@edifice.io/edifice-ent-client-node 6.9.0-develop-pedago.1765184169540 → 6.9.0-develop-pedago.1767943970121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5681 -243
- package/dist/index.umd.cjs +23 -1
- package/dist/nats/client.d.ts +37 -31
- package/dist/nats/client.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
(function(o,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(o=typeof globalThis<"u"?globalThis:o||self,i((o["@edifice"]=o["@edifice"]||{},o["@edifice"]["io/edifice-ent-client-node"]={})))})(this,function(o){"use strict";class i{constructor(r){this.natsConnection=r,console.log("Creating service EntNatsServiceClient")}async addCommunicationLinks(r,t=""){let e="communication.link.users.add";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async addGroupMember(r,t=""){let e="directory.group.member.add";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async addLinkBetweenGroups(r,t=""){let e="communication.link.groups.add";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async checkResourceAccess(r,t,e,s=""){let n="audience.check.right."+t+"."+e;s&&(n="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:n});const d=await this.natsConnection.request(n,JSON.stringify(r));if(!d)throw console.warn("No reply received for subject",{messageAddress:n}),new Error("No reply received");return this.extractResponse(d.json())}async createAndStoreEvent(r,t=""){let e="event.store.create";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async createManualGroup(r,t=""){let e="directory.group.manual.create";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async deleteManualGroup(r,t=""){let e="directory.group.manual.delete";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async fetchTranslations(r,t,e=""){let s="i18n."+t+".fetch";e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async findGroupByExternalId(r,t=""){let e="directory.group.find.byexternalid";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async findSession(r,t=""){let e="session.find";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async getResources(r,t,e=""){let s="resource.get."+t;e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async getUserDisplayNames(r,t=""){let e="directory.users.get.displaynames";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async getUsersByIds(r,t=""){let e="directory.users.get.byids";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async listenAndReplyExample(r,t=""){let e="ent.test.listen.reply";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async listenOnlyExample(r,t=""){let e="ent.test.listen";t&&(e="{platformId}.{eventAddress}"),console.debug("Publishing to NATS subject",{messageAddress:e}),this.natsConnection.publish(e,JSON.stringify(r))}async loadTest(r,t=""){let e="ent.loadtest";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async recreateCommunicationLinks(r,t=""){let e="communication.link.users.recreate";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async refreshSession(r,t=""){let e="session.refresh";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerApp(r,t=""){let e="ent.appregistry.app.register";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerI18nFiles(r,t,e=""){let s="i18n."+t+".register";e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async registerNotification(r,t=""){let e="timeline.notification.register";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerNotifications(r,t=""){let e="timeline.notification.register.batch";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeCommunicationLinks(r,t=""){let e="communication.link.users.remove";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeGroupMember(r,t=""){let e="directory.group.member.delete";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeGroupShares(r,t,e=""){let s="share.group.remove."+t;e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async sendNotification(r,t=""){let e="timeline.notification.send";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateManualGroup(r,t=""){let e="directory.group.manual.update";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateWikiContent(r,t=""){let e="ai.wiki.content.updated";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateWikiStructure(r,t=""){let e="ai.wiki.structure.updated";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async upsertGroupShares(r,t,e=""){let s="share.group.upsert."+t;e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}extractResponse(r){return r.response||r}}o.EntNatsServiceClient=i,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(Te,he){typeof exports=="object"&&typeof module<"u"?he(exports):typeof define=="function"&&define.amd?define(["exports"],he):(Te=typeof globalThis<"u"?globalThis:Te||self,he((Te["@edifice"]=Te["@edifice"]||{},Te["@edifice"]["io/edifice-ent-client-node"]={})))})(this,function(Te){"use strict";var $i=Object.defineProperty;var eo=(Te,he,tt)=>he in Te?$i(Te,he,{enumerable:!0,configurable:!0,writable:!0,value:tt}):Te[he]=tt;var l=(Te,he,tt)=>(eo(Te,typeof he!="symbol"?he+"":he,tt),tt);var he=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tt(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}),r}var Hr={},Vr={},Et={},ye={},ke={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TD=t.TE=t.Empty=void 0,t.encode=r,t.decode=s,t.Empty=new Uint8Array(0),t.TE=new TextEncoder,t.TD=new TextDecoder;function e(...i){let a=0;for(let S=0;S<i.length;S++)a+=i[S].length;const d=new Uint8Array(a);let m=0;for(let S=0;S<i.length;S++)d.set(i[S],m),m+=i[S].length;return d}function r(...i){const a=[];for(let d=0;d<i.length;d++)a.push(t.TE.encode(i[d]));return a.length===0?t.Empty:a.length===1?a[0]:e(...a)}function s(i){return!i||i.length===0?"":t.TD.decode(i)}})(ke);var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.errors=te.PermissionViolationError=te.NoRespondersError=te.TimeoutError=te.RequestError=te.ProtocolError=te.ConnectionError=te.DrainingConnectionError=te.ClosedConnectionError=te.AuthorizationError=te.UserAuthenticationExpiredError=te.InvalidOperationError=te.InvalidArgumentError=te.InvalidSubjectError=void 0;class Yr extends Error{constructor(e,r){super(`illegal subject: '${e}'`,r),this.name="InvalidSubjectError"}}te.InvalidSubjectError=Yr;class Gt extends Error{constructor(e,r){super(e,r),this.name="InvalidArgumentError"}static format(e,r,s){return Array.isArray(r)&&r.length>1&&(r=r[0]),Array.isArray(e)?(e=e.map(i=>`'${i}'`),e=e.join(",")):e=`'${e}'`,new Gt(`${e} ${r}`,s)}}te.InvalidArgumentError=Gt;class Wr extends Error{constructor(e,r){super(e,r),this.name="InvalidOperationError"}}te.InvalidOperationError=Wr;class zt extends Error{constructor(e,r){super(e,r),this.name="UserAuthenticationExpiredError"}static parse(e){return e.toLowerCase().indexOf("user authentication expired")!==-1?new zt(e):null}}te.UserAuthenticationExpiredError=zt;class Jt extends Error{constructor(e,r){super(e,r),this.name="AuthorizationError"}static parse(e){const r=["authorization violation","account authentication expired","authentication timeout"],s=e.toLowerCase();for(let i=0;i<r.length;i++)if(s.indexOf(r[i])!==-1)return new Jt(e);return null}}te.AuthorizationError=Jt;class Xr extends Error{constructor(){super("closed connection"),this.name="ClosedConnectionError"}}te.ClosedConnectionError=Xr;class Zr extends Error{constructor(){super("connection draining"),this.name="DrainingConnectionError"}}te.DrainingConnectionError=Zr;class Qr extends Error{constructor(e,r){super(e,r),this.name="ConnectionError"}}te.ConnectionError=Qr;class $r extends Error{constructor(e,r){super(e,r),this.name="ProtocolError"}}te.ProtocolError=$r;class en extends Error{constructor(e="",r){super(e,r),this.name="RequestError"}isNoResponders(){return this.cause instanceof dr}}te.RequestError=en;class tn extends Error{constructor(e){super("timeout",e),this.name="TimeoutError"}}te.TimeoutError=tn;class dr extends Error{constructor(r,s){super(`no responders: '${r}'`,s);l(this,"subject");this.subject=r,this.name="NoResponders"}}te.NoRespondersError=dr;class Ht extends Error{constructor(r,s,i,a,d){super(r,d);l(this,"operation");l(this,"subject");l(this,"queue");this.name="PermissionViolationError",this.operation=s,this.subject=i,this.queue=a}static parse(r){if((r?r.toLowerCase():"").indexOf("permissions violation")===-1)return null;let i="publish",a="",d;const m=r.match(/(Publish|Subscription) to "(\S+)"/);if(m&&(i=m[1].toLowerCase(),a=m[2],i==="subscription")){const S=r.match(/using queue "(\S+)"/);S&&(d=S[1])}return new Ht(r,i,a,d)}}te.PermissionViolationError=Ht,te.errors={AuthorizationError:Jt,ClosedConnectionError:Xr,ConnectionError:Qr,DrainingConnectionError:Zr,InvalidArgumentError:Gt,InvalidOperationError:Wr,InvalidSubjectError:Yr,NoRespondersError:dr,PermissionViolationError:Ht,ProtocolError:$r,RequestError:en,TimeoutError:tn,UserAuthenticationExpiredError:zt},Object.defineProperty(ye,"__esModule",{value:!0}),ye.SimpleMutex=ye.Perf=void 0,ye.extend=fs,ye.render=us,ye.timeout=hs,ye.delay=ds,ye.deadline=ls,ye.deferred=br,ye.debugDeferred=bs,ye.shuffle=ys,ye.collect=gs,ye.jitter=rn,ye.backoff=vs,ye.nanos=ps,ye.millis=xs;const cs=ke,lr=te;function fs(t,...e){for(let r=0;r<e.length;r++){const s=e[r];Object.keys(s).forEach(function(i){t[i]=s[i]})}return t}function us(t){return cs.TD.decode(t).replace(/\n/g,"␊").replace(/\r/g,"␍")}function hs(t,e=!0){const r=e?new lr.TimeoutError:null;let s,i;const a=new Promise((d,m)=>{s={cancel:()=>{i&&clearTimeout(i)}},i=setTimeout(()=>{m(r===null?new lr.TimeoutError:r)},t)});return Object.assign(a,s)}function ds(t=0){let e;const r=new Promise(s=>{const i=setTimeout(()=>{s()},t);e={cancel:()=>{i&&(clearTimeout(i),s())}}});return Object.assign(r,e)}async function ls(t,e=1e3){const r=br(),s=setTimeout(()=>{r.reject(new lr.TimeoutError)},e);try{return await Promise.race([t,r])}finally{clearTimeout(s)}}function br(){let t={};const e=new Promise((r,s)=>{t={resolve:r,reject:s}});return Object.assign(e,t)}function bs(){let t={};const e=new Promise((r,s)=>{t={resolve:i=>{console.trace("resolve",i),r(i)},reject:i=>{console.trace("reject"),s(i)}}});return Object.assign(e,t)}function ys(t){for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t}async function gs(t){const e=[];for await(const r of t)e.push(r);return e}class ms{constructor(){l(this,"timers");l(this,"measures");this.timers=new Map,this.measures=new Map}mark(e){this.timers.set(e,performance.now())}measure(e,r,s){const i=this.timers.get(r);if(i===void 0)throw new Error(`${r} is not defined`);const a=this.timers.get(s);if(a===void 0)throw new Error(`${s} is not defined`);this.measures.set(e,a-i)}getEntries(){const e=[];return this.measures.forEach((r,s)=>{e.push({name:s,duration:r})}),e}}ye.Perf=ms;class _s{constructor(e=1){l(this,"max");l(this,"current");l(this,"waiting");this.max=e,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();const e=br();return this.waiting.push(e),e}unlock(){this.current--;const e=this.waiting.pop();e==null||e.resolve()}}ye.SimpleMutex=_s;function rn(t){return t===0?0:Math.floor(t/2+Math.random()*t)}function vs(t=[0,250,250,500,500,3e3,5e3]){Array.isArray(t)||(t=[0,250,250,500,500,3e3,5e3]);const e=t.length-1;return{backoff(r){return rn(r>e?t[e]:t[r])}}}function ps(t){return t*1e6}function xs(t){return Math.floor(t/1e6)}var Me={},rt={},Oe={},St={},ft={};Object.defineProperty(ft,"__esModule",{value:!0}),ft.nuid=ft.Nuid=void 0;const nn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",yr=36,Vt=12,ws=10,sn=0xcfd41b9100000,on=33,Es=333,an=Vt+ws;function Ss(t){for(let e=0;e<t.length;e++)t[e]=Math.floor(Math.random()*255)}function Ps(t){var e;(e=globalThis==null?void 0:globalThis.crypto)!=null&&e.getRandomValues?globalThis.crypto.getRandomValues(t):Ss(t)}class cn{constructor(){l(this,"buf");l(this,"seq");l(this,"inc");l(this,"inited");this.buf=new Uint8Array(an),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){this.seq=Math.floor(Math.random()*sn),this.inc=Math.floor(Math.random()*(Es-on)+on)}setPre(){const e=new Uint8Array(Vt);Ps(e);for(let r=0;r<Vt;r++){const s=e[r]%yr;this.buf[r]=nn.charCodeAt(s)}}fillSeq(){let e=this.seq;for(let r=an-1;r>=Vt;r--)this.buf[r]=nn.charCodeAt(e%yr),e=Math.floor(e/yr)}next(){return this.inited||this.init(),this.seq+=this.inc,this.seq>sn&&(this.setPre(),this.initSeqAndInc()),this.fillSeq(),String.fromCharCode.apply(String,this.buf)}reset(){this.init()}}ft.Nuid=cn,ft.nuid=new cn,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.nuid=t.Nuid=void 0;var e=ft;Object.defineProperty(t,"Nuid",{enumerable:!0,get:function(){return e.Nuid}}),Object.defineProperty(t,"nuid",{enumerable:!0,get:function(){return e.nuid}})}(St),Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.DEFAULT_HOST=Oe.DEFAULT_PORT=Oe.Match=void 0,Oe.syncIterator=Cs,Oe.createInbox=js;const As=St,Os=te;Oe.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function Cs(t){const e=t[Symbol.asyncIterator]();return{async next(){const r=await e.next();return r.done?Promise.resolve(null):Promise.resolve(r.value)}}}function js(t=""){if(t=t||"_INBOX",typeof t!="string")throw new TypeError("prefix must be a string");return t.split(".").forEach(e=>{if(e==="*"||e===">")throw Os.InvalidArgumentError.format("prefix",`cannot have wildcards ('${t}')`)}),`${t}.${As.nuid.next()}`}Oe.DEFAULT_PORT=4222,Oe.DEFAULT_HOST="127.0.0.1";var nt={};Object.defineProperty(nt,"__esModule",{value:!0}),nt.DataBuffer=void 0;const fn=ke;class Ns{constructor(){l(this,"buffers");l(this,"byteLength");this.buffers=[],this.byteLength=0}static concat(...e){let r=0;for(let a=0;a<e.length;a++)r+=e[a].length;const s=new Uint8Array(r);let i=0;for(let a=0;a<e.length;a++)s.set(e[a],i),i+=e[a].length;return s}static fromAscii(e){return e||(e=""),fn.TE.encode(e)}static toAscii(e){return fn.TD.decode(e)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){const e=new Uint8Array(this.byteLength);let r=0;for(let s=0;s<this.buffers.length;s++)e.set(this.buffers[s],r),r+=this.buffers[s].length;this.buffers.length=0,this.buffers.push(e)}}shift(){if(this.buffers.length){const e=this.buffers.shift();if(e)return this.byteLength-=e.length,e}return new Uint8Array(0)}drain(e){if(this.buffers.length){this.pack();const r=this.buffers.pop();if(r){const s=this.byteLength;(e===void 0||e>s)&&(e=s);const i=r.subarray(0,e);return s>e&&this.buffers.push(r.subarray(e)),this.byteLength=s-e,i}}return new Uint8Array(0)}fill(e,...r){e&&(this.buffers.push(e),this.byteLength+=e.length);for(let s=0;s<r.length;s++)r[s]&&r[s].length&&(this.buffers.push(r[s]),this.byteLength+=r[s].length)}peek(){return this.buffers.length?(this.pack(),this.buffers[0]):new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}nt.DataBuffer=Ns,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LF=t.CR=t.CRLF=t.CR_LF_LEN=t.CR_LF=void 0,t.setTransportFactory=a,t.defaultPort=d,t.getUrlParseFn=m,t.newTransport=S,t.getResolveFn=_,t.protoLen=w,t.extractProtocolMessage=E;const e=ke,r=Oe,s=nt;let i;function a(b){i=b}function d(){return i!==void 0&&i.defaultPort!==void 0?i.defaultPort:r.DEFAULT_PORT}function m(){return i!==void 0&&i.urlParseFn?i.urlParseFn:void 0}function S(){if(!i||typeof i.factory!="function")throw new Error("transport fn is not set");return i.factory()}function _(){return i!==void 0&&i.dnsResolveFn?i.dnsResolveFn:void 0}t.CR_LF=`\r
|
|
2
|
+
`,t.CR_LF_LEN=t.CR_LF.length,t.CRLF=s.DataBuffer.fromAscii(t.CR_LF),t.CR=new Uint8Array(t.CRLF)[0],t.LF=new Uint8Array(t.CRLF)[1];function w(b){for(let p=0;p<b.length;p++){const R=p+1;if(b.byteLength>R&&b[p]===t.CR&&b[R]===t.LF)return R+1}return 0}function E(b){const p=w(b);if(p>0){const M=new Uint8Array(b).slice(0,p);return e.TD.decode(M)}return""}}(rt);var Ye={},ut={};Object.defineProperty(ut,"__esModule",{value:!0}),ut.ipV4=ln,ut.isIP=Is,ut.parseIP=bn;const Pt=4,st=16,Yt=48,un=57,hn=65,Ms=70,dn=97,Ts=102,gr=16777215;function ln(t,e,r,s){const i=new Uint8Array(st);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((d,m)=>{i[m]=d}),i[12]=t,i[13]=e,i[14]=r,i[15]=s,i}function Is(t){return bn(t)!==void 0}function bn(t){for(let e=0;e<t.length;e++)switch(t[e]){case".":return yn(t);case":":return Rs(t)}}function yn(t){const e=new Uint8Array(Pt);for(let r=0;r<Pt;r++){if(t.length===0)return;if(r>0){if(t[0]!==".")return;t=t.substring(1)}const{n:s,c:i,ok:a}=ks(t);if(!a||s>255)return;t=t.substring(i),e[r]=s}return ln(e[0],e[1],e[2],e[3])}function Rs(t){const e=new Uint8Array(st);let r=-1;if(t.length>=2&&t[0]===":"&&t[1]===":"&&(r=0,t=t.substring(2),t.length===0))return e;let s=0;for(;s<st;){const{n:i,c:a,ok:d}=Us(t);if(!d||i>65535)return;if(a<t.length&&t[a]==="."){if(r<0&&s!=st-Pt||s+Pt>st)return;const m=yn(t);if(m===void 0)return;e[s]=m[12],e[s+1]=m[13],e[s+2]=m[14],e[s+3]=m[15],t="",s+=Pt;break}if(e[s]=i>>8,e[s+1]=i,s+=2,t=t.substring(a),t.length===0)break;if(t[0]!==":"||t.length==1)return;if(t=t.substring(1),t[0]===":"){if(r>=0)return;if(r=s,t=t.substring(1),t.length===0)break}}if(t.length===0){if(s<st){if(r<0)return;const i=st-s;for(let a=s-1;a>=r;a--)e[a+i]=e[a];for(let a=r+i-1;a>=r;a--)e[a]=0}else if(r>=0)return;return e}}function ks(t){let e=0,r=0;for(e=0;e<t.length&&Yt<=t.charCodeAt(e)&&t.charCodeAt(e)<=un;e++)if(r=r*10+(t.charCodeAt(e)-Yt),r>=gr)return{n:gr,c:e,ok:!1};return e===0?{n:0,c:0,ok:!1}:{n:r,c:e,ok:!0}}function Us(t){let e=0,r=0;for(r=0;r<t.length;r++){if(Yt<=t.charCodeAt(r)&&t.charCodeAt(r)<=un)e*=16,e+=t.charCodeAt(r)-Yt;else if(dn<=t.charCodeAt(r)&&t.charCodeAt(r)<=Ts)e*=16,e+=t.charCodeAt(r)-dn+10;else if(hn<=t.charCodeAt(r)&&t.charCodeAt(r)<=Ms)e*=16,e+=t.charCodeAt(r)-hn+10;else break;if(e>=gr)return{n:0,c:r,ok:!1}}return r===0?{n:0,c:r,ok:!1}:{n:e,c:r,ok:!0}}Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.Servers=Ye.ServerImpl=void 0,Ye.isIPV4OrHostname=_n,Ye.hostPort=vn;const Wt=rt,gn=ye,mr=ut,mn=Oe;function _n(t){return t.indexOf("[")!==-1||t.indexOf("::")!==-1?!1:t.indexOf(".")!==-1||t.split(":").length<=2}function _r(t){return!_n(t)}function Ls(t){const e="::FFFF:",r=t.toUpperCase().indexOf(e);if(r!==-1&&t.indexOf(".")!==-1){let s=t.substring(r+e.length);return s=s.replace("[",""),s.replace("]","")}return t}function vn(t){t=t.trim(),t.match(/^(.*:\/\/)(.*)/m)&&(t=t.replace(/^(.*:\/\/)(.*)/gm,"$2")),t=Ls(t),_r(t)&&t.indexOf("[")===-1&&(t=`[${t}]`);const e=_r(t)?t.match(/(]:)(\d+)/):t.match(/(:)(\d+)/),r=e&&e.length===3&&e[1]&&e[2]?parseInt(e[2]):mn.DEFAULT_PORT,s=r===80?"https":"http",i=new URL(`${s}://${t}`);i.port=`${r}`;let a=i.hostname;return a.charAt(0)==="["&&(a=a.substring(1,a.length-1)),{listen:i.host,hostname:a,port:r}}class ht{constructor(e,r=!1){l(this,"src");l(this,"listen");l(this,"hostname");l(this,"port");l(this,"didConnect");l(this,"reconnects");l(this,"lastConnect");l(this,"gossiped");l(this,"tlsName");l(this,"resolves");this.src=e,this.tlsName="";const s=vn(e);this.listen=s.listen,this.hostname=s.hostname,this.port=s.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=r}toString(){return this.listen}async resolve(e){if(!e.fn||e.resolve===!1)return[this];const r=[];if((0,mr.isIP)(this.hostname))return[this];{const s=await e.fn(this.hostname);e.debug&&console.log(`resolve ${this.hostname} = ${s.join(",")}`);for(const i of s){const a=this.port===80?"https":"http",d=new URL(`${a}://${_r(i)?"["+i+"]":i}`);d.port=`${this.port}`;const m=new ht(d.host,!1);m.tlsName=this.hostname,r.push(m)}}return e.randomize&&(0,gn.shuffle)(r),this.resolves=r,r}}Ye.ServerImpl=ht;class qs{constructor(e=[],r={}){l(this,"firstSelect");l(this,"servers");l(this,"currentServer");l(this,"tlsName");l(this,"randomize");this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=r.randomize||!1;const s=(0,Wt.getUrlParseFn)();e&&(e.forEach(i=>{i=s?s(i):i,this.servers.push(new ht(i))}),this.randomize&&(this.servers=(0,gn.shuffle)(this.servers))),this.servers.length===0&&this.addServer(`${mn.DEFAULT_HOST}:${(0,Wt.defaultPort)()}`,!1),this.currentServer=this.servers[0]}clear(){this.servers.length=0}updateTLSName(){const e=this.getCurrentServer();(0,mr.isIP)(e.hostname)||(this.tlsName=e.hostname,this.servers.forEach(r=>{r.gossiped&&(r.tlsName=this.tlsName)}))}getCurrentServer(){return this.currentServer}addServer(e,r=!1){const s=(0,Wt.getUrlParseFn)();e=s?s(e):e;const i=new ht(e,r);(0,mr.isIP)(i.hostname)&&(i.tlsName=this.tlsName),this.servers.push(i)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;const e=this.servers.shift();return e&&(this.servers.push(e),this.currentServer=e),e}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer(e){if(e){const r=this.servers.indexOf(e);this.servers.splice(r,1)}}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update(e,r){const s=[];let i=[];const a=(0,Wt.getUrlParseFn)(),d=new Map;e.connect_urls&&e.connect_urls.length>0&&e.connect_urls.forEach(S=>{S=a?a(S,r):S;const _=new ht(S,!0);d.set(S,_)});const m=[];return this.servers.forEach((S,_)=>{const w=S.listen;S.gossiped&&this.currentServer.listen!==w&&d.get(w)===void 0&&m.push(_),d.delete(w)}),m.reverse(),m.forEach(S=>{const _=this.servers.splice(S,1);i=i.concat(_[0].listen)}),d.forEach((S,_)=>{this.servers.push(S),s.push(_)}),{added:s,deleted:i}}}Ye.Servers=qs;var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.QueuedIteratorImpl=void 0;const vr=ye,pn=te;class Fs{constructor(){l(this,"inflight");l(this,"processed");l(this,"received");l(this,"noIterator");l(this,"iterClosed");l(this,"done");l(this,"signal");l(this,"yields");l(this,"filtered");l(this,"pendingFiltered");l(this,"ctx");l(this,"_data");l(this,"err");l(this,"time");l(this,"profile");l(this,"yielding");l(this,"didBreak");this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=(0,vr.deferred)(),this.yields=[],this.iterClosed=(0,vr.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push(e){if(!this.done){if(this.didBreak){if(typeof e=="function"){const r=e;try{r()}catch{}}return}typeof e=="function"&&this.pendingFiltered++,this.yields.push(e),this.signal.resolve()}}async*iterate(){if(this.noIterator)throw new pn.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new pn.InvalidOperationError("iterator is already yielding");this.yielding=!0;try{for(;;){if(this.yields.length===0&&await this.signal,this.err)throw this.err;const e=this.yields;this.inflight=e.length,this.yields=[];for(let r=0;r<e.length;r++){if(typeof e[r]=="function"){this.pendingFiltered--;const i=e[r];try{i()}catch(a){throw a}if(this.err)throw this.err;continue}this.processed++,this.inflight--;const s=this.profile?Date.now():0;yield e[r],this.time=this.profile?Date.now()-s:0}if(this.done)break;this.yields.length===0&&(e.length=0,this.yields=e,this.signal=(0,vr.deferred)())}}finally{this.didBreak=!0,this.stop()}}stop(e){this.done||(this.err=e,this.done=!0,this.signal.resolve(),this.iterClosed.resolve(e))}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}dt.QueuedIteratorImpl=Fs;var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.MuxSubscription=void 0;const Bs=Oe,xn=te;class Ks{constructor(){l(this,"baseInbox");l(this,"reqs");this.reqs=new Map}size(){return this.reqs.size}init(e){return this.baseInbox=`${(0,Bs.createInbox)(e)}.`,this.baseInbox}add(e){isNaN(e.received)||(e.received=0),this.reqs.set(e.token,e)}get(e){return this.reqs.get(e)}cancel(e){this.reqs.delete(e.token)}getToken(e){const r=e.subject||"";return r.indexOf(this.baseInbox)===0?r.substring(this.baseInbox.length):null}all(){return Array.from(this.reqs.values())}handleError(e,r){if(e)return this.all().forEach(s=>{s.resolver(r,{})}),!0;if(r.operation==="publish"){const s=this.all().find(i=>i.requestSubject===r.subject);if(s)return s.resolver(r,{}),!0}return!1}dispatcher(){return(e,r)=>{var i,a;const s=this.getToken(r);if(s){const d=this.get(s);d&&(e===null&&(e=((i=r==null?void 0:r.data)==null?void 0:i.length)===0&&((a=r.headers)==null?void 0:a.code)===503?new xn.NoRespondersError(d.requestSubject):null),d.resolver(e,r))}}}close(){const e=new xn.RequestError("connection closed");this.reqs.forEach(r=>{r.resolver(e,{})})}}At.MuxSubscription=Ks;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Heartbeat=void 0;const Ds=ye;class Gs{constructor(e,r,s){l(this,"ph");l(this,"interval");l(this,"maxOut");l(this,"timer");l(this,"pendings");this.ph=e,this.interval=r,this.maxOut=s,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel(e){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this._reset(),e&&this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:"ping",pendingPings:this.pendings.length+1}),this.pendings.length===this.maxOut){this.cancel(!0);return}const e=(0,Ds.deferred)();this.ph.flush(e).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push(e),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(e=>(e.resolve(),!1))}}Ot.Heartbeat=Gs;var pr={},xr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DenoBuffer=t.MAX_SIZE=t.AssertionError=void 0,t.assert=s,t.concat=d,t.append=m,t.readAll=_,t.writeAll=w;const e=ke;class r extends Error{constructor(b){super(b),this.name="AssertionError"}}t.AssertionError=r;function s(E,b="Assertion failed."){if(!E)throw new r(b)}const i=32*1024;t.MAX_SIZE=2**32-2;function a(E,b,p=0){const R=b.byteLength-p;return E.byteLength>R&&(E=E.subarray(0,R)),b.set(E,p),E.byteLength}function d(E,b){if(E===void 0&&b===void 0)return new Uint8Array(0);if(E===void 0)return b;if(b===void 0)return E;const p=new Uint8Array(E.length+b.length);return p.set(E,0),p.set(b,E.length),p}function m(E,b){return d(E,Uint8Array.of(b))}class S{constructor(b){l(this,"_buf");l(this,"_off");if(this._off=0,b==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array(b)}bytes(b={copy:!0}){return b.copy===!1?this._buf.subarray(this._off):this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate(b){if(b===0){this.reset();return}if(b<0||b>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+b)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice(b){const p=this._buf.byteLength;return b<=this.capacity-p?(this._reslice(p+b),p):-1}_reslice(b){s(b<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,b)}readByte(){const b=new Uint8Array(1);return this.read(b)?b[0]:null}read(b){if(this.empty())return this.reset(),b.byteLength===0?0:null;const p=a(this._buf.subarray(this._off),b);return this._off+=p,p}writeByte(b){return this.write(Uint8Array.of(b))}writeString(b){return this.write(e.TE.encode(b))}write(b){const p=this._grow(b.byteLength);return a(b,this._buf,p)}_grow(b){const p=this.length;p===0&&this._off!==0&&this.reset();const R=this._tryGrowByReslice(b);if(R>=0)return R;const M=this.capacity;if(b<=Math.floor(M/2)-p)a(this._buf.subarray(this._off),this._buf);else{if(M+b>t.MAX_SIZE)throw new Error("The buffer cannot be grown beyond the maximum size.");{const U=new Uint8Array(Math.min(2*M+b,t.MAX_SIZE));a(this._buf.subarray(this._off),U),this._buf=U}}return this._off=0,this._reslice(Math.min(p+b,t.MAX_SIZE)),p}grow(b){if(b<0)throw Error("Buffer._grow: negative count");const p=this._grow(b);this._reslice(p)}readFrom(b){let p=0;const R=new Uint8Array(i);for(;;){const M=this.capacity-this.length<i,U=M?R:new Uint8Array(this._buf.buffer,this.length),se=b.read(U);if(se===null)return p;M?this.write(U.subarray(0,se)):this._reslice(this.length+se),p+=se}}}t.DenoBuffer=S;function _(E){const b=new S;return b.readFrom(E),b.bytes()}function w(E,b){let p=0;for(;p<b.length;)p+=E.write(b.subarray(p))}})(xr),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.cc=t.State=t.Parser=t.Kind=void 0,t.describe=s;const e=xr,r=ke;t.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function s(S){let _,w="";switch(S.kind){case t.Kind.MSG:_="MSG";break;case t.Kind.OK:_="OK";break;case t.Kind.ERR:_="ERR",w=r.TD.decode(S.data);break;case t.Kind.PING:_="PING";break;case t.Kind.PONG:_="PONG";break;case t.Kind.INFO:_="INFO",w=r.TD.decode(S.data)}return`${_}: ${w}`}function i(){const S={};return S.sid=-1,S.hdr=-1,S.size=-1,S}const a=48,d=57;class m{constructor(_){l(this,"dispatcher");l(this,"state");l(this,"as");l(this,"drop");l(this,"hdr");l(this,"ma");l(this,"argBuf");l(this,"msgBuf");this.dispatcher=_,this.state=t.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse(_){let w;for(w=0;w<_.length;w++){const E=_[w];switch(this.state){case t.State.OP_START:switch(E){case t.cc.M:case t.cc.m:this.state=t.State.OP_M,this.hdr=-1,this.ma=i();break;case t.cc.H:case t.cc.h:this.state=t.State.OP_H,this.hdr=0,this.ma=i();break;case t.cc.P:case t.cc.p:this.state=t.State.OP_P;break;case t.cc.PLUS:this.state=t.State.OP_PLUS;break;case t.cc.MINUS:this.state=t.State.OP_MINUS;break;case t.cc.I:case t.cc.i:this.state=t.State.OP_I;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_H:switch(E){case t.cc.M:case t.cc.m:this.state=t.State.OP_M;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_M:switch(E){case t.cc.S:case t.cc.s:this.state=t.State.OP_MS;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_MS:switch(E){case t.cc.G:case t.cc.g:this.state=t.State.OP_MSG;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_MSG:switch(E){case t.cc.SPACE:case t.cc.TAB:this.state=t.State.OP_MSG_SPC;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_MSG_SPC:switch(E){case t.cc.SPACE:case t.cc.TAB:continue;default:this.state=t.State.MSG_ARG,this.as=w}break;case t.State.MSG_ARG:switch(E){case t.cc.CR:this.drop=1;break;case t.cc.NL:{const b=this.argBuf?this.argBuf.bytes():_.subarray(this.as,w-this.drop);this.processMsgArgs(b),this.drop=0,this.as=w+1,this.state=t.State.MSG_PAYLOAD,w=this.as+this.ma.size-1;break}default:this.argBuf&&this.argBuf.writeByte(E)}break;case t.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){const b=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:t.Kind.MSG,msg:this.ma,data:b}),this.argBuf=void 0,this.msgBuf=void 0,this.state=t.State.MSG_END}else{let b=this.ma.size-this.msgBuf.length;const p=_.length-w;p<b&&(b=p),b>0?(this.msgBuf.write(_.subarray(w,w+b)),w=w+b-1):this.msgBuf.writeByte(E)}else w-this.as>=this.ma.size&&(this.dispatcher.push({kind:t.Kind.MSG,msg:this.ma,data:_.subarray(this.as,w)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=t.State.MSG_END);break;case t.State.MSG_END:switch(E){case t.cc.NL:this.drop=0,this.as=w+1,this.state=t.State.OP_START;break;default:continue}break;case t.State.OP_PLUS:switch(E){case t.cc.O:case t.cc.o:this.state=t.State.OP_PLUS_O;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_PLUS_O:switch(E){case t.cc.K:case t.cc.k:this.state=t.State.OP_PLUS_OK;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_PLUS_OK:switch(E){case t.cc.NL:this.dispatcher.push({kind:t.Kind.OK}),this.drop=0,this.state=t.State.OP_START;break}break;case t.State.OP_MINUS:switch(E){case t.cc.E:case t.cc.e:this.state=t.State.OP_MINUS_E;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_MINUS_E:switch(E){case t.cc.R:case t.cc.r:this.state=t.State.OP_MINUS_ER;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_MINUS_ER:switch(E){case t.cc.R:case t.cc.r:this.state=t.State.OP_MINUS_ERR;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_MINUS_ERR:switch(E){case t.cc.SPACE:case t.cc.TAB:this.state=t.State.OP_MINUS_ERR_SPC;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_MINUS_ERR_SPC:switch(E){case t.cc.SPACE:case t.cc.TAB:continue;default:this.state=t.State.MINUS_ERR_ARG,this.as=w}break;case t.State.MINUS_ERR_ARG:switch(E){case t.cc.CR:this.drop=1;break;case t.cc.NL:{let b;this.argBuf?(b=this.argBuf.bytes(),this.argBuf=void 0):b=_.subarray(this.as,w-this.drop),this.dispatcher.push({kind:t.Kind.ERR,data:b}),this.drop=0,this.as=w+1,this.state=t.State.OP_START;break}default:this.argBuf&&this.argBuf.write(Uint8Array.of(E))}break;case t.State.OP_P:switch(E){case t.cc.I:case t.cc.i:this.state=t.State.OP_PI;break;case t.cc.O:case t.cc.o:this.state=t.State.OP_PO;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_PO:switch(E){case t.cc.N:case t.cc.n:this.state=t.State.OP_PON;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_PON:switch(E){case t.cc.G:case t.cc.g:this.state=t.State.OP_PONG;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_PONG:switch(E){case t.cc.NL:this.dispatcher.push({kind:t.Kind.PONG}),this.drop=0,this.state=t.State.OP_START;break}break;case t.State.OP_PI:switch(E){case t.cc.N:case t.cc.n:this.state=t.State.OP_PIN;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_PIN:switch(E){case t.cc.G:case t.cc.g:this.state=t.State.OP_PING;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_PING:switch(E){case t.cc.NL:this.dispatcher.push({kind:t.Kind.PING}),this.drop=0,this.state=t.State.OP_START;break}break;case t.State.OP_I:switch(E){case t.cc.N:case t.cc.n:this.state=t.State.OP_IN;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_IN:switch(E){case t.cc.F:case t.cc.f:this.state=t.State.OP_INF;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_INF:switch(E){case t.cc.O:case t.cc.o:this.state=t.State.OP_INFO;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_INFO:switch(E){case t.cc.SPACE:case t.cc.TAB:this.state=t.State.OP_INFO_SPC;break;default:throw this.fail(_.subarray(w))}break;case t.State.OP_INFO_SPC:switch(E){case t.cc.SPACE:case t.cc.TAB:continue;default:this.state=t.State.INFO_ARG,this.as=w}break;case t.State.INFO_ARG:switch(E){case t.cc.CR:this.drop=1;break;case t.cc.NL:{let b;this.argBuf?(b=this.argBuf.bytes(),this.argBuf=void 0):b=_.subarray(this.as,w-this.drop),this.dispatcher.push({kind:t.Kind.INFO,data:b}),this.drop=0,this.as=w+1,this.state=t.State.OP_START;break}default:this.argBuf&&this.argBuf.writeByte(E)}break;default:throw this.fail(_.subarray(w))}}(this.state===t.State.MSG_ARG||this.state===t.State.MINUS_ERR_ARG||this.state===t.State.INFO_ARG)&&!this.argBuf&&(this.argBuf=new e.DenoBuffer(_.subarray(this.as,w-this.drop))),this.state===t.State.MSG_PAYLOAD&&!this.msgBuf&&(this.argBuf||this.cloneMsgArg(),this.msgBuf=new e.DenoBuffer(_.subarray(this.as)))}cloneMsgArg(){const _=this.ma.subject.length,w=this.ma.reply?this.ma.reply.length:0,E=new Uint8Array(_+w);E.set(this.ma.subject),this.ma.reply&&E.set(this.ma.reply,_),this.argBuf=new e.DenoBuffer(E),this.ma.subject=E.subarray(0,_),this.ma.reply&&(this.ma.reply=E.subarray(_))}processMsgArgs(_){if(this.hdr>=0)return this.processHeaderMsgArgs(_);const w=[];let E=-1;for(let b=0;b<_.length;b++)switch(_[b]){case t.cc.SPACE:case t.cc.TAB:case t.cc.CR:case t.cc.NL:E>=0&&(w.push(_.subarray(E,b)),E=-1);break;default:E<0&&(E=b)}switch(E>=0&&w.push(_.subarray(E)),w.length){case 3:this.ma.subject=w[0],this.ma.sid=this.protoParseInt(w[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(w[2]);break;case 4:this.ma.subject=w[0],this.ma.sid=this.protoParseInt(w[1]),this.ma.reply=w[2],this.ma.size=this.protoParseInt(w[3]);break;default:throw this.fail(_,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(_,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail(_,"processMsgArgs Bad or Missing Size Error")}fail(_,w=""){return w?w=`${w} [${this.state}]`:w=`parse error [${this.state}]`,new Error(`${w}: ${r.TD.decode(_)}`)}processHeaderMsgArgs(_){const w=[];let E=-1;for(let b=0;b<_.length;b++)switch(_[b]){case t.cc.SPACE:case t.cc.TAB:case t.cc.CR:case t.cc.NL:E>=0&&(w.push(_.subarray(E,b)),E=-1);break;default:E<0&&(E=b)}switch(E>=0&&w.push(_.subarray(E)),w.length){case 4:this.ma.subject=w[0],this.ma.sid=this.protoParseInt(w[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(w[2]),this.ma.size=this.protoParseInt(w[3]);break;case 5:this.ma.subject=w[0],this.ma.sid=this.protoParseInt(w[1]),this.ma.reply=w[2],this.ma.hdr=this.protoParseInt(w[3]),this.ma.size=this.protoParseInt(w[4]);break;default:throw this.fail(_,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(_,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail(_,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail(_,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt(_){if(_.length===0)return-1;let w=0;for(let E=0;E<_.length;E++){if(_[E]<a||_[E]>d)return-1;w=w*10+(_[E]-a)}return w}}t.Parser=m,t.State={OP_START:0,OP_PLUS:1,OP_PLUS_O:2,OP_PLUS_OK:3,OP_MINUS:4,OP_MINUS_E:5,OP_MINUS_ER:6,OP_MINUS_ERR:7,OP_MINUS_ERR_SPC:8,MINUS_ERR_ARG:9,OP_M:10,OP_MS:11,OP_MSG:12,OP_MSG_SPC:13,MSG_ARG:14,MSG_PAYLOAD:15,MSG_END:16,OP_H:17,OP_P:18,OP_PI:19,OP_PIN:20,OP_PING:21,OP_PO:22,OP_PON:23,OP_PONG:24,OP_I:25,OP_IN:26,OP_INF:27,OP_INFO:28,OP_INFO_SPC:29,INFO_ARG:30},t.cc={CR:13,E:69,e:101,F:70,f:102,G:71,g:103,H:72,h:104,I:73,i:105,K:75,k:107,M:77,m:109,MINUS:45,N:78,n:110,NL:10,O:79,o:111,P:80,p:112,PLUS:43,R:82,r:114,S:83,s:115,SPACE:32,TAB:9}}(pr);var Ct={},$e={};Object.defineProperty($e,"__esModule",{value:!0}),$e.MsgHdrsImpl=void 0,$e.canonicalMIMEHeaderKey=Er,$e.headers=zs;const wn=ke,Be=Oe,wr=te;function Er(t){let w=!0;const E=new Array(t.length);for(let b=0;b<t.length;b++){let p=t.charCodeAt(b);if(p===58||p<33||p>126)throw wr.InvalidArgumentError.format("header",`'${t[b]}' is not a valid character in a header name`);w&&97<=p&&p<=122?p-=32:!w&&65<=p&&p<=90&&(p+=32),E[b]=p,w=p==45}return String.fromCharCode(...E)}function zs(t=0,e=""){if(t===0&&e!==""||t>0&&e==="")throw wr.InvalidArgumentError.format("description","is required");return new lt(t,e)}const Sr="NATS/1.0";class lt{constructor(e=0,r=""){l(this,"_code");l(this,"headers");l(this,"_description");this._code=e,this._description=r,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(e){if(e&&this.headers.size===e.headers.size&&this._code===e._code){for(const[r,s]of this.headers){const i=e.values(r);if(s.length!==i.length)return!1;const a=[...s].sort(),d=[...i].sort();for(let m=0;m<a.length;m++)if(a[m]!==d[m])return!1}return!0}return!1}static decode(e){const r=new lt,i=wn.TD.decode(e).split(`\r
|
|
3
|
+
`),a=i[0];if(a!==Sr){let d=a.replace(Sr,"").trim();if(d.length>0){r._code=parseInt(d,10),isNaN(r._code)&&(r._code=0);const m=r._code.toString();d=d.replace(m,""),r._description=d.trim()}}return i.length>=1&&i.slice(1).map(d=>{if(d){const m=d.indexOf(":");if(m>-1){const S=d.slice(0,m),_=d.slice(m+1).trim();r.append(S,_)}}}),r}toString(){if(this.headers.size===0&&this._code===0)return"";let e=Sr;this._code>0&&this._description!==""&&(e+=` ${this._code} ${this._description}`);for(const[r,s]of this.headers)for(let i=0;i<s.length;i++)e=`${e}\r
|
|
4
|
+
${r}: ${s[i]}`;return`${e}\r
|
|
5
|
+
\r
|
|
6
|
+
`}encode(){return wn.TE.encode(this.toString())}static validHeaderValue(e){if(/[\r\n]/.test(e))throw wr.InvalidArgumentError.format("header","values cannot contain \\r or \\n");return e.trim()}keys(){const e=[];for(const r of this.headers.keys())e.push(r);return e}findKeys(e,r=Be.Match.Exact){const s=this.keys();switch(r){case Be.Match.Exact:return s.filter(i=>i===e);case Be.Match.CanonicalMIME:return e=Er(e),s.filter(i=>i===e);default:{const i=e.toLowerCase();return s.filter(a=>i===a.toLowerCase())}}}get(e,r=Be.Match.Exact){const s=this.findKeys(e,r);if(s.length){const i=this.headers.get(s[0]);if(i)return Array.isArray(i)?i[0]:i}return""}last(e,r=Be.Match.Exact){const s=this.findKeys(e,r);if(s.length){const i=this.headers.get(s[0]);if(i)return Array.isArray(i)?i[i.length-1]:i}return""}has(e,r=Be.Match.Exact){return this.findKeys(e,r).length>0}set(e,r,s=Be.Match.Exact){this.delete(e,s),this.append(e,r,s)}append(e,r,s=Be.Match.Exact){const i=Er(e);s===Be.Match.CanonicalMIME&&(e=i);const a=this.findKeys(e,s);e=a.length>0?a[0]:e;const d=lt.validHeaderValue(r);let m=this.headers.get(e);m||(m=[],this.headers.set(e,m)),m.push(d)}values(e,r=Be.Match.Exact){const s=[];return this.findKeys(e,r).forEach(a=>{const d=this.headers.get(a);d&&s.push(...d)}),s}delete(e,r=Be.Match.Exact){this.findKeys(e,r).forEach(i=>{this.headers.delete(i)})}get hasError(){return this._code>=300}get status(){return`${this._code} ${this._description}`.trim()}toRecord(){const e={};return this.keys().forEach(r=>{e[r]=this.values(r)}),e}get code(){return this._code}get description(){return this._description}static fromRecord(e){const r=new lt;for(const s in e)r.headers.set(s,e[s]);return r}}$e.MsgHdrsImpl=lt,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.MsgImpl=void 0;const Js=$e,Xt=ke;class Hs{constructor(e,r,s){l(this,"_headers");l(this,"_msg");l(this,"_rdata");l(this,"_reply");l(this,"_subject");l(this,"publisher");this._msg=e,this._rdata=r,this.publisher=s}get subject(){return this._subject?this._subject:(this._subject=Xt.TD.decode(this._msg.subject),this._subject)}get reply(){return this._reply?this._reply:(this._reply=Xt.TD.decode(this._msg.reply),this._reply)}get sid(){return this._msg.sid}get headers(){if(this._msg.hdr>-1&&!this._headers){const e=this._rdata.subarray(0,this._msg.hdr);this._headers=Js.MsgHdrsImpl.decode(e)}return this._headers}get data(){return this._rdata?this._msg.hdr>-1?this._rdata.subarray(this._msg.hdr):this._rdata:new Uint8Array(0)}respond(e=Xt.Empty,r){return this.reply?(this.publisher.publish(this.reply,e,r),!0):!1}size(){var i;const e=this._msg.subject.length,r=((i=this._msg.reply)==null?void 0:i.length)||0,s=this._msg.size===-1?0:this._msg.size;return e+r+s}json(e){return JSON.parse(this.string(),e)}string(){return Xt.TD.decode(this.data)}requestInfo(){var r;const e=(r=this.headers)==null?void 0:r.get("Nats-Request-Info");return e?JSON.parse(e,function(s,i){return(s==="start"||s==="stop")&&i!==""?new Date(Date.parse(i)):i}):null}}Ct.MsgImpl=Hs;var Zt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Features=t.Feature=void 0,t.parseSemVer=e,t.compare=r;function e(i=""){const a=i.match(/(\d+).(\d+).(\d+)/);if(a)return{major:parseInt(a[1]),minor:parseInt(a[2]),micro:parseInt(a[3])};throw new Error(`'${i}' is not a semver value`)}function r(i,a){return i.major<a.major?-1:i.major>a.major?1:i.minor<a.minor?-1:i.minor>a.minor?1:i.micro<a.micro?-1:i.micro>a.micro?1:0}t.Feature={JS_KV:"js_kv",JS_OBJECTSTORE:"js_objectstore",JS_PULL_MAX_BYTES:"js_pull_max_bytes",JS_NEW_CONSUMER_CREATE_API:"js_new_consumer_create",JS_ALLOW_DIRECT:"js_allow_direct",JS_MULTIPLE_CONSUMER_FILTER:"js_multiple_consumer_filter",JS_SIMPLIFICATION:"js_simplification",JS_STREAM_CONSUMER_METADATA:"js_stream_consumer_metadata",JS_CONSUMER_FILTER_SUBJECTS:"js_consumer_filter_subjects",JS_STREAM_FIRST_SEQ:"js_stream_first_seq",JS_STREAM_SUBJECT_TRANSFORM:"js_stream_subject_transform",JS_STREAM_SOURCE_SUBJECT_TRANSFORM:"js_stream_source_subject_transform",JS_STREAM_COMPRESSION:"js_stream_compression",JS_DEFAULT_CONSUMER_LIMITS:"js_default_consumer_limits",JS_BATCH_DIRECT_GET:"js_batch_direct_get",JS_PRIORITY_GROUPS:"js_priority_groups"};class s{constructor(a){l(this,"server");l(this,"features");l(this,"disabled");this.features=new Map,this.disabled=[],this.update(a)}resetDisabled(){this.disabled.length=0,this.update(this.server)}disable(a){this.disabled.push(a),this.update(this.server)}isDisabled(a){return this.disabled.indexOf(a)!==-1}update(a){typeof a=="string"&&(a=e(a)),this.server=a,this.set(t.Feature.JS_KV,"2.6.2"),this.set(t.Feature.JS_OBJECTSTORE,"2.6.3"),this.set(t.Feature.JS_PULL_MAX_BYTES,"2.8.3"),this.set(t.Feature.JS_NEW_CONSUMER_CREATE_API,"2.9.0"),this.set(t.Feature.JS_ALLOW_DIRECT,"2.9.0"),this.set(t.Feature.JS_MULTIPLE_CONSUMER_FILTER,"2.10.0"),this.set(t.Feature.JS_SIMPLIFICATION,"2.9.4"),this.set(t.Feature.JS_STREAM_CONSUMER_METADATA,"2.10.0"),this.set(t.Feature.JS_CONSUMER_FILTER_SUBJECTS,"2.10.0"),this.set(t.Feature.JS_STREAM_FIRST_SEQ,"2.10.0"),this.set(t.Feature.JS_STREAM_SUBJECT_TRANSFORM,"2.10.0"),this.set(t.Feature.JS_STREAM_SOURCE_SUBJECT_TRANSFORM,"2.10.0"),this.set(t.Feature.JS_STREAM_COMPRESSION,"2.10.0"),this.set(t.Feature.JS_DEFAULT_CONSUMER_LIMITS,"2.10.0"),this.set(t.Feature.JS_BATCH_DIRECT_GET,"2.11.0"),this.set(t.Feature.JS_PRIORITY_GROUPS,"2.11.0"),this.disabled.forEach(d=>{this.features.delete(d)})}set(a,d){this.features.set(a,{min:d,ok:r(this.server,e(d))>=0})}get(a){return this.features.get(a)||{min:"unknown",ok:!1}}supports(a){var d;return((d=this.get(a))==null?void 0:d.ok)||!1}require(a){return typeof a=="string"&&(a=e(a)),r(this.server,a)>=0}}t.Features=s})(Zt);var jt={},Ge={},Nt={},En={},pe={},Mt={},Tt={},It={};Object.defineProperty(It,"__esModule",{value:!0}),It.crc16=void 0;const Vs=new Uint16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);class Pr{static checksum(e){let r=0;for(let s=0;s<e.byteLength;s++){const i=e[s];r=r<<8&65535^Vs[(r>>8^i)&255]}return r}static validate(e,r){return Pr.checksum(e)==r}}It.crc16=Pr;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.base32=void 0;const Ar="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";class Ys{static encode(e){let r=0,s=0;const i=new Uint8Array(e),a=new Uint8Array(e.byteLength*2);let d=0;for(let m=0;m<i.byteLength;m++)for(s=s<<8|i[m],r+=8;r>=5;){const S=s>>>r-5&31;a[d++]=Ar.charAt(S).charCodeAt(0),r-=5}if(r>0){const m=s<<5-r&31;a[d++]=Ar.charAt(m).charCodeAt(0)}return a.slice(0,d)}static decode(e){let r=0,s=0,i=0;const a=new Uint8Array(e),d=new Uint8Array(a.byteLength*5/8|0);for(let m=0;m<a.byteLength;m++){const S=String.fromCharCode(a[m]),_=Ar.indexOf(S);if(_===-1)throw new Error("Illegal Base32 character: "+a[m]);s=s<<5|_,r+=5,r>=8&&(d[i++]=s>>>r-8&255,r-=8)}return d.slice(0,i)}}Rt.base32=Ys;var Sn;function Qt(){if(Sn)return Tt;Sn=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Codec=void 0;const t=It,e=yt(),r=Rt;class s{static encode(a,d){if(!d||!(d instanceof Uint8Array))throw new e.NKeysError(e.NKeysErrorCode.SerializationError);if(!e.Prefixes.isValidPrefix(a))throw new e.NKeysError(e.NKeysErrorCode.InvalidPrefixByte);return s._encode(!1,a,d)}static encodeSeed(a,d){if(!d)throw new e.NKeysError(e.NKeysErrorCode.ApiError);if(!e.Prefixes.isValidPublicPrefix(a))throw new e.NKeysError(e.NKeysErrorCode.InvalidPrefixByte);if(d.byteLength!==32)throw new e.NKeysError(e.NKeysErrorCode.InvalidSeedLen);return s._encode(!0,a,d)}static decode(a,d){if(!e.Prefixes.isValidPrefix(a))throw new e.NKeysError(e.NKeysErrorCode.InvalidPrefixByte);const m=s._decode(d);if(m[0]!==a)throw new e.NKeysError(e.NKeysErrorCode.InvalidPrefixByte);return m.slice(1)}static decodeSeed(a){const d=s._decode(a),m=s._decodePrefix(d);if(m[0]!=e.Prefix.Seed)throw new e.NKeysError(e.NKeysErrorCode.InvalidSeed);if(!e.Prefixes.isValidPublicPrefix(m[1]))throw new e.NKeysError(e.NKeysErrorCode.InvalidPrefixByte);return{buf:d.slice(2),prefix:m[1]}}static _encode(a,d,m){const S=a?2:1,_=m.byteLength,E=S+_+2,b=S+_,p=new Uint8Array(E);if(a){const U=s._encodePrefix(e.Prefix.Seed,d);p.set(U)}else p[0]=d;p.set(m,S);const R=t.crc16.checksum(p.slice(0,b));return new DataView(p.buffer).setUint16(b,R,!0),r.base32.encode(p)}static _decode(a){if(a.byteLength<4)throw new e.NKeysError(e.NKeysErrorCode.InvalidEncoding);let d;try{d=r.base32.decode(a)}catch(E){throw new e.NKeysError(e.NKeysErrorCode.InvalidEncoding,{cause:E})}const m=d.byteLength-2,_=new DataView(d.buffer).getUint16(m,!0),w=d.slice(0,m);if(!t.crc16.validate(w,_))throw new e.NKeysError(e.NKeysErrorCode.InvalidChecksum);return w}static _encodePrefix(a,d){const m=a|d>>5,S=(d&31)<<3;return new Uint8Array([m,S])}static _decodePrefix(a){const d=a[0]&248,m=(a[0]&7)<<5|(a[1]&248)>>3;return new Uint8Array([d,m])}}return Tt.Codec=s,Tt}var bt={};function Ws(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Pn={exports:{}};const Xs=tt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(t){(function(e){var r=function(o){var f,c=new Float64Array(16);if(o)for(f=0;f<o.length;f++)c[f]=o[f];return c},s=function(){throw new Error("no PRNG")},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var d=r(),m=r([1]),S=r([56129,1]),_=r([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),w=r([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),E=r([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),b=r([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function R(o,f,c,n){o[f]=c>>24&255,o[f+1]=c>>16&255,o[f+2]=c>>8&255,o[f+3]=c&255,o[f+4]=n>>24&255,o[f+5]=n>>16&255,o[f+6]=n>>8&255,o[f+7]=n&255}function M(o,f,c,n,u){var y,g=0;for(y=0;y<u;y++)g|=o[f+y]^c[n+y];return(1&g-1>>>8)-1}function U(o,f,c,n){return M(o,f,c,n,16)}function se(o,f,c,n){return M(o,f,c,n,32)}function ge(o,f,c,n){for(var u=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,y=c[0]&255|(c[1]&255)<<8|(c[2]&255)<<16|(c[3]&255)<<24,g=c[4]&255|(c[5]&255)<<8|(c[6]&255)<<16|(c[7]&255)<<24,A=c[8]&255|(c[9]&255)<<8|(c[10]&255)<<16|(c[11]&255)<<24,N=c[12]&255|(c[13]&255)<<8|(c[14]&255)<<16|(c[15]&255)<<24,D=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,I=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,ce=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,q=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,J=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,H=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,Z=c[16]&255|(c[17]&255)<<8|(c[18]&255)<<16|(c[19]&255)<<24,X=c[20]&255|(c[21]&255)<<8|(c[22]&255)<<16|(c[23]&255)<<24,V=c[24]&255|(c[25]&255)<<8|(c[26]&255)<<16|(c[27]&255)<<24,W=c[28]&255|(c[29]&255)<<8|(c[30]&255)<<16|(c[31]&255)<<24,Y=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,F=u,G=y,k=g,B=A,K=N,T=D,v=I,x=ce,C=q,P=J,O=H,j=Z,z=X,Q=V,ee=W,$=Y,h,ne=0;ne<20;ne+=2)h=F+z|0,K^=h<<7|h>>>25,h=K+F|0,C^=h<<9|h>>>23,h=C+K|0,z^=h<<13|h>>>19,h=z+C|0,F^=h<<18|h>>>14,h=T+G|0,P^=h<<7|h>>>25,h=P+T|0,Q^=h<<9|h>>>23,h=Q+P|0,G^=h<<13|h>>>19,h=G+Q|0,T^=h<<18|h>>>14,h=O+v|0,ee^=h<<7|h>>>25,h=ee+O|0,k^=h<<9|h>>>23,h=k+ee|0,v^=h<<13|h>>>19,h=v+k|0,O^=h<<18|h>>>14,h=$+j|0,B^=h<<7|h>>>25,h=B+$|0,x^=h<<9|h>>>23,h=x+B|0,j^=h<<13|h>>>19,h=j+x|0,$^=h<<18|h>>>14,h=F+B|0,G^=h<<7|h>>>25,h=G+F|0,k^=h<<9|h>>>23,h=k+G|0,B^=h<<13|h>>>19,h=B+k|0,F^=h<<18|h>>>14,h=T+K|0,v^=h<<7|h>>>25,h=v+T|0,x^=h<<9|h>>>23,h=x+v|0,K^=h<<13|h>>>19,h=K+x|0,T^=h<<18|h>>>14,h=O+P|0,j^=h<<7|h>>>25,h=j+O|0,C^=h<<9|h>>>23,h=C+j|0,P^=h<<13|h>>>19,h=P+C|0,O^=h<<18|h>>>14,h=$+ee|0,z^=h<<7|h>>>25,h=z+$|0,Q^=h<<9|h>>>23,h=Q+z|0,ee^=h<<13|h>>>19,h=ee+Q|0,$^=h<<18|h>>>14;F=F+u|0,G=G+y|0,k=k+g|0,B=B+A|0,K=K+N|0,T=T+D|0,v=v+I|0,x=x+ce|0,C=C+q|0,P=P+J|0,O=O+H|0,j=j+Z|0,z=z+X|0,Q=Q+V|0,ee=ee+W|0,$=$+Y|0,o[0]=F>>>0&255,o[1]=F>>>8&255,o[2]=F>>>16&255,o[3]=F>>>24&255,o[4]=G>>>0&255,o[5]=G>>>8&255,o[6]=G>>>16&255,o[7]=G>>>24&255,o[8]=k>>>0&255,o[9]=k>>>8&255,o[10]=k>>>16&255,o[11]=k>>>24&255,o[12]=B>>>0&255,o[13]=B>>>8&255,o[14]=B>>>16&255,o[15]=B>>>24&255,o[16]=K>>>0&255,o[17]=K>>>8&255,o[18]=K>>>16&255,o[19]=K>>>24&255,o[20]=T>>>0&255,o[21]=T>>>8&255,o[22]=T>>>16&255,o[23]=T>>>24&255,o[24]=v>>>0&255,o[25]=v>>>8&255,o[26]=v>>>16&255,o[27]=v>>>24&255,o[28]=x>>>0&255,o[29]=x>>>8&255,o[30]=x>>>16&255,o[31]=x>>>24&255,o[32]=C>>>0&255,o[33]=C>>>8&255,o[34]=C>>>16&255,o[35]=C>>>24&255,o[36]=P>>>0&255,o[37]=P>>>8&255,o[38]=P>>>16&255,o[39]=P>>>24&255,o[40]=O>>>0&255,o[41]=O>>>8&255,o[42]=O>>>16&255,o[43]=O>>>24&255,o[44]=j>>>0&255,o[45]=j>>>8&255,o[46]=j>>>16&255,o[47]=j>>>24&255,o[48]=z>>>0&255,o[49]=z>>>8&255,o[50]=z>>>16&255,o[51]=z>>>24&255,o[52]=Q>>>0&255,o[53]=Q>>>8&255,o[54]=Q>>>16&255,o[55]=Q>>>24&255,o[56]=ee>>>0&255,o[57]=ee>>>8&255,o[58]=ee>>>16&255,o[59]=ee>>>24&255,o[60]=$>>>0&255,o[61]=$>>>8&255,o[62]=$>>>16&255,o[63]=$>>>24&255}function qe(o,f,c,n){for(var u=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,y=c[0]&255|(c[1]&255)<<8|(c[2]&255)<<16|(c[3]&255)<<24,g=c[4]&255|(c[5]&255)<<8|(c[6]&255)<<16|(c[7]&255)<<24,A=c[8]&255|(c[9]&255)<<8|(c[10]&255)<<16|(c[11]&255)<<24,N=c[12]&255|(c[13]&255)<<8|(c[14]&255)<<16|(c[15]&255)<<24,D=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,I=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,ce=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,q=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,J=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,H=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,Z=c[16]&255|(c[17]&255)<<8|(c[18]&255)<<16|(c[19]&255)<<24,X=c[20]&255|(c[21]&255)<<8|(c[22]&255)<<16|(c[23]&255)<<24,V=c[24]&255|(c[25]&255)<<8|(c[26]&255)<<16|(c[27]&255)<<24,W=c[28]&255|(c[29]&255)<<8|(c[30]&255)<<16|(c[31]&255)<<24,Y=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,F=u,G=y,k=g,B=A,K=N,T=D,v=I,x=ce,C=q,P=J,O=H,j=Z,z=X,Q=V,ee=W,$=Y,h,ne=0;ne<20;ne+=2)h=F+z|0,K^=h<<7|h>>>25,h=K+F|0,C^=h<<9|h>>>23,h=C+K|0,z^=h<<13|h>>>19,h=z+C|0,F^=h<<18|h>>>14,h=T+G|0,P^=h<<7|h>>>25,h=P+T|0,Q^=h<<9|h>>>23,h=Q+P|0,G^=h<<13|h>>>19,h=G+Q|0,T^=h<<18|h>>>14,h=O+v|0,ee^=h<<7|h>>>25,h=ee+O|0,k^=h<<9|h>>>23,h=k+ee|0,v^=h<<13|h>>>19,h=v+k|0,O^=h<<18|h>>>14,h=$+j|0,B^=h<<7|h>>>25,h=B+$|0,x^=h<<9|h>>>23,h=x+B|0,j^=h<<13|h>>>19,h=j+x|0,$^=h<<18|h>>>14,h=F+B|0,G^=h<<7|h>>>25,h=G+F|0,k^=h<<9|h>>>23,h=k+G|0,B^=h<<13|h>>>19,h=B+k|0,F^=h<<18|h>>>14,h=T+K|0,v^=h<<7|h>>>25,h=v+T|0,x^=h<<9|h>>>23,h=x+v|0,K^=h<<13|h>>>19,h=K+x|0,T^=h<<18|h>>>14,h=O+P|0,j^=h<<7|h>>>25,h=j+O|0,C^=h<<9|h>>>23,h=C+j|0,P^=h<<13|h>>>19,h=P+C|0,O^=h<<18|h>>>14,h=$+ee|0,z^=h<<7|h>>>25,h=z+$|0,Q^=h<<9|h>>>23,h=Q+z|0,ee^=h<<13|h>>>19,h=ee+Q|0,$^=h<<18|h>>>14;o[0]=F>>>0&255,o[1]=F>>>8&255,o[2]=F>>>16&255,o[3]=F>>>24&255,o[4]=T>>>0&255,o[5]=T>>>8&255,o[6]=T>>>16&255,o[7]=T>>>24&255,o[8]=O>>>0&255,o[9]=O>>>8&255,o[10]=O>>>16&255,o[11]=O>>>24&255,o[12]=$>>>0&255,o[13]=$>>>8&255,o[14]=$>>>16&255,o[15]=$>>>24&255,o[16]=v>>>0&255,o[17]=v>>>8&255,o[18]=v>>>16&255,o[19]=v>>>24&255,o[20]=x>>>0&255,o[21]=x>>>8&255,o[22]=x>>>16&255,o[23]=x>>>24&255,o[24]=C>>>0&255,o[25]=C>>>8&255,o[26]=C>>>16&255,o[27]=C>>>24&255,o[28]=P>>>0&255,o[29]=P>>>8&255,o[30]=P>>>16&255,o[31]=P>>>24&255}function L(o,f,c,n){ge(o,f,c,n)}function de(o,f,c,n){qe(o,f,c,n)}var le=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function He(o,f,c,n,u,y,g){var A=new Uint8Array(16),N=new Uint8Array(64),D,I;for(I=0;I<16;I++)A[I]=0;for(I=0;I<8;I++)A[I]=y[I];for(;u>=64;){for(L(N,A,g,le),I=0;I<64;I++)o[f+I]=c[n+I]^N[I];for(D=1,I=8;I<16;I++)D=D+(A[I]&255)|0,A[I]=D&255,D>>>=8;u-=64,f+=64,n+=64}if(u>0)for(L(N,A,g,le),I=0;I<u;I++)o[f+I]=c[n+I]^N[I];return 0}function Lt(o,f,c,n,u){var y=new Uint8Array(16),g=new Uint8Array(64),A,N;for(N=0;N<16;N++)y[N]=0;for(N=0;N<8;N++)y[N]=n[N];for(;c>=64;){for(L(g,y,u,le),N=0;N<64;N++)o[f+N]=g[N];for(A=1,N=8;N<16;N++)A=A+(y[N]&255)|0,y[N]=A&255,A>>>=8;c-=64,f+=64}if(c>0)for(L(g,y,u,le),N=0;N<c;N++)o[f+N]=g[N];return 0}function mt(o,f,c,n,u){var y=new Uint8Array(32);de(y,n,u,le);for(var g=new Uint8Array(8),A=0;A<8;A++)g[A]=n[A+16];return Lt(o,f,c,g,y)}function _t(o,f,c,n,u,y,g){var A=new Uint8Array(32);de(A,y,g,le);for(var N=new Uint8Array(8),D=0;D<8;D++)N[D]=y[D+16];return He(o,f,c,n,u,N,A)}var vt=function(o){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var f,c,n,u,y,g,A,N;f=o[0]&255|(o[1]&255)<<8,this.r[0]=f&8191,c=o[2]&255|(o[3]&255)<<8,this.r[1]=(f>>>13|c<<3)&8191,n=o[4]&255|(o[5]&255)<<8,this.r[2]=(c>>>10|n<<6)&7939,u=o[6]&255|(o[7]&255)<<8,this.r[3]=(n>>>7|u<<9)&8191,y=o[8]&255|(o[9]&255)<<8,this.r[4]=(u>>>4|y<<12)&255,this.r[5]=y>>>1&8190,g=o[10]&255|(o[11]&255)<<8,this.r[6]=(y>>>14|g<<2)&8191,A=o[12]&255|(o[13]&255)<<8,this.r[7]=(g>>>11|A<<5)&8065,N=o[14]&255|(o[15]&255)<<8,this.r[8]=(A>>>8|N<<8)&8191,this.r[9]=N>>>5&127,this.pad[0]=o[16]&255|(o[17]&255)<<8,this.pad[1]=o[18]&255|(o[19]&255)<<8,this.pad[2]=o[20]&255|(o[21]&255)<<8,this.pad[3]=o[22]&255|(o[23]&255)<<8,this.pad[4]=o[24]&255|(o[25]&255)<<8,this.pad[5]=o[26]&255|(o[27]&255)<<8,this.pad[6]=o[28]&255|(o[29]&255)<<8,this.pad[7]=o[30]&255|(o[31]&255)<<8};vt.prototype.blocks=function(o,f,c){for(var n=this.fin?0:2048,u,y,g,A,N,D,I,ce,q,J,H,Z,X,V,W,Y,F,G,k,B=this.h[0],K=this.h[1],T=this.h[2],v=this.h[3],x=this.h[4],C=this.h[5],P=this.h[6],O=this.h[7],j=this.h[8],z=this.h[9],Q=this.r[0],ee=this.r[1],$=this.r[2],h=this.r[3],ne=this.r[4],fe=this.r[5],ue=this.r[6],re=this.r[7],oe=this.r[8],ae=this.r[9];c>=16;)u=o[f+0]&255|(o[f+1]&255)<<8,B+=u&8191,y=o[f+2]&255|(o[f+3]&255)<<8,K+=(u>>>13|y<<3)&8191,g=o[f+4]&255|(o[f+5]&255)<<8,T+=(y>>>10|g<<6)&8191,A=o[f+6]&255|(o[f+7]&255)<<8,v+=(g>>>7|A<<9)&8191,N=o[f+8]&255|(o[f+9]&255)<<8,x+=(A>>>4|N<<12)&8191,C+=N>>>1&8191,D=o[f+10]&255|(o[f+11]&255)<<8,P+=(N>>>14|D<<2)&8191,I=o[f+12]&255|(o[f+13]&255)<<8,O+=(D>>>11|I<<5)&8191,ce=o[f+14]&255|(o[f+15]&255)<<8,j+=(I>>>8|ce<<8)&8191,z+=ce>>>5|n,q=0,J=q,J+=B*Q,J+=K*(5*ae),J+=T*(5*oe),J+=v*(5*re),J+=x*(5*ue),q=J>>>13,J&=8191,J+=C*(5*fe),J+=P*(5*ne),J+=O*(5*h),J+=j*(5*$),J+=z*(5*ee),q+=J>>>13,J&=8191,H=q,H+=B*ee,H+=K*Q,H+=T*(5*ae),H+=v*(5*oe),H+=x*(5*re),q=H>>>13,H&=8191,H+=C*(5*ue),H+=P*(5*fe),H+=O*(5*ne),H+=j*(5*h),H+=z*(5*$),q+=H>>>13,H&=8191,Z=q,Z+=B*$,Z+=K*ee,Z+=T*Q,Z+=v*(5*ae),Z+=x*(5*oe),q=Z>>>13,Z&=8191,Z+=C*(5*re),Z+=P*(5*ue),Z+=O*(5*fe),Z+=j*(5*ne),Z+=z*(5*h),q+=Z>>>13,Z&=8191,X=q,X+=B*h,X+=K*$,X+=T*ee,X+=v*Q,X+=x*(5*ae),q=X>>>13,X&=8191,X+=C*(5*oe),X+=P*(5*re),X+=O*(5*ue),X+=j*(5*fe),X+=z*(5*ne),q+=X>>>13,X&=8191,V=q,V+=B*ne,V+=K*h,V+=T*$,V+=v*ee,V+=x*Q,q=V>>>13,V&=8191,V+=C*(5*ae),V+=P*(5*oe),V+=O*(5*re),V+=j*(5*ue),V+=z*(5*fe),q+=V>>>13,V&=8191,W=q,W+=B*fe,W+=K*ne,W+=T*h,W+=v*$,W+=x*ee,q=W>>>13,W&=8191,W+=C*Q,W+=P*(5*ae),W+=O*(5*oe),W+=j*(5*re),W+=z*(5*ue),q+=W>>>13,W&=8191,Y=q,Y+=B*ue,Y+=K*fe,Y+=T*ne,Y+=v*h,Y+=x*$,q=Y>>>13,Y&=8191,Y+=C*ee,Y+=P*Q,Y+=O*(5*ae),Y+=j*(5*oe),Y+=z*(5*re),q+=Y>>>13,Y&=8191,F=q,F+=B*re,F+=K*ue,F+=T*fe,F+=v*ne,F+=x*h,q=F>>>13,F&=8191,F+=C*$,F+=P*ee,F+=O*Q,F+=j*(5*ae),F+=z*(5*oe),q+=F>>>13,F&=8191,G=q,G+=B*oe,G+=K*re,G+=T*ue,G+=v*fe,G+=x*ne,q=G>>>13,G&=8191,G+=C*h,G+=P*$,G+=O*ee,G+=j*Q,G+=z*(5*ae),q+=G>>>13,G&=8191,k=q,k+=B*ae,k+=K*oe,k+=T*re,k+=v*ue,k+=x*fe,q=k>>>13,k&=8191,k+=C*ne,k+=P*h,k+=O*$,k+=j*ee,k+=z*Q,q+=k>>>13,k&=8191,q=(q<<2)+q|0,q=q+J|0,J=q&8191,q=q>>>13,H+=q,B=J,K=H,T=Z,v=X,x=V,C=W,P=Y,O=F,j=G,z=k,f+=16,c-=16;this.h[0]=B,this.h[1]=K,this.h[2]=T,this.h[3]=v,this.h[4]=x,this.h[5]=C,this.h[6]=P,this.h[7]=O,this.h[8]=j,this.h[9]=z},vt.prototype.finish=function(o,f){var c=new Uint16Array(10),n,u,y,g;if(this.leftover){for(g=this.leftover,this.buffer[g++]=1;g<16;g++)this.buffer[g]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,g=2;g<10;g++)this.h[g]+=n,n=this.h[g]>>>13,this.h[g]&=8191;for(this.h[0]+=n*5,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,c[0]=this.h[0]+5,n=c[0]>>>13,c[0]&=8191,g=1;g<10;g++)c[g]=this.h[g]+n,n=c[g]>>>13,c[g]&=8191;for(c[9]-=8192,u=(n^1)-1,g=0;g<10;g++)c[g]&=u;for(u=~u,g=0;g<10;g++)this.h[g]=this.h[g]&u|c[g];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,y=this.h[0]+this.pad[0],this.h[0]=y&65535,g=1;g<8;g++)y=(this.h[g]+this.pad[g]|0)+(y>>>16)|0,this.h[g]=y&65535;o[f+0]=this.h[0]>>>0&255,o[f+1]=this.h[0]>>>8&255,o[f+2]=this.h[1]>>>0&255,o[f+3]=this.h[1]>>>8&255,o[f+4]=this.h[2]>>>0&255,o[f+5]=this.h[2]>>>8&255,o[f+6]=this.h[3]>>>0&255,o[f+7]=this.h[3]>>>8&255,o[f+8]=this.h[4]>>>0&255,o[f+9]=this.h[4]>>>8&255,o[f+10]=this.h[5]>>>0&255,o[f+11]=this.h[5]>>>8&255,o[f+12]=this.h[6]>>>0&255,o[f+13]=this.h[6]>>>8&255,o[f+14]=this.h[7]>>>0&255,o[f+15]=this.h[7]>>>8&255},vt.prototype.update=function(o,f,c){var n,u;if(this.leftover){for(u=16-this.leftover,u>c&&(u=c),n=0;n<u;n++)this.buffer[this.leftover+n]=o[f+n];if(c-=u,f+=u,this.leftover+=u,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(c>=16&&(u=c-c%16,this.blocks(o,f,u),f+=u,c-=u),c){for(n=0;n<c;n++)this.buffer[this.leftover+n]=o[f+n];this.leftover+=c}};function pt(o,f,c,n,u,y){var g=new vt(y);return g.update(c,n,u),g.finish(o,f),0}function qt(o,f,c,n,u,y){var g=new Uint8Array(16);return pt(g,0,c,n,u,y),U(o,f,g,0)}function Se(o,f,c,n,u){var y;if(c<32)return-1;for(_t(o,0,f,0,c,n,u),pt(o,16,o,32,c-32,o),y=0;y<16;y++)o[y]=0;return 0}function Ve(o,f,c,n,u){var y,g=new Uint8Array(32);if(c<32||(mt(g,0,32,n,u),qt(f,16,f,32,c-32,g)!==0))return-1;for(_t(o,0,f,0,c,n,u),y=0;y<32;y++)o[y]=0;return 0}function Pe(o,f){var c;for(c=0;c<16;c++)o[c]=f[c]|0}function Ie(o){var f,c,n=1;for(f=0;f<16;f++)c=o[f]+n+65535,n=Math.floor(c/65536),o[f]=c-n*65536;o[0]+=n-1+37*(n-1)}function Re(o,f,c){for(var n,u=~(c-1),y=0;y<16;y++)n=u&(o[y]^f[y]),o[y]^=n,f[y]^=n}function Ue(o,f){var c,n,u,y=r(),g=r();for(c=0;c<16;c++)g[c]=f[c];for(Ie(g),Ie(g),Ie(g),n=0;n<2;n++){for(y[0]=g[0]-65517,c=1;c<15;c++)y[c]=g[c]-65535-(y[c-1]>>16&1),y[c-1]&=65535;y[15]=g[15]-32767-(y[14]>>16&1),u=y[15]>>16&1,y[14]&=65535,Re(g,y,1-u)}for(c=0;c<16;c++)o[2*c]=g[c]&255,o[2*c+1]=g[c]>>8}function Wn(o,f){var c=new Uint8Array(32),n=new Uint8Array(32);return Ue(c,o),Ue(n,f),se(c,0,n,0)}function Xn(o){var f=new Uint8Array(32);return Ue(f,o),f[0]&1}function kr(o,f){var c;for(c=0;c<16;c++)o[c]=f[2*c]+(f[2*c+1]<<8);o[15]&=32767}function Ke(o,f,c){for(var n=0;n<16;n++)o[n]=f[n]+c[n]}function De(o,f,c){for(var n=0;n<16;n++)o[n]=f[n]-c[n]}function ie(o,f,c){var n,u,y=0,g=0,A=0,N=0,D=0,I=0,ce=0,q=0,J=0,H=0,Z=0,X=0,V=0,W=0,Y=0,F=0,G=0,k=0,B=0,K=0,T=0,v=0,x=0,C=0,P=0,O=0,j=0,z=0,Q=0,ee=0,$=0,h=c[0],ne=c[1],fe=c[2],ue=c[3],re=c[4],oe=c[5],ae=c[6],xe=c[7],be=c[8],me=c[9],_e=c[10],ve=c[11],Ee=c[12],Ce=c[13],je=c[14],Ne=c[15];n=f[0],y+=n*h,g+=n*ne,A+=n*fe,N+=n*ue,D+=n*re,I+=n*oe,ce+=n*ae,q+=n*xe,J+=n*be,H+=n*me,Z+=n*_e,X+=n*ve,V+=n*Ee,W+=n*Ce,Y+=n*je,F+=n*Ne,n=f[1],g+=n*h,A+=n*ne,N+=n*fe,D+=n*ue,I+=n*re,ce+=n*oe,q+=n*ae,J+=n*xe,H+=n*be,Z+=n*me,X+=n*_e,V+=n*ve,W+=n*Ee,Y+=n*Ce,F+=n*je,G+=n*Ne,n=f[2],A+=n*h,N+=n*ne,D+=n*fe,I+=n*ue,ce+=n*re,q+=n*oe,J+=n*ae,H+=n*xe,Z+=n*be,X+=n*me,V+=n*_e,W+=n*ve,Y+=n*Ee,F+=n*Ce,G+=n*je,k+=n*Ne,n=f[3],N+=n*h,D+=n*ne,I+=n*fe,ce+=n*ue,q+=n*re,J+=n*oe,H+=n*ae,Z+=n*xe,X+=n*be,V+=n*me,W+=n*_e,Y+=n*ve,F+=n*Ee,G+=n*Ce,k+=n*je,B+=n*Ne,n=f[4],D+=n*h,I+=n*ne,ce+=n*fe,q+=n*ue,J+=n*re,H+=n*oe,Z+=n*ae,X+=n*xe,V+=n*be,W+=n*me,Y+=n*_e,F+=n*ve,G+=n*Ee,k+=n*Ce,B+=n*je,K+=n*Ne,n=f[5],I+=n*h,ce+=n*ne,q+=n*fe,J+=n*ue,H+=n*re,Z+=n*oe,X+=n*ae,V+=n*xe,W+=n*be,Y+=n*me,F+=n*_e,G+=n*ve,k+=n*Ee,B+=n*Ce,K+=n*je,T+=n*Ne,n=f[6],ce+=n*h,q+=n*ne,J+=n*fe,H+=n*ue,Z+=n*re,X+=n*oe,V+=n*ae,W+=n*xe,Y+=n*be,F+=n*me,G+=n*_e,k+=n*ve,B+=n*Ee,K+=n*Ce,T+=n*je,v+=n*Ne,n=f[7],q+=n*h,J+=n*ne,H+=n*fe,Z+=n*ue,X+=n*re,V+=n*oe,W+=n*ae,Y+=n*xe,F+=n*be,G+=n*me,k+=n*_e,B+=n*ve,K+=n*Ee,T+=n*Ce,v+=n*je,x+=n*Ne,n=f[8],J+=n*h,H+=n*ne,Z+=n*fe,X+=n*ue,V+=n*re,W+=n*oe,Y+=n*ae,F+=n*xe,G+=n*be,k+=n*me,B+=n*_e,K+=n*ve,T+=n*Ee,v+=n*Ce,x+=n*je,C+=n*Ne,n=f[9],H+=n*h,Z+=n*ne,X+=n*fe,V+=n*ue,W+=n*re,Y+=n*oe,F+=n*ae,G+=n*xe,k+=n*be,B+=n*me,K+=n*_e,T+=n*ve,v+=n*Ee,x+=n*Ce,C+=n*je,P+=n*Ne,n=f[10],Z+=n*h,X+=n*ne,V+=n*fe,W+=n*ue,Y+=n*re,F+=n*oe,G+=n*ae,k+=n*xe,B+=n*be,K+=n*me,T+=n*_e,v+=n*ve,x+=n*Ee,C+=n*Ce,P+=n*je,O+=n*Ne,n=f[11],X+=n*h,V+=n*ne,W+=n*fe,Y+=n*ue,F+=n*re,G+=n*oe,k+=n*ae,B+=n*xe,K+=n*be,T+=n*me,v+=n*_e,x+=n*ve,C+=n*Ee,P+=n*Ce,O+=n*je,j+=n*Ne,n=f[12],V+=n*h,W+=n*ne,Y+=n*fe,F+=n*ue,G+=n*re,k+=n*oe,B+=n*ae,K+=n*xe,T+=n*be,v+=n*me,x+=n*_e,C+=n*ve,P+=n*Ee,O+=n*Ce,j+=n*je,z+=n*Ne,n=f[13],W+=n*h,Y+=n*ne,F+=n*fe,G+=n*ue,k+=n*re,B+=n*oe,K+=n*ae,T+=n*xe,v+=n*be,x+=n*me,C+=n*_e,P+=n*ve,O+=n*Ee,j+=n*Ce,z+=n*je,Q+=n*Ne,n=f[14],Y+=n*h,F+=n*ne,G+=n*fe,k+=n*ue,B+=n*re,K+=n*oe,T+=n*ae,v+=n*xe,x+=n*be,C+=n*me,P+=n*_e,O+=n*ve,j+=n*Ee,z+=n*Ce,Q+=n*je,ee+=n*Ne,n=f[15],F+=n*h,G+=n*ne,k+=n*fe,B+=n*ue,K+=n*re,T+=n*oe,v+=n*ae,x+=n*xe,C+=n*be,P+=n*me,O+=n*_e,j+=n*ve,z+=n*Ee,Q+=n*Ce,ee+=n*je,$+=n*Ne,y+=38*G,g+=38*k,A+=38*B,N+=38*K,D+=38*T,I+=38*v,ce+=38*x,q+=38*C,J+=38*P,H+=38*O,Z+=38*j,X+=38*z,V+=38*Q,W+=38*ee,Y+=38*$,u=1,n=y+u+65535,u=Math.floor(n/65536),y=n-u*65536,n=g+u+65535,u=Math.floor(n/65536),g=n-u*65536,n=A+u+65535,u=Math.floor(n/65536),A=n-u*65536,n=N+u+65535,u=Math.floor(n/65536),N=n-u*65536,n=D+u+65535,u=Math.floor(n/65536),D=n-u*65536,n=I+u+65535,u=Math.floor(n/65536),I=n-u*65536,n=ce+u+65535,u=Math.floor(n/65536),ce=n-u*65536,n=q+u+65535,u=Math.floor(n/65536),q=n-u*65536,n=J+u+65535,u=Math.floor(n/65536),J=n-u*65536,n=H+u+65535,u=Math.floor(n/65536),H=n-u*65536,n=Z+u+65535,u=Math.floor(n/65536),Z=n-u*65536,n=X+u+65535,u=Math.floor(n/65536),X=n-u*65536,n=V+u+65535,u=Math.floor(n/65536),V=n-u*65536,n=W+u+65535,u=Math.floor(n/65536),W=n-u*65536,n=Y+u+65535,u=Math.floor(n/65536),Y=n-u*65536,n=F+u+65535,u=Math.floor(n/65536),F=n-u*65536,y+=u-1+37*(u-1),u=1,n=y+u+65535,u=Math.floor(n/65536),y=n-u*65536,n=g+u+65535,u=Math.floor(n/65536),g=n-u*65536,n=A+u+65535,u=Math.floor(n/65536),A=n-u*65536,n=N+u+65535,u=Math.floor(n/65536),N=n-u*65536,n=D+u+65535,u=Math.floor(n/65536),D=n-u*65536,n=I+u+65535,u=Math.floor(n/65536),I=n-u*65536,n=ce+u+65535,u=Math.floor(n/65536),ce=n-u*65536,n=q+u+65535,u=Math.floor(n/65536),q=n-u*65536,n=J+u+65535,u=Math.floor(n/65536),J=n-u*65536,n=H+u+65535,u=Math.floor(n/65536),H=n-u*65536,n=Z+u+65535,u=Math.floor(n/65536),Z=n-u*65536,n=X+u+65535,u=Math.floor(n/65536),X=n-u*65536,n=V+u+65535,u=Math.floor(n/65536),V=n-u*65536,n=W+u+65535,u=Math.floor(n/65536),W=n-u*65536,n=Y+u+65535,u=Math.floor(n/65536),Y=n-u*65536,n=F+u+65535,u=Math.floor(n/65536),F=n-u*65536,y+=u-1+37*(u-1),o[0]=y,o[1]=g,o[2]=A,o[3]=N,o[4]=D,o[5]=I,o[6]=ce,o[7]=q,o[8]=J,o[9]=H,o[10]=Z,o[11]=X,o[12]=V,o[13]=W,o[14]=Y,o[15]=F}function Fe(o,f){ie(o,f,f)}function Zn(o,f){var c=r(),n;for(n=0;n<16;n++)c[n]=f[n];for(n=253;n>=0;n--)Fe(c,c),n!==2&&n!==4&&ie(c,c,f);for(n=0;n<16;n++)o[n]=c[n]}function Qn(o,f){var c=r(),n;for(n=0;n<16;n++)c[n]=f[n];for(n=250;n>=0;n--)Fe(c,c),n!==1&&ie(c,c,f);for(n=0;n<16;n++)o[n]=c[n]}function sr(o,f,c){var n=new Uint8Array(32),u=new Float64Array(80),y,g,A=r(),N=r(),D=r(),I=r(),ce=r(),q=r();for(g=0;g<31;g++)n[g]=f[g];for(n[31]=f[31]&127|64,n[0]&=248,kr(u,c),g=0;g<16;g++)N[g]=u[g],I[g]=A[g]=D[g]=0;for(A[0]=I[0]=1,g=254;g>=0;--g)y=n[g>>>3]>>>(g&7)&1,Re(A,N,y),Re(D,I,y),Ke(ce,A,D),De(A,A,D),Ke(D,N,I),De(N,N,I),Fe(I,ce),Fe(q,A),ie(A,D,A),ie(D,N,ce),Ke(ce,A,D),De(A,A,D),Fe(N,A),De(D,I,q),ie(A,D,S),Ke(A,A,I),ie(D,D,A),ie(A,I,q),ie(I,N,u),Fe(N,ce),Re(A,N,y),Re(D,I,y);for(g=0;g<16;g++)u[g+16]=A[g],u[g+32]=D[g],u[g+48]=N[g],u[g+64]=I[g];var J=u.subarray(32),H=u.subarray(16);return Zn(J,J),ie(H,H,J),Ue(o,H),0}function ir(o,f){return sr(o,f,a)}function $n(o,f){return s(f,32),ir(o,f)}function or(o,f,c){var n=new Uint8Array(32);return sr(n,c,f),de(o,i,n,le)}var es=Se,Hi=Ve;function Vi(o,f,c,n,u,y){var g=new Uint8Array(32);return or(g,u,y),es(o,f,c,n,g)}function Yi(o,f,c,n,u,y){var g=new Uint8Array(32);return or(g,u,y),Hi(o,f,c,n,g)}var ts=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function rs(o,f,c,n){for(var u=new Int32Array(16),y=new Int32Array(16),g,A,N,D,I,ce,q,J,H,Z,X,V,W,Y,F,G,k,B,K,T,v,x,C,P,O,j,z=o[0],Q=o[1],ee=o[2],$=o[3],h=o[4],ne=o[5],fe=o[6],ue=o[7],re=f[0],oe=f[1],ae=f[2],xe=f[3],be=f[4],me=f[5],_e=f[6],ve=f[7],Ee=0;n>=128;){for(K=0;K<16;K++)T=8*K+Ee,u[K]=c[T+0]<<24|c[T+1]<<16|c[T+2]<<8|c[T+3],y[K]=c[T+4]<<24|c[T+5]<<16|c[T+6]<<8|c[T+7];for(K=0;K<80;K++)if(g=z,A=Q,N=ee,D=$,I=h,ce=ne,q=fe,J=ue,H=re,Z=oe,X=ae,V=xe,W=be,Y=me,F=_e,G=ve,v=ue,x=ve,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=(h>>>14|be<<18)^(h>>>18|be<<14)^(be>>>9|h<<23),x=(be>>>14|h<<18)^(be>>>18|h<<14)^(h>>>9|be<<23),C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,v=h&ne^~h&fe,x=be&me^~be&_e,C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,v=ts[K*2],x=ts[K*2+1],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,v=u[K%16],x=y[K%16],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,k=O&65535|j<<16,B=C&65535|P<<16,v=k,x=B,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=(z>>>28|re<<4)^(re>>>2|z<<30)^(re>>>7|z<<25),x=(re>>>28|z<<4)^(z>>>2|re<<30)^(z>>>7|re<<25),C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,v=z&Q^z&ee^Q&ee,x=re&oe^re&ae^oe&ae,C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,J=O&65535|j<<16,G=C&65535|P<<16,v=D,x=V,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=k,x=B,C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,D=O&65535|j<<16,V=C&65535|P<<16,Q=g,ee=A,$=N,h=D,ne=I,fe=ce,ue=q,z=J,oe=H,ae=Z,xe=X,be=V,me=W,_e=Y,ve=F,re=G,K%16===15)for(T=0;T<16;T++)v=u[T],x=y[T],C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=u[(T+9)%16],x=y[(T+9)%16],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,k=u[(T+1)%16],B=y[(T+1)%16],v=(k>>>1|B<<31)^(k>>>8|B<<24)^k>>>7,x=(B>>>1|k<<31)^(B>>>8|k<<24)^(B>>>7|k<<25),C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,k=u[(T+14)%16],B=y[(T+14)%16],v=(k>>>19|B<<13)^(B>>>29|k<<3)^k>>>6,x=(B>>>19|k<<13)^(k>>>29|B<<3)^(B>>>6|k<<26),C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,u[T]=O&65535|j<<16,y[T]=C&65535|P<<16;v=z,x=re,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[0],x=f[0],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[0]=z=O&65535|j<<16,f[0]=re=C&65535|P<<16,v=Q,x=oe,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[1],x=f[1],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[1]=Q=O&65535|j<<16,f[1]=oe=C&65535|P<<16,v=ee,x=ae,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[2],x=f[2],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[2]=ee=O&65535|j<<16,f[2]=ae=C&65535|P<<16,v=$,x=xe,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[3],x=f[3],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[3]=$=O&65535|j<<16,f[3]=xe=C&65535|P<<16,v=h,x=be,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[4],x=f[4],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[4]=h=O&65535|j<<16,f[4]=be=C&65535|P<<16,v=ne,x=me,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[5],x=f[5],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[5]=ne=O&65535|j<<16,f[5]=me=C&65535|P<<16,v=fe,x=_e,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[6],x=f[6],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[6]=fe=O&65535|j<<16,f[6]=_e=C&65535|P<<16,v=ue,x=ve,C=x&65535,P=x>>>16,O=v&65535,j=v>>>16,v=o[7],x=f[7],C+=x&65535,P+=x>>>16,O+=v&65535,j+=v>>>16,P+=C>>>16,O+=P>>>16,j+=O>>>16,o[7]=ue=O&65535|j<<16,f[7]=ve=C&65535|P<<16,Ee+=128,n-=128}return n}function at(o,f,c){var n=new Int32Array(8),u=new Int32Array(8),y=new Uint8Array(256),g,A=c;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,u[0]=4089235720,u[1]=2227873595,u[2]=4271175723,u[3]=1595750129,u[4]=2917565137,u[5]=725511199,u[6]=4215389547,u[7]=327033209,rs(n,u,f,c),c%=128,g=0;g<c;g++)y[g]=f[A-c+g];for(y[c]=128,c=256-128*(c<112?1:0),y[c-9]=0,R(y,c-8,A/536870912|0,A<<3),rs(n,u,y,c),g=0;g<8;g++)R(o,8*g,n[g],u[g]);return 0}function ar(o,f){var c=r(),n=r(),u=r(),y=r(),g=r(),A=r(),N=r(),D=r(),I=r();De(c,o[1],o[0]),De(I,f[1],f[0]),ie(c,c,I),Ke(n,o[0],o[1]),Ke(I,f[0],f[1]),ie(n,n,I),ie(u,o[3],f[3]),ie(u,u,w),ie(y,o[2],f[2]),Ke(y,y,y),De(g,n,c),De(A,y,u),Ke(N,y,u),Ke(D,n,c),ie(o[0],g,A),ie(o[1],D,N),ie(o[2],N,A),ie(o[3],g,D)}function ns(o,f,c){var n;for(n=0;n<4;n++)Re(o[n],f[n],c)}function Ur(o,f){var c=r(),n=r(),u=r();Zn(u,f[2]),ie(c,f[0],u),ie(n,f[1],u),Ue(o,n),o[31]^=Xn(c)<<7}function Lr(o,f,c){var n,u;for(Pe(o[0],d),Pe(o[1],m),Pe(o[2],m),Pe(o[3],d),u=255;u>=0;--u)n=c[u/8|0]>>(u&7)&1,ns(o,f,n),ar(f,o),ar(o,o),ns(o,f,n)}function cr(o,f){var c=[r(),r(),r(),r()];Pe(c[0],E),Pe(c[1],b),Pe(c[2],m),ie(c[3],E,b),Lr(o,c,f)}function qr(o,f,c){var n=new Uint8Array(64),u=[r(),r(),r(),r()],y;for(c||s(f,32),at(n,f,32),n[0]&=248,n[31]&=127,n[31]|=64,cr(u,n),Ur(o,u),y=0;y<32;y++)f[y+32]=o[y];return 0}var fr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Fr(o,f){var c,n,u,y;for(n=63;n>=32;--n){for(c=0,u=n-32,y=n-12;u<y;++u)f[u]+=c-16*f[n]*fr[u-(n-32)],c=Math.floor((f[u]+128)/256),f[u]-=c*256;f[u]+=c,f[n]=0}for(c=0,u=0;u<32;u++)f[u]+=c-(f[31]>>4)*fr[u],c=f[u]>>8,f[u]&=255;for(u=0;u<32;u++)f[u]-=c*fr[u];for(n=0;n<32;n++)f[n+1]+=f[n]>>8,o[n]=f[n]&255}function Br(o){var f=new Float64Array(64),c;for(c=0;c<64;c++)f[c]=o[c];for(c=0;c<64;c++)o[c]=0;Fr(o,f)}function ss(o,f,c,n){var u=new Uint8Array(64),y=new Uint8Array(64),g=new Uint8Array(64),A,N,D=new Float64Array(64),I=[r(),r(),r(),r()];at(u,n,32),u[0]&=248,u[31]&=127,u[31]|=64;var ce=c+64;for(A=0;A<c;A++)o[64+A]=f[A];for(A=0;A<32;A++)o[32+A]=u[32+A];for(at(g,o.subarray(32),c+32),Br(g),cr(I,g),Ur(o,I),A=32;A<64;A++)o[A]=n[A];for(at(y,o,c+64),Br(y),A=0;A<64;A++)D[A]=0;for(A=0;A<32;A++)D[A]=g[A];for(A=0;A<32;A++)for(N=0;N<32;N++)D[A+N]+=y[A]*u[N];return Fr(o.subarray(32),D),ce}function Wi(o,f){var c=r(),n=r(),u=r(),y=r(),g=r(),A=r(),N=r();return Pe(o[2],m),kr(o[1],f),Fe(u,o[1]),ie(y,u,_),De(u,u,o[2]),Ke(y,o[2],y),Fe(g,y),Fe(A,g),ie(N,A,g),ie(c,N,u),ie(c,c,y),Qn(c,c),ie(c,c,u),ie(c,c,y),ie(c,c,y),ie(o[0],c,y),Fe(n,o[0]),ie(n,n,y),Wn(n,u)&&ie(o[0],o[0],p),Fe(n,o[0]),ie(n,n,y),Wn(n,u)?-1:(Xn(o[0])===f[31]>>7&&De(o[0],d,o[0]),ie(o[3],o[0],o[1]),0)}function Kr(o,f,c,n){var u,y=new Uint8Array(32),g=new Uint8Array(64),A=[r(),r(),r(),r()],N=[r(),r(),r(),r()];if(c<64||Wi(N,n))return-1;for(u=0;u<c;u++)o[u]=f[u];for(u=0;u<32;u++)o[u+32]=n[u];if(at(g,o,c),Br(g),Lr(A,N,g),cr(N,f.subarray(32)),ar(A,N),Ur(y,A),c-=64,se(f,0,y,0)){for(u=0;u<c;u++)o[u]=0;return-1}for(u=0;u<c;u++)o[u]=f[u+64];return c}var Dr=32,ur=24,Ft=32,xt=16,Bt=32,hr=32,Kt=32,Dt=32,Gr=32,is=ur,Xi=Ft,Zi=xt,Qe=64,ct=32,wt=64,zr=32,Jr=64;e.lowlevel={crypto_core_hsalsa20:de,crypto_stream_xor:_t,crypto_stream:mt,crypto_stream_salsa20_xor:He,crypto_stream_salsa20:Lt,crypto_onetimeauth:pt,crypto_onetimeauth_verify:qt,crypto_verify_16:U,crypto_verify_32:se,crypto_secretbox:Se,crypto_secretbox_open:Ve,crypto_scalarmult:sr,crypto_scalarmult_base:ir,crypto_box_beforenm:or,crypto_box_afternm:es,crypto_box:Vi,crypto_box_open:Yi,crypto_box_keypair:$n,crypto_hash:at,crypto_sign:ss,crypto_sign_keypair:qr,crypto_sign_open:Kr,crypto_secretbox_KEYBYTES:Dr,crypto_secretbox_NONCEBYTES:ur,crypto_secretbox_ZEROBYTES:Ft,crypto_secretbox_BOXZEROBYTES:xt,crypto_scalarmult_BYTES:Bt,crypto_scalarmult_SCALARBYTES:hr,crypto_box_PUBLICKEYBYTES:Kt,crypto_box_SECRETKEYBYTES:Dt,crypto_box_BEFORENMBYTES:Gr,crypto_box_NONCEBYTES:is,crypto_box_ZEROBYTES:Xi,crypto_box_BOXZEROBYTES:Zi,crypto_sign_BYTES:Qe,crypto_sign_PUBLICKEYBYTES:ct,crypto_sign_SECRETKEYBYTES:wt,crypto_sign_SEEDBYTES:zr,crypto_hash_BYTES:Jr,gf:r,D:_,L:fr,pack25519:Ue,unpack25519:kr,M:ie,A:Ke,S:Fe,Z:De,pow2523:Qn,add:ar,set25519:Pe,modL:Fr,scalarmult:Lr,scalarbase:cr};function os(o,f){if(o.length!==Dr)throw new Error("bad key size");if(f.length!==ur)throw new Error("bad nonce size")}function Qi(o,f){if(o.length!==Kt)throw new Error("bad public key size");if(f.length!==Dt)throw new Error("bad secret key size")}function Le(){for(var o=0;o<arguments.length;o++)if(!(arguments[o]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function as(o){for(var f=0;f<o.length;f++)o[f]=0}e.randomBytes=function(o){var f=new Uint8Array(o);return s(f,o),f},e.secretbox=function(o,f,c){Le(o,f,c),os(c,f);for(var n=new Uint8Array(Ft+o.length),u=new Uint8Array(n.length),y=0;y<o.length;y++)n[y+Ft]=o[y];return Se(u,n,n.length,f,c),u.subarray(xt)},e.secretbox.open=function(o,f,c){Le(o,f,c),os(c,f);for(var n=new Uint8Array(xt+o.length),u=new Uint8Array(n.length),y=0;y<o.length;y++)n[y+xt]=o[y];return n.length<32||Ve(u,n,n.length,f,c)!==0?null:u.subarray(Ft)},e.secretbox.keyLength=Dr,e.secretbox.nonceLength=ur,e.secretbox.overheadLength=xt,e.scalarMult=function(o,f){if(Le(o,f),o.length!==hr)throw new Error("bad n size");if(f.length!==Bt)throw new Error("bad p size");var c=new Uint8Array(Bt);return sr(c,o,f),c},e.scalarMult.base=function(o){if(Le(o),o.length!==hr)throw new Error("bad n size");var f=new Uint8Array(Bt);return ir(f,o),f},e.scalarMult.scalarLength=hr,e.scalarMult.groupElementLength=Bt,e.box=function(o,f,c,n){var u=e.box.before(c,n);return e.secretbox(o,f,u)},e.box.before=function(o,f){Le(o,f),Qi(o,f);var c=new Uint8Array(Gr);return or(c,o,f),c},e.box.after=e.secretbox,e.box.open=function(o,f,c,n){var u=e.box.before(c,n);return e.secretbox.open(o,f,u)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var o=new Uint8Array(Kt),f=new Uint8Array(Dt);return $n(o,f),{publicKey:o,secretKey:f}},e.box.keyPair.fromSecretKey=function(o){if(Le(o),o.length!==Dt)throw new Error("bad secret key size");var f=new Uint8Array(Kt);return ir(f,o),{publicKey:f,secretKey:new Uint8Array(o)}},e.box.publicKeyLength=Kt,e.box.secretKeyLength=Dt,e.box.sharedKeyLength=Gr,e.box.nonceLength=is,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(o,f){if(Le(o,f),f.length!==wt)throw new Error("bad secret key size");var c=new Uint8Array(Qe+o.length);return ss(c,o,o.length,f),c},e.sign.open=function(o,f){if(Le(o,f),f.length!==ct)throw new Error("bad public key size");var c=new Uint8Array(o.length),n=Kr(c,o,o.length,f);if(n<0)return null;for(var u=new Uint8Array(n),y=0;y<u.length;y++)u[y]=c[y];return u},e.sign.detached=function(o,f){for(var c=e.sign(o,f),n=new Uint8Array(Qe),u=0;u<n.length;u++)n[u]=c[u];return n},e.sign.detached.verify=function(o,f,c){if(Le(o,f,c),f.length!==Qe)throw new Error("bad signature size");if(c.length!==ct)throw new Error("bad public key size");var n=new Uint8Array(Qe+o.length),u=new Uint8Array(Qe+o.length),y;for(y=0;y<Qe;y++)n[y]=f[y];for(y=0;y<o.length;y++)n[y+Qe]=o[y];return Kr(u,n,n.length,c)>=0},e.sign.keyPair=function(){var o=new Uint8Array(ct),f=new Uint8Array(wt);return qr(o,f),{publicKey:o,secretKey:f}},e.sign.keyPair.fromSecretKey=function(o){if(Le(o),o.length!==wt)throw new Error("bad secret key size");for(var f=new Uint8Array(ct),c=0;c<f.length;c++)f[c]=o[32+c];return{publicKey:f,secretKey:new Uint8Array(o)}},e.sign.keyPair.fromSeed=function(o){if(Le(o),o.length!==zr)throw new Error("bad seed size");for(var f=new Uint8Array(ct),c=new Uint8Array(wt),n=0;n<32;n++)c[n]=o[n];return qr(f,c,!0),{publicKey:f,secretKey:c}},e.sign.publicKeyLength=ct,e.sign.secretKeyLength=wt,e.sign.seedLength=zr,e.sign.signatureLength=Qe,e.hash=function(o){Le(o);var f=new Uint8Array(Jr);return at(f,o,o.length),f},e.hash.hashLength=Jr,e.verify=function(o,f){return Le(o,f),o.length===0||f.length===0||o.length!==f.length?!1:M(o,0,f,0,o.length)===0},e.setPRNG=function(o){s=o},function(){var o=typeof self<"u"?self.crypto||self.msCrypto:null;if(o&&o.getRandomValues){var f=65536;e.setPRNG(function(c,n){var u,y=new Uint8Array(n);for(u=0;u<n;u+=f)o.getRandomValues(y.subarray(u,u+Math.min(n-u,f)));for(u=0;u<n;u++)c[u]=y[u];as(y)})}else typeof Ws<"u"&&(o=Xs,o&&o.randomBytes&&e.setPRNG(function(c,n){var u,y=o.randomBytes(n);for(u=0;u<n;u++)c[u]=y[u];as(y)}))}()})(t.exports?t.exports:self.nacl=self.nacl||{})})(Pn);var Zs=Pn.exports,Qs=he&&he.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bt,"__esModule",{value:!0});const $s=Qs(Zs);bt.default=$s.default;var An;function ei(){if(An)return Mt;An=1;var t=he&&he.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.KP=void 0;const e=Qt(),r=yt(),s=t(bt);class i{constructor(d){l(this,"seed");this.seed=d}getRawSeed(){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);return e.Codec.decodeSeed(this.seed).buf}getSeed(){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);return this.seed}getPublicKey(){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);const d=e.Codec.decodeSeed(this.seed),m=s.default.sign.keyPair.fromSeed(this.getRawSeed()),S=e.Codec.encode(d.prefix,m.publicKey);return new TextDecoder().decode(S)}getPrivateKey(){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);const d=s.default.sign.keyPair.fromSeed(this.getRawSeed());return e.Codec.encode(r.Prefix.Private,d.secretKey)}sign(d){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);const m=s.default.sign.keyPair.fromSeed(this.getRawSeed());return s.default.sign.detached(d,m.secretKey)}verify(d,m){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);const S=s.default.sign.keyPair.fromSeed(this.getRawSeed());return s.default.sign.detached.verify(d,m,S.publicKey)}clear(){this.seed&&(this.seed.fill(0),this.seed=void 0)}seal(d,m,S){throw new r.NKeysError(r.NKeysErrorCode.InvalidNKeyOperation)}open(d,m){throw new r.NKeysError(r.NKeysErrorCode.InvalidNKeyOperation)}}return Mt.KP=i,Mt}var kt={},On;function ti(){if(On)return kt;On=1;var t=he&&he.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(kt,"__esModule",{value:!0}),kt.PublicKey=void 0;const e=Qt(),r=yt(),s=t(bt);class i{constructor(d){l(this,"publicKey");this.publicKey=d}getPublicKey(){if(!this.publicKey)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);return new TextDecoder().decode(this.publicKey)}getPrivateKey(){throw this.publicKey?new r.NKeysError(r.NKeysErrorCode.PublicKeyOnly):new r.NKeysError(r.NKeysErrorCode.ClearedPair)}getSeed(){throw this.publicKey?new r.NKeysError(r.NKeysErrorCode.PublicKeyOnly):new r.NKeysError(r.NKeysErrorCode.ClearedPair)}sign(d){throw this.publicKey?new r.NKeysError(r.NKeysErrorCode.CannotSign):new r.NKeysError(r.NKeysErrorCode.ClearedPair)}verify(d,m){if(!this.publicKey)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);const S=e.Codec._decode(this.publicKey);return s.default.sign.detached.verify(d,m,S.slice(1))}clear(){this.publicKey&&(this.publicKey.fill(0),this.publicKey=void 0)}seal(d,m,S){throw new r.NKeysError(r.NKeysErrorCode.InvalidNKeyOperation)}open(d,m){throw new r.NKeysError(r.NKeysErrorCode.InvalidNKeyOperation)}}return kt.PublicKey=i,kt}var Or={},Cn;function ri(){return Cn||(Cn=1,function(t){var e=he&&he.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(t,"__esModule",{value:!0}),t.CurveKP=t.curveNonceLen=t.curveKeyLen=void 0;const r=yt(),s=e(bt),i=Qt(),a=yt(),d=Rt,m=It;t.curveKeyLen=32;const S=35;t.curveNonceLen=24;const _=[120,107,118,49];class w{constructor(b){l(this,"seed");this.seed=b}clear(){this.seed&&(this.seed.fill(0),this.seed=void 0)}getPrivateKey(){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);return i.Codec.encode(a.Prefix.Private,this.seed)}getPublicKey(){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);const b=s.default.scalarMult.base(this.seed),p=i.Codec.encode(a.Prefix.Curve,b);return new TextDecoder().decode(p)}getSeed(){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);return i.Codec.encodeSeed(a.Prefix.Curve,this.seed)}sign(){throw new r.NKeysError(r.NKeysErrorCode.InvalidCurveOperation)}verify(){throw new r.NKeysError(r.NKeysErrorCode.InvalidCurveOperation)}decodePubCurveKey(b){try{const p=d.base32.decode(new TextEncoder().encode(b));if(p.byteLength!==S)throw new r.NKeysError(r.NKeysErrorCode.InvalidCurveKey);if(p[0]!==a.Prefix.Curve)throw new r.NKeysError(r.NKeysErrorCode.InvalidPublicKey);const R=p.byteLength-2,U=new DataView(p.buffer).getUint16(R,!0),se=p.slice(0,R);if(!m.crc16.validate(se,U))throw new r.NKeysError(r.NKeysErrorCode.InvalidChecksum);return se.slice(1)}catch(p){throw new r.NKeysError(r.NKeysErrorCode.InvalidRecipient,{cause:p})}}seal(b,p,R){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);R||(R=s.default.randomBytes(t.curveNonceLen));const M=this.decodePubCurveKey(p),U=new Uint8Array(_.length+t.curveNonceLen);U.set(_,0),U.set(R,_.length);const se=s.default.box(b,R,M,this.seed),ge=new Uint8Array(U.length+se.length);return ge.set(U),ge.set(se,U.length),ge}open(b,p){if(!this.seed)throw new r.NKeysError(r.NKeysErrorCode.ClearedPair);if(b.length<=t.curveNonceLen+_.length)throw new r.NKeysError(r.NKeysErrorCode.InvalidEncrypted);for(let U=0;U<_.length;U++)if(b[U]!==_[U])throw new r.NKeysError(r.NKeysErrorCode.InvalidEncrypted);const R=this.decodePubCurveKey(p);b=b.slice(_.length);const M=b.slice(0,t.curveNonceLen);return b=b.slice(t.curveNonceLen),s.default.box.open(b,M,R,this.seed)}}t.CurveKP=w}(Or)),Or}var jn;function yt(){if(jn)return pe;jn=1;var t=he&&he.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.NKeysError=pe.NKeysErrorCode=pe.Prefixes=pe.Prefix=void 0,pe.createPair=d,pe.createOperator=m,pe.createAccount=S,pe.createUser=_,pe.createCluster=w,pe.createServer=E,pe.createCurve=b,pe.fromPublic=p,pe.fromCurveSeed=R,pe.fromSeed=M;const e=ei(),r=ti(),s=Qt(),i=ri(),a=t(bt);function d(L){const de=L===U.Curve?i.curveKeyLen:32,le=a.default.randomBytes(de),He=s.Codec.encodeSeed(L,new Uint8Array(le));return L===U.Curve?new i.CurveKP(new Uint8Array(le)):new e.KP(He)}function m(){return d(U.Operator)}function S(){return d(U.Account)}function _(){return d(U.User)}function w(){return d(U.Cluster)}function E(){return d(U.Server)}function b(){return d(U.Curve)}function p(L){const de=new TextEncoder().encode(L),le=s.Codec._decode(de),He=se.parsePrefix(le[0]);if(se.isValidPublicPrefix(He))return new r.PublicKey(de);throw new qe(ge.InvalidPublicKey)}function R(L){const de=s.Codec.decodeSeed(L);if(de.prefix!==U.Curve)throw new qe(ge.InvalidCurveSeed);if(de.buf.byteLength!==i.curveKeyLen)throw new qe(ge.InvalidSeedLen);return new i.CurveKP(de.buf)}function M(L){return s.Codec.decodeSeed(L).prefix===U.Curve?R(L):new e.KP(L)}var U;(function(L){L[L.Unknown=-1]="Unknown",L[L.Seed=144]="Seed",L[L.Private=120]="Private",L[L.Operator=112]="Operator",L[L.Server=104]="Server",L[L.Cluster=16]="Cluster",L[L.Account=0]="Account",L[L.User=160]="User",L[L.Curve=184]="Curve"})(U||(pe.Prefix=U={}));class se{static isValidPublicPrefix(de){return de==U.Server||de==U.Operator||de==U.Cluster||de==U.Account||de==U.User||de==U.Curve}static startsWithValidPrefix(de){const le=de[0];return le=="S"||le=="P"||le=="O"||le=="N"||le=="C"||le=="A"||le=="U"||le=="X"}static isValidPrefix(de){return this.parsePrefix(de)!==U.Unknown}static parsePrefix(de){switch(de){case U.Seed:return U.Seed;case U.Private:return U.Private;case U.Operator:return U.Operator;case U.Server:return U.Server;case U.Cluster:return U.Cluster;case U.Account:return U.Account;case U.User:return U.User;case U.Curve:return U.Curve;default:return U.Unknown}}}pe.Prefixes=se;var ge;(function(L){L.InvalidPrefixByte="nkeys: invalid prefix byte",L.InvalidKey="nkeys: invalid key",L.InvalidPublicKey="nkeys: invalid public key",L.InvalidSeedLen="nkeys: invalid seed length",L.InvalidSeed="nkeys: invalid seed",L.InvalidCurveSeed="nkeys: invalid curve seed",L.InvalidCurveKey="nkeys: not a valid curve key",L.InvalidCurveOperation="nkeys: curve key is not valid for sign/verify",L.InvalidNKeyOperation="keys: only curve key can seal/open",L.InvalidEncoding="nkeys: invalid encoded key",L.InvalidRecipient="nkeys: not a valid recipient public curve key",L.InvalidEncrypted="nkeys: encrypted input is not valid",L.CannotSign="nkeys: cannot sign, no private key available",L.PublicKeyOnly="nkeys: no seed or private key available",L.InvalidChecksum="nkeys: invalid checksum",L.SerializationError="nkeys: serialization error",L.ApiError="nkeys: api error",L.ClearedPair="nkeys: pair is cleared"})(ge||(pe.NKeysErrorCode=ge={}));class qe extends Error{constructor(le,He){super(le,He);l(this,"code");this.code=le}}return pe.NKeysError=qe,pe}var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.encode=ni,Ut.decode=si,Ut.dump=ii;function ni(t){return btoa(String.fromCharCode(...t))}function si(t){const e=atob(t),r=new Uint8Array(e.length);for(let s=0;s<e.length;s++)r[s]=e.charCodeAt(s);return r}function ii(t,e){e&&console.log(e);const r=[];for(let s=0;s<t.byteLength;s++){s%8===0&&r.push(`
|
|
7
|
+
`);let i=t[s].toString(16);i.length===1&&(i="0"+i),r.push(i)}console.log(r.join(" "))}var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.version=void 0,$t.version="2.0.3",function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.encode=t.decode=t.Prefixes=t.Prefix=t.NKeysErrorCode=t.NKeysError=t.fromSeed=t.fromPublic=t.fromCurveSeed=t.createUser=t.createServer=t.createPair=t.createOperator=t.createCurve=t.createCluster=t.createAccount=void 0;var e=yt();Object.defineProperty(t,"createAccount",{enumerable:!0,get:function(){return e.createAccount}}),Object.defineProperty(t,"createCluster",{enumerable:!0,get:function(){return e.createCluster}}),Object.defineProperty(t,"createCurve",{enumerable:!0,get:function(){return e.createCurve}}),Object.defineProperty(t,"createOperator",{enumerable:!0,get:function(){return e.createOperator}}),Object.defineProperty(t,"createPair",{enumerable:!0,get:function(){return e.createPair}}),Object.defineProperty(t,"createServer",{enumerable:!0,get:function(){return e.createServer}}),Object.defineProperty(t,"createUser",{enumerable:!0,get:function(){return e.createUser}}),Object.defineProperty(t,"fromCurveSeed",{enumerable:!0,get:function(){return e.fromCurveSeed}}),Object.defineProperty(t,"fromPublic",{enumerable:!0,get:function(){return e.fromPublic}}),Object.defineProperty(t,"fromSeed",{enumerable:!0,get:function(){return e.fromSeed}}),Object.defineProperty(t,"NKeysError",{enumerable:!0,get:function(){return e.NKeysError}}),Object.defineProperty(t,"NKeysErrorCode",{enumerable:!0,get:function(){return e.NKeysErrorCode}}),Object.defineProperty(t,"Prefix",{enumerable:!0,get:function(){return e.Prefix}}),Object.defineProperty(t,"Prefixes",{enumerable:!0,get:function(){return e.Prefixes}});var r=Ut;Object.defineProperty(t,"decode",{enumerable:!0,get:function(){return r.decode}}),Object.defineProperty(t,"encode",{enumerable:!0,get:function(){return r.encode}});var s=$t;Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}})}(En);var oi=he&&he.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,i)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),ai=he&&he.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ci=he&&he.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[s.length]=i);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),i=0;i<s.length;i++)s[i]!=="default"&&oi(r,e,s[i]);return ai(r,e),r}}();Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.nkeys=void 0,Nt.nkeys=ci(En),Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.multiAuthenticator=fi,Ge.noAuthFn=ui,Ge.usernamePasswordAuthenticator=hi,Ge.tokenAuthenticator=di,Ge.nkeyAuthenticator=Mn,Ge.jwtAuthenticator=Tn,Ge.credsAuthenticator=li;const Nn=Nt,Cr=ke;function fi(t){return e=>{let r={};return t.forEach(s=>{const i=s(e)||{};r=Object.assign(r,i)}),r}}function ui(){return()=>{}}function hi(t,e){return()=>{const r=typeof t=="function"?t():t,s=typeof e=="function"?e():e;return{user:r,pass:s}}}function di(t){return()=>({auth_token:typeof t=="function"?t():t})}function Mn(t){return e=>{const r=typeof t=="function"?t():t,s=r?Nn.nkeys.fromSeed(r):void 0,i=s?s.getPublicKey():"",a=Cr.TE.encode(e||""),d=s!==void 0&&e?s.sign(a):void 0,m=d?Nn.nkeys.encode(d):"";return{nkey:i,sig:m}}}function Tn(t,e){return r=>{const s=typeof t=="function"?t():t,i=Mn(e),{nkey:a,sig:d}=i(r);return{jwt:s,nkey:a,sig:d}}}function li(t){const e=typeof t!="function"?()=>t:t,r=()=>{const a=/\s*(?:(?:[-]{3,}[^\n]*[-]{3,}\n)(.+)(?:\n\s*[-]{3,}[^\n]*[-]{3,}\n))/ig,d=Cr.TD.decode(e());let m=a.exec(d);if(!m)throw new Error("unable to parse credentials");const S=m[1].trim();if(m=a.exec(d),!m)throw new Error("unable to parse credentials");const _=Cr.TE.encode(m[1].trim());return{jwt:S,seed:_}};return Tn(()=>{const{jwt:a}=r();return a},()=>{const{seed:a}=r();return a})}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_RECONNECT_TIME_WAIT=t.DEFAULT_MAX_PING_OUT=t.DEFAULT_PING_INTERVAL=t.DEFAULT_JITTER_TLS=t.DEFAULT_JITTER=t.DEFAULT_MAX_RECONNECT_ATTEMPTS=void 0,t.defaultOptions=d,t.hasWsProtocol=m,t.buildAuthenticator=S,t.parseOptions=_,t.checkOptions=w,t.checkUnsupportedOption=E;const e=ye,r=rt,s=Oe,i=Ge,a=te;t.DEFAULT_MAX_RECONNECT_ATTEMPTS=10,t.DEFAULT_JITTER=100,t.DEFAULT_JITTER_TLS=1e3,t.DEFAULT_PING_INTERVAL=2*60*1e3,t.DEFAULT_MAX_PING_OUT=2,t.DEFAULT_RECONNECT_TIME_WAIT=2*1e3;function d(){return{maxPingOut:t.DEFAULT_MAX_PING_OUT,maxReconnectAttempts:t.DEFAULT_MAX_RECONNECT_ATTEMPTS,noRandomize:!1,pedantic:!1,pingInterval:t.DEFAULT_PING_INTERVAL,reconnect:!0,reconnectJitter:t.DEFAULT_JITTER,reconnectJitterTLS:t.DEFAULT_JITTER_TLS,reconnectTimeWait:t.DEFAULT_RECONNECT_TIME_WAIT,tls:void 0,verbose:!1,waitOnFirstConnect:!1,ignoreAuthErrorAbort:!1}}function m(b){if(b){let{servers:p}=b;if(typeof p=="string"&&(p=[p]),p)for(let R=0;R<p.length;R++){const M=p[R].toLowerCase();if(M.startsWith("ws://")||M.startsWith("wss://"))return!0}}return!1}function S(b){const p=[];return typeof b.authenticator=="function"&&p.push(b.authenticator),Array.isArray(b.authenticator)&&p.push(...b.authenticator),b.token&&p.push((0,i.tokenAuthenticator)(b.token)),b.user&&p.push((0,i.usernamePasswordAuthenticator)(b.user,b.pass)),p.length===0?(0,i.noAuthFn)():(0,i.multiAuthenticator)(p)}function _(b){const p=`${s.DEFAULT_HOST}:${(0,r.defaultPort)()}`;if(b=b||{servers:[p]},b.servers=b.servers||[],typeof b.servers=="string"&&(b.servers=[b.servers]),b.servers.length>0&&b.port)throw a.InvalidArgumentError.format(["servers","port"],"are mutually exclusive");b.servers.length===0&&b.port&&(b.servers=[`${s.DEFAULT_HOST}:${b.port}`]),b.servers&&b.servers.length===0&&(b.servers=[p]);const R=(0,e.extend)(d(),b);if(R.authenticator=S(R),["reconnectDelayHandler","authenticator"].forEach(M=>{if(R[M]&&typeof R[M]!="function")throw TypeError(`'${M}' must be a function`)}),R.reconnectDelayHandler||(R.reconnectDelayHandler=()=>{let M=R.tls?R.reconnectJitterTLS:R.reconnectJitter;return M&&(M++,M=Math.floor(Math.random()*M)),R.reconnectTimeWait+M}),R.inboxPrefix&&(0,s.createInbox)(R.inboxPrefix),R.resolve===void 0&&(R.resolve=typeof(0,r.getResolveFn)()=="function"),R.resolve&&typeof(0,r.getResolveFn)()!="function")throw a.InvalidArgumentError.format("resolve","is not supported in the current runtime");return R}function w(b,p){const{proto:R,tls_required:M,tls_available:U}=b;if((R===void 0||R<1)&&p.noEcho)throw new a.errors.ConnectionError("server does not support 'noEcho'");const se=M||U||!1;if(p.tls&&!se)throw new a.errors.ConnectionError("server does not support 'tls'")}function E(b,p){if(p)throw a.InvalidArgumentError.format(b,"is not supported")}})(jt),Object.defineProperty(Me,"__esModule",{value:!0}),Me.ProtocolHandler=Me.Subscriptions=Me.SubscriptionImpl=Me.Connect=Me.INFO=void 0;const ze=ke,it=rt,Je=ye,bi=nt,yi=Ye,gi=dt,mi=At,_i=Ot,et=pr,vi=Ct,In=Zt,jr=jt,Ae=te,pi=1024*32;Me.INFO=/^INFO\s+([^\r\n]+)\r\n/i;const xi=(0,ze.encode)(`PONG\r
|
|
8
|
+
`),Rn=(0,ze.encode)(`PING\r
|
|
9
|
+
`);class kn{constructor(e,r,s){l(this,"echo");l(this,"no_responders");l(this,"protocol");l(this,"verbose");l(this,"pedantic");l(this,"jwt");l(this,"nkey");l(this,"sig");l(this,"user");l(this,"pass");l(this,"auth_token");l(this,"tls_required");l(this,"name");l(this,"lang");l(this,"version");l(this,"headers");this.protocol=1,this.version=e.version,this.lang=e.lang,this.echo=r.noEcho?!1:void 0,this.verbose=r.verbose,this.pedantic=r.pedantic,this.tls_required=r.tls?!0:void 0,this.name=r.name;const i=(r&&typeof r.authenticator=="function"?r.authenticator(s):{})||{};(0,Je.extend)(this,i)}}Me.Connect=kn;class wi{constructor(e,r){l(this,"slow");l(this,"cb");l(this,"notified");this.slow=e,this.cb=r,this.notified=!1}maybeNotify(e){e<=this.slow?this.notified=!1:this.notified||(this.cb(e),this.notified=!0)}}class Un extends gi.QueuedIteratorImpl{constructor(r,s,i={}){var d;super();l(this,"sid");l(this,"queue");l(this,"draining");l(this,"max");l(this,"subject");l(this,"drained");l(this,"protocol");l(this,"timer");l(this,"info");l(this,"cleanupFn");l(this,"closed");l(this,"requestSubject");l(this,"slow");(0,Je.extend)(this,i),this.protocol=r,this.subject=s,this.draining=!1,this.noIterator=typeof i.callback=="function",this.closed=(0,Je.deferred)();const a=!((d=r.options)!=null&&d.noAsyncTraces);i.timeout&&(this.timer=(0,Je.timeout)(i.timeout,a),this.timer.then(()=>{this.timer=void 0}).catch(m=>{this.stop(m),this.noIterator&&this.callback(m,{})})),this.noIterator||this.iterClosed.then(m=>{this.closed.resolve(m),this.unsubscribe()})}setSlowNotificationFn(r,s){if(this.slow=void 0,s){if(this.noIterator)throw new Error("callbacks don't support slow notifications");this.slow=new wi(r,s)}}callback(r,s){this.cancelTimeout(),r?this.stop(r):this.push(s),!r&&this.slow&&this.slow.maybeNotify(this.getPending())}close(r){if(!this.isClosed()){this.cancelTimeout();const s=()=>{if(this.stop(),this.cleanupFn)try{this.cleanupFn(this,this.info)}catch{}this.closed.resolve(r)};this.noIterator?s():this.push(s)}}unsubscribe(r){this.protocol.unsubscribe(this,r)}cancelTimeout(){this.timer&&(this.timer.cancel(),this.timer=void 0)}drain(){return this.protocol.isClosed()?Promise.reject(new Ae.errors.ClosedConnectionError):this.isClosed()?Promise.reject(new Ae.errors.InvalidOperationError("subscription is already closed")):(this.drained||(this.draining=!0,this.protocol.unsub(this),this.drained=this.protocol.flush((0,Je.deferred)()).then(()=>{this.protocol.subscriptions.cancel(this)}).catch(()=>{this.protocol.subscriptions.cancel(this)})),this.drained)}isDraining(){return this.draining}isClosed(){return this.done}getSubject(){return this.subject}getMax(){return this.max}getID(){return this.sid}}Me.SubscriptionImpl=Un;class Ln{constructor(){l(this,"mux");l(this,"subs");l(this,"sidCounter");this.sidCounter=0,this.mux=null,this.subs=new Map}size(){return this.subs.size}add(e){return this.sidCounter++,e.sid=this.sidCounter,this.subs.set(e.sid,e),e}setMux(e){return this.mux=e,e}getMux(){return this.mux}get(e){return this.subs.get(e)}resub(e){return this.sidCounter++,this.subs.delete(e.sid),e.sid=this.sidCounter,this.subs.set(e.sid,e),e}all(){return Array.from(this.subs.values())}cancel(e){e&&(e.close(),this.subs.delete(e.sid))}handleError(e){const r=this.all();let s;return e.operation==="subscription"?s=r.find(i=>i.subject===e.subject&&i.queue===e.queue):e.operation==="publish"&&(s=r.find(i=>i.requestSubject===e.subject)),s?(s.callback(e,{}),s.close(e),this.subs.delete(s.sid),s!==this.mux):!1}close(){this.subs.forEach(e=>{e.close()})}}Me.Subscriptions=Ln;class er{constructor(e,r){l(this,"connected");l(this,"connectedOnce");l(this,"infoReceived");l(this,"info");l(this,"muxSubscriptions");l(this,"options");l(this,"outbound");l(this,"pongs");l(this,"subscriptions");l(this,"transport");l(this,"noMorePublishing");l(this,"connectError");l(this,"publisher");l(this,"_closed");l(this,"closed");l(this,"listeners");l(this,"heartbeats");l(this,"parser");l(this,"outMsgs");l(this,"inMsgs");l(this,"outBytes");l(this,"inBytes");l(this,"pendingLimit");l(this,"lastError");l(this,"abortReconnect");l(this,"whyClosed");l(this,"servers");l(this,"server");l(this,"features");l(this,"connectPromise");l(this,"dialDelay");l(this,"raceTimer");this._closed=!1,this.connected=!1,this.connectedOnce=!1,this.infoReceived=!1,this.noMorePublishing=!1,this.abortReconnect=!1,this.listeners=[],this.pendingLimit=pi,this.outMsgs=0,this.inMsgs=0,this.outBytes=0,this.inBytes=0,this.options=e,this.publisher=r,this.subscriptions=new Ln,this.muxSubscriptions=new mi.MuxSubscription,this.outbound=new bi.DataBuffer,this.pongs=[],this.whyClosed="",this.pendingLimit=e.pendingLimit||this.pendingLimit,this.features=new In.Features({major:0,minor:0,micro:0}),this.connectPromise=null,this.dialDelay=null;const s=typeof e.servers=="string"?[e.servers]:e.servers;this.servers=new yi.Servers(s,{randomize:!e.noRandomize}),this.closed=(0,Je.deferred)(),this.parser=new et.Parser(this),this.heartbeats=new _i.Heartbeat(this,this.options.pingInterval||jr.DEFAULT_PING_INTERVAL,this.options.maxPingOut||jr.DEFAULT_MAX_PING_OUT)}resetOutbound(){this.outbound.reset();const e=this.pongs;this.pongs=[];const r=new Ae.errors.RequestError("connection disconnected");r.stack="",e.forEach(s=>{s.reject(r)}),this.parser=new et.Parser(this),this.infoReceived=!1}dispatchStatus(e){this.listeners.forEach(r=>{r.push(e)})}prepare(){this.transport&&this.transport.discard(),this.info=void 0,this.resetOutbound();const e=(0,Je.deferred)();return e.catch(()=>{}),this.pongs.unshift(e),this.connectError=r=>{e.reject(r)},this.transport=(0,it.newTransport)(),this.transport.closed().then(async r=>{if(this.connected=!1,!this.isClosed()){await this.disconnected(this.transport.closeError||this.lastError);return}}),e}disconnect(){this.dispatchStatus({type:"staleConnection"}),this.transport.disconnect()}reconnect(){return this.connected&&(this.dispatchStatus({type:"forceReconnect"}),this.transport.disconnect()),Promise.resolve()}async disconnected(e){this.dispatchStatus({type:"disconnect",server:this.servers.getCurrentServer().toString()}),this.options.reconnect?await this.dialLoop().then(()=>{this.dispatchStatus({type:"reconnect",server:this.servers.getCurrentServer().toString()}),this.lastError instanceof Ae.errors.UserAuthenticationExpiredError&&(this.lastError=void 0)}).catch(r=>{this.close(r).catch()}):await this.close(e).catch()}async dial(e){var s,i;const r=this.prepare();try{this.raceTimer=(0,Je.timeout)(this.options.timeout||2e4);const a=this.transport.connect(e,this.options);await Promise.race([a,this.raceTimer]),(async()=>{try{for await(const d of this.transport)this.parser.parse(d)}catch(d){console.log("reader closed",d)}})().then()}catch(a){r.reject(a)}try{await Promise.race([this.raceTimer,r]),(s=this.raceTimer)==null||s.cancel(),this.connected=!0,this.connectError=void 0,this.sendSubscriptions(),this.connectedOnce=!0,this.server.didConnect=!0,this.server.reconnects=0,this.flushPending(),this.heartbeats.start()}catch(a){throw(i=this.raceTimer)==null||i.cancel(),await this.transport.close(a),a}}async _doDial(e){const{resolve:r}=this.options,s=await e.resolve({fn:(0,it.getResolveFn)(),debug:this.options.debug,randomize:!this.options.noRandomize,resolve:r});let i=null;for(const a of s)try{i=null,this.dispatchStatus({type:"reconnecting"}),await this.dial(a);return}catch(d){i=d}throw i}dialLoop(){return this.connectPromise===null&&(this.connectPromise=this.dodialLoop(),this.connectPromise.then(()=>{}).catch(()=>{}).finally(()=>{this.connectPromise=null})),this.connectPromise}async dodialLoop(){let e;for(;;){this._closed&&this.servers.clear();const r=this.options.reconnectDelayHandler?this.options.reconnectDelayHandler():jr.DEFAULT_RECONNECT_TIME_WAIT;let s=r;const i=this.selectServer();if(!i||this.abortReconnect)throw e||(this.lastError?this.lastError:new Ae.errors.ConnectionError("connection refused"));const a=Date.now();if(i.lastConnect===0||i.lastConnect+r<=a){i.lastConnect=Date.now();try{await this._doDial(i);break}catch(d){if(e=d,!this.connectedOnce){if(this.options.waitOnFirstConnect)continue;this.servers.removeCurrentServer()}i.reconnects++;const m=this.options.maxReconnectAttempts||0;m!==-1&&i.reconnects>=m&&this.servers.removeCurrentServer()}}else s=Math.min(s,i.lastConnect+r-a),this.dialDelay=(0,Je.delay)(s),await this.dialDelay}}static async connect(e,r){const s=new er(e,r);return await s.dialLoop(),s}static toError(e){let r=Ae.errors.PermissionViolationError.parse(e);return r||(r=Ae.errors.UserAuthenticationExpiredError.parse(e),r)||(r=Ae.errors.AuthorizationError.parse(e),r)?r:new Ae.errors.ProtocolError(e)}processMsg(e,r){if(this.inMsgs++,this.inBytes+=r.length,!this.subscriptions.sidCounter)return;const s=this.subscriptions.get(e.sid);s&&(s.received+=1,s.callback&&s.callback(null,new vi.MsgImpl(e,r,this)),s.max!==void 0&&s.received>=s.max&&s.unsubscribe())}processError(e){let r=(0,ze.decode)(e);r.startsWith("'")&&r.endsWith("'")&&(r=r.slice(1,r.length-1));const s=er.toError(r);switch(s.constructor){case Ae.errors.PermissionViolationError:{const i=s,a=this.subscriptions.getMux(),d=a?i.subject===a.subject:!1;this.subscriptions.handleError(i),this.muxSubscriptions.handleError(d,i),d&&this.subscriptions.setMux(null)}}this.dispatchStatus({type:"error",error:s}),this.handleError(s)}handleError(e){(e instanceof Ae.errors.UserAuthenticationExpiredError||e instanceof Ae.errors.AuthorizationError)&&this.handleAuthError(e),e instanceof Ae.errors.PermissionViolationError||(this.lastError=e)}handleAuthError(e){(this.lastError instanceof Ae.errors.UserAuthenticationExpiredError||this.lastError instanceof Ae.errors.AuthorizationError)&&this.options.ignoreAuthErrorAbort===!1&&(this.abortReconnect=!0),this.connectError?this.connectError(e):this.disconnect()}processPing(){this.transport.send(xi)}processPong(){const e=this.pongs.shift();e&&e.resolve()}processInfo(e){const r=JSON.parse((0,ze.decode)(e));this.info=r;const s=this.options&&this.options.ignoreClusterUpdates?void 0:this.servers.update(r,this.transport.isEncrypted());if(!this.infoReceived){this.features.update((0,In.parseSemVer)(r.version)),this.infoReceived=!0,this.transport.isEncrypted()&&this.servers.updateTLSName();const{version:a,lang:d}=this.transport;try{const m=new kn({version:a,lang:d},this.options,r.nonce);r.headers&&(m.headers=!0,m.no_responders=!0);const S=JSON.stringify(m);this.transport.send((0,ze.encode)(`CONNECT ${S}${it.CR_LF}`)),this.transport.send(Rn)}catch(m){this.close(m).catch()}}if(s){const{added:a,deleted:d}=s;this.dispatchStatus({type:"update",added:a,deleted:d})}(r.ldm!==void 0?r.ldm:!1)&&this.dispatchStatus({type:"ldm",server:this.servers.getCurrentServer().toString()})}push(e){switch(e.kind){case et.Kind.MSG:{const{msg:r,data:s}=e;this.processMsg(r,s);break}case et.Kind.OK:break;case et.Kind.ERR:this.processError(e.data);break;case et.Kind.PING:this.processPing();break;case et.Kind.PONG:this.processPong();break;case et.Kind.INFO:this.processInfo(e.data);break}}sendCommand(e,...r){const s=this.outbound.length();let i;typeof e=="string"?i=(0,ze.encode)(e):i=e,this.outbound.fill(i,...r),s===0?queueMicrotask(()=>{this.flushPending()}):this.outbound.size()>=this.pendingLimit&&this.flushPending()}publish(e,r=ze.Empty,s){let i;if(r instanceof Uint8Array)i=r;else if(typeof r=="string")i=ze.TE.encode(r);else throw new TypeError("payload types can be strings or Uint8Array");let a=i.length;s=s||{},s.reply=s.reply||"";let d=ze.Empty,m=0;if(s.headers&&(this.info&&!this.info.headers&&Ae.InvalidArgumentError.format("headers","are not available on this server"),d=s.headers.encode(),m=d.length,a=i.length+m),this.info&&a>this.info.max_payload)throw Ae.InvalidArgumentError.format("payload","max_payload size exceeded");this.outBytes+=a,this.outMsgs++;let S;s.headers?(s.reply?S=`HPUB ${e} ${s.reply} ${m} ${a}\r
|
|
10
|
+
`:S=`HPUB ${e} ${m} ${a}\r
|
|
11
|
+
`,this.sendCommand(S,d,i,it.CRLF)):(s.reply?S=`PUB ${e} ${s.reply} ${a}\r
|
|
12
|
+
`:S=`PUB ${e} ${a}\r
|
|
13
|
+
`,this.sendCommand(S,i,it.CRLF))}request(e){return this.initMux(),this.muxSubscriptions.add(e),e}subscribe(e){return this.subscriptions.add(e),this._subunsub(e),e}_sub(e){e.queue?this.sendCommand(`SUB ${e.subject} ${e.queue} ${e.sid}\r
|
|
14
|
+
`):this.sendCommand(`SUB ${e.subject} ${e.sid}\r
|
|
15
|
+
`)}_subunsub(e){return this._sub(e),e.max&&this.unsubscribe(e,e.max),e}unsubscribe(e,r){this.unsub(e,r),(e.max===void 0||e.received>=e.max)&&this.subscriptions.cancel(e)}unsub(e,r){!e||this.isClosed()||(r?this.sendCommand(`UNSUB ${e.sid} ${r}\r
|
|
16
|
+
`):this.sendCommand(`UNSUB ${e.sid}\r
|
|
17
|
+
`),e.max=r)}resub(e,r){!e||this.isClosed()||(this.unsub(e),e.subject=r,this.subscriptions.resub(e),this._sub(e))}flush(e){return e||(e=(0,Je.deferred)()),this.pongs.push(e),this.outbound.fill(Rn),this.flushPending(),e}sendSubscriptions(){const e=[];this.subscriptions.all().forEach(r=>{const s=r;s.queue?e.push(`SUB ${s.subject} ${s.queue} ${s.sid}${it.CR_LF}`):e.push(`SUB ${s.subject} ${s.sid}${it.CR_LF}`)}),e.length&&this.transport.send((0,ze.encode)(e.join("")))}async close(e){var s,i;if(this._closed)return;this.whyClosed=new Error("close trace").stack||"",this.heartbeats.cancel(),this.connectError&&(this.connectError(e),this.connectError=void 0),this.muxSubscriptions.close(),this.subscriptions.close();const r=[];for(let a=0;a<this.listeners.length;a++){const d=this.listeners[a];d&&(d.push({type:"close"}),d.stop(),r.push(d.iterClosed))}r.length&&await Promise.all(r),this._closed=!0,await this.transport.close(e),(s=this.raceTimer)==null||s.cancel(),(i=this.dialDelay)==null||i.cancel(),this.closed.resolve(e)}isClosed(){return this._closed}async drain(){const e=this.subscriptions.all(),r=[];e.forEach(s=>{r.push(s.drain())});try{await Promise.allSettled(r)}catch{}finally{this.noMorePublishing=!0,await this.flush()}return this.close()}flushPending(){if(!(!this.infoReceived||!this.connected)&&this.outbound.size()){const e=this.outbound.drain();this.transport.send(e)}}initMux(){if(!this.subscriptions.getMux()){const r=this.muxSubscriptions.init(this.options.inboxPrefix),s=new Un(this,`${r}*`);s.callback=this.muxSubscriptions.dispatcher(),this.subscriptions.setMux(s),this.subscribe(s)}}selectServer(){const e=this.servers.selectServer();if(e!==void 0)return this.server=e,this.server}getServer(){return this.server}}Me.ProtocolHandler=er;var We={};Object.defineProperty(We,"__esModule",{value:!0}),We.RequestOne=We.RequestMany=We.BaseRequest=void 0;const Nr=ye,Ei=St,tr=te;class Mr{constructor(e,r,s=!0){l(this,"token");l(this,"received");l(this,"ctx");l(this,"requestSubject");l(this,"mux");this.mux=e,this.requestSubject=r,this.received=0,this.token=Ei.nuid.next(),s&&(this.ctx=new tr.RequestError)}}We.BaseRequest=Mr;class Si extends Mr{constructor(r,s,i={maxWait:1e3}){super(r,s);l(this,"callback");l(this,"done");l(this,"timer");l(this,"max");l(this,"opts");if(this.opts=i,typeof this.opts.callback!="function")throw new TypeError("callback must be a function");this.callback=this.opts.callback,this.max=typeof i.maxMessages=="number"&&i.maxMessages>0?i.maxMessages:-1,this.done=(0,Nr.deferred)(),this.done.then(()=>{this.callback(null,null)}),this.timer=setTimeout(()=>{this.cancel()},i.maxWait)}cancel(r){r&&this.callback(r,null),clearTimeout(this.timer),this.mux.cancel(this),this.done.resolve()}resolver(r,s){r?(this.ctx&&(r.stack+=`
|
|
18
|
+
|
|
19
|
+
${this.ctx.stack}`),this.cancel(r)):(this.callback(null,s),this.opts.strategy==="count"&&(this.max--,this.max===0&&this.cancel()),this.opts.strategy==="stall"&&(clearTimeout(this.timer),this.timer=setTimeout(()=>{this.cancel()},this.opts.stall||300)),this.opts.strategy==="sentinel"&&s&&s.data.length===0&&this.cancel())}}We.RequestMany=Si;class Pi extends Mr{constructor(r,s,i={timeout:1e3},a=!0){super(r,s,a);l(this,"deferred");l(this,"timer");this.deferred=(0,Nr.deferred)(),this.timer=(0,Nr.timeout)(i.timeout,a)}resolver(r,s){this.timer&&this.timer.cancel(),r?(r instanceof tr.TimeoutError||(this.ctx?(this.ctx.message=r.message,this.ctx.cause=r,r=this.ctx):r=new tr.errors.RequestError(r.message,{cause:r})),this.deferred.reject(r)):this.deferred.resolve(s),this.cancel()}cancel(r){this.timer&&this.timer.cancel(),this.mux.cancel(this),this.deferred.reject(r||new tr.RequestError("cancelled"))}}We.RequestOne=Pi,Object.defineProperty(Et,"__esModule",{value:!0}),Et.NatsConnectionImpl=void 0;const Ai=ye,qn=Me,Oi=ke,Fn=$e,Ci=Zt,ji=jt,Bn=dt,Kn=We,Dn=Oe,we=te;class Tr{constructor(e){l(this,"options");l(this,"protocol");l(this,"draining");l(this,"closeListeners");this.draining=!1,this.options=(0,ji.parseOptions)(e)}static connect(e={}){return new Promise((r,s)=>{const i=new Tr(e);qn.ProtocolHandler.connect(i.options,i).then(a=>{i.protocol=a,r(i)}).catch(a=>{s(a)})})}closed(){return this.protocol.closed}async close(){await this.protocol.close()}_check(e,r,s){if(this.isClosed())throw new we.errors.ClosedConnectionError;if(r&&this.isDraining())throw new we.errors.DrainingConnectionError;if(s&&this.protocol.noMorePublishing)throw new we.errors.DrainingConnectionError;if(e=e||"",e.length===0)throw new we.errors.InvalidSubjectError(e)}publish(e,r,s){if(this._check(e,!1,!0),s!=null&&s.reply&&this._check(s.reply,!1,!0),typeof(s==null?void 0:s.traceOnly)=="boolean"){const i=s.headers||(0,Fn.headers)();i.set("Nats-Trace-Only","true"),s.headers=i}if(typeof(s==null?void 0:s.traceDestination)=="string"){const i=s.headers||(0,Fn.headers)();i.set("Nats-Trace-Dest",s.traceDestination),s.headers=i}this.protocol.publish(e,r,s)}publishMessage(e){return this.publish(e.subject,e.data,{reply:e.reply,headers:e.headers})}respondMessage(e){return e.reply?(this.publish(e.reply,e.data,{reply:e.reply,headers:e.headers}),!0):!1}subscribe(e,r={}){this._check(e,!0,!1);const s=new qn.SubscriptionImpl(this.protocol,e,r);return typeof r.callback!="function"&&typeof r.slow=="number"&&s.setSlowNotificationFn(r.slow,i=>{this.protocol.dispatchStatus({type:"slowConsumer",sub:s,pending:i})}),this.protocol.subscribe(s),s}_resub(e,r,s){this._check(r,!0,!1);const i=e;i.max=s,s&&(i.max=s+i.received),this.protocol.resub(i,r)}requestMany(e,r=Oi.Empty,s={maxWait:1e3,maxMessages:-1}){const i=!this.protocol.options.noAsyncTraces;try{this._check(e,!0,!0)}catch(S){return Promise.reject(S)}if(s.strategy=s.strategy||"timer",s.maxWait=s.maxWait||1e3,s.maxWait<1)return Promise.reject(we.InvalidArgumentError.format("timeout","must be greater than 0"));const a=new Bn.QueuedIteratorImpl;function d(S){a.push(()=>{a.stop(S)})}function m(S,_){S||_===null?d(S===null?void 0:S):a.push(_)}if(s.noMux){const S=i?new Error().stack:null;let _=typeof s.maxMessages=="number"&&s.maxMessages>0?s.maxMessages:-1;const w=this.subscribe((0,Dn.createInbox)(this.options.inboxPrefix),{callback:(se,ge)=>{var qe,L;if(((qe=ge==null?void 0:ge.data)==null?void 0:qe.length)===0&&((L=ge==null?void 0:ge.headers)==null?void 0:L.status)==="503"&&(se=new we.errors.NoRespondersError(e)),se){S&&(se.stack+=`
|
|
20
|
+
|
|
21
|
+
${S}`),E(se);return}m(null,ge),s.strategy==="count"&&(_--,_===0&&E()),s.strategy==="stall"&&(U(),M=setTimeout(()=>{E()},300)),s.strategy==="sentinel"&&ge&&ge.data.length===0&&E()}});w.requestSubject=e,w.closed.then(()=>{d()}).catch(se=>{a.stop(se)});const E=se=>{se&&a.push(()=>{throw se}),U(),w.drain().then(()=>{d()}).catch(ge=>{d()})};a.iterClosed.then(()=>{U(),w==null||w.unsubscribe()}).catch(se=>{U(),w==null||w.unsubscribe()});const{headers:b,traceDestination:p,traceOnly:R}=s;try{this.publish(e,r,{reply:w.getSubject(),headers:b,traceDestination:p,traceOnly:R})}catch(se){E(se)}let M=setTimeout(()=>{E()},s.maxWait);const U=()=>{M&&clearTimeout(M)}}else{const S=s;S.callback=m,a.iterClosed.then(()=>{_.cancel()}).catch(p=>{_.cancel(p)});const _=new Kn.RequestMany(this.protocol.muxSubscriptions,e,S);this.protocol.request(_);const{headers:w,traceDestination:E,traceOnly:b}=s;try{this.publish(e,r,{reply:`${this.protocol.muxSubscriptions.baseInbox}${_.token}`,headers:w,traceDestination:E,traceOnly:b})}catch(p){_.cancel(p)}}return Promise.resolve(a)}request(e,r,s={timeout:1e3,noMux:!1}){try{this._check(e,!0,!0)}catch(a){return Promise.reject(a)}const i=!this.protocol.options.noAsyncTraces;if(s.timeout=s.timeout||1e3,s.timeout<1)return Promise.reject(we.InvalidArgumentError.format("timeout","must be greater than 0"));if(!s.noMux&&s.reply)return Promise.reject(we.InvalidArgumentError.format(["reply","noMux"],"are mutually exclusive"));if(s.noMux){const a=s.reply?s.reply:(0,Dn.createInbox)(this.options.inboxPrefix),d=(0,Ai.deferred)(),m=i?new we.errors.RequestError(""):null,S=this.subscribe(a,{max:1,timeout:s.timeout,callback:(_,w)=>{var E,b;w&&((E=w.data)==null?void 0:E.length)===0&&((b=w.headers)==null?void 0:b.code)===503&&(_=new we.errors.NoRespondersError(e)),_?(_ instanceof we.TimeoutError||(m?(m.message=_.message,m.cause=_,_=m):_=new we.errors.RequestError(_.message,{cause:_})),d.reject(_),S.unsubscribe()):d.resolve(w)}});return S.requestSubject=e,this.protocol.publish(e,r,{reply:a,headers:s.headers}),d}else{const a=new Kn.RequestOne(this.protocol.muxSubscriptions,e,s,i);this.protocol.request(a);const{headers:d,traceDestination:m,traceOnly:S}=s;try{this.publish(e,r,{reply:`${this.protocol.muxSubscriptions.baseInbox}${a.token}`,headers:d,traceDestination:m,traceOnly:S})}catch(w){a.cancel(w)}const _=Promise.race([a.timer,a.deferred]);return _.catch(()=>{a.cancel()}),_}}flush(){return this.isClosed()?Promise.reject(new we.errors.ClosedConnectionError):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(new we.errors.ClosedConnectionError):this.isDraining()?Promise.reject(new we.errors.DrainingConnectionError):(this.draining=!0,this.protocol.drain())}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){const e=this.protocol.getServer();return e?e.listen:""}status(){const e=new Bn.QueuedIteratorImpl;return e.iterClosed.then(()=>{const r=this.protocol.listeners.indexOf(e);r>-1&&this.protocol.listeners.splice(r,1)}),this.protocol.listeners.push(e),e}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((r,s)=>r==="time"?new Date(Date.parse(s)):s)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}getServerVersion(){const e=this.info;return e?(0,Ci.parseSemVer)(e.version):void 0}async rtt(){if(this.isClosed())throw new we.errors.ClosedConnectionError;if(!this.protocol.connected)throw new we.errors.RequestError("connection disconnected");const e=Date.now();return await this.flush(),Date.now()-e}get features(){return this.protocol.features}reconnect(){return this.isClosed()?Promise.reject(new we.errors.ClosedConnectionError):this.isDraining()?Promise.reject(new we.errors.DrainingConnectionError):this.protocol.reconnect()}addCloseListener(e){this.closeListeners===void 0&&(this.closeListeners=new Ni(this.closed())),this.closeListeners.add(e)}removeCloseListener(e){this.closeListeners&&this.closeListeners.remove(e)}}Et.NatsConnectionImpl=Tr;class Ni{constructor(e){l(this,"listeners");this.listeners=[],e.then(r=>{this.notify(r)})}add(e){this.listeners.push(e)}remove(e){this.listeners=this.listeners.filter(r=>r!==e)}notify(e){this.listeners.forEach(r=>{if(typeof r.connectionClosedCallback=="function")try{r.connectionClosedCallback(e)}catch{}}),this.listeners=[]}}var Xe={},Ir={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Empty=void 0;var e=ke;Object.defineProperty(t,"Empty",{enumerable:!0,get:function(){return e.Empty}})})(Ir),Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.Bench=Xe.Metric=void 0,Xe.throughput=Gn,Xe.msgThroughput=Ri,Xe.humanizeBytes=zn;const Mi=Ir,Ti=St,Rr=ye;class ot{constructor(e,r){l(this,"name");l(this,"duration");l(this,"date");l(this,"payload");l(this,"msgs");l(this,"lang");l(this,"version");l(this,"bytes");l(this,"asyncRequests");l(this,"min");l(this,"max");this.name=e,this.duration=r,this.date=Date.now(),this.payload=0,this.msgs=0,this.bytes=0}toString(){const e=this.duration/1e3,r=Math.round(this.msgs/e),s=this.asyncRequests?"asyncRequests":"";let i="";return this.max&&(i=`${this.min}/${this.max}`),`${this.name}${s?" [asyncRequests]":""} ${ki(r)} msgs/sec - [${e.toFixed(2)} secs] ~ ${Gn(this.bytes,e)} ${i}`}toCsv(){return`"${this.name}",${new Date(this.date).toISOString()},${this.lang},${this.version},${this.msgs},${this.payload},${this.bytes},${this.duration},${this.asyncRequests?this.asyncRequests:!1}
|
|
22
|
+
`}static header(){return`Test,Date,Lang,Version,Count,MsgPayload,Bytes,Millis,Async
|
|
23
|
+
`}}Xe.Metric=ot;class Ii{constructor(e,r={msgs:1e5,size:128,subject:"",asyncRequests:!1,pub:!1,sub:!1,req:!1,rep:!1}){l(this,"nc");l(this,"callbacks");l(this,"msgs");l(this,"size");l(this,"subject");l(this,"asyncRequests");l(this,"pub");l(this,"sub");l(this,"req");l(this,"rep");l(this,"perf");l(this,"payload");if(this.nc=e,this.callbacks=r.callbacks||!1,this.msgs=r.msgs||0,this.size=r.size||0,this.subject=r.subject||Ti.nuid.next(),this.asyncRequests=r.asyncRequests||!1,this.pub=r.pub||!1,this.sub=r.sub||!1,this.req=r.req||!1,this.rep=r.rep||!1,this.perf=new Rr.Perf,this.payload=this.size?new Uint8Array(this.size):Mi.Empty,!this.pub&&!this.sub&&!this.req&&!this.rep)throw new Error("no options selected")}async run(){return this.nc.closed().then(e=>{if(e)throw e}),this.callbacks?await this.runCallbacks():await this.runAsync(),this.processMetrics()}processMetrics(){const e=this.nc,{lang:r,version:s}=e.protocol.transport;this.pub&&this.sub&&this.perf.measure("pubsub","pubStart","subStop"),this.req&&this.rep&&this.perf.measure("reqrep","reqStart","reqStop");const i=this.perf.getEntries(),a=i.find(p=>p.name==="pubsub"),d=i.find(p=>p.name==="reqrep"),m=i.find(p=>p.name==="req"),S=i.find(p=>p.name==="rep"),_=i.find(p=>p.name==="pub"),w=i.find(p=>p.name==="sub"),E=this.nc.stats(),b=[];if(a){const{name:p,duration:R}=a,M=new ot(p,R);M.msgs=this.msgs*2,M.bytes=E.inBytes+E.outBytes,M.lang=r,M.version=s,M.payload=this.payload.length,b.push(M)}if(d){const{name:p,duration:R}=d,M=new ot(p,R);M.msgs=this.msgs*2,M.bytes=E.inBytes+E.outBytes,M.lang=r,M.version=s,M.payload=this.payload.length,b.push(M)}if(_){const{name:p,duration:R}=_,M=new ot(p,R);M.msgs=this.msgs,M.bytes=E.outBytes,M.lang=r,M.version=s,M.payload=this.payload.length,b.push(M)}if(w){const{name:p,duration:R}=w,M=new ot(p,R);M.msgs=this.msgs,M.bytes=E.inBytes,M.lang=r,M.version=s,M.payload=this.payload.length,b.push(M)}if(S){const{name:p,duration:R}=S,M=new ot(p,R);M.msgs=this.msgs,M.bytes=E.inBytes+E.outBytes,M.lang=r,M.version=s,M.payload=this.payload.length,b.push(M)}if(m){const{name:p,duration:R}=m,M=new ot(p,R);M.msgs=this.msgs,M.bytes=E.inBytes+E.outBytes,M.lang=r,M.version=s,M.payload=this.payload.length,b.push(M)}return b}async runCallbacks(){const e=[];if(this.sub){const r=(0,Rr.deferred)();e.push(r);let s=0;this.nc.subscribe(this.subject,{max:this.msgs,callback:()=>{s++,s===1&&this.perf.mark("subStart"),s===this.msgs&&(this.perf.mark("subStop"),this.perf.measure("sub","subStart","subStop"),r.resolve())}})}if(this.rep){const r=(0,Rr.deferred)();e.push(r);let s=0;this.nc.subscribe(this.subject,{max:this.msgs,callback:(i,a)=>{a.respond(this.payload),s++,s===1&&this.perf.mark("repStart"),s===this.msgs&&(this.perf.mark("repStop"),this.perf.measure("rep","repStart","repStop"),r.resolve())}})}if(this.pub){const r=(async()=>{this.perf.mark("pubStart");for(let s=0;s<this.msgs;s++)this.nc.publish(this.subject,this.payload);await this.nc.flush(),this.perf.mark("pubStop"),this.perf.measure("pub","pubStart","pubStop")})();e.push(r)}if(this.req){const r=(async()=>{if(this.asyncRequests){this.perf.mark("reqStart");const s=[];for(let i=0;i<this.msgs;i++)s.push(this.nc.request(this.subject,this.payload,{timeout:2e4}));await Promise.all(s),this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}else{this.perf.mark("reqStart");for(let s=0;s<this.msgs;s++)await this.nc.request(this.subject);this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}})();e.push(r)}await Promise.all(e)}async runAsync(){const e=[];if(this.rep){let r=!1;const s=this.nc.subscribe(this.subject,{max:this.msgs}),i=(async()=>{for await(const a of s)r||(this.perf.mark("repStart"),r=!0),a.respond(this.payload);await this.nc.flush(),this.perf.mark("repStop"),this.perf.measure("rep","repStart","repStop")})();e.push(i)}if(this.sub){let r=!1;const s=this.nc.subscribe(this.subject,{max:this.msgs}),i=(async()=>{for await(const a of s)r||(this.perf.mark("subStart"),r=!0);this.perf.mark("subStop"),this.perf.measure("sub","subStart","subStop")})();e.push(i)}if(this.pub){const r=(async()=>{this.perf.mark("pubStart");for(let s=0;s<this.msgs;s++)this.nc.publish(this.subject,this.payload);await this.nc.flush(),this.perf.mark("pubStop"),this.perf.measure("pub","pubStart","pubStop")})();e.push(r)}if(this.req){const r=(async()=>{if(this.asyncRequests){this.perf.mark("reqStart");const s=[];for(let i=0;i<this.msgs;i++)s.push(this.nc.request(this.subject,this.payload,{timeout:2e4}));await Promise.all(s),this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}else{this.perf.mark("reqStart");for(let s=0;s<this.msgs;s++)await this.nc.request(this.subject);this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}})();e.push(r)}await Promise.all(e)}}Xe.Bench=Ii;function Gn(t,e){return`${zn(t/e)}/sec`}function Ri(t,e){return`${Math.floor(t/e)} msgs/sec`}function zn(t,e=!1){const r=e?1e3:1024,s=e?["k","M","G","T","P","E"]:["K","M","G","T","P","E"],i=e?"iB":"B";if(t<r)return`${t.toFixed(2)} ${i}`;const a=parseInt(Math.log(t)/Math.log(r)+""),d=parseInt(a-1+"");return`${(t/Math.pow(r,a)).toFixed(2)} ${s[d]}${i}`}function ki(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.IdleHeartbeatMonitor=void 0;class Ui{constructor(e,r,s={maxOut:2}){l(this,"interval");l(this,"maxOut");l(this,"cancelAfter");l(this,"timer");l(this,"autoCancelTimer");l(this,"last");l(this,"missed");l(this,"count");l(this,"callback");this.interval=e,this.maxOut=(s==null?void 0:s.maxOut)||2,this.cancelAfter=(s==null?void 0:s.cancelAfter)||0,this.last=Date.now(),this.missed=0,this.count=0,this.callback=r,this._schedule()}cancel(){this.autoCancelTimer&&clearTimeout(this.autoCancelTimer),this.timer&&clearInterval(this.timer),this.timer=0,this.autoCancelTimer=0,this.missed=0}work(){this.last=Date.now(),this.missed=0}_change(e,r=0,s=2){this.interval=e,this.maxOut=s,this.cancelAfter=r,this.restart()}restart(){this.cancel(),this._schedule()}_schedule(){this.cancelAfter>0&&(this.autoCancelTimer=setTimeout(()=>{this.cancel()},this.cancelAfter)),this.timer=setInterval(()=>{if(this.count++,Date.now()-this.last>this.interval&&this.missed++,this.missed>=this.maxOut)try{this.callback(this.missed)===!0&&this.cancel()}catch(e){console.log(e)}},this.interval)}}rr.IdleHeartbeatMonitor=Ui;var gt={},nr={};Object.defineProperty(nr,"__esModule",{value:!0}),nr.version=void 0,nr.version="3.2.0",Object.defineProperty(gt,"__esModule",{value:!0}),gt.WsTransport=void 0,gt.wsUrlParseFn=Yn,gt.wsconnect=zi;const Ze=ye,Jn=rt,Li=jt,qi=nt,Fi=Me,Bi=Et,Ki=nr,Hn=te,Di=Ki.version,Gi="nats.ws";class Vn{constructor(){l(this,"version");l(this,"lang");l(this,"closeError");l(this,"connected");l(this,"done");l(this,"socket");l(this,"options");l(this,"socketClosed");l(this,"encrypted");l(this,"peeked");l(this,"yields");l(this,"signal");l(this,"closedNotification");this.version=Di,this.lang=Gi,this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=(0,Ze.deferred)(),this.closedNotification=(0,Ze.deferred)()}async connect(e,r){const s=(0,Ze.deferred)();this.options=r;const i=e.src;if(r.wsFactory){const{socket:a,encrypted:d}=await r.wsFactory(e.src,r);this.socket=a,this.encrypted=d}else this.encrypted=i.indexOf("wss://")===0,this.socket=new WebSocket(i);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.done&&this._closed(new Error("aborted"))},this.socket.onmessage=a=>{if(this.done)return;if(this.yields.push(new Uint8Array(a.data)),this.peeked){this.signal.resolve();return}const d=qi.DataBuffer.concat(...this.yields),m=(0,Jn.extractProtocolMessage)(d);if(m!==""){const S=Fi.INFO.exec(m);if(!S){r.debug&&console.error("!!!",(0,Ze.render)(d)),s.reject(new Error("unexpected response from server"));return}try{const _=JSON.parse(S[1]);(0,Li.checkOptions)(_,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),s.resolve()}catch(_){s.reject(_);return}}},this.socket.onclose=a=>{let d;!a.wasClean&&a.reason!==""&&(d=new Error(a.reason)),this._closed(d),this._cleanup()},this.socket.onerror=a=>{if(this.done)return;const d=a,m=new Hn.errors.ConnectionError(d.message);s.reject(m),this._cleanup()},s}_cleanup(){this.socketClosed===!1&&(this.socketClosed=!0,this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.closedNotification.resolve(this.closeError))}disconnect(){this._closed(void 0,!0)}async _closed(e,r=!0){if(this.done){try{this.socket.close()}catch{}return}if(this.closeError=e,!e)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await(0,Ze.delay)(100);this.done=!0;try{this.socket.close()}catch{}return this.closedNotification}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async*iterate(){for(;;){if(this.done)return;this.yields.length===0&&await this.signal;const e=this.yields;this.yields=[];for(let r=0;r<e.length;r++)this.options.debug&&console.info(`> ${(0,Ze.render)(e[r])}`),yield e[r];if(this.done)break;this.yields.length===0&&(e.length=0,this.yields=e,this.signal=(0,Ze.deferred)())}}isEncrypted(){return this.connected&&this.encrypted}send(e){if(!this.done)try{this.socket.send(e.buffer),this.options.debug&&console.info(`< ${(0,Ze.render)(e)}`);return}catch(r){this.options.debug&&console.error(`!!! ${(0,Ze.render)(e)}: ${r}`)}}close(e){return this._closed(e,!1)}closed(){return this.closedNotification}discard(){var e;(e=this.socket)==null||e.close()}}gt.WsTransport=Vn;function Yn(t,e){/^(.*:\/\/)(.*)/.test(t)||(typeof e=="boolean"?t=`${e===!0?"https":"http"}://${t}`:t=`https://${t}`);let s=new URL(t);const i=s.protocol.toLowerCase();i==="ws:"&&(e=!1),i==="wss:"&&(e=!0),i!=="https:"&&i!=="http"&&(t=t.replace(/^(.*:\/\/)(.*)/gm,"$2"),s=new URL(`http://${t}`));let a,d;const m=s.hostname,S=s.pathname,_=s.search||"";switch(i){case"http:":case"ws:":case"nats:":d=s.port||"80",a="ws:";break;case"https:":case"wss:":case"tls:":d=s.port||"443",a="wss:";break;default:d=s.port||e===!0?"443":"80",a=e===!0?"wss:":"ws:";break}return`${a}//${m}:${d}${S}${_}`}function zi(t={}){return(0,Jn.setTransportFactory)({defaultPort:443,urlParseFn:Yn,factory:()=>{if(t.tls)throw Hn.InvalidArgumentError.format("tls","is not configurable on w3c websocket connections");return new Vn}}),Bi.NatsConnectionImpl.connect(t)}(function(t){var e=he&&he.__createBinding||(Object.create?function(Ve,Pe,Ie,Re){Re===void 0&&(Re=Ie);var Ue=Object.getOwnPropertyDescriptor(Pe,Ie);(!Ue||("get"in Ue?!Pe.__esModule:Ue.writable||Ue.configurable))&&(Ue={enumerable:!0,get:function(){return Pe[Ie]}}),Object.defineProperty(Ve,Re,Ue)}:function(Ve,Pe,Ie,Re){Re===void 0&&(Re=Ie),Ve[Re]=Pe[Ie]}),r=he&&he.__exportStar||function(Ve,Pe){for(var Ie in Ve)Ie!=="default"&&!Object.prototype.hasOwnProperty.call(Pe,Ie)&&e(Pe,Ve,Ie)};Object.defineProperty(t,"__esModule",{value:!0}),t.TD=t.Metric=t.Bench=t.writeAll=t.readAll=t.MAX_SIZE=t.DenoBuffer=t.State=t.Parser=t.Kind=t.QueuedIteratorImpl=t.usernamePasswordAuthenticator=t.tokenAuthenticator=t.nkeyAuthenticator=t.jwtAuthenticator=t.credsAuthenticator=t.RequestOne=t.parseOptions=t.hasWsProtocol=t.defaultOptions=t.DEFAULT_MAX_RECONNECT_ATTEMPTS=t.checkUnsupportedOption=t.checkOptions=t.buildAuthenticator=t.DataBuffer=t.MuxSubscription=t.Heartbeat=t.MsgHdrsImpl=t.headers=t.canonicalMIMEHeaderKey=t.timeout=t.SimpleMutex=t.render=t.nanos=t.millis=t.extend=t.delay=t.deferred=t.deadline=t.collect=t.backoff=t.ProtocolHandler=t.INFO=t.Connect=t.setTransportFactory=t.getResolveFn=t.MsgImpl=t.nuid=t.Nuid=t.NatsConnectionImpl=void 0,t.UserAuthenticationExpiredError=t.TimeoutError=t.RequestError=t.ProtocolError=t.PermissionViolationError=t.NoRespondersError=t.InvalidSubjectError=t.InvalidOperationError=t.InvalidArgumentError=t.errors=t.DrainingConnectionError=t.ConnectionError=t.ClosedConnectionError=t.AuthorizationError=t.wsUrlParseFn=t.wsconnect=t.Servers=t.isIPV4OrHostname=t.IdleHeartbeatMonitor=t.Subscriptions=t.SubscriptionImpl=t.syncIterator=t.Match=t.createInbox=t.protoLen=t.extractProtocolMessage=t.Empty=t.parseSemVer=t.Features=t.Feature=t.compare=t.parseIP=t.isIP=t.ipV4=t.TE=void 0;var s=Et;Object.defineProperty(t,"NatsConnectionImpl",{enumerable:!0,get:function(){return s.NatsConnectionImpl}});var i=St;Object.defineProperty(t,"Nuid",{enumerable:!0,get:function(){return i.Nuid}}),Object.defineProperty(t,"nuid",{enumerable:!0,get:function(){return i.nuid}});var a=Ct;Object.defineProperty(t,"MsgImpl",{enumerable:!0,get:function(){return a.MsgImpl}});var d=rt;Object.defineProperty(t,"getResolveFn",{enumerable:!0,get:function(){return d.getResolveFn}}),Object.defineProperty(t,"setTransportFactory",{enumerable:!0,get:function(){return d.setTransportFactory}});var m=Me;Object.defineProperty(t,"Connect",{enumerable:!0,get:function(){return m.Connect}}),Object.defineProperty(t,"INFO",{enumerable:!0,get:function(){return m.INFO}}),Object.defineProperty(t,"ProtocolHandler",{enumerable:!0,get:function(){return m.ProtocolHandler}});var S=ye;Object.defineProperty(t,"backoff",{enumerable:!0,get:function(){return S.backoff}}),Object.defineProperty(t,"collect",{enumerable:!0,get:function(){return S.collect}}),Object.defineProperty(t,"deadline",{enumerable:!0,get:function(){return S.deadline}}),Object.defineProperty(t,"deferred",{enumerable:!0,get:function(){return S.deferred}}),Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return S.delay}}),Object.defineProperty(t,"extend",{enumerable:!0,get:function(){return S.extend}}),Object.defineProperty(t,"millis",{enumerable:!0,get:function(){return S.millis}}),Object.defineProperty(t,"nanos",{enumerable:!0,get:function(){return S.nanos}}),Object.defineProperty(t,"render",{enumerable:!0,get:function(){return S.render}}),Object.defineProperty(t,"SimpleMutex",{enumerable:!0,get:function(){return S.SimpleMutex}}),Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return S.timeout}});var _=$e;Object.defineProperty(t,"canonicalMIMEHeaderKey",{enumerable:!0,get:function(){return _.canonicalMIMEHeaderKey}}),Object.defineProperty(t,"headers",{enumerable:!0,get:function(){return _.headers}}),Object.defineProperty(t,"MsgHdrsImpl",{enumerable:!0,get:function(){return _.MsgHdrsImpl}});var w=Ot;Object.defineProperty(t,"Heartbeat",{enumerable:!0,get:function(){return w.Heartbeat}});var E=At;Object.defineProperty(t,"MuxSubscription",{enumerable:!0,get:function(){return E.MuxSubscription}});var b=nt;Object.defineProperty(t,"DataBuffer",{enumerable:!0,get:function(){return b.DataBuffer}});var p=jt;Object.defineProperty(t,"buildAuthenticator",{enumerable:!0,get:function(){return p.buildAuthenticator}}),Object.defineProperty(t,"checkOptions",{enumerable:!0,get:function(){return p.checkOptions}}),Object.defineProperty(t,"checkUnsupportedOption",{enumerable:!0,get:function(){return p.checkUnsupportedOption}}),Object.defineProperty(t,"DEFAULT_MAX_RECONNECT_ATTEMPTS",{enumerable:!0,get:function(){return p.DEFAULT_MAX_RECONNECT_ATTEMPTS}}),Object.defineProperty(t,"defaultOptions",{enumerable:!0,get:function(){return p.defaultOptions}}),Object.defineProperty(t,"hasWsProtocol",{enumerable:!0,get:function(){return p.hasWsProtocol}}),Object.defineProperty(t,"parseOptions",{enumerable:!0,get:function(){return p.parseOptions}});var R=We;Object.defineProperty(t,"RequestOne",{enumerable:!0,get:function(){return R.RequestOne}});var M=Ge;Object.defineProperty(t,"credsAuthenticator",{enumerable:!0,get:function(){return M.credsAuthenticator}}),Object.defineProperty(t,"jwtAuthenticator",{enumerable:!0,get:function(){return M.jwtAuthenticator}}),Object.defineProperty(t,"nkeyAuthenticator",{enumerable:!0,get:function(){return M.nkeyAuthenticator}}),Object.defineProperty(t,"tokenAuthenticator",{enumerable:!0,get:function(){return M.tokenAuthenticator}}),Object.defineProperty(t,"usernamePasswordAuthenticator",{enumerable:!0,get:function(){return M.usernamePasswordAuthenticator}}),r(Nt,t);var U=dt;Object.defineProperty(t,"QueuedIteratorImpl",{enumerable:!0,get:function(){return U.QueuedIteratorImpl}});var se=pr;Object.defineProperty(t,"Kind",{enumerable:!0,get:function(){return se.Kind}}),Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return se.Parser}}),Object.defineProperty(t,"State",{enumerable:!0,get:function(){return se.State}});var ge=xr;Object.defineProperty(t,"DenoBuffer",{enumerable:!0,get:function(){return ge.DenoBuffer}}),Object.defineProperty(t,"MAX_SIZE",{enumerable:!0,get:function(){return ge.MAX_SIZE}}),Object.defineProperty(t,"readAll",{enumerable:!0,get:function(){return ge.readAll}}),Object.defineProperty(t,"writeAll",{enumerable:!0,get:function(){return ge.writeAll}});var qe=Xe;Object.defineProperty(t,"Bench",{enumerable:!0,get:function(){return qe.Bench}}),Object.defineProperty(t,"Metric",{enumerable:!0,get:function(){return qe.Metric}});var L=ke;Object.defineProperty(t,"TD",{enumerable:!0,get:function(){return L.TD}}),Object.defineProperty(t,"TE",{enumerable:!0,get:function(){return L.TE}});var de=ut;Object.defineProperty(t,"ipV4",{enumerable:!0,get:function(){return de.ipV4}}),Object.defineProperty(t,"isIP",{enumerable:!0,get:function(){return de.isIP}}),Object.defineProperty(t,"parseIP",{enumerable:!0,get:function(){return de.parseIP}});var le=Zt;Object.defineProperty(t,"compare",{enumerable:!0,get:function(){return le.compare}}),Object.defineProperty(t,"Feature",{enumerable:!0,get:function(){return le.Feature}}),Object.defineProperty(t,"Features",{enumerable:!0,get:function(){return le.Features}}),Object.defineProperty(t,"parseSemVer",{enumerable:!0,get:function(){return le.parseSemVer}});var He=Ir;Object.defineProperty(t,"Empty",{enumerable:!0,get:function(){return He.Empty}});var Lt=rt;Object.defineProperty(t,"extractProtocolMessage",{enumerable:!0,get:function(){return Lt.extractProtocolMessage}}),Object.defineProperty(t,"protoLen",{enumerable:!0,get:function(){return Lt.protoLen}});var mt=Oe;Object.defineProperty(t,"createInbox",{enumerable:!0,get:function(){return mt.createInbox}}),Object.defineProperty(t,"Match",{enumerable:!0,get:function(){return mt.Match}}),Object.defineProperty(t,"syncIterator",{enumerable:!0,get:function(){return mt.syncIterator}});var _t=Me;Object.defineProperty(t,"SubscriptionImpl",{enumerable:!0,get:function(){return _t.SubscriptionImpl}}),Object.defineProperty(t,"Subscriptions",{enumerable:!0,get:function(){return _t.Subscriptions}});var vt=rr;Object.defineProperty(t,"IdleHeartbeatMonitor",{enumerable:!0,get:function(){return vt.IdleHeartbeatMonitor}});var pt=Ye;Object.defineProperty(t,"isIPV4OrHostname",{enumerable:!0,get:function(){return pt.isIPV4OrHostname}}),Object.defineProperty(t,"Servers",{enumerable:!0,get:function(){return pt.Servers}});var qt=gt;Object.defineProperty(t,"wsconnect",{enumerable:!0,get:function(){return qt.wsconnect}}),Object.defineProperty(t,"wsUrlParseFn",{enumerable:!0,get:function(){return qt.wsUrlParseFn}});var Se=te;Object.defineProperty(t,"AuthorizationError",{enumerable:!0,get:function(){return Se.AuthorizationError}}),Object.defineProperty(t,"ClosedConnectionError",{enumerable:!0,get:function(){return Se.ClosedConnectionError}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return Se.ConnectionError}}),Object.defineProperty(t,"DrainingConnectionError",{enumerable:!0,get:function(){return Se.DrainingConnectionError}}),Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return Se.errors}}),Object.defineProperty(t,"InvalidArgumentError",{enumerable:!0,get:function(){return Se.InvalidArgumentError}}),Object.defineProperty(t,"InvalidOperationError",{enumerable:!0,get:function(){return Se.InvalidOperationError}}),Object.defineProperty(t,"InvalidSubjectError",{enumerable:!0,get:function(){return Se.InvalidSubjectError}}),Object.defineProperty(t,"NoRespondersError",{enumerable:!0,get:function(){return Se.NoRespondersError}}),Object.defineProperty(t,"PermissionViolationError",{enumerable:!0,get:function(){return Se.PermissionViolationError}}),Object.defineProperty(t,"ProtocolError",{enumerable:!0,get:function(){return Se.ProtocolError}}),Object.defineProperty(t,"RequestError",{enumerable:!0,get:function(){return Se.RequestError}}),Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return Se.TimeoutError}}),Object.defineProperty(t,"UserAuthenticationExpiredError",{enumerable:!0,get:function(){return Se.UserAuthenticationExpiredError}})})(Vr),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.wsconnect=t.usernamePasswordAuthenticator=t.UserAuthenticationExpiredError=t.tokenAuthenticator=t.TimeoutError=t.syncIterator=t.RequestError=t.ProtocolError=t.PermissionViolationError=t.nuid=t.Nuid=t.NoRespondersError=t.nkeys=t.nkeyAuthenticator=t.nanos=t.MsgHdrsImpl=t.millis=t.Metric=t.Match=t.jwtAuthenticator=t.InvalidSubjectError=t.InvalidOperationError=t.InvalidArgumentError=t.headers=t.hasWsProtocol=t.errors=t.Empty=t.DrainingConnectionError=t.delay=t.deferred=t.deadline=t.credsAuthenticator=t.createInbox=t.ConnectionError=t.ClosedConnectionError=t.canonicalMIMEHeaderKey=t.buildAuthenticator=t.Bench=t.backoff=t.AuthorizationError=void 0;var e=Vr;Object.defineProperty(t,"AuthorizationError",{enumerable:!0,get:function(){return e.AuthorizationError}}),Object.defineProperty(t,"backoff",{enumerable:!0,get:function(){return e.backoff}}),Object.defineProperty(t,"Bench",{enumerable:!0,get:function(){return e.Bench}}),Object.defineProperty(t,"buildAuthenticator",{enumerable:!0,get:function(){return e.buildAuthenticator}}),Object.defineProperty(t,"canonicalMIMEHeaderKey",{enumerable:!0,get:function(){return e.canonicalMIMEHeaderKey}}),Object.defineProperty(t,"ClosedConnectionError",{enumerable:!0,get:function(){return e.ClosedConnectionError}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return e.ConnectionError}}),Object.defineProperty(t,"createInbox",{enumerable:!0,get:function(){return e.createInbox}}),Object.defineProperty(t,"credsAuthenticator",{enumerable:!0,get:function(){return e.credsAuthenticator}}),Object.defineProperty(t,"deadline",{enumerable:!0,get:function(){return e.deadline}}),Object.defineProperty(t,"deferred",{enumerable:!0,get:function(){return e.deferred}}),Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return e.delay}}),Object.defineProperty(t,"DrainingConnectionError",{enumerable:!0,get:function(){return e.DrainingConnectionError}}),Object.defineProperty(t,"Empty",{enumerable:!0,get:function(){return e.Empty}}),Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return e.errors}}),Object.defineProperty(t,"hasWsProtocol",{enumerable:!0,get:function(){return e.hasWsProtocol}}),Object.defineProperty(t,"headers",{enumerable:!0,get:function(){return e.headers}}),Object.defineProperty(t,"InvalidArgumentError",{enumerable:!0,get:function(){return e.InvalidArgumentError}}),Object.defineProperty(t,"InvalidOperationError",{enumerable:!0,get:function(){return e.InvalidOperationError}}),Object.defineProperty(t,"InvalidSubjectError",{enumerable:!0,get:function(){return e.InvalidSubjectError}}),Object.defineProperty(t,"jwtAuthenticator",{enumerable:!0,get:function(){return e.jwtAuthenticator}}),Object.defineProperty(t,"Match",{enumerable:!0,get:function(){return e.Match}}),Object.defineProperty(t,"Metric",{enumerable:!0,get:function(){return e.Metric}}),Object.defineProperty(t,"millis",{enumerable:!0,get:function(){return e.millis}}),Object.defineProperty(t,"MsgHdrsImpl",{enumerable:!0,get:function(){return e.MsgHdrsImpl}}),Object.defineProperty(t,"nanos",{enumerable:!0,get:function(){return e.nanos}}),Object.defineProperty(t,"nkeyAuthenticator",{enumerable:!0,get:function(){return e.nkeyAuthenticator}}),Object.defineProperty(t,"nkeys",{enumerable:!0,get:function(){return e.nkeys}}),Object.defineProperty(t,"NoRespondersError",{enumerable:!0,get:function(){return e.NoRespondersError}}),Object.defineProperty(t,"Nuid",{enumerable:!0,get:function(){return e.Nuid}}),Object.defineProperty(t,"nuid",{enumerable:!0,get:function(){return e.nuid}}),Object.defineProperty(t,"PermissionViolationError",{enumerable:!0,get:function(){return e.PermissionViolationError}}),Object.defineProperty(t,"ProtocolError",{enumerable:!0,get:function(){return e.ProtocolError}}),Object.defineProperty(t,"RequestError",{enumerable:!0,get:function(){return e.RequestError}}),Object.defineProperty(t,"syncIterator",{enumerable:!0,get:function(){return e.syncIterator}}),Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return e.TimeoutError}}),Object.defineProperty(t,"tokenAuthenticator",{enumerable:!0,get:function(){return e.tokenAuthenticator}}),Object.defineProperty(t,"UserAuthenticationExpiredError",{enumerable:!0,get:function(){return e.UserAuthenticationExpiredError}}),Object.defineProperty(t,"usernamePasswordAuthenticator",{enumerable:!0,get:function(){return e.usernamePasswordAuthenticator}}),Object.defineProperty(t,"wsconnect",{enumerable:!0,get:function(){return e.wsconnect}})}(Hr);class Ji{constructor(e){l(this,"defaultTimeout");this.natsConnection=e,this.defaultTimeout=parseInt(process.env.NATS_REQUEST_TIMEOUT||"5000",10)}async addCommunicationLinks(e,r="",s){let i="communication.link.users.add";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async addGroupMember(e,r="",s){let i="directory.group.member.add";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async addLinkBetweenGroups(e,r="",s){let i="communication.link.groups.add";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async checkResourceAccess(e,r,s,i="",a){let d="audience.check.right."+r+"."+s;i&&(d=`${i}.${d}`),console.debug("Sending request to NATS subject",{messageAddress:d});const m=await this.natsConnection.request(d,JSON.stringify(e));if(!m)throw console.warn("No reply received for subject",{messageAddress:d}),new Error("No reply received");return this.extractResponse(m.json())}async createAndStoreEvent(e,r="",s){let i="event.store.create";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async createManualGroup(e,r="",s){let i="directory.group.manual.create";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async deleteManualGroup(e,r="",s){let i="directory.group.manual.delete";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async fetchTranslations(e,r,s="",i){let a="i18n."+r+".fetch";s&&(a=`${s}.${a}`),console.debug("Sending request to NATS subject",{messageAddress:a});const d=await this.natsConnection.request(a,JSON.stringify(e));if(!d)throw console.warn("No reply received for subject",{messageAddress:a}),new Error("No reply received");return this.extractResponse(d.json())}async findGroupByExternalId(e,r="",s){let i="directory.group.find.byexternalid";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async findSession(e,r="",s){let i="session.find";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async getResources(e,r,s="",i){let a="resource.get."+r;s&&(a=`${s}.${a}`),console.debug("Sending request to NATS subject",{messageAddress:a});const d=await this.natsConnection.request(a,JSON.stringify(e));if(!d)throw console.warn("No reply received for subject",{messageAddress:a}),new Error("No reply received");return this.extractResponse(d.json())}async getUserDisplayNames(e,r="",s){let i="directory.users.get.displaynames";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async getUsersByIds(e,r="",s){let i="directory.users.get.byids";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async listenAndReplyExample(e,r="",s){let i="ent.test.listen.reply";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async listenOnlyExample(e,r="",s){let i="ent.test.listen";r&&(i=`${r}.${i}`),console.debug("Publishing to NATS subject",{messageAddress:i}),this.natsConnection.publish(i,JSON.stringify(e))}async loadTest(e,r="",s){let i="ent.loadtest";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async recreateCommunicationLinks(e,r="",s){let i="communication.link.users.recreate";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async refreshSession(e,r="",s){let i="session.refresh";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async registerApp(e,r="",s){let i="ent.appregistry.app.register";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async registerI18nFiles(e,r,s="",i){let a="i18n."+r+".register";s&&(a=`${s}.${a}`),console.debug("Sending request to NATS subject",{messageAddress:a});const d=await this.natsConnection.request(a,JSON.stringify(e));if(!d)throw console.warn("No reply received for subject",{messageAddress:a}),new Error("No reply received");return this.extractResponse(d.json())}async registerNotification(e,r="",s){let i="timeline.notification.register";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async registerNotifications(e,r="",s){let i="timeline.notification.register.batch";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async removeCommunicationLinks(e,r="",s){let i="communication.link.users.remove";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async removeGroupMember(e,r="",s){let i="directory.group.member.delete";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async removeGroupShares(e,r,s="",i){let a="share.group.remove."+r;s&&(a=`${s}.${a}`),console.debug("Sending request to NATS subject",{messageAddress:a});const d=await this.natsConnection.request(a,JSON.stringify(e));if(!d)throw console.warn("No reply received for subject",{messageAddress:a}),new Error("No reply received");return this.extractResponse(d.json())}async sendNotification(e,r="",s){let i="timeline.notification.send";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async updateManualGroup(e,r="",s){let i="directory.group.manual.update";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async updateWikiContent(e,r="",s){let i="ai.wiki.content.updated";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async updateWikiStructure(e,r="",s){let i="ai.wiki.structure.updated";r&&(i=`${r}.${i}`),console.debug("Sending request to NATS subject",{messageAddress:i});const a=await this.natsConnection.request(i,JSON.stringify(e));if(!a)throw console.warn("No reply received for subject",{messageAddress:i}),new Error("No reply received");return this.extractResponse(a.json())}async upsertGroupShares(e,r,s="",i){let a="share.group.upsert."+r;s&&(a=`${s}.${a}`),console.debug("Sending request to NATS subject",{messageAddress:a});const d=await this.natsConnection.request(a,JSON.stringify(e));if(!d)throw console.warn("No reply received for subject",{messageAddress:a}),new Error("No reply received");return this.extractResponse(d.json())}extractResponse(e){return e.response||e}toNatsOptions(e){const s={timeout:(e==null?void 0:e.timeout)??this.defaultTimeout};if(e!=null&&e.headers){const i=Hr.headers();for(const[a,d]of Object.entries(e.headers))Array.isArray(d)?d.forEach(m=>i.append(a,m)):i.set(a,d);s.headers=i}return s}}Te.EntNatsServiceClient=Ji,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});
|
package/dist/nats/client.d.ts
CHANGED
|
@@ -1,38 +1,44 @@
|
|
|
1
|
-
import { NatsConnection } from '@nats-io/nats-core';
|
|
2
1
|
import { AddCommunicationLinksRequestDTO, AddCommunicationLinksResponseDTO, AddGroupMemberRequestDTO, AddGroupMemberResponseDTO, AddLinkBetweenGroupsRequestDTO, AddLinkBetweenGroupsResponseDTO, AppRegistrationRequestDTO, AppRegistrationResponseDTO, BaseResponseDTO, CheckResourceAccessRequestDTO, CheckResourceAccessResponseDTO, CreateEventRequestDTO, CreateEventResponseDTO, CreateGroupRequestDTO, CreateGroupResponseDTO, DeleteGroupRequestDTO, DeleteGroupResponseDTO, DummyResponseDTO, FetchTranslationsRequestDTO, FetchTranslationsResponseDTO, FindGroupByExternalIdRequestDTO, FindGroupByExternalIdResponseDTO, FindSessionRequestDTO, FindSessionResponseDTO, GetResourcesRequestDTO, GetResourcesResponseDTO, GetUserDisplayNamesRequestDTO, GetUserDisplayNamesResponseDTO, GetUsersByIdsRequestDTO, GetUsersByIdsResponseDTO, ListenAndAnswerDTO, ListenOnlyDTO, LoadTestRequestDTO, LoadTestResponseDTO, RecreateCommunicationLinksRequestDTO, RecreateCommunicationLinksResponseDTO, RefreshSessionRequestDTO, RefreshSessionResponseDTO, RegisterNotificationBatchRequestDTO, RegisterNotificationRequestDTO, RegisterNotificationResponseDTO, RegisterTranslationFilesRequestDTO, RegisterTranslationFilesResponseDTO, RemoveCommunicationLinksRequestDTO, RemoveCommunicationLinksResponseDTO, RemoveGroupMemberRequestDTO, RemoveGroupMemberResponseDTO, RemoveGroupSharesRequestDTO, RemoveGroupSharesResponseDTO, SendNotificationRequestDTO, SendNotificationResponseDTO, UpdateGroupRequestDTO, UpdateGroupResponseDTO, UpsertGroupSharesRequestDTO, UpsertGroupSharesResponseDTO } from './types';
|
|
2
|
+
import { NatsConnection } from '@nats-io/nats-core';
|
|
3
|
+
export interface RequestOptions {
|
|
4
|
+
timeout?: number;
|
|
5
|
+
headers?: Record<string, string[] | string>;
|
|
6
|
+
}
|
|
3
7
|
export declare class EntNatsServiceClient {
|
|
4
8
|
private readonly natsConnection;
|
|
9
|
+
private readonly defaultTimeout;
|
|
5
10
|
constructor(natsConnection: NatsConnection);
|
|
6
|
-
addCommunicationLinks(request: AddCommunicationLinksRequestDTO, platformId?: string): Promise<AddCommunicationLinksResponseDTO>;
|
|
7
|
-
addGroupMember(request: AddGroupMemberRequestDTO, platformId?: string): Promise<AddGroupMemberResponseDTO>;
|
|
8
|
-
addLinkBetweenGroups(request: AddLinkBetweenGroupsRequestDTO, platformId?: string): Promise<AddLinkBetweenGroupsResponseDTO>;
|
|
9
|
-
checkResourceAccess(request: CheckResourceAccessRequestDTO, module: string, resourceType: string, platformId?: string): Promise<CheckResourceAccessResponseDTO>;
|
|
10
|
-
createAndStoreEvent(request: CreateEventRequestDTO, platformId?: string): Promise<CreateEventResponseDTO>;
|
|
11
|
-
createManualGroup(request: CreateGroupRequestDTO, platformId?: string): Promise<CreateGroupResponseDTO>;
|
|
12
|
-
deleteManualGroup(request: DeleteGroupRequestDTO, platformId?: string): Promise<DeleteGroupResponseDTO>;
|
|
13
|
-
fetchTranslations(request: FetchTranslationsRequestDTO, application: string, platformId?: string): Promise<FetchTranslationsResponseDTO>;
|
|
14
|
-
findGroupByExternalId(request: FindGroupByExternalIdRequestDTO, platformId?: string): Promise<FindGroupByExternalIdResponseDTO>;
|
|
15
|
-
findSession(request: FindSessionRequestDTO, platformId?: string): Promise<FindSessionResponseDTO>;
|
|
16
|
-
getResources(request: GetResourcesRequestDTO, application: string, platformId?: string): Promise<GetResourcesResponseDTO>;
|
|
17
|
-
getUserDisplayNames(request: GetUserDisplayNamesRequestDTO, platformId?: string): Promise<GetUserDisplayNamesResponseDTO>;
|
|
18
|
-
getUsersByIds(request: GetUsersByIdsRequestDTO, platformId?: string): Promise<GetUsersByIdsResponseDTO>;
|
|
19
|
-
listenAndReplyExample(request: ListenAndAnswerDTO, platformId?: string): Promise<DummyResponseDTO>;
|
|
20
|
-
listenOnlyExample(request: ListenOnlyDTO, platformId?: string): Promise<void>;
|
|
21
|
-
loadTest(request: LoadTestRequestDTO, platformId?: string): Promise<LoadTestResponseDTO>;
|
|
22
|
-
recreateCommunicationLinks(request: RecreateCommunicationLinksRequestDTO, platformId?: string): Promise<RecreateCommunicationLinksResponseDTO>;
|
|
23
|
-
refreshSession(request: RefreshSessionRequestDTO, platformId?: string): Promise<RefreshSessionResponseDTO>;
|
|
24
|
-
registerApp(request: AppRegistrationRequestDTO, platformId?: string): Promise<AppRegistrationResponseDTO>;
|
|
25
|
-
registerI18nFiles(request: RegisterTranslationFilesRequestDTO, application: string, platformId?: string): Promise<RegisterTranslationFilesResponseDTO>;
|
|
26
|
-
registerNotification(request: RegisterNotificationRequestDTO, platformId?: string): Promise<RegisterNotificationResponseDTO>;
|
|
27
|
-
registerNotifications(request: RegisterNotificationBatchRequestDTO, platformId?: string): Promise<RegisterNotificationResponseDTO>;
|
|
28
|
-
removeCommunicationLinks(request: RemoveCommunicationLinksRequestDTO, platformId?: string): Promise<RemoveCommunicationLinksResponseDTO>;
|
|
29
|
-
removeGroupMember(request: RemoveGroupMemberRequestDTO, platformId?: string): Promise<RemoveGroupMemberResponseDTO>;
|
|
30
|
-
removeGroupShares(request: RemoveGroupSharesRequestDTO, application: string, platformId?: string): Promise<RemoveGroupSharesResponseDTO>;
|
|
31
|
-
sendNotification(request: SendNotificationRequestDTO, platformId?: string): Promise<SendNotificationResponseDTO>;
|
|
32
|
-
updateManualGroup(request: UpdateGroupRequestDTO, platformId?: string): Promise<UpdateGroupResponseDTO>;
|
|
33
|
-
updateWikiContent(request: BaseResponseDTO, platformId?: string): Promise<BaseResponseDTO>;
|
|
34
|
-
updateWikiStructure(request: BaseResponseDTO, platformId?: string): Promise<BaseResponseDTO>;
|
|
35
|
-
upsertGroupShares(request: UpsertGroupSharesRequestDTO, application: string, platformId?: string): Promise<UpsertGroupSharesResponseDTO>;
|
|
11
|
+
addCommunicationLinks(request: AddCommunicationLinksRequestDTO, platformId?: string, options?: RequestOptions): Promise<AddCommunicationLinksResponseDTO>;
|
|
12
|
+
addGroupMember(request: AddGroupMemberRequestDTO, platformId?: string, options?: RequestOptions): Promise<AddGroupMemberResponseDTO>;
|
|
13
|
+
addLinkBetweenGroups(request: AddLinkBetweenGroupsRequestDTO, platformId?: string, options?: RequestOptions): Promise<AddLinkBetweenGroupsResponseDTO>;
|
|
14
|
+
checkResourceAccess(request: CheckResourceAccessRequestDTO, module: string, resourceType: string, platformId?: string, options?: RequestOptions): Promise<CheckResourceAccessResponseDTO>;
|
|
15
|
+
createAndStoreEvent(request: CreateEventRequestDTO, platformId?: string, options?: RequestOptions): Promise<CreateEventResponseDTO>;
|
|
16
|
+
createManualGroup(request: CreateGroupRequestDTO, platformId?: string, options?: RequestOptions): Promise<CreateGroupResponseDTO>;
|
|
17
|
+
deleteManualGroup(request: DeleteGroupRequestDTO, platformId?: string, options?: RequestOptions): Promise<DeleteGroupResponseDTO>;
|
|
18
|
+
fetchTranslations(request: FetchTranslationsRequestDTO, application: string, platformId?: string, options?: RequestOptions): Promise<FetchTranslationsResponseDTO>;
|
|
19
|
+
findGroupByExternalId(request: FindGroupByExternalIdRequestDTO, platformId?: string, options?: RequestOptions): Promise<FindGroupByExternalIdResponseDTO>;
|
|
20
|
+
findSession(request: FindSessionRequestDTO, platformId?: string, options?: RequestOptions): Promise<FindSessionResponseDTO>;
|
|
21
|
+
getResources(request: GetResourcesRequestDTO, application: string, platformId?: string, options?: RequestOptions): Promise<GetResourcesResponseDTO>;
|
|
22
|
+
getUserDisplayNames(request: GetUserDisplayNamesRequestDTO, platformId?: string, options?: RequestOptions): Promise<GetUserDisplayNamesResponseDTO>;
|
|
23
|
+
getUsersByIds(request: GetUsersByIdsRequestDTO, platformId?: string, options?: RequestOptions): Promise<GetUsersByIdsResponseDTO>;
|
|
24
|
+
listenAndReplyExample(request: ListenAndAnswerDTO, platformId?: string, options?: RequestOptions): Promise<DummyResponseDTO>;
|
|
25
|
+
listenOnlyExample(request: ListenOnlyDTO, platformId?: string, options?: RequestOptions): Promise<void>;
|
|
26
|
+
loadTest(request: LoadTestRequestDTO, platformId?: string, options?: RequestOptions): Promise<LoadTestResponseDTO>;
|
|
27
|
+
recreateCommunicationLinks(request: RecreateCommunicationLinksRequestDTO, platformId?: string, options?: RequestOptions): Promise<RecreateCommunicationLinksResponseDTO>;
|
|
28
|
+
refreshSession(request: RefreshSessionRequestDTO, platformId?: string, options?: RequestOptions): Promise<RefreshSessionResponseDTO>;
|
|
29
|
+
registerApp(request: AppRegistrationRequestDTO, platformId?: string, options?: RequestOptions): Promise<AppRegistrationResponseDTO>;
|
|
30
|
+
registerI18nFiles(request: RegisterTranslationFilesRequestDTO, application: string, platformId?: string, options?: RequestOptions): Promise<RegisterTranslationFilesResponseDTO>;
|
|
31
|
+
registerNotification(request: RegisterNotificationRequestDTO, platformId?: string, options?: RequestOptions): Promise<RegisterNotificationResponseDTO>;
|
|
32
|
+
registerNotifications(request: RegisterNotificationBatchRequestDTO, platformId?: string, options?: RequestOptions): Promise<RegisterNotificationResponseDTO>;
|
|
33
|
+
removeCommunicationLinks(request: RemoveCommunicationLinksRequestDTO, platformId?: string, options?: RequestOptions): Promise<RemoveCommunicationLinksResponseDTO>;
|
|
34
|
+
removeGroupMember(request: RemoveGroupMemberRequestDTO, platformId?: string, options?: RequestOptions): Promise<RemoveGroupMemberResponseDTO>;
|
|
35
|
+
removeGroupShares(request: RemoveGroupSharesRequestDTO, application: string, platformId?: string, options?: RequestOptions): Promise<RemoveGroupSharesResponseDTO>;
|
|
36
|
+
sendNotification(request: SendNotificationRequestDTO, platformId?: string, options?: RequestOptions): Promise<SendNotificationResponseDTO>;
|
|
37
|
+
updateManualGroup(request: UpdateGroupRequestDTO, platformId?: string, options?: RequestOptions): Promise<UpdateGroupResponseDTO>;
|
|
38
|
+
updateWikiContent(request: BaseResponseDTO, platformId?: string, options?: RequestOptions): Promise<BaseResponseDTO>;
|
|
39
|
+
updateWikiStructure(request: BaseResponseDTO, platformId?: string, options?: RequestOptions): Promise<BaseResponseDTO>;
|
|
40
|
+
upsertGroupShares(request: UpsertGroupSharesRequestDTO, application: string, platformId?: string, options?: RequestOptions): Promise<UpsertGroupSharesResponseDTO>;
|
|
36
41
|
private extractResponse;
|
|
42
|
+
private toNatsOptions;
|
|
37
43
|
}
|
|
38
44
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/nats/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/nats/client.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAEhE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAEhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAEpE,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,SAAS,CAAC;AAErE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAG5D,OAAO,KAAK,EAAE,cAAc,EAA6C,MAAM,oBAAoB,CAAC;AAGpG,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA;CAC9C;AAED,qBAAa,oBAAoB;IAInB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAF3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;gBAEX,cAAc,EAAE,cAAc;IAMrD,qBAAqB,CAAC,OAAO,EAAE,+BAA+B,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gCAAgC,CAAC;IAgB7J,cAAc,CAAC,OAAO,EAAE,wBAAwB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAgBxI,oBAAoB,CAAC,OAAO,EAAE,8BAA8B,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAgB1J,mBAAmB,CAAC,OAAO,EAAE,6BAA6B,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAgB7L,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgBvI,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgBrI,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgBrI,iBAAiB,CAAC,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAgBtK,qBAAqB,CAAC,OAAO,EAAE,+BAA+B,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gCAAgC,CAAC;IAgB7J,WAAW,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgB/H,YAAY,CAAC,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAgBvJ,mBAAmB,CAAC,OAAO,EAAE,6BAA6B,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAgBvJ,aAAa,CAAC,OAAO,EAAE,uBAAuB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAgBrI,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAgBhI,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc;IAW3F,QAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAgBtH,0BAA0B,CAAC,OAAO,EAAE,oCAAoC,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,qCAAqC,CAAC;IAgB5K,cAAc,CAAC,OAAO,EAAE,wBAAwB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAgBxI,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAgBvI,iBAAiB,CAAC,OAAO,EAAE,kCAAkC,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,mCAAmC,CAAC;IAgBpL,oBAAoB,CAAC,OAAO,EAAE,8BAA8B,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAgB1J,qBAAqB,CAAC,OAAO,EAAE,mCAAmC,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAgBhK,wBAAwB,CAAC,OAAO,EAAE,kCAAkC,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,mCAAmC,CAAC;IAgBtK,iBAAiB,CAAC,OAAO,EAAE,2BAA2B,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAgBjJ,iBAAiB,CAAC,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAgBtK,gBAAgB,CAAC,OAAO,EAAE,0BAA0B,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAgB9I,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgBrI,iBAAiB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAgBxH,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAgB1H,iBAAiB,CAAC,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAgB5K,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,aAAa;CAmBtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/edifice-ent-client-node",
|
|
3
|
-
"version": "6.9.0-develop-pedago.
|
|
3
|
+
"version": "6.9.0-develop-pedago.1767943970121",
|
|
4
4
|
"description": "Clients to interact with ent-nats-service",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"author": "Edifice",
|
|
11
11
|
"license": "AGPL-3.0",
|
|
12
|
+
"packageManager": "pnpm@8.6.6",
|
|
12
13
|
"engines": {
|
|
13
14
|
"node": "22"
|
|
14
15
|
},
|