@elizaos/core 1.6.1-alpha.4 → 1.6.1-alpha.6
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var JM=Object.create;var{getPrototypeOf:TM,defineProperty:l4,getOwnPropertyNames:LH,getOwnPropertyDescriptor:wM}=Object,bH=Object.prototype.hasOwnProperty;var Uq=($,q,K)=>{K=$!=null?JM(TM($)):{};let P=q||!$||!$.__esModule?l4(K,"default",{value:$,enumerable:!0}):K;for(let _ of LH($))if(!bH.call(P,_))l4(P,_,{get:()=>$[_],enumerable:!0});return P},gH=new WeakMap,w6=($)=>{var q=gH.get($),K;if(q)return q;if(q=l4({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function")LH($).map((P)=>!bH.call(q,P)&&l4(q,P,{get:()=>$[P],enumerable:!(K=wM($,P))||K.enumerable}));return gH.set($,q),q},u$=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var uq=($,q)=>{for(var K in q)l4($,K,{get:q[K],enumerable:!0,configurable:!0,set:(P)=>q[K]=()=>P})};var o4=($,q)=>()=>($&&(q=$($=0)),q);var E_=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(q,K)=>(typeof require<"u"?require:q)[K]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var UH=u$((Zn,BH)=>{function _8($,q){if(typeof q==="boolean")q={forever:q};if(this._originalTimeouts=JSON.parse(JSON.stringify($)),this._timeouts=$,this._options=q||{},this._maxRetryTime=q&&q.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}BH.exports=_8;_8.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};_8.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);if(this._timer)clearTimeout(this._timer);this._timeouts=[],this._cachedTimeouts=null};_8.prototype.retry=function($){if(this._timeout)clearTimeout(this._timeout);if(!$)return!1;var q=new Date().getTime();if($&&q-this._operationStart>=this._maxRetryTime)return this._errors.push($),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push($);var K=this._timeouts.shift();if(K===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),K=this._cachedTimeouts.slice(-1);else return!1;var P=this;if(this._timer=setTimeout(function(){if(P._attempts++,P._operationTimeoutCb){if(P._timeout=setTimeout(function(){P._operationTimeoutCb(P._attempts)},P._operationTimeout),P._options.unref)P._timeout.unref()}P._fn(P._attempts)},K),this._options.unref)this._timer.unref();return!0};_8.prototype.attempt=function($,q){if(this._fn=$,q){if(q.timeout)this._operationTimeout=q.timeout;if(q.cb)this._operationTimeoutCb=q.cb}var K=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){K._operationTimeoutCb()},K._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};_8.prototype.try=function($){console.log("Using RetryOperation.try() is deprecated"),this.attempt($)};_8.prototype.start=function($){console.log("Using RetryOperation.start() is deprecated"),this.attempt($)};_8.prototype.start=_8.prototype.try;_8.prototype.errors=function(){return this._errors};_8.prototype.attempts=function(){return this._attempts};_8.prototype.mainError=function(){if(this._errors.length===0)return null;var $={},q=null,K=0;for(var P=0;P<this._errors.length;P++){var _=this._errors[P],O=_.message,j=($[O]||0)+1;if($[O]=j,j>=K)q=_,K=j}return q}});var aH=u$((b0)=>{var L0=UH();b0.operation=function($){var q=b0.timeouts($);return new L0(q,{forever:$&&($.forever||$.retries===1/0),unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})};b0.timeouts=function($){if($ instanceof Array)return[].concat($);var q={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var K in $)q[K]=$[K];if(q.minTimeout>q.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var P=[];for(var _=0;_<q.retries;_++)P.push(this.createTimeout(_,q));if($&&$.forever&&!P.length)P.push(this.createTimeout(_,q));return P.sort(function(O,j){return O-j}),P};b0.createTimeout=function($,q){var K=q.randomize?Math.random()+1:1,P=Math.round(K*Math.max(q.minTimeout,1)*Math.pow(q.factor,$));return P=Math.min(P,q.maxTimeout),P};b0.wrap=function($,q,K){if(q instanceof Array)K=q,q=null;if(!K){K=[];for(var P in $)if(typeof $[P]==="function")K.push(P)}for(var _=0;_<K.length;_++){var O=K[_],j=$[O];$[O]=function(J){var w=b0.operation(q),G=Array.prototype.slice.call(arguments,1),f=G.pop();G.push(function(A){if(w.retry(A))return;if(A)arguments[0]=w.mainError();f.apply(this,arguments)}),w.attempt(function(){J.apply($,G)})}.bind($,j),$[O].options=q}}});var B7=u$((fn,t7)=>{var x0=aH(),c0=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class YO extends Error{constructor($){super();if($ instanceof Error)this.originalError=$,{message:$}=$;else this.originalError=Error($),this.originalError.stack=this.stack;this.name="AbortError",this.message=$}}var m0=($,q,K)=>{let P=K.retries-(q-1);return $.attemptNumber=q,$.retriesLeft=P,$},d0=($)=>c0.includes($),QH=($,q)=>new Promise((K,P)=>{q={onFailedAttempt:()=>{},retries:10,...q};let _=x0.operation(q);_.attempt(async(O)=>{try{K(await $(O))}catch(j){if(!(j instanceof Error)){P(TypeError(`Non-error was thrown: "${j}". You should only throw errors.`));return}if(j instanceof YO)_.stop(),P(j.originalError);else if(j instanceof TypeError&&!d0(j.message))_.stop(),P(j);else{m0(j,O,q);try{await q.onFailedAttempt(j)}catch(z){P(z);return}if(!_.retry(j))P(_.mainError())}}})});t7.exports=QH;t7.exports.default=QH;t7.exports.AbortError=YO});var sJ=u$((Ri,RO)=>{var VN=Object.prototype.hasOwnProperty,Eq="~";function KP(){}if(Object.create){if(KP.prototype=Object.create(null),!new KP().__proto__)Eq=!1}function SN($,q,K){this.fn=$,this.context=q,this.once=K||!1}function eJ($,q,K,P,_){if(typeof K!=="function")throw TypeError("The listener must be a function");var O=new SN(K,P||$,_),j=Eq?Eq+q:q;if(!$._events[j])$._events[j]=O,$._eventsCount++;else if(!$._events[j].fn)$._events[j].push(O);else $._events[j]=[$._events[j],O];return $}function v1($,q){if(--$._eventsCount===0)$._events=new KP;else delete $._events[q]}function Nq(){this._events=new KP,this._eventsCount=0}Nq.prototype.eventNames=function(){var q=[],K,P;if(this._eventsCount===0)return q;for(P in K=this._events)if(VN.call(K,P))q.push(Eq?P.slice(1):P);if(Object.getOwnPropertySymbols)return q.concat(Object.getOwnPropertySymbols(K));return q};Nq.prototype.listeners=function(q){var K=Eq?Eq+q:q,P=this._events[K];if(!P)return[];if(P.fn)return[P.fn];for(var _=0,O=P.length,j=Array(O);_<O;_++)j[_]=P[_].fn;return j};Nq.prototype.listenerCount=function(q){var K=Eq?Eq+q:q,P=this._events[K];if(!P)return 0;if(P.fn)return 1;return P.length};Nq.prototype.emit=function(q,K,P,_,O,j){var z=Eq?Eq+q:q;if(!this._events[z])return!1;var J=this._events[z],w=arguments.length,G,f;if(J.fn){if(J.once)this.removeListener(q,J.fn,void 0,!0);switch(w){case 1:return J.fn.call(J.context),!0;case 2:return J.fn.call(J.context,K),!0;case 3:return J.fn.call(J.context,K,P),!0;case 4:return J.fn.call(J.context,K,P,_),!0;case 5:return J.fn.call(J.context,K,P,_,O),!0;case 6:return J.fn.call(J.context,K,P,_,O,j),!0}for(f=1,G=Array(w-1);f<w;f++)G[f-1]=arguments[f];J.fn.apply(J.context,G)}else{var A=J.length,V;for(f=0;f<A;f++){if(J[f].once)this.removeListener(q,J[f].fn,void 0,!0);switch(w){case 1:J[f].fn.call(J[f].context);break;case 2:J[f].fn.call(J[f].context,K);break;case 3:J[f].fn.call(J[f].context,K,P);break;case 4:J[f].fn.call(J[f].context,K,P,_);break;default:if(!G)for(V=1,G=Array(w-1);V<w;V++)G[V-1]=arguments[V];J[f].fn.apply(J[f].context,G)}}}return!0};Nq.prototype.on=function(q,K,P){return eJ(this,q,K,P,!1)};Nq.prototype.once=function(q,K,P){return eJ(this,q,K,P,!0)};Nq.prototype.removeListener=function(q,K,P,_){var O=Eq?Eq+q:q;if(!this._events[O])return this;if(!K)return v1(this,O),this;var j=this._events[O];if(j.fn){if(j.fn===K&&(!_||j.once)&&(!P||j.context===P))v1(this,O)}else{for(var z=0,J=[],w=j.length;z<w;z++)if(j[z].fn!==K||_&&!j[z].once||P&&j[z].context!==P)J.push(j[z]);if(J.length)this._events[O]=J.length===1?J[0]:J;else v1(this,O)}return this};Nq.prototype.removeAllListeners=function(q){var K;if(q){if(K=Eq?Eq+q:q,this._events[K])v1(this,K)}else this._events=new KP,this._eventsCount=0;return this};Nq.prototype.off=Nq.prototype.removeListener;Nq.prototype.addListener=Nq.prototype.on;Nq.prefixed=Eq;Nq.EventEmitter=Nq;if(typeof RO<"u")RO.exports=Nq});var qT=u$((Ii,$T)=>{$T.exports=($,q)=>{return q=q||(()=>{}),$.then((K)=>new Promise((P)=>{P(q())}).then(()=>K),(K)=>new Promise((P)=>{P(q())}).then(()=>{throw K}))}});var _T=u$((Di,z1)=>{var MN=qT();class IO extends Error{constructor($){super($);this.name="TimeoutError"}}var KT=($,q,K)=>new Promise((P,_)=>{if(typeof q!=="number"||q<0)throw TypeError("Expected `milliseconds` to be a positive number");if(q===1/0){P($);return}let O=setTimeout(()=>{if(typeof K==="function"){try{P(K())}catch(J){_(J)}return}let j=typeof K==="string"?K:`Promise timed out after ${q} milliseconds`,z=K instanceof Error?K:new IO(j);if(typeof $.cancel==="function")$.cancel();_(z)},q);MN($.then(P,_),()=>{clearTimeout(O)})});z1.exports=KT;z1.exports.default=KT;z1.exports.TimeoutError=IO});var jT=u$((PT)=>{Object.defineProperty(PT,"__esModule",{value:!0});function NN($,q,K){let P=0,_=$.length;while(_>0){let O=_/2|0,j=P+O;if(K($[j],q)<=0)P=++j,_-=O+1;else _=O}return P}PT.default=NN});var vT=u$((YT)=>{Object.defineProperty(YT,"__esModule",{value:!0});var EN=jT();class OT{constructor(){this._queue=[]}enqueue($,q){q=Object.assign({priority:0},q);let K={priority:q.priority,run:$};if(this.size&&this._queue[this.size-1].priority>=q.priority){this._queue.push(K);return}let P=EN.default(this._queue,K,(_,O)=>O.priority-_.priority);this._queue.splice(P,0,K)}dequeue(){let $=this._queue.shift();return $===null||$===void 0?void 0:$.run}filter($){return this._queue.filter((q)=>q.priority===$.priority).map((q)=>q.run)}get size(){return this._queue.length}}YT.default=OT});var H1=u$((HT)=>{Object.defineProperty(HT,"__esModule",{value:!0});var RN=sJ(),zT=_T(),IN=vT(),W1=()=>{},DN=new zT.TimeoutError;class WT extends RN{constructor($){var q,K,P,_;super();if(this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=W1,this._resolveIdle=W1,$=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:IN.default},$),!(typeof $.intervalCap==="number"&&$.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(K=(q=$.intervalCap)===null||q===void 0?void 0:q.toString())!==null&&K!==void 0?K:""}\` (${typeof $.intervalCap})`);if($.interval===void 0||!(Number.isFinite($.interval)&&$.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_=(P=$.interval)===null||P===void 0?void 0:P.toString())!==null&&_!==void 0?_:""}\` (${typeof $.interval})`);this._carryoverConcurrencyCount=$.carryoverConcurrencyCount,this._isIntervalIgnored=$.intervalCap===1/0||$.interval===0,this._intervalCap=$.intervalCap,this._interval=$.interval,this._queue=new $.queueClass,this._queueClass=$.queueClass,this.concurrency=$.concurrency,this._timeout=$.timeout,this._throwOnTimeout=$.throwOnTimeout===!0,this._isPaused=$.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){if(this._resolveEmpty(),this._resolveEmpty=W1,this._pendingCount===0)this._resolveIdle(),this._resolveIdle=W1,this.emit("idle")}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let $=Date.now();if(this._intervalId===void 0){let q=this._intervalEnd-$;if(q<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else{if(this._timeoutId===void 0)this._timeoutId=setTimeout(()=>{this._onResumeInterval()},q);return!0}}return!1}_tryToStartAnother(){if(this._queue.size===0){if(this._intervalId)clearInterval(this._intervalId);return this._intervalId=void 0,this._resolvePromises(),!1}if(!this._isPaused){let $=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let q=this._queue.dequeue();if(!q)return!1;if(this.emit("active"),q(),$)this._initializeIntervalIfNeeded();return!0}}return!1}_initializeIntervalIfNeeded(){if(this._isIntervalIgnored||this._intervalId!==void 0)return;this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval}_onInterval(){if(this._intervalCount===0&&this._pendingCount===0&&this._intervalId)clearInterval(this._intervalId),this._intervalId=void 0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){while(this._tryToStartAnother());}get concurrency(){return this._concurrency}set concurrency($){if(!(typeof $==="number"&&$>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${$}\` (${typeof $})`);this._concurrency=$,this._processQueue()}async add($,q={}){return new Promise((K,P)=>{let _=async()=>{this._pendingCount++,this._intervalCount++;try{let O=this._timeout===void 0&&q.timeout===void 0?$():zT.default(Promise.resolve($()),q.timeout===void 0?this._timeout:q.timeout,()=>{if(q.throwOnTimeout===void 0?this._throwOnTimeout:q.throwOnTimeout)P(DN);return});K(await O)}catch(O){P(O)}this._next()};this._queue.enqueue(_,q),this._tryToStartAnother(),this.emit("add")})}async addAll($,q){return Promise.all($.map(async(K)=>this.add(K,q)))}start(){if(!this._isPaused)return this;return this._isPaused=!1,this._processQueue(),this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size===0)return;return new Promise(($)=>{let q=this._resolveEmpty;this._resolveEmpty=()=>{q(),$()}})}async onIdle(){if(this._pendingCount===0&&this._queue.size===0)return;return new Promise(($)=>{let q=this._resolveIdle;this._resolveIdle=()=>{q(),$()}})}get size(){return this._queue.size}sizeBy($){return this._queue.filter($).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout($){this._timeout=$}}HT.default=WT});var _P=u$((ci,wT)=>{var uN=Number.MAX_SAFE_INTEGER||9007199254740991,yN=["major","premajor","minor","preminor","patch","prepatch","prerelease"];wT.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:uN,RELEASE_TYPES:yN,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var PP=u$((mi,ZT)=>{var pN=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...$)=>console.error("SEMVER",...$):()=>{};ZT.exports=pN});var i_=u$((g8,XT)=>{var{MAX_SAFE_COMPONENT_LENGTH:LO,MAX_SAFE_BUILD_LENGTH:xN,MAX_LENGTH:cN}=_P(),mN=PP();g8=XT.exports={};var dN=g8.re=[],lN=g8.safeRe=[],t$=g8.src=[],oN=g8.safeSrc=[],B$=g8.t={},rN=0,bO="[a-zA-Z0-9-]",nN=[["\\s",1],["\\d",cN],[bO,xN]],iN=($)=>{for(let[q,K]of nN)$=$.split(`${q}*`).join(`${q}{0,${K}}`).split(`${q}+`).join(`${q}{1,${K}}`);return $},P6=($,q,K)=>{let P=iN(q),_=rN++;mN($,_,q),B$[$]=_,t$[_]=q,oN[_]=P,dN[_]=new RegExp(q,K?"g":void 0),lN[_]=new RegExp(P,K?"g":void 0)};P6("NUMERICIDENTIFIER","0|[1-9]\\d*");P6("NUMERICIDENTIFIERLOOSE","\\d+");P6("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${bO}*`);P6("MAINVERSION",`(${t$[B$.NUMERICIDENTIFIER]})\\.(${t$[B$.NUMERICIDENTIFIER]})\\.(${t$[B$.NUMERICIDENTIFIER]})`);P6("MAINVERSIONLOOSE",`(${t$[B$.NUMERICIDENTIFIERLOOSE]})\\.(${t$[B$.NUMERICIDENTIFIERLOOSE]})\\.(${t$[B$.NUMERICIDENTIFIERLOOSE]})`);P6("PRERELEASEIDENTIFIER",`(?:${t$[B$.NONNUMERICIDENTIFIER]}|${t$[B$.NUMERICIDENTIFIER]})`);P6("PRERELEASEIDENTIFIERLOOSE",`(?:${t$[B$.NONNUMERICIDENTIFIER]}|${t$[B$.NUMERICIDENTIFIERLOOSE]})`);P6("PRERELEASE",`(?:-(${t$[B$.PRERELEASEIDENTIFIER]}(?:\\.${t$[B$.PRERELEASEIDENTIFIER]})*))`);P6("PRERELEASELOOSE",`(?:-?(${t$[B$.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${t$[B$.PRERELEASEIDENTIFIERLOOSE]})*))`);P6("BUILDIDENTIFIER",`${bO}+`);P6("BUILD",`(?:\\+(${t$[B$.BUILDIDENTIFIER]}(?:\\.${t$[B$.BUILDIDENTIFIER]})*))`);P6("FULLPLAIN",`v?${t$[B$.MAINVERSION]}${t$[B$.PRERELEASE]}?${t$[B$.BUILD]}?`);P6("FULL",`^${t$[B$.FULLPLAIN]}$`);P6("LOOSEPLAIN",`[v=\\s]*${t$[B$.MAINVERSIONLOOSE]}${t$[B$.PRERELEASELOOSE]}?${t$[B$.BUILD]}?`);P6("LOOSE",`^${t$[B$.LOOSEPLAIN]}$`);P6("GTLT","((?:<|>)?=?)");P6("XRANGEIDENTIFIERLOOSE",`${t$[B$.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P6("XRANGEIDENTIFIER",`${t$[B$.NUMERICIDENTIFIER]}|x|X|\\*`);P6("XRANGEPLAIN",`[v=\\s]*(${t$[B$.XRANGEIDENTIFIER]})(?:\\.(${t$[B$.XRANGEIDENTIFIER]})(?:\\.(${t$[B$.XRANGEIDENTIFIER]})(?:${t$[B$.PRERELEASE]})?${t$[B$.BUILD]}?)?)?`);P6("XRANGEPLAINLOOSE",`[v=\\s]*(${t$[B$.XRANGEIDENTIFIERLOOSE]})(?:\\.(${t$[B$.XRANGEIDENTIFIERLOOSE]})(?:\\.(${t$[B$.XRANGEIDENTIFIERLOOSE]})(?:${t$[B$.PRERELEASELOOSE]})?${t$[B$.BUILD]}?)?)?`);P6("XRANGE",`^${t$[B$.GTLT]}\\s*${t$[B$.XRANGEPLAIN]}$`);P6("XRANGELOOSE",`^${t$[B$.GTLT]}\\s*${t$[B$.XRANGEPLAINLOOSE]}$`);P6("COERCEPLAIN",`(^|[^\\d])(\\d{1,${LO}})(?:\\.(\\d{1,${LO}}))?(?:\\.(\\d{1,${LO}}))?`);P6("COERCE",`${t$[B$.COERCEPLAIN]}(?:$|[^\\d])`);P6("COERCEFULL",t$[B$.COERCEPLAIN]+`(?:${t$[B$.PRERELEASE]})?(?:${t$[B$.BUILD]})?(?:$|[^\\d])`);P6("COERCERTL",t$[B$.COERCE],!0);P6("COERCERTLFULL",t$[B$.COERCEFULL],!0);P6("LONETILDE","(?:~>?)");P6("TILDETRIM",`(\\s*)${t$[B$.LONETILDE]}\\s+`,!0);g8.tildeTrimReplace="$1~";P6("TILDE",`^${t$[B$.LONETILDE]}${t$[B$.XRANGEPLAIN]}$`);P6("TILDELOOSE",`^${t$[B$.LONETILDE]}${t$[B$.XRANGEPLAINLOOSE]}$`);P6("LONECARET","(?:\\^)");P6("CARETTRIM",`(\\s*)${t$[B$.LONECARET]}\\s+`,!0);g8.caretTrimReplace="$1^";P6("CARET",`^${t$[B$.LONECARET]}${t$[B$.XRANGEPLAIN]}$`);P6("CARETLOOSE",`^${t$[B$.LONECARET]}${t$[B$.XRANGEPLAINLOOSE]}$`);P6("COMPARATORLOOSE",`^${t$[B$.GTLT]}\\s*(${t$[B$.LOOSEPLAIN]})$|^$`);P6("COMPARATOR",`^${t$[B$.GTLT]}\\s*(${t$[B$.FULLPLAIN]})$|^$`);P6("COMPARATORTRIM",`(\\s*)${t$[B$.GTLT]}\\s*(${t$[B$.LOOSEPLAIN]}|${t$[B$.XRANGEPLAIN]})`,!0);g8.comparatorTrimReplace="$1$2$3";P6("HYPHENRANGE",`^\\s*(${t$[B$.XRANGEPLAIN]})\\s+-\\s+(${t$[B$.XRANGEPLAIN]})\\s*$`);P6("HYPHENRANGELOOSE",`^\\s*(${t$[B$.XRANGEPLAINLOOSE]})\\s+-\\s+(${t$[B$.XRANGEPLAINLOOSE]})\\s*$`);P6("STAR","(<|>)?=?\\s*\\*");P6("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P6("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Z1=u$((di,fT)=>{var tN=Object.freeze({loose:!0}),BN=Object.freeze({}),UN=($)=>{if(!$)return BN;if(typeof $!=="object")return tN;return $};fT.exports=UN});var uO=u$((li,GT)=>{var kT=/^[0-9]+$/,AT=($,q)=>{let K=kT.test($),P=kT.test(q);if(K&&P)$=+$,q=+q;return $===q?0:K&&!P?-1:P&&!K?1:$<q?-1:1},FN=($,q)=>AT(q,$);GT.exports={compareIdentifiers:AT,rcompareIdentifiers:FN}});var Cq=u$((oi,ST)=>{var X1=PP(),{MAX_LENGTH:VT,MAX_SAFE_INTEGER:f1}=_P(),{safeRe:k1,t:A1}=i_(),aN=Z1(),{compareIdentifiers:t_}=uO();class V8{constructor($,q){if(q=aN(q),$ instanceof V8)if($.loose===!!q.loose&&$.includePrerelease===!!q.includePrerelease)return $;else $=$.version;else if(typeof $!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof $}".`);if($.length>VT)throw TypeError(`version is longer than ${VT} characters`);X1("SemVer",$,q),this.options=q,this.loose=!!q.loose,this.includePrerelease=!!q.includePrerelease;let K=$.trim().match(q.loose?k1[A1.LOOSE]:k1[A1.FULL]);if(!K)throw TypeError(`Invalid Version: ${$}`);if(this.raw=$,this.major=+K[1],this.minor=+K[2],this.patch=+K[3],this.major>f1||this.major<0)throw TypeError("Invalid major version");if(this.minor>f1||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>f1||this.patch<0)throw TypeError("Invalid patch version");if(!K[4])this.prerelease=[];else this.prerelease=K[4].split(".").map((P)=>{if(/^[0-9]+$/.test(P)){let _=+P;if(_>=0&&_<f1)return _}return P});this.build=K[5]?K[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare($){if(X1("SemVer.compare",this.version,this.options,$),!($ instanceof V8)){if(typeof $==="string"&&$===this.version)return 0;$=new V8($,this.options)}if($.version===this.version)return 0;return this.compareMain($)||this.comparePre($)}compareMain($){if(!($ instanceof V8))$=new V8($,this.options);return t_(this.major,$.major)||t_(this.minor,$.minor)||t_(this.patch,$.patch)}comparePre($){if(!($ instanceof V8))$=new V8($,this.options);if(this.prerelease.length&&!$.prerelease.length)return-1;else if(!this.prerelease.length&&$.prerelease.length)return 1;else if(!this.prerelease.length&&!$.prerelease.length)return 0;let q=0;do{let K=this.prerelease[q],P=$.prerelease[q];if(X1("prerelease compare",q,K,P),K===void 0&&P===void 0)return 0;else if(P===void 0)return 1;else if(K===void 0)return-1;else if(K===P)continue;else return t_(K,P)}while(++q)}compareBuild($){if(!($ instanceof V8))$=new V8($,this.options);let q=0;do{let K=this.build[q],P=$.build[q];if(X1("build compare",q,K,P),K===void 0&&P===void 0)return 0;else if(P===void 0)return 1;else if(K===void 0)return-1;else if(K===P)continue;else return t_(K,P)}while(++q)}inc($,q,K){if($.startsWith("pre")){if(!q&&K===!1)throw Error("invalid increment argument: identifier is empty");if(q){let P=`-${q}`.match(this.options.loose?k1[A1.PRERELEASELOOSE]:k1[A1.PRERELEASE]);if(!P||P[1]!==q)throw Error(`invalid identifier: ${q}`)}}switch($){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",q,K);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",q,K);break;case"prepatch":this.prerelease.length=0,this.inc("patch",q,K),this.inc("pre",q,K);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",q,K);this.inc("pre",q,K);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let P=Number(K)?1:0;if(this.prerelease.length===0)this.prerelease=[P];else{let _=this.prerelease.length;while(--_>=0)if(typeof this.prerelease[_]==="number")this.prerelease[_]++,_=-2;if(_===-1){if(q===this.prerelease.join(".")&&K===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(P)}}if(q){let _=[q,P];if(K===!1)_=[q];if(t_(this.prerelease[0],q)===0){if(isNaN(this.prerelease[1]))this.prerelease=_}else this.prerelease=_}break}default:throw Error(`invalid increment argument: ${$}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}ST.exports=V8});var QK=u$((ri,NT)=>{var MT=Cq(),QN=($,q,K=!1)=>{if($ instanceof MT)return $;try{return new MT($,q)}catch(P){if(!K)return null;throw P}};NT.exports=QN});var ET=u$((ni,CT)=>{var eN=QK(),sN=($,q)=>{let K=eN($,q);return K?K.version:null};CT.exports=sN});var RT=u$((ii,hT)=>{var $C=QK(),qC=($,q)=>{let K=$C($.trim().replace(/^[=v]+/,""),q);return K?K.version:null};hT.exports=qC});var gT=u$((ti,DT)=>{var IT=Cq(),KC=($,q,K,P,_)=>{if(typeof K==="string")_=P,P=K,K=void 0;try{return new IT($ instanceof IT?$.version:$,K).inc(q,P,_).version}catch(O){return null}};DT.exports=KC});var uT=u$((Bi,bT)=>{var LT=QK(),_C=($,q)=>{let K=LT($,null,!0),P=LT(q,null,!0),_=K.compare(P);if(_===0)return null;let O=_>0,j=O?K:P,z=O?P:K,J=!!j.prerelease.length;if(!!z.prerelease.length&&!J){if(!z.patch&&!z.minor)return"major";if(z.compareMain(j)===0){if(z.minor&&!z.patch)return"minor";return"patch"}}let G=J?"pre":"";if(K.major!==P.major)return G+"major";if(K.minor!==P.minor)return G+"minor";if(K.patch!==P.patch)return G+"patch";return"prerelease"};bT.exports=_C});var pT=u$((Ui,yT)=>{var PC=Cq(),jC=($,q)=>new PC($,q).major;yT.exports=jC});var cT=u$((Fi,xT)=>{var OC=Cq(),YC=($,q)=>new OC($,q).minor;xT.exports=YC});var dT=u$((ai,mT)=>{var vC=Cq(),zC=($,q)=>new vC($,q).patch;mT.exports=zC});var oT=u$((Qi,lT)=>{var WC=QK(),HC=($,q)=>{let K=WC($,q);return K&&K.prerelease.length?K.prerelease:null};lT.exports=HC});var j8=u$((ei,nT)=>{var rT=Cq(),JC=($,q,K)=>new rT($,K).compare(new rT(q,K));nT.exports=JC});var tT=u$((si,iT)=>{var TC=j8(),wC=($,q,K)=>TC(q,$,K);iT.exports=wC});var UT=u$(($t,BT)=>{var ZC=j8(),XC=($,q)=>ZC($,q,!0);BT.exports=XC});var G1=u$((qt,aT)=>{var FT=Cq(),fC=($,q,K)=>{let P=new FT($,K),_=new FT(q,K);return P.compare(_)||P.compareBuild(_)};aT.exports=fC});var eT=u$((Kt,QT)=>{var kC=G1(),AC=($,q)=>$.sort((K,P)=>kC(K,P,q));QT.exports=AC});var $w=u$((_t,sT)=>{var GC=G1(),VC=($,q)=>$.sort((K,P)=>GC(P,K,q));sT.exports=VC});var jP=u$((Pt,qw)=>{var SC=j8(),MC=($,q,K)=>SC($,q,K)>0;qw.exports=MC});var V1=u$((jt,Kw)=>{var NC=j8(),CC=($,q,K)=>NC($,q,K)<0;Kw.exports=CC});var yO=u$((Ot,_w)=>{var EC=j8(),hC=($,q,K)=>EC($,q,K)===0;_w.exports=hC});var pO=u$((Yt,Pw)=>{var RC=j8(),IC=($,q,K)=>RC($,q,K)!==0;Pw.exports=IC});var S1=u$((vt,jw)=>{var DC=j8(),gC=($,q,K)=>DC($,q,K)>=0;jw.exports=gC});var M1=u$((zt,Ow)=>{var LC=j8(),bC=($,q,K)=>LC($,q,K)<=0;Ow.exports=bC});var xO=u$((Wt,Yw)=>{var uC=yO(),yC=pO(),pC=jP(),xC=S1(),cC=V1(),mC=M1(),dC=($,q,K,P)=>{switch(q){case"===":if(typeof $==="object")$=$.version;if(typeof K==="object")K=K.version;return $===K;case"!==":if(typeof $==="object")$=$.version;if(typeof K==="object")K=K.version;return $!==K;case"":case"=":case"==":return uC($,K,P);case"!=":return yC($,K,P);case">":return pC($,K,P);case">=":return xC($,K,P);case"<":return cC($,K,P);case"<=":return mC($,K,P);default:throw TypeError(`Invalid operator: ${q}`)}};Yw.exports=dC});var zw=u$((Ht,vw)=>{var lC=Cq(),oC=QK(),{safeRe:N1,t:C1}=i_(),rC=($,q)=>{if($ instanceof lC)return $;if(typeof $==="number")$=String($);if(typeof $!=="string")return null;q=q||{};let K=null;if(!q.rtl)K=$.match(q.includePrerelease?N1[C1.COERCEFULL]:N1[C1.COERCE]);else{let J=q.includePrerelease?N1[C1.COERCERTLFULL]:N1[C1.COERCERTL],w;while((w=J.exec($))&&(!K||K.index+K[0].length!==$.length)){if(!K||w.index+w[0].length!==K.index+K[0].length)K=w;J.lastIndex=w.index+w[1].length+w[2].length}J.lastIndex=-1}if(K===null)return null;let P=K[2],_=K[3]||"0",O=K[4]||"0",j=q.includePrerelease&&K[5]?`-${K[5]}`:"",z=q.includePrerelease&&K[6]?`+${K[6]}`:"";return oC(`${P}.${_}.${O}${j}${z}`,q)};vw.exports=rC});var Jw=u$((Jt,Hw)=>{class Ww{constructor(){this.max=1000,this.map=new Map}get($){let q=this.map.get($);if(q===void 0)return;else return this.map.delete($),this.map.set($,q),q}delete($){return this.map.delete($)}set($,q){if(!this.delete($)&&q!==void 0){if(this.map.size>=this.max){let P=this.map.keys().next().value;this.delete(P)}this.map.set($,q)}return this}}Hw.exports=Ww});var O8=u$((Tt,Xw)=>{var nC=/\s+/g;class OP{constructor($,q){if(q=tC(q),$ instanceof OP)if($.loose===!!q.loose&&$.includePrerelease===!!q.includePrerelease)return $;else return new OP($.raw,q);if($ instanceof cO)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=q,this.loose=!!q.loose,this.includePrerelease=!!q.includePrerelease,this.raw=$.trim().replace(nC," "),this.set=this.raw.split("||").map((K)=>this.parseRange(K.trim())).filter((K)=>K.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let K=this.set[0];if(this.set=this.set.filter((P)=>!ww(P[0])),this.set.length===0)this.set=[K];else if(this.set.length>1){for(let P of this.set)if(P.length===1&&sC(P[0])){this.set=[P];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){if($>0)this.formatted+="||";let q=this.set[$];for(let K=0;K<q.length;K++){if(K>0)this.formatted+=" ";this.formatted+=q[K].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){let K=((this.options.includePrerelease&&QC)|(this.options.loose&&eC))+":"+$,P=Tw.get(K);if(P)return P;let _=this.options.loose,O=_?xq[hq.HYPHENRANGELOOSE]:xq[hq.HYPHENRANGE];$=$.replace(O,zE(this.options.includePrerelease)),M6("hyphen replace",$),$=$.replace(xq[hq.COMPARATORTRIM],UC),M6("comparator trim",$),$=$.replace(xq[hq.TILDETRIM],FC),M6("tilde trim",$),$=$.replace(xq[hq.CARETTRIM],aC),M6("caret trim",$);let j=$.split(" ").map((G)=>$E(G,this.options)).join(" ").split(/\s+/).map((G)=>vE(G,this.options));if(_)j=j.filter((G)=>{return M6("loose invalid filter",G,this.options),!!G.match(xq[hq.COMPARATORLOOSE])});M6("range list",j);let z=new Map,J=j.map((G)=>new cO(G,this.options));for(let G of J){if(ww(G))return[G];z.set(G.value,G)}if(z.size>1&&z.has(""))z.delete("");let w=[...z.values()];return Tw.set(K,w),w}intersects($,q){if(!($ instanceof OP))throw TypeError("a Range is required");return this.set.some((K)=>{return Zw(K,q)&&$.set.some((P)=>{return Zw(P,q)&&K.every((_)=>{return P.every((O)=>{return _.intersects(O,q)})})})})}test($){if(!$)return!1;if(typeof $==="string")try{$=new BC($,this.options)}catch(q){return!1}for(let q=0;q<this.set.length;q++)if(WE(this.set[q],$,this.options))return!0;return!1}}Xw.exports=OP;var iC=Jw(),Tw=new iC,tC=Z1(),cO=YP(),M6=PP(),BC=Cq(),{safeRe:xq,t:hq,comparatorTrimReplace:UC,tildeTrimReplace:FC,caretTrimReplace:aC}=i_(),{FLAG_INCLUDE_PRERELEASE:QC,FLAG_LOOSE:eC}=_P(),ww=($)=>$.value==="<0.0.0-0",sC=($)=>$.value==="",Zw=($,q)=>{let K=!0,P=$.slice(),_=P.pop();while(K&&P.length)K=P.every((O)=>{return _.intersects(O,q)}),_=P.pop();return K},$E=($,q)=>{return M6("comp",$,q),$=_E($,q),M6("caret",$),$=qE($,q),M6("tildes",$),$=jE($,q),M6("xrange",$),$=YE($,q),M6("stars",$),$},Rq=($)=>!$||$.toLowerCase()==="x"||$==="*",qE=($,q)=>{return $.trim().split(/\s+/).map((K)=>KE(K,q)).join(" ")},KE=($,q)=>{let K=q.loose?xq[hq.TILDELOOSE]:xq[hq.TILDE];return $.replace(K,(P,_,O,j,z)=>{M6("tilde",$,P,_,O,j,z);let J;if(Rq(_))J="";else if(Rq(O))J=`>=${_}.0.0 <${+_+1}.0.0-0`;else if(Rq(j))J=`>=${_}.${O}.0 <${_}.${+O+1}.0-0`;else if(z)M6("replaceTilde pr",z),J=`>=${_}.${O}.${j}-${z} <${_}.${+O+1}.0-0`;else J=`>=${_}.${O}.${j} <${_}.${+O+1}.0-0`;return M6("tilde return",J),J})},_E=($,q)=>{return $.trim().split(/\s+/).map((K)=>PE(K,q)).join(" ")},PE=($,q)=>{M6("caret",$,q);let K=q.loose?xq[hq.CARETLOOSE]:xq[hq.CARET],P=q.includePrerelease?"-0":"";return $.replace(K,(_,O,j,z,J)=>{M6("caret",$,_,O,j,z,J);let w;if(Rq(O))w="";else if(Rq(j))w=`>=${O}.0.0${P} <${+O+1}.0.0-0`;else if(Rq(z))if(O==="0")w=`>=${O}.${j}.0${P} <${O}.${+j+1}.0-0`;else w=`>=${O}.${j}.0${P} <${+O+1}.0.0-0`;else if(J)if(M6("replaceCaret pr",J),O==="0")if(j==="0")w=`>=${O}.${j}.${z}-${J} <${O}.${j}.${+z+1}-0`;else w=`>=${O}.${j}.${z}-${J} <${O}.${+j+1}.0-0`;else w=`>=${O}.${j}.${z}-${J} <${+O+1}.0.0-0`;else if(M6("no pr"),O==="0")if(j==="0")w=`>=${O}.${j}.${z}${P} <${O}.${j}.${+z+1}-0`;else w=`>=${O}.${j}.${z}${P} <${O}.${+j+1}.0-0`;else w=`>=${O}.${j}.${z} <${+O+1}.0.0-0`;return M6("caret return",w),w})},jE=($,q)=>{return M6("replaceXRanges",$,q),$.split(/\s+/).map((K)=>OE(K,q)).join(" ")},OE=($,q)=>{$=$.trim();let K=q.loose?xq[hq.XRANGELOOSE]:xq[hq.XRANGE];return $.replace(K,(P,_,O,j,z,J)=>{M6("xRange",$,P,_,O,j,z,J);let w=Rq(O),G=w||Rq(j),f=G||Rq(z),A=f;if(_==="="&&A)_="";if(J=q.includePrerelease?"-0":"",w)if(_===">"||_==="<")P="<0.0.0-0";else P="*";else if(_&&A){if(G)j=0;if(z=0,_===">")if(_=">=",G)O=+O+1,j=0,z=0;else j=+j+1,z=0;else if(_==="<=")if(_="<",G)O=+O+1;else j=+j+1;if(_==="<")J="-0";P=`${_+O}.${j}.${z}${J}`}else if(G)P=`>=${O}.0.0${J} <${+O+1}.0.0-0`;else if(f)P=`>=${O}.${j}.0${J} <${O}.${+j+1}.0-0`;return M6("xRange return",P),P})},YE=($,q)=>{return M6("replaceStars",$,q),$.trim().replace(xq[hq.STAR],"")},vE=($,q)=>{return M6("replaceGTE0",$,q),$.trim().replace(xq[q.includePrerelease?hq.GTE0PRE:hq.GTE0],"")},zE=($)=>(q,K,P,_,O,j,z,J,w,G,f,A)=>{if(Rq(P))K="";else if(Rq(_))K=`>=${P}.0.0${$?"-0":""}`;else if(Rq(O))K=`>=${P}.${_}.0${$?"-0":""}`;else if(j)K=`>=${K}`;else K=`>=${K}${$?"-0":""}`;if(Rq(w))J="";else if(Rq(G))J=`<${+w+1}.0.0-0`;else if(Rq(f))J=`<${w}.${+G+1}.0-0`;else if(A)J=`<=${w}.${G}.${f}-${A}`;else if($)J=`<${w}.${G}.${+f+1}-0`;else J=`<=${J}`;return`${K} ${J}`.trim()},WE=($,q,K)=>{for(let P=0;P<$.length;P++)if(!$[P].test(q))return!1;if(q.prerelease.length&&!K.includePrerelease){for(let P=0;P<$.length;P++){if(M6($[P].semver),$[P].semver===cO.ANY)continue;if($[P].semver.prerelease.length>0){let _=$[P].semver;if(_.major===q.major&&_.minor===q.minor&&_.patch===q.patch)return!0}}return!1}return!0}});var YP=u$((wt,Sw)=>{var vP=Symbol("SemVer ANY");class E1{static get ANY(){return vP}constructor($,q){if(q=fw(q),$ instanceof E1)if($.loose===!!q.loose)return $;else $=$.value;if($=$.trim().split(/\s+/).join(" "),dO("comparator",$,q),this.options=q,this.loose=!!q.loose,this.parse($),this.semver===vP)this.value="";else this.value=this.operator+this.semver.version;dO("comp",this)}parse($){let q=this.options.loose?kw[Aw.COMPARATORLOOSE]:kw[Aw.COMPARATOR],K=$.match(q);if(!K)throw TypeError(`Invalid comparator: ${$}`);if(this.operator=K[1]!==void 0?K[1]:"",this.operator==="=")this.operator="";if(!K[2])this.semver=vP;else this.semver=new Gw(K[2],this.options.loose)}toString(){return this.value}test($){if(dO("Comparator.test",$,this.options.loose),this.semver===vP||$===vP)return!0;if(typeof $==="string")try{$=new Gw($,this.options)}catch(q){return!1}return mO($,this.operator,this.semver,this.options)}intersects($,q){if(!($ instanceof E1))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Vw($.value,q).test(this.value)}else if($.operator===""){if($.value==="")return!0;return new Vw(this.value,q).test($.semver)}if(q=fw(q),q.includePrerelease&&(this.value==="<0.0.0-0"||$.value==="<0.0.0-0"))return!1;if(!q.includePrerelease&&(this.value.startsWith("<0.0.0")||$.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&$.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&$.operator.startsWith("<"))return!0;if(this.semver.version===$.semver.version&&this.operator.includes("=")&&$.operator.includes("="))return!0;if(mO(this.semver,"<",$.semver,q)&&this.operator.startsWith(">")&&$.operator.startsWith("<"))return!0;if(mO(this.semver,">",$.semver,q)&&this.operator.startsWith("<")&&$.operator.startsWith(">"))return!0;return!1}}Sw.exports=E1;var fw=Z1(),{safeRe:kw,t:Aw}=i_(),mO=xO(),dO=PP(),Gw=Cq(),Vw=O8()});var zP=u$((Zt,Mw)=>{var HE=O8(),JE=($,q,K)=>{try{q=new HE(q,K)}catch(P){return!1}return q.test($)};Mw.exports=JE});var Cw=u$((Xt,Nw)=>{var TE=O8(),wE=($,q)=>new TE($,q).set.map((K)=>K.map((P)=>P.value).join(" ").trim().split(" "));Nw.exports=wE});var hw=u$((ft,Ew)=>{var ZE=Cq(),XE=O8(),fE=($,q,K)=>{let P=null,_=null,O=null;try{O=new XE(q,K)}catch(j){return null}return $.forEach((j)=>{if(O.test(j)){if(!P||_.compare(j)===-1)P=j,_=new ZE(P,K)}}),P};Ew.exports=fE});var Iw=u$((kt,Rw)=>{var kE=Cq(),AE=O8(),GE=($,q,K)=>{let P=null,_=null,O=null;try{O=new AE(q,K)}catch(j){return null}return $.forEach((j)=>{if(O.test(j)){if(!P||_.compare(j)===1)P=j,_=new kE(P,K)}}),P};Rw.exports=GE});var Lw=u$((At,gw)=>{var lO=Cq(),VE=O8(),Dw=jP(),SE=($,q)=>{$=new VE($,q);let K=new lO("0.0.0");if($.test(K))return K;if(K=new lO("0.0.0-0"),$.test(K))return K;K=null;for(let P=0;P<$.set.length;++P){let _=$.set[P],O=null;if(_.forEach((j)=>{let z=new lO(j.semver.version);switch(j.operator){case">":if(z.prerelease.length===0)z.patch++;else z.prerelease.push(0);z.raw=z.format();case"":case">=":if(!O||Dw(z,O))O=z;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${j.operator}`)}}),O&&(!K||Dw(K,O)))K=O}if(K&&$.test(K))return K;return null};gw.exports=SE});var uw=u$((Gt,bw)=>{var ME=O8(),NE=($,q)=>{try{return new ME($,q).range||"*"}catch(K){return null}};bw.exports=NE});var h1=u$((Vt,cw)=>{var CE=Cq(),xw=YP(),{ANY:EE}=xw,hE=O8(),RE=zP(),yw=jP(),pw=V1(),IE=M1(),DE=S1(),gE=($,q,K,P)=>{$=new CE($,P),q=new hE(q,P);let _,O,j,z,J;switch(K){case">":_=yw,O=IE,j=pw,z=">",J=">=";break;case"<":_=pw,O=DE,j=yw,z="<",J="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(RE($,q,P))return!1;for(let w=0;w<q.set.length;++w){let G=q.set[w],f=null,A=null;if(G.forEach((V)=>{if(V.semver===EE)V=new xw(">=0.0.0");if(f=f||V,A=A||V,_(V.semver,f.semver,P))f=V;else if(j(V.semver,A.semver,P))A=V}),f.operator===z||f.operator===J)return!1;if((!A.operator||A.operator===z)&&O($,A.semver))return!1;else if(A.operator===J&&j($,A.semver))return!1}return!0};cw.exports=gE});var dw=u$((St,mw)=>{var LE=h1(),bE=($,q,K)=>LE($,q,">",K);mw.exports=bE});var ow=u$((Mt,lw)=>{var uE=h1(),yE=($,q,K)=>uE($,q,"<",K);lw.exports=yE});var iw=u$((Nt,nw)=>{var rw=O8(),pE=($,q,K)=>{return $=new rw($,K),q=new rw(q,K),$.intersects(q,K)};nw.exports=pE});var Bw=u$((Ct,tw)=>{var xE=zP(),cE=j8();tw.exports=($,q,K)=>{let P=[],_=null,O=null,j=$.sort((G,f)=>cE(G,f,K));for(let G of j)if(xE(G,q,K)){if(O=G,!_)_=G}else{if(O)P.push([_,O]);O=null,_=null}if(_)P.push([_,null]);let z=[];for(let[G,f]of P)if(G===f)z.push(G);else if(!f&&G===j[0])z.push("*");else if(!f)z.push(`>=${G}`);else if(G===j[0])z.push(`<=${f}`);else z.push(`${G} - ${f}`);let J=z.join(" || "),w=typeof q.raw==="string"?q.raw:String(q);return J.length<w.length?J:q}});var sw=u$((Et,ew)=>{var Uw=O8(),rO=YP(),{ANY:oO}=rO,WP=zP(),nO=j8(),mE=($,q,K={})=>{if($===q)return!0;$=new Uw($,K),q=new Uw(q,K);let P=!1;$:for(let _ of $.set){for(let O of q.set){let j=lE(_,O,K);if(P=P||j!==null,j)continue $}if(P)return!1}return!0},dE=[new rO(">=0.0.0-0")],Fw=[new rO(">=0.0.0")],lE=($,q,K)=>{if($===q)return!0;if($.length===1&&$[0].semver===oO)if(q.length===1&&q[0].semver===oO)return!0;else if(K.includePrerelease)$=dE;else $=Fw;if(q.length===1&&q[0].semver===oO)if(K.includePrerelease)return!0;else q=Fw;let P=new Set,_,O;for(let V of $)if(V.operator===">"||V.operator===">=")_=aw(_,V,K);else if(V.operator==="<"||V.operator==="<=")O=Qw(O,V,K);else P.add(V.semver);if(P.size>1)return null;let j;if(_&&O){if(j=nO(_.semver,O.semver,K),j>0)return null;else if(j===0&&(_.operator!==">="||O.operator!=="<="))return null}for(let V of P){if(_&&!WP(V,String(_),K))return null;if(O&&!WP(V,String(O),K))return null;for(let C of q)if(!WP(V,String(C),K))return!1;return!0}let z,J,w,G,f=O&&!K.includePrerelease&&O.semver.prerelease.length?O.semver:!1,A=_&&!K.includePrerelease&&_.semver.prerelease.length?_.semver:!1;if(f&&f.prerelease.length===1&&O.operator==="<"&&f.prerelease[0]===0)f=!1;for(let V of q){if(G=G||V.operator===">"||V.operator===">=",w=w||V.operator==="<"||V.operator==="<=",_){if(A){if(V.semver.prerelease&&V.semver.prerelease.length&&V.semver.major===A.major&&V.semver.minor===A.minor&&V.semver.patch===A.patch)A=!1}if(V.operator===">"||V.operator===">="){if(z=aw(_,V,K),z===V&&z!==_)return!1}else if(_.operator===">="&&!WP(_.semver,String(V),K))return!1}if(O){if(f){if(V.semver.prerelease&&V.semver.prerelease.length&&V.semver.major===f.major&&V.semver.minor===f.minor&&V.semver.patch===f.patch)f=!1}if(V.operator==="<"||V.operator==="<="){if(J=Qw(O,V,K),J===V&&J!==O)return!1}else if(O.operator==="<="&&!WP(O.semver,String(V),K))return!1}if(!V.operator&&(O||_)&&j!==0)return!1}if(_&&w&&!O&&j!==0)return!1;if(O&&G&&!_&&j!==0)return!1;if(A||f)return!1;return!0},aw=($,q,K)=>{if(!$)return q;let P=nO($.semver,q.semver,K);return P>0?$:P<0?q:q.operator===">"&&$.operator===">="?q:$},Qw=($,q,K)=>{if(!$)return q;let P=nO($.semver,q.semver,K);return P<0?$:P>0?q:q.operator==="<"&&$.operator==="<="?q:$};ew.exports=mE});var _Z=u$((ht,KZ)=>{var iO=i_(),$Z=_P(),oE=Cq(),qZ=uO(),rE=QK(),nE=ET(),iE=RT(),tE=gT(),BE=uT(),UE=pT(),FE=cT(),aE=dT(),QE=oT(),eE=j8(),sE=tT(),$h=UT(),qh=G1(),Kh=eT(),_h=$w(),Ph=jP(),jh=V1(),Oh=yO(),Yh=pO(),vh=S1(),zh=M1(),Wh=xO(),Hh=zw(),Jh=YP(),Th=O8(),wh=zP(),Zh=Cw(),Xh=hw(),fh=Iw(),kh=Lw(),Ah=uw(),Gh=h1(),Vh=dw(),Sh=ow(),Mh=iw(),Nh=Bw(),Ch=sw();KZ.exports={parse:rE,valid:nE,clean:iE,inc:tE,diff:BE,major:UE,minor:FE,patch:aE,prerelease:QE,compare:eE,rcompare:sE,compareLoose:$h,compareBuild:qh,sort:Kh,rsort:_h,gt:Ph,lt:jh,eq:Oh,neq:Yh,gte:vh,lte:zh,cmp:Wh,coerce:Hh,Comparator:Jh,Range:Th,satisfies:wh,toComparators:Zh,maxSatisfying:Xh,minSatisfying:fh,minVersion:kh,validRange:Ah,outside:Gh,gtr:Vh,ltr:Sh,intersects:Mh,simplifyRange:Nh,subset:Ch,SemVer:oE,re:iO.re,src:iO.src,tokens:iO.t,SEMVER_SPEC_VERSION:$Z.SEMVER_SPEC_VERSION,RELEASE_TYPES:$Z.RELEASE_TYPES,compareIdentifiers:qZ.compareIdentifiers,rcompareIdentifiers:qZ.rcompareIdentifiers}});var AZ=u$((jB,kZ)=>{kZ.exports=function($,q){if(typeof $!=="string")throw TypeError("Expected a string");return q=typeof q>"u"?"_":q,$.replace(/([a-z\d])([A-Z])/g,"$1"+q+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+q+"$2").toLowerCase()}});var EZ=u$((OB,aO)=>{var th=/[\p{Lu}]/u,Bh=/[\p{Ll}]/u,GZ=/^[\p{Lu}](?![\p{Lu}])/gu,MZ=/([\p{Alpha}\p{N}_]|$)/u,NZ=/[_.\- ]+/,Uh=new RegExp("^"+NZ.source),VZ=new RegExp(NZ.source+MZ.source,"gu"),SZ=new RegExp("\\d+"+MZ.source,"gu"),Fh=($,q,K)=>{let P=!1,_=!1,O=!1;for(let j=0;j<$.length;j++){let z=$[j];if(P&&th.test(z))$=$.slice(0,j)+"-"+$.slice(j),P=!1,O=_,_=!0,j++;else if(_&&O&&Bh.test(z))$=$.slice(0,j-1)+"-"+$.slice(j-1),O=_,_=!1,P=!0;else P=q(z)===z&&K(z)!==z,O=_,_=K(z)===z&&q(z)!==z}return $},ah=($,q)=>{return GZ.lastIndex=0,$.replace(GZ,(K)=>q(K))},Qh=($,q)=>{return VZ.lastIndex=0,SZ.lastIndex=0,$.replace(VZ,(K,P)=>q(P)).replace(SZ,(K)=>q(K))},CZ=($,q)=>{if(!(typeof $==="string"||Array.isArray($)))throw TypeError("Expected the input to be `string | string[]`");if(q={pascalCase:!1,preserveConsecutiveUppercase:!1,...q},Array.isArray($))$=$.map((O)=>O.trim()).filter((O)=>O.length).join("-");else $=$.trim();if($.length===0)return"";let K=q.locale===!1?(O)=>O.toLowerCase():(O)=>O.toLocaleLowerCase(q.locale),P=q.locale===!1?(O)=>O.toUpperCase():(O)=>O.toLocaleUpperCase(q.locale);if($.length===1)return q.pascalCase?P($):K($);if($!==K($))$=Fh($,K,P);if($=$.replace(Uh,""),q.preserveConsecutiveUppercase)$=ah($,K);else $=K($);if(q.pascalCase)$=P($.charAt(0))+$.slice(1);return Qh($,P)};aO.exports=CZ;aO.exports.default=CZ});var xZ=u$((kB,pZ)=>{var uZ=($=0)=>(q)=>`\x1B[${38+$};5;${q}m`,yZ=($=0)=>(q,K,P)=>`\x1B[${38+$};2;${q};${K};${P}m`;function OR(){let $=new Map,q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};q.color.gray=q.color.blackBright,q.bgColor.bgGray=q.bgColor.bgBlackBright,q.color.grey=q.color.blackBright,q.bgColor.bgGrey=q.bgColor.bgBlackBright;for(let[K,P]of Object.entries(q)){for(let[_,O]of Object.entries(P))q[_]={open:`\x1B[${O[0]}m`,close:`\x1B[${O[1]}m`},P[_]=q[_],$.set(O[0],O[1]);Object.defineProperty(q,K,{value:P,enumerable:!1})}return Object.defineProperty(q,"codes",{value:$,enumerable:!1}),q.color.close="\x1B[39m",q.bgColor.close="\x1B[49m",q.color.ansi256=uZ(),q.color.ansi16m=yZ(),q.bgColor.ansi256=uZ(10),q.bgColor.ansi16m=yZ(10),Object.defineProperties(q,{rgbToAnsi256:{value:(K,P,_)=>{if(K===P&&P===_){if(K<8)return 16;if(K>248)return 231;return Math.round((K-8)/247*24)+232}return 16+36*Math.round(K/255*5)+6*Math.round(P/255*5)+Math.round(_/255*5)},enumerable:!1},hexToRgb:{value:(K)=>{let P=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(K.toString(16));if(!P)return[0,0,0];let{colorString:_}=P.groups;if(_.length===3)_=_.split("").map((j)=>j+j).join("");let O=Number.parseInt(_,16);return[O>>16&255,O>>8&255,O&255]},enumerable:!1},hexToAnsi256:{value:(K)=>q.rgbToAnsi256(...q.hexToRgb(K)),enumerable:!1}}),q}Object.defineProperty(pZ,"exports",{enumerable:!0,get:OR})});var gk=u$((cL)=>{cL.byteLength=LL;cL.toByteArray=uL;cL.fromByteArray=xL;var l8=[],H8=[],gL=typeof Uint8Array<"u"?Uint8Array:Array,Vz="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(yK=0,Sz=Vz.length;yK<Sz;++yK)l8[yK]=Vz[yK],H8[Vz.charCodeAt(yK)]=yK;var yK,Sz;H8[45]=62;H8[95]=63;function Dk($){var q=$.length;if(q%4>0)throw Error("Invalid string. Length must be a multiple of 4");var K=$.indexOf("=");if(K===-1)K=q;var P=K===q?0:4-K%4;return[K,P]}function LL($){var q=Dk($),K=q[0],P=q[1];return(K+P)*3/4-P}function bL($,q,K){return(q+K)*3/4-K}function uL($){var q,K=Dk($),P=K[0],_=K[1],O=new gL(bL($,P,_)),j=0,z=_>0?P-4:P,J;for(J=0;J<z;J+=4)q=H8[$.charCodeAt(J)]<<18|H8[$.charCodeAt(J+1)]<<12|H8[$.charCodeAt(J+2)]<<6|H8[$.charCodeAt(J+3)],O[j++]=q>>16&255,O[j++]=q>>8&255,O[j++]=q&255;if(_===2)q=H8[$.charCodeAt(J)]<<2|H8[$.charCodeAt(J+1)]>>4,O[j++]=q&255;if(_===1)q=H8[$.charCodeAt(J)]<<10|H8[$.charCodeAt(J+1)]<<4|H8[$.charCodeAt(J+2)]>>2,O[j++]=q>>8&255,O[j++]=q&255;return O}function yL($){return l8[$>>18&63]+l8[$>>12&63]+l8[$>>6&63]+l8[$&63]}function pL($,q,K){var P,_=[];for(var O=q;O<K;O+=3)P=($[O]<<16&16711680)+($[O+1]<<8&65280)+($[O+2]&255),_.push(yL(P));return _.join("")}function xL($){var q,K=$.length,P=K%3,_=[],O=16383;for(var j=0,z=K-P;j<z;j+=O)_.push(pL($,j,j+O>z?z:j+O));if(P===1)q=$[K-1],_.push(l8[q>>2]+l8[q<<4&63]+"==");else if(P===2)q=($[K-2]<<8)+$[K-1],_.push(l8[q>>10]+l8[q>>4&63]+l8[q<<2&63]+"=");return _.join("")}});var Lq=u$((jb)=>{jb.__esModule=!0;jb.extend=uk;jb.indexOf=sL;jb.escapeExpression=$b;jb.isEmpty=qb;jb.createFrame=Kb;jb.blockParams=_b;jb.appendContextPath=Pb;var FL={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},aL=/[&<>"'`=]/g,QL=/[&<>"'`=]/;function eL($){return FL[$]}function uk($){for(var q=1;q<arguments.length;q++)for(var K in arguments[q])if(Object.prototype.hasOwnProperty.call(arguments[q],K))$[K]=arguments[q][K];return $}var Ez=Object.prototype.toString;jb.toString=Ez;var Cz=function(q){return typeof q==="function"};if(Cz(/x/))jb.isFunction=Cz=function($){return typeof $==="function"&&Ez.call($)==="[object Function]"};jb.isFunction=Cz;var yk=Array.isArray||function($){return $&&typeof $==="object"?Ez.call($)==="[object Array]":!1};jb.isArray=yk;function sL($,q){for(var K=0,P=$.length;K<P;K++)if($[K]===q)return K;return-1}function $b($){if(typeof $!=="string"){if($&&$.toHTML)return $.toHTML();else if($==null)return"";else if(!$)return $+"";$=""+$}if(!QL.test($))return $;return $.replace(aL,eL)}function qb($){if(!$&&$!==0)return!0;else if(yk($)&&$.length===0)return!0;else return!1}function Kb($){var q=uk({},$);return q._parent=$,q}function _b($,q){return $.path=q,$}function Pb($,q){return($?$+".":"")+q}});var J8=u$((pk,xk)=>{pk.__esModule=!0;var hz=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Rz($,q){var K=q&&q.loc,P=void 0,_=void 0,O=void 0,j=void 0;if(K)P=K.start.line,_=K.end.line,O=K.start.column,j=K.end.column,$+=" - "+P+":"+O;var z=Error.prototype.constructor.call(this,$);for(var J=0;J<hz.length;J++)this[hz[J]]=z[hz[J]];if(Error.captureStackTrace)Error.captureStackTrace(this,Rz);try{if(K)if(this.lineNumber=P,this.endLineNumber=_,Object.defineProperty)Object.defineProperty(this,"column",{value:O,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:j,enumerable:!0});else this.column=O,this.endColumn=j}catch(w){}}Rz.prototype=Error();pk.default=Rz;xk.exports=pk.default});var dk=u$((ck,mk)=>{ck.__esModule=!0;var Iz=Lq();ck.default=function($){$.registerHelper("blockHelperMissing",function(q,K){var{inverse:P,fn:_}=K;if(q===!0)return _(this);else if(q===!1||q==null)return P(this);else if(Iz.isArray(q))if(q.length>0){if(K.ids)K.ids=[K.name];return $.helpers.each(q,K)}else return P(this);else{if(K.data&&K.ids){var O=Iz.createFrame(K.data);O.contextPath=Iz.appendContextPath(K.data.contextPath,K.name),K={data:O}}return _(q,K)}})};mk.exports=ck.default});var rk=u$((lk,ok)=>{lk.__esModule=!0;function Vb($){return $&&$.__esModule?$:{default:$}}var W7=Lq(),Sb=J8(),Mb=Vb(Sb);lk.default=function($){$.registerHelper("each",function(q,K){if(!K)throw new Mb.default("Must pass iterator to #each");var{fn:P,inverse:_}=K,O=0,j="",z=void 0,J=void 0;if(K.data&&K.ids)J=W7.appendContextPath(K.data.contextPath,K.ids[0])+".";if(W7.isFunction(q))q=q.call(this);if(K.data)z=W7.createFrame(K.data);function w(C,E,R){if(z){if(z.key=C,z.index=E,z.first=E===0,z.last=!!R,J)z.contextPath=J+C}j=j+P(q[C],{data:z,blockParams:W7.blockParams([q[C],C],[J+C,null])})}if(q&&typeof q==="object")if(W7.isArray(q)){for(var G=q.length;O<G;O++)if(O in q)w(O,O,O===q.length-1)}else if(typeof Symbol==="function"&&q[Symbol.iterator]){var f=[],A=q[Symbol.iterator]();for(var V=A.next();!V.done;V=A.next())f.push(V.value);q=f;for(var G=q.length;O<G;O++)w(O,O,O===q.length-1)}else(function(){var C=void 0;if(Object.keys(q).forEach(function(E){if(C!==void 0)w(C,O-1);C=E,O++}),C!==void 0)w(C,O-1,!0)})();if(O===0)j=_(this);return j})};ok.exports=lk.default});var tk=u$((nk,ik)=>{nk.__esModule=!0;function Eb($){return $&&$.__esModule?$:{default:$}}var hb=J8(),Rb=Eb(hb);nk.default=function($){$.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new Rb.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};ik.exports=nk.default});var Qk=u$((Fk,ak)=>{Fk.__esModule=!0;function gb($){return $&&$.__esModule?$:{default:$}}var Bk=Lq(),Lb=J8(),Uk=gb(Lb);Fk.default=function($){$.registerHelper("if",function(q,K){if(arguments.length!=2)throw new Uk.default("#if requires exactly one argument");if(Bk.isFunction(q))q=q.call(this);if(!K.hash.includeZero&&!q||Bk.isEmpty(q))return K.inverse(this);else return K.fn(this)}),$.registerHelper("unless",function(q,K){if(arguments.length!=2)throw new Uk.default("#unless requires exactly one argument");return $.helpers.if.call(this,q,{fn:K.inverse,inverse:K.fn,hash:K.hash})})};ak.exports=Fk.default});var $A=u$((ek,sk)=>{ek.__esModule=!0;ek.default=function($){$.registerHelper("log",function(){var q=[void 0],K=arguments[arguments.length-1];for(var P=0;P<arguments.length-1;P++)q.push(arguments[P]);var _=1;if(K.hash.level!=null)_=K.hash.level;else if(K.data&&K.data.level!=null)_=K.data.level;q[0]=_,$.log.apply($,q)})};sk.exports=ek.default});var _A=u$((qA,KA)=>{qA.__esModule=!0;qA.default=function($){$.registerHelper("lookup",function(q,K,P){if(!q)return q;return P.lookupProperty(q,K)})};KA.exports=qA.default});var OA=u$((PA,jA)=>{PA.__esModule=!0;function mb($){return $&&$.__esModule?$:{default:$}}var H7=Lq(),db=J8(),lb=mb(db);PA.default=function($){$.registerHelper("with",function(q,K){if(arguments.length!=2)throw new lb.default("#with requires exactly one argument");if(H7.isFunction(q))q=q.call(this);var P=K.fn;if(!H7.isEmpty(q)){var _=K.data;if(K.data&&K.ids)_=H7.createFrame(K.data),_.contextPath=H7.appendContextPath(K.data.contextPath,K.ids[0]);return P(q,{data:_,blockParams:H7.blockParams([q],[_&&_.contextPath])})}else return K.inverse(this)})};jA.exports=PA.default});var Dz=u$((Ou)=>{Ou.__esModule=!0;Ou.registerDefaultHelpers=Pu;Ou.moveHelperToHooks=ju;function J_($){return $&&$.__esModule?$:{default:$}}var nb=dk(),ib=J_(nb),tb=rk(),Bb=J_(tb),Ub=tk(),Fb=J_(Ub),ab=Qk(),Qb=J_(ab),eb=$A(),sb=J_(eb),$u=_A(),qu=J_($u),Ku=OA(),_u=J_(Ku);function Pu($){ib.default($),Bb.default($),Fb.default($),Qb.default($),sb.default($),qu.default($),_u.default($)}function ju($,q,K){if($.helpers[q]){if($.hooks[q]=$.helpers[q],!K)delete $.helpers[q]}}});var zA=u$((YA,vA)=>{YA.__esModule=!0;var Wu=Lq();YA.default=function($){$.registerDecorator("inline",function(q,K,P,_){var O=q;if(!K.partials)K.partials={},O=function(j,z){var J=P.partials;P.partials=Wu.extend({},J,K.partials);var w=q(j,z);return P.partials=J,w};return K.partials[_.args[0]]=_.fn,O})};vA.exports=YA.default});var WA=u$((fu)=>{fu.__esModule=!0;fu.registerDefaultDecorators=Xu;function Tu($){return $&&$.__esModule?$:{default:$}}var wu=zA(),Zu=Tu(wu);function Xu($){Zu.default($)}});var gz=u$((HA,JA)=>{HA.__esModule=!0;var Gu=Lq(),Z4={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(q){if(typeof q==="string"){var K=Gu.indexOf(Z4.methodMap,q.toLowerCase());if(K>=0)q=K;else q=parseInt(q,10)}return q},log:function(q){if(q=Z4.lookupLevel(q),typeof console<"u"&&Z4.lookupLevel(Z4.level)<=q){var K=Z4.methodMap[q];if(!console[K])K="log";for(var P=arguments.length,_=Array(P>1?P-1:0),O=1;O<P;O++)_[O-1]=arguments[O];console[K].apply(console,_)}}};HA.default=Z4;JA.exports=HA.default});var TA=u$((Cu)=>{Cu.__esModule=!0;Cu.createNewLookupObject=Nu;var Mu=Lq();function Nu(){for(var $=arguments.length,q=Array($),K=0;K<$;K++)q[K]=arguments[K];return Mu.extend.apply(void 0,[Object.create(null)].concat(q))}});var Lz=u$((yu)=>{yu.__esModule=!0;yu.createProtoAccessControl=gu;yu.resultIsAllowed=Lu;yu.resetLoggedProperties=uu;function Ru($){return $&&$.__esModule?$:{default:$}}var wA=TA(),Iu=gz(),Du=Ru(Iu),vj=Object.create(null);function gu($){var q=Object.create(null);q.constructor=!1,q.__defineGetter__=!1,q.__defineSetter__=!1,q.__lookupGetter__=!1;var K=Object.create(null);return K.__proto__=!1,{properties:{whitelist:wA.createNewLookupObject(K,$.allowedProtoProperties),defaultValue:$.allowProtoPropertiesByDefault},methods:{whitelist:wA.createNewLookupObject(q,$.allowedProtoMethods),defaultValue:$.allowProtoMethodsByDefault}}}function Lu($,q,K){if(typeof $==="function")return ZA(q.methods,K);else return ZA(q.properties,K)}function ZA($,q){if($.whitelist[q]!==void 0)return $.whitelist[q]===!0;if($.defaultValue!==void 0)return $.defaultValue;return bu(q),!1}function bu($){if(vj[$]!==!0)vj[$]=!0,Du.default.log("error",'Handlebars: Access has been denied to resolve the property "'+$+`" because it is not an "own property" of its parent.
|
|
1
|
+
var JM=Object.create;var{getPrototypeOf:TM,defineProperty:l4,getOwnPropertyNames:LH,getOwnPropertyDescriptor:wM}=Object,bH=Object.prototype.hasOwnProperty;var Uq=($,q,K)=>{K=$!=null?JM(TM($)):{};let P=q||!$||!$.__esModule?l4(K,"default",{value:$,enumerable:!0}):K;for(let _ of LH($))if(!bH.call(P,_))l4(P,_,{get:()=>$[_],enumerable:!0});return P},gH=new WeakMap,w6=($)=>{var q=gH.get($),K;if(q)return q;if(q=l4({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function")LH($).map((P)=>!bH.call(q,P)&&l4(q,P,{get:()=>$[P],enumerable:!(K=wM($,P))||K.enumerable}));return gH.set($,q),q},u$=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var uq=($,q)=>{for(var K in q)l4($,K,{get:q[K],enumerable:!0,configurable:!0,set:(P)=>q[K]=()=>P})};var o4=($,q)=>()=>($&&(q=$($=0)),q);var E_=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(q,K)=>(typeof require<"u"?require:q)[K]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var UH=u$((Xn,BH)=>{function _8($,q){if(typeof q==="boolean")q={forever:q};if(this._originalTimeouts=JSON.parse(JSON.stringify($)),this._timeouts=$,this._options=q||{},this._maxRetryTime=q&&q.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}BH.exports=_8;_8.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};_8.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);if(this._timer)clearTimeout(this._timer);this._timeouts=[],this._cachedTimeouts=null};_8.prototype.retry=function($){if(this._timeout)clearTimeout(this._timeout);if(!$)return!1;var q=new Date().getTime();if($&&q-this._operationStart>=this._maxRetryTime)return this._errors.push($),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push($);var K=this._timeouts.shift();if(K===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),K=this._cachedTimeouts.slice(-1);else return!1;var P=this;if(this._timer=setTimeout(function(){if(P._attempts++,P._operationTimeoutCb){if(P._timeout=setTimeout(function(){P._operationTimeoutCb(P._attempts)},P._operationTimeout),P._options.unref)P._timeout.unref()}P._fn(P._attempts)},K),this._options.unref)this._timer.unref();return!0};_8.prototype.attempt=function($,q){if(this._fn=$,q){if(q.timeout)this._operationTimeout=q.timeout;if(q.cb)this._operationTimeoutCb=q.cb}var K=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){K._operationTimeoutCb()},K._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};_8.prototype.try=function($){console.log("Using RetryOperation.try() is deprecated"),this.attempt($)};_8.prototype.start=function($){console.log("Using RetryOperation.start() is deprecated"),this.attempt($)};_8.prototype.start=_8.prototype.try;_8.prototype.errors=function(){return this._errors};_8.prototype.attempts=function(){return this._attempts};_8.prototype.mainError=function(){if(this._errors.length===0)return null;var $={},q=null,K=0;for(var P=0;P<this._errors.length;P++){var _=this._errors[P],O=_.message,j=($[O]||0)+1;if($[O]=j,j>=K)q=_,K=j}return q}});var aH=u$((b0)=>{var L0=UH();b0.operation=function($){var q=b0.timeouts($);return new L0(q,{forever:$&&($.forever||$.retries===1/0),unref:$&&$.unref,maxRetryTime:$&&$.maxRetryTime})};b0.timeouts=function($){if($ instanceof Array)return[].concat($);var q={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var K in $)q[K]=$[K];if(q.minTimeout>q.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var P=[];for(var _=0;_<q.retries;_++)P.push(this.createTimeout(_,q));if($&&$.forever&&!P.length)P.push(this.createTimeout(_,q));return P.sort(function(O,j){return O-j}),P};b0.createTimeout=function($,q){var K=q.randomize?Math.random()+1:1,P=Math.round(K*Math.max(q.minTimeout,1)*Math.pow(q.factor,$));return P=Math.min(P,q.maxTimeout),P};b0.wrap=function($,q,K){if(q instanceof Array)K=q,q=null;if(!K){K=[];for(var P in $)if(typeof $[P]==="function")K.push(P)}for(var _=0;_<K.length;_++){var O=K[_],j=$[O];$[O]=function(J){var w=b0.operation(q),G=Array.prototype.slice.call(arguments,1),f=G.pop();G.push(function(A){if(w.retry(A))return;if(A)arguments[0]=w.mainError();f.apply(this,arguments)}),w.attempt(function(){J.apply($,G)})}.bind($,j),$[O].options=q}}});var B7=u$((kn,t7)=>{var x0=aH(),c0=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class YO extends Error{constructor($){super();if($ instanceof Error)this.originalError=$,{message:$}=$;else this.originalError=Error($),this.originalError.stack=this.stack;this.name="AbortError",this.message=$}}var m0=($,q,K)=>{let P=K.retries-(q-1);return $.attemptNumber=q,$.retriesLeft=P,$},d0=($)=>c0.includes($),QH=($,q)=>new Promise((K,P)=>{q={onFailedAttempt:()=>{},retries:10,...q};let _=x0.operation(q);_.attempt(async(O)=>{try{K(await $(O))}catch(j){if(!(j instanceof Error)){P(TypeError(`Non-error was thrown: "${j}". You should only throw errors.`));return}if(j instanceof YO)_.stop(),P(j.originalError);else if(j instanceof TypeError&&!d0(j.message))_.stop(),P(j);else{m0(j,O,q);try{await q.onFailedAttempt(j)}catch(z){P(z);return}if(!_.retry(j))P(_.mainError())}}})});t7.exports=QH;t7.exports.default=QH;t7.exports.AbortError=YO});var sJ=u$((Ii,RO)=>{var VN=Object.prototype.hasOwnProperty,Eq="~";function KP(){}if(Object.create){if(KP.prototype=Object.create(null),!new KP().__proto__)Eq=!1}function SN($,q,K){this.fn=$,this.context=q,this.once=K||!1}function eJ($,q,K,P,_){if(typeof K!=="function")throw TypeError("The listener must be a function");var O=new SN(K,P||$,_),j=Eq?Eq+q:q;if(!$._events[j])$._events[j]=O,$._eventsCount++;else if(!$._events[j].fn)$._events[j].push(O);else $._events[j]=[$._events[j],O];return $}function v1($,q){if(--$._eventsCount===0)$._events=new KP;else delete $._events[q]}function Nq(){this._events=new KP,this._eventsCount=0}Nq.prototype.eventNames=function(){var q=[],K,P;if(this._eventsCount===0)return q;for(P in K=this._events)if(VN.call(K,P))q.push(Eq?P.slice(1):P);if(Object.getOwnPropertySymbols)return q.concat(Object.getOwnPropertySymbols(K));return q};Nq.prototype.listeners=function(q){var K=Eq?Eq+q:q,P=this._events[K];if(!P)return[];if(P.fn)return[P.fn];for(var _=0,O=P.length,j=Array(O);_<O;_++)j[_]=P[_].fn;return j};Nq.prototype.listenerCount=function(q){var K=Eq?Eq+q:q,P=this._events[K];if(!P)return 0;if(P.fn)return 1;return P.length};Nq.prototype.emit=function(q,K,P,_,O,j){var z=Eq?Eq+q:q;if(!this._events[z])return!1;var J=this._events[z],w=arguments.length,G,f;if(J.fn){if(J.once)this.removeListener(q,J.fn,void 0,!0);switch(w){case 1:return J.fn.call(J.context),!0;case 2:return J.fn.call(J.context,K),!0;case 3:return J.fn.call(J.context,K,P),!0;case 4:return J.fn.call(J.context,K,P,_),!0;case 5:return J.fn.call(J.context,K,P,_,O),!0;case 6:return J.fn.call(J.context,K,P,_,O,j),!0}for(f=1,G=Array(w-1);f<w;f++)G[f-1]=arguments[f];J.fn.apply(J.context,G)}else{var A=J.length,V;for(f=0;f<A;f++){if(J[f].once)this.removeListener(q,J[f].fn,void 0,!0);switch(w){case 1:J[f].fn.call(J[f].context);break;case 2:J[f].fn.call(J[f].context,K);break;case 3:J[f].fn.call(J[f].context,K,P);break;case 4:J[f].fn.call(J[f].context,K,P,_);break;default:if(!G)for(V=1,G=Array(w-1);V<w;V++)G[V-1]=arguments[V];J[f].fn.apply(J[f].context,G)}}}return!0};Nq.prototype.on=function(q,K,P){return eJ(this,q,K,P,!1)};Nq.prototype.once=function(q,K,P){return eJ(this,q,K,P,!0)};Nq.prototype.removeListener=function(q,K,P,_){var O=Eq?Eq+q:q;if(!this._events[O])return this;if(!K)return v1(this,O),this;var j=this._events[O];if(j.fn){if(j.fn===K&&(!_||j.once)&&(!P||j.context===P))v1(this,O)}else{for(var z=0,J=[],w=j.length;z<w;z++)if(j[z].fn!==K||_&&!j[z].once||P&&j[z].context!==P)J.push(j[z]);if(J.length)this._events[O]=J.length===1?J[0]:J;else v1(this,O)}return this};Nq.prototype.removeAllListeners=function(q){var K;if(q){if(K=Eq?Eq+q:q,this._events[K])v1(this,K)}else this._events=new KP,this._eventsCount=0;return this};Nq.prototype.off=Nq.prototype.removeListener;Nq.prototype.addListener=Nq.prototype.on;Nq.prefixed=Eq;Nq.EventEmitter=Nq;if(typeof RO<"u")RO.exports=Nq});var qT=u$((Di,$T)=>{$T.exports=($,q)=>{return q=q||(()=>{}),$.then((K)=>new Promise((P)=>{P(q())}).then(()=>K),(K)=>new Promise((P)=>{P(q())}).then(()=>{throw K}))}});var _T=u$((gi,z1)=>{var MN=qT();class IO extends Error{constructor($){super($);this.name="TimeoutError"}}var KT=($,q,K)=>new Promise((P,_)=>{if(typeof q!=="number"||q<0)throw TypeError("Expected `milliseconds` to be a positive number");if(q===1/0){P($);return}let O=setTimeout(()=>{if(typeof K==="function"){try{P(K())}catch(J){_(J)}return}let j=typeof K==="string"?K:`Promise timed out after ${q} milliseconds`,z=K instanceof Error?K:new IO(j);if(typeof $.cancel==="function")$.cancel();_(z)},q);MN($.then(P,_),()=>{clearTimeout(O)})});z1.exports=KT;z1.exports.default=KT;z1.exports.TimeoutError=IO});var jT=u$((PT)=>{Object.defineProperty(PT,"__esModule",{value:!0});function NN($,q,K){let P=0,_=$.length;while(_>0){let O=_/2|0,j=P+O;if(K($[j],q)<=0)P=++j,_-=O+1;else _=O}return P}PT.default=NN});var vT=u$((YT)=>{Object.defineProperty(YT,"__esModule",{value:!0});var EN=jT();class OT{constructor(){this._queue=[]}enqueue($,q){q=Object.assign({priority:0},q);let K={priority:q.priority,run:$};if(this.size&&this._queue[this.size-1].priority>=q.priority){this._queue.push(K);return}let P=EN.default(this._queue,K,(_,O)=>O.priority-_.priority);this._queue.splice(P,0,K)}dequeue(){let $=this._queue.shift();return $===null||$===void 0?void 0:$.run}filter($){return this._queue.filter((q)=>q.priority===$.priority).map((q)=>q.run)}get size(){return this._queue.length}}YT.default=OT});var H1=u$((HT)=>{Object.defineProperty(HT,"__esModule",{value:!0});var RN=sJ(),zT=_T(),IN=vT(),W1=()=>{},DN=new zT.TimeoutError;class WT extends RN{constructor($){var q,K,P,_;super();if(this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=W1,this._resolveIdle=W1,$=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:IN.default},$),!(typeof $.intervalCap==="number"&&$.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(K=(q=$.intervalCap)===null||q===void 0?void 0:q.toString())!==null&&K!==void 0?K:""}\` (${typeof $.intervalCap})`);if($.interval===void 0||!(Number.isFinite($.interval)&&$.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_=(P=$.interval)===null||P===void 0?void 0:P.toString())!==null&&_!==void 0?_:""}\` (${typeof $.interval})`);this._carryoverConcurrencyCount=$.carryoverConcurrencyCount,this._isIntervalIgnored=$.intervalCap===1/0||$.interval===0,this._intervalCap=$.intervalCap,this._interval=$.interval,this._queue=new $.queueClass,this._queueClass=$.queueClass,this.concurrency=$.concurrency,this._timeout=$.timeout,this._throwOnTimeout=$.throwOnTimeout===!0,this._isPaused=$.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){if(this._resolveEmpty(),this._resolveEmpty=W1,this._pendingCount===0)this._resolveIdle(),this._resolveIdle=W1,this.emit("idle")}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let $=Date.now();if(this._intervalId===void 0){let q=this._intervalEnd-$;if(q<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else{if(this._timeoutId===void 0)this._timeoutId=setTimeout(()=>{this._onResumeInterval()},q);return!0}}return!1}_tryToStartAnother(){if(this._queue.size===0){if(this._intervalId)clearInterval(this._intervalId);return this._intervalId=void 0,this._resolvePromises(),!1}if(!this._isPaused){let $=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let q=this._queue.dequeue();if(!q)return!1;if(this.emit("active"),q(),$)this._initializeIntervalIfNeeded();return!0}}return!1}_initializeIntervalIfNeeded(){if(this._isIntervalIgnored||this._intervalId!==void 0)return;this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval}_onInterval(){if(this._intervalCount===0&&this._pendingCount===0&&this._intervalId)clearInterval(this._intervalId),this._intervalId=void 0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){while(this._tryToStartAnother());}get concurrency(){return this._concurrency}set concurrency($){if(!(typeof $==="number"&&$>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${$}\` (${typeof $})`);this._concurrency=$,this._processQueue()}async add($,q={}){return new Promise((K,P)=>{let _=async()=>{this._pendingCount++,this._intervalCount++;try{let O=this._timeout===void 0&&q.timeout===void 0?$():zT.default(Promise.resolve($()),q.timeout===void 0?this._timeout:q.timeout,()=>{if(q.throwOnTimeout===void 0?this._throwOnTimeout:q.throwOnTimeout)P(DN);return});K(await O)}catch(O){P(O)}this._next()};this._queue.enqueue(_,q),this._tryToStartAnother(),this.emit("add")})}async addAll($,q){return Promise.all($.map(async(K)=>this.add(K,q)))}start(){if(!this._isPaused)return this;return this._isPaused=!1,this._processQueue(),this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size===0)return;return new Promise(($)=>{let q=this._resolveEmpty;this._resolveEmpty=()=>{q(),$()}})}async onIdle(){if(this._pendingCount===0&&this._queue.size===0)return;return new Promise(($)=>{let q=this._resolveIdle;this._resolveIdle=()=>{q(),$()}})}get size(){return this._queue.size}sizeBy($){return this._queue.filter($).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout($){this._timeout=$}}HT.default=WT});var _P=u$((mi,wT)=>{var uN=Number.MAX_SAFE_INTEGER||9007199254740991,yN=["major","premajor","minor","preminor","patch","prepatch","prerelease"];wT.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:uN,RELEASE_TYPES:yN,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var PP=u$((di,ZT)=>{var pN=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...$)=>console.error("SEMVER",...$):()=>{};ZT.exports=pN});var i_=u$((g8,XT)=>{var{MAX_SAFE_COMPONENT_LENGTH:LO,MAX_SAFE_BUILD_LENGTH:xN,MAX_LENGTH:cN}=_P(),mN=PP();g8=XT.exports={};var dN=g8.re=[],lN=g8.safeRe=[],t$=g8.src=[],oN=g8.safeSrc=[],B$=g8.t={},rN=0,bO="[a-zA-Z0-9-]",nN=[["\\s",1],["\\d",cN],[bO,xN]],iN=($)=>{for(let[q,K]of nN)$=$.split(`${q}*`).join(`${q}{0,${K}}`).split(`${q}+`).join(`${q}{1,${K}}`);return $},P6=($,q,K)=>{let P=iN(q),_=rN++;mN($,_,q),B$[$]=_,t$[_]=q,oN[_]=P,dN[_]=new RegExp(q,K?"g":void 0),lN[_]=new RegExp(P,K?"g":void 0)};P6("NUMERICIDENTIFIER","0|[1-9]\\d*");P6("NUMERICIDENTIFIERLOOSE","\\d+");P6("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${bO}*`);P6("MAINVERSION",`(${t$[B$.NUMERICIDENTIFIER]})\\.(${t$[B$.NUMERICIDENTIFIER]})\\.(${t$[B$.NUMERICIDENTIFIER]})`);P6("MAINVERSIONLOOSE",`(${t$[B$.NUMERICIDENTIFIERLOOSE]})\\.(${t$[B$.NUMERICIDENTIFIERLOOSE]})\\.(${t$[B$.NUMERICIDENTIFIERLOOSE]})`);P6("PRERELEASEIDENTIFIER",`(?:${t$[B$.NONNUMERICIDENTIFIER]}|${t$[B$.NUMERICIDENTIFIER]})`);P6("PRERELEASEIDENTIFIERLOOSE",`(?:${t$[B$.NONNUMERICIDENTIFIER]}|${t$[B$.NUMERICIDENTIFIERLOOSE]})`);P6("PRERELEASE",`(?:-(${t$[B$.PRERELEASEIDENTIFIER]}(?:\\.${t$[B$.PRERELEASEIDENTIFIER]})*))`);P6("PRERELEASELOOSE",`(?:-?(${t$[B$.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${t$[B$.PRERELEASEIDENTIFIERLOOSE]})*))`);P6("BUILDIDENTIFIER",`${bO}+`);P6("BUILD",`(?:\\+(${t$[B$.BUILDIDENTIFIER]}(?:\\.${t$[B$.BUILDIDENTIFIER]})*))`);P6("FULLPLAIN",`v?${t$[B$.MAINVERSION]}${t$[B$.PRERELEASE]}?${t$[B$.BUILD]}?`);P6("FULL",`^${t$[B$.FULLPLAIN]}$`);P6("LOOSEPLAIN",`[v=\\s]*${t$[B$.MAINVERSIONLOOSE]}${t$[B$.PRERELEASELOOSE]}?${t$[B$.BUILD]}?`);P6("LOOSE",`^${t$[B$.LOOSEPLAIN]}$`);P6("GTLT","((?:<|>)?=?)");P6("XRANGEIDENTIFIERLOOSE",`${t$[B$.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P6("XRANGEIDENTIFIER",`${t$[B$.NUMERICIDENTIFIER]}|x|X|\\*`);P6("XRANGEPLAIN",`[v=\\s]*(${t$[B$.XRANGEIDENTIFIER]})(?:\\.(${t$[B$.XRANGEIDENTIFIER]})(?:\\.(${t$[B$.XRANGEIDENTIFIER]})(?:${t$[B$.PRERELEASE]})?${t$[B$.BUILD]}?)?)?`);P6("XRANGEPLAINLOOSE",`[v=\\s]*(${t$[B$.XRANGEIDENTIFIERLOOSE]})(?:\\.(${t$[B$.XRANGEIDENTIFIERLOOSE]})(?:\\.(${t$[B$.XRANGEIDENTIFIERLOOSE]})(?:${t$[B$.PRERELEASELOOSE]})?${t$[B$.BUILD]}?)?)?`);P6("XRANGE",`^${t$[B$.GTLT]}\\s*${t$[B$.XRANGEPLAIN]}$`);P6("XRANGELOOSE",`^${t$[B$.GTLT]}\\s*${t$[B$.XRANGEPLAINLOOSE]}$`);P6("COERCEPLAIN",`(^|[^\\d])(\\d{1,${LO}})(?:\\.(\\d{1,${LO}}))?(?:\\.(\\d{1,${LO}}))?`);P6("COERCE",`${t$[B$.COERCEPLAIN]}(?:$|[^\\d])`);P6("COERCEFULL",t$[B$.COERCEPLAIN]+`(?:${t$[B$.PRERELEASE]})?(?:${t$[B$.BUILD]})?(?:$|[^\\d])`);P6("COERCERTL",t$[B$.COERCE],!0);P6("COERCERTLFULL",t$[B$.COERCEFULL],!0);P6("LONETILDE","(?:~>?)");P6("TILDETRIM",`(\\s*)${t$[B$.LONETILDE]}\\s+`,!0);g8.tildeTrimReplace="$1~";P6("TILDE",`^${t$[B$.LONETILDE]}${t$[B$.XRANGEPLAIN]}$`);P6("TILDELOOSE",`^${t$[B$.LONETILDE]}${t$[B$.XRANGEPLAINLOOSE]}$`);P6("LONECARET","(?:\\^)");P6("CARETTRIM",`(\\s*)${t$[B$.LONECARET]}\\s+`,!0);g8.caretTrimReplace="$1^";P6("CARET",`^${t$[B$.LONECARET]}${t$[B$.XRANGEPLAIN]}$`);P6("CARETLOOSE",`^${t$[B$.LONECARET]}${t$[B$.XRANGEPLAINLOOSE]}$`);P6("COMPARATORLOOSE",`^${t$[B$.GTLT]}\\s*(${t$[B$.LOOSEPLAIN]})$|^$`);P6("COMPARATOR",`^${t$[B$.GTLT]}\\s*(${t$[B$.FULLPLAIN]})$|^$`);P6("COMPARATORTRIM",`(\\s*)${t$[B$.GTLT]}\\s*(${t$[B$.LOOSEPLAIN]}|${t$[B$.XRANGEPLAIN]})`,!0);g8.comparatorTrimReplace="$1$2$3";P6("HYPHENRANGE",`^\\s*(${t$[B$.XRANGEPLAIN]})\\s+-\\s+(${t$[B$.XRANGEPLAIN]})\\s*$`);P6("HYPHENRANGELOOSE",`^\\s*(${t$[B$.XRANGEPLAINLOOSE]})\\s+-\\s+(${t$[B$.XRANGEPLAINLOOSE]})\\s*$`);P6("STAR","(<|>)?=?\\s*\\*");P6("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P6("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Z1=u$((li,fT)=>{var tN=Object.freeze({loose:!0}),BN=Object.freeze({}),UN=($)=>{if(!$)return BN;if(typeof $!=="object")return tN;return $};fT.exports=UN});var uO=u$((oi,GT)=>{var kT=/^[0-9]+$/,AT=($,q)=>{let K=kT.test($),P=kT.test(q);if(K&&P)$=+$,q=+q;return $===q?0:K&&!P?-1:P&&!K?1:$<q?-1:1},FN=($,q)=>AT(q,$);GT.exports={compareIdentifiers:AT,rcompareIdentifiers:FN}});var Cq=u$((ri,ST)=>{var X1=PP(),{MAX_LENGTH:VT,MAX_SAFE_INTEGER:f1}=_P(),{safeRe:k1,t:A1}=i_(),aN=Z1(),{compareIdentifiers:t_}=uO();class V8{constructor($,q){if(q=aN(q),$ instanceof V8)if($.loose===!!q.loose&&$.includePrerelease===!!q.includePrerelease)return $;else $=$.version;else if(typeof $!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof $}".`);if($.length>VT)throw TypeError(`version is longer than ${VT} characters`);X1("SemVer",$,q),this.options=q,this.loose=!!q.loose,this.includePrerelease=!!q.includePrerelease;let K=$.trim().match(q.loose?k1[A1.LOOSE]:k1[A1.FULL]);if(!K)throw TypeError(`Invalid Version: ${$}`);if(this.raw=$,this.major=+K[1],this.minor=+K[2],this.patch=+K[3],this.major>f1||this.major<0)throw TypeError("Invalid major version");if(this.minor>f1||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>f1||this.patch<0)throw TypeError("Invalid patch version");if(!K[4])this.prerelease=[];else this.prerelease=K[4].split(".").map((P)=>{if(/^[0-9]+$/.test(P)){let _=+P;if(_>=0&&_<f1)return _}return P});this.build=K[5]?K[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare($){if(X1("SemVer.compare",this.version,this.options,$),!($ instanceof V8)){if(typeof $==="string"&&$===this.version)return 0;$=new V8($,this.options)}if($.version===this.version)return 0;return this.compareMain($)||this.comparePre($)}compareMain($){if(!($ instanceof V8))$=new V8($,this.options);return t_(this.major,$.major)||t_(this.minor,$.minor)||t_(this.patch,$.patch)}comparePre($){if(!($ instanceof V8))$=new V8($,this.options);if(this.prerelease.length&&!$.prerelease.length)return-1;else if(!this.prerelease.length&&$.prerelease.length)return 1;else if(!this.prerelease.length&&!$.prerelease.length)return 0;let q=0;do{let K=this.prerelease[q],P=$.prerelease[q];if(X1("prerelease compare",q,K,P),K===void 0&&P===void 0)return 0;else if(P===void 0)return 1;else if(K===void 0)return-1;else if(K===P)continue;else return t_(K,P)}while(++q)}compareBuild($){if(!($ instanceof V8))$=new V8($,this.options);let q=0;do{let K=this.build[q],P=$.build[q];if(X1("build compare",q,K,P),K===void 0&&P===void 0)return 0;else if(P===void 0)return 1;else if(K===void 0)return-1;else if(K===P)continue;else return t_(K,P)}while(++q)}inc($,q,K){if($.startsWith("pre")){if(!q&&K===!1)throw Error("invalid increment argument: identifier is empty");if(q){let P=`-${q}`.match(this.options.loose?k1[A1.PRERELEASELOOSE]:k1[A1.PRERELEASE]);if(!P||P[1]!==q)throw Error(`invalid identifier: ${q}`)}}switch($){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",q,K);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",q,K);break;case"prepatch":this.prerelease.length=0,this.inc("patch",q,K),this.inc("pre",q,K);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",q,K);this.inc("pre",q,K);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let P=Number(K)?1:0;if(this.prerelease.length===0)this.prerelease=[P];else{let _=this.prerelease.length;while(--_>=0)if(typeof this.prerelease[_]==="number")this.prerelease[_]++,_=-2;if(_===-1){if(q===this.prerelease.join(".")&&K===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(P)}}if(q){let _=[q,P];if(K===!1)_=[q];if(t_(this.prerelease[0],q)===0){if(isNaN(this.prerelease[1]))this.prerelease=_}else this.prerelease=_}break}default:throw Error(`invalid increment argument: ${$}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}ST.exports=V8});var QK=u$((ni,NT)=>{var MT=Cq(),QN=($,q,K=!1)=>{if($ instanceof MT)return $;try{return new MT($,q)}catch(P){if(!K)return null;throw P}};NT.exports=QN});var ET=u$((ii,CT)=>{var eN=QK(),sN=($,q)=>{let K=eN($,q);return K?K.version:null};CT.exports=sN});var RT=u$((ti,hT)=>{var $C=QK(),qC=($,q)=>{let K=$C($.trim().replace(/^[=v]+/,""),q);return K?K.version:null};hT.exports=qC});var gT=u$((Bi,DT)=>{var IT=Cq(),KC=($,q,K,P,_)=>{if(typeof K==="string")_=P,P=K,K=void 0;try{return new IT($ instanceof IT?$.version:$,K).inc(q,P,_).version}catch(O){return null}};DT.exports=KC});var uT=u$((Ui,bT)=>{var LT=QK(),_C=($,q)=>{let K=LT($,null,!0),P=LT(q,null,!0),_=K.compare(P);if(_===0)return null;let O=_>0,j=O?K:P,z=O?P:K,J=!!j.prerelease.length;if(!!z.prerelease.length&&!J){if(!z.patch&&!z.minor)return"major";if(z.compareMain(j)===0){if(z.minor&&!z.patch)return"minor";return"patch"}}let G=J?"pre":"";if(K.major!==P.major)return G+"major";if(K.minor!==P.minor)return G+"minor";if(K.patch!==P.patch)return G+"patch";return"prerelease"};bT.exports=_C});var pT=u$((Fi,yT)=>{var PC=Cq(),jC=($,q)=>new PC($,q).major;yT.exports=jC});var cT=u$((ai,xT)=>{var OC=Cq(),YC=($,q)=>new OC($,q).minor;xT.exports=YC});var dT=u$((Qi,mT)=>{var vC=Cq(),zC=($,q)=>new vC($,q).patch;mT.exports=zC});var oT=u$((ei,lT)=>{var WC=QK(),HC=($,q)=>{let K=WC($,q);return K&&K.prerelease.length?K.prerelease:null};lT.exports=HC});var j8=u$((si,nT)=>{var rT=Cq(),JC=($,q,K)=>new rT($,K).compare(new rT(q,K));nT.exports=JC});var tT=u$(($t,iT)=>{var TC=j8(),wC=($,q,K)=>TC(q,$,K);iT.exports=wC});var UT=u$((qt,BT)=>{var ZC=j8(),XC=($,q)=>ZC($,q,!0);BT.exports=XC});var G1=u$((Kt,aT)=>{var FT=Cq(),fC=($,q,K)=>{let P=new FT($,K),_=new FT(q,K);return P.compare(_)||P.compareBuild(_)};aT.exports=fC});var eT=u$((_t,QT)=>{var kC=G1(),AC=($,q)=>$.sort((K,P)=>kC(K,P,q));QT.exports=AC});var $w=u$((Pt,sT)=>{var GC=G1(),VC=($,q)=>$.sort((K,P)=>GC(P,K,q));sT.exports=VC});var jP=u$((jt,qw)=>{var SC=j8(),MC=($,q,K)=>SC($,q,K)>0;qw.exports=MC});var V1=u$((Ot,Kw)=>{var NC=j8(),CC=($,q,K)=>NC($,q,K)<0;Kw.exports=CC});var yO=u$((Yt,_w)=>{var EC=j8(),hC=($,q,K)=>EC($,q,K)===0;_w.exports=hC});var pO=u$((vt,Pw)=>{var RC=j8(),IC=($,q,K)=>RC($,q,K)!==0;Pw.exports=IC});var S1=u$((zt,jw)=>{var DC=j8(),gC=($,q,K)=>DC($,q,K)>=0;jw.exports=gC});var M1=u$((Wt,Ow)=>{var LC=j8(),bC=($,q,K)=>LC($,q,K)<=0;Ow.exports=bC});var xO=u$((Ht,Yw)=>{var uC=yO(),yC=pO(),pC=jP(),xC=S1(),cC=V1(),mC=M1(),dC=($,q,K,P)=>{switch(q){case"===":if(typeof $==="object")$=$.version;if(typeof K==="object")K=K.version;return $===K;case"!==":if(typeof $==="object")$=$.version;if(typeof K==="object")K=K.version;return $!==K;case"":case"=":case"==":return uC($,K,P);case"!=":return yC($,K,P);case">":return pC($,K,P);case">=":return xC($,K,P);case"<":return cC($,K,P);case"<=":return mC($,K,P);default:throw TypeError(`Invalid operator: ${q}`)}};Yw.exports=dC});var zw=u$((Jt,vw)=>{var lC=Cq(),oC=QK(),{safeRe:N1,t:C1}=i_(),rC=($,q)=>{if($ instanceof lC)return $;if(typeof $==="number")$=String($);if(typeof $!=="string")return null;q=q||{};let K=null;if(!q.rtl)K=$.match(q.includePrerelease?N1[C1.COERCEFULL]:N1[C1.COERCE]);else{let J=q.includePrerelease?N1[C1.COERCERTLFULL]:N1[C1.COERCERTL],w;while((w=J.exec($))&&(!K||K.index+K[0].length!==$.length)){if(!K||w.index+w[0].length!==K.index+K[0].length)K=w;J.lastIndex=w.index+w[1].length+w[2].length}J.lastIndex=-1}if(K===null)return null;let P=K[2],_=K[3]||"0",O=K[4]||"0",j=q.includePrerelease&&K[5]?`-${K[5]}`:"",z=q.includePrerelease&&K[6]?`+${K[6]}`:"";return oC(`${P}.${_}.${O}${j}${z}`,q)};vw.exports=rC});var Jw=u$((Tt,Hw)=>{class Ww{constructor(){this.max=1000,this.map=new Map}get($){let q=this.map.get($);if(q===void 0)return;else return this.map.delete($),this.map.set($,q),q}delete($){return this.map.delete($)}set($,q){if(!this.delete($)&&q!==void 0){if(this.map.size>=this.max){let P=this.map.keys().next().value;this.delete(P)}this.map.set($,q)}return this}}Hw.exports=Ww});var O8=u$((wt,Xw)=>{var nC=/\s+/g;class OP{constructor($,q){if(q=tC(q),$ instanceof OP)if($.loose===!!q.loose&&$.includePrerelease===!!q.includePrerelease)return $;else return new OP($.raw,q);if($ instanceof cO)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=q,this.loose=!!q.loose,this.includePrerelease=!!q.includePrerelease,this.raw=$.trim().replace(nC," "),this.set=this.raw.split("||").map((K)=>this.parseRange(K.trim())).filter((K)=>K.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let K=this.set[0];if(this.set=this.set.filter((P)=>!ww(P[0])),this.set.length===0)this.set=[K];else if(this.set.length>1){for(let P of this.set)if(P.length===1&&sC(P[0])){this.set=[P];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){if($>0)this.formatted+="||";let q=this.set[$];for(let K=0;K<q.length;K++){if(K>0)this.formatted+=" ";this.formatted+=q[K].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){let K=((this.options.includePrerelease&&QC)|(this.options.loose&&eC))+":"+$,P=Tw.get(K);if(P)return P;let _=this.options.loose,O=_?xq[hq.HYPHENRANGELOOSE]:xq[hq.HYPHENRANGE];$=$.replace(O,zE(this.options.includePrerelease)),M6("hyphen replace",$),$=$.replace(xq[hq.COMPARATORTRIM],UC),M6("comparator trim",$),$=$.replace(xq[hq.TILDETRIM],FC),M6("tilde trim",$),$=$.replace(xq[hq.CARETTRIM],aC),M6("caret trim",$);let j=$.split(" ").map((G)=>$E(G,this.options)).join(" ").split(/\s+/).map((G)=>vE(G,this.options));if(_)j=j.filter((G)=>{return M6("loose invalid filter",G,this.options),!!G.match(xq[hq.COMPARATORLOOSE])});M6("range list",j);let z=new Map,J=j.map((G)=>new cO(G,this.options));for(let G of J){if(ww(G))return[G];z.set(G.value,G)}if(z.size>1&&z.has(""))z.delete("");let w=[...z.values()];return Tw.set(K,w),w}intersects($,q){if(!($ instanceof OP))throw TypeError("a Range is required");return this.set.some((K)=>{return Zw(K,q)&&$.set.some((P)=>{return Zw(P,q)&&K.every((_)=>{return P.every((O)=>{return _.intersects(O,q)})})})})}test($){if(!$)return!1;if(typeof $==="string")try{$=new BC($,this.options)}catch(q){return!1}for(let q=0;q<this.set.length;q++)if(WE(this.set[q],$,this.options))return!0;return!1}}Xw.exports=OP;var iC=Jw(),Tw=new iC,tC=Z1(),cO=YP(),M6=PP(),BC=Cq(),{safeRe:xq,t:hq,comparatorTrimReplace:UC,tildeTrimReplace:FC,caretTrimReplace:aC}=i_(),{FLAG_INCLUDE_PRERELEASE:QC,FLAG_LOOSE:eC}=_P(),ww=($)=>$.value==="<0.0.0-0",sC=($)=>$.value==="",Zw=($,q)=>{let K=!0,P=$.slice(),_=P.pop();while(K&&P.length)K=P.every((O)=>{return _.intersects(O,q)}),_=P.pop();return K},$E=($,q)=>{return M6("comp",$,q),$=_E($,q),M6("caret",$),$=qE($,q),M6("tildes",$),$=jE($,q),M6("xrange",$),$=YE($,q),M6("stars",$),$},Rq=($)=>!$||$.toLowerCase()==="x"||$==="*",qE=($,q)=>{return $.trim().split(/\s+/).map((K)=>KE(K,q)).join(" ")},KE=($,q)=>{let K=q.loose?xq[hq.TILDELOOSE]:xq[hq.TILDE];return $.replace(K,(P,_,O,j,z)=>{M6("tilde",$,P,_,O,j,z);let J;if(Rq(_))J="";else if(Rq(O))J=`>=${_}.0.0 <${+_+1}.0.0-0`;else if(Rq(j))J=`>=${_}.${O}.0 <${_}.${+O+1}.0-0`;else if(z)M6("replaceTilde pr",z),J=`>=${_}.${O}.${j}-${z} <${_}.${+O+1}.0-0`;else J=`>=${_}.${O}.${j} <${_}.${+O+1}.0-0`;return M6("tilde return",J),J})},_E=($,q)=>{return $.trim().split(/\s+/).map((K)=>PE(K,q)).join(" ")},PE=($,q)=>{M6("caret",$,q);let K=q.loose?xq[hq.CARETLOOSE]:xq[hq.CARET],P=q.includePrerelease?"-0":"";return $.replace(K,(_,O,j,z,J)=>{M6("caret",$,_,O,j,z,J);let w;if(Rq(O))w="";else if(Rq(j))w=`>=${O}.0.0${P} <${+O+1}.0.0-0`;else if(Rq(z))if(O==="0")w=`>=${O}.${j}.0${P} <${O}.${+j+1}.0-0`;else w=`>=${O}.${j}.0${P} <${+O+1}.0.0-0`;else if(J)if(M6("replaceCaret pr",J),O==="0")if(j==="0")w=`>=${O}.${j}.${z}-${J} <${O}.${j}.${+z+1}-0`;else w=`>=${O}.${j}.${z}-${J} <${O}.${+j+1}.0-0`;else w=`>=${O}.${j}.${z}-${J} <${+O+1}.0.0-0`;else if(M6("no pr"),O==="0")if(j==="0")w=`>=${O}.${j}.${z}${P} <${O}.${j}.${+z+1}-0`;else w=`>=${O}.${j}.${z}${P} <${O}.${+j+1}.0-0`;else w=`>=${O}.${j}.${z} <${+O+1}.0.0-0`;return M6("caret return",w),w})},jE=($,q)=>{return M6("replaceXRanges",$,q),$.split(/\s+/).map((K)=>OE(K,q)).join(" ")},OE=($,q)=>{$=$.trim();let K=q.loose?xq[hq.XRANGELOOSE]:xq[hq.XRANGE];return $.replace(K,(P,_,O,j,z,J)=>{M6("xRange",$,P,_,O,j,z,J);let w=Rq(O),G=w||Rq(j),f=G||Rq(z),A=f;if(_==="="&&A)_="";if(J=q.includePrerelease?"-0":"",w)if(_===">"||_==="<")P="<0.0.0-0";else P="*";else if(_&&A){if(G)j=0;if(z=0,_===">")if(_=">=",G)O=+O+1,j=0,z=0;else j=+j+1,z=0;else if(_==="<=")if(_="<",G)O=+O+1;else j=+j+1;if(_==="<")J="-0";P=`${_+O}.${j}.${z}${J}`}else if(G)P=`>=${O}.0.0${J} <${+O+1}.0.0-0`;else if(f)P=`>=${O}.${j}.0${J} <${O}.${+j+1}.0-0`;return M6("xRange return",P),P})},YE=($,q)=>{return M6("replaceStars",$,q),$.trim().replace(xq[hq.STAR],"")},vE=($,q)=>{return M6("replaceGTE0",$,q),$.trim().replace(xq[q.includePrerelease?hq.GTE0PRE:hq.GTE0],"")},zE=($)=>(q,K,P,_,O,j,z,J,w,G,f,A)=>{if(Rq(P))K="";else if(Rq(_))K=`>=${P}.0.0${$?"-0":""}`;else if(Rq(O))K=`>=${P}.${_}.0${$?"-0":""}`;else if(j)K=`>=${K}`;else K=`>=${K}${$?"-0":""}`;if(Rq(w))J="";else if(Rq(G))J=`<${+w+1}.0.0-0`;else if(Rq(f))J=`<${w}.${+G+1}.0-0`;else if(A)J=`<=${w}.${G}.${f}-${A}`;else if($)J=`<${w}.${G}.${+f+1}-0`;else J=`<=${J}`;return`${K} ${J}`.trim()},WE=($,q,K)=>{for(let P=0;P<$.length;P++)if(!$[P].test(q))return!1;if(q.prerelease.length&&!K.includePrerelease){for(let P=0;P<$.length;P++){if(M6($[P].semver),$[P].semver===cO.ANY)continue;if($[P].semver.prerelease.length>0){let _=$[P].semver;if(_.major===q.major&&_.minor===q.minor&&_.patch===q.patch)return!0}}return!1}return!0}});var YP=u$((Zt,Sw)=>{var vP=Symbol("SemVer ANY");class E1{static get ANY(){return vP}constructor($,q){if(q=fw(q),$ instanceof E1)if($.loose===!!q.loose)return $;else $=$.value;if($=$.trim().split(/\s+/).join(" "),dO("comparator",$,q),this.options=q,this.loose=!!q.loose,this.parse($),this.semver===vP)this.value="";else this.value=this.operator+this.semver.version;dO("comp",this)}parse($){let q=this.options.loose?kw[Aw.COMPARATORLOOSE]:kw[Aw.COMPARATOR],K=$.match(q);if(!K)throw TypeError(`Invalid comparator: ${$}`);if(this.operator=K[1]!==void 0?K[1]:"",this.operator==="=")this.operator="";if(!K[2])this.semver=vP;else this.semver=new Gw(K[2],this.options.loose)}toString(){return this.value}test($){if(dO("Comparator.test",$,this.options.loose),this.semver===vP||$===vP)return!0;if(typeof $==="string")try{$=new Gw($,this.options)}catch(q){return!1}return mO($,this.operator,this.semver,this.options)}intersects($,q){if(!($ instanceof E1))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Vw($.value,q).test(this.value)}else if($.operator===""){if($.value==="")return!0;return new Vw(this.value,q).test($.semver)}if(q=fw(q),q.includePrerelease&&(this.value==="<0.0.0-0"||$.value==="<0.0.0-0"))return!1;if(!q.includePrerelease&&(this.value.startsWith("<0.0.0")||$.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&$.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&$.operator.startsWith("<"))return!0;if(this.semver.version===$.semver.version&&this.operator.includes("=")&&$.operator.includes("="))return!0;if(mO(this.semver,"<",$.semver,q)&&this.operator.startsWith(">")&&$.operator.startsWith("<"))return!0;if(mO(this.semver,">",$.semver,q)&&this.operator.startsWith("<")&&$.operator.startsWith(">"))return!0;return!1}}Sw.exports=E1;var fw=Z1(),{safeRe:kw,t:Aw}=i_(),mO=xO(),dO=PP(),Gw=Cq(),Vw=O8()});var zP=u$((Xt,Mw)=>{var HE=O8(),JE=($,q,K)=>{try{q=new HE(q,K)}catch(P){return!1}return q.test($)};Mw.exports=JE});var Cw=u$((ft,Nw)=>{var TE=O8(),wE=($,q)=>new TE($,q).set.map((K)=>K.map((P)=>P.value).join(" ").trim().split(" "));Nw.exports=wE});var hw=u$((kt,Ew)=>{var ZE=Cq(),XE=O8(),fE=($,q,K)=>{let P=null,_=null,O=null;try{O=new XE(q,K)}catch(j){return null}return $.forEach((j)=>{if(O.test(j)){if(!P||_.compare(j)===-1)P=j,_=new ZE(P,K)}}),P};Ew.exports=fE});var Iw=u$((At,Rw)=>{var kE=Cq(),AE=O8(),GE=($,q,K)=>{let P=null,_=null,O=null;try{O=new AE(q,K)}catch(j){return null}return $.forEach((j)=>{if(O.test(j)){if(!P||_.compare(j)===1)P=j,_=new kE(P,K)}}),P};Rw.exports=GE});var Lw=u$((Gt,gw)=>{var lO=Cq(),VE=O8(),Dw=jP(),SE=($,q)=>{$=new VE($,q);let K=new lO("0.0.0");if($.test(K))return K;if(K=new lO("0.0.0-0"),$.test(K))return K;K=null;for(let P=0;P<$.set.length;++P){let _=$.set[P],O=null;if(_.forEach((j)=>{let z=new lO(j.semver.version);switch(j.operator){case">":if(z.prerelease.length===0)z.patch++;else z.prerelease.push(0);z.raw=z.format();case"":case">=":if(!O||Dw(z,O))O=z;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${j.operator}`)}}),O&&(!K||Dw(K,O)))K=O}if(K&&$.test(K))return K;return null};gw.exports=SE});var uw=u$((Vt,bw)=>{var ME=O8(),NE=($,q)=>{try{return new ME($,q).range||"*"}catch(K){return null}};bw.exports=NE});var h1=u$((St,cw)=>{var CE=Cq(),xw=YP(),{ANY:EE}=xw,hE=O8(),RE=zP(),yw=jP(),pw=V1(),IE=M1(),DE=S1(),gE=($,q,K,P)=>{$=new CE($,P),q=new hE(q,P);let _,O,j,z,J;switch(K){case">":_=yw,O=IE,j=pw,z=">",J=">=";break;case"<":_=pw,O=DE,j=yw,z="<",J="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(RE($,q,P))return!1;for(let w=0;w<q.set.length;++w){let G=q.set[w],f=null,A=null;if(G.forEach((V)=>{if(V.semver===EE)V=new xw(">=0.0.0");if(f=f||V,A=A||V,_(V.semver,f.semver,P))f=V;else if(j(V.semver,A.semver,P))A=V}),f.operator===z||f.operator===J)return!1;if((!A.operator||A.operator===z)&&O($,A.semver))return!1;else if(A.operator===J&&j($,A.semver))return!1}return!0};cw.exports=gE});var dw=u$((Mt,mw)=>{var LE=h1(),bE=($,q,K)=>LE($,q,">",K);mw.exports=bE});var ow=u$((Nt,lw)=>{var uE=h1(),yE=($,q,K)=>uE($,q,"<",K);lw.exports=yE});var iw=u$((Ct,nw)=>{var rw=O8(),pE=($,q,K)=>{return $=new rw($,K),q=new rw(q,K),$.intersects(q,K)};nw.exports=pE});var Bw=u$((Et,tw)=>{var xE=zP(),cE=j8();tw.exports=($,q,K)=>{let P=[],_=null,O=null,j=$.sort((G,f)=>cE(G,f,K));for(let G of j)if(xE(G,q,K)){if(O=G,!_)_=G}else{if(O)P.push([_,O]);O=null,_=null}if(_)P.push([_,null]);let z=[];for(let[G,f]of P)if(G===f)z.push(G);else if(!f&&G===j[0])z.push("*");else if(!f)z.push(`>=${G}`);else if(G===j[0])z.push(`<=${f}`);else z.push(`${G} - ${f}`);let J=z.join(" || "),w=typeof q.raw==="string"?q.raw:String(q);return J.length<w.length?J:q}});var sw=u$((ht,ew)=>{var Uw=O8(),rO=YP(),{ANY:oO}=rO,WP=zP(),nO=j8(),mE=($,q,K={})=>{if($===q)return!0;$=new Uw($,K),q=new Uw(q,K);let P=!1;$:for(let _ of $.set){for(let O of q.set){let j=lE(_,O,K);if(P=P||j!==null,j)continue $}if(P)return!1}return!0},dE=[new rO(">=0.0.0-0")],Fw=[new rO(">=0.0.0")],lE=($,q,K)=>{if($===q)return!0;if($.length===1&&$[0].semver===oO)if(q.length===1&&q[0].semver===oO)return!0;else if(K.includePrerelease)$=dE;else $=Fw;if(q.length===1&&q[0].semver===oO)if(K.includePrerelease)return!0;else q=Fw;let P=new Set,_,O;for(let V of $)if(V.operator===">"||V.operator===">=")_=aw(_,V,K);else if(V.operator==="<"||V.operator==="<=")O=Qw(O,V,K);else P.add(V.semver);if(P.size>1)return null;let j;if(_&&O){if(j=nO(_.semver,O.semver,K),j>0)return null;else if(j===0&&(_.operator!==">="||O.operator!=="<="))return null}for(let V of P){if(_&&!WP(V,String(_),K))return null;if(O&&!WP(V,String(O),K))return null;for(let C of q)if(!WP(V,String(C),K))return!1;return!0}let z,J,w,G,f=O&&!K.includePrerelease&&O.semver.prerelease.length?O.semver:!1,A=_&&!K.includePrerelease&&_.semver.prerelease.length?_.semver:!1;if(f&&f.prerelease.length===1&&O.operator==="<"&&f.prerelease[0]===0)f=!1;for(let V of q){if(G=G||V.operator===">"||V.operator===">=",w=w||V.operator==="<"||V.operator==="<=",_){if(A){if(V.semver.prerelease&&V.semver.prerelease.length&&V.semver.major===A.major&&V.semver.minor===A.minor&&V.semver.patch===A.patch)A=!1}if(V.operator===">"||V.operator===">="){if(z=aw(_,V,K),z===V&&z!==_)return!1}else if(_.operator===">="&&!WP(_.semver,String(V),K))return!1}if(O){if(f){if(V.semver.prerelease&&V.semver.prerelease.length&&V.semver.major===f.major&&V.semver.minor===f.minor&&V.semver.patch===f.patch)f=!1}if(V.operator==="<"||V.operator==="<="){if(J=Qw(O,V,K),J===V&&J!==O)return!1}else if(O.operator==="<="&&!WP(O.semver,String(V),K))return!1}if(!V.operator&&(O||_)&&j!==0)return!1}if(_&&w&&!O&&j!==0)return!1;if(O&&G&&!_&&j!==0)return!1;if(A||f)return!1;return!0},aw=($,q,K)=>{if(!$)return q;let P=nO($.semver,q.semver,K);return P>0?$:P<0?q:q.operator===">"&&$.operator===">="?q:$},Qw=($,q,K)=>{if(!$)return q;let P=nO($.semver,q.semver,K);return P<0?$:P>0?q:q.operator==="<"&&$.operator==="<="?q:$};ew.exports=mE});var _Z=u$((Rt,KZ)=>{var iO=i_(),$Z=_P(),oE=Cq(),qZ=uO(),rE=QK(),nE=ET(),iE=RT(),tE=gT(),BE=uT(),UE=pT(),FE=cT(),aE=dT(),QE=oT(),eE=j8(),sE=tT(),$h=UT(),qh=G1(),Kh=eT(),_h=$w(),Ph=jP(),jh=V1(),Oh=yO(),Yh=pO(),vh=S1(),zh=M1(),Wh=xO(),Hh=zw(),Jh=YP(),Th=O8(),wh=zP(),Zh=Cw(),Xh=hw(),fh=Iw(),kh=Lw(),Ah=uw(),Gh=h1(),Vh=dw(),Sh=ow(),Mh=iw(),Nh=Bw(),Ch=sw();KZ.exports={parse:rE,valid:nE,clean:iE,inc:tE,diff:BE,major:UE,minor:FE,patch:aE,prerelease:QE,compare:eE,rcompare:sE,compareLoose:$h,compareBuild:qh,sort:Kh,rsort:_h,gt:Ph,lt:jh,eq:Oh,neq:Yh,gte:vh,lte:zh,cmp:Wh,coerce:Hh,Comparator:Jh,Range:Th,satisfies:wh,toComparators:Zh,maxSatisfying:Xh,minSatisfying:fh,minVersion:kh,validRange:Ah,outside:Gh,gtr:Vh,ltr:Sh,intersects:Mh,simplifyRange:Nh,subset:Ch,SemVer:oE,re:iO.re,src:iO.src,tokens:iO.t,SEMVER_SPEC_VERSION:$Z.SEMVER_SPEC_VERSION,RELEASE_TYPES:$Z.RELEASE_TYPES,compareIdentifiers:qZ.compareIdentifiers,rcompareIdentifiers:qZ.rcompareIdentifiers}});var AZ=u$((OB,kZ)=>{kZ.exports=function($,q){if(typeof $!=="string")throw TypeError("Expected a string");return q=typeof q>"u"?"_":q,$.replace(/([a-z\d])([A-Z])/g,"$1"+q+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+q+"$2").toLowerCase()}});var EZ=u$((YB,aO)=>{var th=/[\p{Lu}]/u,Bh=/[\p{Ll}]/u,GZ=/^[\p{Lu}](?![\p{Lu}])/gu,MZ=/([\p{Alpha}\p{N}_]|$)/u,NZ=/[_.\- ]+/,Uh=new RegExp("^"+NZ.source),VZ=new RegExp(NZ.source+MZ.source,"gu"),SZ=new RegExp("\\d+"+MZ.source,"gu"),Fh=($,q,K)=>{let P=!1,_=!1,O=!1;for(let j=0;j<$.length;j++){let z=$[j];if(P&&th.test(z))$=$.slice(0,j)+"-"+$.slice(j),P=!1,O=_,_=!0,j++;else if(_&&O&&Bh.test(z))$=$.slice(0,j-1)+"-"+$.slice(j-1),O=_,_=!1,P=!0;else P=q(z)===z&&K(z)!==z,O=_,_=K(z)===z&&q(z)!==z}return $},ah=($,q)=>{return GZ.lastIndex=0,$.replace(GZ,(K)=>q(K))},Qh=($,q)=>{return VZ.lastIndex=0,SZ.lastIndex=0,$.replace(VZ,(K,P)=>q(P)).replace(SZ,(K)=>q(K))},CZ=($,q)=>{if(!(typeof $==="string"||Array.isArray($)))throw TypeError("Expected the input to be `string | string[]`");if(q={pascalCase:!1,preserveConsecutiveUppercase:!1,...q},Array.isArray($))$=$.map((O)=>O.trim()).filter((O)=>O.length).join("-");else $=$.trim();if($.length===0)return"";let K=q.locale===!1?(O)=>O.toLowerCase():(O)=>O.toLocaleLowerCase(q.locale),P=q.locale===!1?(O)=>O.toUpperCase():(O)=>O.toLocaleUpperCase(q.locale);if($.length===1)return q.pascalCase?P($):K($);if($!==K($))$=Fh($,K,P);if($=$.replace(Uh,""),q.preserveConsecutiveUppercase)$=ah($,K);else $=K($);if(q.pascalCase)$=P($.charAt(0))+$.slice(1);return Qh($,P)};aO.exports=CZ;aO.exports.default=CZ});var xZ=u$((AB,pZ)=>{var uZ=($=0)=>(q)=>`\x1B[${38+$};5;${q}m`,yZ=($=0)=>(q,K,P)=>`\x1B[${38+$};2;${q};${K};${P}m`;function OR(){let $=new Map,q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};q.color.gray=q.color.blackBright,q.bgColor.bgGray=q.bgColor.bgBlackBright,q.color.grey=q.color.blackBright,q.bgColor.bgGrey=q.bgColor.bgBlackBright;for(let[K,P]of Object.entries(q)){for(let[_,O]of Object.entries(P))q[_]={open:`\x1B[${O[0]}m`,close:`\x1B[${O[1]}m`},P[_]=q[_],$.set(O[0],O[1]);Object.defineProperty(q,K,{value:P,enumerable:!1})}return Object.defineProperty(q,"codes",{value:$,enumerable:!1}),q.color.close="\x1B[39m",q.bgColor.close="\x1B[49m",q.color.ansi256=uZ(),q.color.ansi16m=yZ(),q.bgColor.ansi256=uZ(10),q.bgColor.ansi16m=yZ(10),Object.defineProperties(q,{rgbToAnsi256:{value:(K,P,_)=>{if(K===P&&P===_){if(K<8)return 16;if(K>248)return 231;return Math.round((K-8)/247*24)+232}return 16+36*Math.round(K/255*5)+6*Math.round(P/255*5)+Math.round(_/255*5)},enumerable:!1},hexToRgb:{value:(K)=>{let P=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(K.toString(16));if(!P)return[0,0,0];let{colorString:_}=P.groups;if(_.length===3)_=_.split("").map((j)=>j+j).join("");let O=Number.parseInt(_,16);return[O>>16&255,O>>8&255,O&255]},enumerable:!1},hexToAnsi256:{value:(K)=>q.rgbToAnsi256(...q.hexToRgb(K)),enumerable:!1}}),q}Object.defineProperty(pZ,"exports",{enumerable:!0,get:OR})});var gk=u$((cL)=>{cL.byteLength=LL;cL.toByteArray=uL;cL.fromByteArray=xL;var l8=[],H8=[],gL=typeof Uint8Array<"u"?Uint8Array:Array,Vz="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(yK=0,Sz=Vz.length;yK<Sz;++yK)l8[yK]=Vz[yK],H8[Vz.charCodeAt(yK)]=yK;var yK,Sz;H8[45]=62;H8[95]=63;function Dk($){var q=$.length;if(q%4>0)throw Error("Invalid string. Length must be a multiple of 4");var K=$.indexOf("=");if(K===-1)K=q;var P=K===q?0:4-K%4;return[K,P]}function LL($){var q=Dk($),K=q[0],P=q[1];return(K+P)*3/4-P}function bL($,q,K){return(q+K)*3/4-K}function uL($){var q,K=Dk($),P=K[0],_=K[1],O=new gL(bL($,P,_)),j=0,z=_>0?P-4:P,J;for(J=0;J<z;J+=4)q=H8[$.charCodeAt(J)]<<18|H8[$.charCodeAt(J+1)]<<12|H8[$.charCodeAt(J+2)]<<6|H8[$.charCodeAt(J+3)],O[j++]=q>>16&255,O[j++]=q>>8&255,O[j++]=q&255;if(_===2)q=H8[$.charCodeAt(J)]<<2|H8[$.charCodeAt(J+1)]>>4,O[j++]=q&255;if(_===1)q=H8[$.charCodeAt(J)]<<10|H8[$.charCodeAt(J+1)]<<4|H8[$.charCodeAt(J+2)]>>2,O[j++]=q>>8&255,O[j++]=q&255;return O}function yL($){return l8[$>>18&63]+l8[$>>12&63]+l8[$>>6&63]+l8[$&63]}function pL($,q,K){var P,_=[];for(var O=q;O<K;O+=3)P=($[O]<<16&16711680)+($[O+1]<<8&65280)+($[O+2]&255),_.push(yL(P));return _.join("")}function xL($){var q,K=$.length,P=K%3,_=[],O=16383;for(var j=0,z=K-P;j<z;j+=O)_.push(pL($,j,j+O>z?z:j+O));if(P===1)q=$[K-1],_.push(l8[q>>2]+l8[q<<4&63]+"==");else if(P===2)q=($[K-2]<<8)+$[K-1],_.push(l8[q>>10]+l8[q>>4&63]+l8[q<<2&63]+"=");return _.join("")}});var Lq=u$((jb)=>{jb.__esModule=!0;jb.extend=uk;jb.indexOf=sL;jb.escapeExpression=$b;jb.isEmpty=qb;jb.createFrame=Kb;jb.blockParams=_b;jb.appendContextPath=Pb;var FL={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},aL=/[&<>"'`=]/g,QL=/[&<>"'`=]/;function eL($){return FL[$]}function uk($){for(var q=1;q<arguments.length;q++)for(var K in arguments[q])if(Object.prototype.hasOwnProperty.call(arguments[q],K))$[K]=arguments[q][K];return $}var Ez=Object.prototype.toString;jb.toString=Ez;var Cz=function(q){return typeof q==="function"};if(Cz(/x/))jb.isFunction=Cz=function($){return typeof $==="function"&&Ez.call($)==="[object Function]"};jb.isFunction=Cz;var yk=Array.isArray||function($){return $&&typeof $==="object"?Ez.call($)==="[object Array]":!1};jb.isArray=yk;function sL($,q){for(var K=0,P=$.length;K<P;K++)if($[K]===q)return K;return-1}function $b($){if(typeof $!=="string"){if($&&$.toHTML)return $.toHTML();else if($==null)return"";else if(!$)return $+"";$=""+$}if(!QL.test($))return $;return $.replace(aL,eL)}function qb($){if(!$&&$!==0)return!0;else if(yk($)&&$.length===0)return!0;else return!1}function Kb($){var q=uk({},$);return q._parent=$,q}function _b($,q){return $.path=q,$}function Pb($,q){return($?$+".":"")+q}});var J8=u$((pk,xk)=>{pk.__esModule=!0;var hz=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Rz($,q){var K=q&&q.loc,P=void 0,_=void 0,O=void 0,j=void 0;if(K)P=K.start.line,_=K.end.line,O=K.start.column,j=K.end.column,$+=" - "+P+":"+O;var z=Error.prototype.constructor.call(this,$);for(var J=0;J<hz.length;J++)this[hz[J]]=z[hz[J]];if(Error.captureStackTrace)Error.captureStackTrace(this,Rz);try{if(K)if(this.lineNumber=P,this.endLineNumber=_,Object.defineProperty)Object.defineProperty(this,"column",{value:O,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:j,enumerable:!0});else this.column=O,this.endColumn=j}catch(w){}}Rz.prototype=Error();pk.default=Rz;xk.exports=pk.default});var dk=u$((ck,mk)=>{ck.__esModule=!0;var Iz=Lq();ck.default=function($){$.registerHelper("blockHelperMissing",function(q,K){var{inverse:P,fn:_}=K;if(q===!0)return _(this);else if(q===!1||q==null)return P(this);else if(Iz.isArray(q))if(q.length>0){if(K.ids)K.ids=[K.name];return $.helpers.each(q,K)}else return P(this);else{if(K.data&&K.ids){var O=Iz.createFrame(K.data);O.contextPath=Iz.appendContextPath(K.data.contextPath,K.name),K={data:O}}return _(q,K)}})};mk.exports=ck.default});var rk=u$((lk,ok)=>{lk.__esModule=!0;function Vb($){return $&&$.__esModule?$:{default:$}}var W7=Lq(),Sb=J8(),Mb=Vb(Sb);lk.default=function($){$.registerHelper("each",function(q,K){if(!K)throw new Mb.default("Must pass iterator to #each");var{fn:P,inverse:_}=K,O=0,j="",z=void 0,J=void 0;if(K.data&&K.ids)J=W7.appendContextPath(K.data.contextPath,K.ids[0])+".";if(W7.isFunction(q))q=q.call(this);if(K.data)z=W7.createFrame(K.data);function w(C,E,R){if(z){if(z.key=C,z.index=E,z.first=E===0,z.last=!!R,J)z.contextPath=J+C}j=j+P(q[C],{data:z,blockParams:W7.blockParams([q[C],C],[J+C,null])})}if(q&&typeof q==="object")if(W7.isArray(q)){for(var G=q.length;O<G;O++)if(O in q)w(O,O,O===q.length-1)}else if(typeof Symbol==="function"&&q[Symbol.iterator]){var f=[],A=q[Symbol.iterator]();for(var V=A.next();!V.done;V=A.next())f.push(V.value);q=f;for(var G=q.length;O<G;O++)w(O,O,O===q.length-1)}else(function(){var C=void 0;if(Object.keys(q).forEach(function(E){if(C!==void 0)w(C,O-1);C=E,O++}),C!==void 0)w(C,O-1,!0)})();if(O===0)j=_(this);return j})};ok.exports=lk.default});var tk=u$((nk,ik)=>{nk.__esModule=!0;function Eb($){return $&&$.__esModule?$:{default:$}}var hb=J8(),Rb=Eb(hb);nk.default=function($){$.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new Rb.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};ik.exports=nk.default});var Qk=u$((Fk,ak)=>{Fk.__esModule=!0;function gb($){return $&&$.__esModule?$:{default:$}}var Bk=Lq(),Lb=J8(),Uk=gb(Lb);Fk.default=function($){$.registerHelper("if",function(q,K){if(arguments.length!=2)throw new Uk.default("#if requires exactly one argument");if(Bk.isFunction(q))q=q.call(this);if(!K.hash.includeZero&&!q||Bk.isEmpty(q))return K.inverse(this);else return K.fn(this)}),$.registerHelper("unless",function(q,K){if(arguments.length!=2)throw new Uk.default("#unless requires exactly one argument");return $.helpers.if.call(this,q,{fn:K.inverse,inverse:K.fn,hash:K.hash})})};ak.exports=Fk.default});var $A=u$((ek,sk)=>{ek.__esModule=!0;ek.default=function($){$.registerHelper("log",function(){var q=[void 0],K=arguments[arguments.length-1];for(var P=0;P<arguments.length-1;P++)q.push(arguments[P]);var _=1;if(K.hash.level!=null)_=K.hash.level;else if(K.data&&K.data.level!=null)_=K.data.level;q[0]=_,$.log.apply($,q)})};sk.exports=ek.default});var _A=u$((qA,KA)=>{qA.__esModule=!0;qA.default=function($){$.registerHelper("lookup",function(q,K,P){if(!q)return q;return P.lookupProperty(q,K)})};KA.exports=qA.default});var OA=u$((PA,jA)=>{PA.__esModule=!0;function mb($){return $&&$.__esModule?$:{default:$}}var H7=Lq(),db=J8(),lb=mb(db);PA.default=function($){$.registerHelper("with",function(q,K){if(arguments.length!=2)throw new lb.default("#with requires exactly one argument");if(H7.isFunction(q))q=q.call(this);var P=K.fn;if(!H7.isEmpty(q)){var _=K.data;if(K.data&&K.ids)_=H7.createFrame(K.data),_.contextPath=H7.appendContextPath(K.data.contextPath,K.ids[0]);return P(q,{data:_,blockParams:H7.blockParams([q],[_&&_.contextPath])})}else return K.inverse(this)})};jA.exports=PA.default});var Dz=u$((Ou)=>{Ou.__esModule=!0;Ou.registerDefaultHelpers=Pu;Ou.moveHelperToHooks=ju;function J_($){return $&&$.__esModule?$:{default:$}}var nb=dk(),ib=J_(nb),tb=rk(),Bb=J_(tb),Ub=tk(),Fb=J_(Ub),ab=Qk(),Qb=J_(ab),eb=$A(),sb=J_(eb),$u=_A(),qu=J_($u),Ku=OA(),_u=J_(Ku);function Pu($){ib.default($),Bb.default($),Fb.default($),Qb.default($),sb.default($),qu.default($),_u.default($)}function ju($,q,K){if($.helpers[q]){if($.hooks[q]=$.helpers[q],!K)delete $.helpers[q]}}});var zA=u$((YA,vA)=>{YA.__esModule=!0;var Wu=Lq();YA.default=function($){$.registerDecorator("inline",function(q,K,P,_){var O=q;if(!K.partials)K.partials={},O=function(j,z){var J=P.partials;P.partials=Wu.extend({},J,K.partials);var w=q(j,z);return P.partials=J,w};return K.partials[_.args[0]]=_.fn,O})};vA.exports=YA.default});var WA=u$((fu)=>{fu.__esModule=!0;fu.registerDefaultDecorators=Xu;function Tu($){return $&&$.__esModule?$:{default:$}}var wu=zA(),Zu=Tu(wu);function Xu($){Zu.default($)}});var gz=u$((HA,JA)=>{HA.__esModule=!0;var Gu=Lq(),Z4={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(q){if(typeof q==="string"){var K=Gu.indexOf(Z4.methodMap,q.toLowerCase());if(K>=0)q=K;else q=parseInt(q,10)}return q},log:function(q){if(q=Z4.lookupLevel(q),typeof console<"u"&&Z4.lookupLevel(Z4.level)<=q){var K=Z4.methodMap[q];if(!console[K])K="log";for(var P=arguments.length,_=Array(P>1?P-1:0),O=1;O<P;O++)_[O-1]=arguments[O];console[K].apply(console,_)}}};HA.default=Z4;JA.exports=HA.default});var TA=u$((Cu)=>{Cu.__esModule=!0;Cu.createNewLookupObject=Nu;var Mu=Lq();function Nu(){for(var $=arguments.length,q=Array($),K=0;K<$;K++)q[K]=arguments[K];return Mu.extend.apply(void 0,[Object.create(null)].concat(q))}});var Lz=u$((yu)=>{yu.__esModule=!0;yu.createProtoAccessControl=gu;yu.resultIsAllowed=Lu;yu.resetLoggedProperties=uu;function Ru($){return $&&$.__esModule?$:{default:$}}var wA=TA(),Iu=gz(),Du=Ru(Iu),vj=Object.create(null);function gu($){var q=Object.create(null);q.constructor=!1,q.__defineGetter__=!1,q.__defineSetter__=!1,q.__lookupGetter__=!1;var K=Object.create(null);return K.__proto__=!1,{properties:{whitelist:wA.createNewLookupObject(K,$.allowedProtoProperties),defaultValue:$.allowProtoPropertiesByDefault},methods:{whitelist:wA.createNewLookupObject(q,$.allowedProtoMethods),defaultValue:$.allowProtoMethodsByDefault}}}function Lu($,q,K){if(typeof $==="function")return ZA(q.methods,K);else return ZA(q.properties,K)}function ZA($,q){if($.whitelist[q]!==void 0)return $.whitelist[q]===!0;if($.defaultValue!==void 0)return $.defaultValue;return bu(q),!1}function bu($){if(vj[$]!==!0)vj[$]=!0,Du.default.log("error",'Handlebars: Access has been denied to resolve the property "'+$+`" because it is not an "own property" of its parent.
|
|
2
2
|
You can add a runtime option to disable the check or this warning:
|
|
3
3
|
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function uu(){Object.keys(vj).forEach(function($){delete vj[$]})}});var Wj=u$((au)=>{au.__esModule=!0;au.HandlebarsEnvironment=yz;function XA($){return $&&$.__esModule?$:{default:$}}var T_=Lq(),du=J8(),bz=XA(du),lu=Dz(),ou=WA(),ru=gz(),zj=XA(ru),nu=Lz(),iu="4.7.8";au.VERSION=iu;var tu=8;au.COMPILER_REVISION=tu;var Bu=7;au.LAST_COMPATIBLE_COMPILER_REVISION=Bu;var Uu={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};au.REVISION_CHANGES=Uu;var uz="[object Object]";function yz($,q,K){this.helpers=$||{},this.partials=q||{},this.decorators=K||{},lu.registerDefaultHelpers(this),ou.registerDefaultDecorators(this)}yz.prototype={constructor:yz,logger:zj.default,log:zj.default.log,registerHelper:function(q,K){if(T_.toString.call(q)===uz){if(K)throw new bz.default("Arg not supported with multiple helpers");T_.extend(this.helpers,q)}else this.helpers[q]=K},unregisterHelper:function(q){delete this.helpers[q]},registerPartial:function(q,K){if(T_.toString.call(q)===uz)T_.extend(this.partials,q);else{if(typeof K>"u")throw new bz.default('Attempting to register a partial called "'+q+'" as undefined');this.partials[q]=K}},unregisterPartial:function(q){delete this.partials[q]},registerDecorator:function(q,K){if(T_.toString.call(q)===uz){if(K)throw new bz.default("Arg not supported with multiple decorators");T_.extend(this.decorators,q)}else this.decorators[q]=K},unregisterDecorator:function(q){delete this.decorators[q]},resetLoggedPropertyAccesses:function(){nu.resetLoggedProperties()}};var Fu=zj.default.log;au.log=Fu;au.createFrame=T_.createFrame;au.logger=zj.default});var AA=u$((fA,kA)=>{fA.__esModule=!0;function pz($){this.string=$}pz.prototype.toString=pz.prototype.toHTML=function(){return""+this.string};fA.default=pz;kA.exports=fA.default});var GA=u$((zy)=>{zy.__esModule=!0;zy.wrapHelper=vy;function vy($,q){if(typeof $!=="function")return $;var K=function(){var _=arguments[arguments.length-1];return arguments[arguments.length-1]=q(_),$.apply(this,arguments)};return K}});var CA=u$((Ny)=>{Ny.__esModule=!0;Ny.checkRevision=fy;Ny.template=ky;Ny.wrapProgram=Hj;Ny.resolvePartial=Ay;Ny.invokePartial=Gy;Ny.noop=MA;function Jy($){return $&&$.__esModule?$:{default:$}}function Ty($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var K in $)if(Object.prototype.hasOwnProperty.call($,K))q[K]=$[K]}return q.default=$,q}}var wy=Lq(),zK=Ty(wy),Zy=J8(),WK=Jy(Zy),HK=Wj(),VA=Dz(),Xy=GA(),SA=Lz();function fy($){var q=$&&$[0]||1,K=HK.COMPILER_REVISION;if(q>=HK.LAST_COMPATIBLE_COMPILER_REVISION&&q<=HK.COMPILER_REVISION)return;if(q<HK.LAST_COMPATIBLE_COMPILER_REVISION){var P=HK.REVISION_CHANGES[K],_=HK.REVISION_CHANGES[q];throw new WK.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+P+") or downgrade your runtime to an older version ("+_+").")}else throw new WK.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+$[1]+").")}function ky($,q){if(!q)throw new WK.default("No environment passed to template");if(!$||!$.main)throw new WK.default("Unknown template object: "+typeof $);$.main.decorator=$.main_d,q.VM.checkRevision($.compiler);var K=$.compiler&&$.compiler[0]===7;function P(j,z,J){if(J.hash){if(z=zK.extend({},z,J.hash),J.ids)J.ids[0]=!0}j=q.VM.resolvePartial.call(this,j,z,J);var w=zK.extend({},J,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),G=q.VM.invokePartial.call(this,j,z,w);if(G==null&&q.compile)J.partials[J.name]=q.compile(j,$.compilerOptions,q),G=J.partials[J.name](z,w);if(G!=null){if(J.indent){var f=G.split(`
|
|
4
4
|
`);for(var A=0,V=f.length;A<V;A++){if(!f[A]&&A+1===V)break;f[A]=J.indent+f[A]}G=f.join(`
|
|
@@ -20,7 +20,7 @@ Expecting `+H.join(", ")+", got '"+(this.terminals_[u]||u)+"'";else T="Parse err
|
|
|
20
20
|
return undefined
|
|
21
21
|
}
|
|
22
22
|
`.trim()},blockValue:function(q){var K=this.aliasable("container.hooks.blockHelperMissing"),P=[this.contextName(0)];this.setupHelperArgs(q,0,P);var _=this.popStack();P.splice(1,0,_),this.push(this.source.functionCall(K,"call",P))},ambiguousBlockValue:function(){var q=this.aliasable("container.hooks.blockHelperMissing"),K=[this.contextName(0)];this.setupHelperArgs("",0,K,!0),this.flushInline();var P=this.topStack();K.splice(1,0,P),this.pushSource(["if (!",this.lastHelper,") { ",P," = ",this.source.functionCall(q,"call",K),"}"])},appendContent:function(q){if(this.pendingContent)q=this.pendingContent+q;else this.pendingLocation=this.source.currentLocation;this.pendingContent=q},append:function(){if(this.isInline())this.replaceStack(function(K){return[" != null ? ",K,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var q=this.popStack();if(this.pushSource(["if (",q," != null) { ",this.appendToBuffer(q,void 0,!0)," }"]),this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(q){this.lastContext=q},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(q,K,P,_){var O=0;if(!_&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup(q[O++]));else this.pushContext();this.resolvePath("context",q,O,K,P)},lookupBlockParam:function(q,K){this.useBlockParams=!0,this.push(["blockParams[",q[0],"][",q[1],"]"]),this.resolvePath("context",K,1)},lookupData:function(q,K,P){if(!q)this.pushStackLiteral("data");else this.pushStackLiteral("container.data(data, "+q+")");this.resolvePath("data",K,0,!0,P)},resolvePath:function(q,K,P,_,O){var j=this;if(this.options.strict||this.options.assumeObjects){this.push(zc(this.options.strict&&O,this,K,P,q));return}var z=K.length;for(;P<z;P++)this.replaceStack(function(J){var w=j.nameLookup(J,K[P],q);if(!_)return[" != null ? ",w," : ",J];else return[" && ",w]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(q,K){if(this.pushContext(),this.pushString(K),K!=="SubExpression")if(typeof q==="string")this.pushString(q);else this.pushStackLiteral(q)},emptyHash:function(q){if(this.trackIds)this.push("{}");if(this.stringParams)this.push("{}"),this.push("{}");this.pushStackLiteral(q?"undefined":"{}")},pushHash:function(){if(this.hash)this.hashes.push(this.hash);this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var q=this.hash;if(this.hash=this.hashes.pop(),this.trackIds)this.push(this.objectLiteral(q.ids));if(this.stringParams)this.push(this.objectLiteral(q.contexts)),this.push(this.objectLiteral(q.types));this.push(this.objectLiteral(q.values))},pushString:function(q){this.pushStackLiteral(this.quotedString(q))},pushLiteral:function(q){this.pushStackLiteral(q)},pushProgram:function(q){if(q!=null)this.pushStackLiteral(this.programExpression(q));else this.pushStackLiteral(null)},registerDecorator:function(q,K){var P=this.nameLookup("decorators",K,"decorator"),_=this.setupHelperArgs(K,q);this.decorators.push(["fn = ",this.decorators.functionCall(P,"",["fn","props","container",_])," || fn;"])},invokeHelper:function(q,K,P){var _=this.popStack(),O=this.setupHelper(q,K),j=[];if(P)j.push(O.name);if(j.push(_),!this.options.strict)j.push(this.aliasable("container.hooks.helperMissing"));var z=["(",this.itemsSeparatedBy(j,"||"),")"],J=this.source.functionCall(z,"call",O.callParams);this.push(J)},itemsSeparatedBy:function(q,K){var P=[];P.push(q[0]);for(var _=1;_<q.length;_++)P.push(K,q[_]);return P},invokeKnownHelper:function(q,K){var P=this.setupHelper(q,K);this.push(this.source.functionCall(P.name,"call",P.callParams))},invokeAmbiguous:function(q,K){this.useRegister("helper");var P=this.popStack();this.emptyHash();var _=this.setupHelper(0,q,K),O=this.lastHelper=this.nameLookup("helpers",q,"helper"),j=["(","(helper = ",O," || ",P,")"];if(!this.options.strict)j[0]="(helper = ",j.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"));this.push(["(",j,_.paramsInit?["),(",_.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",_.callParams)," : helper))"])},invokePartial:function(q,K,P){var _=[],O=this.setupParams(K,1,_);if(q)K=this.popStack(),delete O.name;if(P)O.indent=JSON.stringify(P);if(O.helpers="helpers",O.partials="partials",O.decorators="container.decorators",!q)_.unshift(this.nameLookup("partials",K,"partial"));else _.unshift(K);if(this.options.compat)O.depths="depths";O=this.objectLiteral(O),_.push(O),this.push(this.source.functionCall("container.invokePartial","",_))},assignToHash:function(q){var K=this.popStack(),P=void 0,_=void 0,O=void 0;if(this.trackIds)O=this.popStack();if(this.stringParams)_=this.popStack(),P=this.popStack();var j=this.hash;if(P)j.contexts[q]=P;if(_)j.types[q]=_;if(O)j.ids[q]=O;j.values[q]=K},pushId:function(q,K,P){if(q==="BlockParam")this.pushStackLiteral("blockParams["+K[0]+"].path["+K[1]+"]"+(P?" + "+JSON.stringify("."+P):""));else if(q==="PathExpression")this.pushString(K);else if(q==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:S4,compileChildren:function(q,K){var P=q.children,_=void 0,O=void 0;for(var j=0,z=P.length;j<z;j++){_=P[j],O=new this.compiler;var J=this.matchExistingProgram(_);if(J==null){this.context.programs.push("");var w=this.context.programs.length;_.index=w,_.name="program"+w,this.context.programs[w]=O.compile(_,K,this.context,!this.precompile),this.context.decorators[w]=O.decorators,this.context.environments[w]=_,this.useDepths=this.useDepths||O.useDepths,this.useBlockParams=this.useBlockParams||O.useBlockParams,_.useDepths=this.useDepths,_.useBlockParams=this.useBlockParams}else _.index=J.index,_.name="program"+J.index,this.useDepths=this.useDepths||J.useDepths,this.useBlockParams=this.useBlockParams||J.useBlockParams}},matchExistingProgram:function(q){for(var K=0,P=this.context.environments.length;K<P;K++){var _=this.context.environments[K];if(_&&_.equals(q))return _}},programExpression:function(q){var K=this.environment.children[q],P=[K.index,"data",K.blockParams];if(this.useBlockParams||this.useDepths)P.push("blockParams");if(this.useDepths)P.push("depths");return"container.program("+P.join(", ")+")"},useRegister:function(q){if(!this.registers[q])this.registers[q]=!0,this.registers.list.push(q)},push:function(q){if(!(q instanceof V4))q=this.source.wrap(q);return this.inlineStack.push(q),q},pushStackLiteral:function(q){this.push(new V4(q))},pushSource:function(q){if(this.pendingContent)this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0;if(q)this.source.push(q)},replaceStack:function(q){var K=["("],P=void 0,_=void 0,O=void 0;if(!this.isInline())throw new WW.default("replaceStack on non-inline");var j=this.popStack(!0);if(j instanceof V4)P=[j.value],K=["(",P],O=!0;else{_=!0;var z=this.incrStack();K=["((",this.push(z)," = ",j,")"],P=this.topStack()}var J=q.call(this,P);if(!O)this.popStack();if(_)this.stackSlot--;this.push(K.concat(J,")"))},incrStack:function(){if(this.stackSlot++,this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var q=this.inlineStack;this.inlineStack=[];for(var K=0,P=q.length;K<P;K++){var _=q[K];if(_ instanceof V4)this.compileStack.push(_);else{var O=this.incrStack();this.pushSource([O," = ",_,";"]),this.compileStack.push(O)}}},isInline:function(){return this.inlineStack.length},popStack:function(q){var K=this.isInline(),P=(K?this.inlineStack:this.compileStack).pop();if(!q&&P instanceof V4)return P.value;else{if(!K){if(!this.stackSlot)throw new WW.default("Invalid stack pop");this.stackSlot--}return P}},topStack:function(){var q=this.isInline()?this.inlineStack:this.compileStack,K=q[q.length-1];if(K instanceof V4)return K.value;else return K},contextName:function(q){if(this.useDepths&&q)return"depths["+q+"]";else return"depth"+q},quotedString:function(q){return this.source.quotedString(q)},objectLiteral:function(q){return this.source.objectLiteral(q)},aliasable:function(q){var K=this.aliases[q];if(K)return K.referenceCount++,K;return K=this.aliases[q]=this.source.wrap(q),K.aliasable=!0,K.referenceCount=1,K},setupHelper:function(q,K,P){var _=[],O=this.setupHelperArgs(K,q,_,P),j=this.nameLookup("helpers",K,"helper"),z=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:_,paramsInit:O,name:j,callParams:[z].concat(_)}},setupParams:function(q,K,P){var _={},O=[],j=[],z=[],J=!P,w=void 0;if(J)P=[];if(_.name=this.quotedString(q),_.hash=this.popStack(),this.trackIds)_.hashIds=this.popStack();if(this.stringParams)_.hashTypes=this.popStack(),_.hashContexts=this.popStack();var G=this.popStack(),f=this.popStack();if(f||G)_.fn=f||"container.noop",_.inverse=G||"container.noop";var A=K;while(A--){if(w=this.popStack(),P[A]=w,this.trackIds)z[A]=this.popStack();if(this.stringParams)j[A]=this.popStack(),O[A]=this.popStack()}if(J)_.args=this.source.generateArray(P);if(this.trackIds)_.ids=this.source.generateArray(z);if(this.stringParams)_.types=this.source.generateArray(j),_.contexts=this.source.generateArray(O);if(this.options.data)_.data="data";if(this.useBlockParams)_.blockParams="blockParams";return _},setupHelperArgs:function(q,K,P,_){var O=this.setupParams(q,K,P);if(O.loc=JSON.stringify(this.source.currentLocation),O=this.objectLiteral(O),_)return this.useRegister("options"),P.push("options"),["options=",O];else if(P)return P.push(O),"";else return O}};(function(){var $="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),q=S4.RESERVED_WORDS={};for(var K=0,P=$.length;K<P;K++)q[$[K]]=!0})();S4.isValidJavaScriptVariableName=function($){return!S4.RESERVED_WORDS[$]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test($)};function zc($,q,K,P,_){var O=q.popStack(),j=K.length;if($)j--;for(;P<j;P++)O=q.nameLookup(O,K[P],_);if($)return[q.aliasable("container.strict"),"(",O,", ",q.quotedString(K[P]),", ",JSON.stringify(q.source.currentLocation)," )"];else return O}RG.default=S4;IG.exports=RG.default});var uG=u$((LG,bG)=>{LG.__esModule=!0;function A7($){return $&&$.__esModule?$:{default:$}}var Jc=bA(),Tc=A7(Jc),wc=lz(),Zc=A7(wc),HW=aA(),JW=$G(),Xc=DG(),fc=A7(Xc),kc=wj(),Ac=A7(kc),Gc=xz(),Vc=A7(Gc),Sc=Tc.default.create;function gG(){var $=Sc();return $.compile=function(q,K){return JW.compile(q,K,$)},$.precompile=function(q,K){return JW.precompile(q,K,$)},$.AST=Zc.default,$.Compiler=JW.Compiler,$.JavaScriptCompiler=fc.default,$.Parser=HW.parser,$.parse=HW.parse,$.parseWithoutProcessing=HW.parseWithoutProcessing,$}var M4=gG();M4.create=gG;Vc.default(M4);M4.Visitor=Ac.default;M4.default=M4;LG.default=M4;bG.exports=LG.default});var yG=u$((Ic)=>{Ic.__esModule=!0;Ic.print=Rc;Ic.PrintVisitor=L6;function Cc($){return $&&$.__esModule?$:{default:$}}var Ec=wj(),hc=Cc(Ec);function Rc($){return new L6().accept($)}function L6(){this.padding=0}L6.prototype=new hc.default;L6.prototype.pad=function($){var q="";for(var K=0,P=this.padding;K<P;K++)q+=" ";return q+=$+`
|
|
23
|
-
`,q};L6.prototype.Program=function($){var q="",K=$.body,P=void 0,_=void 0;if($.blockParams){var O="BLOCK PARAMS: [";for(P=0,_=$.blockParams.length;P<_;P++)O+=" "+$.blockParams[P];O+=" ]",q+=this.pad(O)}for(P=0,_=K.length;P<_;P++)q+=this.accept(K[P]);return this.padding--,q};L6.prototype.MustacheStatement=function($){return this.pad("{{ "+this.SubExpression($)+" }}")};L6.prototype.Decorator=function($){return this.pad("{{ DIRECTIVE "+this.SubExpression($)+" }}")};L6.prototype.BlockStatement=L6.prototype.DecoratorBlock=function($){var q="";if(q+=this.pad(($.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,q+=this.pad(this.SubExpression($)),$.program)q+=this.pad("PROGRAM:"),this.padding++,q+=this.accept($.program),this.padding--;if($.inverse){if($.program)this.padding++;if(q+=this.pad("{{^}}"),this.padding++,q+=this.accept($.inverse),this.padding--,$.program)this.padding--}return this.padding--,q};L6.prototype.PartialStatement=function($){var q="PARTIAL:"+$.name.original;if($.params[0])q+=" "+this.accept($.params[0]);if($.hash)q+=" "+this.accept($.hash);return this.pad("{{> "+q+" }}")};L6.prototype.PartialBlockStatement=function($){var q="PARTIAL BLOCK:"+$.name.original;if($.params[0])q+=" "+this.accept($.params[0]);if($.hash)q+=" "+this.accept($.hash);return q+=" "+this.pad("PROGRAM:"),this.padding++,q+=this.accept($.program),this.padding--,this.pad("{{> "+q+" }}")};L6.prototype.ContentStatement=function($){return this.pad("CONTENT[ '"+$.value+"' ]")};L6.prototype.CommentStatement=function($){return this.pad("{{! '"+$.value+"' }}")};L6.prototype.SubExpression=function($){var q=$.params,K=[],P=void 0;for(var _=0,O=q.length;_<O;_++)K.push(this.accept(q[_]));return q="["+K.join(", ")+"]",P=$.hash?" "+this.accept($.hash):"",this.accept($.path)+" "+q+P};L6.prototype.PathExpression=function($){var q=$.parts.join("/");return($.data?"@":"")+"PATH:"+q};L6.prototype.StringLiteral=function($){return'"'+$.value+'"'};L6.prototype.NumberLiteral=function($){return"NUMBER{"+$.value+"}"};L6.prototype.BooleanLiteral=function($){return"BOOLEAN{"+$.value+"}"};L6.prototype.UndefinedLiteral=function(){return"UNDEFINED"};L6.prototype.NullLiteral=function(){return"NULL"};L6.prototype.Hash=function($){var q=$.pairs,K=[];for(var P=0,_=q.length;P<_;P++)K.push(this.accept(q[P]));return"HASH{"+K.join(", ")+"}"};L6.prototype.HashPair=function($){return $.key+"="+this.accept($.value)}});var mG=u$((
|
|
23
|
+
`,q};L6.prototype.Program=function($){var q="",K=$.body,P=void 0,_=void 0;if($.blockParams){var O="BLOCK PARAMS: [";for(P=0,_=$.blockParams.length;P<_;P++)O+=" "+$.blockParams[P];O+=" ]",q+=this.pad(O)}for(P=0,_=K.length;P<_;P++)q+=this.accept(K[P]);return this.padding--,q};L6.prototype.MustacheStatement=function($){return this.pad("{{ "+this.SubExpression($)+" }}")};L6.prototype.Decorator=function($){return this.pad("{{ DIRECTIVE "+this.SubExpression($)+" }}")};L6.prototype.BlockStatement=L6.prototype.DecoratorBlock=function($){var q="";if(q+=this.pad(($.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,q+=this.pad(this.SubExpression($)),$.program)q+=this.pad("PROGRAM:"),this.padding++,q+=this.accept($.program),this.padding--;if($.inverse){if($.program)this.padding++;if(q+=this.pad("{{^}}"),this.padding++,q+=this.accept($.inverse),this.padding--,$.program)this.padding--}return this.padding--,q};L6.prototype.PartialStatement=function($){var q="PARTIAL:"+$.name.original;if($.params[0])q+=" "+this.accept($.params[0]);if($.hash)q+=" "+this.accept($.hash);return this.pad("{{> "+q+" }}")};L6.prototype.PartialBlockStatement=function($){var q="PARTIAL BLOCK:"+$.name.original;if($.params[0])q+=" "+this.accept($.params[0]);if($.hash)q+=" "+this.accept($.hash);return q+=" "+this.pad("PROGRAM:"),this.padding++,q+=this.accept($.program),this.padding--,this.pad("{{> "+q+" }}")};L6.prototype.ContentStatement=function($){return this.pad("CONTENT[ '"+$.value+"' ]")};L6.prototype.CommentStatement=function($){return this.pad("{{! '"+$.value+"' }}")};L6.prototype.SubExpression=function($){var q=$.params,K=[],P=void 0;for(var _=0,O=q.length;_<O;_++)K.push(this.accept(q[_]));return q="["+K.join(", ")+"]",P=$.hash?" "+this.accept($.hash):"",this.accept($.path)+" "+q+P};L6.prototype.PathExpression=function($){var q=$.parts.join("/");return($.data?"@":"")+"PATH:"+q};L6.prototype.StringLiteral=function($){return'"'+$.value+'"'};L6.prototype.NumberLiteral=function($){return"NUMBER{"+$.value+"}"};L6.prototype.BooleanLiteral=function($){return"BOOLEAN{"+$.value+"}"};L6.prototype.UndefinedLiteral=function(){return"UNDEFINED"};L6.prototype.NullLiteral=function(){return"NULL"};L6.prototype.Hash=function($){var q=$.pairs,K=[];for(var P=0,_=q.length;P<_;P++)K.push(this.accept(q[P]));return"HASH{"+K.join(", ")+"}"};L6.prototype.HashPair=function($){return $.key+"="+this.accept($.value)}});var mG=u$((P8$,cG)=>{var Aj=uG().default,xG=yG();Aj.PrintVisitor=xG.PrintVisitor;Aj.print=xG.print;cG.exports=Aj;function pG($,q){var K=(()=>({})),P=K.readFileSync(q,"utf8");$.exports=Aj.compile(P)}if(E_.extensions)E_.extensions[".handlebars"]=pG,E_.extensions[".hbs"]=pG});var OV=u$((h8$,AW)=>{var v6=String,jV=function(){return{isColorSupported:!1,reset:v6,bold:v6,dim:v6,italic:v6,underline:v6,inverse:v6,hidden:v6,strikethrough:v6,black:v6,red:v6,green:v6,yellow:v6,blue:v6,magenta:v6,cyan:v6,white:v6,gray:v6,bgBlack:v6,bgRed:v6,bgGreen:v6,bgYellow:v6,bgBlue:v6,bgMagenta:v6,bgCyan:v6,bgWhite:v6,blackBright:v6,redBright:v6,greenBright:v6,yellowBright:v6,blueBright:v6,magentaBright:v6,cyanBright:v6,whiteBright:v6,bgBlackBright:v6,bgRedBright:v6,bgGreenBright:v6,bgYellowBright:v6,bgBlueBright:v6,bgMagentaBright:v6,bgCyanBright:v6,bgWhiteBright:v6}};AW.exports=jV();AW.exports.createColors=jV});var VV={};uq(VV,{uptime:()=>$m,type:()=>Pm,totalmem:()=>Km,tmpdir:()=>GV,tmpDir:()=>zm,release:()=>jm,platform:()=>vm,networkInterfaces:()=>Om,loadavg:()=>sc,hostname:()=>ec,homedir:()=>Hm,getNetworkInterfaces:()=>AV,freemem:()=>qm,endianness:()=>Qc,cpus:()=>_m,arch:()=>Ym,EOL:()=>Wm});var Qc=function(){return"LE"},ec=function(){if(typeof location<"u")return location.hostname;else return""},sc=function(){return[]},$m=function(){return 0},qm=function(){return Number.MAX_VALUE},Km=function(){return Number.MAX_VALUE},_m=function(){return[]},Pm=function(){return"Browser"},jm=function(){if(typeof navigator<"u")return navigator.appVersion;return""},AV=function(){return{}},Om,Ym=function(){return"javascript"},vm=function(){return"browser"},GV=function(){return"/tmp"},zm,Wm=`
|
|
24
24
|
`,Hm=function(){return"/"};var SV=o4(()=>{Om=AV,zm=GV});var jq={};uq(jq,{transcode:()=>kd,resolveObjectURL:()=>Zd,kStringMaxLength:()=>iV,kMaxLength:()=>g7,isUtf8:()=>Xd,isAscii:()=>fd,default:()=>Ad,constants:()=>rm,btoa:()=>mm,atob:()=>dm,INSPECT_MAX_BYTES:()=>nV,File:()=>lm,Buffer:()=>J$,Blob:()=>om});function um($){var q=$.length;if(q%4>0)throw Error("Invalid string. Length must be a multiple of 4");var K=$.indexOf("=");if(K===-1)K=q;var P=K===q?0:4-K%4;return[K,P]}function ym($,q){return($+q)*3/4-q}function pm($){var q,K=um($),P=K[0],_=K[1],O=new Uint8Array(ym(P,_)),j=0,z=_>0?P-4:P,J;for(J=0;J<z;J+=4)q=w8[$.charCodeAt(J)]<<18|w8[$.charCodeAt(J+1)]<<12|w8[$.charCodeAt(J+2)]<<6|w8[$.charCodeAt(J+3)],O[j++]=q>>16&255,O[j++]=q>>8&255,O[j++]=q&255;if(_===2)q=w8[$.charCodeAt(J)]<<2|w8[$.charCodeAt(J+1)]>>4,O[j++]=q&255;if(_===1)q=w8[$.charCodeAt(J)]<<10|w8[$.charCodeAt(J+1)]<<4|w8[$.charCodeAt(J+2)]>>2,O[j++]=q>>8&255,O[j++]=q&255;return O}function xm($){return n8[$>>18&63]+n8[$>>12&63]+n8[$>>6&63]+n8[$&63]}function cm($,q,K){var P,_=[];for(var O=q;O<K;O+=3)P=($[O]<<16&16711680)+($[O+1]<<8&65280)+($[O+2]&255),_.push(xm(P));return _.join("")}function cV($){var q,K=$.length,P=K%3,_=[],O=16383;for(var j=0,z=K-P;j<z;j+=O)_.push(cm($,j,j+O>z?z:j+O));if(P===1)q=$[K-1],_.push(n8[q>>2]+n8[q<<4&63]+"==");else if(P===2)q=($[K-2]<<8)+$[K-1],_.push(n8[q>>10]+n8[q>>4&63]+n8[q<<2&63]+"=");return _.join("")}function pj($,q,K,P,_){var O,j,z=_*8-P-1,J=(1<<z)-1,w=J>>1,G=-7,f=K?_-1:0,A=K?-1:1,V=$[q+f];f+=A,O=V&(1<<-G)-1,V>>=-G,G+=z;for(;G>0;O=O*256+$[q+f],f+=A,G-=8);j=O&(1<<-G)-1,O>>=-G,G+=P;for(;G>0;j=j*256+$[q+f],f+=A,G-=8);if(O===0)O=1-w;else if(O===J)return j?NaN:(V?-1:1)*(1/0);else j=j+Math.pow(2,P),O=O-w;return(V?-1:1)*j*Math.pow(2,O-P)}function rV($,q,K,P,_,O){var j,z,J,w=O*8-_-1,G=(1<<w)-1,f=G>>1,A=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,V=P?0:O-1,C=P?1:-1,E=q<0||q===0&&1/q<0?1:0;if(q=Math.abs(q),isNaN(q)||q===1/0)z=isNaN(q)?1:0,j=G;else{if(j=Math.floor(Math.log(q)/Math.LN2),q*(J=Math.pow(2,-j))<1)j--,J*=2;if(j+f>=1)q+=A/J;else q+=A*Math.pow(2,1-f);if(q*J>=2)j++,J/=2;if(j+f>=G)z=0,j=G;else if(j+f>=1)z=(q*J-1)*Math.pow(2,_),j=j+f;else z=q*Math.pow(2,f-1)*Math.pow(2,_),j=0}for(;_>=8;$[K+V]=z&255,V+=C,z/=256,_-=8);j=j<<_|z,w+=_;for(;w>0;$[K+V]=j&255,V+=C,j/=256,w-=8);$[K+V-C]|=E*128}function wK($){if($>g7)throw RangeError('The value "'+$+'" is invalid for option "size"');let q=new Uint8Array($);return Object.setPrototypeOf(q,J$.prototype),q}function QW($,q,K){return class extends K{constructor(){super();Object.defineProperty(this,"message",{value:q.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${$}]`,this.stack,delete this.name}get code(){return $}set code(_){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:_,writable:!0})}toString(){return`${this.name} [${$}]: ${this.message}`}}}function J$($,q,K){if(typeof $==="number"){if(typeof q==="string")throw TypeError('The "string" argument must be of type string. Received type number');return eW($)}return tV($,q,K)}function tV($,q,K){if(typeof $==="string")return Bm($,q);if(ArrayBuffer.isView($))return Um($);if($==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(i8($,ArrayBuffer)||$&&i8($.buffer,ArrayBuffer))return FW($,q,K);if(typeof SharedArrayBuffer<"u"&&(i8($,SharedArrayBuffer)||$&&i8($.buffer,SharedArrayBuffer)))return FW($,q,K);if(typeof $==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let P=$.valueOf&&$.valueOf();if(P!=null&&P!==$)return J$.from(P,q,K);let _=Fm($);if(_)return _;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]==="function")return J$.from($[Symbol.toPrimitive]("string"),q,K);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}function BV($){if(typeof $!=="number")throw TypeError('"size" argument must be of type number');else if($<0)throw RangeError('The value "'+$+'" is invalid for option "size"')}function tm($,q,K){if(BV($),$<=0)return wK($);if(q!==void 0)return typeof K==="string"?wK($).fill(q,K):wK($).fill(q);return wK($)}function eW($){return BV($),wK($<0?0:sW($)|0)}function Bm($,q){if(typeof q!=="string"||q==="")q="utf8";if(!J$.isEncoding(q))throw TypeError("Unknown encoding: "+q);let K=UV($,q)|0,P=wK(K),_=P.write($,q);if(_!==K)P=P.slice(0,_);return P}function UW($){let q=$.length<0?0:sW($.length)|0,K=wK(q);for(let P=0;P<q;P+=1)K[P]=$[P]&255;return K}function Um($){if(i8($,Uint8Array)){let q=new Uint8Array($);return FW(q.buffer,q.byteOffset,q.byteLength)}return UW($)}function FW($,q,K){if(q<0||$.byteLength<q)throw RangeError('"offset" is outside of buffer bounds');if($.byteLength<q+(K||0))throw RangeError('"length" is outside of buffer bounds');let P;if(q===void 0&&K===void 0)P=new Uint8Array($);else if(K===void 0)P=new Uint8Array($,q);else P=new Uint8Array($,q,K);return Object.setPrototypeOf(P,J$.prototype),P}function Fm($){if(J$.isBuffer($)){let q=sW($.length)|0,K=wK(q);if(K.length===0)return K;return $.copy(K,0,0,q),K}if($.length!==void 0){if(typeof $.length!=="number"||Number.isNaN($.length))return wK(0);return UW($)}if($.type==="Buffer"&&Array.isArray($.data))return UW($.data)}function sW($){if($>=g7)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g7.toString(16)+" bytes");return $|0}function UV($,q){if(J$.isBuffer($))return $.length;if(ArrayBuffer.isView($)||i8($,ArrayBuffer))return $.byteLength;if(typeof $!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);let K=$.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&K===0)return 0;let _=!1;for(;;)switch(q){case"ascii":case"latin1":case"binary":return K;case"utf8":case"utf-8":return aW($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K*2;case"hex":return K>>>1;case"base64":return _S($).length;default:if(_)return P?-1:aW($).length;q=(""+q).toLowerCase(),_=!0}}function am($,q,K){let P=!1;if(q===void 0||q<0)q=0;if(q>this.length)return"";if(K===void 0||K>this.length)K=this.length;if(K<=0)return"";if(K>>>=0,q>>>=0,K<=q)return"";if(!$)$="utf8";while(!0)switch($){case"hex":return Od(this,q,K);case"utf8":case"utf-8":return aV(this,q,K);case"ascii":return Pd(this,q,K);case"latin1":case"binary":return jd(this,q,K);case"base64":return Kd(this,q,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yd(this,q,K);default:if(P)throw TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),P=!0}}function A_($,q,K){let P=$[q];$[q]=$[K],$[K]=P}function FV($,q,K,P,_){if($.length===0)return-1;if(typeof K==="string")P=K,K=0;else if(K>2147483647)K=2147483647;else if(K<-2147483648)K=-2147483648;if(K=+K,Number.isNaN(K))K=_?0:$.length-1;if(K<0)K=$.length+K;if(K>=$.length)if(_)return-1;else K=$.length-1;else if(K<0)if(_)K=0;else return-1;if(typeof q==="string")q=J$.from(q,P);if(J$.isBuffer(q)){if(q.length===0)return-1;return dV($,q,K,P,_)}else if(typeof q==="number"){if(q=q&255,typeof Uint8Array.prototype.indexOf==="function")if(_)return Uint8Array.prototype.indexOf.call($,q,K);else return Uint8Array.prototype.lastIndexOf.call($,q,K);return dV($,[q],K,P,_)}throw TypeError("val must be string, number or Buffer")}function dV($,q,K,P,_){let O=1,j=$.length,z=q.length;if(P!==void 0){if(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le"){if($.length<2||q.length<2)return-1;O=2,j/=2,z/=2,K/=2}}function J(G,f){if(O===1)return G[f];else return G.readUInt16BE(f*O)}let w;if(_){let G=-1;for(w=K;w<j;w++)if(J($,w)===J(q,G===-1?0:w-G)){if(G===-1)G=w;if(w-G+1===z)return G*O}else{if(G!==-1)w-=w-G;G=-1}}else{if(K+z>j)K=j-z;for(w=K;w>=0;w--){let G=!0;for(let f=0;f<z;f++)if(J($,w+f)!==J(q,f)){G=!1;break}if(G)return w}}return-1}function Qm($,q,K,P){K=Number(K)||0;let _=$.length-K;if(!P)P=_;else if(P=Number(P),P>_)P=_;let O=q.length;if(P>O/2)P=O/2;let j;for(j=0;j<P;++j){let z=parseInt(q.substr(j*2,2),16);if(Number.isNaN(z))return j;$[K+j]=z}return j}function em($,q,K,P){return xj(aW(q,$.length-K),$,K,P)}function sm($,q,K,P){return xj(Hd(q),$,K,P)}function $d($,q,K,P){return xj(_S(q),$,K,P)}function qd($,q,K,P){return xj(Jd(q,$.length-K),$,K,P)}function Kd($,q,K){if(q===0&&K===$.length)return cV($);else return cV($.slice(q,K))}function aV($,q,K){K=Math.min($.length,K);let P=[],_=q;while(_<K){let O=$[_],j=null,z=O>239?4:O>223?3:O>191?2:1;if(_+z<=K){let J,w,G,f;switch(z){case 1:if(O<128)j=O;break;case 2:if(J=$[_+1],(J&192)===128){if(f=(O&31)<<6|J&63,f>127)j=f}break;case 3:if(J=$[_+1],w=$[_+2],(J&192)===128&&(w&192)===128){if(f=(O&15)<<12|(J&63)<<6|w&63,f>2047&&(f<55296||f>57343))j=f}break;case 4:if(J=$[_+1],w=$[_+2],G=$[_+3],(J&192)===128&&(w&192)===128&&(G&192)===128){if(f=(O&15)<<18|(J&63)<<12|(w&63)<<6|G&63,f>65535&&f<1114112)j=f}}}if(j===null)j=65533,z=1;else if(j>65535)j-=65536,P.push(j>>>10&1023|55296),j=56320|j&1023;P.push(j),_+=z}return _d(P)}function _d($){let q=$.length;if(q<=lV)return String.fromCharCode.apply(String,$);let K="",P=0;while(P<q)K+=String.fromCharCode.apply(String,$.slice(P,P+=lV));return K}function Pd($,q,K){let P="";K=Math.min($.length,K);for(let _=q;_<K;++_)P+=String.fromCharCode($[_]&127);return P}function jd($,q,K){let P="";K=Math.min($.length,K);for(let _=q;_<K;++_)P+=String.fromCharCode($[_]);return P}function Od($,q,K){let P=$.length;if(!q||q<0)q=0;if(!K||K<0||K>P)K=P;let _="";for(let O=q;O<K;++O)_+=Td[$[O]];return _}function Yd($,q,K){let P=$.slice(q,K),_="";for(let O=0;O<P.length-1;O+=2)_+=String.fromCharCode(P[O]+P[O+1]*256);return _}function Pq($,q,K){if($%1!==0||$<0)throw RangeError("offset is not uint");if($+q>K)throw RangeError("Trying to access beyond buffer length")}function rq($,q,K,P,_,O){if(!J$.isBuffer($))throw TypeError('"buffer" argument must be a Buffer instance');if(q>_||q<O)throw RangeError('"value" argument is out of bounds');if(K+P>$.length)throw RangeError("Index out of range")}function QV($,q,K,P,_){KS(q,P,_,$,K,7);let O=Number(q&BigInt(4294967295));$[K++]=O,O=O>>8,$[K++]=O,O=O>>8,$[K++]=O,O=O>>8,$[K++]=O;let j=Number(q>>BigInt(32)&BigInt(4294967295));return $[K++]=j,j=j>>8,$[K++]=j,j=j>>8,$[K++]=j,j=j>>8,$[K++]=j,K}function eV($,q,K,P,_){KS(q,P,_,$,K,7);let O=Number(q&BigInt(4294967295));$[K+7]=O,O=O>>8,$[K+6]=O,O=O>>8,$[K+5]=O,O=O>>8,$[K+4]=O;let j=Number(q>>BigInt(32)&BigInt(4294967295));return $[K+3]=j,j=j>>8,$[K+2]=j,j=j>>8,$[K+1]=j,j=j>>8,$[K]=j,K+8}function sV($,q,K,P,_,O){if(K+P>$.length)throw RangeError("Index out of range");if(K<0)throw RangeError("Index out of range")}function $S($,q,K,P,_){if(q=+q,K=K>>>0,!_)sV($,q,K,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return rV($,q,K,P,23,4),K+4}function qS($,q,K,P,_){if(q=+q,K=K>>>0,!_)sV($,q,K,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return rV($,q,K,P,52,8),K+8}function oV($){let q="",K=$.length,P=$[0]==="-"?1:0;for(;K>=P+4;K-=3)q=`_${$.slice(K-3,K)}${q}`;return`${$.slice(0,K)}${q}`}function vd($,q,K){if(y4(q,"offset"),$[q]===void 0||$[q+K]===void 0)L7(q,$.length-(K+1))}function KS($,q,K,P,_,O){if($>K||$<q){let j=typeof q==="bigint"?"n":"",z;if(O>3)if(q===0||q===BigInt(0))z=`>= 0${j} and < 2${j} ** ${(O+1)*8}${j}`;else z=`>= -(2${j} ** ${(O+1)*8-1}${j}) and < 2 ** ${(O+1)*8-1}${j}`;else z=`>= ${q}${j} and <= ${K}${j}`;throw new BW("value",z,$)}vd(P,_,O)}function y4($,q){if(typeof $!=="number")throw new im(q,"number",$)}function L7($,q,K){if(Math.floor($)!==$)throw y4($,K),new BW(K||"offset","an integer",$);if(q<0)throw new nm;throw new BW(K||"offset",`>= ${K?1:0} and <= ${q}`,$)}function Wd($){if($=$.split("=")[0],$=$.trim().replace(zd,""),$.length<2)return"";while($.length%4!==0)$=$+"=";return $}function aW($,q){q=q||1/0;let K,P=$.length,_=null,O=[];for(let j=0;j<P;++j){if(K=$.charCodeAt(j),K>55295&&K<57344){if(!_){if(K>56319){if((q-=3)>-1)O.push(239,191,189);continue}else if(j+1===P){if((q-=3)>-1)O.push(239,191,189);continue}_=K;continue}if(K<56320){if((q-=3)>-1)O.push(239,191,189);_=K;continue}K=(_-55296<<10|K-56320)+65536}else if(_){if((q-=3)>-1)O.push(239,191,189)}if(_=null,K<128){if((q-=1)<0)break;O.push(K)}else if(K<2048){if((q-=2)<0)break;O.push(K>>6|192,K&63|128)}else if(K<65536){if((q-=3)<0)break;O.push(K>>12|224,K>>6&63|128,K&63|128)}else if(K<1114112){if((q-=4)<0)break;O.push(K>>18|240,K>>12&63|128,K>>6&63|128,K&63|128)}else throw Error("Invalid code point")}return O}function Hd($){let q=[];for(let K=0;K<$.length;++K)q.push($.charCodeAt(K)&255);return q}function Jd($,q){let K,P,_,O=[];for(let j=0;j<$.length;++j){if((q-=2)<0)break;K=$.charCodeAt(j),P=K>>8,_=K%256,O.push(_),O.push(P)}return O}function _S($){return pm(Wd($))}function xj($,q,K,P){let _;for(_=0;_<P;++_){if(_+K>=q.length||_>=$.length)break;q[_+K]=$[_]}return _}function i8($,q){return $ instanceof q||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===q.name}function cK($){return typeof BigInt>"u"?wd:$}function wd(){throw Error("BigInt not supported")}function $H($){return()=>{throw Error($+" is not implemented for node:buffer browser polyfill")}}var n8,w8,tW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k_,xV,mV,nV=50,g7=2147483647,iV=536870888,mm,dm,lm,om,rm,nm,im,BW,lV=4096,zd,Td,Zd,Xd,fd=($)=>{for(let q of $)if(q.charCodeAt(0)>127)return!1;return!0},kd,Ad;var Oq=o4(()=>{n8=[],w8=[];for(k_=0,xV=tW.length;k_<xV;++k_)n8[k_]=tW[k_],w8[tW.charCodeAt(k_)]=k_;w8[45]=62;w8[95]=63;mV=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,mm=globalThis.btoa,dm=globalThis.atob,lm=globalThis.File,om=globalThis.Blob,rm={MAX_LENGTH:g7,MAX_STRING_LENGTH:iV};nm=QW("ERR_BUFFER_OUT_OF_BOUNDS",function($){if($)return`${$} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),im=QW("ERR_INVALID_ARG_TYPE",function($,q){return`The "${$}" argument must be of type number. Received type ${typeof q}`},TypeError),BW=QW("ERR_OUT_OF_RANGE",function($,q,K){let P=`The value of "${$}" is out of range.`,_=K;if(Number.isInteger(K)&&Math.abs(K)>4294967296)_=oV(String(K));else if(typeof K==="bigint"){if(_=String(K),K>BigInt(2)**BigInt(32)||K<-(BigInt(2)**BigInt(32)))_=oV(_);_+="n"}return P+=` It must be ${q}. Received ${_}`,P},RangeError);Object.defineProperty(J$.prototype,"parent",{enumerable:!0,get:function(){if(!J$.isBuffer(this))return;return this.buffer}});Object.defineProperty(J$.prototype,"offset",{enumerable:!0,get:function(){if(!J$.isBuffer(this))return;return this.byteOffset}});J$.poolSize=8192;J$.from=function($,q,K){return tV($,q,K)};Object.setPrototypeOf(J$.prototype,Uint8Array.prototype);Object.setPrototypeOf(J$,Uint8Array);J$.alloc=function($,q,K){return tm($,q,K)};J$.allocUnsafe=function($){return eW($)};J$.allocUnsafeSlow=function($){return eW($)};J$.isBuffer=function(q){return q!=null&&q._isBuffer===!0&&q!==J$.prototype};J$.compare=function(q,K){if(i8(q,Uint8Array))q=J$.from(q,q.offset,q.byteLength);if(i8(K,Uint8Array))K=J$.from(K,K.offset,K.byteLength);if(!J$.isBuffer(q)||!J$.isBuffer(K))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(q===K)return 0;let P=q.length,_=K.length;for(let O=0,j=Math.min(P,_);O<j;++O)if(q[O]!==K[O]){P=q[O],_=K[O];break}if(P<_)return-1;if(_<P)return 1;return 0};J$.isEncoding=function(q){switch(String(q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};J$.concat=function(q,K){if(!Array.isArray(q))throw TypeError('"list" argument must be an Array of Buffers');if(q.length===0)return J$.alloc(0);let P;if(K===void 0){K=0;for(P=0;P<q.length;++P)K+=q[P].length}let _=J$.allocUnsafe(K),O=0;for(P=0;P<q.length;++P){let j=q[P];if(i8(j,Uint8Array))if(O+j.length>_.length){if(!J$.isBuffer(j))j=J$.from(j);j.copy(_,O)}else Uint8Array.prototype.set.call(_,j,O);else if(!J$.isBuffer(j))throw TypeError('"list" argument must be an Array of Buffers');else j.copy(_,O);O+=j.length}return _};J$.byteLength=UV;J$.prototype._isBuffer=!0;J$.prototype.swap16=function(){let q=this.length;if(q%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let K=0;K<q;K+=2)A_(this,K,K+1);return this};J$.prototype.swap32=function(){let q=this.length;if(q%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let K=0;K<q;K+=4)A_(this,K,K+3),A_(this,K+1,K+2);return this};J$.prototype.swap64=function(){let q=this.length;if(q%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let K=0;K<q;K+=8)A_(this,K,K+7),A_(this,K+1,K+6),A_(this,K+2,K+5),A_(this,K+3,K+4);return this};J$.prototype.toString=function(){let q=this.length;if(q===0)return"";if(arguments.length===0)return aV(this,0,q);return am.apply(this,arguments)};J$.prototype.toLocaleString=J$.prototype.toString;J$.prototype.equals=function(q){if(!J$.isBuffer(q))throw TypeError("Argument must be a Buffer");if(this===q)return!0;return J$.compare(this,q)===0};J$.prototype.inspect=function(){let q="",K=nV;if(q=this.toString("hex",0,K).replace(/(.{2})/g,"$1 ").trim(),this.length>K)q+=" ... ";return"<Buffer "+q+">"};if(mV)J$.prototype[mV]=J$.prototype.inspect;J$.prototype.compare=function(q,K,P,_,O){if(i8(q,Uint8Array))q=J$.from(q,q.offset,q.byteLength);if(!J$.isBuffer(q))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof q);if(K===void 0)K=0;if(P===void 0)P=q?q.length:0;if(_===void 0)_=0;if(O===void 0)O=this.length;if(K<0||P>q.length||_<0||O>this.length)throw RangeError("out of range index");if(_>=O&&K>=P)return 0;if(_>=O)return-1;if(K>=P)return 1;if(K>>>=0,P>>>=0,_>>>=0,O>>>=0,this===q)return 0;let j=O-_,z=P-K,J=Math.min(j,z),w=this.slice(_,O),G=q.slice(K,P);for(let f=0;f<J;++f)if(w[f]!==G[f]){j=w[f],z=G[f];break}if(j<z)return-1;if(z<j)return 1;return 0};J$.prototype.includes=function(q,K,P){return this.indexOf(q,K,P)!==-1};J$.prototype.indexOf=function(q,K,P){return FV(this,q,K,P,!0)};J$.prototype.lastIndexOf=function(q,K,P){return FV(this,q,K,P,!1)};J$.prototype.write=function(q,K,P,_){if(K===void 0)_="utf8",P=this.length,K=0;else if(P===void 0&&typeof K==="string")_=K,P=this.length,K=0;else if(isFinite(K))if(K=K>>>0,isFinite(P)){if(P=P>>>0,_===void 0)_="utf8"}else _=P,P=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let O=this.length-K;if(P===void 0||P>O)P=O;if(q.length>0&&(P<0||K<0)||K>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!_)_="utf8";let j=!1;for(;;)switch(_){case"hex":return Qm(this,q,K,P);case"utf8":case"utf-8":return em(this,q,K,P);case"ascii":case"latin1":case"binary":return sm(this,q,K,P);case"base64":return $d(this,q,K,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qd(this,q,K,P);default:if(j)throw TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),j=!0}};J$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};J$.prototype.slice=function(q,K){let P=this.length;if(q=~~q,K=K===void 0?P:~~K,q<0){if(q+=P,q<0)q=0}else if(q>P)q=P;if(K<0){if(K+=P,K<0)K=0}else if(K>P)K=P;if(K<q)K=q;let _=this.subarray(q,K);return Object.setPrototypeOf(_,J$.prototype),_};J$.prototype.readUintLE=J$.prototype.readUIntLE=function(q,K,P){if(q=q>>>0,K=K>>>0,!P)Pq(q,K,this.length);let _=this[q],O=1,j=0;while(++j<K&&(O*=256))_+=this[q+j]*O;return _};J$.prototype.readUintBE=J$.prototype.readUIntBE=function(q,K,P){if(q=q>>>0,K=K>>>0,!P)Pq(q,K,this.length);let _=this[q+--K],O=1;while(K>0&&(O*=256))_+=this[q+--K]*O;return _};J$.prototype.readUint8=J$.prototype.readUInt8=function(q,K){if(q=q>>>0,!K)Pq(q,1,this.length);return this[q]};J$.prototype.readUint16LE=J$.prototype.readUInt16LE=function(q,K){if(q=q>>>0,!K)Pq(q,2,this.length);return this[q]|this[q+1]<<8};J$.prototype.readUint16BE=J$.prototype.readUInt16BE=function(q,K){if(q=q>>>0,!K)Pq(q,2,this.length);return this[q]<<8|this[q+1]};J$.prototype.readUint32LE=J$.prototype.readUInt32LE=function(q,K){if(q=q>>>0,!K)Pq(q,4,this.length);return(this[q]|this[q+1]<<8|this[q+2]<<16)+this[q+3]*16777216};J$.prototype.readUint32BE=J$.prototype.readUInt32BE=function(q,K){if(q=q>>>0,!K)Pq(q,4,this.length);return this[q]*16777216+(this[q+1]<<16|this[q+2]<<8|this[q+3])};J$.prototype.readBigUInt64LE=cK(function(q){q=q>>>0,y4(q,"offset");let K=this[q],P=this[q+7];if(K===void 0||P===void 0)L7(q,this.length-8);let _=K+this[++q]*256+this[++q]*65536+this[++q]*16777216,O=this[++q]+this[++q]*256+this[++q]*65536+P*16777216;return BigInt(_)+(BigInt(O)<<BigInt(32))});J$.prototype.readBigUInt64BE=cK(function(q){q=q>>>0,y4(q,"offset");let K=this[q],P=this[q+7];if(K===void 0||P===void 0)L7(q,this.length-8);let _=K*16777216+this[++q]*65536+this[++q]*256+this[++q],O=this[++q]*16777216+this[++q]*65536+this[++q]*256+P;return(BigInt(_)<<BigInt(32))+BigInt(O)});J$.prototype.readIntLE=function(q,K,P){if(q=q>>>0,K=K>>>0,!P)Pq(q,K,this.length);let _=this[q],O=1,j=0;while(++j<K&&(O*=256))_+=this[q+j]*O;if(O*=128,_>=O)_-=Math.pow(2,8*K);return _};J$.prototype.readIntBE=function(q,K,P){if(q=q>>>0,K=K>>>0,!P)Pq(q,K,this.length);let _=K,O=1,j=this[q+--_];while(_>0&&(O*=256))j+=this[q+--_]*O;if(O*=128,j>=O)j-=Math.pow(2,8*K);return j};J$.prototype.readInt8=function(q,K){if(q=q>>>0,!K)Pq(q,1,this.length);if(!(this[q]&128))return this[q];return(255-this[q]+1)*-1};J$.prototype.readInt16LE=function(q,K){if(q=q>>>0,!K)Pq(q,2,this.length);let P=this[q]|this[q+1]<<8;return P&32768?P|4294901760:P};J$.prototype.readInt16BE=function(q,K){if(q=q>>>0,!K)Pq(q,2,this.length);let P=this[q+1]|this[q]<<8;return P&32768?P|4294901760:P};J$.prototype.readInt32LE=function(q,K){if(q=q>>>0,!K)Pq(q,4,this.length);return this[q]|this[q+1]<<8|this[q+2]<<16|this[q+3]<<24};J$.prototype.readInt32BE=function(q,K){if(q=q>>>0,!K)Pq(q,4,this.length);return this[q]<<24|this[q+1]<<16|this[q+2]<<8|this[q+3]};J$.prototype.readBigInt64LE=cK(function(q){q=q>>>0,y4(q,"offset");let K=this[q],P=this[q+7];if(K===void 0||P===void 0)L7(q,this.length-8);let _=this[q+4]+this[q+5]*256+this[q+6]*65536+(P<<24);return(BigInt(_)<<BigInt(32))+BigInt(K+this[++q]*256+this[++q]*65536+this[++q]*16777216)});J$.prototype.readBigInt64BE=cK(function(q){q=q>>>0,y4(q,"offset");let K=this[q],P=this[q+7];if(K===void 0||P===void 0)L7(q,this.length-8);let _=(K<<24)+this[++q]*65536+this[++q]*256+this[++q];return(BigInt(_)<<BigInt(32))+BigInt(this[++q]*16777216+this[++q]*65536+this[++q]*256+P)});J$.prototype.readFloatLE=function(q,K){if(q=q>>>0,!K)Pq(q,4,this.length);return pj(this,q,!0,23,4)};J$.prototype.readFloatBE=function(q,K){if(q=q>>>0,!K)Pq(q,4,this.length);return pj(this,q,!1,23,4)};J$.prototype.readDoubleLE=function(q,K){if(q=q>>>0,!K)Pq(q,8,this.length);return pj(this,q,!0,52,8)};J$.prototype.readDoubleBE=function(q,K){if(q=q>>>0,!K)Pq(q,8,this.length);return pj(this,q,!1,52,8)};J$.prototype.writeUintLE=J$.prototype.writeUIntLE=function(q,K,P,_){if(q=+q,K=K>>>0,P=P>>>0,!_){let z=Math.pow(2,8*P)-1;rq(this,q,K,P,z,0)}let O=1,j=0;this[K]=q&255;while(++j<P&&(O*=256))this[K+j]=q/O&255;return K+P};J$.prototype.writeUintBE=J$.prototype.writeUIntBE=function(q,K,P,_){if(q=+q,K=K>>>0,P=P>>>0,!_){let z=Math.pow(2,8*P)-1;rq(this,q,K,P,z,0)}let O=P-1,j=1;this[K+O]=q&255;while(--O>=0&&(j*=256))this[K+O]=q/j&255;return K+P};J$.prototype.writeUint8=J$.prototype.writeUInt8=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,1,255,0);return this[K]=q&255,K+1};J$.prototype.writeUint16LE=J$.prototype.writeUInt16LE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,2,65535,0);return this[K]=q&255,this[K+1]=q>>>8,K+2};J$.prototype.writeUint16BE=J$.prototype.writeUInt16BE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,2,65535,0);return this[K]=q>>>8,this[K+1]=q&255,K+2};J$.prototype.writeUint32LE=J$.prototype.writeUInt32LE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,4,4294967295,0);return this[K+3]=q>>>24,this[K+2]=q>>>16,this[K+1]=q>>>8,this[K]=q&255,K+4};J$.prototype.writeUint32BE=J$.prototype.writeUInt32BE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,4,4294967295,0);return this[K]=q>>>24,this[K+1]=q>>>16,this[K+2]=q>>>8,this[K+3]=q&255,K+4};J$.prototype.writeBigUInt64LE=cK(function(q,K=0){return QV(this,q,K,BigInt(0),BigInt("0xffffffffffffffff"))});J$.prototype.writeBigUInt64BE=cK(function(q,K=0){return eV(this,q,K,BigInt(0),BigInt("0xffffffffffffffff"))});J$.prototype.writeIntLE=function(q,K,P,_){if(q=+q,K=K>>>0,!_){let J=Math.pow(2,8*P-1);rq(this,q,K,P,J-1,-J)}let O=0,j=1,z=0;this[K]=q&255;while(++O<P&&(j*=256)){if(q<0&&z===0&&this[K+O-1]!==0)z=1;this[K+O]=(q/j>>0)-z&255}return K+P};J$.prototype.writeIntBE=function(q,K,P,_){if(q=+q,K=K>>>0,!_){let J=Math.pow(2,8*P-1);rq(this,q,K,P,J-1,-J)}let O=P-1,j=1,z=0;this[K+O]=q&255;while(--O>=0&&(j*=256)){if(q<0&&z===0&&this[K+O+1]!==0)z=1;this[K+O]=(q/j>>0)-z&255}return K+P};J$.prototype.writeInt8=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,1,127,-128);if(q<0)q=255+q+1;return this[K]=q&255,K+1};J$.prototype.writeInt16LE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,2,32767,-32768);return this[K]=q&255,this[K+1]=q>>>8,K+2};J$.prototype.writeInt16BE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,2,32767,-32768);return this[K]=q>>>8,this[K+1]=q&255,K+2};J$.prototype.writeInt32LE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,4,2147483647,-2147483648);return this[K]=q&255,this[K+1]=q>>>8,this[K+2]=q>>>16,this[K+3]=q>>>24,K+4};J$.prototype.writeInt32BE=function(q,K,P){if(q=+q,K=K>>>0,!P)rq(this,q,K,4,2147483647,-2147483648);if(q<0)q=4294967295+q+1;return this[K]=q>>>24,this[K+1]=q>>>16,this[K+2]=q>>>8,this[K+3]=q&255,K+4};J$.prototype.writeBigInt64LE=cK(function(q,K=0){return QV(this,q,K,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});J$.prototype.writeBigInt64BE=cK(function(q,K=0){return eV(this,q,K,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});J$.prototype.writeFloatLE=function(q,K,P){return $S(this,q,K,!0,P)};J$.prototype.writeFloatBE=function(q,K,P){return $S(this,q,K,!1,P)};J$.prototype.writeDoubleLE=function(q,K,P){return qS(this,q,K,!0,P)};J$.prototype.writeDoubleBE=function(q,K,P){return qS(this,q,K,!1,P)};J$.prototype.copy=function(q,K,P,_){if(!J$.isBuffer(q))throw TypeError("argument should be a Buffer");if(!P)P=0;if(!_&&_!==0)_=this.length;if(K>=q.length)K=q.length;if(!K)K=0;if(_>0&&_<P)_=P;if(_===P)return 0;if(q.length===0||this.length===0)return 0;if(K<0)throw RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw RangeError("Index out of range");if(_<0)throw RangeError("sourceEnd out of bounds");if(_>this.length)_=this.length;if(q.length-K<_-P)_=q.length-K+P;let O=_-P;if(this===q&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(K,P,_);else Uint8Array.prototype.set.call(q,this.subarray(P,_),K);return O};J$.prototype.fill=function(q,K,P,_){if(typeof q==="string"){if(typeof K==="string")_=K,K=0,P=this.length;else if(typeof P==="string")_=P,P=this.length;if(_!==void 0&&typeof _!=="string")throw TypeError("encoding must be a string");if(typeof _==="string"&&!J$.isEncoding(_))throw TypeError("Unknown encoding: "+_);if(q.length===1){let j=q.charCodeAt(0);if(_==="utf8"&&j<128||_==="latin1")q=j}}else if(typeof q==="number")q=q&255;else if(typeof q==="boolean")q=Number(q);if(K<0||this.length<K||this.length<P)throw RangeError("Out of range index");if(P<=K)return this;if(K=K>>>0,P=P===void 0?this.length:P>>>0,!q)q=0;let O;if(typeof q==="number")for(O=K;O<P;++O)this[O]=q;else{let j=J$.isBuffer(q)?q:J$.from(q,_),z=j.length;if(z===0)throw TypeError('The value "'+q+'" is invalid for argument "value"');for(O=0;O<P-K;++O)this[O+K]=j[O%z]}return this};zd=/[^+/0-9A-Za-z-_]/g;Td=function(){let $=Array(256);for(let q=0;q<16;++q){let K=q*16;for(let P=0;P<16;++P)$[K+P]="0123456789abcdef"[q]+"0123456789abcdef"[P]}return $}();Zd=$H("resolveObjectURL"),Xd=$H("isUtf8"),kd=$H("transcode"),Ad=J$});var TS={};uq(TS,{types:()=>Id,promisify:()=>zS,log:()=>OS,isUndefined:()=>p4,isSymbol:()=>gd,isString:()=>rj,isRegExp:()=>cj,isPrimitive:()=>Ld,isObject:()=>x4,isNumber:()=>jS,isNullOrUndefined:()=>Dd,isNull:()=>oj,isFunction:()=>dj,isError:()=>mj,isDate:()=>PH,isBuffer:()=>bd,isBoolean:()=>OH,isArray:()=>PS,inspect:()=>G_,inherits:()=>YS,format:()=>jH,deprecate:()=>Vd,default:()=>pd,debuglog:()=>Sd,callbackifyOnRejected:()=>zH,callbackify:()=>WS,_extend:()=>vH,TextEncoder:()=>HS,TextDecoder:()=>JS});function jH($,...q){if(!rj($)){var K=[$];for(var P=0;P<q.length;P++)K.push(G_(q[P]));return K.join(" ")}var P=0,_=q.length,O=String($).replace(Gd,function(z){if(z==="%%")return"%";if(P>=_)return z;switch(z){case"%s":return String(q[P++]);case"%d":return Number(q[P++]);case"%j":try{return JSON.stringify(q[P++])}catch(J){return"[Circular]"}default:return z}});for(var j=q[P];P<_;j=q[++P])if(oj(j)||!x4(j))O+=" "+j;else O+=" "+G_(j);return O}function Vd($,q){if(typeof process>"u"||process?.noDeprecation===!0)return $;var K=!1;function P(..._){if(!K){if(process.throwDeprecation)throw Error(q);else if(process.traceDeprecation)console.trace(q);else console.error(q);K=!0}return $.apply(this,..._)}return P}function Md($,q){var K=G_.styles[q];if(K)return"\x1B["+G_.colors[K][0]+"m"+$+"\x1B["+G_.colors[K][1]+"m";else return $}function Nd($,q){return $}function Cd($){var q={};return $.forEach(function(K,P){q[K]=!0}),q}function lj($,q,K){if($.customInspect&&q&&dj(q.inspect)&&q.inspect!==G_&&!(q.constructor&&q.constructor.prototype===q)){var P=q.inspect(K,$);if(!rj(P))P=lj($,P,K);return P}var _=Ed($,q);if(_)return _;var O=Object.keys(q),j=Cd(O);if($.showHidden)O=Object.getOwnPropertyNames(q);if(mj(q)&&(O.indexOf("message")>=0||O.indexOf("description")>=0))return qH(q);if(O.length===0){if(dj(q)){var z=q.name?": "+q.name:"";return $.stylize("[Function"+z+"]","special")}if(cj(q))return $.stylize(RegExp.prototype.toString.call(q),"regexp");if(PH(q))return $.stylize(Date.prototype.toString.call(q),"date");if(mj(q))return qH(q)}var J="",w=!1,G=["{","}"];if(PS(q))w=!0,G=["[","]"];if(dj(q)){var f=q.name?": "+q.name:"";J=" [Function"+f+"]"}if(cj(q))J=" "+RegExp.prototype.toString.call(q);if(PH(q))J=" "+Date.prototype.toUTCString.call(q);if(mj(q))J=" "+qH(q);if(O.length===0&&(!w||q.length==0))return G[0]+J+G[1];if(K<0)if(cj(q))return $.stylize(RegExp.prototype.toString.call(q),"regexp");else return $.stylize("[Object]","special");$.seen.push(q);var A;if(w)A=hd($,q,K,j,O);else A=O.map(function(V){return _H($,q,K,j,V,w)});return $.seen.pop(),Rd(A,J,G)}function Ed($,q){if(p4(q))return $.stylize("undefined","undefined");if(rj(q)){var K="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(K,"string")}if(jS(q))return $.stylize(""+q,"number");if(OH(q))return $.stylize(""+q,"boolean");if(oj(q))return $.stylize("null","null")}function qH($){return"["+Error.prototype.toString.call($)+"]"}function hd($,q,K,P,_){var O=[];for(var j=0,z=q.length;j<z;++j)if(vS(q,String(j)))O.push(_H($,q,K,P,String(j),!0));else O.push("");return _.forEach(function(J){if(!J.match(/^\d+$/))O.push(_H($,q,K,P,J,!0))}),O}function _H($,q,K,P,_,O){var j,z,J;if(J=Object.getOwnPropertyDescriptor(q,_)||{value:q[_]},J.get)if(J.set)z=$.stylize("[Getter/Setter]","special");else z=$.stylize("[Getter]","special");else if(J.set)z=$.stylize("[Setter]","special");if(!vS(P,_))j="["+_+"]";if(!z)if($.seen.indexOf(J.value)<0){if(oj(K))z=lj($,J.value,null);else z=lj($,J.value,K-1);if(z.indexOf(`
|
|
25
25
|
`)>-1)if(O)z=z.split(`
|
|
26
26
|
`).map(function(w){return" "+w}).join(`
|
|
@@ -30,13 +30,13 @@ Expecting `+H.join(", ")+", got '"+(this.terminals_[u]||u)+"'";else T="Parse err
|
|
|
30
30
|
`)}else z=$.stylize("[Circular]","special");if(p4(j)){if(O&&_.match(/^\d+$/))return z;if(j=JSON.stringify(""+_),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))j=j.slice(1,-1),j=$.stylize(j,"name");else j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=$.stylize(j,"string")}return j+": "+z}function Rd($,q,K){var P=0,_=$.reduce(function(O,j){if(P++,j.indexOf(`
|
|
31
31
|
`)>=0)P++;return O+j.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(_>60)return K[0]+(q===""?"":q+`
|
|
32
32
|
`)+" "+$.join(`,
|
|
33
|
-
`)+" "+K[1];return K[0]+q+" "+$.join(", ")+" "+K[1]}function PS($){return Array.isArray($)}function OH($){return typeof $==="boolean"}function oj($){return $===null}function Dd($){return $==null}function jS($){return typeof $==="number"}function rj($){return typeof $==="string"}function gd($){return typeof $==="symbol"}function p4($){return $===void 0}function cj($){return x4($)&&YH($)==="[object RegExp]"}function x4($){return typeof $==="object"&&$!==null}function PH($){return x4($)&&YH($)==="[object Date]"}function mj($){return x4($)&&(YH($)==="[object Error]"||$ instanceof Error)}function dj($){return typeof $==="function"}function Ld($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function bd($){return $ instanceof Buffer}function YH($){return Object.prototype.toString.call($)}function KH($){return $<10?"0"+$.toString(10):$.toString(10)}function yd(){var $=new Date,q=[KH($.getHours()),KH($.getMinutes()),KH($.getSeconds())].join(":");return[$.getDate(),ud[$.getMonth()],q].join(" ")}function OS(...$){console.log("%s - %s",yd(),jH.apply(null,$))}function YS($,q){if(q)$.super_=q,$.prototype=Object.create(q.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function vH($,q){if(!q||!x4(q))return $;var K=Object.keys(q),P=K.length;while(P--)$[K[P]]=q[K[P]];return $}function vS($,q){return Object.prototype.hasOwnProperty.call($,q)}function zH($,q){if(!$){var K=Error("Promise was rejected with a falsy value");K.reason=$,$=K}return q($)}function WS($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function q(...K){var P=K.pop();if(typeof P!=="function")throw TypeError("The last argument must be of type Function");var _=this,O=function(...j){return P.apply(_,...j)};$.apply(this,K).then(function(j){process.nextTick(O.bind(null,null,j))},function(j){process.nextTick(zH.bind(null,j,O))})}return Object.setPrototypeOf(q,Object.getPrototypeOf($)),Object.defineProperties(q,Object.getOwnPropertyDescriptors($)),q}var Gd,Sd,G_,Id=()=>{},ud,zS,HS,JS,pd;var wS=o4(()=>{Gd=/%[sdj%]/g;Sd=(($={},q={},K)=>((K=typeof process<"u"&&!1)&&(K=K.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),q=new RegExp("^"+K+"$","i"),(P)=>{if(P=P.toUpperCase(),!$[P])if(q.test(P))$[P]=function(..._){console.error("%s: %s",P,pid,jH.apply(null,..._))};else $[P]=function(){};return $[P]}))(),G_=(($)=>($.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$.custom=Symbol.for("nodejs.util.inspect.custom"),$))(function(q,K,...P){var _={seen:[],stylize:Nd};if(P.length>=1)_.depth=P[0];if(P.length>=2)_.colors=P[1];if(OH(K))_.showHidden=K;else if(K)vH(_,K);if(p4(_.showHidden))_.showHidden=!1;if(p4(_.depth))_.depth=2;if(p4(_.colors))_.colors=!1;if(_.colors)_.stylize=Md;return lj(_,q,_.depth)});ud=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];zS=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function(q){if(typeof q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&q[kCustomPromisifiedSymbol]){var K=q[kCustomPromisifiedSymbol];if(typeof K!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(K,kCustomPromisifiedSymbol,{value:K,enumerable:!1,writable:!1,configurable:!0}),K}function K(...P){var _,O,j=new Promise(function(z,J){_=z,O=J});P.push(function(z,J){if(z)O(z);else _(J)});try{q.apply(this,P)}catch(z){O(z)}return j}if(Object.setPrototypeOf(K,Object.getPrototypeOf(q)),kCustomPromisifiedSymbol)Object.defineProperty(K,kCustomPromisifiedSymbol,{value:K,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(K,Object.getOwnPropertyDescriptors(q))});({TextEncoder:HS,TextDecoder:JS}=globalThis),pd={TextEncoder:HS,TextDecoder:JS,promisify:zS,log:OS,inherits:YS,_extend:vH,callbackifyOnRejected:zH,callbackify:WS}});var u7={};uq(u7,{setMaxListeners:()=>CS,once:()=>MS,listenerCount:()=>ES,init:()=>mK,getMaxListeners:()=>RS,getEventListeners:()=>NS,default:()=>id,captureRejectionSymbol:()=>AS,addAbortListener:()=>IS,EventEmitter:()=>mK});function GS($,q){var{_events:K}=$;if(q[0]??=Error("Unhandled error."),!K)throw q[0];var P=K[kS];if(P)for(var _ of XS.call(P))_.apply($,q);var O=K.error;if(!O)throw q[0];for(var _ of XS.call(O))_.apply($,q);return!0}function md($,q,K,P){q.then(void 0,function(_){queueMicrotask(()=>dd($,_,K,P))})}function dd($,q,K,P){if(typeof $[ZS]==="function")$[ZS](q,K,...P);else try{$[V_]=!1,$.emit("error",q)}finally{$[V_]=!0}}function VS($,q,K){K.warned=!0;let P=Error(`Possible EventEmitter memory leak detected. ${K.length} ${String(q)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);P.name="MaxListenersExceededWarning",P.emitter=$,P.type=q,P.count=K.length,console.warn(P)}function SS($,q,...K){this.removeListener($,q),q.apply(this,K)}function MS($,q,K){var P=K?.signal;if(hS(P,"options.signal"),P?.aborted)throw new WH(void 0,{cause:P?.reason});let{resolve:_,reject:O,promise:j}=$newPromiseCapability(Promise),z=(G)=>{if($.removeListener(q,J),P!=null)nj(P,"abort",w);O(G)},J=(...G)=>{if(typeof $.removeListener==="function")$.removeListener("error",z);if(P!=null)nj(P,"abort",w);_(G)};if(fS($,q,J,{once:!0}),q!=="error"&&typeof $.once==="function")$.once("error",z);function w(){nj($,q,J),nj($,"error",z),O(new WH(void 0,{cause:P?.reason}))}if(P!=null)fS(P,"abort",w,{once:!0});return j}function NS($,q){return $.listeners(q)}function CS($,...q){JH($,"setMaxListeners",0);var K;if(q&&(K=q.length))for(let P=0;P<K;P++)q[P].setMaxListeners($);else S_=$}function ES($,q){return $.listenerCount(q)}function nj($,q,K,P){if(typeof $.removeListener==="function")$.removeListener(q,K);else $.removeEventListener(q,K,P)}function fS($,q,K,P){if(typeof $.on==="function")if(P.once)$.once(q,K);else $.on(q,K);else $.addEventListener(q,K,P)}function c4($,q,K){let P=TypeError(`The "${$}" argument must be of type ${q}. Received ${K}`);return P.code="ERR_INVALID_ARG_TYPE",P}function rd($,q,K){let P=RangeError(`The "${$}" argument is out of range. It must be ${q}. Received ${K}`);return P.code="ERR_OUT_OF_RANGE",P}function hS($,q){if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw c4(q,"AbortSignal",$)}function JH($,q,K,P){if(typeof $!=="number")throw c4(q,"number",$);if(K!=null&&$<K||P!=null&&$>P||(K!=null||P!=null)&&Number.isNaN($))throw rd(q,`${K!=null?`>= ${K}`:""}${K!=null&&P!=null?" && ":""}${P!=null?`<= ${P}`:""}`,$)}function b7($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function nd($,q){if(typeof $!=="boolean")throw c4(q,"boolean",$)}function RS($){return $?._maxListeners??S_}function IS($,q){if($===void 0)throw c4("signal","AbortSignal",$);if(hS($,"signal"),typeof q!=="function")throw c4("listener","function",q);let K;if($.aborted)queueMicrotask(()=>q());else $.addEventListener("abort",q,{__proto__:null,once:!0}),K=()=>{$.removeEventListener("abort",q)};return{__proto__:null,[Symbol.dispose](){K?.()}}}var HH,V_,kS,xd,cd,ZS,AS,XS,S_=10,mK=function(q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[V_]=q?.captureRejections?Boolean(q?.captureRejections):E6[V_])this.emit=od},E6,ld=function(q,...K){if(q==="error")return GS(this,K);var{_events:P}=this;if(P===void 0)return!1;var _=P[q];if(_===void 0)return!1;let O=_.length>1?_.slice():_;for(let j=0,{length:z}=O;j<z;j++){let J=O[j];switch(K.length){case 0:J.call(this);break;case 1:J.call(this,K[0]);break;case 2:J.call(this,K[0],K[1]);break;case 3:J.call(this,K[0],K[1],K[2]);break;default:J.apply(this,K);break}}return!0},od=function(q,...K){if(q==="error")return GS(this,K);var{_events:P}=this;if(P===void 0)return!1;var _=P[q];if(_===void 0)return!1;let O=_.length>1?_.slice():_;for(let j=0,{length:z}=O;j<z;j++){let J=O[j],w;switch(K.length){case 0:w=J.call(this);break;case 1:w=J.call(this,K[0]);break;case 2:w=J.call(this,K[0],K[1]);break;case 3:w=J.call(this,K[0],K[1],K[2]);break;default:w=J.apply(this,K);break}if(w!==void 0&&typeof w?.then==="function"&&w.then===Promise.prototype.then)md(this,w,q,K)}return!0},WH,id;var y7=o4(()=>{HH=Symbol.for,V_=Symbol("kCapture"),kS=HH("events.errorMonitor"),xd=Symbol("events.maxEventTargetListeners"),cd=Symbol("events.maxEventTargetListenersWarned"),ZS=HH("nodejs.rejection"),AS=HH("nodejs.rejection"),XS=Array.prototype.slice,E6=mK.prototype={};E6._events=void 0;E6._eventsCount=0;E6._maxListeners=void 0;E6.setMaxListeners=function(q){return JH(q,"setMaxListeners",0),this._maxListeners=q,this};E6.constructor=mK;E6.getMaxListeners=function(){return this?._maxListeners??S_};E6.emit=ld;E6.addListener=function(q,K){b7(K);var P=this._events;if(!P)P=this._events={__proto__:null},this._eventsCount=0;else if(P.newListener)this.emit("newListener",q,K.listener??K);var _=P[q];if(!_)P[q]=[K],this._eventsCount++;else{_.push(K);var O=this._maxListeners??S_;if(O>0&&_.length>O&&!_.warned)VS(this,q,_)}return this};E6.on=E6.addListener;E6.prependListener=function(q,K){b7(K);var P=this._events;if(!P)P=this._events={__proto__:null},this._eventsCount=0;else if(P.newListener)this.emit("newListener",q,K.listener??K);var _=P[q];if(!_)P[q]=[K],this._eventsCount++;else{_.unshift(K);var O=this._maxListeners??S_;if(O>0&&_.length>O&&!_.warned)VS(this,q,_)}return this};E6.once=function(q,K){b7(K);let P=SS.bind(this,q,K);return P.listener=K,this.addListener(q,P),this};E6.prependOnceListener=function(q,K){b7(K);let P=SS.bind(this,q,K);return P.listener=K,this.prependListener(q,P),this};E6.removeListener=function(q,K){b7(K);var{_events:P}=this;if(!P)return this;var _=P[q];if(!_)return this;var O=_.length;let j=-1;for(let z=O-1;z>=0;z--)if(_[z]===K||_[z].listener===K){j=z;break}if(j<0)return this;if(j===0)_.shift();else _.splice(j,1);if(_.length===0)delete P[q],this._eventsCount--;return this};E6.off=E6.removeListener;E6.removeAllListeners=function(q){var{_events:K}=this;if(q&&K){if(K[q])delete K[q],this._eventsCount--}else this._events={__proto__:null};return this};E6.listeners=function(q){var{_events:K}=this;if(!K)return[];var P=K[q];if(!P)return[];return P.map((_)=>_.listener??_)};E6.rawListeners=function(q){var{_events:K}=this;if(!K)return[];var P=K[q];if(!P)return[];return P.slice()};E6.listenerCount=function(q){var{_events:K}=this;if(!K)return 0;return K[q]?.length??0};E6.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};E6[V_]=!1;WH=class WH extends Error{constructor($="The operation was aborted",q=void 0){if(q!==void 0&&typeof q!=="object")throw c4("options","Object",q);super($,q);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(mK,{captureRejections:{get(){return E6[V_]},set($){nd($,"EventEmitter.captureRejections"),E6[V_]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return S_},set:($)=>{JH($,"defaultMaxListeners",0),S_=$}},kMaxEventTargetListeners:{value:xd,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:cd,enumerable:!1,configurable:!1,writable:!1}});Object.assign(mK,{once:MS,getEventListeners:NS,getMaxListeners:RS,setMaxListeners:CS,EventEmitter:mK,usingDomains:!1,captureRejectionSymbol:AS,errorMonitor:kS,addAbortListener:IS,init:mK,listenerCount:ES});id=mK});var XH=u$((m_$,xS)=>{var k6=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),I6=k6(($,q)=>{class K extends Error{constructor(P){if(!Array.isArray(P))throw TypeError(`Expected input to be an Array, got ${typeof P}`);let _="";for(let O=0;O<P.length;O++)_+=` ${P[O].stack}
|
|
33
|
+
`)+" "+K[1];return K[0]+q+" "+$.join(", ")+" "+K[1]}function PS($){return Array.isArray($)}function OH($){return typeof $==="boolean"}function oj($){return $===null}function Dd($){return $==null}function jS($){return typeof $==="number"}function rj($){return typeof $==="string"}function gd($){return typeof $==="symbol"}function p4($){return $===void 0}function cj($){return x4($)&&YH($)==="[object RegExp]"}function x4($){return typeof $==="object"&&$!==null}function PH($){return x4($)&&YH($)==="[object Date]"}function mj($){return x4($)&&(YH($)==="[object Error]"||$ instanceof Error)}function dj($){return typeof $==="function"}function Ld($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function bd($){return $ instanceof Buffer}function YH($){return Object.prototype.toString.call($)}function KH($){return $<10?"0"+$.toString(10):$.toString(10)}function yd(){var $=new Date,q=[KH($.getHours()),KH($.getMinutes()),KH($.getSeconds())].join(":");return[$.getDate(),ud[$.getMonth()],q].join(" ")}function OS(...$){console.log("%s - %s",yd(),jH.apply(null,$))}function YS($,q){if(q)$.super_=q,$.prototype=Object.create(q.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function vH($,q){if(!q||!x4(q))return $;var K=Object.keys(q),P=K.length;while(P--)$[K[P]]=q[K[P]];return $}function vS($,q){return Object.prototype.hasOwnProperty.call($,q)}function zH($,q){if(!$){var K=Error("Promise was rejected with a falsy value");K.reason=$,$=K}return q($)}function WS($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function q(...K){var P=K.pop();if(typeof P!=="function")throw TypeError("The last argument must be of type Function");var _=this,O=function(...j){return P.apply(_,...j)};$.apply(this,K).then(function(j){process.nextTick(O.bind(null,null,j))},function(j){process.nextTick(zH.bind(null,j,O))})}return Object.setPrototypeOf(q,Object.getPrototypeOf($)),Object.defineProperties(q,Object.getOwnPropertyDescriptors($)),q}var Gd,Sd,G_,Id=()=>{},ud,zS,HS,JS,pd;var wS=o4(()=>{Gd=/%[sdj%]/g;Sd=(($={},q={},K)=>((K=typeof process<"u"&&!1)&&(K=K.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),q=new RegExp("^"+K+"$","i"),(P)=>{if(P=P.toUpperCase(),!$[P])if(q.test(P))$[P]=function(..._){console.error("%s: %s",P,pid,jH.apply(null,..._))};else $[P]=function(){};return $[P]}))(),G_=(($)=>($.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$.custom=Symbol.for("nodejs.util.inspect.custom"),$))(function(q,K,...P){var _={seen:[],stylize:Nd};if(P.length>=1)_.depth=P[0];if(P.length>=2)_.colors=P[1];if(OH(K))_.showHidden=K;else if(K)vH(_,K);if(p4(_.showHidden))_.showHidden=!1;if(p4(_.depth))_.depth=2;if(p4(_.colors))_.colors=!1;if(_.colors)_.stylize=Md;return lj(_,q,_.depth)});ud=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];zS=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function(q){if(typeof q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&q[kCustomPromisifiedSymbol]){var K=q[kCustomPromisifiedSymbol];if(typeof K!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(K,kCustomPromisifiedSymbol,{value:K,enumerable:!1,writable:!1,configurable:!0}),K}function K(...P){var _,O,j=new Promise(function(z,J){_=z,O=J});P.push(function(z,J){if(z)O(z);else _(J)});try{q.apply(this,P)}catch(z){O(z)}return j}if(Object.setPrototypeOf(K,Object.getPrototypeOf(q)),kCustomPromisifiedSymbol)Object.defineProperty(K,kCustomPromisifiedSymbol,{value:K,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(K,Object.getOwnPropertyDescriptors(q))});({TextEncoder:HS,TextDecoder:JS}=globalThis),pd={TextEncoder:HS,TextDecoder:JS,promisify:zS,log:OS,inherits:YS,_extend:vH,callbackifyOnRejected:zH,callbackify:WS}});var u7={};uq(u7,{setMaxListeners:()=>CS,once:()=>MS,listenerCount:()=>ES,init:()=>mK,getMaxListeners:()=>RS,getEventListeners:()=>NS,default:()=>id,captureRejectionSymbol:()=>AS,addAbortListener:()=>IS,EventEmitter:()=>mK});function GS($,q){var{_events:K}=$;if(q[0]??=Error("Unhandled error."),!K)throw q[0];var P=K[kS];if(P)for(var _ of XS.call(P))_.apply($,q);var O=K.error;if(!O)throw q[0];for(var _ of XS.call(O))_.apply($,q);return!0}function md($,q,K,P){q.then(void 0,function(_){queueMicrotask(()=>dd($,_,K,P))})}function dd($,q,K,P){if(typeof $[ZS]==="function")$[ZS](q,K,...P);else try{$[V_]=!1,$.emit("error",q)}finally{$[V_]=!0}}function VS($,q,K){K.warned=!0;let P=Error(`Possible EventEmitter memory leak detected. ${K.length} ${String(q)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);P.name="MaxListenersExceededWarning",P.emitter=$,P.type=q,P.count=K.length,console.warn(P)}function SS($,q,...K){this.removeListener($,q),q.apply(this,K)}function MS($,q,K){var P=K?.signal;if(hS(P,"options.signal"),P?.aborted)throw new WH(void 0,{cause:P?.reason});let{resolve:_,reject:O,promise:j}=$newPromiseCapability(Promise),z=(G)=>{if($.removeListener(q,J),P!=null)nj(P,"abort",w);O(G)},J=(...G)=>{if(typeof $.removeListener==="function")$.removeListener("error",z);if(P!=null)nj(P,"abort",w);_(G)};if(fS($,q,J,{once:!0}),q!=="error"&&typeof $.once==="function")$.once("error",z);function w(){nj($,q,J),nj($,"error",z),O(new WH(void 0,{cause:P?.reason}))}if(P!=null)fS(P,"abort",w,{once:!0});return j}function NS($,q){return $.listeners(q)}function CS($,...q){JH($,"setMaxListeners",0);var K;if(q&&(K=q.length))for(let P=0;P<K;P++)q[P].setMaxListeners($);else S_=$}function ES($,q){return $.listenerCount(q)}function nj($,q,K,P){if(typeof $.removeListener==="function")$.removeListener(q,K);else $.removeEventListener(q,K,P)}function fS($,q,K,P){if(typeof $.on==="function")if(P.once)$.once(q,K);else $.on(q,K);else $.addEventListener(q,K,P)}function c4($,q,K){let P=TypeError(`The "${$}" argument must be of type ${q}. Received ${K}`);return P.code="ERR_INVALID_ARG_TYPE",P}function rd($,q,K){let P=RangeError(`The "${$}" argument is out of range. It must be ${q}. Received ${K}`);return P.code="ERR_OUT_OF_RANGE",P}function hS($,q){if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw c4(q,"AbortSignal",$)}function JH($,q,K,P){if(typeof $!=="number")throw c4(q,"number",$);if(K!=null&&$<K||P!=null&&$>P||(K!=null||P!=null)&&Number.isNaN($))throw rd(q,`${K!=null?`>= ${K}`:""}${K!=null&&P!=null?" && ":""}${P!=null?`<= ${P}`:""}`,$)}function b7($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function nd($,q){if(typeof $!=="boolean")throw c4(q,"boolean",$)}function RS($){return $?._maxListeners??S_}function IS($,q){if($===void 0)throw c4("signal","AbortSignal",$);if(hS($,"signal"),typeof q!=="function")throw c4("listener","function",q);let K;if($.aborted)queueMicrotask(()=>q());else $.addEventListener("abort",q,{__proto__:null,once:!0}),K=()=>{$.removeEventListener("abort",q)};return{__proto__:null,[Symbol.dispose](){K?.()}}}var HH,V_,kS,xd,cd,ZS,AS,XS,S_=10,mK=function(q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[V_]=q?.captureRejections?Boolean(q?.captureRejections):E6[V_])this.emit=od},E6,ld=function(q,...K){if(q==="error")return GS(this,K);var{_events:P}=this;if(P===void 0)return!1;var _=P[q];if(_===void 0)return!1;let O=_.length>1?_.slice():_;for(let j=0,{length:z}=O;j<z;j++){let J=O[j];switch(K.length){case 0:J.call(this);break;case 1:J.call(this,K[0]);break;case 2:J.call(this,K[0],K[1]);break;case 3:J.call(this,K[0],K[1],K[2]);break;default:J.apply(this,K);break}}return!0},od=function(q,...K){if(q==="error")return GS(this,K);var{_events:P}=this;if(P===void 0)return!1;var _=P[q];if(_===void 0)return!1;let O=_.length>1?_.slice():_;for(let j=0,{length:z}=O;j<z;j++){let J=O[j],w;switch(K.length){case 0:w=J.call(this);break;case 1:w=J.call(this,K[0]);break;case 2:w=J.call(this,K[0],K[1]);break;case 3:w=J.call(this,K[0],K[1],K[2]);break;default:w=J.apply(this,K);break}if(w!==void 0&&typeof w?.then==="function"&&w.then===Promise.prototype.then)md(this,w,q,K)}return!0},WH,id;var y7=o4(()=>{HH=Symbol.for,V_=Symbol("kCapture"),kS=HH("events.errorMonitor"),xd=Symbol("events.maxEventTargetListeners"),cd=Symbol("events.maxEventTargetListenersWarned"),ZS=HH("nodejs.rejection"),AS=HH("nodejs.rejection"),XS=Array.prototype.slice,E6=mK.prototype={};E6._events=void 0;E6._eventsCount=0;E6._maxListeners=void 0;E6.setMaxListeners=function(q){return JH(q,"setMaxListeners",0),this._maxListeners=q,this};E6.constructor=mK;E6.getMaxListeners=function(){return this?._maxListeners??S_};E6.emit=ld;E6.addListener=function(q,K){b7(K);var P=this._events;if(!P)P=this._events={__proto__:null},this._eventsCount=0;else if(P.newListener)this.emit("newListener",q,K.listener??K);var _=P[q];if(!_)P[q]=[K],this._eventsCount++;else{_.push(K);var O=this._maxListeners??S_;if(O>0&&_.length>O&&!_.warned)VS(this,q,_)}return this};E6.on=E6.addListener;E6.prependListener=function(q,K){b7(K);var P=this._events;if(!P)P=this._events={__proto__:null},this._eventsCount=0;else if(P.newListener)this.emit("newListener",q,K.listener??K);var _=P[q];if(!_)P[q]=[K],this._eventsCount++;else{_.unshift(K);var O=this._maxListeners??S_;if(O>0&&_.length>O&&!_.warned)VS(this,q,_)}return this};E6.once=function(q,K){b7(K);let P=SS.bind(this,q,K);return P.listener=K,this.addListener(q,P),this};E6.prependOnceListener=function(q,K){b7(K);let P=SS.bind(this,q,K);return P.listener=K,this.prependListener(q,P),this};E6.removeListener=function(q,K){b7(K);var{_events:P}=this;if(!P)return this;var _=P[q];if(!_)return this;var O=_.length;let j=-1;for(let z=O-1;z>=0;z--)if(_[z]===K||_[z].listener===K){j=z;break}if(j<0)return this;if(j===0)_.shift();else _.splice(j,1);if(_.length===0)delete P[q],this._eventsCount--;return this};E6.off=E6.removeListener;E6.removeAllListeners=function(q){var{_events:K}=this;if(q&&K){if(K[q])delete K[q],this._eventsCount--}else this._events={__proto__:null};return this};E6.listeners=function(q){var{_events:K}=this;if(!K)return[];var P=K[q];if(!P)return[];return P.map((_)=>_.listener??_)};E6.rawListeners=function(q){var{_events:K}=this;if(!K)return[];var P=K[q];if(!P)return[];return P.slice()};E6.listenerCount=function(q){var{_events:K}=this;if(!K)return 0;return K[q]?.length??0};E6.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};E6[V_]=!1;WH=class WH extends Error{constructor($="The operation was aborted",q=void 0){if(q!==void 0&&typeof q!=="object")throw c4("options","Object",q);super($,q);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(mK,{captureRejections:{get(){return E6[V_]},set($){nd($,"EventEmitter.captureRejections"),E6[V_]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return S_},set:($)=>{JH($,"defaultMaxListeners",0),S_=$}},kMaxEventTargetListeners:{value:xd,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:cd,enumerable:!1,configurable:!1,writable:!1}});Object.assign(mK,{once:MS,getEventListeners:NS,getMaxListeners:RS,setMaxListeners:CS,EventEmitter:mK,usingDomains:!1,captureRejectionSymbol:AS,errorMonitor:kS,addAbortListener:IS,init:mK,listenerCount:ES});id=mK});var XH=u$((d_$,xS)=>{var k6=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),I6=k6(($,q)=>{class K extends Error{constructor(P){if(!Array.isArray(P))throw TypeError(`Expected input to be an Array, got ${typeof P}`);let _="";for(let O=0;O<P.length;O++)_+=` ${P[O].stack}
|
|
34
34
|
`;super(_);this.name="AggregateError",this.errors=P}}q.exports={AggregateError:K,ArrayIsArray(P){return Array.isArray(P)},ArrayPrototypeIncludes(P,_){return P.includes(_)},ArrayPrototypeIndexOf(P,_){return P.indexOf(_)},ArrayPrototypeJoin(P,_){return P.join(_)},ArrayPrototypeMap(P,_){return P.map(_)},ArrayPrototypePop(P,_){return P.pop(_)},ArrayPrototypePush(P,_){return P.push(_)},ArrayPrototypeSlice(P,_,O){return P.slice(_,O)},Error,FunctionPrototypeCall(P,_,...O){return P.call(_,...O)},FunctionPrototypeSymbolHasInstance(P,_){return Function.prototype[Symbol.hasInstance].call(P,_)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(P,_){return Object.defineProperties(P,_)},ObjectDefineProperty(P,_,O){return Object.defineProperty(P,_,O)},ObjectGetOwnPropertyDescriptor(P,_){return Object.getOwnPropertyDescriptor(P,_)},ObjectKeys(P){return Object.keys(P)},ObjectSetPrototypeOf(P,_){return Object.setPrototypeOf(P,_)},Promise,PromisePrototypeCatch(P,_){return P.catch(_)},PromisePrototypeThen(P,_,O){return P.then(_,O)},PromiseReject(P){return Promise.reject(P)},PromiseResolve(P){return Promise.resolve(P)},ReflectApply:Reflect.apply,RegExpPrototypeTest(P,_){return P.test(_)},SafeSet:Set,String,StringPrototypeSlice(P,_,O){return P.slice(_,O)},StringPrototypeToLowerCase(P){return P.toLowerCase()},StringPrototypeToUpperCase(P){return P.toUpperCase()},StringPrototypeTrim(P){return P.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(P,_,O){return P.set(_,O)},Boolean,Uint8Array}}),DS=k6(($,q)=>{q.exports={format(K,...P){return K.replace(/%([sdifj])/g,function(...[_,O]){let j=P.shift();if(O==="f")return j.toFixed(6);else if(O==="j")return JSON.stringify(j);else if(O==="s"&&typeof j==="object")return`${j.constructor!==Object?j.constructor.name:""} {}`.trim();else return j.toString()})},inspect(K){switch(typeof K){case"string":if(K.includes("'")){if(!K.includes('"'))return`"${K}"`;else if(!K.includes("`")&&!K.includes("${"))return`\`${K}\``}return`'${K}'`;case"number":if(isNaN(K))return"NaN";else if(Object.is(K,-0))return String(K);return K;case"bigint":return`${String(K)}n`;case"boolean":case"undefined":return String(K);case"object":return"{}"}}}}),bq=k6(($,q)=>{var{format:K,inspect:P}=DS(),{AggregateError:_}=I6(),O=globalThis.AggregateError||_,j=Symbol("kIsNodeError"),z=["string","function","number","object","Function","Object","boolean","bigint","symbol"],J=/^([A-Z][a-z0-9]*)+$/,w={};function G(I,D){if(!I)throw new w.ERR_INTERNAL_ASSERTION(D)}function f(I){let D="",b=I.length,u=I[0]==="-"?1:0;for(;b>=u+4;b-=3)D=`_${I.slice(b-3,b)}${D}`;return`${I.slice(0,b)}${D}`}function A(I,D,b){if(typeof D==="function")return G(D.length<=b.length,`Code: ${I}; The provided arguments length (${b.length}) does not match the required ones (${D.length}).`),D(...b);let u=(D.match(/%[dfijoOs]/g)||[]).length;if(G(u===b.length,`Code: ${I}; The provided arguments length (${b.length}) does not match the required ones (${u}).`),b.length===0)return D;return K(D,...b)}function V(I,D,b){if(!b)b=Error;class u extends b{constructor(...y){super(A(I,D,y))}toString(){return`${this.name} [${I}]: ${this.message}`}}Object.defineProperties(u.prototype,{name:{value:b.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${I}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),u.prototype.code=I,u.prototype[j]=!0,w[I]=u}function C(I){let D="__node_internal_"+I.name;return Object.defineProperty(I,"name",{value:D}),I}function E(I,D){if(I&&D&&I!==D){if(Array.isArray(D.errors))return D.errors.push(I),D;let b=new O([D,I],D.message);return b.code=D.code,b}return I||D}class R extends Error{constructor(I="The operation was aborted",D=void 0){if(D!==void 0&&typeof D!=="object")throw new w.ERR_INVALID_ARG_TYPE("options","Object",D);super(I,D);this.code="ABORT_ERR",this.name="AbortError"}}V("ERR_ASSERTION","%s",Error),V("ERR_INVALID_ARG_TYPE",(I,D,b)=>{if(G(typeof I==="string","'name' must be a string"),!Array.isArray(D))D=[D];let u="The ";if(I.endsWith(" argument"))u+=`${I} `;else u+=`"${I}" ${I.includes(".")?"property":"argument"} `;u+="must be ";let y=[],c=[],m=[];for(let e of D)if(G(typeof e==="string","All expected entries have to be of type string"),z.includes(e))y.push(e.toLowerCase());else if(J.test(e))c.push(e);else G(e!=="object",'The value "object" should be written as "Object"'),m.push(e);if(c.length>0){let e=y.indexOf("object");if(e!==-1)y.splice(y,e,1),c.push("Object")}if(y.length>0){switch(y.length){case 1:u+=`of type ${y[0]}`;break;case 2:u+=`one of type ${y[0]} or ${y[1]}`;break;default:{let e=y.pop();u+=`one of type ${y.join(", ")}, or ${e}`}}if(c.length>0||m.length>0)u+=" or "}if(c.length>0){switch(c.length){case 1:u+=`an instance of ${c[0]}`;break;case 2:u+=`an instance of ${c[0]} or ${c[1]}`;break;default:{let e=c.pop();u+=`an instance of ${c.join(", ")}, or ${e}`}}if(m.length>0)u+=" or "}switch(m.length){case 0:break;case 1:if(m[0].toLowerCase()!==m[0])u+="an ";u+=`${m[0]}`;break;case 2:u+=`one of ${m[0]} or ${m[1]}`;break;default:{let e=m.pop();u+=`one of ${m.join(", ")}, or ${e}`}}if(b==null)u+=`. Received ${b}`;else if(typeof b==="function"&&b.name)u+=`. Received function ${b.name}`;else if(typeof b==="object"){var q$;if((q$=b.constructor)!==null&&q$!==void 0&&q$.name)u+=`. Received an instance of ${b.constructor.name}`;else{let e=P(b,{depth:-1});u+=`. Received ${e}`}}else{let e=P(b,{colors:!1});if(e.length>25)e=`${e.slice(0,25)}...`;u+=`. Received type ${typeof b} (${e})`}return u},TypeError),V("ERR_INVALID_ARG_VALUE",(I,D,b="is invalid")=>{let u=P(D);if(u.length>128)u=u.slice(0,128)+"...";return`The ${I.includes(".")?"property":"argument"} '${I}' ${b}. Received ${u}`},TypeError),V("ERR_INVALID_RETURN_VALUE",(I,D,b)=>{var u;let y=b!==null&&b!==void 0&&(u=b.constructor)!==null&&u!==void 0&&u.name?`instance of ${b.constructor.name}`:`type ${typeof b}`;return`Expected ${I} to be returned from the "${D}" function but got ${y}.`},TypeError),V("ERR_MISSING_ARGS",(...I)=>{G(I.length>0,"At least one arg needs to be specified");let D,b=I.length;switch(I=(Array.isArray(I)?I:[I]).map((u)=>`"${u}"`).join(" or "),b){case 1:D+=`The ${I[0]} argument`;break;case 2:D+=`The ${I[0]} and ${I[1]} arguments`;break;default:{let u=I.pop();D+=`The ${I.join(", ")}, and ${u} arguments`}break}return`${D} must be specified`},TypeError),V("ERR_OUT_OF_RANGE",(I,D,b)=>{G(D,'Missing "range" argument');let u;if(Number.isInteger(b)&&Math.abs(b)>4294967296)u=f(String(b));else if(typeof b==="bigint"){u=String(b);let y=BigInt(2)**BigInt(32);if(b>y||b<-y)u=f(u);u+="n"}else u=P(b);return`The value of "${I}" is out of range. It must be ${D}. Received ${u}`},RangeError),V("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),V("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),V("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),V("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),V("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),V("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),V("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),V("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),V("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),V("ERR_STREAM_WRITE_AFTER_END","write after end",Error),V("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),q.exports={AbortError:R,aggregateTwoErrors:C(E),hideStackFrames:C,codes:w}}),td=k6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var K=new WeakMap,P=new WeakMap;function _(l){let r=K.get(l);return console.assert(r!=null,"'this' is expected an Event object, but got",l),r}function O(l){if(l.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",l.passiveListener);return}if(!l.event.cancelable)return;if(l.canceled=!0,typeof l.event.preventDefault==="function")l.event.preventDefault()}function j(l,r){K.set(this,{eventTarget:l,event:r,eventPhase:2,currentTarget:l,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:r.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let M=Object.keys(r);for(let Y=0;Y<M.length;++Y){let H=M[Y];if(!(H in this))Object.defineProperty(this,H,z(H))}}if(j.prototype={get type(){return _(this).event.type},get target(){return _(this).eventTarget},get currentTarget(){return _(this).currentTarget},composedPath(){let l=_(this).currentTarget;if(l==null)return[];return[l]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return _(this).eventPhase},stopPropagation(){let l=_(this);if(l.stopped=!0,typeof l.event.stopPropagation==="function")l.event.stopPropagation()},stopImmediatePropagation(){let l=_(this);if(l.stopped=!0,l.immediateStopped=!0,typeof l.event.stopImmediatePropagation==="function")l.event.stopImmediatePropagation()},get bubbles(){return Boolean(_(this).event.bubbles)},get cancelable(){return Boolean(_(this).event.cancelable)},preventDefault(){O(_(this))},get defaultPrevented(){return _(this).canceled},get composed(){return Boolean(_(this).event.composed)},get timeStamp(){return _(this).timeStamp},get srcElement(){return _(this).eventTarget},get cancelBubble(){return _(this).stopped},set cancelBubble(l){if(!l)return;let r=_(this);if(r.stopped=!0,typeof r.event.cancelBubble==="boolean")r.event.cancelBubble=!0},get returnValue(){return!_(this).canceled},set returnValue(l){if(!l)O(_(this))},initEvent(){}},Object.defineProperty(j.prototype,"constructor",{value:j,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(j.prototype,window.Event.prototype),P.set(window.Event.prototype,j);function z(l){return{get(){return _(this).event[l]},set(r){_(this).event[l]=r},configurable:!0,enumerable:!0}}function J(l){return{value(){let r=_(this).event;return r[l].apply(r,arguments)},configurable:!0,enumerable:!0}}function w(l,r){let M=Object.keys(r);if(M.length===0)return l;function Y(H,T){l.call(this,H,T)}Y.prototype=Object.create(l.prototype,{constructor:{value:Y,configurable:!0,writable:!0}});for(let H=0;H<M.length;++H){let T=M[H];if(!(T in l.prototype)){let W=typeof Object.getOwnPropertyDescriptor(r,T).value==="function";Object.defineProperty(Y.prototype,T,W?J(T):z(T))}}return Y}function G(l){if(l==null||l===Object.prototype)return j;let r=P.get(l);if(r==null)r=w(G(Object.getPrototypeOf(l)),l),P.set(l,r);return r}function f(l,r){return new(G(Object.getPrototypeOf(r)))(l,r)}function A(l){return _(l).immediateStopped}function V(l,r){_(l).eventPhase=r}function C(l,r){_(l).currentTarget=r}function E(l,r){_(l).passiveListener=r}var R=new WeakMap,I=1,D=2,b=3;function u(l){return l!==null&&typeof l==="object"}function y(l){let r=R.get(l);if(r==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return r}function c(l){return{get(){let r=y(this).get(l);while(r!=null){if(r.listenerType===b)return r.listener;r=r.next}return null},set(r){if(typeof r!=="function"&&!u(r))r=null;let M=y(this),Y=null,H=M.get(l);while(H!=null){if(H.listenerType===b)if(Y!==null)Y.next=H.next;else if(H.next!==null)M.set(l,H.next);else M.delete(l);else Y=H;H=H.next}if(r!==null){let T={listener:r,listenerType:b,passive:!1,once:!1,next:null};if(Y===null)M.set(l,T);else Y.next=T}},configurable:!0,enumerable:!0}}function m(l,r){Object.defineProperty(l,`on${r}`,c(r))}function q$(l){function r(){e.call(this)}r.prototype=Object.create(e.prototype,{constructor:{value:r,configurable:!0,writable:!0}});for(let M=0;M<l.length;++M)m(r.prototype,l[M]);return r}function e(){if(this instanceof e){R.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return q$(arguments[0]);if(arguments.length>0){let l=Array(arguments.length);for(let r=0;r<arguments.length;++r)l[r]=arguments[r];return q$(l)}throw TypeError("Cannot call a class as a function")}if(e.prototype={addEventListener(l,r,M){if(r==null)return;if(typeof r!=="function"&&!u(r))throw TypeError("'listener' should be a function or an object.");let Y=y(this),H=u(M),T=(H?Boolean(M.capture):Boolean(M))?I:D,W={listener:r,listenerType:T,passive:H&&Boolean(M.passive),once:H&&Boolean(M.once),next:null},Z=Y.get(l);if(Z===void 0){Y.set(l,W);return}let S=null;while(Z!=null){if(Z.listener===r&&Z.listenerType===T)return;S=Z,Z=Z.next}S.next=W},removeEventListener(l,r,M){if(r==null)return;let Y=y(this),H=(u(M)?Boolean(M.capture):Boolean(M))?I:D,T=null,W=Y.get(l);while(W!=null){if(W.listener===r&&W.listenerType===H){if(T!==null)T.next=W.next;else if(W.next!==null)Y.set(l,W.next);else Y.delete(l);return}T=W,W=W.next}},dispatchEvent(l){if(l==null||typeof l.type!=="string")throw TypeError('"event.type" should be a string.');let r=y(this),M=l.type,Y=r.get(M);if(Y==null)return!0;let H=f(this,l),T=null;while(Y!=null){if(Y.once)if(T!==null)T.next=Y.next;else if(Y.next!==null)r.set(M,Y.next);else r.delete(M);else T=Y;if(E(H,Y.passive?Y.listener:null),typeof Y.listener==="function")try{Y.listener.call(this,H)}catch(W){if(typeof console<"u"&&typeof console.error==="function")console.error(W)}else if(Y.listenerType!==b&&typeof Y.listener.handleEvent==="function")Y.listener.handleEvent(H);if(A(H))break;Y=Y.next}return E(H,null),V(H,0),C(H,null),!H.defaultPrevented}},Object.defineProperty(e.prototype,"constructor",{value:e,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(e.prototype,window.EventTarget.prototype);$.defineEventAttribute=m,$.EventTarget=e,$.default=e,q.exports=e,q.exports.EventTarget=q.exports.default=e,q.exports.defineEventAttribute=m}),p7=k6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var K=td();class P extends K.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let G=j.get(this);if(typeof G!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return G}}K.defineEventAttribute(P.prototype,"abort");function _(){let G=Object.create(P.prototype);return K.EventTarget.call(G),j.set(G,!1),G}function O(G){if(j.get(G)!==!1)return;j.set(G,!0),G.dispatchEvent({type:"abort"})}var j=new WeakMap;if(Object.defineProperties(P.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(P.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class z{constructor(){J.set(this,_())}get signal(){return w(this)}abort(){O(w(this))}}var J=new WeakMap;function w(G){let f=J.get(G);if(f==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${G===null?"null":typeof G}`);return f}if(Object.defineProperties(z.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(z.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});$.AbortController=z,$.AbortSignal=P,$.default=z,q.exports=z,q.exports.AbortController=q.exports.default=z,q.exports.AbortSignal=P}),nq=k6(($,q)=>{var K=(Oq(),w6(jq)),{format:P,inspect:_}=DS(),{codes:{ERR_INVALID_ARG_TYPE:O}}=bq(),{kResistStopPropagation:j,AggregateError:z,SymbolDispose:J}=I6(),w=globalThis.AbortSignal||p7().AbortSignal,G=globalThis.AbortController||p7().AbortController,f=Object.getPrototypeOf(async function(){}).constructor,A=globalThis.Blob||K.Blob,V=typeof A<"u"?function(I){return I instanceof A}:function(I){return!1},C=(R,I)=>{if(R!==void 0&&(R===null||typeof R!=="object"||!("aborted"in R)))throw new O(I,"AbortSignal",R)},E=(R,I)=>{if(typeof R!=="function")throw new O(I,"Function",R)};q.exports={AggregateError:z,kEmptyObject:Object.freeze({}),once(R){let I=!1;return function(...D){if(I)return;I=!0,R.apply(this,D)}},createDeferredPromise:function(){let R,I;return{promise:new Promise((D,b)=>{R=D,I=b}),resolve:R,reject:I}},promisify(R){return new Promise((I,D)=>{R((b,...u)=>{if(b)return D(b);return I(...u)})})},debuglog(){return function(){}},format:P,inspect:_,types:{isAsyncFunction(R){return R instanceof f},isArrayBufferView(R){return ArrayBuffer.isView(R)}},isBlob:V,deprecate(R,I){return R},addAbortListener:(y7(),w6(u7)).addAbortListener||function(I,D){if(I===void 0)throw new O("signal","AbortSignal",I);C(I,"signal"),E(D,"listener");let b;if(I.aborted)queueMicrotask(()=>D());else I.addEventListener("abort",D,{__proto__:null,once:!0,[j]:!0}),b=()=>{I.removeEventListener("abort",D)};return{__proto__:null,[J](){var u;(u=b)===null||u===void 0||u()}}},AbortSignalAny:w.any||function(I){if(I.length===1)return I[0];let D=new G,b=()=>D.abort();return I.forEach((u)=>{C(u,"signals"),u.addEventListener("abort",b,{once:!0})}),D.signal.addEventListener("abort",()=>{I.forEach((u)=>u.removeEventListener("abort",b))},{once:!0}),D.signal}},q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),x7=k6(($,q)=>{var{ArrayIsArray:K,ArrayPrototypeIncludes:P,ArrayPrototypeJoin:_,ArrayPrototypeMap:O,NumberIsInteger:j,NumberIsNaN:z,NumberMAX_SAFE_INTEGER:J,NumberMIN_SAFE_INTEGER:w,NumberParseInt:G,ObjectPrototypeHasOwnProperty:f,RegExpPrototypeExec:A,String:V,StringPrototypeToUpperCase:C,StringPrototypeTrim:E}=I6(),{hideStackFrames:R,codes:{ERR_SOCKET_BAD_PORT:I,ERR_INVALID_ARG_TYPE:D,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:u,ERR_UNKNOWN_SIGNAL:y}}=bq(),{normalizeEncoding:c}=nq(),{isAsyncFunction:m,isArrayBufferView:q$}=nq().types,e={};function l(Q){return Q===(Q|0)}function r(Q){return Q===Q>>>0}var M=/^[0-7]+$/,Y="must be a 32-bit unsigned integer or an octal string";function H(Q,U,_$){if(typeof Q>"u")Q=_$;if(typeof Q==="string"){if(A(M,Q)===null)throw new b(U,Q,Y);Q=G(Q,8)}return Z(Q,U),Q}var T=R((Q,U,_$=w,X$=J)=>{if(typeof Q!=="number")throw new D(U,"number",Q);if(!j(Q))throw new u(U,"an integer",Q);if(Q<_$||Q>X$)throw new u(U,`>= ${_$} && <= ${X$}`,Q)}),W=R((Q,U,_$=-2147483648,X$=2147483647)=>{if(typeof Q!=="number")throw new D(U,"number",Q);if(!j(Q))throw new u(U,"an integer",Q);if(Q<_$||Q>X$)throw new u(U,`>= ${_$} && <= ${X$}`,Q)}),Z=R((Q,U,_$=!1)=>{if(typeof Q!=="number")throw new D(U,"number",Q);if(!j(Q))throw new u(U,"an integer",Q);let X$=_$?1:0,O$=4294967295;if(Q<X$||Q>O$)throw new u(U,`>= ${X$} && <= ${O$}`,Q)});function S(Q,U){if(typeof Q!=="string")throw new D(U,"string",Q)}function N(Q,U,_$=void 0,X$){if(typeof Q!=="number")throw new D(U,"number",Q);if(_$!=null&&Q<_$||X$!=null&&Q>X$||(_$!=null||X$!=null)&&z(Q))throw new u(U,`${_$!=null?`>= ${_$}`:""}${_$!=null&&X$!=null?" && ":""}${X$!=null?`<= ${X$}`:""}`,Q)}var X=R((Q,U,_$)=>{if(!P(_$,Q)){let X$="must be one of: "+_(O(_$,(O$)=>typeof O$==="string"?`'${O$}'`:V(O$)),", ");throw new b(U,Q,X$)}});function v(Q,U){if(typeof Q!=="boolean")throw new D(U,"boolean",Q)}function k(Q,U,_$){return Q==null||!f(Q,U)?_$:Q[U]}var g=R((Q,U,_$=null)=>{let X$=k(_$,"allowArray",!1),O$=k(_$,"allowFunction",!1);if(!k(_$,"nullable",!1)&&Q===null||!X$&&K(Q)||typeof Q!=="object"&&(!O$||typeof Q!=="function"))throw new D(U,"Object",Q)}),h=R((Q,U)=>{if(Q!=null&&typeof Q!=="object"&&typeof Q!=="function")throw new D(U,"a dictionary",Q)}),L=R((Q,U,_$=0)=>{if(!K(Q))throw new D(U,"Array",Q);if(Q.length<_$){let X$=`must be longer than ${_$}`;throw new b(U,Q,X$)}});function d(Q,U){L(Q,U);for(let _$=0;_$<Q.length;_$++)S(Q[_$],`${U}[${_$}]`)}function i(Q,U){L(Q,U);for(let _$=0;_$<Q.length;_$++)v(Q[_$],`${U}[${_$}]`)}function F(Q,U){L(Q,U);for(let _$=0;_$<Q.length;_$++){let X$=Q[_$],O$=`${U}[${_$}]`;if(X$==null)throw new D(O$,"AbortSignal",X$);Y$(X$,O$)}}function W$(Q,U="signal"){if(S(Q,U),e[Q]===void 0){if(e[C(Q)]!==void 0)throw new y(Q+" (signals must use all capital letters)");throw new y(Q)}}var n=R((Q,U="buffer")=>{if(!q$(Q))throw new D(U,["Buffer","TypedArray","DataView"],Q)});function t(Q,U){let _$=c(U),X$=Q.length;if(_$==="hex"&&X$%2!==0)throw new b("encoding",U,`is invalid for data of length ${X$}`)}function y$(Q,U="Port",_$=!0){if(typeof Q!=="number"&&typeof Q!=="string"||typeof Q==="string"&&E(Q).length===0||+Q!==+Q>>>0||Q>65535||Q===0&&!_$)throw new I(U,Q,_$);return Q|0}var Y$=R((Q,U)=>{if(Q!==void 0&&(Q===null||typeof Q!=="object"||!("aborted"in Q)))throw new D(U,"AbortSignal",Q)}),v$=R((Q,U)=>{if(typeof Q!=="function")throw new D(U,"Function",Q)}),a=R((Q,U)=>{if(typeof Q!=="function"||m(Q))throw new D(U,"Function",Q)}),o=R((Q,U)=>{if(Q!==void 0)throw new D(U,"undefined",Q)});function B(Q,U,_$){if(!P(_$,Q))throw new D(U,`('${_(_$,"|")}')`,Q)}var p$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function $$(Q,U){if(typeof Q>"u"||!A(p$,Q))throw new b(U,Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function s(Q){if(typeof Q==="string")return $$(Q,"hints"),Q;else if(K(Q)){let U=Q.length,_$="";if(U===0)return _$;for(let X$=0;X$<U;X$++){let O$=Q[X$];if($$(O$,"hints"),_$+=O$,X$!==U-1)_$+=", "}return _$}throw new b("hints",Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}q.exports={isInt32:l,isUint32:r,parseFileMode:H,validateArray:L,validateStringArray:d,validateBooleanArray:i,validateAbortSignalArray:F,validateBoolean:v,validateBuffer:n,validateDictionary:h,validateEncoding:t,validateFunction:v$,validateInt32:W,validateInteger:T,validateNumber:N,validateObject:g,validateOneOf:X,validatePlainFunction:a,validatePort:y$,validateSignalName:W$,validateString:S,validateUint32:Z,validateUndefined:o,validateUnion:B,validateAbortSignal:Y$,validateLinkHeaderValue:s}}),M_=k6(($,q)=>{q.exports=globalThis.process}),XK=k6(($,q)=>{var{SymbolAsyncIterator:K,SymbolIterator:P,SymbolFor:_}=I6(),O=_("nodejs.stream.destroyed"),j=_("nodejs.stream.errored"),z=_("nodejs.stream.readable"),J=_("nodejs.stream.writable"),w=_("nodejs.stream.disturbed"),G=_("nodejs.webstream.isClosedPromise"),f=_("nodejs.webstream.controllerErrorFunction");function A(k,g=!1){var h;return!!(k&&typeof k.pipe==="function"&&typeof k.on==="function"&&(!g||typeof k.pause==="function"&&typeof k.resume==="function")&&(!k._writableState||((h=k._readableState)===null||h===void 0?void 0:h.readable)!==!1)&&(!k._writableState||k._readableState))}function V(k){var g;return!!(k&&typeof k.write==="function"&&typeof k.on==="function"&&(!k._readableState||((g=k._writableState)===null||g===void 0?void 0:g.writable)!==!1))}function C(k){return!!(k&&typeof k.pipe==="function"&&k._readableState&&typeof k.on==="function"&&typeof k.write==="function")}function E(k){return k&&(k._readableState||k._writableState||typeof k.write==="function"&&typeof k.on==="function"||typeof k.pipe==="function"&&typeof k.on==="function")}function R(k){return!!(k&&!E(k)&&typeof k.pipeThrough==="function"&&typeof k.getReader==="function"&&typeof k.cancel==="function")}function I(k){return!!(k&&!E(k)&&typeof k.getWriter==="function"&&typeof k.abort==="function")}function D(k){return!!(k&&!E(k)&&typeof k.readable==="object"&&typeof k.writable==="object")}function b(k){return R(k)||I(k)||D(k)}function u(k,g){if(k==null)return!1;if(g===!0)return typeof k[K]==="function";if(g===!1)return typeof k[P]==="function";return typeof k[K]==="function"||typeof k[P]==="function"}function y(k){if(!E(k))return null;let{_writableState:g,_readableState:h}=k,L=g||h;return!!(k.destroyed||k[O]||L!==null&&L!==void 0&&L.destroyed)}function c(k){if(!V(k))return null;if(k.writableEnded===!0)return!0;let g=k._writableState;if(g!==null&&g!==void 0&&g.errored)return!1;if(typeof(g===null||g===void 0?void 0:g.ended)!=="boolean")return null;return g.ended}function m(k,g){if(!V(k))return null;if(k.writableFinished===!0)return!0;let h=k._writableState;if(h!==null&&h!==void 0&&h.errored)return!1;if(typeof(h===null||h===void 0?void 0:h.finished)!=="boolean")return null;return!!(h.finished||g===!1&&h.ended===!0&&h.length===0)}function q$(k){if(!A(k))return null;if(k.readableEnded===!0)return!0;let g=k._readableState;if(!g||g.errored)return!1;if(typeof(g===null||g===void 0?void 0:g.ended)!=="boolean")return null;return g.ended}function e(k,g){if(!A(k))return null;let h=k._readableState;if(h!==null&&h!==void 0&&h.errored)return!1;if(typeof(h===null||h===void 0?void 0:h.endEmitted)!=="boolean")return null;return!!(h.endEmitted||g===!1&&h.ended===!0&&h.length===0)}function l(k){if(k&&k[z]!=null)return k[z];if(typeof(k===null||k===void 0?void 0:k.readable)!=="boolean")return null;if(y(k))return!1;return A(k)&&k.readable&&!e(k)}function r(k){if(k&&k[J]!=null)return k[J];if(typeof(k===null||k===void 0?void 0:k.writable)!=="boolean")return null;if(y(k))return!1;return V(k)&&k.writable&&!c(k)}function M(k,g){if(!E(k))return null;if(y(k))return!0;if((g===null||g===void 0?void 0:g.readable)!==!1&&l(k))return!1;if((g===null||g===void 0?void 0:g.writable)!==!1&&r(k))return!1;return!0}function Y(k){var g,h;if(!E(k))return null;if(k.writableErrored)return k.writableErrored;return(g=(h=k._writableState)===null||h===void 0?void 0:h.errored)!==null&&g!==void 0?g:null}function H(k){var g,h;if(!E(k))return null;if(k.readableErrored)return k.readableErrored;return(g=(h=k._readableState)===null||h===void 0?void 0:h.errored)!==null&&g!==void 0?g:null}function T(k){if(!E(k))return null;if(typeof k.closed==="boolean")return k.closed;let{_writableState:g,_readableState:h}=k;if(typeof(g===null||g===void 0?void 0:g.closed)==="boolean"||typeof(h===null||h===void 0?void 0:h.closed)==="boolean")return(g===null||g===void 0?void 0:g.closed)||(h===null||h===void 0?void 0:h.closed);if(typeof k._closed==="boolean"&&W(k))return k._closed;return null}function W(k){return typeof k._closed==="boolean"&&typeof k._defaultKeepAlive==="boolean"&&typeof k._removedConnection==="boolean"&&typeof k._removedContLen==="boolean"}function Z(k){return typeof k._sent100==="boolean"&&W(k)}function S(k){var g;return typeof k._consuming==="boolean"&&typeof k._dumped==="boolean"&&((g=k.req)===null||g===void 0?void 0:g.upgradeOrConnect)===void 0}function N(k){if(!E(k))return null;let{_writableState:g,_readableState:h}=k,L=g||h;return!L&&Z(k)||!!(L&&L.autoDestroy&&L.emitClose&&L.closed===!1)}function X(k){var g;return!!(k&&((g=k[w])!==null&&g!==void 0?g:k.readableDidRead||k.readableAborted))}function v(k){var g,h,L,d,i,F,W$,n,t,y$;return!!(k&&((g=(h=(L=(d=(i=(F=k[j])!==null&&F!==void 0?F:k.readableErrored)!==null&&i!==void 0?i:k.writableErrored)!==null&&d!==void 0?d:(W$=k._readableState)===null||W$===void 0?void 0:W$.errorEmitted)!==null&&L!==void 0?L:(n=k._writableState)===null||n===void 0?void 0:n.errorEmitted)!==null&&h!==void 0?h:(t=k._readableState)===null||t===void 0?void 0:t.errored)!==null&&g!==void 0?g:(y$=k._writableState)===null||y$===void 0?void 0:y$.errored))}q.exports={isDestroyed:y,kIsDestroyed:O,isDisturbed:X,kIsDisturbed:w,isErrored:v,kIsErrored:j,isReadable:l,kIsReadable:z,kIsClosedPromise:G,kControllerErrorFunction:f,kIsWritable:J,isClosed:T,isDuplexNodeStream:C,isFinished:M,isIterable:u,isReadableNodeStream:A,isReadableStream:R,isReadableEnded:q$,isReadableFinished:e,isReadableErrored:H,isNodeStream:E,isWebStream:b,isWritable:r,isWritableNodeStream:V,isWritableStream:I,isWritableEnded:c,isWritableFinished:m,isWritableErrored:Y,isServerRequest:S,isServerResponse:Z,willEmitClose:N,isTransformStream:D}}),dK=k6(($,q)=>{var K=M_(),{AbortError:P,codes:_}=bq(),{ERR_INVALID_ARG_TYPE:O,ERR_STREAM_PREMATURE_CLOSE:j}=_,{kEmptyObject:z,once:J}=nq(),{validateAbortSignal:w,validateFunction:G,validateObject:f,validateBoolean:A}=x7(),{Promise:V,PromisePrototypeThen:C,SymbolDispose:E}=I6(),{isClosed:R,isReadable:I,isReadableNodeStream:D,isReadableStream:b,isReadableFinished:u,isReadableErrored:y,isWritable:c,isWritableNodeStream:m,isWritableStream:q$,isWritableFinished:e,isWritableErrored:l,isNodeStream:r,willEmitClose:M,kIsClosedPromise:Y}=XK(),H;function T(X){return X.setHeader&&typeof X.abort==="function"}var W=()=>{};function Z(X,v,k){var g,h;if(arguments.length===2)k=v,v=z;else if(v==null)v=z;else f(v,"options");if(G(k,"callback"),w(v.signal,"options.signal"),k=J(k),b(X)||q$(X))return S(X,v,k);if(!r(X))throw new O("stream",["ReadableStream","WritableStream","Stream"],X);let L=(g=v.readable)!==null&&g!==void 0?g:D(X),d=(h=v.writable)!==null&&h!==void 0?h:m(X),i=X._writableState,F=X._readableState,W$=()=>{if(!X.writable)y$()},n=M(X)&&D(X)===L&&m(X)===d,t=e(X,!1),y$=()=>{if(t=!0,X.destroyed)n=!1;if(n&&(!X.readable||L))return;if(!L||Y$)k.call(X)},Y$=u(X,!1),v$=()=>{if(Y$=!0,X.destroyed)n=!1;if(n&&(!X.writable||d))return;if(!d||t)k.call(X)},a=(Q)=>{k.call(X,Q)},o=R(X),B=()=>{o=!0;let Q=l(X)||y(X);if(Q&&typeof Q!=="boolean")return k.call(X,Q);if(L&&!Y$&&D(X,!0)){if(!u(X,!1))return k.call(X,new j)}if(d&&!t){if(!e(X,!1))return k.call(X,new j)}k.call(X)},p$=()=>{o=!0;let Q=l(X)||y(X);if(Q&&typeof Q!=="boolean")return k.call(X,Q);k.call(X)},$$=()=>{X.req.on("finish",y$)};if(T(X)){if(X.on("complete",y$),!n)X.on("abort",B);if(X.req)$$();else X.on("request",$$)}else if(d&&!i)X.on("end",W$),X.on("close",W$);if(!n&&typeof X.aborted==="boolean")X.on("aborted",B);if(X.on("end",v$),X.on("finish",y$),v.error!==!1)X.on("error",a);if(X.on("close",B),o)K.nextTick(B);else if(i!==null&&i!==void 0&&i.errorEmitted||F!==null&&F!==void 0&&F.errorEmitted){if(!n)K.nextTick(p$)}else if(!L&&(!n||I(X))&&(t||c(X)===!1))K.nextTick(p$);else if(!d&&(!n||c(X))&&(Y$||I(X)===!1))K.nextTick(p$);else if(F&&X.req&&X.aborted)K.nextTick(p$);let s=()=>{if(k=W,X.removeListener("aborted",B),X.removeListener("complete",y$),X.removeListener("abort",B),X.removeListener("request",$$),X.req)X.req.removeListener("finish",y$);X.removeListener("end",W$),X.removeListener("close",W$),X.removeListener("finish",y$),X.removeListener("end",v$),X.removeListener("error",a),X.removeListener("close",B)};if(v.signal&&!o){let Q=()=>{let U=k;s(),U.call(X,new P(void 0,{cause:v.signal.reason}))};if(v.signal.aborted)K.nextTick(Q);else{H=H||nq().addAbortListener;let U=H(v.signal,Q),_$=k;k=J((...X$)=>{U[E](),_$.apply(X,X$)})}}return s}function S(X,v,k){let g=!1,h=W;if(v.signal)if(h=()=>{g=!0,k.call(X,new P(void 0,{cause:v.signal.reason}))},v.signal.aborted)K.nextTick(h);else{H=H||nq().addAbortListener;let d=H(v.signal,h),i=k;k=J((...F)=>{d[E](),i.apply(X,F)})}let L=(...d)=>{if(!g)K.nextTick(()=>k.apply(X,d))};return C(X[Y].promise,L,L),W}function N(X,v){var k;let g=!1;if(v===null)v=z;if((k=v)!==null&&k!==void 0&&k.cleanup)A(v.cleanup,"cleanup"),g=v.cleanup;return new V((h,L)=>{let d=Z(X,v,(i)=>{if(g)d();if(i)L(i);else h()})})}q.exports=Z,q.exports.finished=N}),m4=k6(($,q)=>{var K=M_(),{aggregateTwoErrors:P,codes:{ERR_MULTIPLE_CALLBACK:_},AbortError:O}=bq(),{Symbol:j}=I6(),{kIsDestroyed:z,isDestroyed:J,isFinished:w,isServerRequest:G}=XK(),f=j("kDestroy"),A=j("kConstruct");function V(M,Y,H){if(M){if(M.stack,Y&&!Y.errored)Y.errored=M;if(H&&!H.errored)H.errored=M}}function C(M,Y){let H=this._readableState,T=this._writableState,W=T||H;if(T!==null&&T!==void 0&&T.destroyed||H!==null&&H!==void 0&&H.destroyed){if(typeof Y==="function")Y();return this}if(V(M,T,H),T)T.destroyed=!0;if(H)H.destroyed=!0;if(!W.constructed)this.once(f,function(Z){E(this,P(Z,M),Y)});else E(this,M,Y);return this}function E(M,Y,H){let T=!1;function W(Z){if(T)return;T=!0;let{_readableState:S,_writableState:N}=M;if(V(Z,N,S),N)N.closed=!0;if(S)S.closed=!0;if(typeof H==="function")H(Z);if(Z)K.nextTick(R,M,Z);else K.nextTick(I,M)}try{M._destroy(Y||null,W)}catch(Z){W(Z)}}function R(M,Y){D(M,Y),I(M)}function I(M){let{_readableState:Y,_writableState:H}=M;if(H)H.closeEmitted=!0;if(Y)Y.closeEmitted=!0;if(H!==null&&H!==void 0&&H.emitClose||Y!==null&&Y!==void 0&&Y.emitClose)M.emit("close")}function D(M,Y){let{_readableState:H,_writableState:T}=M;if(T!==null&&T!==void 0&&T.errorEmitted||H!==null&&H!==void 0&&H.errorEmitted)return;if(T)T.errorEmitted=!0;if(H)H.errorEmitted=!0;M.emit("error",Y)}function b(){let M=this._readableState,Y=this._writableState;if(M)M.constructed=!0,M.closed=!1,M.closeEmitted=!1,M.destroyed=!1,M.errored=null,M.errorEmitted=!1,M.reading=!1,M.ended=M.readable===!1,M.endEmitted=M.readable===!1;if(Y)Y.constructed=!0,Y.destroyed=!1,Y.closed=!1,Y.closeEmitted=!1,Y.errored=null,Y.errorEmitted=!1,Y.finalCalled=!1,Y.prefinished=!1,Y.ended=Y.writable===!1,Y.ending=Y.writable===!1,Y.finished=Y.writable===!1}function u(M,Y,H){let{_readableState:T,_writableState:W}=M;if(W!==null&&W!==void 0&&W.destroyed||T!==null&&T!==void 0&&T.destroyed)return this;if(T!==null&&T!==void 0&&T.autoDestroy||W!==null&&W!==void 0&&W.autoDestroy)M.destroy(Y);else if(Y){if(Y.stack,W&&!W.errored)W.errored=Y;if(T&&!T.errored)T.errored=Y;if(H)K.nextTick(D,M,Y);else D(M,Y)}}function y(M,Y){if(typeof M._construct!=="function")return;let{_readableState:H,_writableState:T}=M;if(H)H.constructed=!1;if(T)T.constructed=!1;if(M.once(A,Y),M.listenerCount(A)>1)return;K.nextTick(c,M)}function c(M){let Y=!1;function H(T){if(Y){u(M,T!==null&&T!==void 0?T:new _);return}Y=!0;let{_readableState:W,_writableState:Z}=M,S=Z||W;if(W)W.constructed=!0;if(Z)Z.constructed=!0;if(S.destroyed)M.emit(f,T);else if(T)u(M,T,!0);else K.nextTick(m,M)}try{M._construct((T)=>{K.nextTick(H,T)})}catch(T){K.nextTick(H,T)}}function m(M){M.emit(A)}function q$(M){return(M===null||M===void 0?void 0:M.setHeader)&&typeof M.abort==="function"}function e(M){M.emit("close")}function l(M,Y){M.emit("error",Y),K.nextTick(e,M)}function r(M,Y){if(!M||J(M))return;if(!Y&&!w(M))Y=new O;if(G(M))M.socket=null,M.destroy(Y);else if(q$(M))M.abort();else if(q$(M.req))M.req.abort();else if(typeof M.destroy==="function")M.destroy(Y);else if(typeof M.close==="function")M.close();else if(Y)K.nextTick(l,M,Y);else K.nextTick(e,M);if(!M.destroyed)M[z]=!0}q.exports={construct:y,destroyer:r,destroy:C,undestroy:b,errorOrDestroy:u}}),TH=k6(($,q)=>{var{ArrayIsArray:K,ObjectSetPrototypeOf:P}=I6(),{EventEmitter:_}=(y7(),w6(u7));function O(z){_.call(this,z)}P(O.prototype,_.prototype),P(O,_),O.prototype.pipe=function(z,J){let w=this;function G(I){if(z.writable&&z.write(I)===!1&&w.pause)w.pause()}w.on("data",G);function f(){if(w.readable&&w.resume)w.resume()}if(z.on("drain",f),!z._isStdio&&(!J||J.end!==!1))w.on("end",V),w.on("close",C);let A=!1;function V(){if(A)return;A=!0,z.end()}function C(){if(A)return;if(A=!0,typeof z.destroy==="function")z.destroy()}function E(I){if(R(),_.listenerCount(this,"error")===0)this.emit("error",I)}j(w,"error",E),j(z,"error",E);function R(){w.removeListener("data",G),z.removeListener("drain",f),w.removeListener("end",V),w.removeListener("close",C),w.removeListener("error",E),z.removeListener("error",E),w.removeListener("end",R),w.removeListener("close",R),z.removeListener("close",R)}return w.on("end",R),w.on("close",R),z.on("close",R),z.emit("pipe",w),z};function j(z,J,w){if(typeof z.prependListener==="function")return z.prependListener(J,w);if(!z._events||!z._events[J])z.on(J,w);else if(K(z._events[J]))z._events[J].unshift(w);else z._events[J]=[w,z._events[J]]}q.exports={Stream:O,prependListener:j}}),ij=k6(($,q)=>{var{SymbolDispose:K}=I6(),{AbortError:P,codes:_}=bq(),{isNodeStream:O,isWebStream:j,kControllerErrorFunction:z}=XK(),J=dK(),{ERR_INVALID_ARG_TYPE:w}=_,G,f=(A,V)=>{if(typeof A!=="object"||!("aborted"in A))throw new w(V,"AbortSignal",A)};q.exports.addAbortSignal=function(V,C){if(f(V,"signal"),!O(C)&&!j(C))throw new w("stream",["ReadableStream","WritableStream","Stream"],C);return q.exports.addAbortSignalNoValidate(V,C)},q.exports.addAbortSignalNoValidate=function(A,V){if(typeof A!=="object"||!("aborted"in A))return V;let C=O(V)?()=>{V.destroy(new P(void 0,{cause:A.reason}))}:()=>{V[z](new P(void 0,{cause:A.reason}))};if(A.aborted)C();else{G=G||nq().addAbortListener;let E=G(A,C);J(V,E[K])}return V}}),Bd=k6(($,q)=>{var{StringPrototypeSlice:K,SymbolIterator:P,TypedArrayPrototypeSet:_,Uint8Array:O}=I6(),{Buffer:j}=(Oq(),w6(jq)),{inspect:z}=nq();q.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(w){let G={data:w,next:null};if(this.length>0)this.tail.next=G;else this.head=G;this.tail=G,++this.length}unshift(w){let G={data:w,next:this.head};if(this.length===0)this.tail=G;this.head=G,++this.length}shift(){if(this.length===0)return;let w=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,w}clear(){this.head=this.tail=null,this.length=0}join(w){if(this.length===0)return"";let G=this.head,f=""+G.data;while((G=G.next)!==null)f+=w+G.data;return f}concat(w){if(this.length===0)return j.alloc(0);let G=j.allocUnsafe(w>>>0),f=this.head,A=0;while(f)_(G,f.data,A),A+=f.data.length,f=f.next;return G}consume(w,G){let f=this.head.data;if(w<f.length){let A=f.slice(0,w);return this.head.data=f.slice(w),A}if(w===f.length)return this.shift();return G?this._getString(w):this._getBuffer(w)}first(){return this.head.data}*[P](){for(let w=this.head;w;w=w.next)yield w.data}_getString(w){let G="",f=this.head,A=0;do{let V=f.data;if(w>V.length)G+=V,w-=V.length;else{if(w===V.length)if(G+=V,++A,f.next)this.head=f.next;else this.head=this.tail=null;else G+=K(V,0,w),this.head=f,f.data=K(V,w);break}++A}while((f=f.next)!==null);return this.length-=A,G}_getBuffer(w){let G=j.allocUnsafe(w),f=w,A=this.head,V=0;do{let C=A.data;if(w>C.length)_(G,C,f-w),w-=C.length;else{if(w===C.length)if(_(G,C,f-w),++V,A.next)this.head=A.next;else this.head=this.tail=null;else _(G,new O(C.buffer,C.byteOffset,w),f-w),this.head=A,A.data=C.slice(w);break}++V}while((A=A.next)!==null);return this.length-=V,G}[Symbol.for("nodejs.util.inspect.custom")](w,G){return z(this,{...G,depth:0,customInspect:!1})}}}),tj=k6(($,q)=>{var{MathFloor:K,NumberIsInteger:P}=I6(),{validateInteger:_}=x7(),{ERR_INVALID_ARG_VALUE:O}=bq().codes,j=16384,z=16;function J(A,V,C){return A.highWaterMark!=null?A.highWaterMark:V?A[C]:null}function w(A){return A?z:j}function G(A,V){if(_(V,"value",0),A)z=V;else j=V}function f(A,V,C,E){let R=J(V,E,C);if(R!=null){if(!P(R)||R<0){let I=E?`options.${C}`:"options.highWaterMark";throw new O(I,R)}return K(R)}return w(A.objectMode)}q.exports={getHighWaterMark:f,getDefaultHighWaterMark:w,setDefaultHighWaterMark:G}}),Ud=k6(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var K=(Oq(),w6(jq)),P=K.Buffer;function _(j,z){for(var J in j)z[J]=j[J]}if(P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow)q.exports=K;else _(K,$),$.Buffer=O;function O(j,z,J){return P(j,z,J)}O.prototype=Object.create(P.prototype),_(P,O),O.from=function(j,z,J){if(typeof j==="number")throw TypeError("Argument must not be a number");return P(j,z,J)},O.alloc=function(j,z,J){if(typeof j!=="number")throw TypeError("Argument must be a number");var w=P(j);if(z!==void 0)if(typeof J==="string")w.fill(z,J);else w.fill(z);else w.fill(0);return w},O.allocUnsafe=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return P(j)},O.allocUnsafeSlow=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return K.SlowBuffer(j)}}),Fd=k6(($)=>{var q=Ud().Buffer,K=q.isEncoding||function(D){switch(D=""+D,D&&D.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function P(D){if(!D)return"utf8";var b;while(!0)switch(D){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return D;default:if(b)return;D=(""+D).toLowerCase(),b=!0}}function _(D){var b=P(D);if(typeof b!=="string"&&(q.isEncoding===K||!K(D)))throw Error("Unknown encoding: "+D);return b||D}$.StringDecoder=O;function O(D){this.encoding=_(D);var b;switch(this.encoding){case"utf16le":this.text=A,this.end=V,b=4;break;case"utf8":this.fillLast=w,b=4;break;case"base64":this.text=C,this.end=E,b=3;break;default:this.write=R,this.end=I;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(b)}O.prototype.write=function(D){if(D.length===0)return"";var b,u;if(this.lastNeed){if(b=this.fillLast(D),b===void 0)return"";u=this.lastNeed,this.lastNeed=0}else u=0;if(u<D.length)return b?b+this.text(D,u):this.text(D,u);return b||""},O.prototype.end=f,O.prototype.text=G,O.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length};function j(D){if(D<=127)return 0;else if(D>>5===6)return 2;else if(D>>4===14)return 3;else if(D>>3===30)return 4;return D>>6===2?-1:-2}function z(D,b,u){var y=b.length-1;if(y<u)return 0;var c=j(b[y]);if(c>=0){if(c>0)D.lastNeed=c-1;return c}if(--y<u||c===-2)return 0;if(c=j(b[y]),c>=0){if(c>0)D.lastNeed=c-2;return c}if(--y<u||c===-2)return 0;if(c=j(b[y]),c>=0){if(c>0)if(c===2)c=0;else D.lastNeed=c-3;return c}return 0}function J(D,b,u){if((b[0]&192)!==128)return D.lastNeed=0,"�";if(D.lastNeed>1&&b.length>1){if((b[1]&192)!==128)return D.lastNeed=1,"�";if(D.lastNeed>2&&b.length>2){if((b[2]&192)!==128)return D.lastNeed=2,"�"}}}function w(D){var b=this.lastTotal-this.lastNeed,u=J(this,D,b);if(u!==void 0)return u;if(this.lastNeed<=D.length)return D.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,b,0,D.length),this.lastNeed-=D.length}function G(D,b){var u=z(this,D,b);if(!this.lastNeed)return D.toString("utf8",b);this.lastTotal=u;var y=D.length-(u-this.lastNeed);return D.copy(this.lastChar,0,y),D.toString("utf8",b,y)}function f(D){var b=D&&D.length?this.write(D):"";if(this.lastNeed)return b+"�";return b}function A(D,b){if((D.length-b)%2===0){var u=D.toString("utf16le",b);if(u){var y=u.charCodeAt(u.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],u.slice(0,-1)}return u}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",b,D.length-1)}function V(D){var b=D&&D.length?this.write(D):"";if(this.lastNeed){var u=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,u)}return b}function C(D,b){var u=(D.length-b)%3;if(u===0)return D.toString("base64",b);if(this.lastNeed=3-u,this.lastTotal=3,u===1)this.lastChar[0]=D[D.length-1];else this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1];return D.toString("base64",b,D.length-u)}function E(D){var b=D&&D.length?this.write(D):"";if(this.lastNeed)return b+this.lastChar.toString("base64",0,3-this.lastNeed);return b}function R(D){return D.toString(this.encoding)}function I(D){return D&&D.length?this.write(D):""}}),gS=k6(($,q)=>{var K=M_(),{PromisePrototypeThen:P,SymbolAsyncIterator:_,SymbolIterator:O}=I6(),{Buffer:j}=(Oq(),w6(jq)),{ERR_INVALID_ARG_TYPE:z,ERR_STREAM_NULL_VALUES:J}=bq().codes;function w(G,f,A){let V;if(typeof f==="string"||f instanceof j)return new G({objectMode:!0,...A,read(){this.push(f),this.push(null)}});let C;if(f&&f[_])C=!0,V=f[_]();else if(f&&f[O])C=!1,V=f[O]();else throw new z("iterable",["Iterable"],f);let E=new G({objectMode:!0,highWaterMark:1,...A}),R=!1;E._read=function(){if(!R)R=!0,D()},E._destroy=function(b,u){P(I(b),()=>K.nextTick(u,b),(y)=>K.nextTick(u,y||b))};async function I(b){let u=b!==void 0&&b!==null,y=typeof V.throw==="function";if(u&&y){let{value:c,done:m}=await V.throw(b);if(await c,m)return}if(typeof V.return==="function"){let{value:c}=await V.return();await c}}async function D(){for(;;){try{let{value:b,done:u}=C?await V.next():V.next();if(u)E.push(null);else{let y=b&&typeof b.then==="function"?await b:b;if(y===null)throw R=!1,new J;else if(E.push(y))continue;else R=!1}}catch(b){E.destroy(b)}break}}return E}q.exports=w}),Bj=k6(($,q)=>{var K=M_(),{ArrayPrototypeIndexOf:P,NumberIsInteger:_,NumberIsNaN:O,NumberParseInt:j,ObjectDefineProperties:z,ObjectKeys:J,ObjectSetPrototypeOf:w,Promise:G,SafeSet:f,SymbolAsyncDispose:A,SymbolAsyncIterator:V,Symbol:C}=I6();q.exports=X$,X$.ReadableState=_$;var{EventEmitter:E}=(y7(),w6(u7)),{Stream:R,prependListener:I}=TH(),{Buffer:D}=(Oq(),w6(jq)),{addAbortSignal:b}=ij(),u=dK(),y=nq().debuglog("stream",(p)=>{y=p}),c=Bd(),m=m4(),{getHighWaterMark:q$,getDefaultHighWaterMark:e}=tj(),{aggregateTwoErrors:l,codes:{ERR_INVALID_ARG_TYPE:r,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_OUT_OF_RANGE:Y,ERR_STREAM_PUSH_AFTER_EOF:H,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:T},AbortError:W}=bq(),{validateObject:Z}=x7(),S=C("kPaused"),{StringDecoder:N}=Fd(),X=gS();w(X$.prototype,R.prototype),w(X$,R);var v=()=>{},{errorOrDestroy:k}=m,g=1,h=2,L=4,d=8,i=16,F=32,W$=64,n=128,t=256,y$=512,Y$=1024,v$=2048,a=4096,o=8192,B=16384,p$=32768,$$=65536,s=131072,Q=262144;function U(p){return{enumerable:!1,get(){return(this.state&p)!==0},set(x){if(x)this.state|=p;else this.state&=~p}}}z(_$.prototype,{objectMode:U(g),ended:U(h),endEmitted:U(L),reading:U(d),constructed:U(i),sync:U(F),needReadable:U(W$),emittedReadable:U(n),readableListening:U(t),resumeScheduled:U(y$),errorEmitted:U(Y$),emitClose:U(v$),autoDestroy:U(a),destroyed:U(o),closed:U(B),closeEmitted:U(p$),multiAwaitDrain:U($$),readingMore:U(s),dataEmitted:U(Q)});function _$(p,x,x$){if(typeof x$!=="boolean")x$=x instanceof ZK();if(this.state=v$|a|i|F,p&&p.objectMode)this.state|=g;if(x$&&p&&p.readableObjectMode)this.state|=g;if(this.highWaterMark=p?q$(this,p,"readableHighWaterMark",x$):e(!1),this.buffer=new c,this.length=0,this.pipes=[],this.flowing=null,this[S]=null,p&&p.emitClose===!1)this.state&=~v$;if(p&&p.autoDestroy===!1)this.state&=~a;if(this.errored=null,this.defaultEncoding=p&&p.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,p&&p.encoding)this.decoder=new N(p.encoding),this.encoding=p.encoding}function X$(p){if(!(this instanceof X$))return new X$(p);let x=this instanceof ZK();if(this._readableState=new _$(p,this,x),p){if(typeof p.read==="function")this._read=p.read;if(typeof p.destroy==="function")this._destroy=p.destroy;if(typeof p.construct==="function")this._construct=p.construct;if(p.signal&&!x)b(p.signal,this)}R.call(this,p),m.construct(this,()=>{if(this._readableState.needReadable)b6(this,this._readableState)})}X$.prototype.destroy=m.destroy,X$.prototype._undestroy=m.undestroy,X$.prototype._destroy=function(p,x){x(p)},X$.prototype[E.captureRejectionSymbol]=function(p){this.destroy(p)},X$.prototype[A]=function(){let p;if(!this.destroyed)p=this.readableEnded?null:new W,this.destroy(p);return new G((x,x$)=>u(this,(K$)=>K$&&K$!==p?x$(K$):x(null)))},X$.prototype.push=function(p,x){return O$(this,p,x,!1)},X$.prototype.unshift=function(p,x){return O$(this,p,x,!0)};function O$(p,x,x$,K$){y("readableAddChunk",x);let j$=p._readableState,f6;if((j$.state&g)===0){if(typeof x==="string"){if(x$=x$||j$.defaultEncoding,j$.encoding!==x$)if(K$&&j$.encoding)x=D.from(x,x$).toString(j$.encoding);else x=D.from(x,x$),x$=""}else if(x instanceof D)x$="";else if(R._isUint8Array(x))x=R._uint8ArrayToBuffer(x),x$="";else if(x!=null)f6=new r("chunk",["string","Buffer","Uint8Array"],x)}if(f6)k(p,f6);else if(x===null)j$.state&=~d,X6(p,j$);else if((j$.state&g)!==0||x&&x.length>0)if(K$)if((j$.state&L)!==0)k(p,new T);else if(j$.destroyed||j$.errored)return!1;else T$(p,j$,x,!0);else if(j$.ended)k(p,new H);else if(j$.destroyed||j$.errored)return!1;else if(j$.state&=~d,j$.decoder&&!x$)if(x=j$.decoder.write(x),j$.objectMode||x.length!==0)T$(p,j$,x,!1);else b6(p,j$);else T$(p,j$,x,!1);else if(!K$)j$.state&=~d,b6(p,j$);return!j$.ended&&(j$.length<j$.highWaterMark||j$.length===0)}function T$(p,x,x$,K$){if(x.flowing&&x.length===0&&!x.sync&&p.listenerCount("data")>0){if((x.state&$$)!==0)x.awaitDrainWriters.clear();else x.awaitDrainWriters=null;x.dataEmitted=!0,p.emit("data",x$)}else{if(x.length+=x.objectMode?1:x$.length,K$)x.buffer.unshift(x$);else x.buffer.push(x$);if((x.state&W$)!==0)w$(p)}b6(p,x)}X$.prototype.isPaused=function(){let p=this._readableState;return p[S]===!0||p.flowing===!1},X$.prototype.setEncoding=function(p){let x=new N(p);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;let x$=this._readableState.buffer,K$="";for(let j$ of x$)K$+=x.write(j$);if(x$.clear(),K$!=="")x$.push(K$);return this._readableState.length=K$.length,this};var j6=1073741824;function H$(p){if(p>j6)throw new Y("size","<= 1GiB",p);else p--,p|=p>>>1,p|=p>>>2,p|=p>>>4,p|=p>>>8,p|=p>>>16,p++;return p}function f$(p,x){if(p<=0||x.length===0&&x.ended)return 0;if((x.state&g)!==0)return 1;if(O(p)){if(x.flowing&&x.length)return x.buffer.first().length;return x.length}if(p<=x.length)return p;return x.ended?x.length:0}X$.prototype.read=function(p){if(y("read",p),p===void 0)p=NaN;else if(!_(p))p=j(p,10);let x=this._readableState,x$=p;if(p>x.highWaterMark)x.highWaterMark=H$(p);if(p!==0)x.state&=~n;if(p===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended)){if(y("read: emitReadable",x.length,x.ended),x.length===0&&x.ended)V$(this);else w$(this);return null}if(p=f$(p,x),p===0&&x.ended){if(x.length===0)V$(this);return null}let K$=(x.state&W$)!==0;if(y("need readable",K$),x.length===0||x.length-p<x.highWaterMark)K$=!0,y("length less than watermark",K$);if(x.ended||x.reading||x.destroyed||x.errored||!x.constructed)K$=!1,y("reading, ended or constructing",K$);else if(K$){if(y("do read"),x.state|=d|F,x.length===0)x.state|=W$;try{this._read(x.highWaterMark)}catch(f6){k(this,f6)}if(x.state&=~F,!x.reading)p=f$(x$,x)}let j$;if(p>0)j$=h$(p,x);else j$=null;if(j$===null)x.needReadable=x.length<=x.highWaterMark,p=0;else if(x.length-=p,x.multiAwaitDrain)x.awaitDrainWriters.clear();else x.awaitDrainWriters=null;if(x.length===0){if(!x.ended)x.needReadable=!0;if(x$!==p&&x.ended)V$(this)}if(j$!==null&&!x.errorEmitted&&!x.closeEmitted)x.dataEmitted=!0,this.emit("data",j$);return j$};function X6(p,x){if(y("onEofChunk"),x.ended)return;if(x.decoder){let x$=x.decoder.end();if(x$&&x$.length)x.buffer.push(x$),x.length+=x.objectMode?1:x$.length}if(x.ended=!0,x.sync)w$(p);else x.needReadable=!1,x.emittedReadable=!0,G$(p)}function w$(p){let x=p._readableState;if(y("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,!x.emittedReadable)y("emitReadable",x.flowing),x.emittedReadable=!0,K.nextTick(G$,p)}function G$(p){let x=p._readableState;if(y("emitReadable_",x.destroyed,x.length,x.ended),!x.destroyed&&!x.errored&&(x.length||x.ended))p.emit("readable"),x.emittedReadable=!1;x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,C$(p)}function b6(p,x){if(!x.readingMore&&x.constructed)x.readingMore=!0,K.nextTick(k$,p,x)}function k$(p,x){while(!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0)){let x$=x.length;if(y("maybeReadMore read 0"),p.read(0),x$===x.length)break}x.readingMore=!1}X$.prototype._read=function(p){throw new M("_read()")},X$.prototype.pipe=function(p,x){let x$=this,K$=this._readableState;if(K$.pipes.length===1){if(!K$.multiAwaitDrain)K$.multiAwaitDrain=!0,K$.awaitDrainWriters=new f(K$.awaitDrainWriters?[K$.awaitDrainWriters]:[])}K$.pipes.push(p),y("pipe count=%d opts=%j",K$.pipes.length,x);let j$=(!x||x.end!==!1)&&p!==K.stdout&&p!==K.stderr?Z$:O6;if(K$.endEmitted)K.nextTick(j$);else x$.once("end",j$);p.on("unpipe",f6);function f6(K6,A6){if(y("onunpipe"),K6===x$){if(A6&&A6.hasUnpiped===!1)A6.hasUnpiped=!0,b$()}}function Z$(){y("onend"),p.end()}let A$,zq=!1;function b$(){if(y("cleanup"),p.removeListener("close",N$),p.removeListener("finish",D6),A$)p.removeListener("drain",A$);if(p.removeListener("error",M$),p.removeListener("unpipe",f6),x$.removeListener("end",Z$),x$.removeListener("end",O6),x$.removeListener("data",Wq),zq=!0,A$&&K$.awaitDrainWriters&&(!p._writableState||p._writableState.needDrain))A$()}function R$(){if(!zq){if(K$.pipes.length===1&&K$.pipes[0]===p)y("false write response, pause",0),K$.awaitDrainWriters=p,K$.multiAwaitDrain=!1;else if(K$.pipes.length>1&&K$.pipes.includes(p))y("false write response, pause",K$.awaitDrainWriters.size),K$.awaitDrainWriters.add(p);x$.pause()}if(!A$)A$=I$(x$,p),p.on("drain",A$)}x$.on("data",Wq);function Wq(K6){y("ondata");let A6=p.write(K6);if(y("dest.write",A6),A6===!1)R$()}function M$(K6){if(y("onerror",K6),O6(),p.removeListener("error",M$),p.listenerCount("error")===0){let A6=p._writableState||p._readableState;if(A6&&!A6.errorEmitted)k(p,K6);else p.emit("error",K6)}}I(p,"error",M$);function N$(){p.removeListener("finish",D6),O6()}p.once("close",N$);function D6(){y("onfinish"),p.removeListener("close",N$),O6()}p.once("finish",D6);function O6(){y("unpipe"),x$.unpipe(p)}if(p.emit("pipe",x$),p.writableNeedDrain===!0)R$();else if(!K$.flowing)y("pipe resume"),x$.resume();return p};function I$(p,x){return function(){let K$=p._readableState;if(K$.awaitDrainWriters===x)y("pipeOnDrain",1),K$.awaitDrainWriters=null;else if(K$.multiAwaitDrain)y("pipeOnDrain",K$.awaitDrainWriters.size),K$.awaitDrainWriters.delete(x);if((!K$.awaitDrainWriters||K$.awaitDrainWriters.size===0)&&p.listenerCount("data"))p.resume()}}X$.prototype.unpipe=function(p){let x=this._readableState,x$={hasUnpiped:!1};if(x.pipes.length===0)return this;if(!p){let j$=x.pipes;x.pipes=[],this.pause();for(let f6=0;f6<j$.length;f6++)j$[f6].emit("unpipe",this,{hasUnpiped:!1});return this}let K$=P(x.pipes,p);if(K$===-1)return this;if(x.pipes.splice(K$,1),x.pipes.length===0)this.pause();return p.emit("unpipe",this,x$),this},X$.prototype.on=function(p,x){let x$=R.prototype.on.call(this,p,x),K$=this._readableState;if(p==="data"){if(K$.readableListening=this.listenerCount("readable")>0,K$.flowing!==!1)this.resume()}else if(p==="readable"){if(!K$.endEmitted&&!K$.readableListening){if(K$.readableListening=K$.needReadable=!0,K$.flowing=!1,K$.emittedReadable=!1,y("on readable",K$.length,K$.reading),K$.length)w$(this);else if(!K$.reading)K.nextTick(D$,this)}}return x$},X$.prototype.addListener=X$.prototype.on,X$.prototype.removeListener=function(p,x){let x$=R.prototype.removeListener.call(this,p,x);if(p==="readable")K.nextTick(Yq,this);return x$},X$.prototype.off=X$.prototype.removeListener,X$.prototype.removeAllListeners=function(p){let x=R.prototype.removeAllListeners.apply(this,arguments);if(p==="readable"||p===void 0)K.nextTick(Yq,this);return x};function Yq(p){let x=p._readableState;if(x.readableListening=p.listenerCount("readable")>0,x.resumeScheduled&&x[S]===!1)x.flowing=!0;else if(p.listenerCount("data")>0)p.resume();else if(!x.readableListening)x.flowing=null}function D$(p){y("readable nexttick read 0"),p.read(0)}X$.prototype.resume=function(){let p=this._readableState;if(!p.flowing)y("resume"),p.flowing=!p.readableListening,g$(this,p);return p[S]=!1,this};function g$(p,x){if(!x.resumeScheduled)x.resumeScheduled=!0,K.nextTick(Aq,p,x)}function Aq(p,x){if(y("resume",x.reading),!x.reading)p.read(0);if(x.resumeScheduled=!1,p.emit("resume"),C$(p),x.flowing&&!x.reading)p.read(0)}X$.prototype.pause=function(){if(y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)y("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[S]=!0,this};function C$(p){let x=p._readableState;y("flow",x.flowing);while(x.flowing&&p.read()!==null);}X$.prototype.wrap=function(p){let x=!1;p.on("data",(K$)=>{if(!this.push(K$)&&p.pause)x=!0,p.pause()}),p.on("end",()=>{this.push(null)}),p.on("error",(K$)=>{k(this,K$)}),p.on("close",()=>{this.destroy()}),p.on("destroy",()=>{this.destroy()}),this._read=()=>{if(x&&p.resume)x=!1,p.resume()};let x$=J(p);for(let K$=1;K$<x$.length;K$++){let j$=x$[K$];if(this[j$]===void 0&&typeof p[j$]==="function")this[j$]=p[j$].bind(p)}return this},X$.prototype[V]=function(){return E$(this)},X$.prototype.iterator=function(p){if(p!==void 0)Z(p,"options");return E$(this,p)};function E$(p,x){if(typeof p.read!=="function")p=X$.wrap(p,{objectMode:!0});let x$=Gq(p,x);return x$.stream=p,x$}async function*Gq(p,x){let x$=v;function K$(Z$){if(this===p)x$(),x$=v;else x$=Z$}p.on("readable",K$);let j$,f6=u(p,{writable:!1},(Z$)=>{j$=Z$?l(j$,Z$):null,x$(),x$=v});try{while(!0){let Z$=p.destroyed?null:p.read();if(Z$!==null)yield Z$;else if(j$)throw j$;else if(j$===null)return;else await new G(K$)}}catch(Z$){throw j$=l(j$,Z$),j$}finally{if((j$||(x===null||x===void 0?void 0:x.destroyOnReturn)!==!1)&&(j$===void 0||p._readableState.autoDestroy))m.destroyer(p,null);else p.off("readable",K$),f6()}}z(X$.prototype,{readable:{__proto__:null,get(){let p=this._readableState;return!!p&&p.readable!==!1&&!p.destroyed&&!p.errorEmitted&&!p.endEmitted},set(p){if(this._readableState)this._readableState.readable=!!p}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(p){if(this._readableState)this._readableState.flowing=p}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(p){if(!this._readableState)return;this._readableState.destroyed=p}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),z(_$.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[S]!==!1},set(p){this[S]=!!p}}}),X$._fromList=h$;function h$(p,x){if(x.length===0)return null;let x$;if(x.objectMode)x$=x.buffer.shift();else if(!p||p>=x.length){if(x.decoder)x$=x.buffer.join("");else if(x.buffer.length===1)x$=x.buffer.first();else x$=x.buffer.concat(x.length);x.buffer.clear()}else x$=x.buffer.consume(p,x.decoder);return x$}function V$(p){let x=p._readableState;if(y("endReadable",x.endEmitted),!x.endEmitted)x.ended=!0,K.nextTick(Vq,x,p)}function Vq(p,x){if(y("endReadableNT",p.endEmitted,p.length),!p.errored&&!p.closeEmitted&&!p.endEmitted&&p.length===0){if(p.endEmitted=!0,x.emit("end"),x.writable&&x.allowHalfOpen===!1)K.nextTick(L$,x);else if(p.autoDestroy){let x$=x._writableState;if(!x$||x$.autoDestroy&&(x$.finished||x$.writable===!1))x.destroy()}}}function L$(p){if(p.writable&&!p.writableEnded&&!p.destroyed)p.end()}X$.from=function(p,x){return X(X$,p,x)};var S$;function vq(){if(S$===void 0)S$={};return S$}X$.fromWeb=function(p,x){return vq().newStreamReadableFromReadableStream(p,x)},X$.toWeb=function(p,x){return vq().newReadableStreamFromStreamReadable(p,x)},X$.wrap=function(p,x){var x$,K$;return new X$({objectMode:(x$=(K$=p.readableObjectMode)!==null&&K$!==void 0?K$:p.objectMode)!==null&&x$!==void 0?x$:!0,...x,destroy(j$,f6){m.destroyer(p,j$),f6(j$)}}).wrap(p)}}),wH=k6(($,q)=>{var K=M_(),{ArrayPrototypeSlice:P,Error:_,FunctionPrototypeSymbolHasInstance:O,ObjectDefineProperty:j,ObjectDefineProperties:z,ObjectSetPrototypeOf:J,StringPrototypeToLowerCase:w,Symbol:G,SymbolHasInstance:f}=I6();q.exports=Z,Z.WritableState=T;var{EventEmitter:A}=(y7(),w6(u7)),V=TH().Stream,{Buffer:C}=(Oq(),w6(jq)),E=m4(),{addAbortSignal:R}=ij(),{getHighWaterMark:I,getDefaultHighWaterMark:D}=tj(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:u,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:c,ERR_STREAM_DESTROYED:m,ERR_STREAM_ALREADY_FINISHED:q$,ERR_STREAM_NULL_VALUES:e,ERR_STREAM_WRITE_AFTER_END:l,ERR_UNKNOWN_ENCODING:r}=bq().codes,{errorOrDestroy:M}=E;J(Z.prototype,V.prototype),J(Z,V);function Y(){}var H=G("kOnFinished");function T(a,o,B){if(typeof B!=="boolean")B=o instanceof ZK();if(this.objectMode=!!(a&&a.objectMode),B)this.objectMode=this.objectMode||!!(a&&a.writableObjectMode);this.highWaterMark=a?I(this,a,"writableHighWaterMark",B):D(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let p$=!!(a&&a.decodeStrings===!1);this.decodeStrings=!p$,this.defaultEncoding=a&&a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=k.bind(void 0,o),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,W(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!a||a.emitClose!==!1,this.autoDestroy=!a||a.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[H]=[]}function W(a){a.buffered=[],a.bufferedIndex=0,a.allBuffers=!0,a.allNoop=!0}T.prototype.getBuffer=function(){return P(this.buffered,this.bufferedIndex)},j(T.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Z(a){let o=this instanceof ZK();if(!o&&!O(Z,this))return new Z(a);if(this._writableState=new T(a,this,o),a){if(typeof a.write==="function")this._write=a.write;if(typeof a.writev==="function")this._writev=a.writev;if(typeof a.destroy==="function")this._destroy=a.destroy;if(typeof a.final==="function")this._final=a.final;if(typeof a.construct==="function")this._construct=a.construct;if(a.signal)R(a.signal,this)}V.call(this,a),E.construct(this,()=>{let B=this._writableState;if(!B.writing)d(this,B);n(this,B)})}j(Z,f,{__proto__:null,value:function(a){if(O(this,a))return!0;if(this!==Z)return!1;return a&&a._writableState instanceof T}}),Z.prototype.pipe=function(){M(this,new c)};function S(a,o,B,p$){let $$=a._writableState;if(typeof B==="function")p$=B,B=$$.defaultEncoding;else{if(!B)B=$$.defaultEncoding;else if(B!=="buffer"&&!C.isEncoding(B))throw new r(B);if(typeof p$!=="function")p$=Y}if(o===null)throw new e;else if(!$$.objectMode)if(typeof o==="string"){if($$.decodeStrings!==!1)o=C.from(o,B),B="buffer"}else if(o instanceof C)B="buffer";else if(V._isUint8Array(o))o=V._uint8ArrayToBuffer(o),B="buffer";else throw new b("chunk",["string","Buffer","Uint8Array"],o);let s;if($$.ending)s=new l;else if($$.destroyed)s=new m("write");if(s)return K.nextTick(p$,s),M(a,s,!0),s;return $$.pendingcb++,N(a,$$,o,B,p$)}Z.prototype.write=function(a,o,B){return S(this,a,o,B)===!0},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){let a=this._writableState;if(a.corked){if(a.corked--,!a.writing)d(this,a)}},Z.prototype.setDefaultEncoding=function(o){if(typeof o==="string")o=w(o);if(!C.isEncoding(o))throw new r(o);return this._writableState.defaultEncoding=o,this};function N(a,o,B,p$,$$){let s=o.objectMode?1:B.length;o.length+=s;let Q=o.length<o.highWaterMark;if(!Q)o.needDrain=!0;if(o.writing||o.corked||o.errored||!o.constructed){if(o.buffered.push({chunk:B,encoding:p$,callback:$$}),o.allBuffers&&p$!=="buffer")o.allBuffers=!1;if(o.allNoop&&$$!==Y)o.allNoop=!1}else o.writelen=s,o.writecb=$$,o.writing=!0,o.sync=!0,a._write(B,p$,o.onwrite),o.sync=!1;return Q&&!o.errored&&!o.destroyed}function X(a,o,B,p$,$$,s,Q){if(o.writelen=p$,o.writecb=Q,o.writing=!0,o.sync=!0,o.destroyed)o.onwrite(new m("write"));else if(B)a._writev($$,o.onwrite);else a._write($$,s,o.onwrite);o.sync=!1}function v(a,o,B,p$){--o.pendingcb,p$(B),L(o),M(a,B)}function k(a,o){let B=a._writableState,p$=B.sync,$$=B.writecb;if(typeof $$!=="function"){M(a,new y);return}if(B.writing=!1,B.writecb=null,B.length-=B.writelen,B.writelen=0,o){if(o.stack,!B.errored)B.errored=o;if(a._readableState&&!a._readableState.errored)a._readableState.errored=o;if(p$)K.nextTick(v,a,B,o,$$);else v(a,B,o,$$)}else{if(B.buffered.length>B.bufferedIndex)d(a,B);if(p$)if(B.afterWriteTickInfo!==null&&B.afterWriteTickInfo.cb===$$)B.afterWriteTickInfo.count++;else B.afterWriteTickInfo={count:1,cb:$$,stream:a,state:B},K.nextTick(g,B.afterWriteTickInfo);else h(a,B,1,$$)}}function g({stream:a,state:o,count:B,cb:p$}){return o.afterWriteTickInfo=null,h(a,o,B,p$)}function h(a,o,B,p$){if(!o.ending&&!a.destroyed&&o.length===0&&o.needDrain)o.needDrain=!1,a.emit("drain");while(B-- >0)o.pendingcb--,p$();if(o.destroyed)L(o);n(a,o)}function L(a){if(a.writing)return;for(let $$=a.bufferedIndex;$$<a.buffered.length;++$$){var o;let{chunk:s,callback:Q}=a.buffered[$$],U=a.objectMode?1:s.length;a.length-=U,Q((o=a.errored)!==null&&o!==void 0?o:new m("write"))}let B=a[H].splice(0);for(let $$=0;$$<B.length;$$++){var p$;B[$$]((p$=a.errored)!==null&&p$!==void 0?p$:new m("end"))}W(a)}function d(a,o){if(o.corked||o.bufferProcessing||o.destroyed||!o.constructed)return;let{buffered:B,bufferedIndex:p$,objectMode:$$}=o,s=B.length-p$;if(!s)return;let Q=p$;if(o.bufferProcessing=!0,s>1&&a._writev){o.pendingcb-=s-1;let U=o.allNoop?Y:(X$)=>{for(let O$=Q;O$<B.length;++O$)B[O$].callback(X$)},_$=o.allNoop&&Q===0?B:P(B,Q);_$.allBuffers=o.allBuffers,X(a,o,!0,o.length,_$,"",U),W(o)}else{do{let{chunk:U,encoding:_$,callback:X$}=B[Q];B[Q++]=null;let O$=$$?1:U.length;X(a,o,!1,O$,U,_$,X$)}while(Q<B.length&&!o.writing);if(Q===B.length)W(o);else if(Q>256)B.splice(0,Q),o.bufferedIndex=0;else o.bufferedIndex=Q}o.bufferProcessing=!1}Z.prototype._write=function(a,o,B){if(this._writev)this._writev([{chunk:a,encoding:o}],B);else throw new u("_write()")},Z.prototype._writev=null,Z.prototype.end=function(a,o,B){let p$=this._writableState;if(typeof a==="function")B=a,a=null,o=null;else if(typeof o==="function")B=o,o=null;let $$;if(a!==null&&a!==void 0){let s=S(this,a,o);if(s instanceof _)$$=s}if(p$.corked)p$.corked=1,this.uncork();if($$);else if(!p$.errored&&!p$.ending)p$.ending=!0,n(this,p$,!0),p$.ended=!0;else if(p$.finished)$$=new q$("end");else if(p$.destroyed)$$=new m("end");if(typeof B==="function")if($$||p$.finished)K.nextTick(B,$$);else p$[H].push(B);return this};function i(a){return a.ending&&!a.destroyed&&a.constructed&&a.length===0&&!a.errored&&a.buffered.length===0&&!a.finished&&!a.writing&&!a.errorEmitted&&!a.closeEmitted}function F(a,o){let B=!1;function p$($$){if(B){M(a,$$!==null&&$$!==void 0?$$:y());return}if(B=!0,o.pendingcb--,$$){let s=o[H].splice(0);for(let Q=0;Q<s.length;Q++)s[Q]($$);M(a,$$,o.sync)}else if(i(o))o.prefinished=!0,a.emit("prefinish"),o.pendingcb++,K.nextTick(t,a,o)}o.sync=!0,o.pendingcb++;try{a._final(p$)}catch($$){p$($$)}o.sync=!1}function W$(a,o){if(!o.prefinished&&!o.finalCalled)if(typeof a._final==="function"&&!o.destroyed)o.finalCalled=!0,F(a,o);else o.prefinished=!0,a.emit("prefinish")}function n(a,o,B){if(i(o)){if(W$(a,o),o.pendingcb===0){if(B)o.pendingcb++,K.nextTick((p$,$$)=>{if(i($$))t(p$,$$);else $$.pendingcb--},a,o);else if(i(o))o.pendingcb++,t(a,o)}}}function t(a,o){o.pendingcb--,o.finished=!0;let B=o[H].splice(0);for(let p$=0;p$<B.length;p$++)B[p$]();if(a.emit("finish"),o.autoDestroy){let p$=a._readableState;if(!p$||p$.autoDestroy&&(p$.endEmitted||p$.readable===!1))a.destroy()}}z(Z.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(a){if(this._writableState)this._writableState.destroyed=a}},writable:{__proto__:null,get(){let a=this._writableState;return!!a&&a.writable!==!1&&!a.destroyed&&!a.errored&&!a.ending&&!a.ended},set(a){if(this._writableState)this._writableState.writable=!!a}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let a=this._writableState;if(!a)return!1;return!a.destroyed&&!a.ending&&a.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var y$=E.destroy;Z.prototype.destroy=function(a,o){let B=this._writableState;if(!B.destroyed&&(B.bufferedIndex<B.buffered.length||B[H].length))K.nextTick(L,B);return y$.call(this,a,o),this},Z.prototype._undestroy=E.undestroy,Z.prototype._destroy=function(a,o){o(a)},Z.prototype[A.captureRejectionSymbol]=function(a){this.destroy(a)};var Y$;function v$(){if(Y$===void 0)Y$={};return Y$}Z.fromWeb=function(a,o){return v$().newStreamWritableFromWritableStream(a,o)},Z.toWeb=function(a){return v$().newWritableStreamFromStreamWritable(a)}}),ad=k6(($,q)=>{var K=M_(),P=(Oq(),w6(jq)),{isReadable:_,isWritable:O,isIterable:j,isNodeStream:z,isReadableNodeStream:J,isWritableNodeStream:w,isDuplexNodeStream:G,isReadableStream:f,isWritableStream:A}=XK(),V=dK(),{AbortError:C,codes:{ERR_INVALID_ARG_TYPE:E,ERR_INVALID_RETURN_VALUE:R}}=bq(),{destroyer:I}=m4(),D=ZK(),b=Bj(),u=wH(),{createDeferredPromise:y}=nq(),c=gS(),m=globalThis.Blob||P.Blob,q$=typeof m<"u"?function(T){return T instanceof m}:function(T){return!1},e=globalThis.AbortController||p7().AbortController,{FunctionPrototypeCall:l}=I6();class r extends D{constructor(H){super(H);if((H===null||H===void 0?void 0:H.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((H===null||H===void 0?void 0:H.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}q.exports=function H(T,W){if(G(T))return T;if(J(T))return Y({readable:T});if(w(T))return Y({writable:T});if(z(T))return Y({writable:!1,readable:!1});if(f(T))return Y({readable:b.fromWeb(T)});if(A(T))return Y({writable:u.fromWeb(T)});if(typeof T==="function"){let{value:S,write:N,final:X,destroy:v}=M(T);if(j(S))return c(r,S,{objectMode:!0,write:N,final:X,destroy:v});let k=S===null||S===void 0?void 0:S.then;if(typeof k==="function"){let g,h=l(k,S,(L)=>{if(L!=null)throw new R("nully","body",L)},(L)=>{I(g,L)});return g=new r({objectMode:!0,readable:!1,write:N,final(L){X(async()=>{try{await h,K.nextTick(L,null)}catch(d){K.nextTick(L,d)}})},destroy:v})}throw new R("Iterable, AsyncIterable or AsyncFunction",W,S)}if(q$(T))return H(T.arrayBuffer());if(j(T))return c(r,T,{objectMode:!0,writable:!1});if(f(T===null||T===void 0?void 0:T.readable)&&A(T===null||T===void 0?void 0:T.writable))return r.fromWeb(T);if(typeof(T===null||T===void 0?void 0:T.writable)==="object"||typeof(T===null||T===void 0?void 0:T.readable)==="object"){let S=T!==null&&T!==void 0&&T.readable?J(T===null||T===void 0?void 0:T.readable)?T===null||T===void 0?void 0:T.readable:H(T.readable):void 0,N=T!==null&&T!==void 0&&T.writable?w(T===null||T===void 0?void 0:T.writable)?T===null||T===void 0?void 0:T.writable:H(T.writable):void 0;return Y({readable:S,writable:N})}let Z=T===null||T===void 0?void 0:T.then;if(typeof Z==="function"){let S;return l(Z,T,(N)=>{if(N!=null)S.push(N);S.push(null)},(N)=>{I(S,N)}),S=new r({objectMode:!0,writable:!1,read(){}})}throw new E(W,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],T)};function M(H){let{promise:T,resolve:W}=y(),Z=new e,S=Z.signal;return{value:H(async function*(){while(!0){let N=T;T=null;let{chunk:X,done:v,cb:k}=await N;if(K.nextTick(k),v)return;if(S.aborted)throw new C(void 0,{cause:S.reason});({promise:T,resolve:W}=y()),yield X}}(),{signal:S}),write(N,X,v){let k=W;W=null,k({chunk:N,done:!1,cb:v})},final(N){let X=W;W=null,X({done:!0,cb:N})},destroy(N,X){Z.abort(),X(N)}}}function Y(H){let T=H.readable&&typeof H.readable.read!=="function"?b.wrap(H.readable):H.readable,W=H.writable,Z=!!_(T),S=!!O(W),N,X,v,k,g;function h(L){let d=k;if(k=null,d)d(L);else if(L)g.destroy(L)}if(g=new r({readableObjectMode:!!(T!==null&&T!==void 0&&T.readableObjectMode),writableObjectMode:!!(W!==null&&W!==void 0&&W.writableObjectMode),readable:Z,writable:S}),S)V(W,(L)=>{if(S=!1,L)I(T,L);h(L)}),g._write=function(L,d,i){if(W.write(L,d))i();else N=i},g._final=function(L){W.end(),X=L},W.on("drain",function(){if(N){let L=N;N=null,L()}}),W.on("finish",function(){if(X){let L=X;X=null,L()}});if(Z)V(T,(L)=>{if(Z=!1,L)I(T,L);h(L)}),T.on("readable",function(){if(v){let L=v;v=null,L()}}),T.on("end",function(){g.push(null)}),g._read=function(){while(!0){let L=T.read();if(L===null){v=g._read;return}if(!g.push(L))return}};return g._destroy=function(L,d){if(!L&&k!==null)L=new C;if(v=null,N=null,X=null,k===null)d(L);else k=d,I(W,L),I(T,L)},g}}),ZK=k6(($,q)=>{var{ObjectDefineProperties:K,ObjectGetOwnPropertyDescriptor:P,ObjectKeys:_,ObjectSetPrototypeOf:O}=I6();q.exports=J;var j=Bj(),z=wH();O(J.prototype,j.prototype),O(J,j);{let A=_(z.prototype);for(let V=0;V<A.length;V++){let C=A[V];if(!J.prototype[C])J.prototype[C]=z.prototype[C]}}function J(A){if(!(this instanceof J))return new J(A);if(j.call(this,A),z.call(this,A),A){if(this.allowHalfOpen=A.allowHalfOpen!==!1,A.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(A.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}K(J.prototype,{writable:{__proto__:null,...P(z.prototype,"writable")},writableHighWaterMark:{__proto__:null,...P(z.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...P(z.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...P(z.prototype,"writableBuffer")},writableLength:{__proto__:null,...P(z.prototype,"writableLength")},writableFinished:{__proto__:null,...P(z.prototype,"writableFinished")},writableCorked:{__proto__:null,...P(z.prototype,"writableCorked")},writableEnded:{__proto__:null,...P(z.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...P(z.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(A){if(this._readableState&&this._writableState)this._readableState.destroyed=A,this._writableState.destroyed=A}}});var w;function G(){if(w===void 0)w={};return w}J.fromWeb=function(A,V){return G().newStreamDuplexFromReadableWritablePair(A,V)},J.toWeb=function(A){return G().newReadableWritablePairFromDuplex(A)};var f;J.from=function(A){if(!f)f=ad();return f(A,"body")}}),LS=k6(($,q)=>{var{ObjectSetPrototypeOf:K,Symbol:P}=I6();q.exports=J;var{ERR_METHOD_NOT_IMPLEMENTED:_}=bq().codes,O=ZK(),{getHighWaterMark:j}=tj();K(J.prototype,O.prototype),K(J,O);var z=P("kCallback");function J(f){if(!(this instanceof J))return new J(f);let A=f?j(this,f,"readableHighWaterMark",!0):null;if(A===0)f={...f,highWaterMark:null,readableHighWaterMark:A,writableHighWaterMark:f.writableHighWaterMark||0};if(O.call(this,f),this._readableState.sync=!1,this[z]=null,f){if(typeof f.transform==="function")this._transform=f.transform;if(typeof f.flush==="function")this._flush=f.flush}this.on("prefinish",G)}function w(f){if(typeof this._flush==="function"&&!this.destroyed)this._flush((A,V)=>{if(A){if(f)f(A);else this.destroy(A);return}if(V!=null)this.push(V);if(this.push(null),f)f()});else if(this.push(null),f)f()}function G(){if(this._final!==w)w.call(this)}J.prototype._final=w,J.prototype._transform=function(f,A,V){throw new _("_transform()")},J.prototype._write=function(f,A,V){let C=this._readableState,E=this._writableState,R=C.length;this._transform(f,A,(I,D)=>{if(I){V(I);return}if(D!=null)this.push(D);if(E.ended||R===C.length||C.length<C.highWaterMark)V();else this[z]=V})},J.prototype._read=function(){if(this[z]){let f=this[z];this[z]=null,f()}}}),bS=k6(($,q)=>{var{ObjectSetPrototypeOf:K}=I6();q.exports=_;var P=LS();K(_.prototype,P.prototype),K(_,P);function _(O){if(!(this instanceof _))return new _(O);P.call(this,O)}_.prototype._transform=function(O,j,z){z(null,O)}}),ZH=k6(($,q)=>{var K=M_(),{ArrayIsArray:P,Promise:_,SymbolAsyncIterator:O,SymbolDispose:j}=I6(),z=dK(),{once:J}=nq(),w=m4(),G=ZK(),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:A,ERR_INVALID_RETURN_VALUE:V,ERR_MISSING_ARGS:C,ERR_STREAM_DESTROYED:E,ERR_STREAM_PREMATURE_CLOSE:R},AbortError:I}=bq(),{validateFunction:D,validateAbortSignal:b}=x7(),{isIterable:u,isReadable:y,isReadableNodeStream:c,isNodeStream:m,isTransformStream:q$,isWebStream:e,isReadableStream:l,isReadableFinished:r}=XK(),M=globalThis.AbortController||p7().AbortController,Y,H,T;function W(L,d,i){let F=!1;L.on("close",()=>{F=!0});let W$=z(L,{readable:d,writable:i},(n)=>{F=!n});return{destroy:(n)=>{if(F)return;F=!0,w.destroyer(L,n||new E("pipe"))},cleanup:W$}}function Z(L){return D(L[L.length-1],"streams[stream.length - 1]"),L.pop()}function S(L){if(u(L))return L;else if(c(L))return N(L);throw new A("val",["Readable","Iterable","AsyncIterable"],L)}async function*N(L){if(!H)H=Bj();yield*H.prototype[O].call(L)}async function X(L,d,i,{end:F}){let W$,n=null,t=(v$)=>{if(v$)W$=v$;if(n){let a=n;n=null,a()}},y$=()=>new _((v$,a)=>{if(W$)a(W$);else n=()=>{if(W$)a(W$);else v$()}});d.on("drain",t);let Y$=z(d,{readable:!1},t);try{if(d.writableNeedDrain)await y$();for await(let v$ of L)if(!d.write(v$))await y$();if(F)d.end(),await y$();i()}catch(v$){i(W$!==v$?f(W$,v$):v$)}finally{Y$(),d.off("drain",t)}}async function v(L,d,i,{end:F}){if(q$(d))d=d.writable;let W$=d.getWriter();try{for await(let n of L)await W$.ready,W$.write(n).catch(()=>{});if(await W$.ready,F)await W$.close();i()}catch(n){try{await W$.abort(n),i(n)}catch(t){i(t)}}}function k(...L){return g(L,J(Z(L)))}function g(L,d,i){if(L.length===1&&P(L[0]))L=L[0];if(L.length<2)throw new C("streams");let F=new M,W$=F.signal,n=i===null||i===void 0?void 0:i.signal,t=[];b(n,"options.signal");function y$(){$$(new I)}T=T||nq().addAbortListener;let Y$;if(n)Y$=T(n,y$);let v$,a,o=[],B=0;function p$(X$){$$(X$,--B===0)}function $$(X$,O$){var T$;if(X$&&(!v$||v$.code==="ERR_STREAM_PREMATURE_CLOSE"))v$=X$;if(!v$&&!O$)return;while(o.length)o.shift()(v$);if((T$=Y$)===null||T$===void 0||T$[j](),F.abort(),O$){if(!v$)t.forEach((j6)=>j6());K.nextTick(d,v$,a)}}let s;for(let X$=0;X$<L.length;X$++){let O$=L[X$],T$=X$<L.length-1,j6=X$>0,H$=T$||(i===null||i===void 0?void 0:i.end)!==!1,f$=X$===L.length-1;if(m(O$)){let X6=function(w$){if(w$&&w$.name!=="AbortError"&&w$.code!=="ERR_STREAM_PREMATURE_CLOSE")p$(w$)};var Q=X6;if(H$){let{destroy:w$,cleanup:G$}=W(O$,T$,j6);if(o.push(w$),y(O$)&&f$)t.push(G$)}if(O$.on("error",X6),y(O$)&&f$)t.push(()=>{O$.removeListener("error",X6)})}if(X$===0)if(typeof O$==="function"){if(s=O$({signal:W$}),!u(s))throw new V("Iterable, AsyncIterable or Stream","source",s)}else if(u(O$)||c(O$)||q$(O$))s=O$;else s=G.from(O$);else if(typeof O$==="function"){if(q$(s)){var U;s=S((U=s)===null||U===void 0?void 0:U.readable)}else s=S(s);if(s=O$(s,{signal:W$}),T$){if(!u(s,!0))throw new V("AsyncIterable",`transform[${X$-1}]`,s)}else{var _$;if(!Y)Y=bS();let X6=new Y({objectMode:!0}),w$=(_$=s)===null||_$===void 0?void 0:_$.then;if(typeof w$==="function")B++,w$.call(s,(k$)=>{if(a=k$,k$!=null)X6.write(k$);if(H$)X6.end();K.nextTick(p$)},(k$)=>{X6.destroy(k$),K.nextTick(p$,k$)});else if(u(s,!0))B++,X(s,X6,p$,{end:H$});else if(l(s)||q$(s)){let k$=s.readable||s;B++,X(k$,X6,p$,{end:H$})}else throw new V("AsyncIterable or Promise","destination",s);s=X6;let{destroy:G$,cleanup:b6}=W(s,!1,!0);if(o.push(G$),f$)t.push(b6)}}else if(m(O$)){if(c(s)){B+=2;let X6=h(s,O$,p$,{end:H$});if(y(O$)&&f$)t.push(X6)}else if(q$(s)||l(s)){let X6=s.readable||s;B++,X(X6,O$,p$,{end:H$})}else if(u(s))B++,X(s,O$,p$,{end:H$});else throw new A("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],s);s=O$}else if(e(O$)){if(c(s))B++,v(S(s),O$,p$,{end:H$});else if(l(s)||u(s))B++,v(s,O$,p$,{end:H$});else if(q$(s))B++,v(s.readable,O$,p$,{end:H$});else throw new A("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],s);s=O$}else s=G.from(O$)}if(W$!==null&&W$!==void 0&&W$.aborted||n!==null&&n!==void 0&&n.aborted)K.nextTick(y$);return s}function h(L,d,i,{end:F}){let W$=!1;if(d.on("close",()=>{if(!W$)i(new R)}),L.pipe(d,{end:!1}),F){let t=function(){W$=!0,d.end()};var n=t;if(r(L))K.nextTick(t);else L.once("end",t)}else i();return z(L,{readable:!0,writable:!1},(t)=>{let y$=L._readableState;if(t&&t.code==="ERR_STREAM_PREMATURE_CLOSE"&&y$&&y$.ended&&!y$.errored&&!y$.errorEmitted)L.once("end",i).once("error",i);else i(t)}),z(d,{readable:!1,writable:!0},i)}q.exports={pipelineImpl:g,pipeline:k}}),uS=k6(($,q)=>{var{pipeline:K}=ZH(),P=ZK(),{destroyer:_}=m4(),{isNodeStream:O,isReadable:j,isWritable:z,isWebStream:J,isTransformStream:w,isWritableStream:G,isReadableStream:f}=XK(),{AbortError:A,codes:{ERR_INVALID_ARG_VALUE:V,ERR_MISSING_ARGS:C}}=bq(),E=dK();q.exports=function(...I){if(I.length===0)throw new C("streams");if(I.length===1)return P.from(I[0]);let D=[...I];if(typeof I[0]==="function")I[0]=P.from(I[0]);if(typeof I[I.length-1]==="function"){let Y=I.length-1;I[Y]=P.from(I[Y])}for(let Y=0;Y<I.length;++Y){if(!O(I[Y])&&!J(I[Y]))continue;if(Y<I.length-1&&!(j(I[Y])||f(I[Y])||w(I[Y])))throw new V(`streams[${Y}]`,D[Y],"must be readable");if(Y>0&&!(z(I[Y])||G(I[Y])||w(I[Y])))throw new V(`streams[${Y}]`,D[Y],"must be writable")}let b,u,y,c,m;function q$(Y){let H=c;if(c=null,H)H(Y);else if(Y)m.destroy(Y);else if(!M&&!r)m.destroy()}let e=I[0],l=K(I,q$),r=!!(z(e)||G(e)||w(e)),M=!!(j(l)||f(l)||w(l));if(m=new P({writableObjectMode:!!(e!==null&&e!==void 0&&e.writableObjectMode),readableObjectMode:!!(l!==null&&l!==void 0&&l.readableObjectMode),writable:r,readable:M}),r){if(O(e))m._write=function(H,T,W){if(e.write(H,T))W();else b=W},m._final=function(H){e.end(),u=H},e.on("drain",function(){if(b){let H=b;b=null,H()}});else if(J(e)){let H=(w(e)?e.writable:e).getWriter();m._write=async function(T,W,Z){try{await H.ready,H.write(T).catch(()=>{}),Z()}catch(S){Z(S)}},m._final=async function(T){try{await H.ready,H.close().catch(()=>{}),u=T}catch(W){T(W)}}}let Y=w(l)?l.readable:l;E(Y,()=>{if(u){let H=u;u=null,H()}})}if(M){if(O(l))l.on("readable",function(){if(y){let Y=y;y=null,Y()}}),l.on("end",function(){m.push(null)}),m._read=function(){while(!0){let Y=l.read();if(Y===null){y=m._read;return}if(!m.push(Y))return}};else if(J(l)){let Y=(w(l)?l.readable:l).getReader();m._read=async function(){while(!0)try{let{value:H,done:T}=await Y.read();if(!m.push(H))return;if(T){m.push(null);return}}catch{return}}}}return m._destroy=function(Y,H){if(!Y&&c!==null)Y=new A;if(y=null,b=null,u=null,c===null)H(Y);else if(c=H,O(l))_(l,Y)},m}}),Qd=k6(($,q)=>{var K=globalThis.AbortController||p7().AbortController,{codes:{ERR_INVALID_ARG_VALUE:P,ERR_INVALID_ARG_TYPE:_,ERR_MISSING_ARGS:O,ERR_OUT_OF_RANGE:j},AbortError:z}=bq(),{validateAbortSignal:J,validateInteger:w,validateObject:G}=x7(),f=I6().Symbol("kWeak"),A=I6().Symbol("kResistStopPropagation"),{finished:V}=dK(),C=uS(),{addAbortSignalNoValidate:E}=ij(),{isWritable:R,isNodeStream:I}=XK(),{deprecate:D}=nq(),{ArrayPrototypePush:b,Boolean:u,MathFloor:y,Number:c,NumberIsNaN:m,Promise:q$,PromiseReject:e,PromiseResolve:l,PromisePrototypeThen:r,Symbol:M}=I6(),Y=M("kEmpty"),H=M("kEof");function T(n,t){if(t!=null)G(t,"options");if((t===null||t===void 0?void 0:t.signal)!=null)J(t.signal,"options.signal");if(I(n)&&!R(n))throw new P("stream",n,"must be writable");let y$=C(this,n);if(t!==null&&t!==void 0&&t.signal)E(t.signal,y$);return y$}function W(n,t){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);if(t!=null)G(t,"options");if((t===null||t===void 0?void 0:t.signal)!=null)J(t.signal,"options.signal");let y$=1;if((t===null||t===void 0?void 0:t.concurrency)!=null)y$=y(t.concurrency);let Y$=y$-1;if((t===null||t===void 0?void 0:t.highWaterMark)!=null)Y$=y(t.highWaterMark);return w(y$,"options.concurrency",1),w(Y$,"options.highWaterMark",0),Y$+=y$,async function*(){let a=nq().AbortSignalAny([t===null||t===void 0?void 0:t.signal].filter(u)),o=this,B=[],p$={signal:a},$$,s,Q=!1,U=0;function _$(){Q=!0,X$()}function X$(){U-=1,O$()}function O$(){if(s&&!Q&&U<y$&&B.length<Y$)s(),s=null}async function T$(){try{for await(let j6 of o){if(Q)return;if(a.aborted)throw new z;try{if(j6=n(j6,p$),j6===Y)continue;j6=l(j6)}catch(H$){j6=e(H$)}if(U+=1,r(j6,X$,_$),B.push(j6),$$)$$(),$$=null;if(!Q&&(B.length>=Y$||U>=y$))await new q$((H$)=>{s=H$})}B.push(H)}catch(j6){let H$=e(j6);r(H$,X$,_$),B.push(H$)}finally{if(Q=!0,$$)$$(),$$=null}}T$();try{while(!0){while(B.length>0){let j6=await B[0];if(j6===H)return;if(a.aborted)throw new z;if(j6!==Y)yield j6;B.shift(),O$()}await new q$((j6)=>{$$=j6})}}finally{if(Q=!0,s)s(),s=null}}.call(this)}function Z(n=void 0){if(n!=null)G(n,"options");if((n===null||n===void 0?void 0:n.signal)!=null)J(n.signal,"options.signal");return async function*(){let y$=0;for await(let v$ of this){var Y$;if(n!==null&&n!==void 0&&(Y$=n.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z({cause:n.signal.reason});yield[y$++,v$]}}.call(this)}async function S(n,t=void 0){for await(let y$ of k.call(this,n,t))return!0;return!1}async function N(n,t=void 0){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);return!await S.call(this,async(...y$)=>{return!await n(...y$)},t)}async function X(n,t){for await(let y$ of k.call(this,n,t))return y$;return}async function v(n,t){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);async function y$(Y$,v$){return await n(Y$,v$),Y}for await(let Y$ of W.call(this,y$,t));}function k(n,t){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);async function y$(Y$,v$){if(await n(Y$,v$))return Y$;return Y}return W.call(this,y$,t)}class g extends O{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function h(n,t,y$){var Y$;if(typeof n!=="function")throw new _("reducer",["Function","AsyncFunction"],n);if(y$!=null)G(y$,"options");if((y$===null||y$===void 0?void 0:y$.signal)!=null)J(y$.signal,"options.signal");let v$=arguments.length>1;if(y$!==null&&y$!==void 0&&(Y$=y$.signal)!==null&&Y$!==void 0&&Y$.aborted){let $$=new z(void 0,{cause:y$.signal.reason});throw this.once("error",()=>{}),await V(this.destroy($$)),$$}let a=new K,o=a.signal;if(y$!==null&&y$!==void 0&&y$.signal){let $$={once:!0,[f]:this,[A]:!0};y$.signal.addEventListener("abort",()=>a.abort(),$$)}let B=!1;try{for await(let $$ of this){var p$;if(B=!0,y$!==null&&y$!==void 0&&(p$=y$.signal)!==null&&p$!==void 0&&p$.aborted)throw new z;if(!v$)t=$$,v$=!0;else t=await n(t,$$,{signal:o})}if(!B&&!v$)throw new g}finally{a.abort()}return t}async function L(n){if(n!=null)G(n,"options");if((n===null||n===void 0?void 0:n.signal)!=null)J(n.signal,"options.signal");let t=[];for await(let Y$ of this){var y$;if(n!==null&&n!==void 0&&(y$=n.signal)!==null&&y$!==void 0&&y$.aborted)throw new z(void 0,{cause:n.signal.reason});b(t,Y$)}return t}function d(n,t){let y$=W.call(this,n,t);return async function*(){for await(let v$ of y$)yield*v$}.call(this)}function i(n){if(n=c(n),m(n))return 0;if(n<0)throw new j("number",">= 0",n);return n}function F(n,t=void 0){if(t!=null)G(t,"options");if((t===null||t===void 0?void 0:t.signal)!=null)J(t.signal,"options.signal");return n=i(n),async function*(){var Y$;if(t!==null&&t!==void 0&&(Y$=t.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z;for await(let a of this){var v$;if(t!==null&&t!==void 0&&(v$=t.signal)!==null&&v$!==void 0&&v$.aborted)throw new z;if(n--<=0)yield a}}.call(this)}function W$(n,t=void 0){if(t!=null)G(t,"options");if((t===null||t===void 0?void 0:t.signal)!=null)J(t.signal,"options.signal");return n=i(n),async function*(){var Y$;if(t!==null&&t!==void 0&&(Y$=t.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z;for await(let a of this){var v$;if(t!==null&&t!==void 0&&(v$=t.signal)!==null&&v$!==void 0&&v$.aborted)throw new z;if(n-- >0)yield a;if(n<=0)return}}.call(this)}q.exports.streamReturningOperators={asIndexedPairs:D(Z,"readable.asIndexedPairs will be removed in a future version."),drop:F,filter:k,flatMap:d,map:W,take:W$,compose:T},q.exports.promiseReturningOperators={every:N,forEach:v,reduce:h,toArray:L,some:S,find:X}}),yS=k6(($,q)=>{var{ArrayPrototypePop:K,Promise:P}=I6(),{isIterable:_,isNodeStream:O,isWebStream:j}=XK(),{pipelineImpl:z}=ZH(),{finished:J}=dK();pS();function w(...G){return new P((f,A)=>{let V,C,E=G[G.length-1];if(E&&typeof E==="object"&&!O(E)&&!_(E)&&!j(E)){let R=K(G);V=R.signal,C=R.end}z(G,(R,I)=>{if(R)A(R);else f(I)},{signal:V,end:C})})}q.exports={finished:J,pipeline:w}}),pS=k6(($,q)=>{var{Buffer:K}=(Oq(),w6(jq)),{ObjectDefineProperty:P,ObjectKeys:_,ReflectApply:O}=I6(),{promisify:{custom:j}}=nq(),{streamReturningOperators:z,promiseReturningOperators:J}=Qd(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:w}}=bq(),G=uS(),{setDefaultHighWaterMark:f,getDefaultHighWaterMark:A}=tj(),{pipeline:V}=ZH(),{destroyer:C}=m4(),E=dK(),R=yS(),I=XK(),D=q.exports=TH().Stream;D.isDestroyed=I.isDestroyed,D.isDisturbed=I.isDisturbed,D.isErrored=I.isErrored,D.isReadable=I.isReadable,D.isWritable=I.isWritable,D.Readable=Bj();for(let u of _(z)){let y=function(...m){if(new.target)throw w();return D.Readable.from(O(c,this,m))},c=z[u];P(y,"name",{__proto__:null,value:c.name}),P(y,"length",{__proto__:null,value:c.length}),P(D.Readable.prototype,u,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(let u of _(J)){let y=function(...m){if(new.target)throw w();return O(c,this,m)},c=J[u];P(y,"name",{__proto__:null,value:c.name}),P(y,"length",{__proto__:null,value:c.length}),P(D.Readable.prototype,u,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}D.Writable=wH(),D.Duplex=ZK(),D.Transform=LS(),D.PassThrough=bS(),D.pipeline=V;var{addAbortSignal:b}=ij();D.addAbortSignal=b,D.finished=E,D.destroy=C,D.compose=G,D.setDefaultHighWaterMark=f,D.getDefaultHighWaterMark=A,P(D,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return R}}),P(V,j,{__proto__:null,enumerable:!0,get(){return R.pipeline}}),P(E,j,{__proto__:null,enumerable:!0,get(){return R.finished}}),D.Stream=D,D._isUint8Array=function(y){return y instanceof Uint8Array},D._uint8ArrayToBuffer=function(y){return K.from(y.buffer,y.byteOffset,y.byteLength)}}),ed=k6(($,q)=>{var K=XH();{let P=pS(),_=yS(),O=P.Readable.destroy;q.exports=P.Readable,q.exports._uint8ArrayToBuffer=P._uint8ArrayToBuffer,q.exports._isUint8Array=P._isUint8Array,q.exports.isDisturbed=P.isDisturbed,q.exports.isErrored=P.isErrored,q.exports.isReadable=P.isReadable,q.exports.Readable=P.Readable,q.exports.Writable=P.Writable,q.exports.Duplex=P.Duplex,q.exports.Transform=P.Transform,q.exports.PassThrough=P.PassThrough,q.exports.addAbortSignal=P.addAbortSignal,q.exports.finished=P.finished,q.exports.destroy=P.destroy,q.exports.destroy=O,q.exports.pipeline=P.pipeline,q.exports.compose=P.compose,Object.defineProperty(P,"promises",{configurable:!0,enumerable:!0,get(){return _}}),q.exports.Stream=P.Stream}q.exports.default=q.exports});xS.exports=ed()});var tq={};uq(tq,{webcrypto:()=>to,rng:()=>_o,randomUUID:()=>ro,randomFillSync:()=>xo,randomFill:()=>po,randomBytes:()=>Po,publicEncrypt:()=>Lo,publicDecrypt:()=>uo,pseudoRandomBytes:()=>Ko,prng:()=>qo,privateEncrypt:()=>bo,privateDecrypt:()=>yo,pbkdf2Sync:()=>Ho,pbkdf2:()=>Wo,listCiphers:()=>Vo,getRandomValues:()=>oo,getHashes:()=>zo,getDiffieHellman:()=>No,getCurves:()=>io,getCiphers:()=>Go,default:()=>Bo,createVerify:()=>Io,createSign:()=>ho,createHmac:()=>vo,createHash:()=>Oo,createECDH:()=>go,createDiffieHellmanGroup:()=>Mo,createDiffieHellman:()=>Co,createDecipheriv:()=>Ao,createDecipher:()=>fo,createCredentials:()=>co,createCipheriv:()=>Zo,createCipher:()=>To,constants:()=>mo,Verify:()=>Do,Sign:()=>Ro,Hmac:()=>Yo,Hash:()=>jo,DiffieHellmanGroup:()=>So,DiffieHellman:()=>Eo,Decipheriv:()=>ko,Decipher:()=>Xo,DEFAULT_ENCODING:()=>lo,Cipheriv:()=>wo,Cipher:()=>Jo});function io(){return no}var sd,$l,cS,ql,Kl,_l=($,q,K)=>{K=$!=null?sd($l($)):{};let P=q||!$||!$.__esModule?cS(K,"default",{value:$,enumerable:!0}):K;for(let _ of ql($))if(!Kl.call(P,_))cS(P,_,{get:()=>$[_],enumerable:!0});return P},l$=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),Uj,Fj,dS,Pl,kH,AH,iq,GH,lS,jl,oS,Ol,Yl,vl,zl,fK,lK,rS,Z8,nS,aj,Wl,K8,Hl,Jl,Tl,iS,t8,m7,tS,wl,BS,Zl,US,Xl,fl,kl,Al,VH,Gl,SH,Vl,Sl,Ml,Nl,Cl,El,hl,Rl,Il,Dl,gl,Ll,bl,ul,mS,yl,c7,pl,FS,aS,xl,cl,QS,ml,dl,d7,ll,ol,rl,nl,il,tl,eS,Bl,sS,$M,qM,MH,KM,Ul,_M,Fl,al,fH,Ql,el,sl,$o,H6,qo,Ko,_o,Po,jo,Oo,Yo,vo,zo,Wo,Ho,Jo,To,wo,Zo,Xo,fo,ko,Ao,Go,Vo,So,Mo,No,Co,Eo,ho,Ro,Io,Do,go,Lo,bo,uo,yo,po,xo,co,mo,lo="buffer",oo=($)=>{return crypto.getRandomValues($)},ro=()=>{return crypto.randomUUID()},no,to,Bo;var Bq=o4(()=>{sd=Object.create,{getPrototypeOf:$l,defineProperty:cS,getOwnPropertyNames:ql}=Object,Kl=Object.prototype.hasOwnProperty,Uj=l$(($,q)=>{q.exports=(Bq(),w6(tq)).randomBytes}),Fj=l$(($,q)=>{q.exports=(Bq(),w6(tq)).createHash}),dS=l$(($,q)=>{q.exports=(Bq(),w6(tq)).createHmac}),Pl=l$(($,q)=>{q.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),kH=l$(($,q)=>{var K=Math.pow(2,30)-1;q.exports=function(P,_){if(typeof P!=="number")throw TypeError("Iterations not a number");if(P<0)throw TypeError("Bad iterations");if(typeof _!=="number")throw TypeError("Key length not a number");if(_<0||_>K||_!==_)throw TypeError("Bad key length")}}),AH=l$(($,q)=>{var K;if(globalThis.process&&globalThis.process.browser)K="utf-8";else if(globalThis.process&&globalThis.process.version)P=parseInt(process.version.split(".")[0].slice(1),10),K=P>=6?"utf-8":"binary";else K="utf-8";var P;q.exports=K}),iq=l$(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var K=(Oq(),w6(jq)),P=K.Buffer;function _(j,z){for(var J in j)z[J]=j[J]}if(P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow)q.exports=K;else _(K,$),$.Buffer=O;function O(j,z,J){return P(j,z,J)}O.prototype=Object.create(P.prototype),_(P,O),O.from=function(j,z,J){if(typeof j==="number")throw TypeError("Argument must not be a number");return P(j,z,J)},O.alloc=function(j,z,J){if(typeof j!=="number")throw TypeError("Argument must be a number");var w=P(j);if(z!==void 0)if(typeof J==="string")w.fill(z,J);else w.fill(z);else w.fill(0);return w},O.allocUnsafe=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return P(j)},O.allocUnsafeSlow=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return K.SlowBuffer(j)}}),GH=l$(($,q)=>{var K=iq().Buffer;q.exports=function(P,_,O){if(K.isBuffer(P))return P;else if(typeof P==="string")return K.from(P,_);else if(ArrayBuffer.isView(P))return K.from(P.buffer);else throw TypeError(O+" must be a string, a Buffer, a typed array or a DataView")}}),lS=l$(($,q)=>{var K={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20},P=dS(),_=iq().Buffer,O=kH(),j=AH(),z=GH();function J(w,G,f,A,V){O(f,A),w=z(w,j,"Password"),G=z(G,j,"Salt"),V=V||"sha1";var C=_.allocUnsafe(A),E=_.allocUnsafe(G.length+4);G.copy(E,0,0,G.length);var R=0,I=K[V],D=Math.ceil(A/I);for(var b=1;b<=D;b++){E.writeUInt32BE(b,G.length);var u=P(V,w).update(E).digest(),y=u;for(var c=1;c<f;c++){y=P(V,w).update(y).digest();for(var m=0;m<I;m++)u[m]^=y[m]}u.copy(C,R),R+=I}return C}q.exports=J}),jl=l$(($,q)=>{var K=iq().Buffer,P=kH(),_=AH(),O=lS(),j=GH(),z,J=globalThis.crypto&&globalThis.crypto.subtle,w={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},G=[];function f(R){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!J||!J.importKey||!J.deriveBits)return Promise.resolve(!1);if(G[R]!==void 0)return G[R];z=z||K.alloc(8);var I=C(z,z,10,128,R).then(function(){return!0}).catch(function(){return!1});return G[R]=I,I}var A;function V(){if(A)return A;if(globalThis.process&&globalThis.process.nextTick)A=globalThis.process.nextTick;else if(globalThis.queueMicrotask)A=globalThis.queueMicrotask;else if(globalThis.setImmediate)A=globalThis.setImmediate;else A=globalThis.setTimeout;return A}function C(R,I,D,b,u){return J.importKey("raw",R,{name:"PBKDF2"},!1,["deriveBits"]).then(function(y){return J.deriveBits({name:"PBKDF2",salt:I,iterations:D,hash:{name:u}},y,b<<3)}).then(function(y){return K.from(y)})}function E(R,I){R.then(function(D){V()(function(){I(null,D)})},function(D){V()(function(){I(D)})})}q.exports=function(R,I,D,b,u,y){if(typeof u==="function")y=u,u=void 0;u=u||"sha1";var c=w[u.toLowerCase()];if(!c||typeof globalThis.Promise!=="function"){V()(function(){var m;try{m=O(R,I,D,b,u)}catch(q$){return y(q$)}y(null,m)});return}if(P(D,b),R=j(R,_,"Password"),I=j(I,_,"Salt"),typeof y!=="function")throw Error("No callback provided to pbkdf2");E(f(c).then(function(m){if(m)return C(R,I,D,b,c);return O(R,I,D,b,u)}),y)}}),oS=l$(($)=>{var q=(Bq(),w6(tq)),K=kH(),P=AH(),_=GH();function O(z,J,w,G,f,A){if(K(w,G),z=_(z,P,"Password"),J=_(J,P,"Salt"),typeof f==="function")A=f,f="sha1";if(typeof A!=="function")throw Error("No callback provided to pbkdf2");return q.pbkdf2(z,J,w,G,f,A)}function j(z,J,w,G,f){return K(w,G),z=_(z,P,"Password"),J=_(J,P,"Salt"),f=f||"sha1",q.pbkdf2Sync(z,J,w,G,f)}if(!q.pbkdf2Sync||q.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)$.pbkdf2Sync=lS(),$.pbkdf2=jl();else $.pbkdf2Sync=j,$.pbkdf2=O}),Ol=l$(($)=>{var q=(Bq(),w6(tq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),Yl=l$(($)=>{var q=(Bq(),w6(tq));$.DiffieHellmanGroup=q.DiffieHellmanGroup,$.createDiffieHellmanGroup=q.createDiffieHellmanGroup,$.getDiffieHellman=q.getDiffieHellman,$.createDiffieHellman=q.createDiffieHellman,$.DiffieHellman=q.DiffieHellman}),vl=l$(($)=>{var q=(Bq(),w6(tq));$.createSign=q.createSign,$.Sign=q.Sign,$.createVerify=q.createVerify,$.Verify=q.Verify}),zl=l$(($,q)=>{q.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),fK=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(Oq(),w6(jq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var X=Y.length-H;for(W=X%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function G(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,X=Math.min(S,S-N)+T,v=0;for(var k=T;k<X;k+=W)if(v=G(Y,k,k+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var g=1;v=G(Y,k,Y.length,H);for(k=0;k<N;k++)g*=H;if(this.imuln(g),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],X=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=f[6-X.length]+X+T;else T=X+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=A[Y],k=V[Y];T="";var g=this.clone();g.negative=0;while(!g.isZero()){var h=g.modn(k).toString(Y);if(g=g.idivn(k),!g.isZero())T=f[v-h.length]+h+T;else T=h+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),X,v,k=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[Z-v-1]=X}else{for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[v]=X;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,X=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var k=X>>>26,g=X&67108863,h=Math.min(v,Y.length-1);for(var L=Math.max(0,v-M.length+1);L<=h;L++){var d=v-L|0;W=M.words[d]|0,Z=Y.words[L]|0,S=W*Z+g,k+=S/67108864|0,g=S&67108863}H.words[v]=g|0,X=k|0}if(X!==0)H.words[v]=X|0;else H.length--;return H.strip()}var R=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,X,v,k,g=W[0]|0,h=g&8191,L=g>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,t=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,o=a&8191,B=a>>>13,p$=W[5]|0,$$=p$&8191,s=p$>>>13,Q=W[6]|0,U=Q&8191,_$=Q>>>13,X$=W[7]|0,O$=X$&8191,T$=X$>>>13,j6=W[8]|0,H$=j6&8191,f$=j6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,b6=Z[0]|0,k$=b6&8191,I$=b6>>>13,Yq=Z[1]|0,D$=Yq&8191,g$=Yq>>>13,Aq=Z[2]|0,C$=Aq&8191,E$=Aq>>>13,Gq=Z[3]|0,h$=Gq&8191,V$=Gq>>>13,Vq=Z[4]|0,L$=Vq&8191,S$=Vq>>>13,vq=Z[5]|0,p=vq&8191,x=vq>>>13,x$=Z[6]|0,K$=x$&8191,j$=x$>>>13,f6=Z[7]|0,Z$=f6&8191,A$=f6>>>13,zq=Z[8]|0,b$=zq&8191,R$=zq>>>13,Wq=Z[9]|0,M$=Wq&8191,N$=Wq>>>13;T.negative=Y.negative^H.negative,T.length=19,X=Math.imul(h,k$),v=Math.imul(h,I$),v=v+Math.imul(L,k$)|0,k=Math.imul(L,I$);var D6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(D6>>>26)|0,D6&=67108863,X=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,k=Math.imul(F,I$),X=X+Math.imul(h,D$)|0,v=v+Math.imul(h,g$)|0,v=v+Math.imul(L,D$)|0,k=k+Math.imul(L,g$)|0;var O6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(O6>>>26)|0,O6&=67108863,X=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(t,k$)|0,k=Math.imul(t,I$),X=X+Math.imul(i,D$)|0,v=v+Math.imul(i,g$)|0,v=v+Math.imul(F,D$)|0,k=k+Math.imul(F,g$)|0,X=X+Math.imul(h,C$)|0,v=v+Math.imul(h,E$)|0,v=v+Math.imul(L,C$)|0,k=k+Math.imul(L,E$)|0;var K6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,X=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,k=Math.imul(v$,I$),X=X+Math.imul(n,D$)|0,v=v+Math.imul(n,g$)|0,v=v+Math.imul(t,D$)|0,k=k+Math.imul(t,g$)|0,X=X+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,k=k+Math.imul(F,E$)|0,X=X+Math.imul(h,h$)|0,v=v+Math.imul(h,V$)|0,v=v+Math.imul(L,h$)|0,k=k+Math.imul(L,V$)|0;var A6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(A6>>>26)|0,A6&=67108863,X=Math.imul(o,k$),v=Math.imul(o,I$),v=v+Math.imul(B,k$)|0,k=Math.imul(B,I$),X=X+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,g$)|0,v=v+Math.imul(v$,D$)|0,k=k+Math.imul(v$,g$)|0,X=X+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(t,C$)|0,k=k+Math.imul(t,E$)|0,X=X+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,k=k+Math.imul(F,V$)|0,X=X+Math.imul(h,L$)|0,v=v+Math.imul(h,S$)|0,v=v+Math.imul(L,L$)|0,k=k+Math.imul(L,S$)|0;var m6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(m6>>>26)|0,m6&=67108863,X=Math.imul($$,k$),v=Math.imul($$,I$),v=v+Math.imul(s,k$)|0,k=Math.imul(s,I$),X=X+Math.imul(o,D$)|0,v=v+Math.imul(o,g$)|0,v=v+Math.imul(B,D$)|0,k=k+Math.imul(B,g$)|0,X=X+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,k=k+Math.imul(v$,E$)|0,X=X+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(t,h$)|0,k=k+Math.imul(t,V$)|0,X=X+Math.imul(i,L$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,L$)|0,k=k+Math.imul(F,S$)|0,X=X+Math.imul(h,p)|0,v=v+Math.imul(h,x)|0,v=v+Math.imul(L,p)|0,k=k+Math.imul(L,x)|0;var d6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,X=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,k=Math.imul(_$,I$),X=X+Math.imul($$,D$)|0,v=v+Math.imul($$,g$)|0,v=v+Math.imul(s,D$)|0,k=k+Math.imul(s,g$)|0,X=X+Math.imul(o,C$)|0,v=v+Math.imul(o,E$)|0,v=v+Math.imul(B,C$)|0,k=k+Math.imul(B,E$)|0,X=X+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,k=k+Math.imul(v$,V$)|0,X=X+Math.imul(n,L$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(t,L$)|0,k=k+Math.imul(t,S$)|0,X=X+Math.imul(i,p)|0,v=v+Math.imul(i,x)|0,v=v+Math.imul(F,p)|0,k=k+Math.imul(F,x)|0,X=X+Math.imul(h,K$)|0,v=v+Math.imul(h,j$)|0,v=v+Math.imul(L,K$)|0,k=k+Math.imul(L,j$)|0;var l6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,X=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,k=Math.imul(T$,I$),X=X+Math.imul(U,D$)|0,v=v+Math.imul(U,g$)|0,v=v+Math.imul(_$,D$)|0,k=k+Math.imul(_$,g$)|0,X=X+Math.imul($$,C$)|0,v=v+Math.imul($$,E$)|0,v=v+Math.imul(s,C$)|0,k=k+Math.imul(s,E$)|0,X=X+Math.imul(o,h$)|0,v=v+Math.imul(o,V$)|0,v=v+Math.imul(B,h$)|0,k=k+Math.imul(B,V$)|0,X=X+Math.imul(Y$,L$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,L$)|0,k=k+Math.imul(v$,S$)|0,X=X+Math.imul(n,p)|0,v=v+Math.imul(n,x)|0,v=v+Math.imul(t,p)|0,k=k+Math.imul(t,x)|0,X=X+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,k=k+Math.imul(F,j$)|0,X=X+Math.imul(h,Z$)|0,v=v+Math.imul(h,A$)|0,v=v+Math.imul(L,Z$)|0,k=k+Math.imul(L,A$)|0;var o6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,X=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(f$,k$)|0,k=Math.imul(f$,I$),X=X+Math.imul(O$,D$)|0,v=v+Math.imul(O$,g$)|0,v=v+Math.imul(T$,D$)|0,k=k+Math.imul(T$,g$)|0,X=X+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,k=k+Math.imul(_$,E$)|0,X=X+Math.imul($$,h$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(s,h$)|0,k=k+Math.imul(s,V$)|0,X=X+Math.imul(o,L$)|0,v=v+Math.imul(o,S$)|0,v=v+Math.imul(B,L$)|0,k=k+Math.imul(B,S$)|0,X=X+Math.imul(Y$,p)|0,v=v+Math.imul(Y$,x)|0,v=v+Math.imul(v$,p)|0,k=k+Math.imul(v$,x)|0,X=X+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(t,K$)|0,k=k+Math.imul(t,j$)|0,X=X+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,k=k+Math.imul(F,A$)|0,X=X+Math.imul(h,b$)|0,v=v+Math.imul(h,R$)|0,v=v+Math.imul(L,b$)|0,k=k+Math.imul(L,R$)|0;var r6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,X=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,k=Math.imul(G$,I$),X=X+Math.imul(H$,D$)|0,v=v+Math.imul(H$,g$)|0,v=v+Math.imul(f$,D$)|0,k=k+Math.imul(f$,g$)|0,X=X+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,k=k+Math.imul(T$,E$)|0,X=X+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,k=k+Math.imul(_$,V$)|0,X=X+Math.imul($$,L$)|0,v=v+Math.imul($$,S$)|0,v=v+Math.imul(s,L$)|0,k=k+Math.imul(s,S$)|0,X=X+Math.imul(o,p)|0,v=v+Math.imul(o,x)|0,v=v+Math.imul(B,p)|0,k=k+Math.imul(B,x)|0,X=X+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,k=k+Math.imul(v$,j$)|0,X=X+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(t,Z$)|0,k=k+Math.imul(t,A$)|0,X=X+Math.imul(i,b$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,b$)|0,k=k+Math.imul(F,R$)|0,X=X+Math.imul(h,M$)|0,v=v+Math.imul(h,N$)|0,v=v+Math.imul(L,M$)|0,k=k+Math.imul(L,N$)|0;var n6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,X=Math.imul(w$,D$),v=Math.imul(w$,g$),v=v+Math.imul(G$,D$)|0,k=Math.imul(G$,g$),X=X+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(f$,C$)|0,k=k+Math.imul(f$,E$)|0,X=X+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,k=k+Math.imul(T$,V$)|0,X=X+Math.imul(U,L$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,L$)|0,k=k+Math.imul(_$,S$)|0,X=X+Math.imul($$,p)|0,v=v+Math.imul($$,x)|0,v=v+Math.imul(s,p)|0,k=k+Math.imul(s,x)|0,X=X+Math.imul(o,K$)|0,v=v+Math.imul(o,j$)|0,v=v+Math.imul(B,K$)|0,k=k+Math.imul(B,j$)|0,X=X+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,k=k+Math.imul(v$,A$)|0,X=X+Math.imul(n,b$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(t,b$)|0,k=k+Math.imul(t,R$)|0,X=X+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,k=k+Math.imul(F,N$)|0;var i6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,X=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,k=Math.imul(G$,E$),X=X+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(f$,h$)|0,k=k+Math.imul(f$,V$)|0,X=X+Math.imul(O$,L$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,L$)|0,k=k+Math.imul(T$,S$)|0,X=X+Math.imul(U,p)|0,v=v+Math.imul(U,x)|0,v=v+Math.imul(_$,p)|0,k=k+Math.imul(_$,x)|0,X=X+Math.imul($$,K$)|0,v=v+Math.imul($$,j$)|0,v=v+Math.imul(s,K$)|0,k=k+Math.imul(s,j$)|0,X=X+Math.imul(o,Z$)|0,v=v+Math.imul(o,A$)|0,v=v+Math.imul(B,Z$)|0,k=k+Math.imul(B,A$)|0,X=X+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,b$)|0,k=k+Math.imul(v$,R$)|0,X=X+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(t,M$)|0,k=k+Math.imul(t,N$)|0;var t6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,X=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,k=Math.imul(G$,V$),X=X+Math.imul(H$,L$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(f$,L$)|0,k=k+Math.imul(f$,S$)|0,X=X+Math.imul(O$,p)|0,v=v+Math.imul(O$,x)|0,v=v+Math.imul(T$,p)|0,k=k+Math.imul(T$,x)|0,X=X+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,k=k+Math.imul(_$,j$)|0,X=X+Math.imul($$,Z$)|0,v=v+Math.imul($$,A$)|0,v=v+Math.imul(s,Z$)|0,k=k+Math.imul(s,A$)|0,X=X+Math.imul(o,b$)|0,v=v+Math.imul(o,R$)|0,v=v+Math.imul(B,b$)|0,k=k+Math.imul(B,R$)|0,X=X+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,k=k+Math.imul(v$,N$)|0;var B6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,X=Math.imul(w$,L$),v=Math.imul(w$,S$),v=v+Math.imul(G$,L$)|0,k=Math.imul(G$,S$),X=X+Math.imul(H$,p)|0,v=v+Math.imul(H$,x)|0,v=v+Math.imul(f$,p)|0,k=k+Math.imul(f$,x)|0,X=X+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,k=k+Math.imul(T$,j$)|0,X=X+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,k=k+Math.imul(_$,A$)|0,X=X+Math.imul($$,b$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(s,b$)|0,k=k+Math.imul(s,R$)|0,X=X+Math.imul(o,M$)|0,v=v+Math.imul(o,N$)|0,v=v+Math.imul(B,M$)|0,k=k+Math.imul(B,N$)|0;var U6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,X=Math.imul(w$,p),v=Math.imul(w$,x),v=v+Math.imul(G$,p)|0,k=Math.imul(G$,x),X=X+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(f$,K$)|0,k=k+Math.imul(f$,j$)|0,X=X+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,k=k+Math.imul(T$,A$)|0,X=X+Math.imul(U,b$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,b$)|0,k=k+Math.imul(_$,R$)|0,X=X+Math.imul($$,M$)|0,v=v+Math.imul($$,N$)|0,v=v+Math.imul(s,M$)|0,k=k+Math.imul(s,N$)|0;var F6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,X=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,k=Math.imul(G$,j$),X=X+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(f$,Z$)|0,k=k+Math.imul(f$,A$)|0,X=X+Math.imul(O$,b$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,b$)|0,k=k+Math.imul(T$,R$)|0,X=X+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,k=k+Math.imul(_$,N$)|0;var a6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,X=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,k=Math.imul(G$,A$),X=X+Math.imul(H$,b$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(f$,b$)|0,k=k+Math.imul(f$,R$)|0,X=X+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,k=k+Math.imul(T$,N$)|0;var Q6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,X=Math.imul(w$,b$),v=Math.imul(w$,R$),v=v+Math.imul(G$,b$)|0,k=Math.imul(G$,R$),X=X+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(f$,M$)|0,k=k+Math.imul(f$,N$)|0;var e6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,X=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,k=Math.imul(G$,N$);var s6=(N+X|0)+((v&8191)<<13)|0;if(N=(k+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,S[0]=D6,S[1]=O6,S[2]=K6,S[3]=A6,S[4]=m6,S[5]=d6,S[6]=l6,S[7]=o6,S[8]=r6,S[9]=n6,S[10]=i6,S[11]=t6,S[12]=B6,S[13]=U6,S[14]=F6,S[15]=a6,S[16]=Q6,S[17]=e6,S[18]=s6,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)R=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,X=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=X;v++){var k=Z-v,g=M.words[k]|0,h=Y.words[v]|0,L=g*h,d=L&67108863;S=S+(L/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new b;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=R(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function b(M,Y){this.x=M,this.y=Y}b.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},b.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},b.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},b.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var X=N<<1,v=Math.cos(2*Math.PI/X),k=Math.sin(2*Math.PI/X);for(var g=0;g<Z;g+=X){var h=v,L=k;for(var d=0;d<N;d++){var i=T[g+d],F=W[g+d],W$=T[g+d+N],n=W[g+d+N],t=h*W$-L*n;if(n=h*n+L*W$,W$=t,T[g+d]=i+W$,W[g+d]=F+n,T[g+d+N]=i-W$,W[g+d+N]=F-n,d!==X)t=v*h-k*L,L=v*L+k*h,h=t}}}},b.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},b.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},b.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},b.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},b.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},b.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),X=Array(W),v=Array(W),k=Array(W),g=Array(W),h=Array(W),L=T.words;L.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,k,W),this.transform(N,S,X,v,W,Z),this.transform(k,S,g,h,W,Z);for(var d=0;d<W;d++){var i=X[d]*g[d]-v[d]*h[d];v[d]=X[d]*h[d]+v[d]*g[d],X[d]=i}return this.conjugate(X,v,W),this.transform(X,v,L,S,W,Z),this.conjugate(L,S,W),this.normalize13b(L,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,X=(this.words[Z]|0)-N<<H;this.words[Z]=X|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,X=T;if(W-=S,W=Math.max(0,W),X){for(var v=0;v<S;v++)X.words[v]=this.words[v];X.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var k=0;for(v=this.length-1;v>=0&&(k!==0||v>=W);v--){var g=this.words[v]|0;this.words[v]=k<<26-Z|g>>>Z,k=g&N}if(X&&k!==0)X.words[X.length++]=k;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var X=(Y.words[Z]|0)*H;S-=X&67108863,N=(S>>26)-(X/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var X=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=X+1,v.words=Array(v.length);for(var k=0;k<v.length;k++)v.words[k]=0}var g=W.clone()._ishlnsubmul(Z,1,X);if(g.negative===0){if(W=g,v)v.words[X]=1}for(var h=X-1;h>=0;h--){var L=(W.words[Z.length+h]|0)*67108864+(W.words[Z.length+h-1]|0);L=Math.min(L/S|0,67108863),W._ishlnsubmul(Z,L,h);while(W.negative!==0)if(L--,W.negative=0,W._ishlnsubmul(Z,1,h),!W.isZero())W.negative^=1;if(v)v.words[h]=L}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),X=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++X;var v=T.clone(),k=H.clone();while(!H.isZero()){for(var g=0,h=1;(H.words[0]&h)===0&&g<26;++g,h<<=1);if(g>0){H.iushrn(g);while(g-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(k);W.iushrn(1),Z.iushrn(1)}}for(var L=0,d=1;(T.words[0]&d)===0&&L<26;++L,d<<=1);if(L>0){T.iushrn(L);while(L-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(k);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(X)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,X=1;(H.words[0]&X)===0&&N<26;++N,X<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,k=1;(T.words[0]&k)===0&&v<26;++v,k<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var g;if(H.cmpn(1)===0)g=W;else g=Z;if(g.cmpn(0)<0)g.iadd(Y);return g},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(c,y),c.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},c.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function q$(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(q$,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new c;else if(Y==="p224")H=new m;else if(Y==="p192")H=new q$;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),X=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,X).cmp(N)!==0)v.redIAdd(N);var k=this.pow(v,W),g=this.pow(Y,W.addn(1).iushrn(1)),h=this.pow(Y,W),L=Z;while(h.cmp(S)!==0){var d=h;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<L);var F=this.pow(k,new j(1).iushln(L-i-1));g=g.redMul(F),k=F.redSqr(),h=h.redMul(k),L=i}return g},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,X=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var k=H.words[Z];for(var g=v-1;g>=0;g--){var h=k>>g&1;if(S!==W[0])S=this.sqr(S);if(h===0&&N===0){X=0;continue}if(N<<=1,N|=h,X++,X!==T&&(Z!==0||g!==0))continue;S=this.mul(S,W[N]),X=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new r(Y)};function r(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}O(r,l),r.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},r.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},r.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),lK=l$(($,q)=>{q.exports=K;function K(P,_){if(!P)throw Error(_||"Assertion failed")}K.equal=function(_,O,j){if(_!=O)throw Error(j||"Assertion failed: "+_+" != "+O)}}),rS=l$(($)=>{var q=$;function K(O,j){if(Array.isArray(O))return O.slice();if(!O)return[];var z=[];if(typeof O!=="string"){for(var J=0;J<O.length;J++)z[J]=O[J]|0;return z}if(j==="hex"){if(O=O.replace(/[^a-z0-9]+/ig,""),O.length%2!==0)O="0"+O;for(var J=0;J<O.length;J+=2)z.push(parseInt(O[J]+O[J+1],16))}else for(var J=0;J<O.length;J++){var w=O.charCodeAt(J),G=w>>8,f=w&255;if(G)z.push(G,f);else z.push(f)}return z}q.toArray=K;function P(O){if(O.length===1)return"0"+O;else return O}q.zero2=P;function _(O){var j="";for(var z=0;z<O.length;z++)j+=P(O[z].toString(16));return j}q.toHex=_,q.encode=function(j,z){if(z==="hex")return _(j);else return j}}),Z8=l$(($)=>{var q=$,K=fK(),P=lK(),_=rS();q.assert=P,q.toArray=_.toArray,q.zero2=_.zero2,q.toHex=_.toHex,q.encode=_.encode;function O(G,f,A){var V=Array(Math.max(G.bitLength(),A)+1),C;for(C=0;C<V.length;C+=1)V[C]=0;var E=1<<f+1,R=G.clone();for(C=0;C<V.length;C++){var I,D=R.andln(E-1);if(R.isOdd()){if(D>(E>>1)-1)I=(E>>1)-D;else I=D;R.isubn(I)}else I=0;V[C]=I,R.iushrn(1)}return V}q.getNAF=O;function j(G,f){var A=[[],[]];G=G.clone(),f=f.clone();var V=0,C=0,E;while(G.cmpn(-V)>0||f.cmpn(-C)>0){var R=G.andln(3)+V&3,I=f.andln(3)+C&3;if(R===3)R=-1;if(I===3)I=-1;var D;if((R&1)===0)D=0;else if(E=G.andln(7)+V&7,(E===3||E===5)&&I===2)D=-R;else D=R;A[0].push(D);var b;if((I&1)===0)b=0;else if(E=f.andln(7)+C&7,(E===3||E===5)&&R===2)b=-I;else b=I;if(A[1].push(b),2*V===D+1)V=1-V;if(2*C===b+1)C=1-C;G.iushrn(1),f.iushrn(1)}return A}q.getJSF=j;function z(G,f,A){var V="_"+f;G.prototype[f]=function(){return this[V]!==void 0?this[V]:this[V]=A.call(this)}}q.cachedProperty=z;function J(G){return typeof G==="string"?q.toArray(G,"hex"):G}q.parseBytes=J;function w(G){return new K(G,"hex","le")}q.intFromLE=w}),nS=l$(($,q)=>{var K;q.exports=function(j){if(!K)K=new P(null);return K.generate(j)};function P(O){this.rand=O}if(q.exports.Rand=P,P.prototype.generate=function(j){return this._rand(j)},P.prototype._rand=function(j){if(this.rand.getBytes)return this.rand.getBytes(j);var z=new Uint8Array(j);for(var J=0;J<z.length;J++)z[J]=this.rand.getByte();return z},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)P.prototype._rand=function(j){var z=new Uint8Array(j);return self.crypto.getRandomValues(z),z};else if(self.msCrypto&&self.msCrypto.getRandomValues)P.prototype._rand=function(j){var z=new Uint8Array(j);return self.msCrypto.getRandomValues(z),z};else if(typeof window==="object")P.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(_=(Bq(),w6(tq)),typeof _.randomBytes!=="function")throw Error("Not supported");P.prototype._rand=function(j){return _.randomBytes(j)}}catch(O){}var _}),aj=l$(($,q)=>{var K=fK(),P=Z8(),_=P.getNAF,O=P.getJSF,j=P.assert;function z(w,G){this.type=w,this.p=new K(G.p,16),this.red=G.prime?K.red(G.prime):K.mont(this.p),this.zero=new K(0).toRed(this.red),this.one=new K(1).toRed(this.red),this.two=new K(2).toRed(this.red),this.n=G.n&&new K(G.n,16),this.g=G.g&&this.pointFromJSON(G.g,G.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var f=this.n&&this.p.div(this.n);if(!f||f.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}q.exports=z,z.prototype.point=function(){throw Error("Not implemented")},z.prototype.validate=function(){throw Error("Not implemented")},z.prototype._fixedNafMul=function(G,f){j(G.precomputed);var A=G._getDoubles(),V=_(f,1,this._bitLength),C=(1<<A.step+1)-(A.step%2===0?2:1);C/=3;var E=[],R,I;for(R=0;R<V.length;R+=A.step){I=0;for(var D=R+A.step-1;D>=R;D--)I=(I<<1)+V[D];E.push(I)}var b=this.jpoint(null,null,null),u=this.jpoint(null,null,null);for(var y=C;y>0;y--){for(R=0;R<E.length;R++)if(I=E[R],I===y)u=u.mixedAdd(A.points[R]);else if(I===-y)u=u.mixedAdd(A.points[R].neg());b=b.add(u)}return b.toP()},z.prototype._wnafMul=function(G,f){var A=4,V=G._getNAFPoints(A);A=V.wnd;var C=V.points,E=_(f,A,this._bitLength),R=this.jpoint(null,null,null);for(var I=E.length-1;I>=0;I--){for(var D=0;I>=0&&E[I]===0;I--)D++;if(I>=0)D++;if(R=R.dblp(D),I<0)break;var b=E[I];if(j(b!==0),G.type==="affine")if(b>0)R=R.mixedAdd(C[b-1>>1]);else R=R.mixedAdd(C[-b-1>>1].neg());else if(b>0)R=R.add(C[b-1>>1]);else R=R.add(C[-b-1>>1].neg())}return G.type==="affine"?R.toP():R},z.prototype._wnafMulAdd=function(G,f,A,V,C){var E=this._wnafT1,R=this._wnafT2,I=this._wnafT3,D=0,b,u,y;for(b=0;b<V;b++){y=f[b];var c=y._getNAFPoints(G);E[b]=c.wnd,R[b]=c.points}for(b=V-1;b>=1;b-=2){var m=b-1,q$=b;if(E[m]!==1||E[q$]!==1){I[m]=_(A[m],E[m],this._bitLength),I[q$]=_(A[q$],E[q$],this._bitLength),D=Math.max(I[m].length,D),D=Math.max(I[q$].length,D);continue}var e=[f[m],null,null,f[q$]];if(f[m].y.cmp(f[q$].y)===0)e[1]=f[m].add(f[q$]),e[2]=f[m].toJ().mixedAdd(f[q$].neg());else if(f[m].y.cmp(f[q$].y.redNeg())===0)e[1]=f[m].toJ().mixedAdd(f[q$]),e[2]=f[m].add(f[q$].neg());else e[1]=f[m].toJ().mixedAdd(f[q$]),e[2]=f[m].toJ().mixedAdd(f[q$].neg());var l=[-3,-1,-5,-7,0,7,5,1,3],r=O(A[m],A[q$]);D=Math.max(r[0].length,D),I[m]=Array(D),I[q$]=Array(D);for(u=0;u<D;u++){var M=r[0][u]|0,Y=r[1][u]|0;I[m][u]=l[(M+1)*3+(Y+1)],I[q$][u]=0,R[m]=e}}var H=this.jpoint(null,null,null),T=this._wnafT4;for(b=D;b>=0;b--){var W=0;while(b>=0){var Z=!0;for(u=0;u<V;u++)if(T[u]=I[u][b]|0,T[u]!==0)Z=!1;if(!Z)break;W++,b--}if(b>=0)W++;if(H=H.dblp(W),b<0)break;for(u=0;u<V;u++){var S=T[u];if(S===0)continue;else if(S>0)y=R[u][S-1>>1];else if(S<0)y=R[u][-S-1>>1].neg();if(y.type==="affine")H=H.mixedAdd(y);else H=H.add(y)}}for(b=0;b<V;b++)R[b]=null;if(C)return H;else return H.toP()};function J(w,G){this.curve=w,this.type=G,this.precomputed=null}z.BasePoint=J,J.prototype.eq=function(){throw Error("Not implemented")},J.prototype.validate=function(){return this.curve.validate(this)},z.prototype.decodePoint=function(G,f){G=P.toArray(G,f);var A=this.p.byteLength();if((G[0]===4||G[0]===6||G[0]===7)&&G.length-1===2*A){if(G[0]===6)j(G[G.length-1]%2===0);else if(G[0]===7)j(G[G.length-1]%2===1);var V=this.point(G.slice(1,1+A),G.slice(1+A,1+2*A));return V}else if((G[0]===2||G[0]===3)&&G.length-1===A)return this.pointFromX(G.slice(1,1+A),G[0]===3);throw Error("Unknown point format")},J.prototype.encodeCompressed=function(G){return this.encode(G,!0)},J.prototype._encode=function(G){var f=this.curve.p.byteLength(),A=this.getX().toArray("be",f);if(G)return[this.getY().isEven()?2:3].concat(A);return[4].concat(A,this.getY().toArray("be",f))},J.prototype.encode=function(G,f){return P.encode(this._encode(f),G)},J.prototype.precompute=function(G){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,G),f.beta=this._getBeta(),this.precomputed=f,this},J.prototype._hasDoubles=function(G){if(!this.precomputed)return!1;var f=this.precomputed.doubles;if(!f)return!1;return f.points.length>=Math.ceil((G.bitLength()+1)/f.step)},J.prototype._getDoubles=function(G,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var A=[this],V=this;for(var C=0;C<f;C+=G){for(var E=0;E<G;E++)V=V.dbl();A.push(V)}return{step:G,points:A}},J.prototype._getNAFPoints=function(G){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var f=[this],A=(1<<G)-1,V=A===1?null:this.dbl();for(var C=1;C<A;C++)f[C]=f[C-1].add(V);return{wnd:G,points:f}},J.prototype._getBeta=function(){return null},J.prototype.dblp=function(G){var f=this;for(var A=0;A<G;A++)f=f.dbl();return f}}),Wl=l$(($,q)=>{if(typeof Object.create==="function")q.exports=function(P,_){if(_)P.super_=_,P.prototype=Object.create(_.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}})};else q.exports=function(P,_){if(_){P.super_=_;var O=function(){};O.prototype=_.prototype,P.prototype=new O,P.prototype.constructor=P}}}),K8=l$(($,q)=>{try{if(K=(wS(),w6(TS)),typeof K.inherits!=="function")throw"";q.exports=K.inherits}catch(P){q.exports=Wl()}var K}),Hl=l$(($,q)=>{var K=Z8(),P=fK(),_=K8(),O=aj(),j=K.assert;function z(G){O.call(this,"short",G),this.a=new P(G.a,16).toRed(this.red),this.b=new P(G.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(G),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}_(z,O),q.exports=z,z.prototype._getEndomorphism=function(f){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var A,V;if(f.beta)A=new P(f.beta,16).toRed(this.red);else{var C=this._getEndoRoots(this.p);A=C[0].cmp(C[1])<0?C[0]:C[1],A=A.toRed(this.red)}if(f.lambda)V=new P(f.lambda,16);else{var E=this._getEndoRoots(this.n);if(this.g.mul(E[0]).x.cmp(this.g.x.redMul(A))===0)V=E[0];else V=E[1],j(this.g.mul(V).x.cmp(this.g.x.redMul(A))===0)}var R;if(f.basis)R=f.basis.map(function(I){return{a:new P(I.a,16),b:new P(I.b,16)}});else R=this._getEndoBasis(V);return{beta:A,lambda:V,basis:R}},z.prototype._getEndoRoots=function(f){var A=f===this.p?this.red:P.mont(f),V=new P(2).toRed(A).redInvm(),C=V.redNeg(),E=new P(3).toRed(A).redNeg().redSqrt().redMul(V),R=C.redAdd(E).fromRed(),I=C.redSub(E).fromRed();return[R,I]},z.prototype._getEndoBasis=function(f){var A=this.n.ushrn(Math.floor(this.n.bitLength()/2)),V=f,C=this.n.clone(),E=new P(1),R=new P(0),I=new P(0),D=new P(1),b,u,y,c,m,q$,e,l=0,r,M;while(V.cmpn(0)!==0){var Y=C.div(V);r=C.sub(Y.mul(V)),M=I.sub(Y.mul(E));var H=D.sub(Y.mul(R));if(!y&&r.cmp(A)<0)b=e.neg(),u=E,y=r.neg(),c=M;else if(y&&++l===2)break;e=r,C=V,V=r,I=E,E=M,D=R,R=H}m=r.neg(),q$=M;var T=y.sqr().add(c.sqr()),W=m.sqr().add(q$.sqr());if(W.cmp(T)>=0)m=b,q$=u;if(y.negative)y=y.neg(),c=c.neg();if(m.negative)m=m.neg(),q$=q$.neg();return[{a:y,b:c},{a:m,b:q$}]},z.prototype._endoSplit=function(f){var A=this.endo.basis,V=A[0],C=A[1],E=C.b.mul(f).divRound(this.n),R=V.b.neg().mul(f).divRound(this.n),I=E.mul(V.a),D=R.mul(C.a),b=E.mul(V.b),u=R.mul(C.b),y=f.sub(I).sub(D),c=b.add(u).neg();return{k1:y,k2:c}},z.prototype.pointFromX=function(f,A){if(f=new P(f,16),!f.red)f=f.toRed(this.red);var V=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),C=V.redSqrt();if(C.redSqr().redSub(V).cmp(this.zero)!==0)throw Error("invalid point");var E=C.fromRed().isOdd();if(A&&!E||!A&&E)C=C.redNeg();return this.point(f,C)},z.prototype.validate=function(f){if(f.inf)return!0;var{x:A,y:V}=f,C=this.a.redMul(A),E=A.redSqr().redMul(A).redIAdd(C).redIAdd(this.b);return V.redSqr().redISub(E).cmpn(0)===0},z.prototype._endoWnafMulAdd=function(f,A,V){var C=this._endoWnafT1,E=this._endoWnafT2;for(var R=0;R<f.length;R++){var I=this._endoSplit(A[R]),D=f[R],b=D._getBeta();if(I.k1.negative)I.k1.ineg(),D=D.neg(!0);if(I.k2.negative)I.k2.ineg(),b=b.neg(!0);C[R*2]=D,C[R*2+1]=b,E[R*2]=I.k1,E[R*2+1]=I.k2}var u=this._wnafMulAdd(1,C,E,R*2,V);for(var y=0;y<R*2;y++)C[y]=null,E[y]=null;return u};function J(G,f,A,V){if(O.BasePoint.call(this,G,"affine"),f===null&&A===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new P(f,16),this.y=new P(A,16),V)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}_(J,O.BasePoint),z.prototype.point=function(f,A,V){return new J(this,f,A,V)},z.prototype.pointFromJSON=function(f,A){return J.fromJSON(this,f,A)},J.prototype._getBeta=function(){if(!this.curve.endo)return;var f=this.precomputed;if(f&&f.beta)return f.beta;var A=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var V=this.curve,C=function(E){return V.point(E.x.redMul(V.endo.beta),E.y)};f.beta=A,A.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(C)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(C)}}}return A},J.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},J.fromJSON=function(f,A,V){if(typeof A==="string")A=JSON.parse(A);var C=f.point(A[0],A[1],V);if(!A[2])return C;function E(I){return f.point(I[0],I[1],V)}var R=A[2];return C.precomputed={beta:null,doubles:R.doubles&&{step:R.doubles.step,points:[C].concat(R.doubles.points.map(E))},naf:R.naf&&{wnd:R.naf.wnd,points:[C].concat(R.naf.points.map(E))}},C},J.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},J.prototype.isInfinity=function(){return this.inf},J.prototype.add=function(f){if(this.inf)return f;if(f.inf)return this;if(this.eq(f))return this.dbl();if(this.neg().eq(f))return this.curve.point(null,null);if(this.x.cmp(f.x)===0)return this.curve.point(null,null);var A=this.y.redSub(f.y);if(A.cmpn(0)!==0)A=A.redMul(this.x.redSub(f.x).redInvm());var V=A.redSqr().redISub(this.x).redISub(f.x),C=A.redMul(this.x.redSub(V)).redISub(this.y);return this.curve.point(V,C)},J.prototype.dbl=function(){if(this.inf)return this;var f=this.y.redAdd(this.y);if(f.cmpn(0)===0)return this.curve.point(null,null);var A=this.curve.a,V=this.x.redSqr(),C=f.redInvm(),E=V.redAdd(V).redIAdd(V).redIAdd(A).redMul(C),R=E.redSqr().redISub(this.x.redAdd(this.x)),I=E.redMul(this.x.redSub(R)).redISub(this.y);return this.curve.point(R,I)},J.prototype.getX=function(){return this.x.fromRed()},J.prototype.getY=function(){return this.y.fromRed()},J.prototype.mul=function(f){if(f=new P(f,16),this.isInfinity())return this;else if(this._hasDoubles(f))return this.curve._fixedNafMul(this,f);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[f]);else return this.curve._wnafMul(this,f)},J.prototype.mulAdd=function(f,A,V){var C=[this,A],E=[f,V];if(this.curve.endo)return this.curve._endoWnafMulAdd(C,E);else return this.curve._wnafMulAdd(1,C,E,2)},J.prototype.jmulAdd=function(f,A,V){var C=[this,A],E=[f,V];if(this.curve.endo)return this.curve._endoWnafMulAdd(C,E,!0);else return this.curve._wnafMulAdd(1,C,E,2,!0)},J.prototype.eq=function(f){return this===f||this.inf===f.inf&&(this.inf||this.x.cmp(f.x)===0&&this.y.cmp(f.y)===0)},J.prototype.neg=function(f){if(this.inf)return this;var A=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var V=this.precomputed,C=function(E){return E.neg()};A.precomputed={naf:V.naf&&{wnd:V.naf.wnd,points:V.naf.points.map(C)},doubles:V.doubles&&{step:V.doubles.step,points:V.doubles.points.map(C)}}}return A},J.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var f=this.curve.jpoint(this.x,this.y,this.curve.one);return f};function w(G,f,A,V){if(O.BasePoint.call(this,G,"jacobian"),f===null&&A===null&&V===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new P(0);else this.x=new P(f,16),this.y=new P(A,16),this.z=new P(V,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}_(w,O.BasePoint),z.prototype.jpoint=function(f,A,V){return new w(this,f,A,V)},w.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),A=f.redSqr(),V=this.x.redMul(A),C=this.y.redMul(A).redMul(f);return this.curve.point(V,C)},w.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},w.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var A=f.z.redSqr(),V=this.z.redSqr(),C=this.x.redMul(A),E=f.x.redMul(V),R=this.y.redMul(A.redMul(f.z)),I=f.y.redMul(V.redMul(this.z)),D=C.redSub(E),b=R.redSub(I);if(D.cmpn(0)===0)if(b.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var u=D.redSqr(),y=u.redMul(D),c=C.redMul(u),m=b.redSqr().redIAdd(y).redISub(c).redISub(c),q$=b.redMul(c.redISub(m)).redISub(R.redMul(y)),e=this.z.redMul(f.z).redMul(D);return this.curve.jpoint(m,q$,e)},w.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var A=this.z.redSqr(),V=this.x,C=f.x.redMul(A),E=this.y,R=f.y.redMul(A).redMul(this.z),I=V.redSub(C),D=E.redSub(R);if(I.cmpn(0)===0)if(D.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var b=I.redSqr(),u=b.redMul(I),y=V.redMul(b),c=D.redSqr().redIAdd(u).redISub(y).redISub(y),m=D.redMul(y.redISub(c)).redISub(E.redMul(u)),q$=this.z.redMul(I);return this.curve.jpoint(c,m,q$)},w.prototype.dblp=function(f){if(f===0)return this;if(this.isInfinity())return this;if(!f)return this.dbl();var A;if(this.curve.zeroA||this.curve.threeA){var V=this;for(A=0;A<f;A++)V=V.dbl();return V}var C=this.curve.a,E=this.curve.tinv,R=this.x,I=this.y,D=this.z,b=D.redSqr().redSqr(),u=I.redAdd(I);for(A=0;A<f;A++){var y=R.redSqr(),c=u.redSqr(),m=c.redSqr(),q$=y.redAdd(y).redIAdd(y).redIAdd(C.redMul(b)),e=R.redMul(c),l=q$.redSqr().redISub(e.redAdd(e)),r=e.redISub(l),M=q$.redMul(r);M=M.redIAdd(M).redISub(m);var Y=u.redMul(D);if(A+1<f)b=b.redMul(m);R=l,D=Y,u=M}return this.curve.jpoint(R,u.redMul(E),D)},w.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},w.prototype._zeroDbl=function(){var f,A,V;if(this.zOne){var C=this.x.redSqr(),E=this.y.redSqr(),R=E.redSqr(),I=this.x.redAdd(E).redSqr().redISub(C).redISub(R);I=I.redIAdd(I);var D=C.redAdd(C).redIAdd(C),b=D.redSqr().redISub(I).redISub(I),u=R.redIAdd(R);u=u.redIAdd(u),u=u.redIAdd(u),f=b,A=D.redMul(I.redISub(b)).redISub(u),V=this.y.redAdd(this.y)}else{var y=this.x.redSqr(),c=this.y.redSqr(),m=c.redSqr(),q$=this.x.redAdd(c).redSqr().redISub(y).redISub(m);q$=q$.redIAdd(q$);var e=y.redAdd(y).redIAdd(y),l=e.redSqr(),r=m.redIAdd(m);r=r.redIAdd(r),r=r.redIAdd(r),f=l.redISub(q$).redISub(q$),A=e.redMul(q$.redISub(f)).redISub(r),V=this.y.redMul(this.z),V=V.redIAdd(V)}return this.curve.jpoint(f,A,V)},w.prototype._threeDbl=function(){var f,A,V;if(this.zOne){var C=this.x.redSqr(),E=this.y.redSqr(),R=E.redSqr(),I=this.x.redAdd(E).redSqr().redISub(C).redISub(R);I=I.redIAdd(I);var D=C.redAdd(C).redIAdd(C).redIAdd(this.curve.a),b=D.redSqr().redISub(I).redISub(I);f=b;var u=R.redIAdd(R);u=u.redIAdd(u),u=u.redIAdd(u),A=D.redMul(I.redISub(b)).redISub(u),V=this.y.redAdd(this.y)}else{var y=this.z.redSqr(),c=this.y.redSqr(),m=this.x.redMul(c),q$=this.x.redSub(y).redMul(this.x.redAdd(y));q$=q$.redAdd(q$).redIAdd(q$);var e=m.redIAdd(m);e=e.redIAdd(e);var l=e.redAdd(e);f=q$.redSqr().redISub(l),V=this.y.redAdd(this.z).redSqr().redISub(c).redISub(y);var r=c.redSqr();r=r.redIAdd(r),r=r.redIAdd(r),r=r.redIAdd(r),A=q$.redMul(e.redISub(f)).redISub(r)}return this.curve.jpoint(f,A,V)},w.prototype._dbl=function(){var f=this.curve.a,A=this.x,V=this.y,C=this.z,E=C.redSqr().redSqr(),R=A.redSqr(),I=V.redSqr(),D=R.redAdd(R).redIAdd(R).redIAdd(f.redMul(E)),b=A.redAdd(A);b=b.redIAdd(b);var u=b.redMul(I),y=D.redSqr().redISub(u.redAdd(u)),c=u.redISub(y),m=I.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var q$=D.redMul(c).redISub(m),e=V.redAdd(V).redMul(C);return this.curve.jpoint(y,q$,e)},w.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),A=this.y.redSqr(),V=this.z.redSqr(),C=A.redSqr(),E=f.redAdd(f).redIAdd(f),R=E.redSqr(),I=this.x.redAdd(A).redSqr().redISub(f).redISub(C);I=I.redIAdd(I),I=I.redAdd(I).redIAdd(I),I=I.redISub(R);var D=I.redSqr(),b=C.redIAdd(C);b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var u=E.redIAdd(I).redSqr().redISub(R).redISub(D).redISub(b),y=A.redMul(u);y=y.redIAdd(y),y=y.redIAdd(y);var c=this.x.redMul(D).redISub(y);c=c.redIAdd(c),c=c.redIAdd(c);var m=this.y.redMul(u.redMul(b.redISub(u)).redISub(I.redMul(D)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var q$=this.z.redAdd(I).redSqr().redISub(V).redISub(D);return this.curve.jpoint(c,m,q$)},w.prototype.mul=function(f,A){return f=new P(f,A),this.curve._wnafMul(this,f)},w.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var A=this.z.redSqr(),V=f.z.redSqr();if(this.x.redMul(V).redISub(f.x.redMul(A)).cmpn(0)!==0)return!1;var C=A.redMul(this.z),E=V.redMul(f.z);return this.y.redMul(E).redISub(f.y.redMul(C)).cmpn(0)===0},w.prototype.eqXToP=function(f){var A=this.z.redSqr(),V=f.toRed(this.curve.red).redMul(A);if(this.x.cmp(V)===0)return!0;var C=f.clone(),E=this.curve.redN.redMul(A);for(;;){if(C.iadd(this.curve.n),C.cmp(this.curve.p)>=0)return!1;if(V.redIAdd(E),this.x.cmp(V)===0)return!0}},w.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},w.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),Jl=l$(($,q)=>{var K=fK(),P=K8(),_=aj(),O=Z8();function j(J){_.call(this,"mont",J),this.a=new K(J.a,16).toRed(this.red),this.b=new K(J.b,16).toRed(this.red),this.i4=new K(4).toRed(this.red).redInvm(),this.two=new K(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}P(j,_),q.exports=j,j.prototype.validate=function(w){var G=w.normalize().x,f=G.redSqr(),A=f.redMul(G).redAdd(f.redMul(this.a)).redAdd(G),V=A.redSqrt();return V.redSqr().cmp(A)===0};function z(J,w,G){if(_.BasePoint.call(this,J,"projective"),w===null&&G===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new K(w,16),this.z=new K(G,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}P(z,_.BasePoint),j.prototype.decodePoint=function(w,G){return this.point(O.toArray(w,G),1)},j.prototype.point=function(w,G){return new z(this,w,G)},j.prototype.pointFromJSON=function(w){return z.fromJSON(this,w)},z.prototype.precompute=function(){},z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},z.fromJSON=function(w,G){return new z(w,G[0],G[1]||w.one)},z.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return this.z.cmpn(0)===0},z.prototype.dbl=function(){var w=this.x.redAdd(this.z),G=w.redSqr(),f=this.x.redSub(this.z),A=f.redSqr(),V=G.redSub(A),C=G.redMul(A),E=V.redMul(A.redAdd(this.curve.a24.redMul(V)));return this.curve.point(C,E)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(w,G){var f=this.x.redAdd(this.z),A=this.x.redSub(this.z),V=w.x.redAdd(w.z),C=w.x.redSub(w.z),E=C.redMul(f),R=V.redMul(A),I=G.z.redMul(E.redAdd(R).redSqr()),D=G.x.redMul(E.redISub(R).redSqr());return this.curve.point(I,D)},z.prototype.mul=function(w){var G=w.clone(),f=this,A=this.curve.point(null,null),V=this;for(var C=[];G.cmpn(0)!==0;G.iushrn(1))C.push(G.andln(1));for(var E=C.length-1;E>=0;E--)if(C[E]===0)f=f.diffAdd(A,V),A=A.dbl();else A=f.diffAdd(A,V),f=f.dbl();return A},z.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.eq=function(w){return this.getX().cmp(w.getX())===0},z.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},z.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),Tl=l$(($,q)=>{var K=Z8(),P=fK(),_=K8(),O=aj(),j=K.assert;function z(w){this.twisted=(w.a|0)!==1,this.mOneA=this.twisted&&(w.a|0)===-1,this.extended=this.mOneA,O.call(this,"edwards",w),this.a=new P(w.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new P(w.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new P(w.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),j(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(w.c|0)===1}_(z,O),q.exports=z,z.prototype._mulA=function(G){if(this.mOneA)return G.redNeg();else return this.a.redMul(G)},z.prototype._mulC=function(G){if(this.oneC)return G;else return this.c.redMul(G)},z.prototype.jpoint=function(G,f,A,V){return this.point(G,f,A,V)},z.prototype.pointFromX=function(G,f){if(G=new P(G,16),!G.red)G=G.toRed(this.red);var A=G.redSqr(),V=this.c2.redSub(this.a.redMul(A)),C=this.one.redSub(this.c2.redMul(this.d).redMul(A)),E=V.redMul(C.redInvm()),R=E.redSqrt();if(R.redSqr().redSub(E).cmp(this.zero)!==0)throw Error("invalid point");var I=R.fromRed().isOdd();if(f&&!I||!f&&I)R=R.redNeg();return this.point(G,R)},z.prototype.pointFromY=function(G,f){if(G=new P(G,16),!G.red)G=G.toRed(this.red);var A=G.redSqr(),V=A.redSub(this.c2),C=A.redMul(this.d).redMul(this.c2).redSub(this.a),E=V.redMul(C.redInvm());if(E.cmp(this.zero)===0)if(f)throw Error("invalid point");else return this.point(this.zero,G);var R=E.redSqrt();if(R.redSqr().redSub(E).cmp(this.zero)!==0)throw Error("invalid point");if(R.fromRed().isOdd()!==f)R=R.redNeg();return this.point(R,G)},z.prototype.validate=function(G){if(G.isInfinity())return!0;G.normalize();var f=G.x.redSqr(),A=G.y.redSqr(),V=f.redMul(this.a).redAdd(A),C=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(A)));return V.cmp(C)===0};function J(w,G,f,A,V){if(O.BasePoint.call(this,w,"projective"),G===null&&f===null&&A===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new P(G,16),this.y=new P(f,16),this.z=A?new P(A,16):this.curve.one,this.t=V&&new P(V,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}_(J,O.BasePoint),z.prototype.pointFromJSON=function(G){return J.fromJSON(this,G)},z.prototype.point=function(G,f,A,V){return new J(this,G,f,A,V)},J.fromJSON=function(G,f){return new J(G,f[0],f[1],f[2])},J.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},J.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},J.prototype._extDbl=function(){var G=this.x.redSqr(),f=this.y.redSqr(),A=this.z.redSqr();A=A.redIAdd(A);var V=this.curve._mulA(G),C=this.x.redAdd(this.y).redSqr().redISub(G).redISub(f),E=V.redAdd(f),R=E.redSub(A),I=V.redSub(f),D=C.redMul(R),b=E.redMul(I),u=C.redMul(I),y=R.redMul(E);return this.curve.point(D,b,y,u)},J.prototype._projDbl=function(){var G=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),A=this.y.redSqr(),V,C,E,R,I,D;if(this.curve.twisted){R=this.curve._mulA(f);var b=R.redAdd(A);if(this.zOne)V=G.redSub(f).redSub(A).redMul(b.redSub(this.curve.two)),C=b.redMul(R.redSub(A)),E=b.redSqr().redSub(b).redSub(b);else I=this.z.redSqr(),D=b.redSub(I).redISub(I),V=G.redSub(f).redISub(A).redMul(D),C=b.redMul(R.redSub(A)),E=b.redMul(D)}else R=f.redAdd(A),I=this.curve._mulC(this.z).redSqr(),D=R.redSub(I).redSub(I),V=this.curve._mulC(G.redISub(R)).redMul(D),C=this.curve._mulC(R).redMul(f.redISub(A)),E=R.redMul(D);return this.curve.point(V,C,E)},J.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},J.prototype._extAdd=function(G){var f=this.y.redSub(this.x).redMul(G.y.redSub(G.x)),A=this.y.redAdd(this.x).redMul(G.y.redAdd(G.x)),V=this.t.redMul(this.curve.dd).redMul(G.t),C=this.z.redMul(G.z.redAdd(G.z)),E=A.redSub(f),R=C.redSub(V),I=C.redAdd(V),D=A.redAdd(f),b=E.redMul(R),u=I.redMul(D),y=E.redMul(D),c=R.redMul(I);return this.curve.point(b,u,c,y)},J.prototype._projAdd=function(G){var f=this.z.redMul(G.z),A=f.redSqr(),V=this.x.redMul(G.x),C=this.y.redMul(G.y),E=this.curve.d.redMul(V).redMul(C),R=A.redSub(E),I=A.redAdd(E),D=this.x.redAdd(this.y).redMul(G.x.redAdd(G.y)).redISub(V).redISub(C),b=f.redMul(R).redMul(D),u,y;if(this.curve.twisted)u=f.redMul(I).redMul(C.redSub(this.curve._mulA(V))),y=R.redMul(I);else u=f.redMul(I).redMul(C.redSub(V)),y=this.curve._mulC(R).redMul(I);return this.curve.point(b,u,y)},J.prototype.add=function(G){if(this.isInfinity())return G;if(G.isInfinity())return this;if(this.curve.extended)return this._extAdd(G);else return this._projAdd(G)},J.prototype.mul=function(G){if(this._hasDoubles(G))return this.curve._fixedNafMul(this,G);else return this.curve._wnafMul(this,G)},J.prototype.mulAdd=function(G,f,A){return this.curve._wnafMulAdd(1,[this,f],[G,A],2,!1)},J.prototype.jmulAdd=function(G,f,A){return this.curve._wnafMulAdd(1,[this,f],[G,A],2,!0)},J.prototype.normalize=function(){if(this.zOne)return this;var G=this.z.redInvm();if(this.x=this.x.redMul(G),this.y=this.y.redMul(G),this.t)this.t=this.t.redMul(G);return this.z=this.curve.one,this.zOne=!0,this},J.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},J.prototype.getX=function(){return this.normalize(),this.x.fromRed()},J.prototype.getY=function(){return this.normalize(),this.y.fromRed()},J.prototype.eq=function(G){return this===G||this.getX().cmp(G.getX())===0&&this.getY().cmp(G.getY())===0},J.prototype.eqXToP=function(G){var f=G.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;var A=G.clone(),V=this.curve.redN.redMul(this.z);for(;;){if(A.iadd(this.curve.n),A.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(V),this.x.cmp(f)===0)return!0}},J.prototype.toP=J.prototype.normalize,J.prototype.mixedAdd=J.prototype.add}),iS=l$(($)=>{var q=$;q.base=aj(),q.short=Hl(),q.mont=Jl(),q.edwards=Tl()}),t8=l$(($)=>{var q=lK(),K=K8();$.inherits=K;function P(Y,H){if((Y.charCodeAt(H)&64512)!==55296)return!1;if(H<0||H+1>=Y.length)return!1;return(Y.charCodeAt(H+1)&64512)===56320}function _(Y,H){if(Array.isArray(Y))return Y.slice();if(!Y)return[];var T=[];if(typeof Y==="string"){if(!H){var W=0;for(var Z=0;Z<Y.length;Z++){var S=Y.charCodeAt(Z);if(S<128)T[W++]=S;else if(S<2048)T[W++]=S>>6|192,T[W++]=S&63|128;else if(P(Y,Z))S=65536+((S&1023)<<10)+(Y.charCodeAt(++Z)&1023),T[W++]=S>>18|240,T[W++]=S>>12&63|128,T[W++]=S>>6&63|128,T[W++]=S&63|128;else T[W++]=S>>12|224,T[W++]=S>>6&63|128,T[W++]=S&63|128}}else if(H==="hex"){if(Y=Y.replace(/[^a-z0-9]+/ig,""),Y.length%2!==0)Y="0"+Y;for(Z=0;Z<Y.length;Z+=2)T.push(parseInt(Y[Z]+Y[Z+1],16))}}else for(Z=0;Z<Y.length;Z++)T[Z]=Y[Z]|0;return T}$.toArray=_;function O(Y){var H="";for(var T=0;T<Y.length;T++)H+=J(Y[T].toString(16));return H}$.toHex=O;function j(Y){var H=Y>>>24|Y>>>8&65280|Y<<8&16711680|(Y&255)<<24;return H>>>0}$.htonl=j;function z(Y,H){var T="";for(var W=0;W<Y.length;W++){var Z=Y[W];if(H==="little")Z=j(Z);T+=w(Z.toString(16))}return T}$.toHex32=z;function J(Y){if(Y.length===1)return"0"+Y;else return Y}$.zero2=J;function w(Y){if(Y.length===7)return"0"+Y;else if(Y.length===6)return"00"+Y;else if(Y.length===5)return"000"+Y;else if(Y.length===4)return"0000"+Y;else if(Y.length===3)return"00000"+Y;else if(Y.length===2)return"000000"+Y;else if(Y.length===1)return"0000000"+Y;else return Y}$.zero8=w;function G(Y,H,T,W){var Z=T-H;q(Z%4===0);var S=Array(Z/4);for(var N=0,X=H;N<S.length;N++,X+=4){var v;if(W==="big")v=Y[X]<<24|Y[X+1]<<16|Y[X+2]<<8|Y[X+3];else v=Y[X+3]<<24|Y[X+2]<<16|Y[X+1]<<8|Y[X];S[N]=v>>>0}return S}$.join32=G;function f(Y,H){var T=Array(Y.length*4);for(var W=0,Z=0;W<Y.length;W++,Z+=4){var S=Y[W];if(H==="big")T[Z]=S>>>24,T[Z+1]=S>>>16&255,T[Z+2]=S>>>8&255,T[Z+3]=S&255;else T[Z+3]=S>>>24,T[Z+2]=S>>>16&255,T[Z+1]=S>>>8&255,T[Z]=S&255}return T}$.split32=f;function A(Y,H){return Y>>>H|Y<<32-H}$.rotr32=A;function V(Y,H){return Y<<H|Y>>>32-H}$.rotl32=V;function C(Y,H){return Y+H>>>0}$.sum32=C;function E(Y,H,T){return Y+H+T>>>0}$.sum32_3=E;function R(Y,H,T,W){return Y+H+T+W>>>0}$.sum32_4=R;function I(Y,H,T,W,Z){return Y+H+T+W+Z>>>0}$.sum32_5=I;function D(Y,H,T,W){var Z=Y[H],S=Y[H+1],N=W+S>>>0,X=(N<W?1:0)+T+Z;Y[H]=X>>>0,Y[H+1]=N}$.sum64=D;function b(Y,H,T,W){var Z=H+W>>>0,S=(Z<H?1:0)+Y+T;return S>>>0}$.sum64_hi=b;function u(Y,H,T,W){var Z=H+W;return Z>>>0}$.sum64_lo=u;function y(Y,H,T,W,Z,S,N,X){var v=0,k=H;k=k+W>>>0,v+=k<H?1:0,k=k+S>>>0,v+=k<S?1:0,k=k+X>>>0,v+=k<X?1:0;var g=Y+T+Z+N+v;return g>>>0}$.sum64_4_hi=y;function c(Y,H,T,W,Z,S,N,X){var v=H+W+S+X;return v>>>0}$.sum64_4_lo=c;function m(Y,H,T,W,Z,S,N,X,v,k){var g=0,h=H;h=h+W>>>0,g+=h<H?1:0,h=h+S>>>0,g+=h<S?1:0,h=h+X>>>0,g+=h<X?1:0,h=h+k>>>0,g+=h<k?1:0;var L=Y+T+Z+N+v+g;return L>>>0}$.sum64_5_hi=m;function q$(Y,H,T,W,Z,S,N,X,v,k){var g=H+W+S+X+k;return g>>>0}$.sum64_5_lo=q$;function e(Y,H,T){var W=H<<32-T|Y>>>T;return W>>>0}$.rotr64_hi=e;function l(Y,H,T){var W=Y<<32-T|H>>>T;return W>>>0}$.rotr64_lo=l;function r(Y,H,T){return Y>>>T}$.shr64_hi=r;function M(Y,H,T){var W=Y<<32-T|H>>>T;return W>>>0}$.shr64_lo=M}),m7=l$(($)=>{var q=t8(),K=lK();function P(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}$.BlockHash=P,P.prototype.update=function(O,j){if(O=q.toArray(O,j),!this.pending)this.pending=O;else this.pending=this.pending.concat(O);if(this.pendingTotal+=O.length,this.pending.length>=this._delta8){O=this.pending;var z=O.length%this._delta8;if(this.pending=O.slice(O.length-z,O.length),this.pending.length===0)this.pending=null;O=q.join32(O,0,O.length-z,this.endian);for(var J=0;J<O.length;J+=this._delta32)this._update(O,J,J+this._delta32)}return this},P.prototype.digest=function(O){return this.update(this._pad()),K(this.pending===null),this._digest(O)},P.prototype._pad=function(){var O=this.pendingTotal,j=this._delta8,z=j-(O+this.padLength)%j,J=Array(z+this.padLength);J[0]=128;for(var w=1;w<z;w++)J[w]=0;if(O<<=3,this.endian==="big"){for(var G=8;G<this.padLength;G++)J[w++]=0;J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=O>>>24&255,J[w++]=O>>>16&255,J[w++]=O>>>8&255,J[w++]=O&255}else{J[w++]=O&255,J[w++]=O>>>8&255,J[w++]=O>>>16&255,J[w++]=O>>>24&255,J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=0;for(G=8;G<this.padLength;G++)J[w++]=0}return J}}),tS=l$(($)=>{var q=t8(),K=q.rotr32;function P(f,A,V,C){if(f===0)return _(A,V,C);if(f===1||f===3)return j(A,V,C);if(f===2)return O(A,V,C)}$.ft_1=P;function _(f,A,V){return f&A^~f&V}$.ch32=_;function O(f,A,V){return f&A^f&V^A&V}$.maj32=O;function j(f,A,V){return f^A^V}$.p32=j;function z(f){return K(f,2)^K(f,13)^K(f,22)}$.s0_256=z;function J(f){return K(f,6)^K(f,11)^K(f,25)}$.s1_256=J;function w(f){return K(f,7)^K(f,18)^f>>>3}$.g0_256=w;function G(f){return K(f,17)^K(f,19)^f>>>10}$.g1_256=G}),wl=l$(($,q)=>{var K=t8(),P=m7(),_=tS(),O=K.rotl32,j=K.sum32,z=K.sum32_5,J=_.ft_1,w=P.BlockHash,G=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;w.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}K.inherits(f,w),q.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(V,C){var E=this.W;for(var R=0;R<16;R++)E[R]=V[C+R];for(;R<E.length;R++)E[R]=O(E[R-3]^E[R-8]^E[R-14]^E[R-16],1);var I=this.h[0],D=this.h[1],b=this.h[2],u=this.h[3],y=this.h[4];for(R=0;R<E.length;R++){var c=~~(R/20),m=z(O(I,5),J(c,D,b,u),y,E[R],G[c]);y=u,u=b,b=O(D,30),D=I,I=m}this.h[0]=j(this.h[0],I),this.h[1]=j(this.h[1],D),this.h[2]=j(this.h[2],b),this.h[3]=j(this.h[3],u),this.h[4]=j(this.h[4],y)},f.prototype._digest=function(V){if(V==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")}}),BS=l$(($,q)=>{var K=t8(),P=m7(),_=tS(),O=lK(),j=K.sum32,z=K.sum32_4,J=K.sum32_5,w=_.ch32,G=_.maj32,f=_.s0_256,A=_.s1_256,V=_.g0_256,C=_.g1_256,E=P.BlockHash,R=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function I(){if(!(this instanceof I))return new I;E.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=R,this.W=Array(64)}K.inherits(I,E),q.exports=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(b,u){var y=this.W;for(var c=0;c<16;c++)y[c]=b[u+c];for(;c<y.length;c++)y[c]=z(C(y[c-2]),y[c-7],V(y[c-15]),y[c-16]);var m=this.h[0],q$=this.h[1],e=this.h[2],l=this.h[3],r=this.h[4],M=this.h[5],Y=this.h[6],H=this.h[7];O(this.k.length===y.length);for(c=0;c<y.length;c++){var T=J(H,A(r),w(r,M,Y),this.k[c],y[c]),W=j(f(m),G(m,q$,e));H=Y,Y=M,M=r,r=j(l,T),l=e,e=q$,q$=m,m=j(T,W)}this.h[0]=j(this.h[0],m),this.h[1]=j(this.h[1],q$),this.h[2]=j(this.h[2],e),this.h[3]=j(this.h[3],l),this.h[4]=j(this.h[4],r),this.h[5]=j(this.h[5],M),this.h[6]=j(this.h[6],Y),this.h[7]=j(this.h[7],H)},I.prototype._digest=function(b){if(b==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")}}),Zl=l$(($,q)=>{var K=t8(),P=BS();function _(){if(!(this instanceof _))return new _;P.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}K.inherits(_,P),q.exports=_,_.blockSize=512,_.outSize=224,_.hmacStrength=192,_.padLength=64,_.prototype._digest=function(j){if(j==="hex")return K.toHex32(this.h.slice(0,7),"big");else return K.split32(this.h.slice(0,7),"big")}}),US=l$(($,q)=>{var K=t8(),P=m7(),_=lK(),O=K.rotr64_hi,j=K.rotr64_lo,z=K.shr64_hi,J=K.shr64_lo,w=K.sum64,G=K.sum64_hi,f=K.sum64_lo,A=K.sum64_4_hi,V=K.sum64_4_lo,C=K.sum64_5_hi,E=K.sum64_5_lo,R=P.BlockHash,I=[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 D(){if(!(this instanceof D))return new D;R.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=I,this.W=Array(160)}K.inherits(D,R),q.exports=D,D.blockSize=1024,D.outSize=512,D.hmacStrength=192,D.padLength=128,D.prototype._prepareBlock=function(W,Z){var S=this.W;for(var N=0;N<32;N++)S[N]=W[Z+N];for(;N<S.length;N+=2){var X=Y(S[N-4],S[N-3]),v=H(S[N-4],S[N-3]),k=S[N-14],g=S[N-13],h=r(S[N-30],S[N-29]),L=M(S[N-30],S[N-29]),d=S[N-32],i=S[N-31];S[N]=A(X,v,k,g,h,L,d,i),S[N+1]=V(X,v,k,g,h,L,d,i)}},D.prototype._update=function(W,Z){this._prepareBlock(W,Z);var S=this.W,N=this.h[0],X=this.h[1],v=this.h[2],k=this.h[3],g=this.h[4],h=this.h[5],L=this.h[6],d=this.h[7],i=this.h[8],F=this.h[9],W$=this.h[10],n=this.h[11],t=this.h[12],y$=this.h[13],Y$=this.h[14],v$=this.h[15];_(this.k.length===S.length);for(var a=0;a<S.length;a+=2){var o=Y$,B=v$,p$=e(i,F),$$=l(i,F),s=b(i,F,W$,n,t,y$),Q=u(i,F,W$,n,t,y$),U=this.k[a],_$=this.k[a+1],X$=S[a],O$=S[a+1],T$=C(o,B,p$,$$,s,Q,U,_$,X$,O$),j6=E(o,B,p$,$$,s,Q,U,_$,X$,O$);o=m(N,X),B=q$(N,X),p$=y(N,X,v,k,g,h),$$=c(N,X,v,k,g,h);var H$=G(o,B,p$,$$),f$=f(o,B,p$,$$);Y$=t,v$=y$,t=W$,y$=n,W$=i,n=F,i=G(L,d,T$,j6),F=f(d,d,T$,j6),L=g,d=h,g=v,h=k,v=N,k=X,N=G(T$,j6,H$,f$),X=f(T$,j6,H$,f$)}w(this.h,0,N,X),w(this.h,2,v,k),w(this.h,4,g,h),w(this.h,6,L,d),w(this.h,8,i,F),w(this.h,10,W$,n),w(this.h,12,t,y$),w(this.h,14,Y$,v$)},D.prototype._digest=function(W){if(W==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")};function b(T,W,Z,S,N){var X=T&Z^~T&N;if(X<0)X+=4294967296;return X}function u(T,W,Z,S,N,X){var v=W&S^~W&X;if(v<0)v+=4294967296;return v}function y(T,W,Z,S,N){var X=T&Z^T&N^Z&N;if(X<0)X+=4294967296;return X}function c(T,W,Z,S,N,X){var v=W&S^W&X^S&X;if(v<0)v+=4294967296;return v}function m(T,W){var Z=O(T,W,28),S=O(W,T,2),N=O(W,T,7),X=Z^S^N;if(X<0)X+=4294967296;return X}function q$(T,W){var Z=j(T,W,28),S=j(W,T,2),N=j(W,T,7),X=Z^S^N;if(X<0)X+=4294967296;return X}function e(T,W){var Z=O(T,W,14),S=O(T,W,18),N=O(W,T,9),X=Z^S^N;if(X<0)X+=4294967296;return X}function l(T,W){var Z=j(T,W,14),S=j(T,W,18),N=j(W,T,9),X=Z^S^N;if(X<0)X+=4294967296;return X}function r(T,W){var Z=O(T,W,1),S=O(T,W,8),N=z(T,W,7),X=Z^S^N;if(X<0)X+=4294967296;return X}function M(T,W){var Z=j(T,W,1),S=j(T,W,8),N=J(T,W,7),X=Z^S^N;if(X<0)X+=4294967296;return X}function Y(T,W){var Z=O(T,W,19),S=O(W,T,29),N=z(T,W,6),X=Z^S^N;if(X<0)X+=4294967296;return X}function H(T,W){var Z=j(T,W,19),S=j(W,T,29),N=J(T,W,6),X=Z^S^N;if(X<0)X+=4294967296;return X}}),Xl=l$(($,q)=>{var K=t8(),P=US();function _(){if(!(this instanceof _))return new _;P.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}K.inherits(_,P),q.exports=_,_.blockSize=1024,_.outSize=384,_.hmacStrength=192,_.padLength=128,_.prototype._digest=function(j){if(j==="hex")return K.toHex32(this.h.slice(0,12),"big");else return K.split32(this.h.slice(0,12),"big")}}),fl=l$(($)=>{$.sha1=wl(),$.sha224=Zl(),$.sha256=BS(),$.sha384=Xl(),$.sha512=US()}),kl=l$(($)=>{var q=t8(),K=m7(),P=q.rotl32,_=q.sum32,O=q.sum32_3,j=q.sum32_4,z=K.BlockHash;function J(){if(!(this instanceof J))return new J;z.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}q.inherits(J,z),$.ripemd160=J,J.blockSize=512,J.outSize=160,J.hmacStrength=192,J.padLength=64,J.prototype._update=function(I,D){var b=this.h[0],u=this.h[1],y=this.h[2],c=this.h[3],m=this.h[4],q$=b,e=u,l=y,r=c,M=m;for(var Y=0;Y<80;Y++){var H=_(P(j(b,w(Y,u,y,c),I[A[Y]+D],G(Y)),C[Y]),m);b=m,m=c,c=P(y,10),y=u,u=H,H=_(P(j(q$,w(79-Y,e,l,r),I[V[Y]+D],f(Y)),E[Y]),M),q$=M,M=r,r=P(l,10),l=e,e=H}H=O(this.h[1],y,r),this.h[1]=O(this.h[2],c,M),this.h[2]=O(this.h[3],m,q$),this.h[3]=O(this.h[4],b,e),this.h[4]=O(this.h[0],u,l),this.h[0]=H},J.prototype._digest=function(I){if(I==="hex")return q.toHex32(this.h,"little");else return q.split32(this.h,"little")};function w(R,I,D,b){if(R<=15)return I^D^b;else if(R<=31)return I&D|~I&b;else if(R<=47)return(I|~D)^b;else if(R<=63)return I&b|D&~b;else return I^(D|~b)}function G(R){if(R<=15)return 0;else if(R<=31)return 1518500249;else if(R<=47)return 1859775393;else if(R<=63)return 2400959708;else return 2840853838}function f(R){if(R<=15)return 1352829926;else if(R<=31)return 1548603684;else if(R<=47)return 1836072691;else if(R<=63)return 2053994217;else return 0}var A=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],V=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],C=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],E=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),Al=l$(($,q)=>{var K=t8(),P=lK();function _(O,j,z){if(!(this instanceof _))return new _(O,j,z);this.Hash=O,this.blockSize=O.blockSize/8,this.outSize=O.outSize/8,this.inner=null,this.outer=null,this._init(K.toArray(j,z))}q.exports=_,_.prototype._init=function(j){if(j.length>this.blockSize)j=new this.Hash().update(j).digest();P(j.length<=this.blockSize);for(var z=j.length;z<this.blockSize;z++)j.push(0);for(z=0;z<j.length;z++)j[z]^=54;this.inner=new this.Hash().update(j);for(z=0;z<j.length;z++)j[z]^=106;this.outer=new this.Hash().update(j)},_.prototype.update=function(j,z){return this.inner.update(j,z),this},_.prototype.digest=function(j){return this.outer.update(this.inner.digest()),this.outer.digest(j)}}),VH=l$(($)=>{var q=$;q.utils=t8(),q.common=m7(),q.sha=fl(),q.ripemd=kl(),q.hmac=Al(),q.sha1=q.sha.sha1,q.sha256=q.sha.sha256,q.sha224=q.sha.sha224,q.sha384=q.sha.sha384,q.sha512=q.sha.sha512,q.ripemd160=q.ripemd.ripemd160}),Gl=l$(($,q)=>{q.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),SH=l$(($)=>{var q=$,K=VH(),P=iS(),_=Z8(),O=_.assert;function j(w){if(w.type==="short")this.curve=new P.short(w);else if(w.type==="edwards")this.curve=new P.edwards(w);else this.curve=new P.mont(w);this.g=this.curve.g,this.n=this.curve.n,this.hash=w.hash,O(this.g.validate(),"Invalid curve"),O(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}q.PresetCurve=j;function z(w,G){Object.defineProperty(q,w,{configurable:!0,enumerable:!0,get:function(){var f=new j(G);return Object.defineProperty(q,w,{configurable:!0,enumerable:!0,value:f}),f}})}z("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:K.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),z("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:K.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),z("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:K.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),z("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:K.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),z("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:K.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),z("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:K.sha256,gRed:!1,g:["9"]}),z("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:K.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var J;try{J=Gl()}catch(w){J=void 0}z("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:K.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",J]})}),Vl=l$(($,q)=>{var K=VH(),P=rS(),_=lK();function O(j){if(!(this instanceof O))return new O(j);this.hash=j.hash,this.predResist=!!j.predResist,this.outLen=this.hash.outSize,this.minEntropy=j.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var z=P.toArray(j.entropy,j.entropyEnc||"hex"),J=P.toArray(j.nonce,j.nonceEnc||"hex"),w=P.toArray(j.pers,j.persEnc||"hex");_(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(z,J,w)}q.exports=O,O.prototype._init=function(z,J,w){var G=z.concat(J).concat(w);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(G),this._reseed=1,this.reseedInterval=281474976710656},O.prototype._hmac=function(){return new K.hmac(this.hash,this.K)},O.prototype._update=function(z){var J=this._hmac().update(this.V).update([0]);if(z)J=J.update(z);if(this.K=J.digest(),this.V=this._hmac().update(this.V).digest(),!z)return;this.K=this._hmac().update(this.V).update([1]).update(z).digest(),this.V=this._hmac().update(this.V).digest()},O.prototype.reseed=function(z,J,w,G){if(typeof J!=="string")G=w,w=J,J=null;z=P.toArray(z,J),w=P.toArray(w,G),_(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(z.concat(w||[])),this._reseed=1},O.prototype.generate=function(z,J,w,G){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof J!=="string")G=w,w=J,J=null;if(w)w=P.toArray(w,G||"hex"),this._update(w);var f=[];while(f.length<z)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var A=f.slice(0,z);return this._update(w),this._reseed++,P.encode(A,J)}}),Sl=l$(($,q)=>{var K=fK(),P=Z8(),_=P.assert;function O(j,z){if(this.ec=j,this.priv=null,this.pub=null,z.priv)this._importPrivate(z.priv,z.privEnc);if(z.pub)this._importPublic(z.pub,z.pubEnc)}q.exports=O,O.fromPublic=function(z,J,w){if(J instanceof O)return J;return new O(z,{pub:J,pubEnc:w})},O.fromPrivate=function(z,J,w){if(J instanceof O)return J;return new O(z,{priv:J,privEnc:w})},O.prototype.validate=function(){var z=this.getPublic();if(z.isInfinity())return{result:!1,reason:"Invalid public key"};if(!z.validate())return{result:!1,reason:"Public key is not a point"};if(!z.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},O.prototype.getPublic=function(z,J){if(typeof z==="string")J=z,z=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!J)return this.pub;return this.pub.encode(J,z)},O.prototype.getPrivate=function(z){if(z==="hex")return this.priv.toString(16,2);else return this.priv},O.prototype._importPrivate=function(z,J){this.priv=new K(z,J||16),this.priv=this.priv.umod(this.ec.curve.n)},O.prototype._importPublic=function(z,J){if(z.x||z.y){if(this.ec.curve.type==="mont")_(z.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")_(z.x&&z.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(z.x,z.y);return}this.pub=this.ec.curve.decodePoint(z,J)},O.prototype.derive=function(z){if(!z.validate())_(z.validate(),"public point not validated");return z.mul(this.priv).getX()},O.prototype.sign=function(z,J,w){return this.ec.sign(z,this,J,w)},O.prototype.verify=function(z,J,w){return this.ec.verify(z,J,this,void 0,w)},O.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),Ml=l$(($,q)=>{var K=fK(),P=Z8(),_=P.assert;function O(G,f){if(G instanceof O)return G;if(this._importDER(G,f))return;if(_(G.r&&G.s,"Signature without r or s"),this.r=new K(G.r,16),this.s=new K(G.s,16),G.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=G.recoveryParam}q.exports=O;function j(){this.place=0}function z(G,f){var A=G[f.place++];if(!(A&128))return A;var V=A&15;if(V===0||V>4)return!1;if(G[f.place]===0)return!1;var C=0;for(var E=0,R=f.place;E<V;E++,R++)C<<=8,C|=G[R],C>>>=0;if(C<=127)return!1;return f.place=R,C}function J(G){var f=0,A=G.length-1;while(!G[f]&&!(G[f+1]&128)&&f<A)f++;if(f===0)return G;return G.slice(f)}O.prototype._importDER=function(f,A){f=P.toArray(f,A);var V=new j;if(f[V.place++]!==48)return!1;var C=z(f,V);if(C===!1)return!1;if(C+V.place!==f.length)return!1;if(f[V.place++]!==2)return!1;var E=z(f,V);if(E===!1)return!1;if((f[V.place]&128)!==0)return!1;var R=f.slice(V.place,E+V.place);if(V.place+=E,f[V.place++]!==2)return!1;var I=z(f,V);if(I===!1)return!1;if(f.length!==I+V.place)return!1;if((f[V.place]&128)!==0)return!1;var D=f.slice(V.place,I+V.place);if(R[0]===0)if(R[1]&128)R=R.slice(1);else return!1;if(D[0]===0)if(D[1]&128)D=D.slice(1);else return!1;return this.r=new K(R),this.s=new K(D),this.recoveryParam=null,!0};function w(G,f){if(f<128){G.push(f);return}var A=1+(Math.log(f)/Math.LN2>>>3);G.push(A|128);while(--A)G.push(f>>>(A<<3)&255);G.push(f)}O.prototype.toDER=function(f){var A=this.r.toArray(),V=this.s.toArray();if(A[0]&128)A=[0].concat(A);if(V[0]&128)V=[0].concat(V);A=J(A),V=J(V);while(!V[0]&&!(V[1]&128))V=V.slice(1);var C=[2];w(C,A.length),C=C.concat(A),C.push(2),w(C,V.length);var E=C.concat(V),R=[48];return w(R,E.length),R=R.concat(E),P.encode(R,f)}}),Nl=l$(($,q)=>{var K=fK(),P=Vl(),_=Z8(),O=SH(),j=nS(),z=_.assert,J=Sl(),w=Ml();function G(f){if(!(this instanceof G))return new G(f);if(typeof f==="string")z(Object.prototype.hasOwnProperty.call(O,f),"Unknown curve "+f),f=O[f];if(f instanceof O.PresetCurve)f={curve:f};this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}q.exports=G,G.prototype.keyPair=function(A){return new J(this,A)},G.prototype.keyFromPrivate=function(A,V){return J.fromPrivate(this,A,V)},G.prototype.keyFromPublic=function(A,V){return J.fromPublic(this,A,V)},G.prototype.genKeyPair=function(A){if(!A)A={};var V=new P({hash:this.hash,pers:A.pers,persEnc:A.persEnc||"utf8",entropy:A.entropy||j(this.hash.hmacStrength),entropyEnc:A.entropy&&A.entropyEnc||"utf8",nonce:this.n.toArray()}),C=this.n.byteLength(),E=this.n.sub(new K(2));for(;;){var R=new K(V.generate(C));if(R.cmp(E)>0)continue;return R.iaddn(1),this.keyFromPrivate(R)}},G.prototype._truncateToN=function(A,V,C){var E;if(K.isBN(A)||typeof A==="number")A=new K(A,16),E=A.byteLength();else if(typeof A==="object")E=A.length,A=new K(A,16);else{var R=A.toString();E=R.length+1>>>1,A=new K(R,16)}if(typeof C!=="number")C=E*8;var I=C-this.n.bitLength();if(I>0)A=A.ushrn(I);if(!V&&A.cmp(this.n)>=0)return A.sub(this.n);else return A},G.prototype.sign=function(A,V,C,E){if(typeof C==="object")E=C,C=null;if(!E)E={};if(typeof A!=="string"&&typeof A!=="number"&&!K.isBN(A)){z(typeof A==="object"&&A&&typeof A.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),z(A.length>>>0===A.length);for(var R=0;R<A.length;R++)z((A[R]&255)===A[R])}V=this.keyFromPrivate(V,C),A=this._truncateToN(A,!1,E.msgBitLength),z(!A.isNeg(),"Can not sign a negative message");var I=this.n.byteLength(),D=V.getPrivate().toArray("be",I),b=A.toArray("be",I);z(new K(b).eq(A),"Can not sign message");var u=new P({hash:this.hash,entropy:D,nonce:b,pers:E.pers,persEnc:E.persEnc||"utf8"}),y=this.n.sub(new K(1));for(var c=0;;c++){var m=E.k?E.k(c):new K(u.generate(this.n.byteLength()));if(m=this._truncateToN(m,!0),m.cmpn(1)<=0||m.cmp(y)>=0)continue;var q$=this.g.mul(m);if(q$.isInfinity())continue;var e=q$.getX(),l=e.umod(this.n);if(l.cmpn(0)===0)continue;var r=m.invm(this.n).mul(l.mul(V.getPrivate()).iadd(A));if(r=r.umod(this.n),r.cmpn(0)===0)continue;var M=(q$.getY().isOdd()?1:0)|(e.cmp(l)!==0?2:0);if(E.canonical&&r.cmp(this.nh)>0)r=this.n.sub(r),M^=1;return new w({r:l,s:r,recoveryParam:M})}},G.prototype.verify=function(A,V,C,E,R){if(!R)R={};A=this._truncateToN(A,!1,R.msgBitLength),C=this.keyFromPublic(C,E),V=new w(V,"hex");var{r:I,s:D}=V;if(I.cmpn(1)<0||I.cmp(this.n)>=0)return!1;if(D.cmpn(1)<0||D.cmp(this.n)>=0)return!1;var b=D.invm(this.n),u=b.mul(A).umod(this.n),y=b.mul(I).umod(this.n),c;if(!this.curve._maxwellTrick){if(c=this.g.mulAdd(u,C.getPublic(),y),c.isInfinity())return!1;return c.getX().umod(this.n).cmp(I)===0}if(c=this.g.jmulAdd(u,C.getPublic(),y),c.isInfinity())return!1;return c.eqXToP(I)},G.prototype.recoverPubKey=function(f,A,V,C){z((3&V)===V,"The recovery param is more than two bits"),A=new w(A,C);var E=this.n,R=new K(f),I=A.r,D=A.s,b=V&1,u=V>>1;if(I.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw Error("Unable to find sencond key candinate");if(u)I=this.curve.pointFromX(I.add(this.curve.n),b);else I=this.curve.pointFromX(I,b);var y=A.r.invm(E),c=E.sub(R).mul(y).umod(E),m=D.mul(y).umod(E);return this.g.mulAdd(c,I,m)},G.prototype.getKeyRecoveryParam=function(f,A,V,C){if(A=new w(A,C),A.recoveryParam!==null)return A.recoveryParam;for(var E=0;E<4;E++){var R;try{R=this.recoverPubKey(f,A,E)}catch(I){continue}if(R.eq(V))return E}throw Error("Unable to find valid recovery factor")}}),Cl=l$(($,q)=>{var K=Z8(),P=K.assert,_=K.parseBytes,O=K.cachedProperty;function j(z,J){if(this.eddsa=z,this._secret=_(J.secret),z.isPoint(J.pub))this._pub=J.pub;else this._pubBytes=_(J.pub)}j.fromPublic=function(J,w){if(w instanceof j)return w;return new j(J,{pub:w})},j.fromSecret=function(J,w){if(w instanceof j)return w;return new j(J,{secret:w})},j.prototype.secret=function(){return this._secret},O(j,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),O(j,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),O(j,"privBytes",function(){var J=this.eddsa,w=this.hash(),G=J.encodingLength-1,f=w.slice(0,J.encodingLength);return f[0]&=248,f[G]&=127,f[G]|=64,f}),O(j,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),O(j,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),O(j,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),j.prototype.sign=function(J){return P(this._secret,"KeyPair can only verify"),this.eddsa.sign(J,this)},j.prototype.verify=function(J,w){return this.eddsa.verify(J,w,this)},j.prototype.getSecret=function(J){return P(this._secret,"KeyPair is public only"),K.encode(this.secret(),J)},j.prototype.getPublic=function(J){return K.encode(this.pubBytes(),J)},q.exports=j}),El=l$(($,q)=>{var K=fK(),P=Z8(),_=P.assert,O=P.cachedProperty,j=P.parseBytes;function z(J,w){if(this.eddsa=J,typeof w!=="object")w=j(w);if(Array.isArray(w))_(w.length===J.encodingLength*2,"Signature has invalid size"),w={R:w.slice(0,J.encodingLength),S:w.slice(J.encodingLength)};if(_(w.R&&w.S,"Signature without R or S"),J.isPoint(w.R))this._R=w.R;if(w.S instanceof K)this._S=w.S;this._Rencoded=Array.isArray(w.R)?w.R:w.Rencoded,this._Sencoded=Array.isArray(w.S)?w.S:w.Sencoded}O(z,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),O(z,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),O(z,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),O(z,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),z.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},z.prototype.toHex=function(){return P.encode(this.toBytes(),"hex").toUpperCase()},q.exports=z}),hl=l$(($,q)=>{var K=VH(),P=SH(),_=Z8(),O=_.assert,j=_.parseBytes,z=Cl(),J=El();function w(G){if(O(G==="ed25519","only tested with ed25519 so far"),!(this instanceof w))return new w(G);G=P[G].curve,this.curve=G,this.g=G.g,this.g.precompute(G.n.bitLength()+1),this.pointClass=G.point().constructor,this.encodingLength=Math.ceil(G.n.bitLength()/8),this.hash=K.sha512}q.exports=w,w.prototype.sign=function(f,A){f=j(f);var V=this.keyFromSecret(A),C=this.hashInt(V.messagePrefix(),f),E=this.g.mul(C),R=this.encodePoint(E),I=this.hashInt(R,V.pubBytes(),f).mul(V.priv()),D=C.add(I).umod(this.curve.n);return this.makeSignature({R:E,S:D,Rencoded:R})},w.prototype.verify=function(f,A,V){if(f=j(f),A=this.makeSignature(A),A.S().gte(A.eddsa.curve.n)||A.S().isNeg())return!1;var C=this.keyFromPublic(V),E=this.hashInt(A.Rencoded(),C.pubBytes(),f),R=this.g.mul(A.S()),I=A.R().add(C.pub().mul(E));return I.eq(R)},w.prototype.hashInt=function(){var f=this.hash();for(var A=0;A<arguments.length;A++)f.update(arguments[A]);return _.intFromLE(f.digest()).umod(this.curve.n)},w.prototype.keyFromPublic=function(f){return z.fromPublic(this,f)},w.prototype.keyFromSecret=function(f){return z.fromSecret(this,f)},w.prototype.makeSignature=function(f){if(f instanceof J)return f;return new J(this,f)},w.prototype.encodePoint=function(f){var A=f.getY().toArray("le",this.encodingLength);return A[this.encodingLength-1]|=f.getX().isOdd()?128:0,A},w.prototype.decodePoint=function(f){f=_.parseBytes(f);var A=f.length-1,V=f.slice(0,A).concat(f[A]&-129),C=(f[A]&128)!==0,E=_.intFromLE(V);return this.curve.pointFromY(E,C)},w.prototype.encodeInt=function(f){return f.toArray("le",this.encodingLength)},w.prototype.decodeInt=function(f){return _.intFromLE(f)},w.prototype.isPoint=function(f){return f instanceof this.pointClass}}),Rl=l$(($)=>{var q=$;q.version=zl().version,q.utils=Z8(),q.rand=nS(),q.curve=iS(),q.curves=SH(),q.ec=Nl(),q.eddsa=hl()}),Il=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(Oq(),w6(jq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var X=Y.length-H;for(W=X%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function G(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,X=Math.min(S,S-N)+T,v=0;for(var k=T;k<X;k+=W)if(v=G(Y,k,k+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var g=1;v=G(Y,k,Y.length,H);for(k=0;k<N;k++)g*=H;if(this.imuln(g),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],X=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=f[6-X.length]+X+T;else T=X+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=A[Y],k=V[Y];T="";var g=this.clone();g.negative=0;while(!g.isZero()){var h=g.modn(k).toString(Y);if(g=g.idivn(k),!g.isZero())T=f[v-h.length]+h+T;else T=h+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),X,v,k=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[Z-v-1]=X}else{for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[v]=X;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,X=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var k=X>>>26,g=X&67108863,h=Math.min(v,Y.length-1);for(var L=Math.max(0,v-M.length+1);L<=h;L++){var d=v-L|0;W=M.words[d]|0,Z=Y.words[L]|0,S=W*Z+g,k+=S/67108864|0,g=S&67108863}H.words[v]=g|0,X=k|0}if(X!==0)H.words[v]=X|0;else H.length--;return H.strip()}var R=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,X,v,k,g=W[0]|0,h=g&8191,L=g>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,t=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,o=a&8191,B=a>>>13,p$=W[5]|0,$$=p$&8191,s=p$>>>13,Q=W[6]|0,U=Q&8191,_$=Q>>>13,X$=W[7]|0,O$=X$&8191,T$=X$>>>13,j6=W[8]|0,H$=j6&8191,f$=j6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,b6=Z[0]|0,k$=b6&8191,I$=b6>>>13,Yq=Z[1]|0,D$=Yq&8191,g$=Yq>>>13,Aq=Z[2]|0,C$=Aq&8191,E$=Aq>>>13,Gq=Z[3]|0,h$=Gq&8191,V$=Gq>>>13,Vq=Z[4]|0,L$=Vq&8191,S$=Vq>>>13,vq=Z[5]|0,p=vq&8191,x=vq>>>13,x$=Z[6]|0,K$=x$&8191,j$=x$>>>13,f6=Z[7]|0,Z$=f6&8191,A$=f6>>>13,zq=Z[8]|0,b$=zq&8191,R$=zq>>>13,Wq=Z[9]|0,M$=Wq&8191,N$=Wq>>>13;T.negative=Y.negative^H.negative,T.length=19,X=Math.imul(h,k$),v=Math.imul(h,I$),v=v+Math.imul(L,k$)|0,k=Math.imul(L,I$);var D6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(D6>>>26)|0,D6&=67108863,X=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,k=Math.imul(F,I$),X=X+Math.imul(h,D$)|0,v=v+Math.imul(h,g$)|0,v=v+Math.imul(L,D$)|0,k=k+Math.imul(L,g$)|0;var O6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(O6>>>26)|0,O6&=67108863,X=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(t,k$)|0,k=Math.imul(t,I$),X=X+Math.imul(i,D$)|0,v=v+Math.imul(i,g$)|0,v=v+Math.imul(F,D$)|0,k=k+Math.imul(F,g$)|0,X=X+Math.imul(h,C$)|0,v=v+Math.imul(h,E$)|0,v=v+Math.imul(L,C$)|0,k=k+Math.imul(L,E$)|0;var K6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,X=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,k=Math.imul(v$,I$),X=X+Math.imul(n,D$)|0,v=v+Math.imul(n,g$)|0,v=v+Math.imul(t,D$)|0,k=k+Math.imul(t,g$)|0,X=X+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,k=k+Math.imul(F,E$)|0,X=X+Math.imul(h,h$)|0,v=v+Math.imul(h,V$)|0,v=v+Math.imul(L,h$)|0,k=k+Math.imul(L,V$)|0;var A6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(A6>>>26)|0,A6&=67108863,X=Math.imul(o,k$),v=Math.imul(o,I$),v=v+Math.imul(B,k$)|0,k=Math.imul(B,I$),X=X+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,g$)|0,v=v+Math.imul(v$,D$)|0,k=k+Math.imul(v$,g$)|0,X=X+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(t,C$)|0,k=k+Math.imul(t,E$)|0,X=X+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,k=k+Math.imul(F,V$)|0,X=X+Math.imul(h,L$)|0,v=v+Math.imul(h,S$)|0,v=v+Math.imul(L,L$)|0,k=k+Math.imul(L,S$)|0;var m6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(m6>>>26)|0,m6&=67108863,X=Math.imul($$,k$),v=Math.imul($$,I$),v=v+Math.imul(s,k$)|0,k=Math.imul(s,I$),X=X+Math.imul(o,D$)|0,v=v+Math.imul(o,g$)|0,v=v+Math.imul(B,D$)|0,k=k+Math.imul(B,g$)|0,X=X+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,k=k+Math.imul(v$,E$)|0,X=X+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(t,h$)|0,k=k+Math.imul(t,V$)|0,X=X+Math.imul(i,L$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,L$)|0,k=k+Math.imul(F,S$)|0,X=X+Math.imul(h,p)|0,v=v+Math.imul(h,x)|0,v=v+Math.imul(L,p)|0,k=k+Math.imul(L,x)|0;var d6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,X=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,k=Math.imul(_$,I$),X=X+Math.imul($$,D$)|0,v=v+Math.imul($$,g$)|0,v=v+Math.imul(s,D$)|0,k=k+Math.imul(s,g$)|0,X=X+Math.imul(o,C$)|0,v=v+Math.imul(o,E$)|0,v=v+Math.imul(B,C$)|0,k=k+Math.imul(B,E$)|0,X=X+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,k=k+Math.imul(v$,V$)|0,X=X+Math.imul(n,L$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(t,L$)|0,k=k+Math.imul(t,S$)|0,X=X+Math.imul(i,p)|0,v=v+Math.imul(i,x)|0,v=v+Math.imul(F,p)|0,k=k+Math.imul(F,x)|0,X=X+Math.imul(h,K$)|0,v=v+Math.imul(h,j$)|0,v=v+Math.imul(L,K$)|0,k=k+Math.imul(L,j$)|0;var l6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,X=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,k=Math.imul(T$,I$),X=X+Math.imul(U,D$)|0,v=v+Math.imul(U,g$)|0,v=v+Math.imul(_$,D$)|0,k=k+Math.imul(_$,g$)|0,X=X+Math.imul($$,C$)|0,v=v+Math.imul($$,E$)|0,v=v+Math.imul(s,C$)|0,k=k+Math.imul(s,E$)|0,X=X+Math.imul(o,h$)|0,v=v+Math.imul(o,V$)|0,v=v+Math.imul(B,h$)|0,k=k+Math.imul(B,V$)|0,X=X+Math.imul(Y$,L$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,L$)|0,k=k+Math.imul(v$,S$)|0,X=X+Math.imul(n,p)|0,v=v+Math.imul(n,x)|0,v=v+Math.imul(t,p)|0,k=k+Math.imul(t,x)|0,X=X+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,k=k+Math.imul(F,j$)|0,X=X+Math.imul(h,Z$)|0,v=v+Math.imul(h,A$)|0,v=v+Math.imul(L,Z$)|0,k=k+Math.imul(L,A$)|0;var o6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,X=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(f$,k$)|0,k=Math.imul(f$,I$),X=X+Math.imul(O$,D$)|0,v=v+Math.imul(O$,g$)|0,v=v+Math.imul(T$,D$)|0,k=k+Math.imul(T$,g$)|0,X=X+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,k=k+Math.imul(_$,E$)|0,X=X+Math.imul($$,h$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(s,h$)|0,k=k+Math.imul(s,V$)|0,X=X+Math.imul(o,L$)|0,v=v+Math.imul(o,S$)|0,v=v+Math.imul(B,L$)|0,k=k+Math.imul(B,S$)|0,X=X+Math.imul(Y$,p)|0,v=v+Math.imul(Y$,x)|0,v=v+Math.imul(v$,p)|0,k=k+Math.imul(v$,x)|0,X=X+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(t,K$)|0,k=k+Math.imul(t,j$)|0,X=X+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,k=k+Math.imul(F,A$)|0,X=X+Math.imul(h,b$)|0,v=v+Math.imul(h,R$)|0,v=v+Math.imul(L,b$)|0,k=k+Math.imul(L,R$)|0;var r6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,X=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,k=Math.imul(G$,I$),X=X+Math.imul(H$,D$)|0,v=v+Math.imul(H$,g$)|0,v=v+Math.imul(f$,D$)|0,k=k+Math.imul(f$,g$)|0,X=X+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,k=k+Math.imul(T$,E$)|0,X=X+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,k=k+Math.imul(_$,V$)|0,X=X+Math.imul($$,L$)|0,v=v+Math.imul($$,S$)|0,v=v+Math.imul(s,L$)|0,k=k+Math.imul(s,S$)|0,X=X+Math.imul(o,p)|0,v=v+Math.imul(o,x)|0,v=v+Math.imul(B,p)|0,k=k+Math.imul(B,x)|0,X=X+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,k=k+Math.imul(v$,j$)|0,X=X+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(t,Z$)|0,k=k+Math.imul(t,A$)|0,X=X+Math.imul(i,b$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,b$)|0,k=k+Math.imul(F,R$)|0,X=X+Math.imul(h,M$)|0,v=v+Math.imul(h,N$)|0,v=v+Math.imul(L,M$)|0,k=k+Math.imul(L,N$)|0;var n6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,X=Math.imul(w$,D$),v=Math.imul(w$,g$),v=v+Math.imul(G$,D$)|0,k=Math.imul(G$,g$),X=X+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(f$,C$)|0,k=k+Math.imul(f$,E$)|0,X=X+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,k=k+Math.imul(T$,V$)|0,X=X+Math.imul(U,L$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,L$)|0,k=k+Math.imul(_$,S$)|0,X=X+Math.imul($$,p)|0,v=v+Math.imul($$,x)|0,v=v+Math.imul(s,p)|0,k=k+Math.imul(s,x)|0,X=X+Math.imul(o,K$)|0,v=v+Math.imul(o,j$)|0,v=v+Math.imul(B,K$)|0,k=k+Math.imul(B,j$)|0,X=X+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,k=k+Math.imul(v$,A$)|0,X=X+Math.imul(n,b$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(t,b$)|0,k=k+Math.imul(t,R$)|0,X=X+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,k=k+Math.imul(F,N$)|0;var i6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,X=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,k=Math.imul(G$,E$),X=X+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(f$,h$)|0,k=k+Math.imul(f$,V$)|0,X=X+Math.imul(O$,L$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,L$)|0,k=k+Math.imul(T$,S$)|0,X=X+Math.imul(U,p)|0,v=v+Math.imul(U,x)|0,v=v+Math.imul(_$,p)|0,k=k+Math.imul(_$,x)|0,X=X+Math.imul($$,K$)|0,v=v+Math.imul($$,j$)|0,v=v+Math.imul(s,K$)|0,k=k+Math.imul(s,j$)|0,X=X+Math.imul(o,Z$)|0,v=v+Math.imul(o,A$)|0,v=v+Math.imul(B,Z$)|0,k=k+Math.imul(B,A$)|0,X=X+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,b$)|0,k=k+Math.imul(v$,R$)|0,X=X+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(t,M$)|0,k=k+Math.imul(t,N$)|0;var t6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,X=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,k=Math.imul(G$,V$),X=X+Math.imul(H$,L$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(f$,L$)|0,k=k+Math.imul(f$,S$)|0,X=X+Math.imul(O$,p)|0,v=v+Math.imul(O$,x)|0,v=v+Math.imul(T$,p)|0,k=k+Math.imul(T$,x)|0,X=X+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,k=k+Math.imul(_$,j$)|0,X=X+Math.imul($$,Z$)|0,v=v+Math.imul($$,A$)|0,v=v+Math.imul(s,Z$)|0,k=k+Math.imul(s,A$)|0,X=X+Math.imul(o,b$)|0,v=v+Math.imul(o,R$)|0,v=v+Math.imul(B,b$)|0,k=k+Math.imul(B,R$)|0,X=X+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,k=k+Math.imul(v$,N$)|0;var B6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,X=Math.imul(w$,L$),v=Math.imul(w$,S$),v=v+Math.imul(G$,L$)|0,k=Math.imul(G$,S$),X=X+Math.imul(H$,p)|0,v=v+Math.imul(H$,x)|0,v=v+Math.imul(f$,p)|0,k=k+Math.imul(f$,x)|0,X=X+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,k=k+Math.imul(T$,j$)|0,X=X+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,k=k+Math.imul(_$,A$)|0,X=X+Math.imul($$,b$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(s,b$)|0,k=k+Math.imul(s,R$)|0,X=X+Math.imul(o,M$)|0,v=v+Math.imul(o,N$)|0,v=v+Math.imul(B,M$)|0,k=k+Math.imul(B,N$)|0;var U6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,X=Math.imul(w$,p),v=Math.imul(w$,x),v=v+Math.imul(G$,p)|0,k=Math.imul(G$,x),X=X+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(f$,K$)|0,k=k+Math.imul(f$,j$)|0,X=X+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,k=k+Math.imul(T$,A$)|0,X=X+Math.imul(U,b$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,b$)|0,k=k+Math.imul(_$,R$)|0,X=X+Math.imul($$,M$)|0,v=v+Math.imul($$,N$)|0,v=v+Math.imul(s,M$)|0,k=k+Math.imul(s,N$)|0;var F6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,X=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,k=Math.imul(G$,j$),X=X+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(f$,Z$)|0,k=k+Math.imul(f$,A$)|0,X=X+Math.imul(O$,b$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,b$)|0,k=k+Math.imul(T$,R$)|0,X=X+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,k=k+Math.imul(_$,N$)|0;var a6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,X=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,k=Math.imul(G$,A$),X=X+Math.imul(H$,b$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(f$,b$)|0,k=k+Math.imul(f$,R$)|0,X=X+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,k=k+Math.imul(T$,N$)|0;var Q6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,X=Math.imul(w$,b$),v=Math.imul(w$,R$),v=v+Math.imul(G$,b$)|0,k=Math.imul(G$,R$),X=X+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(f$,M$)|0,k=k+Math.imul(f$,N$)|0;var e6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,X=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,k=Math.imul(G$,N$);var s6=(N+X|0)+((v&8191)<<13)|0;if(N=(k+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,S[0]=D6,S[1]=O6,S[2]=K6,S[3]=A6,S[4]=m6,S[5]=d6,S[6]=l6,S[7]=o6,S[8]=r6,S[9]=n6,S[10]=i6,S[11]=t6,S[12]=B6,S[13]=U6,S[14]=F6,S[15]=a6,S[16]=Q6,S[17]=e6,S[18]=s6,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)R=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,X=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=X;v++){var k=Z-v,g=M.words[k]|0,h=Y.words[v]|0,L=g*h,d=L&67108863;S=S+(L/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new b;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=R(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function b(M,Y){this.x=M,this.y=Y}b.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},b.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},b.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},b.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var X=N<<1,v=Math.cos(2*Math.PI/X),k=Math.sin(2*Math.PI/X);for(var g=0;g<Z;g+=X){var h=v,L=k;for(var d=0;d<N;d++){var i=T[g+d],F=W[g+d],W$=T[g+d+N],n=W[g+d+N],t=h*W$-L*n;if(n=h*n+L*W$,W$=t,T[g+d]=i+W$,W[g+d]=F+n,T[g+d+N]=i-W$,W[g+d+N]=F-n,d!==X)t=v*h-k*L,L=v*L+k*h,h=t}}}},b.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},b.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},b.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},b.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},b.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},b.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),X=Array(W),v=Array(W),k=Array(W),g=Array(W),h=Array(W),L=T.words;L.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,k,W),this.transform(N,S,X,v,W,Z),this.transform(k,S,g,h,W,Z);for(var d=0;d<W;d++){var i=X[d]*g[d]-v[d]*h[d];v[d]=X[d]*h[d]+v[d]*g[d],X[d]=i}return this.conjugate(X,v,W),this.transform(X,v,L,S,W,Z),this.conjugate(L,S,W),this.normalize13b(L,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,X=(this.words[Z]|0)-N<<H;this.words[Z]=X|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,X=T;if(W-=S,W=Math.max(0,W),X){for(var v=0;v<S;v++)X.words[v]=this.words[v];X.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var k=0;for(v=this.length-1;v>=0&&(k!==0||v>=W);v--){var g=this.words[v]|0;this.words[v]=k<<26-Z|g>>>Z,k=g&N}if(X&&k!==0)X.words[X.length++]=k;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var X=(Y.words[Z]|0)*H;S-=X&67108863,N=(S>>26)-(X/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var X=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=X+1,v.words=Array(v.length);for(var k=0;k<v.length;k++)v.words[k]=0}var g=W.clone()._ishlnsubmul(Z,1,X);if(g.negative===0){if(W=g,v)v.words[X]=1}for(var h=X-1;h>=0;h--){var L=(W.words[Z.length+h]|0)*67108864+(W.words[Z.length+h-1]|0);L=Math.min(L/S|0,67108863),W._ishlnsubmul(Z,L,h);while(W.negative!==0)if(L--,W.negative=0,W._ishlnsubmul(Z,1,h),!W.isZero())W.negative^=1;if(v)v.words[h]=L}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),X=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++X;var v=T.clone(),k=H.clone();while(!H.isZero()){for(var g=0,h=1;(H.words[0]&h)===0&&g<26;++g,h<<=1);if(g>0){H.iushrn(g);while(g-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(k);W.iushrn(1),Z.iushrn(1)}}for(var L=0,d=1;(T.words[0]&d)===0&&L<26;++L,d<<=1);if(L>0){T.iushrn(L);while(L-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(k);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(X)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,X=1;(H.words[0]&X)===0&&N<26;++N,X<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,k=1;(T.words[0]&k)===0&&v<26;++v,k<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var g;if(H.cmpn(1)===0)g=W;else g=Z;if(g.cmpn(0)<0)g.iadd(Y);return g},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(c,y),c.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},c.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function q$(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(q$,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new c;else if(Y==="p224")H=new m;else if(Y==="p192")H=new q$;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),X=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,X).cmp(N)!==0)v.redIAdd(N);var k=this.pow(v,W),g=this.pow(Y,W.addn(1).iushrn(1)),h=this.pow(Y,W),L=Z;while(h.cmp(S)!==0){var d=h;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<L);var F=this.pow(k,new j(1).iushln(L-i-1));g=g.redMul(F),k=F.redSqr(),h=h.redMul(k),L=i}return g},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,X=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var k=H.words[Z];for(var g=v-1;g>=0;g--){var h=k>>g&1;if(S!==W[0])S=this.sqr(S);if(h===0&&N===0){X=0;continue}if(N<<=1,N|=h,X++,X!==T&&(Z!==0||g!==0))continue;S=this.mul(S,W[N]),X=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new r(Y)};function r(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}O(r,l),r.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},r.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},r.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),Dl=l$(($,q)=>{var K=Rl(),P=Il();q.exports=function(J){return new O(J)};var _={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};_.p224=_.secp224r1,_.p256=_.secp256r1=_.prime256v1,_.p192=_.secp192r1=_.prime192v1,_.p384=_.secp384r1,_.p521=_.secp521r1;function O(z){if(this.curveType=_[z],!this.curveType)this.curveType={name:z};this.curve=new K.ec(this.curveType.name),this.keys=void 0}O.prototype.generateKeys=function(z,J){return this.keys=this.curve.genKeyPair(),this.getPublicKey(z,J)},O.prototype.computeSecret=function(z,J,w){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);var G=this.curve.keyFromPublic(z).getPublic(),f=G.mul(this.keys.getPrivate()).getX();return j(f,w,this.curveType.byteLength)},O.prototype.getPublicKey=function(z,J){var w=this.keys.getPublic(J==="compressed",!0);if(J==="hybrid")if(w[w.length-1]%2)w[0]=7;else w[0]=6;return j(w,z)},O.prototype.getPrivateKey=function(z){return j(this.keys.getPrivate(),z)},O.prototype.setPublicKey=function(z,J){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);return this.keys._importPublic(z),this},O.prototype.setPrivateKey=function(z,J){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);var w=new P(z);return w=w.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(w),this};function j(z,J,w){if(!Array.isArray(z))z=z.toArray();var G=new Buffer(z);if(w&&G.length<w){var f=new Buffer(w-G.length);f.fill(0),G=Buffer.concat([f,G])}if(!J)return G;else return G.toString(J)}}),gl=l$(($,q)=>{var K=(Bq(),w6(tq)).createECDH;q.exports=K||Dl()}),Ll=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(Oq(),w6(jq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var X=Y.length-H;for(W=X%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function G(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,X=Math.min(S,S-N)+T,v=0;for(var k=T;k<X;k+=W)if(v=G(Y,k,k+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var g=1;v=G(Y,k,Y.length,H);for(k=0;k<N;k++)g*=H;if(this.imuln(g),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],X=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=f[6-X.length]+X+T;else T=X+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=A[Y],k=V[Y];T="";var g=this.clone();g.negative=0;while(!g.isZero()){var h=g.modn(k).toString(Y);if(g=g.idivn(k),!g.isZero())T=f[v-h.length]+h+T;else T=h+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),X,v,k=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[Z-v-1]=X}else{for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[v]=X;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,X=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var k=X>>>26,g=X&67108863,h=Math.min(v,Y.length-1);for(var L=Math.max(0,v-M.length+1);L<=h;L++){var d=v-L|0;W=M.words[d]|0,Z=Y.words[L]|0,S=W*Z+g,k+=S/67108864|0,g=S&67108863}H.words[v]=g|0,X=k|0}if(X!==0)H.words[v]=X|0;else H.length--;return H.strip()}var R=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,X,v,k,g=W[0]|0,h=g&8191,L=g>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,t=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,o=a&8191,B=a>>>13,p$=W[5]|0,$$=p$&8191,s=p$>>>13,Q=W[6]|0,U=Q&8191,_$=Q>>>13,X$=W[7]|0,O$=X$&8191,T$=X$>>>13,j6=W[8]|0,H$=j6&8191,f$=j6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,b6=Z[0]|0,k$=b6&8191,I$=b6>>>13,Yq=Z[1]|0,D$=Yq&8191,g$=Yq>>>13,Aq=Z[2]|0,C$=Aq&8191,E$=Aq>>>13,Gq=Z[3]|0,h$=Gq&8191,V$=Gq>>>13,Vq=Z[4]|0,L$=Vq&8191,S$=Vq>>>13,vq=Z[5]|0,p=vq&8191,x=vq>>>13,x$=Z[6]|0,K$=x$&8191,j$=x$>>>13,f6=Z[7]|0,Z$=f6&8191,A$=f6>>>13,zq=Z[8]|0,b$=zq&8191,R$=zq>>>13,Wq=Z[9]|0,M$=Wq&8191,N$=Wq>>>13;T.negative=Y.negative^H.negative,T.length=19,X=Math.imul(h,k$),v=Math.imul(h,I$),v=v+Math.imul(L,k$)|0,k=Math.imul(L,I$);var D6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(D6>>>26)|0,D6&=67108863,X=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,k=Math.imul(F,I$),X=X+Math.imul(h,D$)|0,v=v+Math.imul(h,g$)|0,v=v+Math.imul(L,D$)|0,k=k+Math.imul(L,g$)|0;var O6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(O6>>>26)|0,O6&=67108863,X=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(t,k$)|0,k=Math.imul(t,I$),X=X+Math.imul(i,D$)|0,v=v+Math.imul(i,g$)|0,v=v+Math.imul(F,D$)|0,k=k+Math.imul(F,g$)|0,X=X+Math.imul(h,C$)|0,v=v+Math.imul(h,E$)|0,v=v+Math.imul(L,C$)|0,k=k+Math.imul(L,E$)|0;var K6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,X=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,k=Math.imul(v$,I$),X=X+Math.imul(n,D$)|0,v=v+Math.imul(n,g$)|0,v=v+Math.imul(t,D$)|0,k=k+Math.imul(t,g$)|0,X=X+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,k=k+Math.imul(F,E$)|0,X=X+Math.imul(h,h$)|0,v=v+Math.imul(h,V$)|0,v=v+Math.imul(L,h$)|0,k=k+Math.imul(L,V$)|0;var A6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(A6>>>26)|0,A6&=67108863,X=Math.imul(o,k$),v=Math.imul(o,I$),v=v+Math.imul(B,k$)|0,k=Math.imul(B,I$),X=X+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,g$)|0,v=v+Math.imul(v$,D$)|0,k=k+Math.imul(v$,g$)|0,X=X+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(t,C$)|0,k=k+Math.imul(t,E$)|0,X=X+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,k=k+Math.imul(F,V$)|0,X=X+Math.imul(h,L$)|0,v=v+Math.imul(h,S$)|0,v=v+Math.imul(L,L$)|0,k=k+Math.imul(L,S$)|0;var m6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(m6>>>26)|0,m6&=67108863,X=Math.imul($$,k$),v=Math.imul($$,I$),v=v+Math.imul(s,k$)|0,k=Math.imul(s,I$),X=X+Math.imul(o,D$)|0,v=v+Math.imul(o,g$)|0,v=v+Math.imul(B,D$)|0,k=k+Math.imul(B,g$)|0,X=X+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,k=k+Math.imul(v$,E$)|0,X=X+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(t,h$)|0,k=k+Math.imul(t,V$)|0,X=X+Math.imul(i,L$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,L$)|0,k=k+Math.imul(F,S$)|0,X=X+Math.imul(h,p)|0,v=v+Math.imul(h,x)|0,v=v+Math.imul(L,p)|0,k=k+Math.imul(L,x)|0;var d6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,X=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,k=Math.imul(_$,I$),X=X+Math.imul($$,D$)|0,v=v+Math.imul($$,g$)|0,v=v+Math.imul(s,D$)|0,k=k+Math.imul(s,g$)|0,X=X+Math.imul(o,C$)|0,v=v+Math.imul(o,E$)|0,v=v+Math.imul(B,C$)|0,k=k+Math.imul(B,E$)|0,X=X+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,k=k+Math.imul(v$,V$)|0,X=X+Math.imul(n,L$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(t,L$)|0,k=k+Math.imul(t,S$)|0,X=X+Math.imul(i,p)|0,v=v+Math.imul(i,x)|0,v=v+Math.imul(F,p)|0,k=k+Math.imul(F,x)|0,X=X+Math.imul(h,K$)|0,v=v+Math.imul(h,j$)|0,v=v+Math.imul(L,K$)|0,k=k+Math.imul(L,j$)|0;var l6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,X=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,k=Math.imul(T$,I$),X=X+Math.imul(U,D$)|0,v=v+Math.imul(U,g$)|0,v=v+Math.imul(_$,D$)|0,k=k+Math.imul(_$,g$)|0,X=X+Math.imul($$,C$)|0,v=v+Math.imul($$,E$)|0,v=v+Math.imul(s,C$)|0,k=k+Math.imul(s,E$)|0,X=X+Math.imul(o,h$)|0,v=v+Math.imul(o,V$)|0,v=v+Math.imul(B,h$)|0,k=k+Math.imul(B,V$)|0,X=X+Math.imul(Y$,L$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,L$)|0,k=k+Math.imul(v$,S$)|0,X=X+Math.imul(n,p)|0,v=v+Math.imul(n,x)|0,v=v+Math.imul(t,p)|0,k=k+Math.imul(t,x)|0,X=X+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,k=k+Math.imul(F,j$)|0,X=X+Math.imul(h,Z$)|0,v=v+Math.imul(h,A$)|0,v=v+Math.imul(L,Z$)|0,k=k+Math.imul(L,A$)|0;var o6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,X=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(f$,k$)|0,k=Math.imul(f$,I$),X=X+Math.imul(O$,D$)|0,v=v+Math.imul(O$,g$)|0,v=v+Math.imul(T$,D$)|0,k=k+Math.imul(T$,g$)|0,X=X+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,k=k+Math.imul(_$,E$)|0,X=X+Math.imul($$,h$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(s,h$)|0,k=k+Math.imul(s,V$)|0,X=X+Math.imul(o,L$)|0,v=v+Math.imul(o,S$)|0,v=v+Math.imul(B,L$)|0,k=k+Math.imul(B,S$)|0,X=X+Math.imul(Y$,p)|0,v=v+Math.imul(Y$,x)|0,v=v+Math.imul(v$,p)|0,k=k+Math.imul(v$,x)|0,X=X+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(t,K$)|0,k=k+Math.imul(t,j$)|0,X=X+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,k=k+Math.imul(F,A$)|0,X=X+Math.imul(h,b$)|0,v=v+Math.imul(h,R$)|0,v=v+Math.imul(L,b$)|0,k=k+Math.imul(L,R$)|0;var r6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,X=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,k=Math.imul(G$,I$),X=X+Math.imul(H$,D$)|0,v=v+Math.imul(H$,g$)|0,v=v+Math.imul(f$,D$)|0,k=k+Math.imul(f$,g$)|0,X=X+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,k=k+Math.imul(T$,E$)|0,X=X+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,k=k+Math.imul(_$,V$)|0,X=X+Math.imul($$,L$)|0,v=v+Math.imul($$,S$)|0,v=v+Math.imul(s,L$)|0,k=k+Math.imul(s,S$)|0,X=X+Math.imul(o,p)|0,v=v+Math.imul(o,x)|0,v=v+Math.imul(B,p)|0,k=k+Math.imul(B,x)|0,X=X+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,k=k+Math.imul(v$,j$)|0,X=X+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(t,Z$)|0,k=k+Math.imul(t,A$)|0,X=X+Math.imul(i,b$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,b$)|0,k=k+Math.imul(F,R$)|0,X=X+Math.imul(h,M$)|0,v=v+Math.imul(h,N$)|0,v=v+Math.imul(L,M$)|0,k=k+Math.imul(L,N$)|0;var n6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,X=Math.imul(w$,D$),v=Math.imul(w$,g$),v=v+Math.imul(G$,D$)|0,k=Math.imul(G$,g$),X=X+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(f$,C$)|0,k=k+Math.imul(f$,E$)|0,X=X+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,k=k+Math.imul(T$,V$)|0,X=X+Math.imul(U,L$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,L$)|0,k=k+Math.imul(_$,S$)|0,X=X+Math.imul($$,p)|0,v=v+Math.imul($$,x)|0,v=v+Math.imul(s,p)|0,k=k+Math.imul(s,x)|0,X=X+Math.imul(o,K$)|0,v=v+Math.imul(o,j$)|0,v=v+Math.imul(B,K$)|0,k=k+Math.imul(B,j$)|0,X=X+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,k=k+Math.imul(v$,A$)|0,X=X+Math.imul(n,b$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(t,b$)|0,k=k+Math.imul(t,R$)|0,X=X+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,k=k+Math.imul(F,N$)|0;var i6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,X=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,k=Math.imul(G$,E$),X=X+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(f$,h$)|0,k=k+Math.imul(f$,V$)|0,X=X+Math.imul(O$,L$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,L$)|0,k=k+Math.imul(T$,S$)|0,X=X+Math.imul(U,p)|0,v=v+Math.imul(U,x)|0,v=v+Math.imul(_$,p)|0,k=k+Math.imul(_$,x)|0,X=X+Math.imul($$,K$)|0,v=v+Math.imul($$,j$)|0,v=v+Math.imul(s,K$)|0,k=k+Math.imul(s,j$)|0,X=X+Math.imul(o,Z$)|0,v=v+Math.imul(o,A$)|0,v=v+Math.imul(B,Z$)|0,k=k+Math.imul(B,A$)|0,X=X+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,b$)|0,k=k+Math.imul(v$,R$)|0,X=X+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(t,M$)|0,k=k+Math.imul(t,N$)|0;var t6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,X=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,k=Math.imul(G$,V$),X=X+Math.imul(H$,L$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(f$,L$)|0,k=k+Math.imul(f$,S$)|0,X=X+Math.imul(O$,p)|0,v=v+Math.imul(O$,x)|0,v=v+Math.imul(T$,p)|0,k=k+Math.imul(T$,x)|0,X=X+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,k=k+Math.imul(_$,j$)|0,X=X+Math.imul($$,Z$)|0,v=v+Math.imul($$,A$)|0,v=v+Math.imul(s,Z$)|0,k=k+Math.imul(s,A$)|0,X=X+Math.imul(o,b$)|0,v=v+Math.imul(o,R$)|0,v=v+Math.imul(B,b$)|0,k=k+Math.imul(B,R$)|0,X=X+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,k=k+Math.imul(v$,N$)|0;var B6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,X=Math.imul(w$,L$),v=Math.imul(w$,S$),v=v+Math.imul(G$,L$)|0,k=Math.imul(G$,S$),X=X+Math.imul(H$,p)|0,v=v+Math.imul(H$,x)|0,v=v+Math.imul(f$,p)|0,k=k+Math.imul(f$,x)|0,X=X+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,k=k+Math.imul(T$,j$)|0,X=X+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,k=k+Math.imul(_$,A$)|0,X=X+Math.imul($$,b$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(s,b$)|0,k=k+Math.imul(s,R$)|0,X=X+Math.imul(o,M$)|0,v=v+Math.imul(o,N$)|0,v=v+Math.imul(B,M$)|0,k=k+Math.imul(B,N$)|0;var U6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,X=Math.imul(w$,p),v=Math.imul(w$,x),v=v+Math.imul(G$,p)|0,k=Math.imul(G$,x),X=X+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(f$,K$)|0,k=k+Math.imul(f$,j$)|0,X=X+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,k=k+Math.imul(T$,A$)|0,X=X+Math.imul(U,b$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,b$)|0,k=k+Math.imul(_$,R$)|0,X=X+Math.imul($$,M$)|0,v=v+Math.imul($$,N$)|0,v=v+Math.imul(s,M$)|0,k=k+Math.imul(s,N$)|0;var F6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,X=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,k=Math.imul(G$,j$),X=X+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(f$,Z$)|0,k=k+Math.imul(f$,A$)|0,X=X+Math.imul(O$,b$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,b$)|0,k=k+Math.imul(T$,R$)|0,X=X+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,k=k+Math.imul(_$,N$)|0;var a6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,X=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,k=Math.imul(G$,A$),X=X+Math.imul(H$,b$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(f$,b$)|0,k=k+Math.imul(f$,R$)|0,X=X+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,k=k+Math.imul(T$,N$)|0;var Q6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,X=Math.imul(w$,b$),v=Math.imul(w$,R$),v=v+Math.imul(G$,b$)|0,k=Math.imul(G$,R$),X=X+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(f$,M$)|0,k=k+Math.imul(f$,N$)|0;var e6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,X=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,k=Math.imul(G$,N$);var s6=(N+X|0)+((v&8191)<<13)|0;if(N=(k+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,S[0]=D6,S[1]=O6,S[2]=K6,S[3]=A6,S[4]=m6,S[5]=d6,S[6]=l6,S[7]=o6,S[8]=r6,S[9]=n6,S[10]=i6,S[11]=t6,S[12]=B6,S[13]=U6,S[14]=F6,S[15]=a6,S[16]=Q6,S[17]=e6,S[18]=s6,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)R=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,X=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=X;v++){var k=Z-v,g=M.words[k]|0,h=Y.words[v]|0,L=g*h,d=L&67108863;S=S+(L/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new b;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=R(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function b(M,Y){this.x=M,this.y=Y}b.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},b.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},b.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},b.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var X=N<<1,v=Math.cos(2*Math.PI/X),k=Math.sin(2*Math.PI/X);for(var g=0;g<Z;g+=X){var h=v,L=k;for(var d=0;d<N;d++){var i=T[g+d],F=W[g+d],W$=T[g+d+N],n=W[g+d+N],t=h*W$-L*n;if(n=h*n+L*W$,W$=t,T[g+d]=i+W$,W[g+d]=F+n,T[g+d+N]=i-W$,W[g+d+N]=F-n,d!==X)t=v*h-k*L,L=v*L+k*h,h=t}}}},b.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},b.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},b.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},b.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},b.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},b.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),X=Array(W),v=Array(W),k=Array(W),g=Array(W),h=Array(W),L=T.words;L.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,k,W),this.transform(N,S,X,v,W,Z),this.transform(k,S,g,h,W,Z);for(var d=0;d<W;d++){var i=X[d]*g[d]-v[d]*h[d];v[d]=X[d]*h[d]+v[d]*g[d],X[d]=i}return this.conjugate(X,v,W),this.transform(X,v,L,S,W,Z),this.conjugate(L,S,W),this.normalize13b(L,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,X=(this.words[Z]|0)-N<<H;this.words[Z]=X|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,X=T;if(W-=S,W=Math.max(0,W),X){for(var v=0;v<S;v++)X.words[v]=this.words[v];X.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var k=0;for(v=this.length-1;v>=0&&(k!==0||v>=W);v--){var g=this.words[v]|0;this.words[v]=k<<26-Z|g>>>Z,k=g&N}if(X&&k!==0)X.words[X.length++]=k;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var X=(Y.words[Z]|0)*H;S-=X&67108863,N=(S>>26)-(X/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var X=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=X+1,v.words=Array(v.length);for(var k=0;k<v.length;k++)v.words[k]=0}var g=W.clone()._ishlnsubmul(Z,1,X);if(g.negative===0){if(W=g,v)v.words[X]=1}for(var h=X-1;h>=0;h--){var L=(W.words[Z.length+h]|0)*67108864+(W.words[Z.length+h-1]|0);L=Math.min(L/S|0,67108863),W._ishlnsubmul(Z,L,h);while(W.negative!==0)if(L--,W.negative=0,W._ishlnsubmul(Z,1,h),!W.isZero())W.negative^=1;if(v)v.words[h]=L}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),X=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++X;var v=T.clone(),k=H.clone();while(!H.isZero()){for(var g=0,h=1;(H.words[0]&h)===0&&g<26;++g,h<<=1);if(g>0){H.iushrn(g);while(g-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(k);W.iushrn(1),Z.iushrn(1)}}for(var L=0,d=1;(T.words[0]&d)===0&&L<26;++L,d<<=1);if(L>0){T.iushrn(L);while(L-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(k);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(X)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,X=1;(H.words[0]&X)===0&&N<26;++N,X<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,k=1;(T.words[0]&k)===0&&v<26;++v,k<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var g;if(H.cmpn(1)===0)g=W;else g=Z;if(g.cmpn(0)<0)g.iadd(Y);return g},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(c,y),c.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},c.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function q$(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(q$,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new c;else if(Y==="p224")H=new m;else if(Y==="p192")H=new q$;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),X=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,X).cmp(N)!==0)v.redIAdd(N);var k=this.pow(v,W),g=this.pow(Y,W.addn(1).iushrn(1)),h=this.pow(Y,W),L=Z;while(h.cmp(S)!==0){var d=h;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<L);var F=this.pow(k,new j(1).iushln(L-i-1));g=g.redMul(F),k=F.redSqr(),h=h.redMul(k),L=i}return g},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,X=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var k=H.words[Z];for(var g=v-1;g>=0;g--){var h=k>>g&1;if(S!==W[0])S=this.sqr(S);if(h===0&&N===0){X=0;continue}if(N<<=1,N|=h,X++,X!==T&&(Z!==0||g!==0))continue;S=this.mul(S,W[N]),X=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new r(Y)};function r(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}O(r,l),r.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},r.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},r.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),bl=l$(($)=>{var q=d7(),K=K8(),P=$;P.define=function(j,z){return new _(j,z)};function _(O,j){this.name=O,this.body=j,this.decoders={},this.encoders={}}_.prototype._createNamed=function(j){var z;try{z=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
35
35
|
this._initNamed(entity);
|
|
36
36
|
})`)}catch(J){z=function(w){this._initNamed(w)}}return K(z,j),z.prototype._initNamed=function(w){j.call(this,w)},new z(this)},_.prototype._getDecoder=function(j){if(j=j||"der",!this.decoders.hasOwnProperty(j))this.decoders[j]=this._createNamed(q.decoders[j]);return this.decoders[j]},_.prototype.decode=function(j,z,J){return this._getDecoder(z).decode(j,J)},_.prototype._getEncoder=function(j){if(j=j||"der",!this.encoders.hasOwnProperty(j))this.encoders[j]=this._createNamed(q.encoders[j]);return this.encoders[j]},_.prototype.encode=function(j,z,J){return this._getEncoder(z).encode(j,J)}}),ul=l$(($)=>{var q=K8();function K(_){this._reporterState={obj:null,path:[],options:_||{},errors:[]}}$.Reporter=K,K.prototype.isError=function(O){return O instanceof P},K.prototype.save=function(){var O=this._reporterState;return{obj:O.obj,pathLen:O.path.length}},K.prototype.restore=function(O){var j=this._reporterState;j.obj=O.obj,j.path=j.path.slice(0,O.pathLen)},K.prototype.enterKey=function(O){return this._reporterState.path.push(O)},K.prototype.exitKey=function(O){var j=this._reporterState;j.path=j.path.slice(0,O-1)},K.prototype.leaveKey=function(O,j,z){var J=this._reporterState;if(this.exitKey(O),J.obj!==null)J.obj[j]=z},K.prototype.path=function(){return this._reporterState.path.join("/")},K.prototype.enterObject=function(){var O=this._reporterState,j=O.obj;return O.obj={},j},K.prototype.leaveObject=function(O){var j=this._reporterState,z=j.obj;return j.obj=O,z},K.prototype.error=function(O){var j,z=this._reporterState,J=O instanceof P;if(J)j=O;else j=new P(z.path.map(function(w){return"["+JSON.stringify(w)+"]"}).join(""),O.message||O,O.stack);if(!z.options.partial)throw j;if(!J)z.errors.push(j);return j},K.prototype.wrapResult=function(O){var j=this._reporterState;if(!j.options.partial)return O;return{result:this.isError(O)?null:O,errors:j.errors}};function P(_,O){this.path=_,this.rethrow(O)}q(P,Error),P.prototype.rethrow=function(O){if(this.message=O+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,P);if(!this.stack)try{throw Error(this.message)}catch(j){this.stack=j.stack}return this}}),mS=l$(($)=>{var q=K8(),K=c7().Reporter,P=(Oq(),w6(jq)).Buffer;function _(j,z){if(K.call(this,z),!P.isBuffer(j)){this.error("Input not Buffer");return}this.base=j,this.offset=0,this.length=j.length}q(_,K),$.DecoderBuffer=_,_.prototype.save=function(){return{offset:this.offset,reporter:K.prototype.save.call(this)}},_.prototype.restore=function(z){var J=new _(this.base);return J.offset=z.offset,J.length=this.offset,this.offset=z.offset,K.prototype.restore.call(this,z.reporter),J},_.prototype.isEmpty=function(){return this.offset===this.length},_.prototype.readUInt8=function(z){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(z||"DecoderBuffer overrun")},_.prototype.skip=function(z,J){if(!(this.offset+z<=this.length))return this.error(J||"DecoderBuffer overrun");var w=new _(this.base);return w._reporterState=this._reporterState,w.offset=this.offset,w.length=this.offset+z,this.offset+=z,w},_.prototype.raw=function(z){return this.base.slice(z?z.offset:this.offset,this.length)};function O(j,z){if(Array.isArray(j))this.length=0,this.value=j.map(function(J){if(!(J instanceof O))J=new O(J,z);return this.length+=J.length,J},this);else if(typeof j==="number"){if(!(0<=j&&j<=255))return z.error("non-byte EncoderBuffer value");this.value=j,this.length=1}else if(typeof j==="string")this.value=j,this.length=P.byteLength(j);else if(P.isBuffer(j))this.value=j,this.length=j.length;else return z.error("Unsupported type: "+typeof j)}$.EncoderBuffer=O,O.prototype.join=function(z,J){if(!z)z=new P(this.length);if(!J)J=0;if(this.length===0)return z;if(Array.isArray(this.value))this.value.forEach(function(w){w.join(z,J),J+=w.length});else{if(typeof this.value==="number")z[J]=this.value;else if(typeof this.value==="string")z.write(this.value,J);else if(P.isBuffer(this.value))this.value.copy(z,J);J+=this.length}return z}}),yl=l$(($,q)=>{var K=c7().Reporter,P=c7().EncoderBuffer,_=c7().DecoderBuffer,O=lK(),j=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],z=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(j),J=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function w(f,A){var V={};if(this._baseState=V,V.enc=f,V.parent=A||null,V.children=null,V.tag=null,V.args=null,V.reverseArgs=null,V.choice=null,V.optional=!1,V.any=!1,V.obj=!1,V.use=null,V.useDecoder=null,V.key=null,V.default=null,V.explicit=null,V.implicit=null,V.contains=null,!V.parent)V.children=[],this._wrap()}q.exports=w;var G=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];w.prototype.clone=function(){var A=this._baseState,V={};G.forEach(function(E){V[E]=A[E]});var C=new this.constructor(V.parent);return C._baseState=V,C},w.prototype._wrap=function(){var A=this._baseState;z.forEach(function(V){this[V]=function(){var E=new this.constructor(this);return A.children.push(E),E[V].apply(E,arguments)}},this)},w.prototype._init=function(A){var V=this._baseState;O(V.parent===null),A.call(this),V.children=V.children.filter(function(C){return C._baseState.parent===this},this),O.equal(V.children.length,1,"Root node can have only one child")},w.prototype._useArgs=function(A){var V=this._baseState,C=A.filter(function(E){return E instanceof this.constructor},this);if(A=A.filter(function(E){return!(E instanceof this.constructor)},this),C.length!==0)O(V.children===null),V.children=C,C.forEach(function(E){E._baseState.parent=this},this);if(A.length!==0)O(V.args===null),V.args=A,V.reverseArgs=A.map(function(E){if(typeof E!=="object"||E.constructor!==Object)return E;var R={};return Object.keys(E).forEach(function(I){if(I==(I|0))I|=0;var D=E[I];R[D]=I}),R})},J.forEach(function(f){w.prototype[f]=function(){var V=this._baseState;throw Error(f+" not implemented for encoding: "+V.enc)}}),j.forEach(function(f){w.prototype[f]=function(){var V=this._baseState,C=Array.prototype.slice.call(arguments);return O(V.tag===null),V.tag=f,this._useArgs(C),this}}),w.prototype.use=function(A){O(A);var V=this._baseState;return O(V.use===null),V.use=A,this},w.prototype.optional=function(){var A=this._baseState;return A.optional=!0,this},w.prototype.def=function(A){var V=this._baseState;return O(V.default===null),V.default=A,V.optional=!0,this},w.prototype.explicit=function(A){var V=this._baseState;return O(V.explicit===null&&V.implicit===null),V.explicit=A,this},w.prototype.implicit=function(A){var V=this._baseState;return O(V.explicit===null&&V.implicit===null),V.implicit=A,this},w.prototype.obj=function(){var A=this._baseState,V=Array.prototype.slice.call(arguments);if(A.obj=!0,V.length!==0)this._useArgs(V);return this},w.prototype.key=function(A){var V=this._baseState;return O(V.key===null),V.key=A,this},w.prototype.any=function(){var A=this._baseState;return A.any=!0,this},w.prototype.choice=function(A){var V=this._baseState;return O(V.choice===null),V.choice=A,this._useArgs(Object.keys(A).map(function(C){return A[C]})),this},w.prototype.contains=function(A){var V=this._baseState;return O(V.use===null),V.contains=A,this},w.prototype._decode=function(A,V){var C=this._baseState;if(C.parent===null)return A.wrapResult(C.children[0]._decode(A,V));var E=C.default,R=!0,I=null;if(C.key!==null)I=A.enterKey(C.key);if(C.optional){var D=null;if(C.explicit!==null)D=C.explicit;else if(C.implicit!==null)D=C.implicit;else if(C.tag!==null)D=C.tag;if(D===null&&!C.any){var b=A.save();try{if(C.choice===null)this._decodeGeneric(C.tag,A,V);else this._decodeChoice(A,V);R=!0}catch(e){R=!1}A.restore(b)}else if(R=this._peekTag(A,D,C.any),A.isError(R))return R}var u;if(C.obj&&R)u=A.enterObject();if(R){if(C.explicit!==null){var y=this._decodeTag(A,C.explicit);if(A.isError(y))return y;A=y}var c=A.offset;if(C.use===null&&C.choice===null){if(C.any)var b=A.save();var m=this._decodeTag(A,C.implicit!==null?C.implicit:C.tag,C.any);if(A.isError(m))return m;if(C.any)E=A.raw(b);else A=m}if(V&&V.track&&C.tag!==null)V.track(A.path(),c,A.length,"tagged");if(V&&V.track&&C.tag!==null)V.track(A.path(),A.offset,A.length,"content");if(C.any)E=E;else if(C.choice===null)E=this._decodeGeneric(C.tag,A,V);else E=this._decodeChoice(A,V);if(A.isError(E))return E;if(!C.any&&C.choice===null&&C.children!==null)C.children.forEach(function(l){l._decode(A,V)});if(C.contains&&(C.tag==="octstr"||C.tag==="bitstr")){var q$=new _(E);E=this._getUse(C.contains,A._reporterState.obj)._decode(q$,V)}}if(C.obj&&R)E=A.leaveObject(u);if(C.key!==null&&(E!==null||R===!0))A.leaveKey(I,C.key,E);else if(I!==null)A.exitKey(I);return E},w.prototype._decodeGeneric=function(A,V,C){var E=this._baseState;if(A==="seq"||A==="set")return null;if(A==="seqof"||A==="setof")return this._decodeList(V,A,E.args[0],C);else if(/str$/.test(A))return this._decodeStr(V,A,C);else if(A==="objid"&&E.args)return this._decodeObjid(V,E.args[0],E.args[1],C);else if(A==="objid")return this._decodeObjid(V,null,null,C);else if(A==="gentime"||A==="utctime")return this._decodeTime(V,A,C);else if(A==="null_")return this._decodeNull(V,C);else if(A==="bool")return this._decodeBool(V,C);else if(A==="objDesc")return this._decodeStr(V,A,C);else if(A==="int"||A==="enum")return this._decodeInt(V,E.args&&E.args[0],C);if(E.use!==null)return this._getUse(E.use,V._reporterState.obj)._decode(V,C);else return V.error("unknown tag: "+A)},w.prototype._getUse=function(A,V){var C=this._baseState;if(C.useDecoder=this._use(A,V),O(C.useDecoder._baseState.parent===null),C.useDecoder=C.useDecoder._baseState.children[0],C.implicit!==C.useDecoder._baseState.implicit)C.useDecoder=C.useDecoder.clone(),C.useDecoder._baseState.implicit=C.implicit;return C.useDecoder},w.prototype._decodeChoice=function(A,V){var C=this._baseState,E=null,R=!1;if(Object.keys(C.choice).some(function(I){var D=A.save(),b=C.choice[I];try{var u=b._decode(A,V);if(A.isError(u))return!1;E={type:I,value:u},R=!0}catch(y){return A.restore(D),!1}return!0},this),!R)return A.error("Choice not matched");return E},w.prototype._createEncoderBuffer=function(A){return new P(A,this.reporter)},w.prototype._encode=function(A,V,C){var E=this._baseState;if(E.default!==null&&E.default===A)return;var R=this._encodeValue(A,V,C);if(R===void 0)return;if(this._skipDefault(R,V,C))return;return R},w.prototype._encodeValue=function(A,V,C){var E=this._baseState;if(E.parent===null)return E.children[0]._encode(A,V||new K);var b=null;if(this.reporter=V,E.optional&&A===void 0)if(E.default!==null)A=E.default;else return;var R=null,I=!1;if(E.any)b=this._createEncoderBuffer(A);else if(E.choice)b=this._encodeChoice(A,V);else if(E.contains)R=this._getUse(E.contains,C)._encode(A,V),I=!0;else if(E.children)R=E.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,V,A);if(c._baseState.key===null)return V.error("Child should have a key");var m=V.enterKey(c._baseState.key);if(typeof A!=="object")return V.error("Child expected, but input is not object");var q$=c._encode(A[c._baseState.key],V,A);return V.leaveKey(m),q$},this).filter(function(c){return c}),R=this._createEncoderBuffer(R);else if(E.tag==="seqof"||E.tag==="setof"){if(!(E.args&&E.args.length===1))return V.error("Too many args for : "+E.tag);if(!Array.isArray(A))return V.error("seqof/setof, but data is not Array");var D=this.clone();D._baseState.implicit=null,R=this._createEncoderBuffer(A.map(function(c){var m=this._baseState;return this._getUse(m.args[0],A)._encode(c,V)},D))}else if(E.use!==null)b=this._getUse(E.use,C)._encode(A,V);else R=this._encodePrimitive(E.tag,A),I=!0;var b;if(!E.any&&E.choice===null){var u=E.implicit!==null?E.implicit:E.tag,y=E.implicit===null?"universal":"context";if(u===null){if(E.use===null)V.error("Tag could be omitted only for .use()")}else if(E.use===null)b=this._encodeComposite(u,I,y,R)}if(E.explicit!==null)b=this._encodeComposite(E.explicit,!1,"context",b);return b},w.prototype._encodeChoice=function(A,V){var C=this._baseState,E=C.choice[A.type];if(!E)O(!1,A.type+" not found in "+JSON.stringify(Object.keys(C.choice)));return E._encode(A.value,V)},w.prototype._encodePrimitive=function(A,V){var C=this._baseState;if(/str$/.test(A))return this._encodeStr(V,A);else if(A==="objid"&&C.args)return this._encodeObjid(V,C.reverseArgs[0],C.args[1]);else if(A==="objid")return this._encodeObjid(V,null,null);else if(A==="gentime"||A==="utctime")return this._encodeTime(V,A);else if(A==="null_")return this._encodeNull();else if(A==="int"||A==="enum")return this._encodeInt(V,C.args&&C.reverseArgs[0]);else if(A==="bool")return this._encodeBool(V);else if(A==="objDesc")return this._encodeStr(V,A);else throw Error("Unsupported tag: "+A)},w.prototype._isNumstr=function(A){return/^[0-9 ]*$/.test(A)},w.prototype._isPrintstr=function(A){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(A)}}),c7=l$(($)=>{var q=$;q.Reporter=ul().Reporter,q.DecoderBuffer=mS().DecoderBuffer,q.EncoderBuffer=mS().EncoderBuffer,q.Node=yl()}),pl=l$(($)=>{var q=FS();$.tagClass={0:"universal",1:"application",2:"context",3:"private"},$.tagClassByName=q._reverse($.tagClass),$.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},$.tagByName=q._reverse($.tag)}),FS=l$(($)=>{var q=$;q._reverse=function(P){var _={};return Object.keys(P).forEach(function(O){if((O|0)==O)O=O|0;var j=P[O];_[j]=O}),_},q.der=pl()}),aS=l$(($,q)=>{var K=K8(),P=d7(),_=P.base,O=P.bignum,j=P.constants.der;function z(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new J,this.tree._init(f.body)}q.exports=z,z.prototype.decode=function(A,V){if(!(A instanceof _.DecoderBuffer))A=new _.DecoderBuffer(A,V);return this.tree._decode(A,V)};function J(f){_.Node.call(this,"der",f)}K(J,_.Node),J.prototype._peekTag=function(A,V,C){if(A.isEmpty())return!1;var E=A.save(),R=w(A,'Failed to peek tag: "'+V+'"');if(A.isError(R))return R;return A.restore(E),R.tag===V||R.tagStr===V||R.tagStr+"of"===V||C},J.prototype._decodeTag=function(A,V,C){var E=w(A,'Failed to decode tag of "'+V+'"');if(A.isError(E))return E;var R=G(A,E.primitive,'Failed to get length of "'+V+'"');if(A.isError(R))return R;if(!C&&E.tag!==V&&E.tagStr!==V&&E.tagStr+"of"!==V)return A.error('Failed to match tag: "'+V+'"');if(E.primitive||R!==null)return A.skip(R,'Failed to match body of: "'+V+'"');var I=A.save(),D=this._skipUntilEnd(A,'Failed to skip indefinite length body: "'+this.tag+'"');if(A.isError(D))return D;return R=A.offset-I.offset,A.restore(I),A.skip(R,'Failed to match body of: "'+V+'"')},J.prototype._skipUntilEnd=function(A,V){while(!0){var C=w(A,V);if(A.isError(C))return C;var E=G(A,C.primitive,V);if(A.isError(E))return E;var R;if(C.primitive||E!==null)R=A.skip(E);else R=this._skipUntilEnd(A,V);if(A.isError(R))return R;if(C.tagStr==="end")break}},J.prototype._decodeList=function(A,V,C,E){var R=[];while(!A.isEmpty()){var I=this._peekTag(A,"end");if(A.isError(I))return I;var D=C.decode(A,"der",E);if(A.isError(D)&&I)break;R.push(D)}return R},J.prototype._decodeStr=function(A,V){if(V==="bitstr"){var C=A.readUInt8();if(A.isError(C))return C;return{unused:C,data:A.raw()}}else if(V==="bmpstr"){var E=A.raw();if(E.length%2===1)return A.error("Decoding of string type: bmpstr length mismatch");var R="";for(var I=0;I<E.length/2;I++)R+=String.fromCharCode(E.readUInt16BE(I*2));return R}else if(V==="numstr"){var D=A.raw().toString("ascii");if(!this._isNumstr(D))return A.error("Decoding of string type: numstr unsupported characters");return D}else if(V==="octstr")return A.raw();else if(V==="objDesc")return A.raw();else if(V==="printstr"){var b=A.raw().toString("ascii");if(!this._isPrintstr(b))return A.error("Decoding of string type: printstr unsupported characters");return b}else if(/str$/.test(V))return A.raw().toString();else return A.error("Decoding of string type: "+V+" unsupported")},J.prototype._decodeObjid=function(A,V,C){var E,R=[],I=0;while(!A.isEmpty()){var D=A.readUInt8();if(I<<=7,I|=D&127,(D&128)===0)R.push(I),I=0}if(D&128)R.push(I);var b=R[0]/40|0,u=R[0]%40;if(C)E=R;else E=[b,u].concat(R.slice(1));if(V){var y=V[E.join(" ")];if(y===void 0)y=V[E.join(".")];if(y!==void 0)E=y}return E},J.prototype._decodeTime=function(A,V){var C=A.raw().toString();if(V==="gentime")var E=C.slice(0,4)|0,R=C.slice(4,6)|0,I=C.slice(6,8)|0,D=C.slice(8,10)|0,b=C.slice(10,12)|0,u=C.slice(12,14)|0;else if(V==="utctime"){var E=C.slice(0,2)|0,R=C.slice(2,4)|0,I=C.slice(4,6)|0,D=C.slice(6,8)|0,b=C.slice(8,10)|0,u=C.slice(10,12)|0;if(E<70)E=2000+E;else E=1900+E}else return A.error("Decoding "+V+" time is not supported yet");return Date.UTC(E,R-1,I,D,b,u,0)},J.prototype._decodeNull=function(A){return null},J.prototype._decodeBool=function(A){var V=A.readUInt8();if(A.isError(V))return V;else return V!==0},J.prototype._decodeInt=function(A,V){var C=A.raw(),E=new O(C);if(V)E=V[E.toString(10)]||E;return E},J.prototype._use=function(A,V){if(typeof A==="function")A=A(V);return A._getDecoder("der").tree};function w(f,A){var V=f.readUInt8(A);if(f.isError(V))return V;var C=j.tagClass[V>>6],E=(V&32)===0;if((V&31)===31){var R=V;V=0;while((R&128)===128){if(R=f.readUInt8(A),f.isError(R))return R;V<<=7,V|=R&127}}else V&=31;var I=j.tag[V];return{cls:C,primitive:E,tag:V,tagStr:I}}function G(f,A,V){var C=f.readUInt8(V);if(f.isError(C))return C;if(!A&&C===128)return null;if((C&128)===0)return C;var E=C&127;if(E>4)return f.error("length octect is too long");C=0;for(var R=0;R<E;R++){C<<=8;var I=f.readUInt8(V);if(f.isError(I))return I;C|=I}return C}}),xl=l$(($,q)=>{var K=K8(),P=(Oq(),w6(jq)).Buffer,_=aS();function O(j){_.call(this,j),this.enc="pem"}K(O,_),q.exports=O,O.prototype.decode=function(z,J){var w=z.toString().split(/[\r\n]+/g),G=J.label.toUpperCase(),f=/^-----(BEGIN|END) ([^-]+)-----$/,A=-1,V=-1;for(var C=0;C<w.length;C++){var E=w[C].match(f);if(E===null)continue;if(E[2]!==G)continue;if(A===-1){if(E[1]!=="BEGIN")break;A=C}else{if(E[1]!=="END")break;V=C;break}}if(A===-1||V===-1)throw Error("PEM section not found for: "+G);var R=w.slice(A+1,V).join("");R.replace(/[^a-z0-9\+\/=]+/gi,"");var I=new P(R,"base64");return _.prototype.decode.call(this,I,J)}}),cl=l$(($)=>{var q=$;q.der=aS(),q.pem=xl()}),QS=l$(($,q)=>{var K=K8(),P=(Oq(),w6(jq)).Buffer,_=d7(),O=_.base,j=_.constants.der;function z(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new J,this.tree._init(f.body)}q.exports=z,z.prototype.encode=function(A,V){return this.tree._encode(A,V).join()};function J(f){O.Node.call(this,"der",f)}K(J,O.Node),J.prototype._encodeComposite=function(A,V,C,E){var R=G(A,V,C,this.reporter);if(E.length<128){var b=new P(2);return b[0]=R,b[1]=E.length,this._createEncoderBuffer([b,E])}var I=1;for(var D=E.length;D>=256;D>>=8)I++;var b=new P(2+I);b[0]=R,b[1]=128|I;for(var D=1+I,u=E.length;u>0;D--,u>>=8)b[D]=u&255;return this._createEncoderBuffer([b,E])},J.prototype._encodeStr=function(A,V){if(V==="bitstr")return this._createEncoderBuffer([A.unused|0,A.data]);else if(V==="bmpstr"){var C=new P(A.length*2);for(var E=0;E<A.length;E++)C.writeUInt16BE(A.charCodeAt(E),E*2);return this._createEncoderBuffer(C)}else if(V==="numstr"){if(!this._isNumstr(A))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(A)}else if(V==="printstr"){if(!this._isPrintstr(A))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(A)}else if(/str$/.test(V))return this._createEncoderBuffer(A);else if(V==="objDesc")return this._createEncoderBuffer(A);else return this.reporter.error("Encoding of string type: "+V+" unsupported")},J.prototype._encodeObjid=function(A,V,C){if(typeof A==="string"){if(!V)return this.reporter.error("string objid given, but no values map found");if(!V.hasOwnProperty(A))return this.reporter.error("objid not found in values map");A=V[A].split(/[\s\.]+/g);for(var E=0;E<A.length;E++)A[E]|=0}else if(Array.isArray(A)){A=A.slice();for(var E=0;E<A.length;E++)A[E]|=0}if(!Array.isArray(A))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(A));if(!C){if(A[1]>=40)return this.reporter.error("Second objid identifier OOB");A.splice(0,2,A[0]*40+A[1])}var R=0;for(var E=0;E<A.length;E++){var I=A[E];for(R++;I>=128;I>>=7)R++}var D=new P(R),b=D.length-1;for(var E=A.length-1;E>=0;E--){var I=A[E];D[b--]=I&127;while((I>>=7)>0)D[b--]=128|I&127}return this._createEncoderBuffer(D)};function w(f){if(f<10)return"0"+f;else return f}J.prototype._encodeTime=function(A,V){var C,E=new Date(A);if(V==="gentime")C=[w(E.getFullYear()),w(E.getUTCMonth()+1),w(E.getUTCDate()),w(E.getUTCHours()),w(E.getUTCMinutes()),w(E.getUTCSeconds()),"Z"].join("");else if(V==="utctime")C=[w(E.getFullYear()%100),w(E.getUTCMonth()+1),w(E.getUTCDate()),w(E.getUTCHours()),w(E.getUTCMinutes()),w(E.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+V+" time is not supported yet");return this._encodeStr(C,"octstr")},J.prototype._encodeNull=function(){return this._createEncoderBuffer("")},J.prototype._encodeInt=function(A,V){if(typeof A==="string"){if(!V)return this.reporter.error("String int or enum given, but no values map");if(!V.hasOwnProperty(A))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(A));A=V[A]}if(typeof A!=="number"&&!P.isBuffer(A)){var C=A.toArray();if(!A.sign&&C[0]&128)C.unshift(0);A=new P(C)}if(P.isBuffer(A)){var E=A.length;if(A.length===0)E++;var I=new P(E);if(A.copy(I),A.length===0)I[0]=0;return this._createEncoderBuffer(I)}if(A<128)return this._createEncoderBuffer(A);if(A<256)return this._createEncoderBuffer([0,A]);var E=1;for(var R=A;R>=256;R>>=8)E++;var I=Array(E);for(var R=I.length-1;R>=0;R--)I[R]=A&255,A>>=8;if(I[0]&128)I.unshift(0);return this._createEncoderBuffer(new P(I))},J.prototype._encodeBool=function(A){return this._createEncoderBuffer(A?255:0)},J.prototype._use=function(A,V){if(typeof A==="function")A=A(V);return A._getEncoder("der").tree},J.prototype._skipDefault=function(A,V,C){var E=this._baseState,R;if(E.default===null)return!1;var I=A.join();if(E.defaultBuffer===void 0)E.defaultBuffer=this._encodeValue(E.default,V,C).join();if(I.length!==E.defaultBuffer.length)return!1;for(R=0;R<I.length;R++)if(I[R]!==E.defaultBuffer[R])return!1;return!0};function G(f,A,V,C){var E;if(f==="seqof")f="seq";else if(f==="setof")f="set";if(j.tagByName.hasOwnProperty(f))E=j.tagByName[f];else if(typeof f==="number"&&(f|0)===f)E=f;else return C.error("Unknown tag: "+f);if(E>=31)return C.error("Multi-octet tag encoding unsupported");if(!A)E|=32;return E|=j.tagClassByName[V||"universal"]<<6,E}}),ml=l$(($,q)=>{var K=K8(),P=QS();function _(O){P.call(this,O),this.enc="pem"}K(_,P),q.exports=_,_.prototype.encode=function(j,z){var J=P.prototype.encode.call(this,j),w=J.toString("base64"),G=["-----BEGIN "+z.label+"-----"];for(var f=0;f<w.length;f+=64)G.push(w.slice(f,f+64));return G.push("-----END "+z.label+"-----"),G.join(`
|
|
37
37
|
`)}}),dl=l$(($)=>{var q=$;q.der=QS(),q.pem=ml()}),d7=l$(($)=>{var q=$;q.bignum=Ll(),q.define=bl().define,q.base=c7(),q.constants=FS(),q.decoders=cl(),q.encoders=dl()}),ll=l$(($,q)=>{var K=d7(),P=K.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),_=K.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),O=K.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),j=K.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(O),this.key("subjectPublicKey").bitstr())}),z=K.define("RelativeDistinguishedName",function(){this.setof(_)}),J=K.define("RDNSequence",function(){this.seqof(z)}),w=K.define("Name",function(){this.choice({rdnSequence:this.use(J)})}),G=K.define("Validity",function(){this.seq().obj(this.key("notBefore").use(P),this.key("notAfter").use(P))}),f=K.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),A=K.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(O),this.key("issuer").use(w),this.key("validity").use(G),this.key("subject").use(w),this.key("subjectPublicKeyInfo").use(j),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())}),V=K.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(A),this.key("signatureAlgorithm").use(O),this.key("signatureValue").bitstr())});q.exports=V}),ol=l$(($)=>{var q=d7();$.certificate=ll();var K=q.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});$.RSAPrivateKey=K;var P=q.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$.RSAPublicKey=P;var _=q.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),O=q.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(_),this.key("subjectPublicKey").bitstr())});$.PublicKey=O;var j=q.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(_),this.key("subjectPrivateKey").octstr())});$.PrivateKey=j;var z=q.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});$.EncryptedPrivateKey=z;var J=q.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});$.DSAPrivateKey=J,$.DSAparam=q.define("DSAparam",function(){this.int()});var w=q.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),G=q.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(w),this.key("publicKey").optional().explicit(1).bitstr())});$.ECPrivateKey=G,$.signature=q.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),rl=l$(($,q)=>{q.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),nl=l$(($,q)=>{var K=iq().Buffer,P=XH().Transform,_=K8();function O(w){P.call(this),this._block=K.allocUnsafe(w),this._blockSize=w,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}_(O,P),O.prototype._transform=function(w,G,f){var A=null;try{this.update(w,G)}catch(V){A=V}f(A)},O.prototype._flush=function(w){var G=null;try{this.push(this.digest())}catch(f){G=f}w(G)};var j=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(K.prototype instanceof Uint8Array||K.TYPED_ARRAY_SUPPORT);function J(w,G){if(w instanceof K)return w;if(typeof w==="string")return K.from(w,G);if(z&&ArrayBuffer.isView(w)){if(w.byteLength===0)return K.alloc(0);var f=K.from(w.buffer,w.byteOffset,w.byteLength);if(f.byteLength===w.byteLength)return f}if(j&&w instanceof Uint8Array)return K.from(w);if(K.isBuffer(w)&&w.constructor&&typeof w.constructor.isBuffer==="function"&&w.constructor.isBuffer(w))return K.from(w);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}O.prototype.update=function(w,G){if(this._finalized)throw Error("Digest already called");w=J(w,G);var f=this._block,A=0;while(this._blockOffset+w.length-A>=this._blockSize){for(var V=this._blockOffset;V<this._blockSize;)f[V++]=w[A++];this._update(),this._blockOffset=0}while(A<w.length)f[this._blockOffset++]=w[A++];for(var C=0,E=w.length*8;E>0;++C)if(this._length[C]+=E,E=this._length[C]/4294967296|0,E>0)this._length[C]-=4294967296*E;return this},O.prototype._update=function(){throw Error("_update is not implemented")},O.prototype.digest=function(w){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var G=this._digest();if(w!==void 0)G=G.toString(w);this._block.fill(0),this._blockOffset=0;for(var f=0;f<4;++f)this._length[f]=0;return G},O.prototype._digest=function(){throw Error("_digest is not implemented")},q.exports=O}),il=l$(($,q)=>{var K=K8(),P=nl(),_=iq().Buffer,O=Array(16);function j(){P.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}K(j,P),j.prototype._update=function(){var A=O;for(var V=0;V<16;++V)A[V]=this._block.readInt32LE(V*4);var C=this._a,E=this._b,R=this._c,I=this._d;C=J(C,E,R,I,A[0],3614090360,7),I=J(I,C,E,R,A[1],3905402710,12),R=J(R,I,C,E,A[2],606105819,17),E=J(E,R,I,C,A[3],3250441966,22),C=J(C,E,R,I,A[4],4118548399,7),I=J(I,C,E,R,A[5],1200080426,12),R=J(R,I,C,E,A[6],2821735955,17),E=J(E,R,I,C,A[7],4249261313,22),C=J(C,E,R,I,A[8],1770035416,7),I=J(I,C,E,R,A[9],2336552879,12),R=J(R,I,C,E,A[10],4294925233,17),E=J(E,R,I,C,A[11],2304563134,22),C=J(C,E,R,I,A[12],1804603682,7),I=J(I,C,E,R,A[13],4254626195,12),R=J(R,I,C,E,A[14],2792965006,17),E=J(E,R,I,C,A[15],1236535329,22),C=w(C,E,R,I,A[1],4129170786,5),I=w(I,C,E,R,A[6],3225465664,9),R=w(R,I,C,E,A[11],643717713,14),E=w(E,R,I,C,A[0],3921069994,20),C=w(C,E,R,I,A[5],3593408605,5),I=w(I,C,E,R,A[10],38016083,9),R=w(R,I,C,E,A[15],3634488961,14),E=w(E,R,I,C,A[4],3889429448,20),C=w(C,E,R,I,A[9],568446438,5),I=w(I,C,E,R,A[14],3275163606,9),R=w(R,I,C,E,A[3],4107603335,14),E=w(E,R,I,C,A[8],1163531501,20),C=w(C,E,R,I,A[13],2850285829,5),I=w(I,C,E,R,A[2],4243563512,9),R=w(R,I,C,E,A[7],1735328473,14),E=w(E,R,I,C,A[12],2368359562,20),C=G(C,E,R,I,A[5],4294588738,4),I=G(I,C,E,R,A[8],2272392833,11),R=G(R,I,C,E,A[11],1839030562,16),E=G(E,R,I,C,A[14],4259657740,23),C=G(C,E,R,I,A[1],2763975236,4),I=G(I,C,E,R,A[4],1272893353,11),R=G(R,I,C,E,A[7],4139469664,16),E=G(E,R,I,C,A[10],3200236656,23),C=G(C,E,R,I,A[13],681279174,4),I=G(I,C,E,R,A[0],3936430074,11),R=G(R,I,C,E,A[3],3572445317,16),E=G(E,R,I,C,A[6],76029189,23),C=G(C,E,R,I,A[9],3654602809,4),I=G(I,C,E,R,A[12],3873151461,11),R=G(R,I,C,E,A[15],530742520,16),E=G(E,R,I,C,A[2],3299628645,23),C=f(C,E,R,I,A[0],4096336452,6),I=f(I,C,E,R,A[7],1126891415,10),R=f(R,I,C,E,A[14],2878612391,15),E=f(E,R,I,C,A[5],4237533241,21),C=f(C,E,R,I,A[12],1700485571,6),I=f(I,C,E,R,A[3],2399980690,10),R=f(R,I,C,E,A[10],4293915773,15),E=f(E,R,I,C,A[1],2240044497,21),C=f(C,E,R,I,A[8],1873313359,6),I=f(I,C,E,R,A[15],4264355552,10),R=f(R,I,C,E,A[6],2734768916,15),E=f(E,R,I,C,A[13],1309151649,21),C=f(C,E,R,I,A[4],4149444226,6),I=f(I,C,E,R,A[11],3174756917,10),R=f(R,I,C,E,A[2],718787259,15),E=f(E,R,I,C,A[9],3951481745,21),this._a=this._a+C|0,this._b=this._b+E|0,this._c=this._c+R|0,this._d=this._d+I|0},j.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var A=_.allocUnsafe(16);return A.writeInt32LE(this._a,0),A.writeInt32LE(this._b,4),A.writeInt32LE(this._c,8),A.writeInt32LE(this._d,12),A};function z(A,V){return A<<V|A>>>32-V}function J(A,V,C,E,R,I,D){return z(A+(V&C|~V&E)+R+I|0,D)+V|0}function w(A,V,C,E,R,I,D){return z(A+(V&E|C&~E)+R+I|0,D)+V|0}function G(A,V,C,E,R,I,D){return z(A+(V^C^E)+R+I|0,D)+V|0}function f(A,V,C,E,R,I,D){return z(A+(C^(V|~E))+R+I|0,D)+V|0}q.exports=j}),tl=l$(($,q)=>{var K=iq().Buffer,P=il();function _(O,j,z,J){if(!K.isBuffer(O))O=K.from(O,"binary");if(j){if(!K.isBuffer(j))j=K.from(j,"binary");if(j.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var w=z/8,G=K.alloc(w),f=K.alloc(J||0),A=K.alloc(0);while(w>0||J>0){var V=new P;if(V.update(A),V.update(O),j)V.update(j);A=V.digest();var C=0;if(w>0){var E=G.length-w;C=Math.min(w,A.length),A.copy(G,E,0,C),w-=C}if(C<A.length&&J>0){var R=f.length-J,I=Math.min(J,A.length-C);A.copy(f,R,C,C+I),J-=I}}return A.fill(0),{key:G,iv:f}}q.exports=_}),eS=l$(($)=>{var q=(Bq(),w6(tq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),Bl=l$(($,q)=>{var K=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,P=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,_=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,O=tl(),j=eS(),z=iq().Buffer;q.exports=function(J,w){var G=J.toString(),f=G.match(K),A;if(!f){var V=G.match(_);A=z.from(V[2].replace(/[\r\n]/g,""),"base64")}else{var C="aes"+f[1],E=z.from(f[2],"hex"),R=z.from(f[3].replace(/[\r\n]/g,""),"base64"),I=O(w,E.slice(0,8),parseInt(f[1],10)).key,D=[],b=j.createDecipheriv(C,I,E);D.push(b.update(R)),D.push(b.final()),A=z.concat(D)}var u=G.match(P)[1];return{tag:u,data:A}}}),sS=l$(($,q)=>{var K=ol(),P=rl(),_=Bl(),O=eS(),j=oS(),z=iq().Buffer;function J(G,f){var A=G.algorithm.decrypt.kde.kdeparams.salt,V=parseInt(G.algorithm.decrypt.kde.kdeparams.iters.toString(),10),C=P[G.algorithm.decrypt.cipher.algo.join(".")],E=G.algorithm.decrypt.cipher.iv,R=G.subjectPrivateKey,I=parseInt(C.split("-")[1],10)/8,D=j.pbkdf2Sync(f,A,V,I,"sha1"),b=O.createDecipheriv(C,D,E),u=[];return u.push(b.update(R)),u.push(b.final()),z.concat(u)}function w(G){var f;if(typeof G==="object"&&!z.isBuffer(G))f=G.passphrase,G=G.key;if(typeof G==="string")G=z.from(G);var A=_(G,f),V=A.tag,C=A.data,E,R;switch(V){case"CERTIFICATE":R=K.certificate.decode(C,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!R)R=K.PublicKey.decode(C,"der");switch(E=R.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return K.RSAPublicKey.decode(R.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return R.subjectPrivateKey=R.subjectPublicKey,{type:"ec",data:R};case"1.2.840.10040.4.1":return R.algorithm.params.pub_key=K.DSAparam.decode(R.subjectPublicKey.data,"der"),{type:"dsa",data:R.algorithm.params};default:throw Error("unknown key id "+E)}case"ENCRYPTED PRIVATE KEY":C=K.EncryptedPrivateKey.decode(C,"der"),C=J(C,f);case"PRIVATE KEY":switch(R=K.PrivateKey.decode(C,"der"),E=R.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return K.RSAPrivateKey.decode(R.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:R.algorithm.curve,privateKey:K.ECPrivateKey.decode(R.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return R.algorithm.params.priv_key=K.DSAparam.decode(R.subjectPrivateKey,"der"),{type:"dsa",params:R.algorithm.params};default:throw Error("unknown key id "+E)}case"RSA PUBLIC KEY":return K.RSAPublicKey.decode(C,"der");case"RSA PRIVATE KEY":return K.RSAPrivateKey.decode(C,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:K.DSAPrivateKey.decode(C,"der")};case"EC PRIVATE KEY":return C=K.ECPrivateKey.decode(C,"der"),{curve:C.parameters.value,privateKey:C.privateKey};default:throw Error("unknown key type "+V)}}w.signature=K.signature,q.exports=w}),$M=l$(($,q)=>{var K=Fj(),P=iq().Buffer;q.exports=function(O,j){var z=P.alloc(0),J=0,w;while(z.length<j)w=_(J++),z=P.concat([z,K("sha1").update(O).update(w).digest()]);return z.slice(0,j)};function _(O){var j=P.allocUnsafe(4);return j.writeUInt32BE(O,0),j}}),qM=l$(($,q)=>{q.exports=function(P,_){var O=P.length,j=-1;while(++j<O)P[j]^=_[j];return P}}),MH=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(Oq(),w6(jq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var X=Y.length-H;for(W=X%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function G(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,X=Math.min(S,S-N)+T,v=0;for(var k=T;k<X;k+=W)if(v=G(Y,k,k+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var g=1;v=G(Y,k,Y.length,H);for(k=0;k<N;k++)g*=H;if(this.imuln(g),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],X=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=f[6-X.length]+X+T;else T=X+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=A[Y],k=V[Y];T="";var g=this.clone();g.negative=0;while(!g.isZero()){var h=g.modn(k).toString(Y);if(g=g.idivn(k),!g.isZero())T=f[v-h.length]+h+T;else T=h+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),X,v,k=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[Z-v-1]=X}else{for(v=0;!k.isZero();v++)X=k.andln(255),k.iushrn(8),N[v]=X;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,X=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var k=X>>>26,g=X&67108863,h=Math.min(v,Y.length-1);for(var L=Math.max(0,v-M.length+1);L<=h;L++){var d=v-L|0;W=M.words[d]|0,Z=Y.words[L]|0,S=W*Z+g,k+=S/67108864|0,g=S&67108863}H.words[v]=g|0,X=k|0}if(X!==0)H.words[v]=X|0;else H.length--;return H.strip()}var R=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,X,v,k,g=W[0]|0,h=g&8191,L=g>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,t=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,o=a&8191,B=a>>>13,p$=W[5]|0,$$=p$&8191,s=p$>>>13,Q=W[6]|0,U=Q&8191,_$=Q>>>13,X$=W[7]|0,O$=X$&8191,T$=X$>>>13,j6=W[8]|0,H$=j6&8191,f$=j6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,b6=Z[0]|0,k$=b6&8191,I$=b6>>>13,Yq=Z[1]|0,D$=Yq&8191,g$=Yq>>>13,Aq=Z[2]|0,C$=Aq&8191,E$=Aq>>>13,Gq=Z[3]|0,h$=Gq&8191,V$=Gq>>>13,Vq=Z[4]|0,L$=Vq&8191,S$=Vq>>>13,vq=Z[5]|0,p=vq&8191,x=vq>>>13,x$=Z[6]|0,K$=x$&8191,j$=x$>>>13,f6=Z[7]|0,Z$=f6&8191,A$=f6>>>13,zq=Z[8]|0,b$=zq&8191,R$=zq>>>13,Wq=Z[9]|0,M$=Wq&8191,N$=Wq>>>13;T.negative=Y.negative^H.negative,T.length=19,X=Math.imul(h,k$),v=Math.imul(h,I$),v=v+Math.imul(L,k$)|0,k=Math.imul(L,I$);var D6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(D6>>>26)|0,D6&=67108863,X=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,k=Math.imul(F,I$),X=X+Math.imul(h,D$)|0,v=v+Math.imul(h,g$)|0,v=v+Math.imul(L,D$)|0,k=k+Math.imul(L,g$)|0;var O6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(O6>>>26)|0,O6&=67108863,X=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(t,k$)|0,k=Math.imul(t,I$),X=X+Math.imul(i,D$)|0,v=v+Math.imul(i,g$)|0,v=v+Math.imul(F,D$)|0,k=k+Math.imul(F,g$)|0,X=X+Math.imul(h,C$)|0,v=v+Math.imul(h,E$)|0,v=v+Math.imul(L,C$)|0,k=k+Math.imul(L,E$)|0;var K6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,X=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,k=Math.imul(v$,I$),X=X+Math.imul(n,D$)|0,v=v+Math.imul(n,g$)|0,v=v+Math.imul(t,D$)|0,k=k+Math.imul(t,g$)|0,X=X+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,k=k+Math.imul(F,E$)|0,X=X+Math.imul(h,h$)|0,v=v+Math.imul(h,V$)|0,v=v+Math.imul(L,h$)|0,k=k+Math.imul(L,V$)|0;var A6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(A6>>>26)|0,A6&=67108863,X=Math.imul(o,k$),v=Math.imul(o,I$),v=v+Math.imul(B,k$)|0,k=Math.imul(B,I$),X=X+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,g$)|0,v=v+Math.imul(v$,D$)|0,k=k+Math.imul(v$,g$)|0,X=X+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(t,C$)|0,k=k+Math.imul(t,E$)|0,X=X+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,k=k+Math.imul(F,V$)|0,X=X+Math.imul(h,L$)|0,v=v+Math.imul(h,S$)|0,v=v+Math.imul(L,L$)|0,k=k+Math.imul(L,S$)|0;var m6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(m6>>>26)|0,m6&=67108863,X=Math.imul($$,k$),v=Math.imul($$,I$),v=v+Math.imul(s,k$)|0,k=Math.imul(s,I$),X=X+Math.imul(o,D$)|0,v=v+Math.imul(o,g$)|0,v=v+Math.imul(B,D$)|0,k=k+Math.imul(B,g$)|0,X=X+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,k=k+Math.imul(v$,E$)|0,X=X+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(t,h$)|0,k=k+Math.imul(t,V$)|0,X=X+Math.imul(i,L$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,L$)|0,k=k+Math.imul(F,S$)|0,X=X+Math.imul(h,p)|0,v=v+Math.imul(h,x)|0,v=v+Math.imul(L,p)|0,k=k+Math.imul(L,x)|0;var d6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,X=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,k=Math.imul(_$,I$),X=X+Math.imul($$,D$)|0,v=v+Math.imul($$,g$)|0,v=v+Math.imul(s,D$)|0,k=k+Math.imul(s,g$)|0,X=X+Math.imul(o,C$)|0,v=v+Math.imul(o,E$)|0,v=v+Math.imul(B,C$)|0,k=k+Math.imul(B,E$)|0,X=X+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,k=k+Math.imul(v$,V$)|0,X=X+Math.imul(n,L$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(t,L$)|0,k=k+Math.imul(t,S$)|0,X=X+Math.imul(i,p)|0,v=v+Math.imul(i,x)|0,v=v+Math.imul(F,p)|0,k=k+Math.imul(F,x)|0,X=X+Math.imul(h,K$)|0,v=v+Math.imul(h,j$)|0,v=v+Math.imul(L,K$)|0,k=k+Math.imul(L,j$)|0;var l6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,X=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,k=Math.imul(T$,I$),X=X+Math.imul(U,D$)|0,v=v+Math.imul(U,g$)|0,v=v+Math.imul(_$,D$)|0,k=k+Math.imul(_$,g$)|0,X=X+Math.imul($$,C$)|0,v=v+Math.imul($$,E$)|0,v=v+Math.imul(s,C$)|0,k=k+Math.imul(s,E$)|0,X=X+Math.imul(o,h$)|0,v=v+Math.imul(o,V$)|0,v=v+Math.imul(B,h$)|0,k=k+Math.imul(B,V$)|0,X=X+Math.imul(Y$,L$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,L$)|0,k=k+Math.imul(v$,S$)|0,X=X+Math.imul(n,p)|0,v=v+Math.imul(n,x)|0,v=v+Math.imul(t,p)|0,k=k+Math.imul(t,x)|0,X=X+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,k=k+Math.imul(F,j$)|0,X=X+Math.imul(h,Z$)|0,v=v+Math.imul(h,A$)|0,v=v+Math.imul(L,Z$)|0,k=k+Math.imul(L,A$)|0;var o6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,X=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(f$,k$)|0,k=Math.imul(f$,I$),X=X+Math.imul(O$,D$)|0,v=v+Math.imul(O$,g$)|0,v=v+Math.imul(T$,D$)|0,k=k+Math.imul(T$,g$)|0,X=X+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,k=k+Math.imul(_$,E$)|0,X=X+Math.imul($$,h$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(s,h$)|0,k=k+Math.imul(s,V$)|0,X=X+Math.imul(o,L$)|0,v=v+Math.imul(o,S$)|0,v=v+Math.imul(B,L$)|0,k=k+Math.imul(B,S$)|0,X=X+Math.imul(Y$,p)|0,v=v+Math.imul(Y$,x)|0,v=v+Math.imul(v$,p)|0,k=k+Math.imul(v$,x)|0,X=X+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(t,K$)|0,k=k+Math.imul(t,j$)|0,X=X+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,k=k+Math.imul(F,A$)|0,X=X+Math.imul(h,b$)|0,v=v+Math.imul(h,R$)|0,v=v+Math.imul(L,b$)|0,k=k+Math.imul(L,R$)|0;var r6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,X=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,k=Math.imul(G$,I$),X=X+Math.imul(H$,D$)|0,v=v+Math.imul(H$,g$)|0,v=v+Math.imul(f$,D$)|0,k=k+Math.imul(f$,g$)|0,X=X+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,k=k+Math.imul(T$,E$)|0,X=X+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,k=k+Math.imul(_$,V$)|0,X=X+Math.imul($$,L$)|0,v=v+Math.imul($$,S$)|0,v=v+Math.imul(s,L$)|0,k=k+Math.imul(s,S$)|0,X=X+Math.imul(o,p)|0,v=v+Math.imul(o,x)|0,v=v+Math.imul(B,p)|0,k=k+Math.imul(B,x)|0,X=X+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,k=k+Math.imul(v$,j$)|0,X=X+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(t,Z$)|0,k=k+Math.imul(t,A$)|0,X=X+Math.imul(i,b$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,b$)|0,k=k+Math.imul(F,R$)|0,X=X+Math.imul(h,M$)|0,v=v+Math.imul(h,N$)|0,v=v+Math.imul(L,M$)|0,k=k+Math.imul(L,N$)|0;var n6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,X=Math.imul(w$,D$),v=Math.imul(w$,g$),v=v+Math.imul(G$,D$)|0,k=Math.imul(G$,g$),X=X+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(f$,C$)|0,k=k+Math.imul(f$,E$)|0,X=X+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,k=k+Math.imul(T$,V$)|0,X=X+Math.imul(U,L$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,L$)|0,k=k+Math.imul(_$,S$)|0,X=X+Math.imul($$,p)|0,v=v+Math.imul($$,x)|0,v=v+Math.imul(s,p)|0,k=k+Math.imul(s,x)|0,X=X+Math.imul(o,K$)|0,v=v+Math.imul(o,j$)|0,v=v+Math.imul(B,K$)|0,k=k+Math.imul(B,j$)|0,X=X+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,k=k+Math.imul(v$,A$)|0,X=X+Math.imul(n,b$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(t,b$)|0,k=k+Math.imul(t,R$)|0,X=X+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,k=k+Math.imul(F,N$)|0;var i6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,X=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,k=Math.imul(G$,E$),X=X+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(f$,h$)|0,k=k+Math.imul(f$,V$)|0,X=X+Math.imul(O$,L$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,L$)|0,k=k+Math.imul(T$,S$)|0,X=X+Math.imul(U,p)|0,v=v+Math.imul(U,x)|0,v=v+Math.imul(_$,p)|0,k=k+Math.imul(_$,x)|0,X=X+Math.imul($$,K$)|0,v=v+Math.imul($$,j$)|0,v=v+Math.imul(s,K$)|0,k=k+Math.imul(s,j$)|0,X=X+Math.imul(o,Z$)|0,v=v+Math.imul(o,A$)|0,v=v+Math.imul(B,Z$)|0,k=k+Math.imul(B,A$)|0,X=X+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,b$)|0,k=k+Math.imul(v$,R$)|0,X=X+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(t,M$)|0,k=k+Math.imul(t,N$)|0;var t6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,X=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,k=Math.imul(G$,V$),X=X+Math.imul(H$,L$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(f$,L$)|0,k=k+Math.imul(f$,S$)|0,X=X+Math.imul(O$,p)|0,v=v+Math.imul(O$,x)|0,v=v+Math.imul(T$,p)|0,k=k+Math.imul(T$,x)|0,X=X+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,k=k+Math.imul(_$,j$)|0,X=X+Math.imul($$,Z$)|0,v=v+Math.imul($$,A$)|0,v=v+Math.imul(s,Z$)|0,k=k+Math.imul(s,A$)|0,X=X+Math.imul(o,b$)|0,v=v+Math.imul(o,R$)|0,v=v+Math.imul(B,b$)|0,k=k+Math.imul(B,R$)|0,X=X+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,k=k+Math.imul(v$,N$)|0;var B6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,X=Math.imul(w$,L$),v=Math.imul(w$,S$),v=v+Math.imul(G$,L$)|0,k=Math.imul(G$,S$),X=X+Math.imul(H$,p)|0,v=v+Math.imul(H$,x)|0,v=v+Math.imul(f$,p)|0,k=k+Math.imul(f$,x)|0,X=X+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,k=k+Math.imul(T$,j$)|0,X=X+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,k=k+Math.imul(_$,A$)|0,X=X+Math.imul($$,b$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(s,b$)|0,k=k+Math.imul(s,R$)|0,X=X+Math.imul(o,M$)|0,v=v+Math.imul(o,N$)|0,v=v+Math.imul(B,M$)|0,k=k+Math.imul(B,N$)|0;var U6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,X=Math.imul(w$,p),v=Math.imul(w$,x),v=v+Math.imul(G$,p)|0,k=Math.imul(G$,x),X=X+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(f$,K$)|0,k=k+Math.imul(f$,j$)|0,X=X+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,k=k+Math.imul(T$,A$)|0,X=X+Math.imul(U,b$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,b$)|0,k=k+Math.imul(_$,R$)|0,X=X+Math.imul($$,M$)|0,v=v+Math.imul($$,N$)|0,v=v+Math.imul(s,M$)|0,k=k+Math.imul(s,N$)|0;var F6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,X=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,k=Math.imul(G$,j$),X=X+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(f$,Z$)|0,k=k+Math.imul(f$,A$)|0,X=X+Math.imul(O$,b$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,b$)|0,k=k+Math.imul(T$,R$)|0,X=X+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,k=k+Math.imul(_$,N$)|0;var a6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,X=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,k=Math.imul(G$,A$),X=X+Math.imul(H$,b$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(f$,b$)|0,k=k+Math.imul(f$,R$)|0,X=X+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,k=k+Math.imul(T$,N$)|0;var Q6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,X=Math.imul(w$,b$),v=Math.imul(w$,R$),v=v+Math.imul(G$,b$)|0,k=Math.imul(G$,R$),X=X+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(f$,M$)|0,k=k+Math.imul(f$,N$)|0;var e6=(N+X|0)+((v&8191)<<13)|0;N=(k+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,X=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,k=Math.imul(G$,N$);var s6=(N+X|0)+((v&8191)<<13)|0;if(N=(k+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,S[0]=D6,S[1]=O6,S[2]=K6,S[3]=A6,S[4]=m6,S[5]=d6,S[6]=l6,S[7]=o6,S[8]=r6,S[9]=n6,S[10]=i6,S[11]=t6,S[12]=B6,S[13]=U6,S[14]=F6,S[15]=a6,S[16]=Q6,S[17]=e6,S[18]=s6,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)R=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,X=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=X;v++){var k=Z-v,g=M.words[k]|0,h=Y.words[v]|0,L=g*h,d=L&67108863;S=S+(L/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new b;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=R(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function b(M,Y){this.x=M,this.y=Y}b.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},b.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},b.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},b.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var X=N<<1,v=Math.cos(2*Math.PI/X),k=Math.sin(2*Math.PI/X);for(var g=0;g<Z;g+=X){var h=v,L=k;for(var d=0;d<N;d++){var i=T[g+d],F=W[g+d],W$=T[g+d+N],n=W[g+d+N],t=h*W$-L*n;if(n=h*n+L*W$,W$=t,T[g+d]=i+W$,W[g+d]=F+n,T[g+d+N]=i-W$,W[g+d+N]=F-n,d!==X)t=v*h-k*L,L=v*L+k*h,h=t}}}},b.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},b.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},b.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},b.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},b.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},b.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),X=Array(W),v=Array(W),k=Array(W),g=Array(W),h=Array(W),L=T.words;L.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,k,W),this.transform(N,S,X,v,W,Z),this.transform(k,S,g,h,W,Z);for(var d=0;d<W;d++){var i=X[d]*g[d]-v[d]*h[d];v[d]=X[d]*h[d]+v[d]*g[d],X[d]=i}return this.conjugate(X,v,W),this.transform(X,v,L,S,W,Z),this.conjugate(L,S,W),this.normalize13b(L,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,X=(this.words[Z]|0)-N<<H;this.words[Z]=X|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,X=T;if(W-=S,W=Math.max(0,W),X){for(var v=0;v<S;v++)X.words[v]=this.words[v];X.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var k=0;for(v=this.length-1;v>=0&&(k!==0||v>=W);v--){var g=this.words[v]|0;this.words[v]=k<<26-Z|g>>>Z,k=g&N}if(X&&k!==0)X.words[X.length++]=k;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var X=(Y.words[Z]|0)*H;S-=X&67108863,N=(S>>26)-(X/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var X=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=X+1,v.words=Array(v.length);for(var k=0;k<v.length;k++)v.words[k]=0}var g=W.clone()._ishlnsubmul(Z,1,X);if(g.negative===0){if(W=g,v)v.words[X]=1}for(var h=X-1;h>=0;h--){var L=(W.words[Z.length+h]|0)*67108864+(W.words[Z.length+h-1]|0);L=Math.min(L/S|0,67108863),W._ishlnsubmul(Z,L,h);while(W.negative!==0)if(L--,W.negative=0,W._ishlnsubmul(Z,1,h),!W.isZero())W.negative^=1;if(v)v.words[h]=L}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),X=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++X;var v=T.clone(),k=H.clone();while(!H.isZero()){for(var g=0,h=1;(H.words[0]&h)===0&&g<26;++g,h<<=1);if(g>0){H.iushrn(g);while(g-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(k);W.iushrn(1),Z.iushrn(1)}}for(var L=0,d=1;(T.words[0]&d)===0&&L<26;++L,d<<=1);if(L>0){T.iushrn(L);while(L-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(k);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(X)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,X=1;(H.words[0]&X)===0&&N<26;++N,X<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,k=1;(T.words[0]&k)===0&&v<26;++v,k<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var g;if(H.cmpn(1)===0)g=W;else g=Z;if(g.cmpn(0)<0)g.iadd(Y);return g},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(c,y),c.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},c.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function q$(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(q$,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new c;else if(Y==="p224")H=new m;else if(Y==="p192")H=new q$;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),X=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,X).cmp(N)!==0)v.redIAdd(N);var k=this.pow(v,W),g=this.pow(Y,W.addn(1).iushrn(1)),h=this.pow(Y,W),L=Z;while(h.cmp(S)!==0){var d=h;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<L);var F=this.pow(k,new j(1).iushln(L-i-1));g=g.redMul(F),k=F.redSqr(),h=h.redMul(k),L=i}return g},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,X=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var k=H.words[Z];for(var g=v-1;g>=0;g--){var h=k>>g&1;if(S!==W[0])S=this.sqr(S);if(h===0&&N===0){X=0;continue}if(N<<=1,N|=h,X++,X!==T&&(Z!==0||g!==0))continue;S=this.mul(S,W[N]),X=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new r(Y)};function r(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}O(r,l),r.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},r.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},r.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},r.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),KM=l$(($,q)=>{var K=MH(),P=iq().Buffer;function _(O,j){return P.from(O.toRed(K.mont(j.modulus)).redPow(new K(j.publicExponent)).fromRed().toArray())}q.exports=_}),Ul=l$(($,q)=>{(function(K,P){function _(T,W){if(!T)throw Error(W||"Assertion failed")}function O(T,W){T.super_=W;var Z=function(){};Z.prototype=W.prototype,T.prototype=new Z,T.prototype.constructor=T}function j(T,W,Z){if(j.isBN(T))return T;if(this.negative=0,this.words=null,this.length=0,this.red=null,T!==null){if(W==="le"||W==="be")Z=W,W=10;this._init(T||0,W||10,Z||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(Oq(),w6(jq)).Buffer}catch(T){}j.isBN=function(W){if(W instanceof j)return!0;return W!==null&&typeof W==="object"&&W.constructor.wordSize===j.wordSize&&Array.isArray(W.words)},j.max=function(W,Z){if(W.cmp(Z)>0)return W;return Z},j.min=function(W,Z){if(W.cmp(Z)<0)return W;return Z},j.prototype._init=function(W,Z,S){if(typeof W==="number")return this._initNumber(W,Z,S);if(typeof W==="object")return this._initArray(W,Z,S);if(Z==="hex")Z=16;_(Z===(Z|0)&&Z>=2&&Z<=36),W=W.toString().replace(/\s+/g,"");var N=0;if(W[0]==="-")N++,this.negative=1;if(N<W.length){if(Z===16)this._parseHex(W,N,S);else if(this._parseBase(W,Z,N),S==="le")this._initArray(this.toArray(),Z,S)}},j.prototype._initNumber=function(W,Z,S){if(W<0)this.negative=1,W=-W;if(W<67108864)this.words=[W&67108863],this.length=1;else if(W<4503599627370496)this.words=[W&67108863,W/67108864&67108863],this.length=2;else _(W<9007199254740992),this.words=[W&67108863,W/67108864&67108863,1],this.length=3;if(S!=="le")return;this._initArray(this.toArray(),Z,S)},j.prototype._initArray=function(W,Z,S){if(_(typeof W.length==="number"),W.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(W.length/3),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var X,v,k=0;if(S==="be"){for(N=W.length-1,X=0;N>=0;N-=3)if(v=W[N]|W[N-1]<<8|W[N-2]<<16,this.words[X]|=v<<k&67108863,this.words[X+1]=v>>>26-k&67108863,k+=24,k>=26)k-=26,X++}else if(S==="le"){for(N=0,X=0;N<W.length;N+=3)if(v=W[N]|W[N+1]<<8|W[N+2]<<16,this.words[X]|=v<<k&67108863,this.words[X+1]=v>>>26-k&67108863,k+=24,k>=26)k-=26,X++}return this._strip()};function J(T,W){var Z=T.charCodeAt(W);if(Z>=48&&Z<=57)return Z-48;else if(Z>=65&&Z<=70)return Z-55;else if(Z>=97&&Z<=102)return Z-87;else _(!1,"Invalid character in "+T)}function w(T,W,Z){var S=J(T,Z);if(Z-1>=W)S|=J(T,Z-1)<<4;return S}j.prototype._parseHex=function(W,Z,S){this.length=Math.ceil((W.length-Z)/6),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var X=0,v=0,k;if(S==="be")for(N=W.length-1;N>=Z;N-=2)if(k=w(W,Z,N)<<X,this.words[v]|=k&67108863,X>=18)X-=18,v+=1,this.words[v]|=k>>>26;else X+=8;else{var g=W.length-Z;for(N=g%2===0?Z+1:Z;N<W.length;N+=2)if(k=w(W,Z,N)<<X,this.words[v]|=k&67108863,X>=18)X-=18,v+=1,this.words[v]|=k>>>26;else X+=8}this._strip()};function G(T,W,Z,S){var N=0,X=0,v=Math.min(T.length,Z);for(var k=W;k<v;k++){var g=T.charCodeAt(k)-48;if(N*=S,g>=49)X=g-49+10;else if(g>=17)X=g-17+10;else X=g;_(g>=0&&X<S,"Invalid character"),N+=X}return N}j.prototype._parseBase=function(W,Z,S){this.words=[0],this.length=1;for(var N=0,X=1;X<=67108863;X*=Z)N++;N--,X=X/Z|0;var v=W.length-S,k=v%N,g=Math.min(v,v-k)+S,h=0;for(var L=S;L<g;L+=N)if(h=G(W,L,L+N,Z),this.imuln(X),this.words[0]+h<67108864)this.words[0]+=h;else this._iaddn(h);if(k!==0){var d=1;h=G(W,L,W.length,Z);for(L=0;L<k;L++)d*=Z;if(this.imuln(d),this.words[0]+h<67108864)this.words[0]+=h;else this._iaddn(h)}this._strip()},j.prototype.copy=function(W){W.words=Array(this.length);for(var Z=0;Z<this.length;Z++)W.words[Z]=this.words[Z];W.length=this.length,W.negative=this.negative,W.red=this.red};function f(T,W){T.words=W.words,T.length=W.length,T.negative=W.negative,T.red=W.red}if(j.prototype._move=function(W){f(W,this)},j.prototype.clone=function(){var W=new j(null);return this.copy(W),W},j.prototype._expand=function(W){while(this.length<W)this.words[this.length++]=0;return this},j.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{j.prototype[Symbol.for("nodejs.util.inspect.custom")]=A}catch(T){j.prototype.inspect=A}else j.prototype.inspect=A;function A(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var V=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(W,Z){W=W||10,Z=Z|0||1;var S;if(W===16||W==="hex"){S="";var N=0,X=0;for(var v=0;v<this.length;v++){var k=this.words[v],g=((k<<N|X)&16777215).toString(16);if(X=k>>>24-N&16777215,N+=2,N>=26)N-=26,v--;if(X!==0||v!==this.length-1)S=V[6-g.length]+g+S;else S=g+S}if(X!==0)S=X.toString(16)+S;while(S.length%Z!==0)S="0"+S;if(this.negative!==0)S="-"+S;return S}if(W===(W|0)&&W>=2&&W<=36){var h=C[W],L=E[W];S="";var d=this.clone();d.negative=0;while(!d.isZero()){var i=d.modrn(L).toString(W);if(d=d.idivn(L),!d.isZero())S=V[h-i.length]+i+S;else S=i+S}if(this.isZero())S="0"+S;while(S.length%Z!==0)S="0"+S;if(this.negative!==0)S="-"+S;return S}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var W=this.words[0];if(this.length===2)W+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)W+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-W:W},j.prototype.toJSON=function(){return this.toString(16,2)},z)j.prototype.toBuffer=function(W,Z){return this.toArrayLike(z,W,Z)};j.prototype.toArray=function(W,Z){return this.toArrayLike(Array,W,Z)};var R=function(W,Z){if(W.allocUnsafe)return W.allocUnsafe(Z);return new W(Z)};if(j.prototype.toArrayLike=function(W,Z,S){this._strip();var N=this.byteLength(),X=S||Math.max(1,N);_(N<=X,"byte array longer than desired length"),_(X>0,"Requested array length <= 0");var v=R(W,X),k=Z==="le"?"LE":"BE";return this["_toArrayLike"+k](v,N),v},j.prototype._toArrayLikeLE=function(W,Z){var S=0,N=0;for(var X=0,v=0;X<this.length;X++){var k=this.words[X]<<v|N;if(W[S++]=k&255,S<W.length)W[S++]=k>>8&255;if(S<W.length)W[S++]=k>>16&255;if(v===6){if(S<W.length)W[S++]=k>>24&255;N=0,v=0}else N=k>>>24,v+=2}if(S<W.length){W[S++]=N;while(S<W.length)W[S++]=0}},j.prototype._toArrayLikeBE=function(W,Z){var S=W.length-1,N=0;for(var X=0,v=0;X<this.length;X++){var k=this.words[X]<<v|N;if(W[S--]=k&255,S>=0)W[S--]=k>>8&255;if(S>=0)W[S--]=k>>16&255;if(v===6){if(S>=0)W[S--]=k>>24&255;N=0,v=0}else N=k>>>24,v+=2}if(S>=0){W[S--]=N;while(S>=0)W[S--]=0}},Math.clz32)j.prototype._countBits=function(W){return 32-Math.clz32(W)};else j.prototype._countBits=function(W){var Z=W,S=0;if(Z>=4096)S+=13,Z>>>=13;if(Z>=64)S+=7,Z>>>=7;if(Z>=8)S+=4,Z>>>=4;if(Z>=2)S+=2,Z>>>=2;return S+Z};j.prototype._zeroBits=function(W){if(W===0)return 26;var Z=W,S=0;if((Z&8191)===0)S+=13,Z>>>=13;if((Z&127)===0)S+=7,Z>>>=7;if((Z&15)===0)S+=4,Z>>>=4;if((Z&3)===0)S+=2,Z>>>=2;if((Z&1)===0)S++;return S},j.prototype.bitLength=function(){var W=this.words[this.length-1],Z=this._countBits(W);return(this.length-1)*26+Z};function I(T){var W=Array(T.bitLength());for(var Z=0;Z<W.length;Z++){var S=Z/26|0,N=Z%26;W[Z]=T.words[S]>>>N&1}return W}j.prototype.zeroBits=function(){if(this.isZero())return 0;var W=0;for(var Z=0;Z<this.length;Z++){var S=this._zeroBits(this.words[Z]);if(W+=S,S!==26)break}return W},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(W){if(this.negative!==0)return this.abs().inotn(W).iaddn(1);return this.clone()},j.prototype.fromTwos=function(W){if(this.testn(W-1))return this.notn(W).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(W){while(this.length<W.length)this.words[this.length++]=0;for(var Z=0;Z<W.length;Z++)this.words[Z]=this.words[Z]|W.words[Z];return this._strip()},j.prototype.ior=function(W){return _((this.negative|W.negative)===0),this.iuor(W)},j.prototype.or=function(W){if(this.length>W.length)return this.clone().ior(W);return W.clone().ior(this)},j.prototype.uor=function(W){if(this.length>W.length)return this.clone().iuor(W);return W.clone().iuor(this)},j.prototype.iuand=function(W){var Z;if(this.length>W.length)Z=W;else Z=this;for(var S=0;S<Z.length;S++)this.words[S]=this.words[S]&W.words[S];return this.length=Z.length,this._strip()},j.prototype.iand=function(W){return _((this.negative|W.negative)===0),this.iuand(W)},j.prototype.and=function(W){if(this.length>W.length)return this.clone().iand(W);return W.clone().iand(this)},j.prototype.uand=function(W){if(this.length>W.length)return this.clone().iuand(W);return W.clone().iuand(this)},j.prototype.iuxor=function(W){var Z,S;if(this.length>W.length)Z=this,S=W;else Z=W,S=this;for(var N=0;N<S.length;N++)this.words[N]=Z.words[N]^S.words[N];if(this!==Z)for(;N<Z.length;N++)this.words[N]=Z.words[N];return this.length=Z.length,this._strip()},j.prototype.ixor=function(W){return _((this.negative|W.negative)===0),this.iuxor(W)},j.prototype.xor=function(W){if(this.length>W.length)return this.clone().ixor(W);return W.clone().ixor(this)},j.prototype.uxor=function(W){if(this.length>W.length)return this.clone().iuxor(W);return W.clone().iuxor(this)},j.prototype.inotn=function(W){_(typeof W==="number"&&W>=0);var Z=Math.ceil(W/26)|0,S=W%26;if(this._expand(Z),S>0)Z--;for(var N=0;N<Z;N++)this.words[N]=~this.words[N]&67108863;if(S>0)this.words[N]=~this.words[N]&67108863>>26-S;return this._strip()},j.prototype.notn=function(W){return this.clone().inotn(W)},j.prototype.setn=function(W,Z){_(typeof W==="number"&&W>=0);var S=W/26|0,N=W%26;if(this._expand(S+1),Z)this.words[S]=this.words[S]|1<<N;else this.words[S]=this.words[S]&~(1<<N);return this._strip()},j.prototype.iadd=function(W){var Z;if(this.negative!==0&&W.negative===0)return this.negative=0,Z=this.isub(W),this.negative^=1,this._normSign();else if(this.negative===0&&W.negative!==0)return W.negative=0,Z=this.isub(W),W.negative=1,Z._normSign();var S,N;if(this.length>W.length)S=this,N=W;else S=W,N=this;var X=0;for(var v=0;v<N.length;v++)Z=(S.words[v]|0)+(N.words[v]|0)+X,this.words[v]=Z&67108863,X=Z>>>26;for(;X!==0&&v<S.length;v++)Z=(S.words[v]|0)+X,this.words[v]=Z&67108863,X=Z>>>26;if(this.length=S.length,X!==0)this.words[this.length]=X,this.length++;else if(S!==this)for(;v<S.length;v++)this.words[v]=S.words[v];return this},j.prototype.add=function(W){var Z;if(W.negative!==0&&this.negative===0)return W.negative=0,Z=this.sub(W),W.negative^=1,Z;else if(W.negative===0&&this.negative!==0)return this.negative=0,Z=W.sub(this),this.negative=1,Z;if(this.length>W.length)return this.clone().iadd(W);return W.clone().iadd(this)},j.prototype.isub=function(W){if(W.negative!==0){W.negative=0;var Z=this.iadd(W);return W.negative=1,Z._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(W),this.negative=1,this._normSign();var S=this.cmp(W);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,X;if(S>0)N=this,X=W;else N=W,X=this;var v=0;for(var k=0;k<X.length;k++)Z=(N.words[k]|0)-(X.words[k]|0)+v,v=Z>>26,this.words[k]=Z&67108863;for(;v!==0&&k<N.length;k++)Z=(N.words[k]|0)+v,v=Z>>26,this.words[k]=Z&67108863;if(v===0&&k<N.length&&N!==this)for(;k<N.length;k++)this.words[k]=N.words[k];if(this.length=Math.max(this.length,k),N!==this)this.negative=1;return this._strip()},j.prototype.sub=function(W){return this.clone().isub(W)};function D(T,W,Z){Z.negative=W.negative^T.negative;var S=T.length+W.length|0;Z.length=S,S=S-1|0;var N=T.words[0]|0,X=W.words[0]|0,v=N*X,k=v&67108863,g=v/67108864|0;Z.words[0]=k;for(var h=1;h<S;h++){var L=g>>>26,d=g&67108863,i=Math.min(h,W.length-1);for(var F=Math.max(0,h-T.length+1);F<=i;F++){var W$=h-F|0;N=T.words[W$]|0,X=W.words[F]|0,v=N*X+d,L+=v/67108864|0,d=v&67108863}Z.words[h]=d|0,g=L|0}if(g!==0)Z.words[h]=g|0;else Z.length--;return Z._strip()}var b=function(W,Z,S){var N=W.words,X=Z.words,v=S.words,k=0,g,h,L,d=N[0]|0,i=d&8191,F=d>>>13,W$=N[1]|0,n=W$&8191,t=W$>>>13,y$=N[2]|0,Y$=y$&8191,v$=y$>>>13,a=N[3]|0,o=a&8191,B=a>>>13,p$=N[4]|0,$$=p$&8191,s=p$>>>13,Q=N[5]|0,U=Q&8191,_$=Q>>>13,X$=N[6]|0,O$=X$&8191,T$=X$>>>13,j6=N[7]|0,H$=j6&8191,f$=j6>>>13,X6=N[8]|0,w$=X6&8191,G$=X6>>>13,b6=N[9]|0,k$=b6&8191,I$=b6>>>13,Yq=X[0]|0,D$=Yq&8191,g$=Yq>>>13,Aq=X[1]|0,C$=Aq&8191,E$=Aq>>>13,Gq=X[2]|0,h$=Gq&8191,V$=Gq>>>13,Vq=X[3]|0,L$=Vq&8191,S$=Vq>>>13,vq=X[4]|0,p=vq&8191,x=vq>>>13,x$=X[5]|0,K$=x$&8191,j$=x$>>>13,f6=X[6]|0,Z$=f6&8191,A$=f6>>>13,zq=X[7]|0,b$=zq&8191,R$=zq>>>13,Wq=X[8]|0,M$=Wq&8191,N$=Wq>>>13,D6=X[9]|0,O6=D6&8191,K6=D6>>>13;S.negative=W.negative^Z.negative,S.length=19,g=Math.imul(i,D$),h=Math.imul(i,g$),h=h+Math.imul(F,D$)|0,L=Math.imul(F,g$);var A6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(A6>>>26)|0,A6&=67108863,g=Math.imul(n,D$),h=Math.imul(n,g$),h=h+Math.imul(t,D$)|0,L=Math.imul(t,g$),g=g+Math.imul(i,C$)|0,h=h+Math.imul(i,E$)|0,h=h+Math.imul(F,C$)|0,L=L+Math.imul(F,E$)|0;var m6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(m6>>>26)|0,m6&=67108863,g=Math.imul(Y$,D$),h=Math.imul(Y$,g$),h=h+Math.imul(v$,D$)|0,L=Math.imul(v$,g$),g=g+Math.imul(n,C$)|0,h=h+Math.imul(n,E$)|0,h=h+Math.imul(t,C$)|0,L=L+Math.imul(t,E$)|0,g=g+Math.imul(i,h$)|0,h=h+Math.imul(i,V$)|0,h=h+Math.imul(F,h$)|0,L=L+Math.imul(F,V$)|0;var d6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(d6>>>26)|0,d6&=67108863,g=Math.imul(o,D$),h=Math.imul(o,g$),h=h+Math.imul(B,D$)|0,L=Math.imul(B,g$),g=g+Math.imul(Y$,C$)|0,h=h+Math.imul(Y$,E$)|0,h=h+Math.imul(v$,C$)|0,L=L+Math.imul(v$,E$)|0,g=g+Math.imul(n,h$)|0,h=h+Math.imul(n,V$)|0,h=h+Math.imul(t,h$)|0,L=L+Math.imul(t,V$)|0,g=g+Math.imul(i,L$)|0,h=h+Math.imul(i,S$)|0,h=h+Math.imul(F,L$)|0,L=L+Math.imul(F,S$)|0;var l6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(l6>>>26)|0,l6&=67108863,g=Math.imul($$,D$),h=Math.imul($$,g$),h=h+Math.imul(s,D$)|0,L=Math.imul(s,g$),g=g+Math.imul(o,C$)|0,h=h+Math.imul(o,E$)|0,h=h+Math.imul(B,C$)|0,L=L+Math.imul(B,E$)|0,g=g+Math.imul(Y$,h$)|0,h=h+Math.imul(Y$,V$)|0,h=h+Math.imul(v$,h$)|0,L=L+Math.imul(v$,V$)|0,g=g+Math.imul(n,L$)|0,h=h+Math.imul(n,S$)|0,h=h+Math.imul(t,L$)|0,L=L+Math.imul(t,S$)|0,g=g+Math.imul(i,p)|0,h=h+Math.imul(i,x)|0,h=h+Math.imul(F,p)|0,L=L+Math.imul(F,x)|0;var o6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(o6>>>26)|0,o6&=67108863,g=Math.imul(U,D$),h=Math.imul(U,g$),h=h+Math.imul(_$,D$)|0,L=Math.imul(_$,g$),g=g+Math.imul($$,C$)|0,h=h+Math.imul($$,E$)|0,h=h+Math.imul(s,C$)|0,L=L+Math.imul(s,E$)|0,g=g+Math.imul(o,h$)|0,h=h+Math.imul(o,V$)|0,h=h+Math.imul(B,h$)|0,L=L+Math.imul(B,V$)|0,g=g+Math.imul(Y$,L$)|0,h=h+Math.imul(Y$,S$)|0,h=h+Math.imul(v$,L$)|0,L=L+Math.imul(v$,S$)|0,g=g+Math.imul(n,p)|0,h=h+Math.imul(n,x)|0,h=h+Math.imul(t,p)|0,L=L+Math.imul(t,x)|0,g=g+Math.imul(i,K$)|0,h=h+Math.imul(i,j$)|0,h=h+Math.imul(F,K$)|0,L=L+Math.imul(F,j$)|0;var r6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(r6>>>26)|0,r6&=67108863,g=Math.imul(O$,D$),h=Math.imul(O$,g$),h=h+Math.imul(T$,D$)|0,L=Math.imul(T$,g$),g=g+Math.imul(U,C$)|0,h=h+Math.imul(U,E$)|0,h=h+Math.imul(_$,C$)|0,L=L+Math.imul(_$,E$)|0,g=g+Math.imul($$,h$)|0,h=h+Math.imul($$,V$)|0,h=h+Math.imul(s,h$)|0,L=L+Math.imul(s,V$)|0,g=g+Math.imul(o,L$)|0,h=h+Math.imul(o,S$)|0,h=h+Math.imul(B,L$)|0,L=L+Math.imul(B,S$)|0,g=g+Math.imul(Y$,p)|0,h=h+Math.imul(Y$,x)|0,h=h+Math.imul(v$,p)|0,L=L+Math.imul(v$,x)|0,g=g+Math.imul(n,K$)|0,h=h+Math.imul(n,j$)|0,h=h+Math.imul(t,K$)|0,L=L+Math.imul(t,j$)|0,g=g+Math.imul(i,Z$)|0,h=h+Math.imul(i,A$)|0,h=h+Math.imul(F,Z$)|0,L=L+Math.imul(F,A$)|0;var n6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(n6>>>26)|0,n6&=67108863,g=Math.imul(H$,D$),h=Math.imul(H$,g$),h=h+Math.imul(f$,D$)|0,L=Math.imul(f$,g$),g=g+Math.imul(O$,C$)|0,h=h+Math.imul(O$,E$)|0,h=h+Math.imul(T$,C$)|0,L=L+Math.imul(T$,E$)|0,g=g+Math.imul(U,h$)|0,h=h+Math.imul(U,V$)|0,h=h+Math.imul(_$,h$)|0,L=L+Math.imul(_$,V$)|0,g=g+Math.imul($$,L$)|0,h=h+Math.imul($$,S$)|0,h=h+Math.imul(s,L$)|0,L=L+Math.imul(s,S$)|0,g=g+Math.imul(o,p)|0,h=h+Math.imul(o,x)|0,h=h+Math.imul(B,p)|0,L=L+Math.imul(B,x)|0,g=g+Math.imul(Y$,K$)|0,h=h+Math.imul(Y$,j$)|0,h=h+Math.imul(v$,K$)|0,L=L+Math.imul(v$,j$)|0,g=g+Math.imul(n,Z$)|0,h=h+Math.imul(n,A$)|0,h=h+Math.imul(t,Z$)|0,L=L+Math.imul(t,A$)|0,g=g+Math.imul(i,b$)|0,h=h+Math.imul(i,R$)|0,h=h+Math.imul(F,b$)|0,L=L+Math.imul(F,R$)|0;var i6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(i6>>>26)|0,i6&=67108863,g=Math.imul(w$,D$),h=Math.imul(w$,g$),h=h+Math.imul(G$,D$)|0,L=Math.imul(G$,g$),g=g+Math.imul(H$,C$)|0,h=h+Math.imul(H$,E$)|0,h=h+Math.imul(f$,C$)|0,L=L+Math.imul(f$,E$)|0,g=g+Math.imul(O$,h$)|0,h=h+Math.imul(O$,V$)|0,h=h+Math.imul(T$,h$)|0,L=L+Math.imul(T$,V$)|0,g=g+Math.imul(U,L$)|0,h=h+Math.imul(U,S$)|0,h=h+Math.imul(_$,L$)|0,L=L+Math.imul(_$,S$)|0,g=g+Math.imul($$,p)|0,h=h+Math.imul($$,x)|0,h=h+Math.imul(s,p)|0,L=L+Math.imul(s,x)|0,g=g+Math.imul(o,K$)|0,h=h+Math.imul(o,j$)|0,h=h+Math.imul(B,K$)|0,L=L+Math.imul(B,j$)|0,g=g+Math.imul(Y$,Z$)|0,h=h+Math.imul(Y$,A$)|0,h=h+Math.imul(v$,Z$)|0,L=L+Math.imul(v$,A$)|0,g=g+Math.imul(n,b$)|0,h=h+Math.imul(n,R$)|0,h=h+Math.imul(t,b$)|0,L=L+Math.imul(t,R$)|0,g=g+Math.imul(i,M$)|0,h=h+Math.imul(i,N$)|0,h=h+Math.imul(F,M$)|0,L=L+Math.imul(F,N$)|0;var t6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(t6>>>26)|0,t6&=67108863,g=Math.imul(k$,D$),h=Math.imul(k$,g$),h=h+Math.imul(I$,D$)|0,L=Math.imul(I$,g$),g=g+Math.imul(w$,C$)|0,h=h+Math.imul(w$,E$)|0,h=h+Math.imul(G$,C$)|0,L=L+Math.imul(G$,E$)|0,g=g+Math.imul(H$,h$)|0,h=h+Math.imul(H$,V$)|0,h=h+Math.imul(f$,h$)|0,L=L+Math.imul(f$,V$)|0,g=g+Math.imul(O$,L$)|0,h=h+Math.imul(O$,S$)|0,h=h+Math.imul(T$,L$)|0,L=L+Math.imul(T$,S$)|0,g=g+Math.imul(U,p)|0,h=h+Math.imul(U,x)|0,h=h+Math.imul(_$,p)|0,L=L+Math.imul(_$,x)|0,g=g+Math.imul($$,K$)|0,h=h+Math.imul($$,j$)|0,h=h+Math.imul(s,K$)|0,L=L+Math.imul(s,j$)|0,g=g+Math.imul(o,Z$)|0,h=h+Math.imul(o,A$)|0,h=h+Math.imul(B,Z$)|0,L=L+Math.imul(B,A$)|0,g=g+Math.imul(Y$,b$)|0,h=h+Math.imul(Y$,R$)|0,h=h+Math.imul(v$,b$)|0,L=L+Math.imul(v$,R$)|0,g=g+Math.imul(n,M$)|0,h=h+Math.imul(n,N$)|0,h=h+Math.imul(t,M$)|0,L=L+Math.imul(t,N$)|0,g=g+Math.imul(i,O6)|0,h=h+Math.imul(i,K6)|0,h=h+Math.imul(F,O6)|0,L=L+Math.imul(F,K6)|0;var B6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(B6>>>26)|0,B6&=67108863,g=Math.imul(k$,C$),h=Math.imul(k$,E$),h=h+Math.imul(I$,C$)|0,L=Math.imul(I$,E$),g=g+Math.imul(w$,h$)|0,h=h+Math.imul(w$,V$)|0,h=h+Math.imul(G$,h$)|0,L=L+Math.imul(G$,V$)|0,g=g+Math.imul(H$,L$)|0,h=h+Math.imul(H$,S$)|0,h=h+Math.imul(f$,L$)|0,L=L+Math.imul(f$,S$)|0,g=g+Math.imul(O$,p)|0,h=h+Math.imul(O$,x)|0,h=h+Math.imul(T$,p)|0,L=L+Math.imul(T$,x)|0,g=g+Math.imul(U,K$)|0,h=h+Math.imul(U,j$)|0,h=h+Math.imul(_$,K$)|0,L=L+Math.imul(_$,j$)|0,g=g+Math.imul($$,Z$)|0,h=h+Math.imul($$,A$)|0,h=h+Math.imul(s,Z$)|0,L=L+Math.imul(s,A$)|0,g=g+Math.imul(o,b$)|0,h=h+Math.imul(o,R$)|0,h=h+Math.imul(B,b$)|0,L=L+Math.imul(B,R$)|0,g=g+Math.imul(Y$,M$)|0,h=h+Math.imul(Y$,N$)|0,h=h+Math.imul(v$,M$)|0,L=L+Math.imul(v$,N$)|0,g=g+Math.imul(n,O6)|0,h=h+Math.imul(n,K6)|0,h=h+Math.imul(t,O6)|0,L=L+Math.imul(t,K6)|0;var U6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(U6>>>26)|0,U6&=67108863,g=Math.imul(k$,h$),h=Math.imul(k$,V$),h=h+Math.imul(I$,h$)|0,L=Math.imul(I$,V$),g=g+Math.imul(w$,L$)|0,h=h+Math.imul(w$,S$)|0,h=h+Math.imul(G$,L$)|0,L=L+Math.imul(G$,S$)|0,g=g+Math.imul(H$,p)|0,h=h+Math.imul(H$,x)|0,h=h+Math.imul(f$,p)|0,L=L+Math.imul(f$,x)|0,g=g+Math.imul(O$,K$)|0,h=h+Math.imul(O$,j$)|0,h=h+Math.imul(T$,K$)|0,L=L+Math.imul(T$,j$)|0,g=g+Math.imul(U,Z$)|0,h=h+Math.imul(U,A$)|0,h=h+Math.imul(_$,Z$)|0,L=L+Math.imul(_$,A$)|0,g=g+Math.imul($$,b$)|0,h=h+Math.imul($$,R$)|0,h=h+Math.imul(s,b$)|0,L=L+Math.imul(s,R$)|0,g=g+Math.imul(o,M$)|0,h=h+Math.imul(o,N$)|0,h=h+Math.imul(B,M$)|0,L=L+Math.imul(B,N$)|0,g=g+Math.imul(Y$,O6)|0,h=h+Math.imul(Y$,K6)|0,h=h+Math.imul(v$,O6)|0,L=L+Math.imul(v$,K6)|0;var F6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(F6>>>26)|0,F6&=67108863,g=Math.imul(k$,L$),h=Math.imul(k$,S$),h=h+Math.imul(I$,L$)|0,L=Math.imul(I$,S$),g=g+Math.imul(w$,p)|0,h=h+Math.imul(w$,x)|0,h=h+Math.imul(G$,p)|0,L=L+Math.imul(G$,x)|0,g=g+Math.imul(H$,K$)|0,h=h+Math.imul(H$,j$)|0,h=h+Math.imul(f$,K$)|0,L=L+Math.imul(f$,j$)|0,g=g+Math.imul(O$,Z$)|0,h=h+Math.imul(O$,A$)|0,h=h+Math.imul(T$,Z$)|0,L=L+Math.imul(T$,A$)|0,g=g+Math.imul(U,b$)|0,h=h+Math.imul(U,R$)|0,h=h+Math.imul(_$,b$)|0,L=L+Math.imul(_$,R$)|0,g=g+Math.imul($$,M$)|0,h=h+Math.imul($$,N$)|0,h=h+Math.imul(s,M$)|0,L=L+Math.imul(s,N$)|0,g=g+Math.imul(o,O6)|0,h=h+Math.imul(o,K6)|0,h=h+Math.imul(B,O6)|0,L=L+Math.imul(B,K6)|0;var a6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(a6>>>26)|0,a6&=67108863,g=Math.imul(k$,p),h=Math.imul(k$,x),h=h+Math.imul(I$,p)|0,L=Math.imul(I$,x),g=g+Math.imul(w$,K$)|0,h=h+Math.imul(w$,j$)|0,h=h+Math.imul(G$,K$)|0,L=L+Math.imul(G$,j$)|0,g=g+Math.imul(H$,Z$)|0,h=h+Math.imul(H$,A$)|0,h=h+Math.imul(f$,Z$)|0,L=L+Math.imul(f$,A$)|0,g=g+Math.imul(O$,b$)|0,h=h+Math.imul(O$,R$)|0,h=h+Math.imul(T$,b$)|0,L=L+Math.imul(T$,R$)|0,g=g+Math.imul(U,M$)|0,h=h+Math.imul(U,N$)|0,h=h+Math.imul(_$,M$)|0,L=L+Math.imul(_$,N$)|0,g=g+Math.imul($$,O6)|0,h=h+Math.imul($$,K6)|0,h=h+Math.imul(s,O6)|0,L=L+Math.imul(s,K6)|0;var Q6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,g=Math.imul(k$,K$),h=Math.imul(k$,j$),h=h+Math.imul(I$,K$)|0,L=Math.imul(I$,j$),g=g+Math.imul(w$,Z$)|0,h=h+Math.imul(w$,A$)|0,h=h+Math.imul(G$,Z$)|0,L=L+Math.imul(G$,A$)|0,g=g+Math.imul(H$,b$)|0,h=h+Math.imul(H$,R$)|0,h=h+Math.imul(f$,b$)|0,L=L+Math.imul(f$,R$)|0,g=g+Math.imul(O$,M$)|0,h=h+Math.imul(O$,N$)|0,h=h+Math.imul(T$,M$)|0,L=L+Math.imul(T$,N$)|0,g=g+Math.imul(U,O6)|0,h=h+Math.imul(U,K6)|0,h=h+Math.imul(_$,O6)|0,L=L+Math.imul(_$,K6)|0;var e6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(e6>>>26)|0,e6&=67108863,g=Math.imul(k$,Z$),h=Math.imul(k$,A$),h=h+Math.imul(I$,Z$)|0,L=Math.imul(I$,A$),g=g+Math.imul(w$,b$)|0,h=h+Math.imul(w$,R$)|0,h=h+Math.imul(G$,b$)|0,L=L+Math.imul(G$,R$)|0,g=g+Math.imul(H$,M$)|0,h=h+Math.imul(H$,N$)|0,h=h+Math.imul(f$,M$)|0,L=L+Math.imul(f$,N$)|0,g=g+Math.imul(O$,O6)|0,h=h+Math.imul(O$,K6)|0,h=h+Math.imul(T$,O6)|0,L=L+Math.imul(T$,K6)|0;var s6=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(s6>>>26)|0,s6&=67108863,g=Math.imul(k$,b$),h=Math.imul(k$,R$),h=h+Math.imul(I$,b$)|0,L=Math.imul(I$,R$),g=g+Math.imul(w$,M$)|0,h=h+Math.imul(w$,N$)|0,h=h+Math.imul(G$,M$)|0,L=L+Math.imul(G$,N$)|0,g=g+Math.imul(H$,O6)|0,h=h+Math.imul(H$,K6)|0,h=h+Math.imul(f$,O6)|0,L=L+Math.imul(f$,K6)|0;var sj=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+(sj>>>26)|0,sj&=67108863,g=Math.imul(k$,M$),h=Math.imul(k$,N$),h=h+Math.imul(I$,M$)|0,L=Math.imul(I$,N$),g=g+Math.imul(w$,O6)|0,h=h+Math.imul(w$,K6)|0,h=h+Math.imul(G$,O6)|0,L=L+Math.imul(G$,K6)|0;var $O=(k+g|0)+((h&8191)<<13)|0;k=(L+(h>>>13)|0)+($O>>>26)|0,$O&=67108863,g=Math.imul(k$,O6),h=Math.imul(k$,K6),h=h+Math.imul(I$,O6)|0,L=Math.imul(I$,K6);var qO=(k+g|0)+((h&8191)<<13)|0;if(k=(L+(h>>>13)|0)+(qO>>>26)|0,qO&=67108863,v[0]=A6,v[1]=m6,v[2]=d6,v[3]=l6,v[4]=o6,v[5]=r6,v[6]=n6,v[7]=i6,v[8]=t6,v[9]=B6,v[10]=U6,v[11]=F6,v[12]=a6,v[13]=Q6,v[14]=e6,v[15]=s6,v[16]=sj,v[17]=$O,v[18]=qO,k!==0)v[19]=k,S.length++;return S};if(!Math.imul)b=D;function u(T,W,Z){Z.negative=W.negative^T.negative,Z.length=T.length+W.length;var S=0,N=0;for(var X=0;X<Z.length-1;X++){var v=N;N=0;var k=S&67108863,g=Math.min(X,W.length-1);for(var h=Math.max(0,X-T.length+1);h<=g;h++){var L=X-h,d=T.words[L]|0,i=W.words[h]|0,F=d*i,W$=F&67108863;v=v+(F/67108864|0)|0,W$=W$+k|0,k=W$&67108863,v=v+(W$>>>26)|0,N+=v>>>26,v&=67108863}Z.words[X]=k,S=v,v=N}if(S!==0)Z.words[X]=S;else Z.length--;return Z._strip()}function y(T,W,Z){return u(T,W,Z)}j.prototype.mulTo=function(W,Z){var S,N=this.length+W.length;if(this.length===10&&W.length===10)S=b(this,W,Z);else if(N<63)S=D(this,W,Z);else if(N<1024)S=u(this,W,Z);else S=y(this,W,Z);return S};function c(T,W){this.x=T,this.y=W}c.prototype.makeRBT=function(W){var Z=Array(W),S=j.prototype._countBits(W)-1;for(var N=0;N<W;N++)Z[N]=this.revBin(N,S,W);return Z},c.prototype.revBin=function(W,Z,S){if(W===0||W===S-1)return W;var N=0;for(var X=0;X<Z;X++)N|=(W&1)<<Z-X-1,W>>=1;return N},c.prototype.permute=function(W,Z,S,N,X,v){for(var k=0;k<v;k++)N[k]=Z[W[k]],X[k]=S[W[k]]},c.prototype.transform=function(W,Z,S,N,X,v){this.permute(v,W,Z,S,N,X);for(var k=1;k<X;k<<=1){var g=k<<1,h=Math.cos(2*Math.PI/g),L=Math.sin(2*Math.PI/g);for(var d=0;d<X;d+=g){var i=h,F=L;for(var W$=0;W$<k;W$++){var n=S[d+W$],t=N[d+W$],y$=S[d+W$+k],Y$=N[d+W$+k],v$=i*y$-F*Y$;if(Y$=i*Y$+F*y$,y$=v$,S[d+W$]=n+y$,N[d+W$]=t+Y$,S[d+W$+k]=n-y$,N[d+W$+k]=t-Y$,W$!==g)v$=h*i-L*F,F=h*F+L*i,i=v$}}}},c.prototype.guessLen13b=function(W,Z){var S=Math.max(Z,W)|1,N=S&1,X=0;for(S=S/2|0;S;S=S>>>1)X++;return 1<<X+1+N},c.prototype.conjugate=function(W,Z,S){if(S<=1)return;for(var N=0;N<S/2;N++){var X=W[N];W[N]=W[S-N-1],W[S-N-1]=X,X=Z[N],Z[N]=-Z[S-N-1],Z[S-N-1]=-X}},c.prototype.normalize13b=function(W,Z){var S=0;for(var N=0;N<Z/2;N++){var X=Math.round(W[2*N+1]/Z)*8192+Math.round(W[2*N]/Z)+S;if(W[N]=X&67108863,X<67108864)S=0;else S=X/67108864|0}return W},c.prototype.convert13b=function(W,Z,S,N){var X=0;for(var v=0;v<Z;v++)X=X+(W[v]|0),S[2*v]=X&8191,X=X>>>13,S[2*v+1]=X&8191,X=X>>>13;for(v=2*Z;v<N;++v)S[v]=0;_(X===0),_((X&-8192)===0)},c.prototype.stub=function(W){var Z=Array(W);for(var S=0;S<W;S++)Z[S]=0;return Z},c.prototype.mulp=function(W,Z,S){var N=2*this.guessLen13b(W.length,Z.length),X=this.makeRBT(N),v=this.stub(N),k=Array(N),g=Array(N),h=Array(N),L=Array(N),d=Array(N),i=Array(N),F=S.words;F.length=N,this.convert13b(W.words,W.length,k,N),this.convert13b(Z.words,Z.length,L,N),this.transform(k,v,g,h,N,X),this.transform(L,v,d,i,N,X);for(var W$=0;W$<N;W$++){var n=g[W$]*d[W$]-h[W$]*i[W$];h[W$]=g[W$]*i[W$]+h[W$]*d[W$],g[W$]=n}return this.conjugate(g,h,N),this.transform(g,h,F,v,N,X),this.conjugate(F,v,N),this.normalize13b(F,N),S.negative=W.negative^Z.negative,S.length=W.length+Z.length,S._strip()},j.prototype.mul=function(W){var Z=new j(null);return Z.words=Array(this.length+W.length),this.mulTo(W,Z)},j.prototype.mulf=function(W){var Z=new j(null);return Z.words=Array(this.length+W.length),y(this,W,Z)},j.prototype.imul=function(W){return this.clone().mulTo(W,this)},j.prototype.imuln=function(W){var Z=W<0;if(Z)W=-W;_(typeof W==="number"),_(W<67108864);var S=0;for(var N=0;N<this.length;N++){var X=(this.words[N]|0)*W,v=(X&67108863)+(S&67108863);S>>=26,S+=X/67108864|0,S+=v>>>26,this.words[N]=v&67108863}if(S!==0)this.words[N]=S,this.length++;return this.length=W===0?1:this.length,Z?this.ineg():this},j.prototype.muln=function(W){return this.clone().imuln(W)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(W){var Z=I(W);if(Z.length===0)return new j(1);var S=this;for(var N=0;N<Z.length;N++,S=S.sqr())if(Z[N]!==0)break;if(++N<Z.length)for(var X=S.sqr();N<Z.length;N++,X=X.sqr()){if(Z[N]===0)continue;S=S.mul(X)}return S},j.prototype.iushln=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26,N=67108863>>>26-Z<<26-Z,X;if(Z!==0){var v=0;for(X=0;X<this.length;X++){var k=this.words[X]&N,g=(this.words[X]|0)-k<<Z;this.words[X]=g|v,v=k>>>26-Z}if(v)this.words[X]=v,this.length++}if(S!==0){for(X=this.length-1;X>=0;X--)this.words[X+S]=this.words[X];for(X=0;X<S;X++)this.words[X]=0;this.length+=S}return this._strip()},j.prototype.ishln=function(W){return _(this.negative===0),this.iushln(W)},j.prototype.iushrn=function(W,Z,S){_(typeof W==="number"&&W>=0);var N;if(Z)N=(Z-Z%26)/26;else N=0;var X=W%26,v=Math.min((W-X)/26,this.length),k=67108863^67108863>>>X<<X,g=S;if(N-=v,N=Math.max(0,N),g){for(var h=0;h<v;h++)g.words[h]=this.words[h];g.length=v}if(v===0);else if(this.length>v){this.length-=v;for(h=0;h<this.length;h++)this.words[h]=this.words[h+v]}else this.words[0]=0,this.length=1;var L=0;for(h=this.length-1;h>=0&&(L!==0||h>=N);h--){var d=this.words[h]|0;this.words[h]=L<<26-X|d>>>X,L=d&k}if(g&&L!==0)g.words[g.length++]=L;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},j.prototype.ishrn=function(W,Z,S){return _(this.negative===0),this.iushrn(W,Z,S)},j.prototype.shln=function(W){return this.clone().ishln(W)},j.prototype.ushln=function(W){return this.clone().iushln(W)},j.prototype.shrn=function(W){return this.clone().ishrn(W)},j.prototype.ushrn=function(W){return this.clone().iushrn(W)},j.prototype.testn=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26,N=1<<Z;if(this.length<=S)return!1;var X=this.words[S];return!!(X&N)},j.prototype.imaskn=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(Z!==0)S++;if(this.length=Math.min(S,this.length),Z!==0){var N=67108863^67108863>>>Z<<Z;this.words[this.length-1]&=N}return this._strip()},j.prototype.maskn=function(W){return this.clone().imaskn(W)},j.prototype.iaddn=function(W){if(_(typeof W==="number"),_(W<67108864),W<0)return this.isubn(-W);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=W)return this.words[0]=W-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(W),this.negative=1,this}return this._iaddn(W)},j.prototype._iaddn=function(W){this.words[0]+=W;for(var Z=0;Z<this.length&&this.words[Z]>=67108864;Z++)if(this.words[Z]-=67108864,Z===this.length-1)this.words[Z+1]=1;else this.words[Z+1]++;return this.length=Math.max(this.length,Z+1),this},j.prototype.isubn=function(W){if(_(typeof W==="number"),_(W<67108864),W<0)return this.iaddn(-W);if(this.negative!==0)return this.negative=0,this.iaddn(W),this.negative=1,this;if(this.words[0]-=W,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Z=0;Z<this.length&&this.words[Z]<0;Z++)this.words[Z]+=67108864,this.words[Z+1]-=1;return this._strip()},j.prototype.addn=function(W){return this.clone().iaddn(W)},j.prototype.subn=function(W){return this.clone().isubn(W)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(W,Z,S){var N=W.length+S,X;this._expand(N);var v,k=0;for(X=0;X<W.length;X++){v=(this.words[X+S]|0)+k;var g=(W.words[X]|0)*Z;v-=g&67108863,k=(v>>26)-(g/67108864|0),this.words[X+S]=v&67108863}for(;X<this.length-S;X++)v=(this.words[X+S]|0)+k,k=v>>26,this.words[X+S]=v&67108863;if(k===0)return this._strip();_(k===-1),k=0;for(X=0;X<this.length;X++)v=-(this.words[X]|0)+k,k=v>>26,this.words[X]=v&67108863;return this.negative=1,this._strip()},j.prototype._wordDiv=function(W,Z){var S=this.length-W.length,N=this.clone(),X=W,v=X.words[X.length-1]|0,k=this._countBits(v);if(S=26-k,S!==0)X=X.ushln(S),N.iushln(S),v=X.words[X.length-1]|0;var g=N.length-X.length,h;if(Z!=="mod"){h=new j(null),h.length=g+1,h.words=Array(h.length);for(var L=0;L<h.length;L++)h.words[L]=0}var d=N.clone()._ishlnsubmul(X,1,g);if(d.negative===0){if(N=d,h)h.words[g]=1}for(var i=g-1;i>=0;i--){var F=(N.words[X.length+i]|0)*67108864+(N.words[X.length+i-1]|0);F=Math.min(F/v|0,67108863),N._ishlnsubmul(X,F,i);while(N.negative!==0)if(F--,N.negative=0,N._ishlnsubmul(X,1,i),!N.isZero())N.negative^=1;if(h)h.words[i]=F}if(h)h._strip();if(N._strip(),Z!=="div"&&S!==0)N.iushrn(S);return{div:h||null,mod:N}},j.prototype.divmod=function(W,Z,S){if(_(!W.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var N,X,v;if(this.negative!==0&&W.negative===0){if(v=this.neg().divmod(W,Z),Z!=="mod")N=v.div.neg();if(Z!=="div"){if(X=v.mod.neg(),S&&X.negative!==0)X.iadd(W)}return{div:N,mod:X}}if(this.negative===0&&W.negative!==0){if(v=this.divmod(W.neg(),Z),Z!=="mod")N=v.div.neg();return{div:N,mod:v.mod}}if((this.negative&W.negative)!==0){if(v=this.neg().divmod(W.neg(),Z),Z!=="div"){if(X=v.mod.neg(),S&&X.negative!==0)X.isub(W)}return{div:v.div,mod:X}}if(W.length>this.length||this.cmp(W)<0)return{div:new j(0),mod:this};if(W.length===1){if(Z==="div")return{div:this.divn(W.words[0]),mod:null};if(Z==="mod")return{div:null,mod:new j(this.modrn(W.words[0]))};return{div:this.divn(W.words[0]),mod:new j(this.modrn(W.words[0]))}}return this._wordDiv(W,Z)},j.prototype.div=function(W){return this.divmod(W,"div",!1).div},j.prototype.mod=function(W){return this.divmod(W,"mod",!1).mod},j.prototype.umod=function(W){return this.divmod(W,"mod",!0).mod},j.prototype.divRound=function(W){var Z=this.divmod(W);if(Z.mod.isZero())return Z.div;var S=Z.div.negative!==0?Z.mod.isub(W):Z.mod,N=W.ushrn(1),X=W.andln(1),v=S.cmp(N);if(v<0||X===1&&v===0)return Z.div;return Z.div.negative!==0?Z.div.isubn(1):Z.div.iaddn(1)},j.prototype.modrn=function(W){var Z=W<0;if(Z)W=-W;_(W<=67108863);var S=67108864%W,N=0;for(var X=this.length-1;X>=0;X--)N=(S*N+(this.words[X]|0))%W;return Z?-N:N},j.prototype.modn=function(W){return this.modrn(W)},j.prototype.idivn=function(W){var Z=W<0;if(Z)W=-W;_(W<=67108863);var S=0;for(var N=this.length-1;N>=0;N--){var X=(this.words[N]|0)+S*67108864;this.words[N]=X/W|0,S=X%W}return this._strip(),Z?this.ineg():this},j.prototype.divn=function(W){return this.clone().idivn(W)},j.prototype.egcd=function(W){_(W.negative===0),_(!W.isZero());var Z=this,S=W.clone();if(Z.negative!==0)Z=Z.umod(W);else Z=Z.clone();var N=new j(1),X=new j(0),v=new j(0),k=new j(1),g=0;while(Z.isEven()&&S.isEven())Z.iushrn(1),S.iushrn(1),++g;var h=S.clone(),L=Z.clone();while(!Z.isZero()){for(var d=0,i=1;(Z.words[0]&i)===0&&d<26;++d,i<<=1);if(d>0){Z.iushrn(d);while(d-- >0){if(N.isOdd()||X.isOdd())N.iadd(h),X.isub(L);N.iushrn(1),X.iushrn(1)}}for(var F=0,W$=1;(S.words[0]&W$)===0&&F<26;++F,W$<<=1);if(F>0){S.iushrn(F);while(F-- >0){if(v.isOdd()||k.isOdd())v.iadd(h),k.isub(L);v.iushrn(1),k.iushrn(1)}}if(Z.cmp(S)>=0)Z.isub(S),N.isub(v),X.isub(k);else S.isub(Z),v.isub(N),k.isub(X)}return{a:v,b:k,gcd:S.iushln(g)}},j.prototype._invmp=function(W){_(W.negative===0),_(!W.isZero());var Z=this,S=W.clone();if(Z.negative!==0)Z=Z.umod(W);else Z=Z.clone();var N=new j(1),X=new j(0),v=S.clone();while(Z.cmpn(1)>0&&S.cmpn(1)>0){for(var k=0,g=1;(Z.words[0]&g)===0&&k<26;++k,g<<=1);if(k>0){Z.iushrn(k);while(k-- >0){if(N.isOdd())N.iadd(v);N.iushrn(1)}}for(var h=0,L=1;(S.words[0]&L)===0&&h<26;++h,L<<=1);if(h>0){S.iushrn(h);while(h-- >0){if(X.isOdd())X.iadd(v);X.iushrn(1)}}if(Z.cmp(S)>=0)Z.isub(S),N.isub(X);else S.isub(Z),X.isub(N)}var d;if(Z.cmpn(1)===0)d=N;else d=X;if(d.cmpn(0)<0)d.iadd(W);return d},j.prototype.gcd=function(W){if(this.isZero())return W.abs();if(W.isZero())return this.abs();var Z=this.clone(),S=W.clone();Z.negative=0,S.negative=0;for(var N=0;Z.isEven()&&S.isEven();N++)Z.iushrn(1),S.iushrn(1);do{while(Z.isEven())Z.iushrn(1);while(S.isEven())S.iushrn(1);var X=Z.cmp(S);if(X<0){var v=Z;Z=S,S=v}else if(X===0||S.cmpn(1)===0)break;Z.isub(S)}while(!0);return S.iushln(N)},j.prototype.invm=function(W){return this.egcd(W).a.umod(W)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(W){return this.words[0]&W},j.prototype.bincn=function(W){_(typeof W==="number");var Z=W%26,S=(W-Z)/26,N=1<<Z;if(this.length<=S)return this._expand(S+1),this.words[S]|=N,this;var X=N;for(var v=S;X!==0&&v<this.length;v++){var k=this.words[v]|0;k+=X,X=k>>>26,k&=67108863,this.words[v]=k}if(X!==0)this.words[v]=X,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(W){var Z=W<0;if(this.negative!==0&&!Z)return-1;if(this.negative===0&&Z)return 1;this._strip();var S;if(this.length>1)S=1;else{if(Z)W=-W;_(W<=67108863,"Number is too big");var N=this.words[0]|0;S=N===W?0:N<W?-1:1}if(this.negative!==0)return-S|0;return S},j.prototype.cmp=function(W){if(this.negative!==0&&W.negative===0)return-1;if(this.negative===0&&W.negative!==0)return 1;var Z=this.ucmp(W);if(this.negative!==0)return-Z|0;return Z},j.prototype.ucmp=function(W){if(this.length>W.length)return 1;if(this.length<W.length)return-1;var Z=0;for(var S=this.length-1;S>=0;S--){var N=this.words[S]|0,X=W.words[S]|0;if(N===X)continue;if(N<X)Z=-1;else if(N>X)Z=1;break}return Z},j.prototype.gtn=function(W){return this.cmpn(W)===1},j.prototype.gt=function(W){return this.cmp(W)===1},j.prototype.gten=function(W){return this.cmpn(W)>=0},j.prototype.gte=function(W){return this.cmp(W)>=0},j.prototype.ltn=function(W){return this.cmpn(W)===-1},j.prototype.lt=function(W){return this.cmp(W)===-1},j.prototype.lten=function(W){return this.cmpn(W)<=0},j.prototype.lte=function(W){return this.cmp(W)<=0},j.prototype.eqn=function(W){return this.cmpn(W)===0},j.prototype.eq=function(W){return this.cmp(W)===0},j.red=function(W){return new Y(W)},j.prototype.toRed=function(W){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),W.convertTo(this)._forceRed(W)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(W){return this.red=W,this},j.prototype.forceRed=function(W){return _(!this.red,"Already a number in reduction context"),this._forceRed(W)},j.prototype.redAdd=function(W){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,W)},j.prototype.redIAdd=function(W){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,W)},j.prototype.redSub=function(W){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,W)},j.prototype.redISub=function(W){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,W)},j.prototype.redShl=function(W){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,W)},j.prototype.redMul=function(W){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,W),this.red.mul(this,W)},j.prototype.redIMul=function(W){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,W),this.red.imul(this,W)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(W){return _(this.red&&!W.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,W)};var m={k256:null,p224:null,p192:null,p25519:null};function q$(T,W){this.name=T,this.p=new j(W,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q$.prototype._tmp=function(){var W=new j(null);return W.words=Array(Math.ceil(this.n/13)),W},q$.prototype.ireduce=function(W){var Z=W,S;do this.split(Z,this.tmp),Z=this.imulK(Z),Z=Z.iadd(this.tmp),S=Z.bitLength();while(S>this.n);var N=S<this.n?-1:Z.ucmp(this.p);if(N===0)Z.words[0]=0,Z.length=1;else if(N>0)Z.isub(this.p);else if(Z.strip!==void 0)Z.strip();else Z._strip();return Z},q$.prototype.split=function(W,Z){W.iushrn(this.n,0,Z)},q$.prototype.imulK=function(W){return W.imul(this.k)};function e(){q$.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(e,q$),e.prototype.split=function(W,Z){var S=4194303,N=Math.min(W.length,9);for(var X=0;X<N;X++)Z.words[X]=W.words[X];if(Z.length=N,W.length<=9){W.words[0]=0,W.length=1;return}var v=W.words[9];Z.words[Z.length++]=v&S;for(X=10;X<W.length;X++){var k=W.words[X]|0;W.words[X-10]=(k&S)<<4|v>>>22,v=k}if(v>>>=22,W.words[X-10]=v,v===0&&W.length>10)W.length-=10;else W.length-=9},e.prototype.imulK=function(W){W.words[W.length]=0,W.words[W.length+1]=0,W.length+=2;var Z=0;for(var S=0;S<W.length;S++){var N=W.words[S]|0;Z+=N*977,W.words[S]=Z&67108863,Z=N*64+(Z/67108864|0)}if(W.words[W.length-1]===0){if(W.length--,W.words[W.length-1]===0)W.length--}return W};function l(){q$.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(l,q$);function r(){q$.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(r,q$);function M(){q$.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(M,q$),M.prototype.imulK=function(W){var Z=0;for(var S=0;S<W.length;S++){var N=(W.words[S]|0)*19+Z,X=N&67108863;N>>>=26,W.words[S]=X,Z=N}if(Z!==0)W.words[W.length++]=Z;return W},j._prime=function(W){if(m[W])return m[W];var Z;if(W==="k256")Z=new e;else if(W==="p224")Z=new l;else if(W==="p192")Z=new r;else if(W==="p25519")Z=new M;else throw Error("Unknown prime "+W);return m[W]=Z,Z};function Y(T){if(typeof T==="string"){var W=j._prime(T);this.m=W.p,this.prime=W}else _(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}Y.prototype._verify1=function(W){_(W.negative===0,"red works only with positives"),_(W.red,"red works only with red numbers")},Y.prototype._verify2=function(W,Z){_((W.negative|Z.negative)===0,"red works only with positives"),_(W.red&&W.red===Z.red,"red works only with red numbers")},Y.prototype.imod=function(W){if(this.prime)return this.prime.ireduce(W)._forceRed(this);return f(W,W.umod(this.m)._forceRed(this)),W},Y.prototype.neg=function(W){if(W.isZero())return W.clone();return this.m.sub(W)._forceRed(this)},Y.prototype.add=function(W,Z){this._verify2(W,Z);var S=W.add(Z);if(S.cmp(this.m)>=0)S.isub(this.m);return S._forceRed(this)},Y.prototype.iadd=function(W,Z){this._verify2(W,Z);var S=W.iadd(Z);if(S.cmp(this.m)>=0)S.isub(this.m);return S},Y.prototype.sub=function(W,Z){this._verify2(W,Z);var S=W.sub(Z);if(S.cmpn(0)<0)S.iadd(this.m);return S._forceRed(this)},Y.prototype.isub=function(W,Z){this._verify2(W,Z);var S=W.isub(Z);if(S.cmpn(0)<0)S.iadd(this.m);return S},Y.prototype.shl=function(W,Z){return this._verify1(W),this.imod(W.ushln(Z))},Y.prototype.imul=function(W,Z){return this._verify2(W,Z),this.imod(W.imul(Z))},Y.prototype.mul=function(W,Z){return this._verify2(W,Z),this.imod(W.mul(Z))},Y.prototype.isqr=function(W){return this.imul(W,W.clone())},Y.prototype.sqr=function(W){return this.mul(W,W)},Y.prototype.sqrt=function(W){if(W.isZero())return W.clone();var Z=this.m.andln(3);if(_(Z%2===1),Z===3){var S=this.m.add(new j(1)).iushrn(2);return this.pow(W,S)}var N=this.m.subn(1),X=0;while(!N.isZero()&&N.andln(1)===0)X++,N.iushrn(1);_(!N.isZero());var v=new j(1).toRed(this),k=v.redNeg(),g=this.m.subn(1).iushrn(1),h=this.m.bitLength();h=new j(2*h*h).toRed(this);while(this.pow(h,g).cmp(k)!==0)h.redIAdd(k);var L=this.pow(h,N),d=this.pow(W,N.addn(1).iushrn(1)),i=this.pow(W,N),F=X;while(i.cmp(v)!==0){var W$=i;for(var n=0;W$.cmp(v)!==0;n++)W$=W$.redSqr();_(n<F);var t=this.pow(L,new j(1).iushln(F-n-1));d=d.redMul(t),L=t.redSqr(),i=i.redMul(L),F=n}return d},Y.prototype.invm=function(W){var Z=W._invmp(this.m);if(Z.negative!==0)return Z.negative=0,this.imod(Z).redNeg();else return this.imod(Z)},Y.prototype.pow=function(W,Z){if(Z.isZero())return new j(1).toRed(this);if(Z.cmpn(1)===0)return W.clone();var S=4,N=Array(1<<S);N[0]=new j(1).toRed(this),N[1]=W;for(var X=2;X<N.length;X++)N[X]=this.mul(N[X-1],W);var v=N[0],k=0,g=0,h=Z.bitLength()%26;if(h===0)h=26;for(X=Z.length-1;X>=0;X--){var L=Z.words[X];for(var d=h-1;d>=0;d--){var i=L>>d&1;if(v!==N[0])v=this.sqr(v);if(i===0&&k===0){g=0;continue}if(k<<=1,k|=i,g++,g!==S&&(X!==0||d!==0))continue;v=this.mul(v,N[k]),g=0,k=0}h=26}return v},Y.prototype.convertTo=function(W){var Z=W.umod(this.m);return Z===W?Z.clone():Z},Y.prototype.convertFrom=function(W){var Z=W.clone();return Z.red=null,Z},j.mont=function(W){return new H(W)};function H(T){if(Y.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}O(H,Y),H.prototype.convertTo=function(W){return this.imod(W.ushln(this.shift))},H.prototype.convertFrom=function(W){var Z=this.imod(W.mul(this.rinv));return Z.red=null,Z},H.prototype.imul=function(W,Z){if(W.isZero()||Z.isZero())return W.words[0]=0,W.length=1,W;var S=W.imul(Z),N=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),X=S.isub(N).iushrn(this.shift),v=X;if(X.cmp(this.m)>=0)v=X.isub(this.m);else if(X.cmpn(0)<0)v=X.iadd(this.m);return v._forceRed(this)},H.prototype.mul=function(W,Z){if(W.isZero()||Z.isZero())return new j(0)._forceRed(this);var S=W.mul(Z),N=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),X=S.isub(N).iushrn(this.shift),v=X;if(X.cmp(this.m)>=0)v=X.isub(this.m);else if(X.cmpn(0)<0)v=X.iadd(this.m);return v._forceRed(this)},H.prototype.invm=function(W){var Z=this.imod(W._invmp(this.m).mul(this.r2));return Z._forceRed(this)}})(typeof q>"u"||q,$)}),_M=l$(($,q)=>{var K=Ul(),P=Uj(),_=iq().Buffer;function O(J){var w=J.modulus.byteLength(),G;do G=new K(P(w));while(G.cmp(J.modulus)>=0||!G.umod(J.prime1)||!G.umod(J.prime2));return G}function j(J){var w=O(J),G=w.toRed(K.mont(J.modulus)).redPow(new K(J.publicExponent)).fromRed();return{blinder:G,unblinder:w.invm(J.modulus)}}function z(J,w){var G=j(w),f=w.modulus.byteLength(),A=new K(J).mul(G.blinder).umod(w.modulus),V=A.toRed(K.mont(w.prime1)),C=A.toRed(K.mont(w.prime2)),E=w.coefficient,R=w.prime1,I=w.prime2,D=V.redPow(w.exponent1).fromRed(),b=C.redPow(w.exponent2).fromRed(),u=D.isub(b).imul(E).umod(R).imul(I);return b.iadd(u).imul(G.unblinder).umod(w.modulus).toArrayLike(_,"be",f)}z.getr=O,q.exports=z}),Fl=l$(($,q)=>{var K=sS(),P=Uj(),_=Fj(),O=$M(),j=qM(),z=MH(),J=KM(),w=_M(),G=iq().Buffer;q.exports=function(E,R,I){var D;if(E.padding)D=E.padding;else if(I)D=1;else D=4;var b=K(E),u;if(D===4)u=f(b,R);else if(D===1)u=A(b,R,I);else if(D===3){if(u=new z(R),u.cmp(b.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(I)return w(u,b);else return J(u,b)};function f(C,E){var R=C.modulus.byteLength(),I=E.length,D=_("sha1").update(G.alloc(0)).digest(),b=D.length,u=2*b;if(I>R-u-2)throw Error("message too long");var y=G.alloc(R-I-u-2),c=R-b-1,m=P(b),q$=j(G.concat([D,y,G.alloc(1,1),E],c),O(m,c)),e=j(m,O(q$,b));return new z(G.concat([G.alloc(1),e,q$],R))}function A(C,E,R){var I=E.length,D=C.modulus.byteLength();if(I>D-11)throw Error("message too long");var b;if(R)b=G.alloc(D-I-3,255);else b=V(D-I-3);return new z(G.concat([G.from([0,R?1:2]),b,G.alloc(1),E],D))}function V(C){var E=G.allocUnsafe(C),R=0,I=P(C*2),D=0,b;while(R<C){if(D===I.length)I=P(C*2),D=0;if(b=I[D++],b)E[R++]=b}return E}}),al=l$(($,q)=>{var K=sS(),P=$M(),_=qM(),O=MH(),j=_M(),z=Fj(),J=KM(),w=iq().Buffer;q.exports=function(C,E,R){var I;if(C.padding)I=C.padding;else if(R)I=1;else I=4;var D=K(C),b=D.modulus.byteLength();if(E.length>b||new O(E).cmp(D.modulus)>=0)throw Error("decryption error");var u;if(R)u=J(new O(E),D);else u=j(E,D);var y=w.alloc(b-u.length);if(u=w.concat([y,u],b),I===4)return G(D,u);else if(I===1)return f(D,u,R);else if(I===3)return u;else throw Error("unknown padding")};function G(V,C){var E=V.modulus.byteLength(),R=z("sha1").update(w.alloc(0)).digest(),I=R.length;if(C[0]!==0)throw Error("decryption error");var D=C.slice(1,I+1),b=C.slice(I+1),u=_(D,P(b,I)),y=_(b,P(u,E-I-1));if(A(R,y.slice(0,I)))throw Error("decryption error");var c=I;while(y[c]===0)c++;if(y[c++]!==1)throw Error("decryption error");return y.slice(c)}function f(V,C,E){var R=C.slice(0,2),I=2,D=0;while(C[I++]!==0)if(I>=C.length){D++;break}var b=C.slice(2,I-1);if(R.toString("hex")!=="0002"&&!E||R.toString("hex")!=="0001"&&E)D++;if(b.length<8)D++;if(D)throw Error("decryption error");return C.slice(I)}function A(V,C){V=w.from(V),C=w.from(C);var E=0,R=V.length;if(V.length!==C.length)E++,R=Math.min(V.length,C.length);var I=-1;while(++I<R)E+=V[I]^C[I];return E}}),fH=l$(($)=>{$.publicEncrypt=Fl(),$.privateDecrypt=al(),$.privateEncrypt=function(K,P){return $.publicEncrypt(K,P,!0)},$.publicDecrypt=function(K,P){return $.privateDecrypt(K,P,!0)}}),Ql=l$(($)=>{var q=(Bq(),w6(tq));if(typeof q.publicEncrypt!=="function")q=fH();if($.publicEncrypt=q.publicEncrypt,$.privateDecrypt=q.privateDecrypt,typeof q.privateEncrypt!=="function")$.privateEncrypt=fH().privateEncrypt;else $.privateEncrypt=q.privateEncrypt;if(typeof q.publicDecrypt!=="function")$.publicDecrypt=fH().publicDecrypt;else $.publicDecrypt=q.publicDecrypt}),el=l$(($)=>{var q=iq(),K=Uj(),P=q.Buffer,_=q.kMaxLength,O=globalThis.crypto||globalThis.msCrypto,j=Math.pow(2,32)-1;function z(A,V){if(typeof A!=="number"||A!==A)throw TypeError("offset must be a number");if(A>j||A<0)throw TypeError("offset must be a uint32");if(A>_||A>V)throw RangeError("offset out of range")}function J(A,V,C){if(typeof A!=="number"||A!==A)throw TypeError("size must be a number");if(A>j||A<0)throw TypeError("size must be a uint32");if(A+V>C||A>_)throw RangeError("buffer too small")}O&&O.getRandomValues,$.randomFill=w,$.randomFillSync=f;function w(A,V,C,E){if(!P.isBuffer(A)&&!(A instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof V==="function")E=V,V=0,C=A.length;else if(typeof C==="function")E=C,C=A.length-V;else if(typeof E!=="function")throw TypeError('"cb" argument must be a function');return z(V,A.length),J(C,V,A.length),G(A,V,C,E)}function G(A,V,C,E){if(!1)var R,I;if(E){K(C,function(b,u){if(b)return E(b);u.copy(A,V),E(null,A)});return}var D=K(C);return D.copy(A,V),A}function f(A,V,C){if(typeof V>"u")V=0;if(!P.isBuffer(A)&&!(A instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(z(V,A.length),C===void 0)C=A.length-V;return J(C,V,A.length),G(A,V,C)}}),sl=l$(($,q)=>{var K=(Bq(),w6(tq));if(typeof K.randomFill==="function"&&typeof K.randomFillSync==="function")$.randomFill=K.randomFill,$.randomFillSync=K.randomFillSync;else q.exports=el()}),$o=l$(($)=>{$.randomBytes=$.rng=$.pseudoRandomBytes=$.prng=Uj(),$.createHash=$.Hash=Fj(),$.createHmac=$.Hmac=dS();var q=Pl(),K=Object.keys(q),P=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(K);$.getHashes=function(){return P};var _=oS();$.pbkdf2=_.pbkdf2,$.pbkdf2Sync=_.pbkdf2Sync;var O=Ol();$.Cipher=O.Cipher,$.createCipher=O.createCipher,$.Cipheriv=O.Cipheriv,$.createCipheriv=O.createCipheriv,$.Decipher=O.Decipher,$.createDecipher=O.createDecipher,$.Decipheriv=O.Decipheriv,$.createDecipheriv=O.createDecipheriv,$.getCiphers=O.getCiphers,$.listCiphers=O.listCiphers;var j=Yl();$.DiffieHellmanGroup=j.DiffieHellmanGroup,$.createDiffieHellmanGroup=j.createDiffieHellmanGroup,$.getDiffieHellman=j.getDiffieHellman,$.createDiffieHellman=j.createDiffieHellman,$.DiffieHellman=j.DiffieHellman;var z=vl();$.createSign=z.createSign,$.Sign=z.Sign,$.createVerify=z.createVerify,$.Verify=z.Verify,$.createECDH=gl();var J=Ql();$.publicEncrypt=J.publicEncrypt,$.privateEncrypt=J.privateEncrypt,$.publicDecrypt=J.publicDecrypt,$.privateDecrypt=J.privateDecrypt;var w=sl();$.randomFill=w.randomFill,$.randomFillSync=w.randomFillSync,$.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
38
38
|
we accept pull requests
|
|
39
|
-
https://github.com/browserify/crypto-browserify`)},$.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),H6=_l($o(),1),qo=H6.prng,Ko=H6.pseudoRandomBytes,_o=H6.rng,Po=H6.randomBytes,jo=H6.Hash,Oo=H6.createHash,Yo=H6.Hmac,vo=H6.createHmac,zo=H6.getHashes,Wo=H6.pbkdf2,Ho=H6.pbkdf2Sync,Jo=H6.Cipher,To=H6.createCipher,wo=H6.Cipheriv,Zo=H6.createCipheriv,Xo=H6.Decipher,fo=H6.createDecipher,ko=H6.Decipheriv,Ao=H6.createDecipheriv,Go=H6.getCiphers,Vo=H6.listCiphers,So=H6.DiffieHellmanGroup,Mo=H6.createDiffieHellmanGroup,No=H6.getDiffieHellman,Co=H6.createDiffieHellman,Eo=H6.DiffieHellman,ho=H6.createSign,Ro=H6.Sign,Io=H6.createVerify,Do=H6.Verify,go=H6.createECDH,Lo=H6.publicEncrypt,bo=H6.privateEncrypt,uo=H6.publicDecrypt,yo=H6.privateDecrypt,po=H6.randomFill,xo=H6.randomFillSync,co=H6.createCredentials,mo=H6.constants,no=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];to=crypto,Bo=crypto});function hr($){if(!$||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test($))throw Error(`Invalid UUID format: ${$}`);return $}var uH;((O)=>{O.IMAGE="image";O.VIDEO="video";O.AUDIO="audio";O.DOCUMENT="document";O.LINK="link"})(uH||={});var ZM;((O)=>{O.DOCUMENT="document";O.FRAGMENT="fragment";O.MESSAGE="message";O.DESCRIPTION="description";O.CUSTOM="custom"})(ZM||={});var XM;((P)=>{P.OWNER="OWNER";P.ADMIN="ADMIN";P.NONE="NONE"})(XM||={});var l7;((G)=>{G.SELF="SELF";G.DM="DM";G.GROUP="GROUP";G.VOICE_DM="VOICE_DM";G.VOICE_GROUP="VOICE_GROUP";G.FEED="FEED";G.THREAD="THREAD";G.WORLD="WORLD";G.FORUM="FORUM";G.API="API"})(l7||={});var fM;((K)=>{K.ACTIVE="active";K.INACTIVE="inactive"})(fM||={});var Lr={TRANSCRIPTION:"transcription",VIDEO:"video",BROWSER:"browser",PDF:"pdf",REMOTE_FILES:"aws_s3",WEB_SEARCH:"web_search",EMAIL:"email",TEE:"tee",TASK:"task",WALLET:"wallet",LP_POOL:"lp_pool",TOKEN_DATA:"token_data",MESSAGE:"message",POST:"post",UNKNOWN:"unknown"};class KO{runtime;constructor($){if($)this.runtime=$}static serviceType;config;static async start($){throw Error("Not implemented")}static async stop($){throw Error("Not implemented")}}function br($,q){return $.getService(q)}function ur($,q="UNKNOWN_ERROR"){if($ instanceof Error)return{code:q,message:$.message,cause:$};return{code:q,message:String($)}}var Sq={SMALL:"TEXT_SMALL",MEDIUM:"TEXT_LARGE",LARGE:"TEXT_LARGE",TEXT_SMALL:"TEXT_SMALL",TEXT_LARGE:"TEXT_LARGE",TEXT_EMBEDDING:"TEXT_EMBEDDING",TEXT_TOKENIZER_ENCODE:"TEXT_TOKENIZER_ENCODE",TEXT_TOKENIZER_DECODE:"TEXT_TOKENIZER_DECODE",TEXT_REASONING_SMALL:"REASONING_SMALL",TEXT_REASONING_LARGE:"REASONING_LARGE",TEXT_COMPLETION:"TEXT_COMPLETION",IMAGE:"IMAGE",IMAGE_DESCRIPTION:"IMAGE_DESCRIPTION",TRANSCRIPTION:"TRANSCRIPTION",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",AUDIO:"AUDIO",VIDEO:"VIDEO",OBJECT_SMALL:"OBJECT_SMALL",OBJECT_LARGE:"OBJECT_LARGE"},r4={DEFAULT_MAX_TOKENS:"DEFAULT_MAX_TOKENS",DEFAULT_TEMPERATURE:"DEFAULT_TEMPERATURE",DEFAULT_FREQUENCY_PENALTY:"DEFAULT_FREQUENCY_PENALTY",DEFAULT_PRESENCE_PENALTY:"DEFAULT_PRESENCE_PENALTY",TEXT_SMALL_MAX_TOKENS:"TEXT_SMALL_MAX_TOKENS",TEXT_SMALL_TEMPERATURE:"TEXT_SMALL_TEMPERATURE",TEXT_SMALL_FREQUENCY_PENALTY:"TEXT_SMALL_FREQUENCY_PENALTY",TEXT_SMALL_PRESENCE_PENALTY:"TEXT_SMALL_PRESENCE_PENALTY",TEXT_LARGE_MAX_TOKENS:"TEXT_LARGE_MAX_TOKENS",TEXT_LARGE_TEMPERATURE:"TEXT_LARGE_TEMPERATURE",TEXT_LARGE_FREQUENCY_PENALTY:"TEXT_LARGE_FREQUENCY_PENALTY",TEXT_LARGE_PRESENCE_PENALTY:"TEXT_LARGE_PRESENCE_PENALTY",OBJECT_SMALL_MAX_TOKENS:"OBJECT_SMALL_MAX_TOKENS",OBJECT_SMALL_TEMPERATURE:"OBJECT_SMALL_TEMPERATURE",OBJECT_SMALL_FREQUENCY_PENALTY:"OBJECT_SMALL_FREQUENCY_PENALTY",OBJECT_SMALL_PRESENCE_PENALTY:"OBJECT_SMALL_PRESENCE_PENALTY",OBJECT_LARGE_MAX_TOKENS:"OBJECT_LARGE_MAX_TOKENS",OBJECT_LARGE_TEMPERATURE:"OBJECT_LARGE_TEMPERATURE",OBJECT_LARGE_FREQUENCY_PENALTY:"OBJECT_LARGE_FREQUENCY_PENALTY",OBJECT_LARGE_PRESENCE_PENALTY:"OBJECT_LARGE_PRESENCE_PENALTY",MODEL_MAX_TOKEN:"MODEL_MAX_TOKEN",MODEL_TEMPERATURE:"MODEL_TEMPERATURE",MODEL_FREQ_PENALTY:"MODEL_FREQ_PENALTY",MODEL_PRESENCE_PENALTY:"MODEL_PRESENCE_PENALTY"};var xr={SMALL:384,MEDIUM:512,LARGE:768,XL:1024,XXL:1536,XXXL:3072};var yH;((M)=>{M.WORLD_JOINED="WORLD_JOINED";M.WORLD_CONNECTED="WORLD_CONNECTED";M.WORLD_LEFT="WORLD_LEFT";M.ENTITY_JOINED="ENTITY_JOINED";M.ENTITY_LEFT="ENTITY_LEFT";M.ENTITY_UPDATED="ENTITY_UPDATED";M.ROOM_JOINED="ROOM_JOINED";M.ROOM_LEFT="ROOM_LEFT";M.MESSAGE_RECEIVED="MESSAGE_RECEIVED";M.MESSAGE_SENT="MESSAGE_SENT";M.MESSAGE_DELETED="MESSAGE_DELETED";M.CHANNEL_CLEARED="CHANNEL_CLEARED";M.VOICE_MESSAGE_RECEIVED="VOICE_MESSAGE_RECEIVED";M.VOICE_MESSAGE_SENT="VOICE_MESSAGE_SENT";M.REACTION_RECEIVED="REACTION_RECEIVED";M.POST_GENERATED="POST_GENERATED";M.INTERACTION_RECEIVED="INTERACTION_RECEIVED";M.RUN_STARTED="RUN_STARTED";M.RUN_ENDED="RUN_ENDED";M.RUN_TIMEOUT="RUN_TIMEOUT";M.ACTION_STARTED="ACTION_STARTED";M.ACTION_COMPLETED="ACTION_COMPLETED";M.EVALUATOR_STARTED="EVALUATOR_STARTED";M.EVALUATOR_COMPLETED="EVALUATOR_COMPLETED";M.MODEL_USED="MODEL_USED";M.EMBEDDING_GENERATION_REQUESTED="EMBEDDING_GENERATION_REQUESTED";M.EMBEDDING_GENERATION_COMPLETED="EMBEDDING_GENERATION_COMPLETED";M.EMBEDDING_GENERATION_FAILED="EMBEDDING_GENERATION_FAILED"})(yH||={});var kM;((P)=>{P.DISCORD="DISCORD";P.TELEGRAM="TELEGRAM";P.TWITTER="TWITTER"})(kM||={});var AM;((_)=>{_.OFF="OFF";_.LOCAL="LOCAL";_.DOCKER="DOCKER";_.PRODUCTION="PRODUCTION"})(AM||={});var GM;((q)=>q.TDX_DSTACK="tdx_dstack")(GM||={});var VM;((j)=>{j[j.ROOM_JOINING=1]="ROOM_JOINING";j[j.SEND_MESSAGE=2]="SEND_MESSAGE";j[j.MESSAGE=3]="MESSAGE";j[j.ACK=4]="ACK";j[j.THINKING=5]="THINKING";j[j.CONTROL=6]="CONTROL"})(VM||={});class _O{constructor($){Object.defineProperty(this,"pageContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pageContent=$.pageContent!==void 0?$.pageContent.toString():"",this.metadata=$.metadata??{},this.id=$.id}}var UK={};uq(UK,{void:()=>j0,util:()=>J6,unknown:()=>_0,union:()=>z0,undefined:()=>$0,tuple:()=>J0,transformer:()=>S0,symbol:()=>sM,string:()=>nH,strictObject:()=>v0,setErrorMap:()=>NM,set:()=>Z0,record:()=>T0,quotelessJson:()=>SM,promise:()=>V0,preprocess:()=>C0,pipeline:()=>E0,ostring:()=>h0,optional:()=>M0,onumber:()=>R0,oboolean:()=>I0,objectUtil:()=>PO,object:()=>Y0,number:()=>iH,nullable:()=>N0,null:()=>q0,never:()=>P0,nativeEnum:()=>G0,nan:()=>aM,map:()=>w0,makeIssue:()=>n4,literal:()=>k0,lazy:()=>f0,late:()=>UM,isValid:()=>AK,isDirty:()=>r7,isAsync:()=>R_,isAborted:()=>o7,intersection:()=>H0,instanceof:()=>FM,getParsedType:()=>h8,getErrorMap:()=>h_,function:()=>X0,enum:()=>A0,effect:()=>S0,discriminatedUnion:()=>W0,defaultErrorMap:()=>F8,datetimeRegex:()=>lH,date:()=>eM,custom:()=>rH,coerce:()=>D0,boolean:()=>tH,bigint:()=>QM,array:()=>O0,any:()=>K0,addIssueToContext:()=>n$,ZodVoid:()=>t4,ZodUnknown:()=>GK,ZodUnion:()=>u_,ZodUndefined:()=>L_,ZodType:()=>W6,ZodTuple:()=>I8,ZodTransformer:()=>G8,ZodSymbol:()=>i4,ZodString:()=>X8,ZodSet:()=>tK,ZodSchema:()=>W6,ZodRecord:()=>B4,ZodReadonly:()=>l_,ZodPromise:()=>BK,ZodPipeline:()=>a4,ZodParsedType:()=>r$,ZodOptional:()=>k8,ZodObject:()=>R6,ZodNumber:()=>VK,ZodNullable:()=>Q8,ZodNull:()=>b_,ZodNever:()=>R8,ZodNativeEnum:()=>c_,ZodNaN:()=>F4,ZodMap:()=>U4,ZodLiteral:()=>x_,ZodLazy:()=>p_,ZodIssueCode:()=>c$,ZodIntersection:()=>y_,ZodFunction:()=>D_,ZodFirstPartyTypeKind:()=>e$,ZodError:()=>yq,ZodEnum:()=>MK,ZodEffects:()=>G8,ZodDiscriminatedUnion:()=>n7,ZodDefault:()=>m_,ZodDate:()=>nK,ZodCatch:()=>d_,ZodBranded:()=>i7,ZodBoolean:()=>g_,ZodBigInt:()=>SK,ZodArray:()=>f8,ZodAny:()=>iK,Schema:()=>W6,ParseStatus:()=>Hq,OK:()=>Mq,NEVER:()=>g0,INVALID:()=>Q$,EMPTY_PATH:()=>CM,DIRTY:()=>rK,BRAND:()=>BM});var J6;(function($){$.assertEqual=(_)=>{};function q(_){}$.assertIs=q;function K(_){throw Error()}$.assertNever=K,$.arrayToEnum=(_)=>{let O={};for(let j of _)O[j]=j;return O},$.getValidEnumValues=(_)=>{let O=$.objectKeys(_).filter((z)=>typeof _[_[z]]!=="number"),j={};for(let z of O)j[z]=_[z];return $.objectValues(j)},$.objectValues=(_)=>{return $.objectKeys(_).map(function(O){return _[O]})},$.objectKeys=typeof Object.keys==="function"?(_)=>Object.keys(_):(_)=>{let O=[];for(let j in _)if(Object.prototype.hasOwnProperty.call(_,j))O.push(j);return O},$.find=(_,O)=>{for(let j of _)if(O(j))return j;return},$.isInteger=typeof Number.isInteger==="function"?(_)=>Number.isInteger(_):(_)=>typeof _==="number"&&Number.isFinite(_)&&Math.floor(_)===_;function P(_,O=" | "){return _.map((j)=>typeof j==="string"?`'${j}'`:j).join(O)}$.joinValues=P,$.jsonStringifyReplacer=(_,O)=>{if(typeof O==="bigint")return O.toString();return O}})(J6||(J6={}));var PO;(function($){$.mergeShapes=(q,K)=>{return{...q,...K}}})(PO||(PO={}));var r$=J6.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),h8=($)=>{switch(typeof $){case"undefined":return r$.undefined;case"string":return r$.string;case"number":return Number.isNaN($)?r$.nan:r$.number;case"boolean":return r$.boolean;case"function":return r$.function;case"bigint":return r$.bigint;case"symbol":return r$.symbol;case"object":if(Array.isArray($))return r$.array;if($===null)return r$.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return r$.promise;if(typeof Map<"u"&&$ instanceof Map)return r$.map;if(typeof Set<"u"&&$ instanceof Set)return r$.set;if(typeof Date<"u"&&$ instanceof Date)return r$.date;return r$.object;default:return r$.unknown}};var c$=J6.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),SM=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class yq extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(K)=>{this.issues=[...this.issues,K]},this.addIssues=(K=[])=>{this.issues=[...this.issues,...K]};let q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,q);else this.__proto__=q;this.name="ZodError",this.issues=$}format($){let q=$||function(_){return _.message},K={_errors:[]},P=(_)=>{for(let O of _.issues)if(O.code==="invalid_union")O.unionErrors.map(P);else if(O.code==="invalid_return_type")P(O.returnTypeError);else if(O.code==="invalid_arguments")P(O.argumentsError);else if(O.path.length===0)K._errors.push(q(O));else{let j=K,z=0;while(z<O.path.length){let J=O.path[z];if(z!==O.path.length-1)j[J]=j[J]||{_errors:[]};else j[J]=j[J]||{_errors:[]},j[J]._errors.push(q(O));j=j[J],z++}}};return P(this),K}static assert($){if(!($ instanceof yq))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,J6.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(q)=>q.message){let q={},K=[];for(let P of this.issues)if(P.path.length>0){let _=P.path[0];q[_]=q[_]||[],q[_].push($(P))}else K.push($(P));return{formErrors:K,fieldErrors:q}}get formErrors(){return this.flatten()}}yq.create=($)=>{return new yq($)};var MM=($,q)=>{let K;switch($.code){case c$.invalid_type:if($.received===r$.undefined)K="Required";else K=`Expected ${$.expected}, received ${$.received}`;break;case c$.invalid_literal:K=`Invalid literal value, expected ${JSON.stringify($.expected,J6.jsonStringifyReplacer)}`;break;case c$.unrecognized_keys:K=`Unrecognized key(s) in object: ${J6.joinValues($.keys,", ")}`;break;case c$.invalid_union:K="Invalid input";break;case c$.invalid_union_discriminator:K=`Invalid discriminator value. Expected ${J6.joinValues($.options)}`;break;case c$.invalid_enum_value:K=`Invalid enum value. Expected ${J6.joinValues($.options)}, received '${$.received}'`;break;case c$.invalid_arguments:K="Invalid function arguments";break;case c$.invalid_return_type:K="Invalid function return type";break;case c$.invalid_date:K="Invalid date";break;case c$.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(K=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")K=`${K} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)K=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)K=`Invalid input: must end with "${$.validation.endsWith}"`;else J6.assertNever($.validation);else if($.validation!=="regex")K=`Invalid ${$.validation}`;else K="Invalid";break;case c$.too_small:if($.type==="array")K=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")K=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")K=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")K=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")K=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else K="Invalid input";break;case c$.too_big:if($.type==="array")K=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")K=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")K=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")K=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")K=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else K="Invalid input";break;case c$.custom:K="Invalid input";break;case c$.invalid_intersection_types:K="Intersection results could not be merged";break;case c$.not_multiple_of:K=`Number must be a multiple of ${$.multipleOf}`;break;case c$.not_finite:K="Number must be finite";break;default:K=q.defaultError,J6.assertNever($)}return{message:K}},F8=MM;var pH=F8;function NM($){pH=$}function h_(){return pH}var n4=($)=>{let{data:q,path:K,errorMaps:P,issueData:_}=$,O=[...K,..._.path||[]],j={..._,path:O};if(_.message!==void 0)return{..._,path:O,message:_.message};let z="",J=P.filter((w)=>!!w).slice().reverse();for(let w of J)z=w(j,{data:q,defaultError:z}).message;return{..._,path:O,message:z}},CM=[];function n$($,q){let K=h_(),P=n4({issueData:q,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,K,K===F8?void 0:F8].filter((_)=>!!_)});$.common.issues.push(P)}class Hq{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,q){let K=[];for(let P of q){if(P.status==="aborted")return Q$;if(P.status==="dirty")$.dirty();K.push(P.value)}return{status:$.value,value:K}}static async mergeObjectAsync($,q){let K=[];for(let P of q){let _=await P.key,O=await P.value;K.push({key:_,value:O})}return Hq.mergeObjectSync($,K)}static mergeObjectSync($,q){let K={};for(let P of q){let{key:_,value:O}=P;if(_.status==="aborted")return Q$;if(O.status==="aborted")return Q$;if(_.status==="dirty")$.dirty();if(O.status==="dirty")$.dirty();if(_.value!=="__proto__"&&(typeof O.value<"u"||P.alwaysSet))K[_.value]=O.value}return{status:$.value,value:K}}}var Q$=Object.freeze({status:"aborted"}),rK=($)=>({status:"dirty",value:$}),Mq=($)=>({status:"valid",value:$}),o7=($)=>$.status==="aborted",r7=($)=>$.status==="dirty",AK=($)=>$.status==="valid",R_=($)=>typeof Promise<"u"&&$ instanceof Promise;var F$;(function($){$.errToObj=(q)=>typeof q==="string"?{message:q}:q||{},$.toString=(q)=>typeof q==="string"?q:q?.message})(F$||(F$={}));class A8{constructor($,q,K,P){this._cachedPath=[],this.parent=$,this.data=q,this._path=K,this._key=P}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var xH=($,q)=>{if(AK(q))return{success:!0,data:q.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let K=new yq($.common.issues);return this._error=K,this._error}}}};function Y6($){if(!$)return{};let{errorMap:q,invalid_type_error:K,required_error:P,description:_}=$;if(q&&(K||P))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(q)return{errorMap:q,description:_};return{errorMap:(j,z)=>{let{message:J}=$;if(j.code==="invalid_enum_value")return{message:J??z.defaultError};if(typeof z.data>"u")return{message:J??P??z.defaultError};if(j.code!=="invalid_type")return{message:z.defaultError};return{message:J??K??z.defaultError}},description:_}}class W6{get description(){return this._def.description}_getType($){return h8($.data)}_getOrReturnCtx($,q){return q||{common:$.parent.common,data:$.data,parsedType:h8($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new Hq,ctx:{common:$.parent.common,data:$.data,parsedType:h8($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let q=this._parse($);if(R_(q))throw Error("Synchronous parse encountered promise.");return q}_parseAsync($){let q=this._parse($);return Promise.resolve(q)}parse($,q){let K=this.safeParse($,q);if(K.success)return K.data;throw K.error}safeParse($,q){let K={common:{issues:[],async:q?.async??!1,contextualErrorMap:q?.errorMap},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:h8($)},P=this._parseSync({data:$,path:K.path,parent:K});return xH(K,P)}"~validate"($){let q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:h8($)};if(!this["~standard"].async)try{let K=this._parseSync({data:$,path:[],parent:q});return AK(K)?{value:K.value}:{issues:q.common.issues}}catch(K){if(K?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;q.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:q}).then((K)=>AK(K)?{value:K.value}:{issues:q.common.issues})}async parseAsync($,q){let K=await this.safeParseAsync($,q);if(K.success)return K.data;throw K.error}async safeParseAsync($,q){let K={common:{issues:[],contextualErrorMap:q?.errorMap,async:!0},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:h8($)},P=this._parse({data:$,path:K.path,parent:K}),_=await(R_(P)?P:Promise.resolve(P));return xH(K,_)}refine($,q){let K=(P)=>{if(typeof q==="string"||typeof q>"u")return{message:q};else if(typeof q==="function")return q(P);else return q};return this._refinement((P,_)=>{let O=$(P),j=()=>_.addIssue({code:c$.custom,...K(P)});if(typeof Promise<"u"&&O instanceof Promise)return O.then((z)=>{if(!z)return j(),!1;else return!0});if(!O)return j(),!1;else return!0})}refinement($,q){return this._refinement((K,P)=>{if(!$(K))return P.addIssue(typeof q==="function"?q(K,P):q),!1;else return!0})}_refinement($){return new G8({schema:this,typeName:e$.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(q)=>this["~validate"](q)}}optional(){return k8.create(this,this._def)}nullable(){return Q8.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return f8.create(this)}promise(){return BK.create(this,this._def)}or($){return u_.create([this,$],this._def)}and($){return y_.create(this,$,this._def)}transform($){return new G8({...Y6(this._def),schema:this,typeName:e$.ZodEffects,effect:{type:"transform",transform:$}})}default($){let q=typeof $==="function"?$:()=>$;return new m_({...Y6(this._def),innerType:this,defaultValue:q,typeName:e$.ZodDefault})}brand(){return new i7({typeName:e$.ZodBranded,type:this,...Y6(this._def)})}catch($){let q=typeof $==="function"?$:()=>$;return new d_({...Y6(this._def),innerType:this,catchValue:q,typeName:e$.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return a4.create(this,$)}readonly(){return l_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var EM=/^c[^\s-]{8,}$/i,hM=/^[0-9a-z]+$/,RM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,IM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,DM=/^[a-z0-9_-]{21}$/i,gM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LM=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",jO,yM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mH="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",lM=new RegExp(`^${mH}$`);function dH($){let q="[0-5]\\d";if($.precision)q=`${q}\\.\\d{${$.precision}}`;else if($.precision==null)q=`${q}(\\.\\d+)?`;let K=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${q})${K}`}function oM($){return new RegExp(`^${dH($)}$`)}function lH($){let q=`${mH}T${dH($)}`,K=[];if(K.push($.local?"Z?":"Z"),$.offset)K.push("([+-]\\d{2}:?\\d{2})");return q=`${q}(${K.join("|")})`,new RegExp(`^${q}$`)}function rM($,q){if((q==="v4"||!q)&&yM.test($))return!0;if((q==="v6"||!q)&&xM.test($))return!0;return!1}function nM($,q){if(!gM.test($))return!1;try{let[K]=$.split(".");if(!K)return!1;let P=K.replace(/-/g,"+").replace(/_/g,"/").padEnd(K.length+(4-K.length%4)%4,"="),_=JSON.parse(atob(P));if(typeof _!=="object"||_===null)return!1;if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(q&&_.alg!==q)return!1;return!0}catch{return!1}}function iM($,q){if((q==="v4"||!q)&&pM.test($))return!0;if((q==="v6"||!q)&&cM.test($))return!0;return!1}class X8 extends W6{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==r$.string){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_type,expected:r$.string,received:_.parsedType}),Q$}let K=new Hq,P=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.length<_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),K.dirty()}else if(_.kind==="max"){if($.data.length>_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),K.dirty()}else if(_.kind==="length"){let O=$.data.length>_.value,j=$.data.length<_.value;if(O||j){if(P=this._getOrReturnCtx($,P),O)n$(P,{code:c$.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});else if(j)n$(P,{code:c$.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});K.dirty()}}else if(_.kind==="email"){if(!bM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"email",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="emoji"){if(!jO)jO=new RegExp(uM,"u");if(!jO.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"emoji",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="uuid"){if(!IM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"uuid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="nanoid"){if(!DM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"nanoid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="cuid"){if(!EM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"cuid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="cuid2"){if(!hM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"cuid2",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="ulid"){if(!RM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"ulid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="url")try{new URL($.data)}catch{P=this._getOrReturnCtx($,P),n$(P,{validation:"url",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="regex"){if(_.regex.lastIndex=0,!_.regex.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"regex",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="trim")$.data=$.data.trim();else if(_.kind==="includes"){if(!$.data.includes(_.value,_.position))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),K.dirty()}else if(_.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(_.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(_.kind==="startsWith"){if(!$.data.startsWith(_.value))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:{startsWith:_.value},message:_.message}),K.dirty()}else if(_.kind==="endsWith"){if(!$.data.endsWith(_.value))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:{endsWith:_.value},message:_.message}),K.dirty()}else if(_.kind==="datetime"){if(!lH(_).test($.data))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:"datetime",message:_.message}),K.dirty()}else if(_.kind==="date"){if(!lM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:"date",message:_.message}),K.dirty()}else if(_.kind==="time"){if(!oM(_).test($.data))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:"time",message:_.message}),K.dirty()}else if(_.kind==="duration"){if(!LM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"duration",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="ip"){if(!rM($.data,_.version))P=this._getOrReturnCtx($,P),n$(P,{validation:"ip",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="jwt"){if(!nM($.data,_.alg))P=this._getOrReturnCtx($,P),n$(P,{validation:"jwt",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="cidr"){if(!iM($.data,_.version))P=this._getOrReturnCtx($,P),n$(P,{validation:"cidr",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="base64"){if(!mM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"base64",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="base64url"){if(!dM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"base64url",code:c$.invalid_string,message:_.message}),K.dirty()}else J6.assertNever(_);return{status:K.value,value:$.data}}_regex($,q,K){return this.refinement((P)=>$.test(P),{validation:q,code:c$.invalid_string,...F$.errToObj(K)})}_addCheck($){return new X8({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...F$.errToObj($)})}url($){return this._addCheck({kind:"url",...F$.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...F$.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...F$.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...F$.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...F$.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...F$.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...F$.errToObj($)})}base64($){return this._addCheck({kind:"base64",...F$.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...F$.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...F$.errToObj($)})}ip($){return this._addCheck({kind:"ip",...F$.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...F$.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...F$.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...F$.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...F$.errToObj($)})}regex($,q){return this._addCheck({kind:"regex",regex:$,...F$.errToObj(q)})}includes($,q){return this._addCheck({kind:"includes",value:$,position:q?.position,...F$.errToObj(q?.message)})}startsWith($,q){return this._addCheck({kind:"startsWith",value:$,...F$.errToObj(q)})}endsWith($,q){return this._addCheck({kind:"endsWith",value:$,...F$.errToObj(q)})}min($,q){return this._addCheck({kind:"min",value:$,...F$.errToObj(q)})}max($,q){return this._addCheck({kind:"max",value:$,...F$.errToObj(q)})}length($,q){return this._addCheck({kind:"length",value:$,...F$.errToObj(q)})}nonempty($){return this.min(1,F$.errToObj($))}trim(){return new X8({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new X8({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new X8({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxLength(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}X8.create=($)=>{return new X8({checks:[],typeName:e$.ZodString,coerce:$?.coerce??!1,...Y6($)})};function tM($,q){let K=($.toString().split(".")[1]||"").length,P=(q.toString().split(".")[1]||"").length,_=K>P?K:P,O=Number.parseInt($.toFixed(_).replace(".","")),j=Number.parseInt(q.toFixed(_).replace(".",""));return O%j/10**_}class VK extends W6{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==r$.number){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_type,expected:r$.number,received:_.parsedType}),Q$}let K=void 0,P=new Hq;for(let _ of this._def.checks)if(_.kind==="int"){if(!J6.isInteger($.data))K=this._getOrReturnCtx($,K),n$(K,{code:c$.invalid_type,expected:"integer",received:"float",message:_.message}),P.dirty()}else if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),P.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),P.dirty()}else if(_.kind==="multipleOf"){if(tM($.data,_.value)!==0)K=this._getOrReturnCtx($,K),n$(K,{code:c$.not_multiple_of,multipleOf:_.value,message:_.message}),P.dirty()}else if(_.kind==="finite"){if(!Number.isFinite($.data))K=this._getOrReturnCtx($,K),n$(K,{code:c$.not_finite,message:_.message}),P.dirty()}else J6.assertNever(_);return{status:P.value,value:$.data}}gte($,q){return this.setLimit("min",$,!0,F$.toString(q))}gt($,q){return this.setLimit("min",$,!1,F$.toString(q))}lte($,q){return this.setLimit("max",$,!0,F$.toString(q))}lt($,q){return this.setLimit("max",$,!1,F$.toString(q))}setLimit($,q,K,P){return new VK({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:K,message:F$.toString(P)}]})}_addCheck($){return new VK({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:F$.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F$.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F$.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F$.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F$.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:F$.toString(q)})}finite($){return this._addCheck({kind:"finite",message:F$.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F$.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F$.toString($)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&J6.isInteger($.value))}get isFinite(){let $=null,q=null;for(let K of this._def.checks)if(K.kind==="finite"||K.kind==="int"||K.kind==="multipleOf")return!0;else if(K.kind==="min"){if(q===null||K.value>q)q=K.value}else if(K.kind==="max"){if($===null||K.value<$)$=K.value}return Number.isFinite(q)&&Number.isFinite($)}}VK.create=($)=>{return new VK({checks:[],typeName:e$.ZodNumber,coerce:$?.coerce||!1,...Y6($)})};class SK extends W6{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==r$.bigint)return this._getInvalidInput($);let K=void 0,P=new Hq;for(let _ of this._def.checks)if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),P.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),P.dirty()}else if(_.kind==="multipleOf"){if($.data%_.value!==BigInt(0))K=this._getOrReturnCtx($,K),n$(K,{code:c$.not_multiple_of,multipleOf:_.value,message:_.message}),P.dirty()}else J6.assertNever(_);return{status:P.value,value:$.data}}_getInvalidInput($){let q=this._getOrReturnCtx($);return n$(q,{code:c$.invalid_type,expected:r$.bigint,received:q.parsedType}),Q$}gte($,q){return this.setLimit("min",$,!0,F$.toString(q))}gt($,q){return this.setLimit("min",$,!1,F$.toString(q))}lte($,q){return this.setLimit("max",$,!0,F$.toString(q))}lt($,q){return this.setLimit("max",$,!1,F$.toString(q))}setLimit($,q,K,P){return new SK({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:K,message:F$.toString(P)}]})}_addCheck($){return new SK({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F$.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F$.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F$.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F$.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:F$.toString(q)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}SK.create=($)=>{return new SK({checks:[],typeName:e$.ZodBigInt,coerce:$?.coerce??!1,...Y6($)})};class g_ extends W6{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==r$.boolean){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.boolean,received:K.parsedType}),Q$}return Mq($.data)}}g_.create=($)=>{return new g_({typeName:e$.ZodBoolean,coerce:$?.coerce||!1,...Y6($)})};class nK extends W6{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==r$.date){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_type,expected:r$.date,received:_.parsedType}),Q$}if(Number.isNaN($.data.getTime())){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_date}),Q$}let K=new Hq,P=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.getTime()<_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),K.dirty()}else if(_.kind==="max"){if($.data.getTime()>_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),K.dirty()}else J6.assertNever(_);return{status:K.value,value:new Date($.data.getTime())}}_addCheck($){return new nK({...this._def,checks:[...this._def.checks,$]})}min($,q){return this._addCheck({kind:"min",value:$.getTime(),message:F$.toString(q)})}max($,q){return this._addCheck({kind:"max",value:$.getTime(),message:F$.toString(q)})}get minDate(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $!=null?new Date($):null}}nK.create=($)=>{return new nK({checks:[],coerce:$?.coerce||!1,typeName:e$.ZodDate,...Y6($)})};class i4 extends W6{_parse($){if(this._getType($)!==r$.symbol){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.symbol,received:K.parsedType}),Q$}return Mq($.data)}}i4.create=($)=>{return new i4({typeName:e$.ZodSymbol,...Y6($)})};class L_ extends W6{_parse($){if(this._getType($)!==r$.undefined){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.undefined,received:K.parsedType}),Q$}return Mq($.data)}}L_.create=($)=>{return new L_({typeName:e$.ZodUndefined,...Y6($)})};class b_ extends W6{_parse($){if(this._getType($)!==r$.null){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.null,received:K.parsedType}),Q$}return Mq($.data)}}b_.create=($)=>{return new b_({typeName:e$.ZodNull,...Y6($)})};class iK extends W6{constructor(){super(...arguments);this._any=!0}_parse($){return Mq($.data)}}iK.create=($)=>{return new iK({typeName:e$.ZodAny,...Y6($)})};class GK extends W6{constructor(){super(...arguments);this._unknown=!0}_parse($){return Mq($.data)}}GK.create=($)=>{return new GK({typeName:e$.ZodUnknown,...Y6($)})};class R8 extends W6{_parse($){let q=this._getOrReturnCtx($);return n$(q,{code:c$.invalid_type,expected:r$.never,received:q.parsedType}),Q$}}R8.create=($)=>{return new R8({typeName:e$.ZodNever,...Y6($)})};class t4 extends W6{_parse($){if(this._getType($)!==r$.undefined){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.void,received:K.parsedType}),Q$}return Mq($.data)}}t4.create=($)=>{return new t4({typeName:e$.ZodVoid,...Y6($)})};class f8 extends W6{_parse($){let{ctx:q,status:K}=this._processInputParams($),P=this._def;if(q.parsedType!==r$.array)return n$(q,{code:c$.invalid_type,expected:r$.array,received:q.parsedType}),Q$;if(P.exactLength!==null){let O=q.data.length>P.exactLength.value,j=q.data.length<P.exactLength.value;if(O||j)n$(q,{code:O?c$.too_big:c$.too_small,minimum:j?P.exactLength.value:void 0,maximum:O?P.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:P.exactLength.message}),K.dirty()}if(P.minLength!==null){if(q.data.length<P.minLength.value)n$(q,{code:c$.too_small,minimum:P.minLength.value,type:"array",inclusive:!0,exact:!1,message:P.minLength.message}),K.dirty()}if(P.maxLength!==null){if(q.data.length>P.maxLength.value)n$(q,{code:c$.too_big,maximum:P.maxLength.value,type:"array",inclusive:!0,exact:!1,message:P.maxLength.message}),K.dirty()}if(q.common.async)return Promise.all([...q.data].map((O,j)=>{return P.type._parseAsync(new A8(q,O,q.path,j))})).then((O)=>{return Hq.mergeArray(K,O)});let _=[...q.data].map((O,j)=>{return P.type._parseSync(new A8(q,O,q.path,j))});return Hq.mergeArray(K,_)}get element(){return this._def.type}min($,q){return new f8({...this._def,minLength:{value:$,message:F$.toString(q)}})}max($,q){return new f8({...this._def,maxLength:{value:$,message:F$.toString(q)}})}length($,q){return new f8({...this._def,exactLength:{value:$,message:F$.toString(q)}})}nonempty($){return this.min(1,$)}}f8.create=($,q)=>{return new f8({type:$,minLength:null,maxLength:null,exactLength:null,typeName:e$.ZodArray,...Y6(q)})};function I_($){if($ instanceof R6){let q={};for(let K in $.shape){let P=$.shape[K];q[K]=k8.create(I_(P))}return new R6({...$._def,shape:()=>q})}else if($ instanceof f8)return new f8({...$._def,type:I_($.element)});else if($ instanceof k8)return k8.create(I_($.unwrap()));else if($ instanceof Q8)return Q8.create(I_($.unwrap()));else if($ instanceof I8)return I8.create($.items.map((q)=>I_(q)));else return $}class R6 extends W6{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),q=J6.objectKeys($);return this._cached={shape:$,keys:q},this._cached}_parse($){if(this._getType($)!==r$.object){let J=this._getOrReturnCtx($);return n$(J,{code:c$.invalid_type,expected:r$.object,received:J.parsedType}),Q$}let{status:K,ctx:P}=this._processInputParams($),{shape:_,keys:O}=this._getCached(),j=[];if(!(this._def.catchall instanceof R8&&this._def.unknownKeys==="strip")){for(let J in P.data)if(!O.includes(J))j.push(J)}let z=[];for(let J of O){let w=_[J],G=P.data[J];z.push({key:{status:"valid",value:J},value:w._parse(new A8(P,G,P.path,J)),alwaysSet:J in P.data})}if(this._def.catchall instanceof R8){let J=this._def.unknownKeys;if(J==="passthrough")for(let w of j)z.push({key:{status:"valid",value:w},value:{status:"valid",value:P.data[w]}});else if(J==="strict"){if(j.length>0)n$(P,{code:c$.unrecognized_keys,keys:j}),K.dirty()}else if(J==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let J=this._def.catchall;for(let w of j){let G=P.data[w];z.push({key:{status:"valid",value:w},value:J._parse(new A8(P,G,P.path,w)),alwaysSet:w in P.data})}}if(P.common.async)return Promise.resolve().then(async()=>{let J=[];for(let w of z){let G=await w.key,f=await w.value;J.push({key:G,value:f,alwaysSet:w.alwaysSet})}return J}).then((J)=>{return Hq.mergeObjectSync(K,J)});else return Hq.mergeObjectSync(K,z)}get shape(){return this._def.shape()}strict($){return F$.errToObj,new R6({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(q,K)=>{let P=this._def.errorMap?.(q,K).message??K.defaultError;if(q.code==="unrecognized_keys")return{message:F$.errToObj($).message??P};return{message:P}}}:{}})}strip(){return new R6({...this._def,unknownKeys:"strip"})}passthrough(){return new R6({...this._def,unknownKeys:"passthrough"})}extend($){return new R6({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new R6({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:e$.ZodObject})}setKey($,q){return this.augment({[$]:q})}catchall($){return new R6({...this._def,catchall:$})}pick($){let q={};for(let K of J6.objectKeys($))if($[K]&&this.shape[K])q[K]=this.shape[K];return new R6({...this._def,shape:()=>q})}omit($){let q={};for(let K of J6.objectKeys(this.shape))if(!$[K])q[K]=this.shape[K];return new R6({...this._def,shape:()=>q})}deepPartial(){return I_(this)}partial($){let q={};for(let K of J6.objectKeys(this.shape)){let P=this.shape[K];if($&&!$[K])q[K]=P;else q[K]=P.optional()}return new R6({...this._def,shape:()=>q})}required($){let q={};for(let K of J6.objectKeys(this.shape))if($&&!$[K])q[K]=this.shape[K];else{let _=this.shape[K];while(_ instanceof k8)_=_._def.innerType;q[K]=_}return new R6({...this._def,shape:()=>q})}keyof(){return oH(J6.objectKeys(this.shape))}}R6.create=($,q)=>{return new R6({shape:()=>$,unknownKeys:"strip",catchall:R8.create(),typeName:e$.ZodObject,...Y6(q)})};R6.strictCreate=($,q)=>{return new R6({shape:()=>$,unknownKeys:"strict",catchall:R8.create(),typeName:e$.ZodObject,...Y6(q)})};R6.lazycreate=($,q)=>{return new R6({shape:$,unknownKeys:"strip",catchall:R8.create(),typeName:e$.ZodObject,...Y6(q)})};class u_ extends W6{_parse($){let{ctx:q}=this._processInputParams($),K=this._def.options;function P(_){for(let j of _)if(j.result.status==="valid")return j.result;for(let j of _)if(j.result.status==="dirty")return q.common.issues.push(...j.ctx.common.issues),j.result;let O=_.map((j)=>new yq(j.ctx.common.issues));return n$(q,{code:c$.invalid_union,unionErrors:O}),Q$}if(q.common.async)return Promise.all(K.map(async(_)=>{let O={...q,common:{...q.common,issues:[]},parent:null};return{result:await _._parseAsync({data:q.data,path:q.path,parent:O}),ctx:O}})).then(P);else{let _=void 0,O=[];for(let z of K){let J={...q,common:{...q.common,issues:[]},parent:null},w=z._parseSync({data:q.data,path:q.path,parent:J});if(w.status==="valid")return w;else if(w.status==="dirty"&&!_)_={result:w,ctx:J};if(J.common.issues.length)O.push(J.common.issues)}if(_)return q.common.issues.push(..._.ctx.common.issues),_.result;let j=O.map((z)=>new yq(z));return n$(q,{code:c$.invalid_union,unionErrors:j}),Q$}}get options(){return this._def.options}}u_.create=($,q)=>{return new u_({options:$,typeName:e$.ZodUnion,...Y6(q)})};var a8=($)=>{if($ instanceof p_)return a8($.schema);else if($ instanceof G8)return a8($.innerType());else if($ instanceof x_)return[$.value];else if($ instanceof MK)return $.options;else if($ instanceof c_)return J6.objectValues($.enum);else if($ instanceof m_)return a8($._def.innerType);else if($ instanceof L_)return[void 0];else if($ instanceof b_)return[null];else if($ instanceof k8)return[void 0,...a8($.unwrap())];else if($ instanceof Q8)return[null,...a8($.unwrap())];else if($ instanceof i7)return a8($.unwrap());else if($ instanceof l_)return a8($.unwrap());else if($ instanceof d_)return a8($._def.innerType);else return[]};class n7 extends W6{_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==r$.object)return n$(q,{code:c$.invalid_type,expected:r$.object,received:q.parsedType}),Q$;let K=this.discriminator,P=q.data[K],_=this.optionsMap.get(P);if(!_)return n$(q,{code:c$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[K]}),Q$;if(q.common.async)return _._parseAsync({data:q.data,path:q.path,parent:q});else return _._parseSync({data:q.data,path:q.path,parent:q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,q,K){let P=new Map;for(let _ of q){let O=a8(_.shape[$]);if(!O.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let j of O){if(P.has(j))throw Error(`Discriminator property ${String($)} has duplicate value ${String(j)}`);P.set(j,_)}}return new n7({typeName:e$.ZodDiscriminatedUnion,discriminator:$,options:q,optionsMap:P,...Y6(K)})}}function OO($,q){let K=h8($),P=h8(q);if($===q)return{valid:!0,data:$};else if(K===r$.object&&P===r$.object){let _=J6.objectKeys(q),O=J6.objectKeys($).filter((z)=>_.indexOf(z)!==-1),j={...$,...q};for(let z of O){let J=OO($[z],q[z]);if(!J.valid)return{valid:!1};j[z]=J.data}return{valid:!0,data:j}}else if(K===r$.array&&P===r$.array){if($.length!==q.length)return{valid:!1};let _=[];for(let O=0;O<$.length;O++){let j=$[O],z=q[O],J=OO(j,z);if(!J.valid)return{valid:!1};_.push(J.data)}return{valid:!0,data:_}}else if(K===r$.date&&P===r$.date&&+$===+q)return{valid:!0,data:$};else return{valid:!1}}class y_ extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($),P=(_,O)=>{if(o7(_)||o7(O))return Q$;let j=OO(_.value,O.value);if(!j.valid)return n$(K,{code:c$.invalid_intersection_types}),Q$;if(r7(_)||r7(O))q.dirty();return{status:q.value,value:j.data}};if(K.common.async)return Promise.all([this._def.left._parseAsync({data:K.data,path:K.path,parent:K}),this._def.right._parseAsync({data:K.data,path:K.path,parent:K})]).then(([_,O])=>P(_,O));else return P(this._def.left._parseSync({data:K.data,path:K.path,parent:K}),this._def.right._parseSync({data:K.data,path:K.path,parent:K}))}}y_.create=($,q,K)=>{return new y_({left:$,right:q,typeName:e$.ZodIntersection,...Y6(K)})};class I8 extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.array)return n$(K,{code:c$.invalid_type,expected:r$.array,received:K.parsedType}),Q$;if(K.data.length<this._def.items.length)return n$(K,{code:c$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q$;if(!this._def.rest&&K.data.length>this._def.items.length)n$(K,{code:c$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q.dirty();let _=[...K.data].map((O,j)=>{let z=this._def.items[j]||this._def.rest;if(!z)return null;return z._parse(new A8(K,O,K.path,j))}).filter((O)=>!!O);if(K.common.async)return Promise.all(_).then((O)=>{return Hq.mergeArray(q,O)});else return Hq.mergeArray(q,_)}get items(){return this._def.items}rest($){return new I8({...this._def,rest:$})}}I8.create=($,q)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new I8({items:$,typeName:e$.ZodTuple,rest:null,...Y6(q)})};class B4 extends W6{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.object)return n$(K,{code:c$.invalid_type,expected:r$.object,received:K.parsedType}),Q$;let P=[],_=this._def.keyType,O=this._def.valueType;for(let j in K.data)P.push({key:_._parse(new A8(K,j,K.path,j)),value:O._parse(new A8(K,K.data[j],K.path,j)),alwaysSet:j in K.data});if(K.common.async)return Hq.mergeObjectAsync(q,P);else return Hq.mergeObjectSync(q,P)}get element(){return this._def.valueType}static create($,q,K){if(q instanceof W6)return new B4({keyType:$,valueType:q,typeName:e$.ZodRecord,...Y6(K)});return new B4({keyType:X8.create(),valueType:$,typeName:e$.ZodRecord,...Y6(q)})}}class U4 extends W6{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.map)return n$(K,{code:c$.invalid_type,expected:r$.map,received:K.parsedType}),Q$;let P=this._def.keyType,_=this._def.valueType,O=[...K.data.entries()].map(([j,z],J)=>{return{key:P._parse(new A8(K,j,K.path,[J,"key"])),value:_._parse(new A8(K,z,K.path,[J,"value"]))}});if(K.common.async){let j=new Map;return Promise.resolve().then(async()=>{for(let z of O){let J=await z.key,w=await z.value;if(J.status==="aborted"||w.status==="aborted")return Q$;if(J.status==="dirty"||w.status==="dirty")q.dirty();j.set(J.value,w.value)}return{status:q.value,value:j}})}else{let j=new Map;for(let z of O){let{key:J,value:w}=z;if(J.status==="aborted"||w.status==="aborted")return Q$;if(J.status==="dirty"||w.status==="dirty")q.dirty();j.set(J.value,w.value)}return{status:q.value,value:j}}}}U4.create=($,q,K)=>{return new U4({valueType:q,keyType:$,typeName:e$.ZodMap,...Y6(K)})};class tK extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.set)return n$(K,{code:c$.invalid_type,expected:r$.set,received:K.parsedType}),Q$;let P=this._def;if(P.minSize!==null){if(K.data.size<P.minSize.value)n$(K,{code:c$.too_small,minimum:P.minSize.value,type:"set",inclusive:!0,exact:!1,message:P.minSize.message}),q.dirty()}if(P.maxSize!==null){if(K.data.size>P.maxSize.value)n$(K,{code:c$.too_big,maximum:P.maxSize.value,type:"set",inclusive:!0,exact:!1,message:P.maxSize.message}),q.dirty()}let _=this._def.valueType;function O(z){let J=new Set;for(let w of z){if(w.status==="aborted")return Q$;if(w.status==="dirty")q.dirty();J.add(w.value)}return{status:q.value,value:J}}let j=[...K.data.values()].map((z,J)=>_._parse(new A8(K,z,K.path,J)));if(K.common.async)return Promise.all(j).then((z)=>O(z));else return O(j)}min($,q){return new tK({...this._def,minSize:{value:$,message:F$.toString(q)}})}max($,q){return new tK({...this._def,maxSize:{value:$,message:F$.toString(q)}})}size($,q){return this.min($,q).max($,q)}nonempty($){return this.min(1,$)}}tK.create=($,q)=>{return new tK({valueType:$,minSize:null,maxSize:null,typeName:e$.ZodSet,...Y6(q)})};class D_ extends W6{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==r$.function)return n$(q,{code:c$.invalid_type,expected:r$.function,received:q.parsedType}),Q$;function K(j,z){return n4({data:j,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,h_(),F8].filter((J)=>!!J),issueData:{code:c$.invalid_arguments,argumentsError:z}})}function P(j,z){return n4({data:j,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,h_(),F8].filter((J)=>!!J),issueData:{code:c$.invalid_return_type,returnTypeError:z}})}let _={errorMap:q.common.contextualErrorMap},O=q.data;if(this._def.returns instanceof BK){let j=this;return Mq(async function(...z){let J=new yq([]),w=await j._def.args.parseAsync(z,_).catch((A)=>{throw J.addIssue(K(z,A)),J}),G=await Reflect.apply(O,this,w);return await j._def.returns._def.type.parseAsync(G,_).catch((A)=>{throw J.addIssue(P(G,A)),J})})}else{let j=this;return Mq(function(...z){let J=j._def.args.safeParse(z,_);if(!J.success)throw new yq([K(z,J.error)]);let w=Reflect.apply(O,this,J.data),G=j._def.returns.safeParse(w,_);if(!G.success)throw new yq([P(w,G.error)]);return G.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new D_({...this._def,args:I8.create($).rest(GK.create())})}returns($){return new D_({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,q,K){return new D_({args:$?$:I8.create([]).rest(GK.create()),returns:q||GK.create(),typeName:e$.ZodFunction,...Y6(K)})}}class p_ extends W6{get schema(){return this._def.getter()}_parse($){let{ctx:q}=this._processInputParams($);return this._def.getter()._parse({data:q.data,path:q.path,parent:q})}}p_.create=($,q)=>{return new p_({getter:$,typeName:e$.ZodLazy,...Y6(q)})};class x_ extends W6{_parse($){if($.data!==this._def.value){let q=this._getOrReturnCtx($);return n$(q,{received:q.data,code:c$.invalid_literal,expected:this._def.value}),Q$}return{status:"valid",value:$.data}}get value(){return this._def.value}}x_.create=($,q)=>{return new x_({value:$,typeName:e$.ZodLiteral,...Y6(q)})};function oH($,q){return new MK({values:$,typeName:e$.ZodEnum,...Y6(q)})}class MK extends W6{_parse($){if(typeof $.data!=="string"){let q=this._getOrReturnCtx($),K=this._def.values;return n$(q,{expected:J6.joinValues(K),received:q.parsedType,code:c$.invalid_type}),Q$}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let q=this._getOrReturnCtx($),K=this._def.values;return n$(q,{received:q.data,code:c$.invalid_enum_value,options:K}),Q$}return Mq($.data)}get options(){return this._def.values}get enum(){let $={};for(let q of this._def.values)$[q]=q;return $}get Values(){let $={};for(let q of this._def.values)$[q]=q;return $}get Enum(){let $={};for(let q of this._def.values)$[q]=q;return $}extract($,q=this._def){return MK.create($,{...this._def,...q})}exclude($,q=this._def){return MK.create(this.options.filter((K)=>!$.includes(K)),{...this._def,...q})}}MK.create=oH;class c_ extends W6{_parse($){let q=J6.getValidEnumValues(this._def.values),K=this._getOrReturnCtx($);if(K.parsedType!==r$.string&&K.parsedType!==r$.number){let P=J6.objectValues(q);return n$(K,{expected:J6.joinValues(P),received:K.parsedType,code:c$.invalid_type}),Q$}if(!this._cache)this._cache=new Set(J6.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let P=J6.objectValues(q);return n$(K,{received:K.data,code:c$.invalid_enum_value,options:P}),Q$}return Mq($.data)}get enum(){return this._def.values}}c_.create=($,q)=>{return new c_({values:$,typeName:e$.ZodNativeEnum,...Y6(q)})};class BK extends W6{unwrap(){return this._def.type}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==r$.promise&&q.common.async===!1)return n$(q,{code:c$.invalid_type,expected:r$.promise,received:q.parsedType}),Q$;let K=q.parsedType===r$.promise?q.data:Promise.resolve(q.data);return Mq(K.then((P)=>{return this._def.type.parseAsync(P,{path:q.path,errorMap:q.common.contextualErrorMap})}))}}BK.create=($,q)=>{return new BK({type:$,typeName:e$.ZodPromise,...Y6(q)})};class G8 extends W6{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===e$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:q,ctx:K}=this._processInputParams($),P=this._def.effect||null,_={addIssue:(O)=>{if(n$(K,O),O.fatal)q.abort();else q.dirty()},get path(){return K.path}};if(_.addIssue=_.addIssue.bind(_),P.type==="preprocess"){let O=P.transform(K.data,_);if(K.common.async)return Promise.resolve(O).then(async(j)=>{if(q.value==="aborted")return Q$;let z=await this._def.schema._parseAsync({data:j,path:K.path,parent:K});if(z.status==="aborted")return Q$;if(z.status==="dirty")return rK(z.value);if(q.value==="dirty")return rK(z.value);return z});else{if(q.value==="aborted")return Q$;let j=this._def.schema._parseSync({data:O,path:K.path,parent:K});if(j.status==="aborted")return Q$;if(j.status==="dirty")return rK(j.value);if(q.value==="dirty")return rK(j.value);return j}}if(P.type==="refinement"){let O=(j)=>{let z=P.refinement(j,_);if(K.common.async)return Promise.resolve(z);if(z instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return j};if(K.common.async===!1){let j=this._def.schema._parseSync({data:K.data,path:K.path,parent:K});if(j.status==="aborted")return Q$;if(j.status==="dirty")q.dirty();return O(j.value),{status:q.value,value:j.value}}else return this._def.schema._parseAsync({data:K.data,path:K.path,parent:K}).then((j)=>{if(j.status==="aborted")return Q$;if(j.status==="dirty")q.dirty();return O(j.value).then(()=>{return{status:q.value,value:j.value}})})}if(P.type==="transform")if(K.common.async===!1){let O=this._def.schema._parseSync({data:K.data,path:K.path,parent:K});if(!AK(O))return Q$;let j=P.transform(O.value,_);if(j instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:q.value,value:j}}else return this._def.schema._parseAsync({data:K.data,path:K.path,parent:K}).then((O)=>{if(!AK(O))return Q$;return Promise.resolve(P.transform(O.value,_)).then((j)=>({status:q.value,value:j}))});J6.assertNever(P)}}G8.create=($,q,K)=>{return new G8({schema:$,typeName:e$.ZodEffects,effect:q,...Y6(K)})};G8.createWithPreprocess=($,q,K)=>{return new G8({schema:q,effect:{type:"preprocess",transform:$},typeName:e$.ZodEffects,...Y6(K)})};class k8 extends W6{_parse($){if(this._getType($)===r$.undefined)return Mq(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}k8.create=($,q)=>{return new k8({innerType:$,typeName:e$.ZodOptional,...Y6(q)})};class Q8 extends W6{_parse($){if(this._getType($)===r$.null)return Mq(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Q8.create=($,q)=>{return new Q8({innerType:$,typeName:e$.ZodNullable,...Y6(q)})};class m_ extends W6{_parse($){let{ctx:q}=this._processInputParams($),K=q.data;if(q.parsedType===r$.undefined)K=this._def.defaultValue();return this._def.innerType._parse({data:K,path:q.path,parent:q})}removeDefault(){return this._def.innerType}}m_.create=($,q)=>{return new m_({innerType:$,typeName:e$.ZodDefault,defaultValue:typeof q.default==="function"?q.default:()=>q.default,...Y6(q)})};class d_ extends W6{_parse($){let{ctx:q}=this._processInputParams($),K={...q,common:{...q.common,issues:[]}},P=this._def.innerType._parse({data:K.data,path:K.path,parent:{...K}});if(R_(P))return P.then((_)=>{return{status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new yq(K.common.issues)},input:K.data})}});else return{status:"valid",value:P.status==="valid"?P.value:this._def.catchValue({get error(){return new yq(K.common.issues)},input:K.data})}}removeCatch(){return this._def.innerType}}d_.create=($,q)=>{return new d_({innerType:$,typeName:e$.ZodCatch,catchValue:typeof q.catch==="function"?q.catch:()=>q.catch,...Y6(q)})};class F4 extends W6{_parse($){if(this._getType($)!==r$.nan){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.nan,received:K.parsedType}),Q$}return{status:"valid",value:$.data}}}F4.create=($)=>{return new F4({typeName:e$.ZodNaN,...Y6($)})};var BM=Symbol("zod_brand");class i7 extends W6{_parse($){let{ctx:q}=this._processInputParams($),K=q.data;return this._def.type._parse({data:K,path:q.path,parent:q})}unwrap(){return this._def.type}}class a4 extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.common.async)return(async()=>{let _=await this._def.in._parseAsync({data:K.data,path:K.path,parent:K});if(_.status==="aborted")return Q$;if(_.status==="dirty")return q.dirty(),rK(_.value);else return this._def.out._parseAsync({data:_.value,path:K.path,parent:K})})();else{let P=this._def.in._parseSync({data:K.data,path:K.path,parent:K});if(P.status==="aborted")return Q$;if(P.status==="dirty")return q.dirty(),{status:"dirty",value:P.value};else return this._def.out._parseSync({data:P.value,path:K.path,parent:K})}}static create($,q){return new a4({in:$,out:q,typeName:e$.ZodPipeline})}}class l_ extends W6{_parse($){let q=this._def.innerType._parse($),K=(P)=>{if(AK(P))P.value=Object.freeze(P.value);return P};return R_(q)?q.then((P)=>K(P)):K(q)}unwrap(){return this._def.innerType}}l_.create=($,q)=>{return new l_({innerType:$,typeName:e$.ZodReadonly,...Y6(q)})};function cH($,q){let K=typeof $==="function"?$(q):typeof $==="string"?{message:$}:$;return typeof K==="string"?{message:K}:K}function rH($,q={},K){if($)return iK.create().superRefine((P,_)=>{let O=$(P);if(O instanceof Promise)return O.then((j)=>{if(!j){let z=cH(q,P),J=z.fatal??K??!0;_.addIssue({code:"custom",...z,fatal:J})}});if(!O){let j=cH(q,P),z=j.fatal??K??!0;_.addIssue({code:"custom",...j,fatal:z})}return});return iK.create()}var UM={object:R6.lazycreate},e$;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(e$||(e$={}));var FM=($,q={message:`Input not instance of ${$.name}`})=>rH((K)=>K instanceof $,q),nH=X8.create,iH=VK.create,aM=F4.create,QM=SK.create,tH=g_.create,eM=nK.create,sM=i4.create,$0=L_.create,q0=b_.create,K0=iK.create,_0=GK.create,P0=R8.create,j0=t4.create,O0=f8.create,Y0=R6.create,v0=R6.strictCreate,z0=u_.create,W0=n7.create,H0=y_.create,J0=I8.create,T0=B4.create,w0=U4.create,Z0=tK.create,X0=D_.create,f0=p_.create,k0=x_.create,A0=MK.create,G0=c_.create,V0=BK.create,S0=G8.create,M0=k8.create,N0=Q8.create,C0=G8.createWithPreprocess,E0=a4.create,h0=()=>nH().optional(),R0=()=>iH().optional(),I0=()=>tH().optional(),D0={string:($)=>X8.create({...$,coerce:!0}),number:($)=>VK.create({...$,coerce:!0}),boolean:($)=>g_.create({...$,coerce:!0}),bigint:($)=>SK.create({...$,coerce:!0}),date:($)=>nK.create({...$,coerce:!0})};var g0=Q$;var Xz=Uq(B7(),1);var eH=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function l0($){return typeof $==="string"&&eH.test($)}var o_=l0;var Jq=[];for(Q4=0;Q4<256;++Q4)Jq.push((Q4+256).toString(16).slice(1));var Q4;function sH($,q=0){return(Jq[$[q+0]]+Jq[$[q+1]]+Jq[$[q+2]]+Jq[$[q+3]]+"-"+Jq[$[q+4]]+Jq[$[q+5]]+"-"+Jq[$[q+6]]+Jq[$[q+7]]+"-"+Jq[$[q+8]]+Jq[$[q+9]]+"-"+Jq[$[q+10]]+Jq[$[q+11]]+Jq[$[q+12]]+Jq[$[q+13]]+Jq[$[q+14]]+Jq[$[q+15]]).toLowerCase()}var U7,o0=new Uint8Array(16);function vO(){if(!U7){if(U7=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!U7)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return U7(o0)}var r0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zO={randomUUID:r0};function n0($,q,K){if(zO.randomUUID&&!q&&!$)return zO.randomUUID();$=$||{};var P=$.random||($.rng||vO)();if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){K=K||0;for(var _=0;_<16;++_)q[K+_]=P[_];return q}return sH(P)}var pq=n0;class $J{getStore(){return}run($,q){return q()}}var WO=Symbol.for("ls:tracing_async_local_storage"),t0=new $J;class qJ{getInstance(){return globalThis[WO]??t0}initializeGlobalInstance($){if(globalThis[WO]===void 0)globalThis[WO]=$}}var B0=new qJ;function KJ($=!1){let q=B0.getInstance().getStore();if(!$&&q===void 0)throw Error(`Could not get the current run tree.
|
|
39
|
+
https://github.com/browserify/crypto-browserify`)},$.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),H6=_l($o(),1),qo=H6.prng,Ko=H6.pseudoRandomBytes,_o=H6.rng,Po=H6.randomBytes,jo=H6.Hash,Oo=H6.createHash,Yo=H6.Hmac,vo=H6.createHmac,zo=H6.getHashes,Wo=H6.pbkdf2,Ho=H6.pbkdf2Sync,Jo=H6.Cipher,To=H6.createCipher,wo=H6.Cipheriv,Zo=H6.createCipheriv,Xo=H6.Decipher,fo=H6.createDecipher,ko=H6.Decipheriv,Ao=H6.createDecipheriv,Go=H6.getCiphers,Vo=H6.listCiphers,So=H6.DiffieHellmanGroup,Mo=H6.createDiffieHellmanGroup,No=H6.getDiffieHellman,Co=H6.createDiffieHellman,Eo=H6.DiffieHellman,ho=H6.createSign,Ro=H6.Sign,Io=H6.createVerify,Do=H6.Verify,go=H6.createECDH,Lo=H6.publicEncrypt,bo=H6.privateEncrypt,uo=H6.publicDecrypt,yo=H6.privateDecrypt,po=H6.randomFill,xo=H6.randomFillSync,co=H6.createCredentials,mo=H6.constants,no=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];to=crypto,Bo=crypto});function Rr($){if(!$||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test($))throw Error(`Invalid UUID format: ${$}`);return $}var uH;((O)=>{O.IMAGE="image";O.VIDEO="video";O.AUDIO="audio";O.DOCUMENT="document";O.LINK="link"})(uH||={});var ZM;((O)=>{O.DOCUMENT="document";O.FRAGMENT="fragment";O.MESSAGE="message";O.DESCRIPTION="description";O.CUSTOM="custom"})(ZM||={});var XM;((P)=>{P.OWNER="OWNER";P.ADMIN="ADMIN";P.NONE="NONE"})(XM||={});var l7;((G)=>{G.SELF="SELF";G.DM="DM";G.GROUP="GROUP";G.VOICE_DM="VOICE_DM";G.VOICE_GROUP="VOICE_GROUP";G.FEED="FEED";G.THREAD="THREAD";G.WORLD="WORLD";G.FORUM="FORUM";G.API="API"})(l7||={});var fM;((K)=>{K.ACTIVE="active";K.INACTIVE="inactive"})(fM||={});var br={TRANSCRIPTION:"transcription",VIDEO:"video",BROWSER:"browser",PDF:"pdf",REMOTE_FILES:"aws_s3",WEB_SEARCH:"web_search",EMAIL:"email",TEE:"tee",TASK:"task",WALLET:"wallet",LP_POOL:"lp_pool",TOKEN_DATA:"token_data",MESSAGE:"message",POST:"post",UNKNOWN:"unknown"};class KO{runtime;constructor($){if($)this.runtime=$}static serviceType;config;static async start($){throw Error("Not implemented")}static async stop($){throw Error("Not implemented")}}function ur($,q){return $.getService(q)}function yr($,q="UNKNOWN_ERROR"){if($ instanceof Error)return{code:q,message:$.message,cause:$};return{code:q,message:String($)}}var Sq={SMALL:"TEXT_SMALL",MEDIUM:"TEXT_LARGE",LARGE:"TEXT_LARGE",TEXT_SMALL:"TEXT_SMALL",TEXT_LARGE:"TEXT_LARGE",TEXT_EMBEDDING:"TEXT_EMBEDDING",TEXT_TOKENIZER_ENCODE:"TEXT_TOKENIZER_ENCODE",TEXT_TOKENIZER_DECODE:"TEXT_TOKENIZER_DECODE",TEXT_REASONING_SMALL:"REASONING_SMALL",TEXT_REASONING_LARGE:"REASONING_LARGE",TEXT_COMPLETION:"TEXT_COMPLETION",IMAGE:"IMAGE",IMAGE_DESCRIPTION:"IMAGE_DESCRIPTION",TRANSCRIPTION:"TRANSCRIPTION",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",AUDIO:"AUDIO",VIDEO:"VIDEO",OBJECT_SMALL:"OBJECT_SMALL",OBJECT_LARGE:"OBJECT_LARGE"},r4={DEFAULT_MAX_TOKENS:"DEFAULT_MAX_TOKENS",DEFAULT_TEMPERATURE:"DEFAULT_TEMPERATURE",DEFAULT_FREQUENCY_PENALTY:"DEFAULT_FREQUENCY_PENALTY",DEFAULT_PRESENCE_PENALTY:"DEFAULT_PRESENCE_PENALTY",TEXT_SMALL_MAX_TOKENS:"TEXT_SMALL_MAX_TOKENS",TEXT_SMALL_TEMPERATURE:"TEXT_SMALL_TEMPERATURE",TEXT_SMALL_FREQUENCY_PENALTY:"TEXT_SMALL_FREQUENCY_PENALTY",TEXT_SMALL_PRESENCE_PENALTY:"TEXT_SMALL_PRESENCE_PENALTY",TEXT_LARGE_MAX_TOKENS:"TEXT_LARGE_MAX_TOKENS",TEXT_LARGE_TEMPERATURE:"TEXT_LARGE_TEMPERATURE",TEXT_LARGE_FREQUENCY_PENALTY:"TEXT_LARGE_FREQUENCY_PENALTY",TEXT_LARGE_PRESENCE_PENALTY:"TEXT_LARGE_PRESENCE_PENALTY",OBJECT_SMALL_MAX_TOKENS:"OBJECT_SMALL_MAX_TOKENS",OBJECT_SMALL_TEMPERATURE:"OBJECT_SMALL_TEMPERATURE",OBJECT_SMALL_FREQUENCY_PENALTY:"OBJECT_SMALL_FREQUENCY_PENALTY",OBJECT_SMALL_PRESENCE_PENALTY:"OBJECT_SMALL_PRESENCE_PENALTY",OBJECT_LARGE_MAX_TOKENS:"OBJECT_LARGE_MAX_TOKENS",OBJECT_LARGE_TEMPERATURE:"OBJECT_LARGE_TEMPERATURE",OBJECT_LARGE_FREQUENCY_PENALTY:"OBJECT_LARGE_FREQUENCY_PENALTY",OBJECT_LARGE_PRESENCE_PENALTY:"OBJECT_LARGE_PRESENCE_PENALTY",MODEL_MAX_TOKEN:"MODEL_MAX_TOKEN",MODEL_TEMPERATURE:"MODEL_TEMPERATURE",MODEL_FREQ_PENALTY:"MODEL_FREQ_PENALTY",MODEL_PRESENCE_PENALTY:"MODEL_PRESENCE_PENALTY"};var cr={SMALL:384,MEDIUM:512,LARGE:768,XL:1024,XXL:1536,XXXL:3072};var yH;((M)=>{M.WORLD_JOINED="WORLD_JOINED";M.WORLD_CONNECTED="WORLD_CONNECTED";M.WORLD_LEFT="WORLD_LEFT";M.ENTITY_JOINED="ENTITY_JOINED";M.ENTITY_LEFT="ENTITY_LEFT";M.ENTITY_UPDATED="ENTITY_UPDATED";M.ROOM_JOINED="ROOM_JOINED";M.ROOM_LEFT="ROOM_LEFT";M.MESSAGE_RECEIVED="MESSAGE_RECEIVED";M.MESSAGE_SENT="MESSAGE_SENT";M.MESSAGE_DELETED="MESSAGE_DELETED";M.CHANNEL_CLEARED="CHANNEL_CLEARED";M.VOICE_MESSAGE_RECEIVED="VOICE_MESSAGE_RECEIVED";M.VOICE_MESSAGE_SENT="VOICE_MESSAGE_SENT";M.REACTION_RECEIVED="REACTION_RECEIVED";M.POST_GENERATED="POST_GENERATED";M.INTERACTION_RECEIVED="INTERACTION_RECEIVED";M.RUN_STARTED="RUN_STARTED";M.RUN_ENDED="RUN_ENDED";M.RUN_TIMEOUT="RUN_TIMEOUT";M.ACTION_STARTED="ACTION_STARTED";M.ACTION_COMPLETED="ACTION_COMPLETED";M.EVALUATOR_STARTED="EVALUATOR_STARTED";M.EVALUATOR_COMPLETED="EVALUATOR_COMPLETED";M.MODEL_USED="MODEL_USED";M.EMBEDDING_GENERATION_REQUESTED="EMBEDDING_GENERATION_REQUESTED";M.EMBEDDING_GENERATION_COMPLETED="EMBEDDING_GENERATION_COMPLETED";M.EMBEDDING_GENERATION_FAILED="EMBEDDING_GENERATION_FAILED"})(yH||={});var kM;((P)=>{P.DISCORD="DISCORD";P.TELEGRAM="TELEGRAM";P.TWITTER="TWITTER"})(kM||={});var AM;((_)=>{_.OFF="OFF";_.LOCAL="LOCAL";_.DOCKER="DOCKER";_.PRODUCTION="PRODUCTION"})(AM||={});var GM;((q)=>q.TDX_DSTACK="tdx_dstack")(GM||={});var VM;((j)=>{j[j.ROOM_JOINING=1]="ROOM_JOINING";j[j.SEND_MESSAGE=2]="SEND_MESSAGE";j[j.MESSAGE=3]="MESSAGE";j[j.ACK=4]="ACK";j[j.THINKING=5]="THINKING";j[j.CONTROL=6]="CONTROL"})(VM||={});class _O{constructor($){Object.defineProperty(this,"pageContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pageContent=$.pageContent!==void 0?$.pageContent.toString():"",this.metadata=$.metadata??{},this.id=$.id}}var UK={};uq(UK,{void:()=>j0,util:()=>J6,unknown:()=>_0,union:()=>z0,undefined:()=>$0,tuple:()=>J0,transformer:()=>S0,symbol:()=>sM,string:()=>nH,strictObject:()=>v0,setErrorMap:()=>NM,set:()=>Z0,record:()=>T0,quotelessJson:()=>SM,promise:()=>V0,preprocess:()=>C0,pipeline:()=>E0,ostring:()=>h0,optional:()=>M0,onumber:()=>R0,oboolean:()=>I0,objectUtil:()=>PO,object:()=>Y0,number:()=>iH,nullable:()=>N0,null:()=>q0,never:()=>P0,nativeEnum:()=>G0,nan:()=>aM,map:()=>w0,makeIssue:()=>n4,literal:()=>k0,lazy:()=>f0,late:()=>UM,isValid:()=>AK,isDirty:()=>r7,isAsync:()=>R_,isAborted:()=>o7,intersection:()=>H0,instanceof:()=>FM,getParsedType:()=>h8,getErrorMap:()=>h_,function:()=>X0,enum:()=>A0,effect:()=>S0,discriminatedUnion:()=>W0,defaultErrorMap:()=>F8,datetimeRegex:()=>lH,date:()=>eM,custom:()=>rH,coerce:()=>D0,boolean:()=>tH,bigint:()=>QM,array:()=>O0,any:()=>K0,addIssueToContext:()=>n$,ZodVoid:()=>t4,ZodUnknown:()=>GK,ZodUnion:()=>u_,ZodUndefined:()=>L_,ZodType:()=>W6,ZodTuple:()=>I8,ZodTransformer:()=>G8,ZodSymbol:()=>i4,ZodString:()=>X8,ZodSet:()=>tK,ZodSchema:()=>W6,ZodRecord:()=>B4,ZodReadonly:()=>l_,ZodPromise:()=>BK,ZodPipeline:()=>a4,ZodParsedType:()=>r$,ZodOptional:()=>k8,ZodObject:()=>R6,ZodNumber:()=>VK,ZodNullable:()=>Q8,ZodNull:()=>b_,ZodNever:()=>R8,ZodNativeEnum:()=>c_,ZodNaN:()=>F4,ZodMap:()=>U4,ZodLiteral:()=>x_,ZodLazy:()=>p_,ZodIssueCode:()=>c$,ZodIntersection:()=>y_,ZodFunction:()=>D_,ZodFirstPartyTypeKind:()=>e$,ZodError:()=>yq,ZodEnum:()=>MK,ZodEffects:()=>G8,ZodDiscriminatedUnion:()=>n7,ZodDefault:()=>m_,ZodDate:()=>nK,ZodCatch:()=>d_,ZodBranded:()=>i7,ZodBoolean:()=>g_,ZodBigInt:()=>SK,ZodArray:()=>f8,ZodAny:()=>iK,Schema:()=>W6,ParseStatus:()=>Hq,OK:()=>Mq,NEVER:()=>g0,INVALID:()=>Q$,EMPTY_PATH:()=>CM,DIRTY:()=>rK,BRAND:()=>BM});var J6;(function($){$.assertEqual=(_)=>{};function q(_){}$.assertIs=q;function K(_){throw Error()}$.assertNever=K,$.arrayToEnum=(_)=>{let O={};for(let j of _)O[j]=j;return O},$.getValidEnumValues=(_)=>{let O=$.objectKeys(_).filter((z)=>typeof _[_[z]]!=="number"),j={};for(let z of O)j[z]=_[z];return $.objectValues(j)},$.objectValues=(_)=>{return $.objectKeys(_).map(function(O){return _[O]})},$.objectKeys=typeof Object.keys==="function"?(_)=>Object.keys(_):(_)=>{let O=[];for(let j in _)if(Object.prototype.hasOwnProperty.call(_,j))O.push(j);return O},$.find=(_,O)=>{for(let j of _)if(O(j))return j;return},$.isInteger=typeof Number.isInteger==="function"?(_)=>Number.isInteger(_):(_)=>typeof _==="number"&&Number.isFinite(_)&&Math.floor(_)===_;function P(_,O=" | "){return _.map((j)=>typeof j==="string"?`'${j}'`:j).join(O)}$.joinValues=P,$.jsonStringifyReplacer=(_,O)=>{if(typeof O==="bigint")return O.toString();return O}})(J6||(J6={}));var PO;(function($){$.mergeShapes=(q,K)=>{return{...q,...K}}})(PO||(PO={}));var r$=J6.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),h8=($)=>{switch(typeof $){case"undefined":return r$.undefined;case"string":return r$.string;case"number":return Number.isNaN($)?r$.nan:r$.number;case"boolean":return r$.boolean;case"function":return r$.function;case"bigint":return r$.bigint;case"symbol":return r$.symbol;case"object":if(Array.isArray($))return r$.array;if($===null)return r$.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return r$.promise;if(typeof Map<"u"&&$ instanceof Map)return r$.map;if(typeof Set<"u"&&$ instanceof Set)return r$.set;if(typeof Date<"u"&&$ instanceof Date)return r$.date;return r$.object;default:return r$.unknown}};var c$=J6.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),SM=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class yq extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(K)=>{this.issues=[...this.issues,K]},this.addIssues=(K=[])=>{this.issues=[...this.issues,...K]};let q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,q);else this.__proto__=q;this.name="ZodError",this.issues=$}format($){let q=$||function(_){return _.message},K={_errors:[]},P=(_)=>{for(let O of _.issues)if(O.code==="invalid_union")O.unionErrors.map(P);else if(O.code==="invalid_return_type")P(O.returnTypeError);else if(O.code==="invalid_arguments")P(O.argumentsError);else if(O.path.length===0)K._errors.push(q(O));else{let j=K,z=0;while(z<O.path.length){let J=O.path[z];if(z!==O.path.length-1)j[J]=j[J]||{_errors:[]};else j[J]=j[J]||{_errors:[]},j[J]._errors.push(q(O));j=j[J],z++}}};return P(this),K}static assert($){if(!($ instanceof yq))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,J6.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(q)=>q.message){let q={},K=[];for(let P of this.issues)if(P.path.length>0){let _=P.path[0];q[_]=q[_]||[],q[_].push($(P))}else K.push($(P));return{formErrors:K,fieldErrors:q}}get formErrors(){return this.flatten()}}yq.create=($)=>{return new yq($)};var MM=($,q)=>{let K;switch($.code){case c$.invalid_type:if($.received===r$.undefined)K="Required";else K=`Expected ${$.expected}, received ${$.received}`;break;case c$.invalid_literal:K=`Invalid literal value, expected ${JSON.stringify($.expected,J6.jsonStringifyReplacer)}`;break;case c$.unrecognized_keys:K=`Unrecognized key(s) in object: ${J6.joinValues($.keys,", ")}`;break;case c$.invalid_union:K="Invalid input";break;case c$.invalid_union_discriminator:K=`Invalid discriminator value. Expected ${J6.joinValues($.options)}`;break;case c$.invalid_enum_value:K=`Invalid enum value. Expected ${J6.joinValues($.options)}, received '${$.received}'`;break;case c$.invalid_arguments:K="Invalid function arguments";break;case c$.invalid_return_type:K="Invalid function return type";break;case c$.invalid_date:K="Invalid date";break;case c$.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(K=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")K=`${K} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)K=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)K=`Invalid input: must end with "${$.validation.endsWith}"`;else J6.assertNever($.validation);else if($.validation!=="regex")K=`Invalid ${$.validation}`;else K="Invalid";break;case c$.too_small:if($.type==="array")K=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")K=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")K=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")K=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")K=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else K="Invalid input";break;case c$.too_big:if($.type==="array")K=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")K=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")K=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")K=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")K=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else K="Invalid input";break;case c$.custom:K="Invalid input";break;case c$.invalid_intersection_types:K="Intersection results could not be merged";break;case c$.not_multiple_of:K=`Number must be a multiple of ${$.multipleOf}`;break;case c$.not_finite:K="Number must be finite";break;default:K=q.defaultError,J6.assertNever($)}return{message:K}},F8=MM;var pH=F8;function NM($){pH=$}function h_(){return pH}var n4=($)=>{let{data:q,path:K,errorMaps:P,issueData:_}=$,O=[...K,..._.path||[]],j={..._,path:O};if(_.message!==void 0)return{..._,path:O,message:_.message};let z="",J=P.filter((w)=>!!w).slice().reverse();for(let w of J)z=w(j,{data:q,defaultError:z}).message;return{..._,path:O,message:z}},CM=[];function n$($,q){let K=h_(),P=n4({issueData:q,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,K,K===F8?void 0:F8].filter((_)=>!!_)});$.common.issues.push(P)}class Hq{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,q){let K=[];for(let P of q){if(P.status==="aborted")return Q$;if(P.status==="dirty")$.dirty();K.push(P.value)}return{status:$.value,value:K}}static async mergeObjectAsync($,q){let K=[];for(let P of q){let _=await P.key,O=await P.value;K.push({key:_,value:O})}return Hq.mergeObjectSync($,K)}static mergeObjectSync($,q){let K={};for(let P of q){let{key:_,value:O}=P;if(_.status==="aborted")return Q$;if(O.status==="aborted")return Q$;if(_.status==="dirty")$.dirty();if(O.status==="dirty")$.dirty();if(_.value!=="__proto__"&&(typeof O.value<"u"||P.alwaysSet))K[_.value]=O.value}return{status:$.value,value:K}}}var Q$=Object.freeze({status:"aborted"}),rK=($)=>({status:"dirty",value:$}),Mq=($)=>({status:"valid",value:$}),o7=($)=>$.status==="aborted",r7=($)=>$.status==="dirty",AK=($)=>$.status==="valid",R_=($)=>typeof Promise<"u"&&$ instanceof Promise;var F$;(function($){$.errToObj=(q)=>typeof q==="string"?{message:q}:q||{},$.toString=(q)=>typeof q==="string"?q:q?.message})(F$||(F$={}));class A8{constructor($,q,K,P){this._cachedPath=[],this.parent=$,this.data=q,this._path=K,this._key=P}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var xH=($,q)=>{if(AK(q))return{success:!0,data:q.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let K=new yq($.common.issues);return this._error=K,this._error}}}};function Y6($){if(!$)return{};let{errorMap:q,invalid_type_error:K,required_error:P,description:_}=$;if(q&&(K||P))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(q)return{errorMap:q,description:_};return{errorMap:(j,z)=>{let{message:J}=$;if(j.code==="invalid_enum_value")return{message:J??z.defaultError};if(typeof z.data>"u")return{message:J??P??z.defaultError};if(j.code!=="invalid_type")return{message:z.defaultError};return{message:J??K??z.defaultError}},description:_}}class W6{get description(){return this._def.description}_getType($){return h8($.data)}_getOrReturnCtx($,q){return q||{common:$.parent.common,data:$.data,parsedType:h8($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new Hq,ctx:{common:$.parent.common,data:$.data,parsedType:h8($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let q=this._parse($);if(R_(q))throw Error("Synchronous parse encountered promise.");return q}_parseAsync($){let q=this._parse($);return Promise.resolve(q)}parse($,q){let K=this.safeParse($,q);if(K.success)return K.data;throw K.error}safeParse($,q){let K={common:{issues:[],async:q?.async??!1,contextualErrorMap:q?.errorMap},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:h8($)},P=this._parseSync({data:$,path:K.path,parent:K});return xH(K,P)}"~validate"($){let q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:h8($)};if(!this["~standard"].async)try{let K=this._parseSync({data:$,path:[],parent:q});return AK(K)?{value:K.value}:{issues:q.common.issues}}catch(K){if(K?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;q.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:q}).then((K)=>AK(K)?{value:K.value}:{issues:q.common.issues})}async parseAsync($,q){let K=await this.safeParseAsync($,q);if(K.success)return K.data;throw K.error}async safeParseAsync($,q){let K={common:{issues:[],contextualErrorMap:q?.errorMap,async:!0},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:h8($)},P=this._parse({data:$,path:K.path,parent:K}),_=await(R_(P)?P:Promise.resolve(P));return xH(K,_)}refine($,q){let K=(P)=>{if(typeof q==="string"||typeof q>"u")return{message:q};else if(typeof q==="function")return q(P);else return q};return this._refinement((P,_)=>{let O=$(P),j=()=>_.addIssue({code:c$.custom,...K(P)});if(typeof Promise<"u"&&O instanceof Promise)return O.then((z)=>{if(!z)return j(),!1;else return!0});if(!O)return j(),!1;else return!0})}refinement($,q){return this._refinement((K,P)=>{if(!$(K))return P.addIssue(typeof q==="function"?q(K,P):q),!1;else return!0})}_refinement($){return new G8({schema:this,typeName:e$.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(q)=>this["~validate"](q)}}optional(){return k8.create(this,this._def)}nullable(){return Q8.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return f8.create(this)}promise(){return BK.create(this,this._def)}or($){return u_.create([this,$],this._def)}and($){return y_.create(this,$,this._def)}transform($){return new G8({...Y6(this._def),schema:this,typeName:e$.ZodEffects,effect:{type:"transform",transform:$}})}default($){let q=typeof $==="function"?$:()=>$;return new m_({...Y6(this._def),innerType:this,defaultValue:q,typeName:e$.ZodDefault})}brand(){return new i7({typeName:e$.ZodBranded,type:this,...Y6(this._def)})}catch($){let q=typeof $==="function"?$:()=>$;return new d_({...Y6(this._def),innerType:this,catchValue:q,typeName:e$.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return a4.create(this,$)}readonly(){return l_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var EM=/^c[^\s-]{8,}$/i,hM=/^[0-9a-z]+$/,RM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,IM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,DM=/^[a-z0-9_-]{21}$/i,gM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LM=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",jO,yM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mH="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",lM=new RegExp(`^${mH}$`);function dH($){let q="[0-5]\\d";if($.precision)q=`${q}\\.\\d{${$.precision}}`;else if($.precision==null)q=`${q}(\\.\\d+)?`;let K=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${q})${K}`}function oM($){return new RegExp(`^${dH($)}$`)}function lH($){let q=`${mH}T${dH($)}`,K=[];if(K.push($.local?"Z?":"Z"),$.offset)K.push("([+-]\\d{2}:?\\d{2})");return q=`${q}(${K.join("|")})`,new RegExp(`^${q}$`)}function rM($,q){if((q==="v4"||!q)&&yM.test($))return!0;if((q==="v6"||!q)&&xM.test($))return!0;return!1}function nM($,q){if(!gM.test($))return!1;try{let[K]=$.split(".");if(!K)return!1;let P=K.replace(/-/g,"+").replace(/_/g,"/").padEnd(K.length+(4-K.length%4)%4,"="),_=JSON.parse(atob(P));if(typeof _!=="object"||_===null)return!1;if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(q&&_.alg!==q)return!1;return!0}catch{return!1}}function iM($,q){if((q==="v4"||!q)&&pM.test($))return!0;if((q==="v6"||!q)&&cM.test($))return!0;return!1}class X8 extends W6{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==r$.string){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_type,expected:r$.string,received:_.parsedType}),Q$}let K=new Hq,P=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.length<_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),K.dirty()}else if(_.kind==="max"){if($.data.length>_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),K.dirty()}else if(_.kind==="length"){let O=$.data.length>_.value,j=$.data.length<_.value;if(O||j){if(P=this._getOrReturnCtx($,P),O)n$(P,{code:c$.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});else if(j)n$(P,{code:c$.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});K.dirty()}}else if(_.kind==="email"){if(!bM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"email",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="emoji"){if(!jO)jO=new RegExp(uM,"u");if(!jO.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"emoji",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="uuid"){if(!IM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"uuid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="nanoid"){if(!DM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"nanoid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="cuid"){if(!EM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"cuid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="cuid2"){if(!hM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"cuid2",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="ulid"){if(!RM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"ulid",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="url")try{new URL($.data)}catch{P=this._getOrReturnCtx($,P),n$(P,{validation:"url",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="regex"){if(_.regex.lastIndex=0,!_.regex.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"regex",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="trim")$.data=$.data.trim();else if(_.kind==="includes"){if(!$.data.includes(_.value,_.position))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),K.dirty()}else if(_.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(_.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(_.kind==="startsWith"){if(!$.data.startsWith(_.value))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:{startsWith:_.value},message:_.message}),K.dirty()}else if(_.kind==="endsWith"){if(!$.data.endsWith(_.value))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:{endsWith:_.value},message:_.message}),K.dirty()}else if(_.kind==="datetime"){if(!lH(_).test($.data))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:"datetime",message:_.message}),K.dirty()}else if(_.kind==="date"){if(!lM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:"date",message:_.message}),K.dirty()}else if(_.kind==="time"){if(!oM(_).test($.data))P=this._getOrReturnCtx($,P),n$(P,{code:c$.invalid_string,validation:"time",message:_.message}),K.dirty()}else if(_.kind==="duration"){if(!LM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"duration",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="ip"){if(!rM($.data,_.version))P=this._getOrReturnCtx($,P),n$(P,{validation:"ip",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="jwt"){if(!nM($.data,_.alg))P=this._getOrReturnCtx($,P),n$(P,{validation:"jwt",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="cidr"){if(!iM($.data,_.version))P=this._getOrReturnCtx($,P),n$(P,{validation:"cidr",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="base64"){if(!mM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"base64",code:c$.invalid_string,message:_.message}),K.dirty()}else if(_.kind==="base64url"){if(!dM.test($.data))P=this._getOrReturnCtx($,P),n$(P,{validation:"base64url",code:c$.invalid_string,message:_.message}),K.dirty()}else J6.assertNever(_);return{status:K.value,value:$.data}}_regex($,q,K){return this.refinement((P)=>$.test(P),{validation:q,code:c$.invalid_string,...F$.errToObj(K)})}_addCheck($){return new X8({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...F$.errToObj($)})}url($){return this._addCheck({kind:"url",...F$.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...F$.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...F$.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...F$.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...F$.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...F$.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...F$.errToObj($)})}base64($){return this._addCheck({kind:"base64",...F$.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...F$.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...F$.errToObj($)})}ip($){return this._addCheck({kind:"ip",...F$.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...F$.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...F$.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...F$.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...F$.errToObj($)})}regex($,q){return this._addCheck({kind:"regex",regex:$,...F$.errToObj(q)})}includes($,q){return this._addCheck({kind:"includes",value:$,position:q?.position,...F$.errToObj(q?.message)})}startsWith($,q){return this._addCheck({kind:"startsWith",value:$,...F$.errToObj(q)})}endsWith($,q){return this._addCheck({kind:"endsWith",value:$,...F$.errToObj(q)})}min($,q){return this._addCheck({kind:"min",value:$,...F$.errToObj(q)})}max($,q){return this._addCheck({kind:"max",value:$,...F$.errToObj(q)})}length($,q){return this._addCheck({kind:"length",value:$,...F$.errToObj(q)})}nonempty($){return this.min(1,F$.errToObj($))}trim(){return new X8({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new X8({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new X8({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxLength(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}X8.create=($)=>{return new X8({checks:[],typeName:e$.ZodString,coerce:$?.coerce??!1,...Y6($)})};function tM($,q){let K=($.toString().split(".")[1]||"").length,P=(q.toString().split(".")[1]||"").length,_=K>P?K:P,O=Number.parseInt($.toFixed(_).replace(".","")),j=Number.parseInt(q.toFixed(_).replace(".",""));return O%j/10**_}class VK extends W6{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==r$.number){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_type,expected:r$.number,received:_.parsedType}),Q$}let K=void 0,P=new Hq;for(let _ of this._def.checks)if(_.kind==="int"){if(!J6.isInteger($.data))K=this._getOrReturnCtx($,K),n$(K,{code:c$.invalid_type,expected:"integer",received:"float",message:_.message}),P.dirty()}else if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),P.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),P.dirty()}else if(_.kind==="multipleOf"){if(tM($.data,_.value)!==0)K=this._getOrReturnCtx($,K),n$(K,{code:c$.not_multiple_of,multipleOf:_.value,message:_.message}),P.dirty()}else if(_.kind==="finite"){if(!Number.isFinite($.data))K=this._getOrReturnCtx($,K),n$(K,{code:c$.not_finite,message:_.message}),P.dirty()}else J6.assertNever(_);return{status:P.value,value:$.data}}gte($,q){return this.setLimit("min",$,!0,F$.toString(q))}gt($,q){return this.setLimit("min",$,!1,F$.toString(q))}lte($,q){return this.setLimit("max",$,!0,F$.toString(q))}lt($,q){return this.setLimit("max",$,!1,F$.toString(q))}setLimit($,q,K,P){return new VK({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:K,message:F$.toString(P)}]})}_addCheck($){return new VK({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:F$.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F$.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F$.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F$.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F$.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:F$.toString(q)})}finite($){return this._addCheck({kind:"finite",message:F$.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F$.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F$.toString($)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&J6.isInteger($.value))}get isFinite(){let $=null,q=null;for(let K of this._def.checks)if(K.kind==="finite"||K.kind==="int"||K.kind==="multipleOf")return!0;else if(K.kind==="min"){if(q===null||K.value>q)q=K.value}else if(K.kind==="max"){if($===null||K.value<$)$=K.value}return Number.isFinite(q)&&Number.isFinite($)}}VK.create=($)=>{return new VK({checks:[],typeName:e$.ZodNumber,coerce:$?.coerce||!1,...Y6($)})};class SK extends W6{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==r$.bigint)return this._getInvalidInput($);let K=void 0,P=new Hq;for(let _ of this._def.checks)if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),P.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)K=this._getOrReturnCtx($,K),n$(K,{code:c$.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),P.dirty()}else if(_.kind==="multipleOf"){if($.data%_.value!==BigInt(0))K=this._getOrReturnCtx($,K),n$(K,{code:c$.not_multiple_of,multipleOf:_.value,message:_.message}),P.dirty()}else J6.assertNever(_);return{status:P.value,value:$.data}}_getInvalidInput($){let q=this._getOrReturnCtx($);return n$(q,{code:c$.invalid_type,expected:r$.bigint,received:q.parsedType}),Q$}gte($,q){return this.setLimit("min",$,!0,F$.toString(q))}gt($,q){return this.setLimit("min",$,!1,F$.toString(q))}lte($,q){return this.setLimit("max",$,!0,F$.toString(q))}lt($,q){return this.setLimit("max",$,!1,F$.toString(q))}setLimit($,q,K,P){return new SK({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:K,message:F$.toString(P)}]})}_addCheck($){return new SK({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F$.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F$.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F$.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F$.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:F$.toString(q)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}SK.create=($)=>{return new SK({checks:[],typeName:e$.ZodBigInt,coerce:$?.coerce??!1,...Y6($)})};class g_ extends W6{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==r$.boolean){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.boolean,received:K.parsedType}),Q$}return Mq($.data)}}g_.create=($)=>{return new g_({typeName:e$.ZodBoolean,coerce:$?.coerce||!1,...Y6($)})};class nK extends W6{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==r$.date){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_type,expected:r$.date,received:_.parsedType}),Q$}if(Number.isNaN($.data.getTime())){let _=this._getOrReturnCtx($);return n$(_,{code:c$.invalid_date}),Q$}let K=new Hq,P=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.getTime()<_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),K.dirty()}else if(_.kind==="max"){if($.data.getTime()>_.value)P=this._getOrReturnCtx($,P),n$(P,{code:c$.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),K.dirty()}else J6.assertNever(_);return{status:K.value,value:new Date($.data.getTime())}}_addCheck($){return new nK({...this._def,checks:[...this._def.checks,$]})}min($,q){return this._addCheck({kind:"min",value:$.getTime(),message:F$.toString(q)})}max($,q){return this._addCheck({kind:"max",value:$.getTime(),message:F$.toString(q)})}get minDate(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $!=null?new Date($):null}}nK.create=($)=>{return new nK({checks:[],coerce:$?.coerce||!1,typeName:e$.ZodDate,...Y6($)})};class i4 extends W6{_parse($){if(this._getType($)!==r$.symbol){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.symbol,received:K.parsedType}),Q$}return Mq($.data)}}i4.create=($)=>{return new i4({typeName:e$.ZodSymbol,...Y6($)})};class L_ extends W6{_parse($){if(this._getType($)!==r$.undefined){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.undefined,received:K.parsedType}),Q$}return Mq($.data)}}L_.create=($)=>{return new L_({typeName:e$.ZodUndefined,...Y6($)})};class b_ extends W6{_parse($){if(this._getType($)!==r$.null){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.null,received:K.parsedType}),Q$}return Mq($.data)}}b_.create=($)=>{return new b_({typeName:e$.ZodNull,...Y6($)})};class iK extends W6{constructor(){super(...arguments);this._any=!0}_parse($){return Mq($.data)}}iK.create=($)=>{return new iK({typeName:e$.ZodAny,...Y6($)})};class GK extends W6{constructor(){super(...arguments);this._unknown=!0}_parse($){return Mq($.data)}}GK.create=($)=>{return new GK({typeName:e$.ZodUnknown,...Y6($)})};class R8 extends W6{_parse($){let q=this._getOrReturnCtx($);return n$(q,{code:c$.invalid_type,expected:r$.never,received:q.parsedType}),Q$}}R8.create=($)=>{return new R8({typeName:e$.ZodNever,...Y6($)})};class t4 extends W6{_parse($){if(this._getType($)!==r$.undefined){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.void,received:K.parsedType}),Q$}return Mq($.data)}}t4.create=($)=>{return new t4({typeName:e$.ZodVoid,...Y6($)})};class f8 extends W6{_parse($){let{ctx:q,status:K}=this._processInputParams($),P=this._def;if(q.parsedType!==r$.array)return n$(q,{code:c$.invalid_type,expected:r$.array,received:q.parsedType}),Q$;if(P.exactLength!==null){let O=q.data.length>P.exactLength.value,j=q.data.length<P.exactLength.value;if(O||j)n$(q,{code:O?c$.too_big:c$.too_small,minimum:j?P.exactLength.value:void 0,maximum:O?P.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:P.exactLength.message}),K.dirty()}if(P.minLength!==null){if(q.data.length<P.minLength.value)n$(q,{code:c$.too_small,minimum:P.minLength.value,type:"array",inclusive:!0,exact:!1,message:P.minLength.message}),K.dirty()}if(P.maxLength!==null){if(q.data.length>P.maxLength.value)n$(q,{code:c$.too_big,maximum:P.maxLength.value,type:"array",inclusive:!0,exact:!1,message:P.maxLength.message}),K.dirty()}if(q.common.async)return Promise.all([...q.data].map((O,j)=>{return P.type._parseAsync(new A8(q,O,q.path,j))})).then((O)=>{return Hq.mergeArray(K,O)});let _=[...q.data].map((O,j)=>{return P.type._parseSync(new A8(q,O,q.path,j))});return Hq.mergeArray(K,_)}get element(){return this._def.type}min($,q){return new f8({...this._def,minLength:{value:$,message:F$.toString(q)}})}max($,q){return new f8({...this._def,maxLength:{value:$,message:F$.toString(q)}})}length($,q){return new f8({...this._def,exactLength:{value:$,message:F$.toString(q)}})}nonempty($){return this.min(1,$)}}f8.create=($,q)=>{return new f8({type:$,minLength:null,maxLength:null,exactLength:null,typeName:e$.ZodArray,...Y6(q)})};function I_($){if($ instanceof R6){let q={};for(let K in $.shape){let P=$.shape[K];q[K]=k8.create(I_(P))}return new R6({...$._def,shape:()=>q})}else if($ instanceof f8)return new f8({...$._def,type:I_($.element)});else if($ instanceof k8)return k8.create(I_($.unwrap()));else if($ instanceof Q8)return Q8.create(I_($.unwrap()));else if($ instanceof I8)return I8.create($.items.map((q)=>I_(q)));else return $}class R6 extends W6{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),q=J6.objectKeys($);return this._cached={shape:$,keys:q},this._cached}_parse($){if(this._getType($)!==r$.object){let J=this._getOrReturnCtx($);return n$(J,{code:c$.invalid_type,expected:r$.object,received:J.parsedType}),Q$}let{status:K,ctx:P}=this._processInputParams($),{shape:_,keys:O}=this._getCached(),j=[];if(!(this._def.catchall instanceof R8&&this._def.unknownKeys==="strip")){for(let J in P.data)if(!O.includes(J))j.push(J)}let z=[];for(let J of O){let w=_[J],G=P.data[J];z.push({key:{status:"valid",value:J},value:w._parse(new A8(P,G,P.path,J)),alwaysSet:J in P.data})}if(this._def.catchall instanceof R8){let J=this._def.unknownKeys;if(J==="passthrough")for(let w of j)z.push({key:{status:"valid",value:w},value:{status:"valid",value:P.data[w]}});else if(J==="strict"){if(j.length>0)n$(P,{code:c$.unrecognized_keys,keys:j}),K.dirty()}else if(J==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let J=this._def.catchall;for(let w of j){let G=P.data[w];z.push({key:{status:"valid",value:w},value:J._parse(new A8(P,G,P.path,w)),alwaysSet:w in P.data})}}if(P.common.async)return Promise.resolve().then(async()=>{let J=[];for(let w of z){let G=await w.key,f=await w.value;J.push({key:G,value:f,alwaysSet:w.alwaysSet})}return J}).then((J)=>{return Hq.mergeObjectSync(K,J)});else return Hq.mergeObjectSync(K,z)}get shape(){return this._def.shape()}strict($){return F$.errToObj,new R6({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(q,K)=>{let P=this._def.errorMap?.(q,K).message??K.defaultError;if(q.code==="unrecognized_keys")return{message:F$.errToObj($).message??P};return{message:P}}}:{}})}strip(){return new R6({...this._def,unknownKeys:"strip"})}passthrough(){return new R6({...this._def,unknownKeys:"passthrough"})}extend($){return new R6({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new R6({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:e$.ZodObject})}setKey($,q){return this.augment({[$]:q})}catchall($){return new R6({...this._def,catchall:$})}pick($){let q={};for(let K of J6.objectKeys($))if($[K]&&this.shape[K])q[K]=this.shape[K];return new R6({...this._def,shape:()=>q})}omit($){let q={};for(let K of J6.objectKeys(this.shape))if(!$[K])q[K]=this.shape[K];return new R6({...this._def,shape:()=>q})}deepPartial(){return I_(this)}partial($){let q={};for(let K of J6.objectKeys(this.shape)){let P=this.shape[K];if($&&!$[K])q[K]=P;else q[K]=P.optional()}return new R6({...this._def,shape:()=>q})}required($){let q={};for(let K of J6.objectKeys(this.shape))if($&&!$[K])q[K]=this.shape[K];else{let _=this.shape[K];while(_ instanceof k8)_=_._def.innerType;q[K]=_}return new R6({...this._def,shape:()=>q})}keyof(){return oH(J6.objectKeys(this.shape))}}R6.create=($,q)=>{return new R6({shape:()=>$,unknownKeys:"strip",catchall:R8.create(),typeName:e$.ZodObject,...Y6(q)})};R6.strictCreate=($,q)=>{return new R6({shape:()=>$,unknownKeys:"strict",catchall:R8.create(),typeName:e$.ZodObject,...Y6(q)})};R6.lazycreate=($,q)=>{return new R6({shape:$,unknownKeys:"strip",catchall:R8.create(),typeName:e$.ZodObject,...Y6(q)})};class u_ extends W6{_parse($){let{ctx:q}=this._processInputParams($),K=this._def.options;function P(_){for(let j of _)if(j.result.status==="valid")return j.result;for(let j of _)if(j.result.status==="dirty")return q.common.issues.push(...j.ctx.common.issues),j.result;let O=_.map((j)=>new yq(j.ctx.common.issues));return n$(q,{code:c$.invalid_union,unionErrors:O}),Q$}if(q.common.async)return Promise.all(K.map(async(_)=>{let O={...q,common:{...q.common,issues:[]},parent:null};return{result:await _._parseAsync({data:q.data,path:q.path,parent:O}),ctx:O}})).then(P);else{let _=void 0,O=[];for(let z of K){let J={...q,common:{...q.common,issues:[]},parent:null},w=z._parseSync({data:q.data,path:q.path,parent:J});if(w.status==="valid")return w;else if(w.status==="dirty"&&!_)_={result:w,ctx:J};if(J.common.issues.length)O.push(J.common.issues)}if(_)return q.common.issues.push(..._.ctx.common.issues),_.result;let j=O.map((z)=>new yq(z));return n$(q,{code:c$.invalid_union,unionErrors:j}),Q$}}get options(){return this._def.options}}u_.create=($,q)=>{return new u_({options:$,typeName:e$.ZodUnion,...Y6(q)})};var a8=($)=>{if($ instanceof p_)return a8($.schema);else if($ instanceof G8)return a8($.innerType());else if($ instanceof x_)return[$.value];else if($ instanceof MK)return $.options;else if($ instanceof c_)return J6.objectValues($.enum);else if($ instanceof m_)return a8($._def.innerType);else if($ instanceof L_)return[void 0];else if($ instanceof b_)return[null];else if($ instanceof k8)return[void 0,...a8($.unwrap())];else if($ instanceof Q8)return[null,...a8($.unwrap())];else if($ instanceof i7)return a8($.unwrap());else if($ instanceof l_)return a8($.unwrap());else if($ instanceof d_)return a8($._def.innerType);else return[]};class n7 extends W6{_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==r$.object)return n$(q,{code:c$.invalid_type,expected:r$.object,received:q.parsedType}),Q$;let K=this.discriminator,P=q.data[K],_=this.optionsMap.get(P);if(!_)return n$(q,{code:c$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[K]}),Q$;if(q.common.async)return _._parseAsync({data:q.data,path:q.path,parent:q});else return _._parseSync({data:q.data,path:q.path,parent:q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,q,K){let P=new Map;for(let _ of q){let O=a8(_.shape[$]);if(!O.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let j of O){if(P.has(j))throw Error(`Discriminator property ${String($)} has duplicate value ${String(j)}`);P.set(j,_)}}return new n7({typeName:e$.ZodDiscriminatedUnion,discriminator:$,options:q,optionsMap:P,...Y6(K)})}}function OO($,q){let K=h8($),P=h8(q);if($===q)return{valid:!0,data:$};else if(K===r$.object&&P===r$.object){let _=J6.objectKeys(q),O=J6.objectKeys($).filter((z)=>_.indexOf(z)!==-1),j={...$,...q};for(let z of O){let J=OO($[z],q[z]);if(!J.valid)return{valid:!1};j[z]=J.data}return{valid:!0,data:j}}else if(K===r$.array&&P===r$.array){if($.length!==q.length)return{valid:!1};let _=[];for(let O=0;O<$.length;O++){let j=$[O],z=q[O],J=OO(j,z);if(!J.valid)return{valid:!1};_.push(J.data)}return{valid:!0,data:_}}else if(K===r$.date&&P===r$.date&&+$===+q)return{valid:!0,data:$};else return{valid:!1}}class y_ extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($),P=(_,O)=>{if(o7(_)||o7(O))return Q$;let j=OO(_.value,O.value);if(!j.valid)return n$(K,{code:c$.invalid_intersection_types}),Q$;if(r7(_)||r7(O))q.dirty();return{status:q.value,value:j.data}};if(K.common.async)return Promise.all([this._def.left._parseAsync({data:K.data,path:K.path,parent:K}),this._def.right._parseAsync({data:K.data,path:K.path,parent:K})]).then(([_,O])=>P(_,O));else return P(this._def.left._parseSync({data:K.data,path:K.path,parent:K}),this._def.right._parseSync({data:K.data,path:K.path,parent:K}))}}y_.create=($,q,K)=>{return new y_({left:$,right:q,typeName:e$.ZodIntersection,...Y6(K)})};class I8 extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.array)return n$(K,{code:c$.invalid_type,expected:r$.array,received:K.parsedType}),Q$;if(K.data.length<this._def.items.length)return n$(K,{code:c$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q$;if(!this._def.rest&&K.data.length>this._def.items.length)n$(K,{code:c$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q.dirty();let _=[...K.data].map((O,j)=>{let z=this._def.items[j]||this._def.rest;if(!z)return null;return z._parse(new A8(K,O,K.path,j))}).filter((O)=>!!O);if(K.common.async)return Promise.all(_).then((O)=>{return Hq.mergeArray(q,O)});else return Hq.mergeArray(q,_)}get items(){return this._def.items}rest($){return new I8({...this._def,rest:$})}}I8.create=($,q)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new I8({items:$,typeName:e$.ZodTuple,rest:null,...Y6(q)})};class B4 extends W6{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.object)return n$(K,{code:c$.invalid_type,expected:r$.object,received:K.parsedType}),Q$;let P=[],_=this._def.keyType,O=this._def.valueType;for(let j in K.data)P.push({key:_._parse(new A8(K,j,K.path,j)),value:O._parse(new A8(K,K.data[j],K.path,j)),alwaysSet:j in K.data});if(K.common.async)return Hq.mergeObjectAsync(q,P);else return Hq.mergeObjectSync(q,P)}get element(){return this._def.valueType}static create($,q,K){if(q instanceof W6)return new B4({keyType:$,valueType:q,typeName:e$.ZodRecord,...Y6(K)});return new B4({keyType:X8.create(),valueType:$,typeName:e$.ZodRecord,...Y6(q)})}}class U4 extends W6{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.map)return n$(K,{code:c$.invalid_type,expected:r$.map,received:K.parsedType}),Q$;let P=this._def.keyType,_=this._def.valueType,O=[...K.data.entries()].map(([j,z],J)=>{return{key:P._parse(new A8(K,j,K.path,[J,"key"])),value:_._parse(new A8(K,z,K.path,[J,"value"]))}});if(K.common.async){let j=new Map;return Promise.resolve().then(async()=>{for(let z of O){let J=await z.key,w=await z.value;if(J.status==="aborted"||w.status==="aborted")return Q$;if(J.status==="dirty"||w.status==="dirty")q.dirty();j.set(J.value,w.value)}return{status:q.value,value:j}})}else{let j=new Map;for(let z of O){let{key:J,value:w}=z;if(J.status==="aborted"||w.status==="aborted")return Q$;if(J.status==="dirty"||w.status==="dirty")q.dirty();j.set(J.value,w.value)}return{status:q.value,value:j}}}}U4.create=($,q,K)=>{return new U4({valueType:q,keyType:$,typeName:e$.ZodMap,...Y6(K)})};class tK extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.parsedType!==r$.set)return n$(K,{code:c$.invalid_type,expected:r$.set,received:K.parsedType}),Q$;let P=this._def;if(P.minSize!==null){if(K.data.size<P.minSize.value)n$(K,{code:c$.too_small,minimum:P.minSize.value,type:"set",inclusive:!0,exact:!1,message:P.minSize.message}),q.dirty()}if(P.maxSize!==null){if(K.data.size>P.maxSize.value)n$(K,{code:c$.too_big,maximum:P.maxSize.value,type:"set",inclusive:!0,exact:!1,message:P.maxSize.message}),q.dirty()}let _=this._def.valueType;function O(z){let J=new Set;for(let w of z){if(w.status==="aborted")return Q$;if(w.status==="dirty")q.dirty();J.add(w.value)}return{status:q.value,value:J}}let j=[...K.data.values()].map((z,J)=>_._parse(new A8(K,z,K.path,J)));if(K.common.async)return Promise.all(j).then((z)=>O(z));else return O(j)}min($,q){return new tK({...this._def,minSize:{value:$,message:F$.toString(q)}})}max($,q){return new tK({...this._def,maxSize:{value:$,message:F$.toString(q)}})}size($,q){return this.min($,q).max($,q)}nonempty($){return this.min(1,$)}}tK.create=($,q)=>{return new tK({valueType:$,minSize:null,maxSize:null,typeName:e$.ZodSet,...Y6(q)})};class D_ extends W6{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==r$.function)return n$(q,{code:c$.invalid_type,expected:r$.function,received:q.parsedType}),Q$;function K(j,z){return n4({data:j,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,h_(),F8].filter((J)=>!!J),issueData:{code:c$.invalid_arguments,argumentsError:z}})}function P(j,z){return n4({data:j,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,h_(),F8].filter((J)=>!!J),issueData:{code:c$.invalid_return_type,returnTypeError:z}})}let _={errorMap:q.common.contextualErrorMap},O=q.data;if(this._def.returns instanceof BK){let j=this;return Mq(async function(...z){let J=new yq([]),w=await j._def.args.parseAsync(z,_).catch((A)=>{throw J.addIssue(K(z,A)),J}),G=await Reflect.apply(O,this,w);return await j._def.returns._def.type.parseAsync(G,_).catch((A)=>{throw J.addIssue(P(G,A)),J})})}else{let j=this;return Mq(function(...z){let J=j._def.args.safeParse(z,_);if(!J.success)throw new yq([K(z,J.error)]);let w=Reflect.apply(O,this,J.data),G=j._def.returns.safeParse(w,_);if(!G.success)throw new yq([P(w,G.error)]);return G.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new D_({...this._def,args:I8.create($).rest(GK.create())})}returns($){return new D_({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,q,K){return new D_({args:$?$:I8.create([]).rest(GK.create()),returns:q||GK.create(),typeName:e$.ZodFunction,...Y6(K)})}}class p_ extends W6{get schema(){return this._def.getter()}_parse($){let{ctx:q}=this._processInputParams($);return this._def.getter()._parse({data:q.data,path:q.path,parent:q})}}p_.create=($,q)=>{return new p_({getter:$,typeName:e$.ZodLazy,...Y6(q)})};class x_ extends W6{_parse($){if($.data!==this._def.value){let q=this._getOrReturnCtx($);return n$(q,{received:q.data,code:c$.invalid_literal,expected:this._def.value}),Q$}return{status:"valid",value:$.data}}get value(){return this._def.value}}x_.create=($,q)=>{return new x_({value:$,typeName:e$.ZodLiteral,...Y6(q)})};function oH($,q){return new MK({values:$,typeName:e$.ZodEnum,...Y6(q)})}class MK extends W6{_parse($){if(typeof $.data!=="string"){let q=this._getOrReturnCtx($),K=this._def.values;return n$(q,{expected:J6.joinValues(K),received:q.parsedType,code:c$.invalid_type}),Q$}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let q=this._getOrReturnCtx($),K=this._def.values;return n$(q,{received:q.data,code:c$.invalid_enum_value,options:K}),Q$}return Mq($.data)}get options(){return this._def.values}get enum(){let $={};for(let q of this._def.values)$[q]=q;return $}get Values(){let $={};for(let q of this._def.values)$[q]=q;return $}get Enum(){let $={};for(let q of this._def.values)$[q]=q;return $}extract($,q=this._def){return MK.create($,{...this._def,...q})}exclude($,q=this._def){return MK.create(this.options.filter((K)=>!$.includes(K)),{...this._def,...q})}}MK.create=oH;class c_ extends W6{_parse($){let q=J6.getValidEnumValues(this._def.values),K=this._getOrReturnCtx($);if(K.parsedType!==r$.string&&K.parsedType!==r$.number){let P=J6.objectValues(q);return n$(K,{expected:J6.joinValues(P),received:K.parsedType,code:c$.invalid_type}),Q$}if(!this._cache)this._cache=new Set(J6.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let P=J6.objectValues(q);return n$(K,{received:K.data,code:c$.invalid_enum_value,options:P}),Q$}return Mq($.data)}get enum(){return this._def.values}}c_.create=($,q)=>{return new c_({values:$,typeName:e$.ZodNativeEnum,...Y6(q)})};class BK extends W6{unwrap(){return this._def.type}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==r$.promise&&q.common.async===!1)return n$(q,{code:c$.invalid_type,expected:r$.promise,received:q.parsedType}),Q$;let K=q.parsedType===r$.promise?q.data:Promise.resolve(q.data);return Mq(K.then((P)=>{return this._def.type.parseAsync(P,{path:q.path,errorMap:q.common.contextualErrorMap})}))}}BK.create=($,q)=>{return new BK({type:$,typeName:e$.ZodPromise,...Y6(q)})};class G8 extends W6{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===e$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:q,ctx:K}=this._processInputParams($),P=this._def.effect||null,_={addIssue:(O)=>{if(n$(K,O),O.fatal)q.abort();else q.dirty()},get path(){return K.path}};if(_.addIssue=_.addIssue.bind(_),P.type==="preprocess"){let O=P.transform(K.data,_);if(K.common.async)return Promise.resolve(O).then(async(j)=>{if(q.value==="aborted")return Q$;let z=await this._def.schema._parseAsync({data:j,path:K.path,parent:K});if(z.status==="aborted")return Q$;if(z.status==="dirty")return rK(z.value);if(q.value==="dirty")return rK(z.value);return z});else{if(q.value==="aborted")return Q$;let j=this._def.schema._parseSync({data:O,path:K.path,parent:K});if(j.status==="aborted")return Q$;if(j.status==="dirty")return rK(j.value);if(q.value==="dirty")return rK(j.value);return j}}if(P.type==="refinement"){let O=(j)=>{let z=P.refinement(j,_);if(K.common.async)return Promise.resolve(z);if(z instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return j};if(K.common.async===!1){let j=this._def.schema._parseSync({data:K.data,path:K.path,parent:K});if(j.status==="aborted")return Q$;if(j.status==="dirty")q.dirty();return O(j.value),{status:q.value,value:j.value}}else return this._def.schema._parseAsync({data:K.data,path:K.path,parent:K}).then((j)=>{if(j.status==="aborted")return Q$;if(j.status==="dirty")q.dirty();return O(j.value).then(()=>{return{status:q.value,value:j.value}})})}if(P.type==="transform")if(K.common.async===!1){let O=this._def.schema._parseSync({data:K.data,path:K.path,parent:K});if(!AK(O))return Q$;let j=P.transform(O.value,_);if(j instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:q.value,value:j}}else return this._def.schema._parseAsync({data:K.data,path:K.path,parent:K}).then((O)=>{if(!AK(O))return Q$;return Promise.resolve(P.transform(O.value,_)).then((j)=>({status:q.value,value:j}))});J6.assertNever(P)}}G8.create=($,q,K)=>{return new G8({schema:$,typeName:e$.ZodEffects,effect:q,...Y6(K)})};G8.createWithPreprocess=($,q,K)=>{return new G8({schema:q,effect:{type:"preprocess",transform:$},typeName:e$.ZodEffects,...Y6(K)})};class k8 extends W6{_parse($){if(this._getType($)===r$.undefined)return Mq(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}k8.create=($,q)=>{return new k8({innerType:$,typeName:e$.ZodOptional,...Y6(q)})};class Q8 extends W6{_parse($){if(this._getType($)===r$.null)return Mq(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Q8.create=($,q)=>{return new Q8({innerType:$,typeName:e$.ZodNullable,...Y6(q)})};class m_ extends W6{_parse($){let{ctx:q}=this._processInputParams($),K=q.data;if(q.parsedType===r$.undefined)K=this._def.defaultValue();return this._def.innerType._parse({data:K,path:q.path,parent:q})}removeDefault(){return this._def.innerType}}m_.create=($,q)=>{return new m_({innerType:$,typeName:e$.ZodDefault,defaultValue:typeof q.default==="function"?q.default:()=>q.default,...Y6(q)})};class d_ extends W6{_parse($){let{ctx:q}=this._processInputParams($),K={...q,common:{...q.common,issues:[]}},P=this._def.innerType._parse({data:K.data,path:K.path,parent:{...K}});if(R_(P))return P.then((_)=>{return{status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new yq(K.common.issues)},input:K.data})}});else return{status:"valid",value:P.status==="valid"?P.value:this._def.catchValue({get error(){return new yq(K.common.issues)},input:K.data})}}removeCatch(){return this._def.innerType}}d_.create=($,q)=>{return new d_({innerType:$,typeName:e$.ZodCatch,catchValue:typeof q.catch==="function"?q.catch:()=>q.catch,...Y6(q)})};class F4 extends W6{_parse($){if(this._getType($)!==r$.nan){let K=this._getOrReturnCtx($);return n$(K,{code:c$.invalid_type,expected:r$.nan,received:K.parsedType}),Q$}return{status:"valid",value:$.data}}}F4.create=($)=>{return new F4({typeName:e$.ZodNaN,...Y6($)})};var BM=Symbol("zod_brand");class i7 extends W6{_parse($){let{ctx:q}=this._processInputParams($),K=q.data;return this._def.type._parse({data:K,path:q.path,parent:q})}unwrap(){return this._def.type}}class a4 extends W6{_parse($){let{status:q,ctx:K}=this._processInputParams($);if(K.common.async)return(async()=>{let _=await this._def.in._parseAsync({data:K.data,path:K.path,parent:K});if(_.status==="aborted")return Q$;if(_.status==="dirty")return q.dirty(),rK(_.value);else return this._def.out._parseAsync({data:_.value,path:K.path,parent:K})})();else{let P=this._def.in._parseSync({data:K.data,path:K.path,parent:K});if(P.status==="aborted")return Q$;if(P.status==="dirty")return q.dirty(),{status:"dirty",value:P.value};else return this._def.out._parseSync({data:P.value,path:K.path,parent:K})}}static create($,q){return new a4({in:$,out:q,typeName:e$.ZodPipeline})}}class l_ extends W6{_parse($){let q=this._def.innerType._parse($),K=(P)=>{if(AK(P))P.value=Object.freeze(P.value);return P};return R_(q)?q.then((P)=>K(P)):K(q)}unwrap(){return this._def.innerType}}l_.create=($,q)=>{return new l_({innerType:$,typeName:e$.ZodReadonly,...Y6(q)})};function cH($,q){let K=typeof $==="function"?$(q):typeof $==="string"?{message:$}:$;return typeof K==="string"?{message:K}:K}function rH($,q={},K){if($)return iK.create().superRefine((P,_)=>{let O=$(P);if(O instanceof Promise)return O.then((j)=>{if(!j){let z=cH(q,P),J=z.fatal??K??!0;_.addIssue({code:"custom",...z,fatal:J})}});if(!O){let j=cH(q,P),z=j.fatal??K??!0;_.addIssue({code:"custom",...j,fatal:z})}return});return iK.create()}var UM={object:R6.lazycreate},e$;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(e$||(e$={}));var FM=($,q={message:`Input not instance of ${$.name}`})=>rH((K)=>K instanceof $,q),nH=X8.create,iH=VK.create,aM=F4.create,QM=SK.create,tH=g_.create,eM=nK.create,sM=i4.create,$0=L_.create,q0=b_.create,K0=iK.create,_0=GK.create,P0=R8.create,j0=t4.create,O0=f8.create,Y0=R6.create,v0=R6.strictCreate,z0=u_.create,W0=n7.create,H0=y_.create,J0=I8.create,T0=B4.create,w0=U4.create,Z0=tK.create,X0=D_.create,f0=p_.create,k0=x_.create,A0=MK.create,G0=c_.create,V0=BK.create,S0=G8.create,M0=k8.create,N0=Q8.create,C0=G8.createWithPreprocess,E0=a4.create,h0=()=>nH().optional(),R0=()=>iH().optional(),I0=()=>tH().optional(),D0={string:($)=>X8.create({...$,coerce:!0}),number:($)=>VK.create({...$,coerce:!0}),boolean:($)=>g_.create({...$,coerce:!0}),bigint:($)=>SK.create({...$,coerce:!0}),date:($)=>nK.create({...$,coerce:!0})};var g0=Q$;var Xz=Uq(B7(),1);var eH=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function l0($){return typeof $==="string"&&eH.test($)}var o_=l0;var Jq=[];for(Q4=0;Q4<256;++Q4)Jq.push((Q4+256).toString(16).slice(1));var Q4;function sH($,q=0){return(Jq[$[q+0]]+Jq[$[q+1]]+Jq[$[q+2]]+Jq[$[q+3]]+"-"+Jq[$[q+4]]+Jq[$[q+5]]+"-"+Jq[$[q+6]]+Jq[$[q+7]]+"-"+Jq[$[q+8]]+Jq[$[q+9]]+"-"+Jq[$[q+10]]+Jq[$[q+11]]+Jq[$[q+12]]+Jq[$[q+13]]+Jq[$[q+14]]+Jq[$[q+15]]).toLowerCase()}var U7,o0=new Uint8Array(16);function vO(){if(!U7){if(U7=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!U7)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return U7(o0)}var r0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zO={randomUUID:r0};function n0($,q,K){if(zO.randomUUID&&!q&&!$)return zO.randomUUID();$=$||{};var P=$.random||($.rng||vO)();if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){K=K||0;for(var _=0;_<16;++_)q[K+_]=P[_];return q}return sH(P)}var pq=n0;class $J{getStore(){return}run($,q){return q()}}var WO=Symbol.for("ls:tracing_async_local_storage"),t0=new $J;class qJ{getInstance(){return globalThis[WO]??t0}initializeGlobalInstance($){if(globalThis[WO]===void 0)globalThis[WO]=$}}var B0=new qJ;function KJ($=!1){let q=B0.getInstance().getStore();if(!$&&q===void 0)throw Error(`Could not get the current run tree.
|
|
40
40
|
|
|
41
41
|
Please make sure you are calling this method within a traceable function and that tracing is enabled.`);return q}function F7($){return typeof $==="function"&&"langsmith:traceable"in $}var HO={};uq(HO,{validator:()=>$1,validate:()=>OJ,getValueByPointer:()=>s7,deepClone:()=>F0,applyReducer:()=>Q0,applyPatch:()=>aK,applyOperation:()=>FK,_areEquals:()=>s4,JsonPatchError:()=>g6});/*!
|
|
42
42
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
@@ -47,7 +47,7 @@ Please make sure you are calling this method within a traceable function and tha
|
|
|
47
47
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
48
48
|
* (c) 2013-2021 Joachim Wester
|
|
49
49
|
* MIT license
|
|
50
|
-
*/var mn={...HO,JsonPatchError:r_,deepClone:P8,escapePathComponent:e7,unescapePathComponent:e4};var YJ=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function e0($){return typeof $==="string"&&YJ.test($)}var vJ=e0;function s0($){if(!vJ($))throw TypeError("Invalid UUID");var q,K=new Uint8Array(16);return K[0]=(q=parseInt($.slice(0,8),16))>>>24,K[1]=q>>>16&255,K[2]=q>>>8&255,K[3]=q&255,K[4]=(q=parseInt($.slice(9,13),16))>>>8,K[5]=q&255,K[6]=(q=parseInt($.slice(14,18),16))>>>8,K[7]=q&255,K[8]=(q=parseInt($.slice(19,23),16))>>>8,K[9]=q&255,K[10]=(q=parseInt($.slice(24,36),16))/1099511627776&255,K[11]=q/4294967296&255,K[12]=q>>>24&255,K[13]=q>>>16&255,K[14]=q>>>8&255,K[15]=q&255,K}var zJ=s0;var Tq=[];for($P=0;$P<256;++$P)Tq.push(($P+256).toString(16).slice(1));var $P;function q1($,q=0){return(Tq[$[q+0]]+Tq[$[q+1]]+Tq[$[q+2]]+Tq[$[q+3]]+"-"+Tq[$[q+4]]+Tq[$[q+5]]+"-"+Tq[$[q+6]]+Tq[$[q+7]]+"-"+Tq[$[q+8]]+Tq[$[q+9]]+"-"+Tq[$[q+10]]+Tq[$[q+11]]+Tq[$[q+12]]+Tq[$[q+13]]+Tq[$[q+14]]+Tq[$[q+15]]).toLowerCase()}var K1,$N=new Uint8Array(16);function JO(){if(!K1){if(K1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!K1)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return K1($N)}function qN($){$=unescape(encodeURIComponent($));var q=[];for(var K=0;K<$.length;++K)q.push($.charCodeAt(K));return q}var KN="6ba7b810-9dad-11d1-80b4-00c04fd430c8",_N="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function TO($,q,K){function P(_,O,j,z){var J;if(typeof _==="string")_=qN(_);if(typeof O==="string")O=zJ(O);if(((J=O)===null||J===void 0?void 0:J.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var w=new Uint8Array(16+_.length);if(w.set(O),w.set(_,O.length),w=K(w),w[6]=w[6]&15|q,w[8]=w[8]&63|128,j){z=z||0;for(var G=0;G<16;++G)j[z+G]=w[G];return j}return q1(w)}try{P.name=$}catch(_){}return P.DNS=KN,P.URL=_N,P}var PN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wO={randomUUID:PN};function jN($,q,K){if(wO.randomUUID&&!q&&!$)return wO.randomUUID();$=$||{};var P=$.random||($.rng||JO)();if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){K=K||0;for(var _=0;_<16;++_)q[K+_]=P[_];return q}return q1(P)}var e8=jN;function ON($,q,K,P){switch($){case 0:return q&K^~q&P;case 1:return q^K^P;case 2:return q&K^q&P^K&P;case 3:return q^K^P}}function ZO($,q){return $<<q|$>>>32-q}function YN($){var q=[1518500249,1859775393,2400959708,3395469782],K=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof $==="string"){var P=unescape(encodeURIComponent($));$=[];for(var _=0;_<P.length;++_)$.push(P.charCodeAt(_))}else if(!Array.isArray($))$=Array.prototype.slice.call($);$.push(128);var O=$.length/4+2,j=Math.ceil(O/16),z=Array(j);for(var J=0;J<j;++J){var w=new Uint32Array(16);for(var G=0;G<16;++G)w[G]=$[J*64+G*4]<<24|$[J*64+G*4+1]<<16|$[J*64+G*4+2]<<8|$[J*64+G*4+3];z[J]=w}z[j-1][14]=($.length-1)*8/Math.pow(2,32),z[j-1][14]=Math.floor(z[j-1][14]),z[j-1][15]=($.length-1)*8&4294967295;for(var f=0;f<j;++f){var A=new Uint32Array(80);for(var V=0;V<16;++V)A[V]=z[f][V];for(var C=16;C<80;++C)A[C]=ZO(A[C-3]^A[C-8]^A[C-14]^A[C-16],1);var E=K[0],R=K[1],I=K[2],D=K[3],b=K[4];for(var u=0;u<80;++u){var y=Math.floor(u/20),c=ZO(E,5)+ON(y,R,I,D)+b+q[y]+A[u]>>>0;b=D,D=I,I=ZO(R,30)>>>0,R=E,E=c}K[0]=K[0]+E>>>0,K[1]=K[1]+R>>>0,K[2]=K[2]+I>>>0,K[3]=K[3]+D>>>0,K[4]=K[4]+b>>>0}return[K[0]>>24&255,K[0]>>16&255,K[0]>>8&255,K[0]&255,K[1]>>24&255,K[1]>>16&255,K[1]>>8&255,K[1]&255,K[2]>>24&255,K[2]>>16&255,K[2]>>8&255,K[2]&255,K[3]>>24&255,K[3]>>16&255,K[3]>>8&255,K[3]&255,K[4]>>24&255,K[4]>>16&255,K[4]>>8&255,K[4]&255]}var WJ=YN;var vN=TO("v5",80,WJ),_1=vN;var JJ="gen_ai.operation.name",TJ="gen_ai.system",XO="gen_ai.request.model",wJ="gen_ai.response.model",fO="gen_ai.usage.input_tokens",kO="gen_ai.usage.output_tokens",AO="gen_ai.usage.total_tokens",ZJ="gen_ai.request.max_tokens",XJ="gen_ai.request.temperature",fJ="gen_ai.request.top_p",kJ="gen_ai.request.frequency_penalty",AJ="gen_ai.request.presence_penalty",GJ="gen_ai.response.finish_reasons",VJ="gen_ai.prompt",SJ="gen_ai.completion",MJ="gen_ai.request.extra_query",NJ="gen_ai.request.extra_body",CJ="gen_ai.serialized.name",EJ="gen_ai.serialized.signature",hJ="gen_ai.serialized.doc",RJ="gen_ai.response.id",IJ="gen_ai.response.service_tier",DJ="gen_ai.response.system_fingerprint",gJ="gen_ai.usage.input_token_details",LJ="gen_ai.usage.output_token_details",bJ="langsmith.trace.session_id",uJ="langsmith.trace.session_name",yJ="langsmith.span.kind",pJ="langsmith.trace.name",xJ="langsmith.metadata",GO="langsmith.span.tags";var cJ="langsmith.request.streaming",mJ="langsmith.request.headers";var WN=(...$)=>fetch(...$),dJ=Symbol.for("ls:fetch_implementation");var lJ=()=>{let $=globalThis[dJ];if(!$)return!1;return typeof $==="function"&&"Headers"in $&&"Request"in $&&"Response"in $},oJ=($)=>{return async(...q)=>{if($||y6("DEBUG")==="true"){let[P,_]=q;console.log(`→ ${_?.method||"GET"} ${P}`)}let K=await(globalThis[dJ]??WN)(...q);if($||y6("DEBUG")==="true")console.log(`← ${K.status} ${K.statusText} ${K.url}`);return K}};var qP=()=>{return y6("PROJECT")??Fq("LANGCHAIN_SESSION")??"default"};var P1="0.3.71";var D8,HN=()=>typeof window<"u"&&typeof window.document<"u",JN=()=>typeof globalThis==="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",TN=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),rJ=()=>typeof Deno<"u",wN=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!rJ(),MO=()=>{if(D8)return D8;if(typeof Bun<"u")D8="bun";else if(HN())D8="browser";else if(wN())D8="node";else if(JN())D8="webworker";else if(TN())D8="jsdom";else if(rJ())D8="deno";else D8="other";return D8},VO;function j1(){if(VO===void 0){let $=MO(),q=XN();VO={library:"langsmith",runtime:$,sdk:"langsmith-js",sdk_version:P1,...q}}return VO}function nJ(){let $=ZN()||{},q={},K=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION","LANGSMITH_API_KEY","LANGSMITH_ENDPOINT","LANGSMITH_TRACING_V2","LANGSMITH_PROJECT","LANGSMITH_SESSION"];for(let[P,_]of Object.entries($))if((P.startsWith("LANGCHAIN_")||P.startsWith("LANGSMITH_"))&&typeof _==="string"&&!K.includes(P)&&!P.toLowerCase().includes("key")&&!P.toLowerCase().includes("secret")&&!P.toLowerCase().includes("token"))if(P==="LANGCHAIN_REVISION_ID")q.revision_id=_;else q[P]=_;return q}function ZN(){try{if(typeof process<"u"&&process.env)return Object.entries(process.env).reduce(($,[q,K])=>{return $[q]=String(K),$},{});return}catch($){return}}function Fq($){try{return typeof process<"u"?process.env?.[$]:void 0}catch(q){return}}function y6($){return Fq(`LANGSMITH_${$}`)||Fq(`LANGCHAIN_${$}`)}var SO;function XN(){if(SO!==void 0)return SO;let $=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],q={};for(let K of $){let P=Fq(K);if(P!==void 0)q[K]=P}return SO=q,q}function O1(){return Fq("OTEL_ENABLED")==="true"||y6("OTEL_ENABLED")==="true"}class tJ{constructor(){Object.defineProperty(this,"hasWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startActiveSpan($,...q){if(!this.hasWarned&&O1())console.warn('You have enabled OTEL export via the `OTEL_ENABLED` or `LANGSMITH_OTEL_ENABLED` environment variable, but have not initialized the required OTEL instances. Please add:\n```\nimport { initializeOTEL } from "langsmith/experimental/otel/setup";\ninitializeOTEL();\n```\nat the beginning of your code.'),this.hasWarned=!0;let K;if(q.length===1&&typeof q[0]==="function")K=q[0];else if(q.length===2&&typeof q[1]==="function")K=q[1];else if(q.length===3&&typeof q[2]==="function")K=q[2];if(typeof K==="function")return K();return}}class BJ{constructor(){Object.defineProperty(this,"mockTracer",{enumerable:!0,configurable:!0,writable:!0,value:new tJ})}getTracer($,q){return this.mockTracer}getActiveSpan(){return}setSpan($,q){return $}getSpan($){return}setSpanContext($,q){return $}getTracerProvider(){return}setGlobalTracerProvider($){return!1}}class UJ{active(){return{}}with($,q){return q()}}var NO=Symbol.for("ls:otel_trace"),CO=Symbol.for("ls:otel_context"),iJ=Symbol.for("ls:otel_get_default_otlp_tracer_provider"),fN=new BJ,kN=new UJ;class FJ{getTraceInstance(){return globalThis[NO]??fN}getContextInstance(){return globalThis[CO]??kN}initializeGlobalInstances($){if(globalThis[NO]===void 0)globalThis[NO]=$.trace;if(globalThis[CO]===void 0)globalThis[CO]=$.context}setDefaultOTLPTracerComponents($){globalThis[iJ]=$}getDefaultOTLPTracerComponents(){return globalThis[iJ]??void 0}}var EO=new FJ;function Y1(){return EO.getTraceInstance()}function aJ(){return EO.getContextInstance()}function QJ(){return EO.getDefaultOTLPTracerComponents()}var AN={llm:"chat",tool:"execute_tool",retriever:"embeddings",embedding:"embeddings",prompt:"chat"};function GN($){return AN[$]||$}class hO{constructor(){Object.defineProperty(this,"spans",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}exportBatch($,q){for(let K of $)try{if(!K.run)continue;if(K.operation==="post"){let P=this.createSpanForRun(K,K.run,q.get(K.id));if(P&&!K.run.end_time)this.spans.set(K.id,P)}else this.updateSpanForRun(K,K.run)}catch(P){console.error(`Error processing operation ${K.id}:`,P)}}createSpanForRun($,q,K){let P=K&&Y1().getSpan(K);if(!P)return;try{return this.finishSpanSetup(P,q,$)}catch(_){console.error(`Failed to create span for run ${$.id}:`,_);return}}finishSpanSetup($,q,K){if(this.setSpanAttributes($,q,K),q.error)$.setStatus({code:2}),$.recordException(Error(q.error));else $.setStatus({code:1});if(q.end_time)$.end(new Date(q.end_time));return $}updateSpanForRun($,q){try{let K=this.spans.get($.id);if(!K){console.debug(`No span found for run ${$.id} during update`);return}if(this.setSpanAttributes(K,q,$),q.error)K.setStatus({code:2}),K.recordException(Error(q.error));else K.setStatus({code:1});let P=q.end_time;if(P)K.end(new Date(P)),this.spans.delete($.id)}catch(K){console.error(`Failed to update span for run ${$.id}:`,K)}}extractModelName($){if($.extra?.metadata){let q=$.extra.metadata;if(q.ls_model_name)return q.ls_model_name;if(q.invocation_params){let K=q.invocation_params;if(K.model)return K.model;else if(K.model_name)return K.model_name}}return}setSpanAttributes($,q,K){if("run_type"in q&&q.run_type){$.setAttribute(yJ,q.run_type);let j=GN(q.run_type||"chain");$.setAttribute(JJ,j)}if("name"in q&&q.name)$.setAttribute(pJ,q.name);if("session_id"in q&&q.session_id)$.setAttribute(bJ,q.session_id);if("session_name"in q&&q.session_name)$.setAttribute(uJ,q.session_name);this.setGenAiSystem($,q);let P=this.extractModelName(q);if(P)$.setAttribute(XO,P);if("prompt_tokens"in q&&typeof q.prompt_tokens==="number")$.setAttribute(fO,q.prompt_tokens);if("completion_tokens"in q&&typeof q.completion_tokens==="number")$.setAttribute(kO,q.completion_tokens);if("total_tokens"in q&&typeof q.total_tokens==="number")$.setAttribute(AO,q.total_tokens);this.setInvocationParameters($,q);let _=q.extra?.metadata||{};for(let[j,z]of Object.entries(_))if(z!==null&&z!==void 0)$.setAttribute(`${xJ}.${j}`,String(z));let O=q.tags;if(O&&Array.isArray(O))$.setAttribute(GO,O.join(", "));else if(O)$.setAttribute(GO,String(O));if("serialized"in q&&typeof q.serialized==="object"){let j=q.serialized;if(j.name)$.setAttribute(CJ,String(j.name));if(j.signature)$.setAttribute(EJ,String(j.signature));if(j.doc)$.setAttribute(hJ,String(j.doc))}this.setIOAttributes($,K)}setGenAiSystem($,q){let K="langchain",P=this.extractModelName(q);if(P){let _=P.toLowerCase();if(_.includes("anthropic")||_.startsWith("claude"))K="anthropic";else if(_.includes("bedrock"))K="aws.bedrock";else if(_.includes("azure")&&_.includes("openai"))K="az.ai.openai";else if(_.includes("azure")&&_.includes("inference"))K="az.ai.inference";else if(_.includes("cohere"))K="cohere";else if(_.includes("deepseek"))K="deepseek";else if(_.includes("gemini"))K="gemini";else if(_.includes("groq"))K="groq";else if(_.includes("watson")||_.includes("ibm"))K="ibm.watsonx.ai";else if(_.includes("mistral"))K="mistral_ai";else if(_.includes("gpt")||_.includes("openai"))K="openai";else if(_.includes("perplexity")||_.includes("sonar"))K="perplexity";else if(_.includes("vertex"))K="vertex_ai";else if(_.includes("xai")||_.includes("grok"))K="xai"}$.setAttribute(TJ,K)}setInvocationParameters($,q){if(!q.extra?.metadata?.invocation_params)return;let K=q.extra.metadata.invocation_params;if(K.max_tokens!==void 0)$.setAttribute(ZJ,K.max_tokens);if(K.temperature!==void 0)$.setAttribute(XJ,K.temperature);if(K.top_p!==void 0)$.setAttribute(fJ,K.top_p);if(K.frequency_penalty!==void 0)$.setAttribute(kJ,K.frequency_penalty);if(K.presence_penalty!==void 0)$.setAttribute(AJ,K.presence_penalty)}setIOAttributes($,q){if(q.run.inputs)try{let K=q.run.inputs;if(typeof K==="object"&&K!==null){if(K.model&&Array.isArray(K.messages))$.setAttribute(XO,K.model);if(K.stream!==void 0)$.setAttribute(cJ,K.stream);if(K.extra_headers)$.setAttribute(mJ,JSON.stringify(K.extra_headers));if(K.extra_query)$.setAttribute(MJ,JSON.stringify(K.extra_query));if(K.extra_body)$.setAttribute(NJ,JSON.stringify(K.extra_body))}$.setAttribute(VJ,JSON.stringify(K))}catch(K){console.debug(`Failed to process inputs for run ${q.id}`,K)}if(q.run.outputs)try{let K=q.run.outputs,P=this.getUnifiedRunTokens(K);if(P)$.setAttribute(fO,P[0]),$.setAttribute(kO,P[1]),$.setAttribute(AO,P[0]+P[1]);if(K&&typeof K==="object"){if(K.model)$.setAttribute(wJ,String(K.model));if(K.id)$.setAttribute(RJ,K.id);if(K.choices&&Array.isArray(K.choices)){let _=K.choices.map((O)=>O.finish_reason).filter((O)=>O).map(String);if(_.length>0)$.setAttribute(GJ,_.join(", "))}if(K.service_tier)$.setAttribute(IJ,K.service_tier);if(K.system_fingerprint)$.setAttribute(DJ,K.system_fingerprint);if(K.usage_metadata&&typeof K.usage_metadata==="object"){let _=K.usage_metadata;if(_.input_token_details)$.setAttribute(gJ,JSON.stringify(_.input_token_details));if(_.output_token_details)$.setAttribute(LJ,JSON.stringify(_.output_token_details))}}$.setAttribute(SJ,JSON.stringify(K))}catch(K){console.debug(`Failed to process outputs for run ${q.id}`,K)}}getUnifiedRunTokens($){if(!$)return null;let q=this.extractUnifiedRunTokens($.usage_metadata);if(q)return q;let K=Object.keys($);for(let O of K){let j=$[O];if(!j||typeof j!=="object")continue;if(q=this.extractUnifiedRunTokens(j.usage_metadata),q)return q;if(j.lc===1&&j.kwargs&&typeof j.kwargs==="object"){if(q=this.extractUnifiedRunTokens(j.kwargs.usage_metadata),q)return q}}let P=$.generations||[];if(!Array.isArray(P))return null;let _=Array.isArray(P[0])?P.flat():P;for(let O of _)if(typeof O==="object"&&O.message&&typeof O.message==="object"&&O.message.kwargs&&typeof O.message.kwargs==="object"){if(q=this.extractUnifiedRunTokens(O.message.kwargs.usage_metadata),q)return q}return null}extractUnifiedRunTokens($){if(!$||typeof $!=="object")return null;if(typeof $.input_tokens!=="number"||typeof $.output_tokens!=="number")return null;return[$.input_tokens,$.output_tokens]}}var JT=Uq(B7(),1),J1=Uq(H1(),1),LN=[429,500,502,503,504];class T1{constructor($){if(Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=$.maxConcurrency??1/0,this.maxRetries=$.maxRetries??6,"default"in J1.default)this.queue=new J1.default.default({concurrency:this.maxConcurrency});else this.queue=new J1.default({concurrency:this.maxConcurrency});this.onFailedResponseHook=$?.onFailedResponseHook}call($,...q){let K=this.onFailedResponseHook;return this.queue.add(()=>JT.default(()=>$(...q).catch((P)=>{if(P instanceof Error)throw P;else throw Error(P)}),{async onFailedAttempt(P){if(P.message.startsWith("Cancel")||P.message.startsWith("TimeoutError")||P.name==="TimeoutError"||P.message.startsWith("AbortError"))throw P;if(P?.code==="ECONNABORTED")throw P;let _=P?.response;if(K){if(await K(_))return}let O=_?.status??P?.status;if(O){if(!LN.includes(+O))throw P}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions($,q,...K){if($.signal)return Promise.race([this.call(q,...K),new Promise((P,_)=>{$.signal?.addEventListener("abort",()=>{_(Error("AbortError"))})})]);return this.call(q,...K)}}function DO($){return typeof $?._getType==="function"}function gO($){let q={type:$._getType(),data:{content:$.content}};if($?.additional_kwargs&&Object.keys($.additional_kwargs).length>0)q.data.additional_kwargs={...$.additional_kwargs};return q}var bN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _6($,q){if(!bN.test($)){let K=q!==void 0?`Invalid UUID for ${q}: ${$}`:`Invalid UUID: ${$}`;throw Error(K)}return $}var TT={};function w1($){if(!TT[$])console.warn($),TT[$]=!0}var Eh=Uq(_Z(),1);function s8($){if(!$||$.split("/").length>2||$.startsWith("/")||$.endsWith("/")||$.split(":").length>2)throw Error(`Invalid identifier format: ${$}`);let[q,K]=$.split(":"),P=K||"latest";if(q.includes("/")){let[_,O]=q.split("/",2);if(!_||!O)throw Error(`Invalid identifier format: ${$}`);return[_,O,P]}else{if(!q)throw Error(`Invalid identifier format: ${$}`);return["-",q,P]}}class PZ extends Error{constructor($){super($);Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithConflictError",this.status=409}}async function a$($,q,K){let P;if($.ok){if(K)P=await $.text();return}if($.status===403)try{if((await $.json())?.error==="org_scoped_key_requires_workspace")P="This API key is org-scoped and requires workspace specification. Please provide 'workspaceId' parameter, or set LANGSMITH_WORKSPACE_ID environment variable."}catch(j){let z=Error(`${$.status} ${$.statusText}`);throw z.status=$?.status,z}if(P===void 0)try{P=await $.text()}catch(j){P=""}let _=`Failed to ${q}. Received status [${$.status}]: ${$.statusText}. Message: ${P}`;if($.status===409)throw new PZ(_);let O=Error(_);throw O.status=$.status,O}var jZ="ERR_CONFLICTING_ENDPOINTS";class tO extends Error{constructor(){super("You cannot provide both LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT and LANGSMITH_RUNS_ENDPOINTS.");Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:jZ}),this.name="ConflictingEndpointsError"}}function OZ($){return typeof $==="object"&&$!==null&&$.code===jZ}var YZ="[...]",hh={result:"[Circular]"},I1=[],B_=[],Rh=new TextEncoder;function Ih(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function R1($){return Rh.encode($)}function vZ($){if($&&typeof $==="object"&&$!==null){if($ instanceof Map)return Object.fromEntries($);else if($ instanceof Set)return Array.from($);else if($ instanceof Date)return $.toISOString();else if($ instanceof RegExp)return $.toString();else if($ instanceof Error)return{name:$.name,message:$.message}}else if(typeof $==="bigint")return $.toString();return $}function Dh($){return function(q,K){if($){let P=$.call(this,q,K);if(P!==void 0)return P}return vZ(K)}}function cq($,q,K,P,_){try{let O=JSON.stringify($,Dh(K),P);return R1(O)}catch(O){if(!O.message?.includes("Converting circular structure to JSON"))return console.warn(`[WARNING]: LangSmith received unserializable value.${q?`
|
|
50
|
+
*/var dn={...HO,JsonPatchError:r_,deepClone:P8,escapePathComponent:e7,unescapePathComponent:e4};var YJ=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function e0($){return typeof $==="string"&&YJ.test($)}var vJ=e0;function s0($){if(!vJ($))throw TypeError("Invalid UUID");var q,K=new Uint8Array(16);return K[0]=(q=parseInt($.slice(0,8),16))>>>24,K[1]=q>>>16&255,K[2]=q>>>8&255,K[3]=q&255,K[4]=(q=parseInt($.slice(9,13),16))>>>8,K[5]=q&255,K[6]=(q=parseInt($.slice(14,18),16))>>>8,K[7]=q&255,K[8]=(q=parseInt($.slice(19,23),16))>>>8,K[9]=q&255,K[10]=(q=parseInt($.slice(24,36),16))/1099511627776&255,K[11]=q/4294967296&255,K[12]=q>>>24&255,K[13]=q>>>16&255,K[14]=q>>>8&255,K[15]=q&255,K}var zJ=s0;var Tq=[];for($P=0;$P<256;++$P)Tq.push(($P+256).toString(16).slice(1));var $P;function q1($,q=0){return(Tq[$[q+0]]+Tq[$[q+1]]+Tq[$[q+2]]+Tq[$[q+3]]+"-"+Tq[$[q+4]]+Tq[$[q+5]]+"-"+Tq[$[q+6]]+Tq[$[q+7]]+"-"+Tq[$[q+8]]+Tq[$[q+9]]+"-"+Tq[$[q+10]]+Tq[$[q+11]]+Tq[$[q+12]]+Tq[$[q+13]]+Tq[$[q+14]]+Tq[$[q+15]]).toLowerCase()}var K1,$N=new Uint8Array(16);function JO(){if(!K1){if(K1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!K1)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return K1($N)}function qN($){$=unescape(encodeURIComponent($));var q=[];for(var K=0;K<$.length;++K)q.push($.charCodeAt(K));return q}var KN="6ba7b810-9dad-11d1-80b4-00c04fd430c8",_N="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function TO($,q,K){function P(_,O,j,z){var J;if(typeof _==="string")_=qN(_);if(typeof O==="string")O=zJ(O);if(((J=O)===null||J===void 0?void 0:J.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var w=new Uint8Array(16+_.length);if(w.set(O),w.set(_,O.length),w=K(w),w[6]=w[6]&15|q,w[8]=w[8]&63|128,j){z=z||0;for(var G=0;G<16;++G)j[z+G]=w[G];return j}return q1(w)}try{P.name=$}catch(_){}return P.DNS=KN,P.URL=_N,P}var PN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wO={randomUUID:PN};function jN($,q,K){if(wO.randomUUID&&!q&&!$)return wO.randomUUID();$=$||{};var P=$.random||($.rng||JO)();if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){K=K||0;for(var _=0;_<16;++_)q[K+_]=P[_];return q}return q1(P)}var e8=jN;function ON($,q,K,P){switch($){case 0:return q&K^~q&P;case 1:return q^K^P;case 2:return q&K^q&P^K&P;case 3:return q^K^P}}function ZO($,q){return $<<q|$>>>32-q}function YN($){var q=[1518500249,1859775393,2400959708,3395469782],K=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof $==="string"){var P=unescape(encodeURIComponent($));$=[];for(var _=0;_<P.length;++_)$.push(P.charCodeAt(_))}else if(!Array.isArray($))$=Array.prototype.slice.call($);$.push(128);var O=$.length/4+2,j=Math.ceil(O/16),z=Array(j);for(var J=0;J<j;++J){var w=new Uint32Array(16);for(var G=0;G<16;++G)w[G]=$[J*64+G*4]<<24|$[J*64+G*4+1]<<16|$[J*64+G*4+2]<<8|$[J*64+G*4+3];z[J]=w}z[j-1][14]=($.length-1)*8/Math.pow(2,32),z[j-1][14]=Math.floor(z[j-1][14]),z[j-1][15]=($.length-1)*8&4294967295;for(var f=0;f<j;++f){var A=new Uint32Array(80);for(var V=0;V<16;++V)A[V]=z[f][V];for(var C=16;C<80;++C)A[C]=ZO(A[C-3]^A[C-8]^A[C-14]^A[C-16],1);var E=K[0],R=K[1],I=K[2],D=K[3],b=K[4];for(var u=0;u<80;++u){var y=Math.floor(u/20),c=ZO(E,5)+ON(y,R,I,D)+b+q[y]+A[u]>>>0;b=D,D=I,I=ZO(R,30)>>>0,R=E,E=c}K[0]=K[0]+E>>>0,K[1]=K[1]+R>>>0,K[2]=K[2]+I>>>0,K[3]=K[3]+D>>>0,K[4]=K[4]+b>>>0}return[K[0]>>24&255,K[0]>>16&255,K[0]>>8&255,K[0]&255,K[1]>>24&255,K[1]>>16&255,K[1]>>8&255,K[1]&255,K[2]>>24&255,K[2]>>16&255,K[2]>>8&255,K[2]&255,K[3]>>24&255,K[3]>>16&255,K[3]>>8&255,K[3]&255,K[4]>>24&255,K[4]>>16&255,K[4]>>8&255,K[4]&255]}var WJ=YN;var vN=TO("v5",80,WJ),_1=vN;var JJ="gen_ai.operation.name",TJ="gen_ai.system",XO="gen_ai.request.model",wJ="gen_ai.response.model",fO="gen_ai.usage.input_tokens",kO="gen_ai.usage.output_tokens",AO="gen_ai.usage.total_tokens",ZJ="gen_ai.request.max_tokens",XJ="gen_ai.request.temperature",fJ="gen_ai.request.top_p",kJ="gen_ai.request.frequency_penalty",AJ="gen_ai.request.presence_penalty",GJ="gen_ai.response.finish_reasons",VJ="gen_ai.prompt",SJ="gen_ai.completion",MJ="gen_ai.request.extra_query",NJ="gen_ai.request.extra_body",CJ="gen_ai.serialized.name",EJ="gen_ai.serialized.signature",hJ="gen_ai.serialized.doc",RJ="gen_ai.response.id",IJ="gen_ai.response.service_tier",DJ="gen_ai.response.system_fingerprint",gJ="gen_ai.usage.input_token_details",LJ="gen_ai.usage.output_token_details",bJ="langsmith.trace.session_id",uJ="langsmith.trace.session_name",yJ="langsmith.span.kind",pJ="langsmith.trace.name",xJ="langsmith.metadata",GO="langsmith.span.tags";var cJ="langsmith.request.streaming",mJ="langsmith.request.headers";var WN=(...$)=>fetch(...$),dJ=Symbol.for("ls:fetch_implementation");var lJ=()=>{let $=globalThis[dJ];if(!$)return!1;return typeof $==="function"&&"Headers"in $&&"Request"in $&&"Response"in $},oJ=($)=>{return async(...q)=>{if($||y6("DEBUG")==="true"){let[P,_]=q;console.log(`→ ${_?.method||"GET"} ${P}`)}let K=await(globalThis[dJ]??WN)(...q);if($||y6("DEBUG")==="true")console.log(`← ${K.status} ${K.statusText} ${K.url}`);return K}};var qP=()=>{return y6("PROJECT")??Fq("LANGCHAIN_SESSION")??"default"};var P1="0.3.71";var D8,HN=()=>typeof window<"u"&&typeof window.document<"u",JN=()=>typeof globalThis==="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",TN=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),rJ=()=>typeof Deno<"u",wN=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!rJ(),MO=()=>{if(D8)return D8;if(typeof Bun<"u")D8="bun";else if(HN())D8="browser";else if(wN())D8="node";else if(JN())D8="webworker";else if(TN())D8="jsdom";else if(rJ())D8="deno";else D8="other";return D8},VO;function j1(){if(VO===void 0){let $=MO(),q=XN();VO={library:"langsmith",runtime:$,sdk:"langsmith-js",sdk_version:P1,...q}}return VO}function nJ(){let $=ZN()||{},q={},K=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION","LANGSMITH_API_KEY","LANGSMITH_ENDPOINT","LANGSMITH_TRACING_V2","LANGSMITH_PROJECT","LANGSMITH_SESSION"];for(let[P,_]of Object.entries($))if((P.startsWith("LANGCHAIN_")||P.startsWith("LANGSMITH_"))&&typeof _==="string"&&!K.includes(P)&&!P.toLowerCase().includes("key")&&!P.toLowerCase().includes("secret")&&!P.toLowerCase().includes("token"))if(P==="LANGCHAIN_REVISION_ID")q.revision_id=_;else q[P]=_;return q}function ZN(){try{if(typeof process<"u"&&process.env)return Object.entries(process.env).reduce(($,[q,K])=>{return $[q]=String(K),$},{});return}catch($){return}}function Fq($){try{return typeof process<"u"?process.env?.[$]:void 0}catch(q){return}}function y6($){return Fq(`LANGSMITH_${$}`)||Fq(`LANGCHAIN_${$}`)}var SO;function XN(){if(SO!==void 0)return SO;let $=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],q={};for(let K of $){let P=Fq(K);if(P!==void 0)q[K]=P}return SO=q,q}function O1(){return Fq("OTEL_ENABLED")==="true"||y6("OTEL_ENABLED")==="true"}class tJ{constructor(){Object.defineProperty(this,"hasWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startActiveSpan($,...q){if(!this.hasWarned&&O1())console.warn('You have enabled OTEL export via the `OTEL_ENABLED` or `LANGSMITH_OTEL_ENABLED` environment variable, but have not initialized the required OTEL instances. Please add:\n```\nimport { initializeOTEL } from "langsmith/experimental/otel/setup";\ninitializeOTEL();\n```\nat the beginning of your code.'),this.hasWarned=!0;let K;if(q.length===1&&typeof q[0]==="function")K=q[0];else if(q.length===2&&typeof q[1]==="function")K=q[1];else if(q.length===3&&typeof q[2]==="function")K=q[2];if(typeof K==="function")return K();return}}class BJ{constructor(){Object.defineProperty(this,"mockTracer",{enumerable:!0,configurable:!0,writable:!0,value:new tJ})}getTracer($,q){return this.mockTracer}getActiveSpan(){return}setSpan($,q){return $}getSpan($){return}setSpanContext($,q){return $}getTracerProvider(){return}setGlobalTracerProvider($){return!1}}class UJ{active(){return{}}with($,q){return q()}}var NO=Symbol.for("ls:otel_trace"),CO=Symbol.for("ls:otel_context"),iJ=Symbol.for("ls:otel_get_default_otlp_tracer_provider"),fN=new BJ,kN=new UJ;class FJ{getTraceInstance(){return globalThis[NO]??fN}getContextInstance(){return globalThis[CO]??kN}initializeGlobalInstances($){if(globalThis[NO]===void 0)globalThis[NO]=$.trace;if(globalThis[CO]===void 0)globalThis[CO]=$.context}setDefaultOTLPTracerComponents($){globalThis[iJ]=$}getDefaultOTLPTracerComponents(){return globalThis[iJ]??void 0}}var EO=new FJ;function Y1(){return EO.getTraceInstance()}function aJ(){return EO.getContextInstance()}function QJ(){return EO.getDefaultOTLPTracerComponents()}var AN={llm:"chat",tool:"execute_tool",retriever:"embeddings",embedding:"embeddings",prompt:"chat"};function GN($){return AN[$]||$}class hO{constructor(){Object.defineProperty(this,"spans",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}exportBatch($,q){for(let K of $)try{if(!K.run)continue;if(K.operation==="post"){let P=this.createSpanForRun(K,K.run,q.get(K.id));if(P&&!K.run.end_time)this.spans.set(K.id,P)}else this.updateSpanForRun(K,K.run)}catch(P){console.error(`Error processing operation ${K.id}:`,P)}}createSpanForRun($,q,K){let P=K&&Y1().getSpan(K);if(!P)return;try{return this.finishSpanSetup(P,q,$)}catch(_){console.error(`Failed to create span for run ${$.id}:`,_);return}}finishSpanSetup($,q,K){if(this.setSpanAttributes($,q,K),q.error)$.setStatus({code:2}),$.recordException(Error(q.error));else $.setStatus({code:1});if(q.end_time)$.end(new Date(q.end_time));return $}updateSpanForRun($,q){try{let K=this.spans.get($.id);if(!K){console.debug(`No span found for run ${$.id} during update`);return}if(this.setSpanAttributes(K,q,$),q.error)K.setStatus({code:2}),K.recordException(Error(q.error));else K.setStatus({code:1});let P=q.end_time;if(P)K.end(new Date(P)),this.spans.delete($.id)}catch(K){console.error(`Failed to update span for run ${$.id}:`,K)}}extractModelName($){if($.extra?.metadata){let q=$.extra.metadata;if(q.ls_model_name)return q.ls_model_name;if(q.invocation_params){let K=q.invocation_params;if(K.model)return K.model;else if(K.model_name)return K.model_name}}return}setSpanAttributes($,q,K){if("run_type"in q&&q.run_type){$.setAttribute(yJ,q.run_type);let j=GN(q.run_type||"chain");$.setAttribute(JJ,j)}if("name"in q&&q.name)$.setAttribute(pJ,q.name);if("session_id"in q&&q.session_id)$.setAttribute(bJ,q.session_id);if("session_name"in q&&q.session_name)$.setAttribute(uJ,q.session_name);this.setGenAiSystem($,q);let P=this.extractModelName(q);if(P)$.setAttribute(XO,P);if("prompt_tokens"in q&&typeof q.prompt_tokens==="number")$.setAttribute(fO,q.prompt_tokens);if("completion_tokens"in q&&typeof q.completion_tokens==="number")$.setAttribute(kO,q.completion_tokens);if("total_tokens"in q&&typeof q.total_tokens==="number")$.setAttribute(AO,q.total_tokens);this.setInvocationParameters($,q);let _=q.extra?.metadata||{};for(let[j,z]of Object.entries(_))if(z!==null&&z!==void 0)$.setAttribute(`${xJ}.${j}`,String(z));let O=q.tags;if(O&&Array.isArray(O))$.setAttribute(GO,O.join(", "));else if(O)$.setAttribute(GO,String(O));if("serialized"in q&&typeof q.serialized==="object"){let j=q.serialized;if(j.name)$.setAttribute(CJ,String(j.name));if(j.signature)$.setAttribute(EJ,String(j.signature));if(j.doc)$.setAttribute(hJ,String(j.doc))}this.setIOAttributes($,K)}setGenAiSystem($,q){let K="langchain",P=this.extractModelName(q);if(P){let _=P.toLowerCase();if(_.includes("anthropic")||_.startsWith("claude"))K="anthropic";else if(_.includes("bedrock"))K="aws.bedrock";else if(_.includes("azure")&&_.includes("openai"))K="az.ai.openai";else if(_.includes("azure")&&_.includes("inference"))K="az.ai.inference";else if(_.includes("cohere"))K="cohere";else if(_.includes("deepseek"))K="deepseek";else if(_.includes("gemini"))K="gemini";else if(_.includes("groq"))K="groq";else if(_.includes("watson")||_.includes("ibm"))K="ibm.watsonx.ai";else if(_.includes("mistral"))K="mistral_ai";else if(_.includes("gpt")||_.includes("openai"))K="openai";else if(_.includes("perplexity")||_.includes("sonar"))K="perplexity";else if(_.includes("vertex"))K="vertex_ai";else if(_.includes("xai")||_.includes("grok"))K="xai"}$.setAttribute(TJ,K)}setInvocationParameters($,q){if(!q.extra?.metadata?.invocation_params)return;let K=q.extra.metadata.invocation_params;if(K.max_tokens!==void 0)$.setAttribute(ZJ,K.max_tokens);if(K.temperature!==void 0)$.setAttribute(XJ,K.temperature);if(K.top_p!==void 0)$.setAttribute(fJ,K.top_p);if(K.frequency_penalty!==void 0)$.setAttribute(kJ,K.frequency_penalty);if(K.presence_penalty!==void 0)$.setAttribute(AJ,K.presence_penalty)}setIOAttributes($,q){if(q.run.inputs)try{let K=q.run.inputs;if(typeof K==="object"&&K!==null){if(K.model&&Array.isArray(K.messages))$.setAttribute(XO,K.model);if(K.stream!==void 0)$.setAttribute(cJ,K.stream);if(K.extra_headers)$.setAttribute(mJ,JSON.stringify(K.extra_headers));if(K.extra_query)$.setAttribute(MJ,JSON.stringify(K.extra_query));if(K.extra_body)$.setAttribute(NJ,JSON.stringify(K.extra_body))}$.setAttribute(VJ,JSON.stringify(K))}catch(K){console.debug(`Failed to process inputs for run ${q.id}`,K)}if(q.run.outputs)try{let K=q.run.outputs,P=this.getUnifiedRunTokens(K);if(P)$.setAttribute(fO,P[0]),$.setAttribute(kO,P[1]),$.setAttribute(AO,P[0]+P[1]);if(K&&typeof K==="object"){if(K.model)$.setAttribute(wJ,String(K.model));if(K.id)$.setAttribute(RJ,K.id);if(K.choices&&Array.isArray(K.choices)){let _=K.choices.map((O)=>O.finish_reason).filter((O)=>O).map(String);if(_.length>0)$.setAttribute(GJ,_.join(", "))}if(K.service_tier)$.setAttribute(IJ,K.service_tier);if(K.system_fingerprint)$.setAttribute(DJ,K.system_fingerprint);if(K.usage_metadata&&typeof K.usage_metadata==="object"){let _=K.usage_metadata;if(_.input_token_details)$.setAttribute(gJ,JSON.stringify(_.input_token_details));if(_.output_token_details)$.setAttribute(LJ,JSON.stringify(_.output_token_details))}}$.setAttribute(SJ,JSON.stringify(K))}catch(K){console.debug(`Failed to process outputs for run ${q.id}`,K)}}getUnifiedRunTokens($){if(!$)return null;let q=this.extractUnifiedRunTokens($.usage_metadata);if(q)return q;let K=Object.keys($);for(let O of K){let j=$[O];if(!j||typeof j!=="object")continue;if(q=this.extractUnifiedRunTokens(j.usage_metadata),q)return q;if(j.lc===1&&j.kwargs&&typeof j.kwargs==="object"){if(q=this.extractUnifiedRunTokens(j.kwargs.usage_metadata),q)return q}}let P=$.generations||[];if(!Array.isArray(P))return null;let _=Array.isArray(P[0])?P.flat():P;for(let O of _)if(typeof O==="object"&&O.message&&typeof O.message==="object"&&O.message.kwargs&&typeof O.message.kwargs==="object"){if(q=this.extractUnifiedRunTokens(O.message.kwargs.usage_metadata),q)return q}return null}extractUnifiedRunTokens($){if(!$||typeof $!=="object")return null;if(typeof $.input_tokens!=="number"||typeof $.output_tokens!=="number")return null;return[$.input_tokens,$.output_tokens]}}var JT=Uq(B7(),1),J1=Uq(H1(),1),LN=[429,500,502,503,504];class T1{constructor($){if(Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=$.maxConcurrency??1/0,this.maxRetries=$.maxRetries??6,"default"in J1.default)this.queue=new J1.default.default({concurrency:this.maxConcurrency});else this.queue=new J1.default({concurrency:this.maxConcurrency});this.onFailedResponseHook=$?.onFailedResponseHook}call($,...q){let K=this.onFailedResponseHook;return this.queue.add(()=>JT.default(()=>$(...q).catch((P)=>{if(P instanceof Error)throw P;else throw Error(P)}),{async onFailedAttempt(P){if(P.message.startsWith("Cancel")||P.message.startsWith("TimeoutError")||P.name==="TimeoutError"||P.message.startsWith("AbortError"))throw P;if(P?.code==="ECONNABORTED")throw P;let _=P?.response;if(K){if(await K(_))return}let O=_?.status??P?.status;if(O){if(!LN.includes(+O))throw P}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions($,q,...K){if($.signal)return Promise.race([this.call(q,...K),new Promise((P,_)=>{$.signal?.addEventListener("abort",()=>{_(Error("AbortError"))})})]);return this.call(q,...K)}}function DO($){return typeof $?._getType==="function"}function gO($){let q={type:$._getType(),data:{content:$.content}};if($?.additional_kwargs&&Object.keys($.additional_kwargs).length>0)q.data.additional_kwargs={...$.additional_kwargs};return q}var bN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _6($,q){if(!bN.test($)){let K=q!==void 0?`Invalid UUID for ${q}: ${$}`:`Invalid UUID: ${$}`;throw Error(K)}return $}var TT={};function w1($){if(!TT[$])console.warn($),TT[$]=!0}var Eh=Uq(_Z(),1);function s8($){if(!$||$.split("/").length>2||$.startsWith("/")||$.endsWith("/")||$.split(":").length>2)throw Error(`Invalid identifier format: ${$}`);let[q,K]=$.split(":"),P=K||"latest";if(q.includes("/")){let[_,O]=q.split("/",2);if(!_||!O)throw Error(`Invalid identifier format: ${$}`);return[_,O,P]}else{if(!q)throw Error(`Invalid identifier format: ${$}`);return["-",q,P]}}class PZ extends Error{constructor($){super($);Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithConflictError",this.status=409}}async function a$($,q,K){let P;if($.ok){if(K)P=await $.text();return}if($.status===403)try{if((await $.json())?.error==="org_scoped_key_requires_workspace")P="This API key is org-scoped and requires workspace specification. Please provide 'workspaceId' parameter, or set LANGSMITH_WORKSPACE_ID environment variable."}catch(j){let z=Error(`${$.status} ${$.statusText}`);throw z.status=$?.status,z}if(P===void 0)try{P=await $.text()}catch(j){P=""}let _=`Failed to ${q}. Received status [${$.status}]: ${$.statusText}. Message: ${P}`;if($.status===409)throw new PZ(_);let O=Error(_);throw O.status=$.status,O}var jZ="ERR_CONFLICTING_ENDPOINTS";class tO extends Error{constructor(){super("You cannot provide both LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT and LANGSMITH_RUNS_ENDPOINTS.");Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:jZ}),this.name="ConflictingEndpointsError"}}function OZ($){return typeof $==="object"&&$!==null&&$.code===jZ}var YZ="[...]",hh={result:"[Circular]"},I1=[],B_=[],Rh=new TextEncoder;function Ih(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function R1($){return Rh.encode($)}function vZ($){if($&&typeof $==="object"&&$!==null){if($ instanceof Map)return Object.fromEntries($);else if($ instanceof Set)return Array.from($);else if($ instanceof Date)return $.toISOString();else if($ instanceof RegExp)return $.toString();else if($ instanceof Error)return{name:$.name,message:$.message}}else if(typeof $==="bigint")return $.toString();return $}function Dh($){return function(q,K){if($){let P=$.call(this,q,K);if(P!==void 0)return P}return vZ(K)}}function cq($,q,K,P,_){try{let O=JSON.stringify($,Dh(K),P);return R1(O)}catch(O){if(!O.message?.includes("Converting circular structure to JSON"))return console.warn(`[WARNING]: LangSmith received unserializable value.${q?`
|
|
51
51
|
Context: ${q}`:""}`),R1("[Unserializable]");if(y6("SUPPRESS_CIRCULAR_JSON_WARNINGS")!=="true"&&console.warn(`[WARNING]: LangSmith received circular JSON. This will decrease tracer performance. ${q?`
|
|
52
52
|
Context: ${q}`:""}`),typeof _>"u")_=Ih();UO($,"",0,[],void 0,0,_);let j;try{if(B_.length===0)j=JSON.stringify($,K,P);else j=JSON.stringify($,gh(K),P)}catch(z){return R1("[unable to serialize, circular reference is too complex to analyze]")}finally{while(I1.length!==0){let z=I1.pop();if(z.length===4)Object.defineProperty(z[0],z[1],z[3]);else z[0][z[1]]=z[2]}}return R1(j)}}function BO($,q,K,P){var _=Object.getOwnPropertyDescriptor(P,K);if(_.get!==void 0)if(_.configurable)Object.defineProperty(P,K,{value:$}),I1.push([P,K,q,_]);else B_.push([q,K,$]);else P[K]=$,I1.push([P,K,q])}function UO($,q,K,P,_,O,j){O+=1;var z;if(typeof $==="object"&&$!==null){for(z=0;z<P.length;z++)if(P[z]===$){BO(hh,$,q,_);return}if(typeof j.depthLimit<"u"&&O>j.depthLimit){BO(YZ,$,q,_);return}if(typeof j.edgesLimit<"u"&&K+1>j.edgesLimit){BO(YZ,$,q,_);return}if(P.push($),Array.isArray($))for(z=0;z<$.length;z++)UO($[z],z,z,P,$,O,j);else{$=vZ($);var J=Object.keys($);for(z=0;z<J.length;z++){var w=J[z];UO($[w],w,z,P,$,O,j)}}P.pop()}}function gh($){return $=typeof $<"u"?$:function(q,K){return K},function(q,K){if(B_.length>0)for(var P=0;P<B_.length;P++){var _=B_[P];if(_[1]===q&&_[0]===K){K=_[2],B_.splice(P,1);break}}return $.call(this,q,K)}}function zZ($){let q=j1(),K=nJ(),P=$.extra??{},_=P.metadata;return $.extra={...P,runtime:{...q,...P?.runtime},metadata:{...K,...K.revision_id||"revision_id"in $&&$.revision_id?{revision_id:("revision_id"in $?$.revision_id:void 0)??K.revision_id}:{},..._}},$}var Lh=($)=>{let q=$?.toString()??y6("TRACING_SAMPLING_RATE");if(q===void 0)return;let K=parseFloat(q);if(K<0||K>1)throw Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${K}`);return K},bh=($)=>{let K=$.replace("http://","").replace("https://","").split("/")[0].split(":")[0];return K==="localhost"||K==="127.0.0.1"||K==="::1"};async function uh($){let q=[];for await(let K of $)q.push(K);return q}function D1($){if($===void 0)return;return $.trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}var yh=async($)=>{if($?.status===429){let q=parseInt($.headers.get("retry-after")??"10",10)*1000;if(q>0)return await new Promise((K)=>setTimeout(K,q)),!0}return!1};function WZ($){if(typeof $==="number")return Number($.toFixed(4));return $}class TZ{constructor(){Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0})}peek(){return this.items[0]}push($){let q,K=new Promise((_)=>{q=_}),P=cq($.item,`Serializing run with id: ${$.item.id}`).length;return this.items.push({action:$.action,payload:$.item,otelContext:$.otelContext,apiKey:$.apiKey,apiUrl:$.apiUrl,itemPromiseResolve:q,itemPromise:K,size:P}),this.sizeBytes+=P,K}pop({upToSizeBytes:$,upToSize:q}){if($<1)throw Error("Number of bytes to pop off may not be less than 1.");let K=[],P=0;while(P+(this.peek()?.size??0)<$&&this.items.length>0&&K.length<q){let _=this.items.shift();if(_)K.push(_),P+=_.size,this.sizeBytes-=_.size}if(K.length===0&&this.items.length>0){let _=this.items.shift();K.push(_),P+=_.size,this.sizeBytes-=_.size}return[K.map((_)=>({action:_.action,item:_.payload,otelContext:_.otelContext,apiKey:_.apiKey,apiUrl:_.apiUrl})),()=>K.forEach((_)=>_.itemPromiseResolve())]}}var ph=25165824,xh=1e4,ch=100,HZ="https://api.smith.langchain.com";class NK{get _fetch(){return this.fetchImplementation||oJ(this.debug)}constructor($={}){Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"webUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"workspaceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchIngestCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout_ms",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tenantId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingSampleRate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filteredPostUuids",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"autoBatchTracing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"autoBatchQueue",{enumerable:!0,configurable:!0,writable:!0,value:new TZ}),Object.defineProperty(this,"autoBatchTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"autoBatchAggregationDelayMs",{enumerable:!0,configurable:!0,writable:!0,value:250}),Object.defineProperty(this,"batchSizeBytesLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchSizeLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"blockOnRootRunFinalization",{enumerable:!0,configurable:!0,writable:!0,value:Fq("LANGSMITH_TRACING_BACKGROUND")==="false"}),Object.defineProperty(this,"traceBatchConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(this,"_serverInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_getServerInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"manualFlushMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"langSmithToOTELTranslator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchImplementation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"multipartStreamingDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:Fq("LANGSMITH_DEBUG")==="true"});let q=NK.getDefaultClientConfig();if(this.tracingSampleRate=Lh($.tracingSamplingRate),this.apiUrl=D1($.apiUrl??q.apiUrl)??"",this.apiUrl.endsWith("/"))this.apiUrl=this.apiUrl.slice(0,-1);if(this.apiKey=D1($.apiKey??q.apiKey),this.webUrl=D1($.webUrl??q.webUrl),this.webUrl?.endsWith("/"))this.webUrl=this.webUrl.slice(0,-1);if(this.workspaceId=D1($.workspaceId??y6("WORKSPACE_ID")),this.timeout_ms=$.timeout_ms??90000,this.caller=new T1({...$.callerOptions??{},maxRetries:4,debug:$.debug??this.debug}),this.traceBatchConcurrency=$.traceBatchConcurrency??this.traceBatchConcurrency,this.traceBatchConcurrency<1)throw Error("Trace batch concurrency must be positive.");if(this.debug=$.debug??this.debug,this.fetchImplementation=$.fetchImplementation,this.batchIngestCaller=new T1({maxRetries:2,maxConcurrency:this.traceBatchConcurrency,...$.callerOptions??{},onFailedResponseHook:yh,debug:$.debug??this.debug}),this.hideInputs=$.hideInputs??$.anonymizer??q.hideInputs,this.hideOutputs=$.hideOutputs??$.anonymizer??q.hideOutputs,this.autoBatchTracing=$.autoBatchTracing??this.autoBatchTracing,this.blockOnRootRunFinalization=$.blockOnRootRunFinalization??this.blockOnRootRunFinalization,this.batchSizeBytesLimit=$.batchSizeBytesLimit,this.batchSizeLimit=$.batchSizeLimit,this.fetchOptions=$.fetchOptions||{},this.manualFlushMode=$.manualFlushMode??this.manualFlushMode,O1())this.langSmithToOTELTranslator=new hO}static getDefaultClientConfig(){let $=y6("API_KEY"),q=y6("ENDPOINT")??HZ,K=y6("HIDE_INPUTS")==="true",P=y6("HIDE_OUTPUTS")==="true";return{apiUrl:q,apiKey:$,webUrl:void 0,hideInputs:K,hideOutputs:P}}getHostUrl(){if(this.webUrl)return this.webUrl;else if(bh(this.apiUrl))return this.webUrl="http://localhost:3000",this.webUrl;else if(this.apiUrl.endsWith("/api/v1"))return this.webUrl=this.apiUrl.replace("/api/v1",""),this.webUrl;else if(this.apiUrl.includes("/api")&&!this.apiUrl.split(".",1)[0].endsWith("api"))return this.webUrl=this.apiUrl.replace("/api",""),this.webUrl;else if(this.apiUrl.split(".",1)[0].includes("dev"))return this.webUrl="https://dev.smith.langchain.com",this.webUrl;else if(this.apiUrl.split(".",1)[0].includes("eu"))return this.webUrl="https://eu.smith.langchain.com",this.webUrl;else if(this.apiUrl.split(".",1)[0].includes("beta"))return this.webUrl="https://beta.smith.langchain.com",this.webUrl;else return this.webUrl="https://smith.langchain.com",this.webUrl}get headers(){let $={"User-Agent":`langsmith-js/${P1}`};if(this.apiKey)$["x-api-key"]=`${this.apiKey}`;if(this.workspaceId)$["x-tenant-id"]=this.workspaceId;return $}_getPlatformEndpointPath($){return this.apiUrl.slice(-3)!=="/v1"&&this.apiUrl.slice(-4)!=="/v1/"?`/v1/platform/${$}`:`/platform/${$}`}async processInputs($){if(this.hideInputs===!1)return $;if(this.hideInputs===!0)return{};if(typeof this.hideInputs==="function")return this.hideInputs($);return $}async processOutputs($){if(this.hideOutputs===!1)return $;if(this.hideOutputs===!0)return{};if(typeof this.hideOutputs==="function")return this.hideOutputs($);return $}async prepareRunCreateOrUpdateInputs($){let q={...$};if(q.inputs!==void 0)q.inputs=await this.processInputs(q.inputs);if(q.outputs!==void 0)q.outputs=await this.processOutputs(q.outputs);return q}async _getResponse($,q){let K=q?.toString()??"",P=`${this.apiUrl}${$}?${K}`;return await this.caller.call(async()=>{let O=await this._fetch(P,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(O,`fetch ${$}`),O})}async _get($,q){return(await this._getResponse($,q)).json()}async*_getPaginated($,q=new URLSearchParams,K){let P=Number(q.get("offset"))||0,_=Number(q.get("limit"))||100;while(!0){q.set("offset",String(P)),q.set("limit",String(_));let O=`${this.apiUrl}${$}?${q}`,j=await this.caller.call(async()=>{let J=await this._fetch(O,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(J,`fetch ${$}`),J}),z=K?K(await j.json()):await j.json();if(z.length===0)break;if(yield z,z.length<_)break;P+=z.length}}async*_getCursorPaginatedList($,q=null,K="POST",P="runs"){let _=q?{...q}:{};while(!0){let O=JSON.stringify(_),z=await(await this.caller.call(async()=>{let w=await this._fetch(`${this.apiUrl}${$}`,{method:K,headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(w,`fetch ${$}`),w})).json();if(!z)break;if(!z[P])break;yield z[P];let J=z.cursors;if(!J)break;if(!J.next)break;_.cursor=J.next}}_shouldSample(){if(this.tracingSampleRate===void 0)return!0;return Math.random()<this.tracingSampleRate}_filterForSampling($,q=!1){if(this.tracingSampleRate===void 0)return $;if(q){let K=[];for(let P of $)if(!this.filteredPostUuids.has(P.trace_id))K.push(P);else if(P.id===P.trace_id)this.filteredPostUuids.delete(P.trace_id);return K}else{let K=[];for(let P of $){let _=P.trace_id??P.id;if(this.filteredPostUuids.has(_))continue;if(P.id===_)if(this._shouldSample())K.push(P);else this.filteredPostUuids.add(_);else K.push(P)}return K}}async _getBatchSizeLimitBytes(){let $=await this._ensureServerInfo();return this.batchSizeBytesLimit??$.batch_ingest_config?.size_limit_bytes??ph}async _getBatchSizeLimit(){let $=await this._ensureServerInfo();return this.batchSizeLimit??$.batch_ingest_config?.size_limit??ch}async _getDatasetExamplesMultiPartSupport(){return(await this._ensureServerInfo()).instance_flags?.dataset_examples_multipart_enabled??!1}drainAutoBatchQueue({batchSizeLimitBytes:$,batchSizeLimit:q}){let K=[];while(this.autoBatchQueue.items.length>0){let[P,_]=this.autoBatchQueue.pop({upToSizeBytes:$,upToSize:q});if(!P.length){_();break}let O=P.reduce((J,w)=>{let G=w.apiUrl??this.apiUrl,f=w.apiKey??this.apiKey,V=w.apiKey===this.apiKey&&w.apiUrl===this.apiUrl?"default":`${G}|${f}`;if(!J[V])J[V]=[];return J[V].push(w),J},{}),j=[];for(let[J,w]of Object.entries(O)){let G=this._processBatch(w,{apiUrl:J==="default"?void 0:J.split("|")[0],apiKey:J==="default"?void 0:J.split("|")[1]});j.push(G)}let z=Promise.all(j).finally(_);K.push(z)}return Promise.all(K)}async _processBatch($,q){if(!$.length)return;try{if(this.langSmithToOTELTranslator!==void 0)this._sendBatchToOTELTranslator($);else{let K={runCreates:$.filter((_)=>_.action==="create").map((_)=>_.item),runUpdates:$.filter((_)=>_.action==="update").map((_)=>_.item)},P=await this._ensureServerInfo();if(P?.batch_ingest_config?.use_multipart_endpoint){let _=P?.instance_flags?.gzip_body_enabled;await this.multipartIngestRuns(K,{...q,useGzip:_})}else await this.batchIngestRuns(K,q)}}catch(K){console.error("Error exporting batch:",K)}}_sendBatchToOTELTranslator($){if(this.langSmithToOTELTranslator!==void 0){let q=new Map,K=[];for(let P of $)if(P.item.id&&P.otelContext)if(q.set(P.item.id,P.otelContext),P.action==="create")K.push({operation:"post",id:P.item.id,trace_id:P.item.trace_id??P.item.id,run:P.item});else K.push({operation:"patch",id:P.item.id,trace_id:P.item.trace_id??P.item.id,run:P.item});this.langSmithToOTELTranslator.exportBatch(K,q)}}async processRunOperation($){clearTimeout(this.autoBatchTimeout),this.autoBatchTimeout=void 0,$.item=zZ($.item);let q=this.autoBatchQueue.push($);if(this.manualFlushMode)return q;let K=await this._getBatchSizeLimitBytes(),P=await this._getBatchSizeLimit();if(this.autoBatchQueue.sizeBytes>K||this.autoBatchQueue.items.length>P)this.drainAutoBatchQueue({batchSizeLimitBytes:K,batchSizeLimit:P});if(this.autoBatchQueue.items.length>0)this.autoBatchTimeout=setTimeout(()=>{this.autoBatchTimeout=void 0,this.drainAutoBatchQueue({batchSizeLimitBytes:K,batchSizeLimit:P})},this.autoBatchAggregationDelayMs);return q}async _getServerInfo(){let q=await(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/info`,{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(xh),...this.fetchOptions});return await a$(K,"get server info"),K})).json();if(this.debug)console.log(`
|
|
53
53
|
=== LangSmith Server Configuration ===
|
|
@@ -93,7 +93,7 @@ graph TD;
|
|
|
93
93
|
`}for(let R of V){let{source:I,target:D,data:b,conditional:u}=R,y="";if(b!==void 0){let c=b,m=c.split(" ");if(m.length>J)c=Array.from({length:Math.ceil(m.length/J)},(q$,e)=>m.slice(e*J,(e+1)*J).join(" ")).join(" <br> ");y=u?` -. ${c} .-> `:` -- ${c} --> `}else y=u?" -.-> ":" --> ";w+=` ${X2(I)}${y}${X2(D)};
|
|
94
94
|
`}for(let R in G)if(R.startsWith(`${C}:`)&&R!==C)A(G[R],R);if(C&&!E)w+=` end
|
|
95
95
|
`}A(G[""]??[],"");for(let V in G)if(!V.includes(":")&&V!=="")A(G[V],V);if(j)w+=fR(O??{});return w}async function PX($,q){return kR($,{...q,imageType:"png"})}async function kR($,q){let K=q?.backgroundColor??"white",P=q?.imageType??"png",_=btoa($);if(K!==void 0){if(!/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(K))K=`!${K}`}let O=`https://mermaid.ink/img/${_}?bgColor=${K}&type=${P}`,j=await fetch(O);if(!j.ok)throw Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${j.status}`,`Status text: ${j.statusText}`].join(`
|
|
96
|
-
`));return await j.blob()}var IF=Object.freeze({status:"aborted"});function Q_($,q,K){function P(z,J){var w;Object.defineProperty(z,"_zod",{value:z._zod??{},enumerable:!1}),(w=z._zod).traits??(w.traits=new Set),z._zod.traits.add($),q(z,J);for(let G in j.prototype)if(!(G in z))Object.defineProperty(z,G,{value:j.prototype[G].bind(z)});z._zod.constr=j,z._zod.def=J}let _=K?.Parent??Object;class O extends _{}Object.defineProperty(O,"name",{value:$});function j(z){var J;let w=K?.Parent?new O:this;P(w,z),(J=w._zod).deferred??(J.deferred=[]);for(let G of w._zod.deferred)G();return w}return Object.defineProperty(j,"init",{value:P}),Object.defineProperty(j,Symbol.hasInstance,{value:(z)=>{if(K?.Parent&&z instanceof K.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(j,"name",{value:$}),j}var DF=Symbol("zod_brand");class K_ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var f2={};function XP($){if($)Object.assign(f2,$);return f2}function k2($){let q=Object.values($).filter((P)=>typeof P==="number");return Object.entries($).filter(([P,_])=>q.indexOf(+P)===-1).map(([P,_])=>_)}function OX($,q){if(typeof q==="bigint")return q.toString();return q}function YX($){return{get value(){{let K=$();return Object.defineProperty(this,"value",{value:K}),K}throw Error("cached value already set")}}}var vX=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};var AR=YX(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function e_($,q,K){let P=new $._zod.constr(q??$._zod.def);if(!q||K?.parent)P._zod.parent=$;return P}function zX($){let q=$;if(!q)return{};if(typeof q==="string")return{error:()=>q};if(q?.message!==void 0){if(q?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");q.error=q.message}if(delete q.message,typeof q.error==="string")return{...q,error:()=>q.error};return q}var gF={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function r1($,q=0){for(let K=q;K<$.issues.length;K++)if($.issues[K]?.continue!==!0)return!0;return!1}function o1($){return typeof $==="string"?$:$?.message}function fP($,q,K){let P={...$,path:$.path??[]};if(!$.message){let _=o1($.inst?._zod.def?.error?.($))??o1(q?.error?.($))??o1(K.customError?.($))??o1(K.localeError?.($))??"Invalid input";P.message=_}if(delete P.inst,delete P.continue,!q?.reportInput)delete P.input;return P}var WX=($,q)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:q,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(q,OX,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},HX=Q_("$ZodError",WX),n1=Q_("$ZodError",WX,{Parent:Error});var VR=($)=>(q,K,P,_)=>{let O=P?Object.assign(P,{async:!1}):{async:!1},j=q._zod.run({value:K,issues:[]},O);if(j instanceof Promise)throw new K_;if(j.issues.length){let z=new(_?.Err??$)(j.issues.map((J)=>fP(J,O,XP())));throw vX(z,_?.callee),z}return j.value},JX=VR(n1);var SR=($)=>(q,K,P)=>{let _=P?{...P,async:!1}:{async:!1},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)throw new K_;return O.issues.length?{success:!1,error:new($??HX)(O.issues.map((j)=>fP(j,_,XP())))}:{success:!0,data:O.value}},TX=SR(n1),MR=($)=>async(q,K,P)=>{let _=P?Object.assign(P,{async:!0}):{async:!0},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)O=await O;return O.issues.length?{success:!1,error:new $(O.issues.map((j)=>fP(j,_,XP())))}:{success:!0,data:O.value}},wX=MR(n1);var ZX={major:4,minor:0,patch:0};var NR=Q_("$ZodType",($,q)=>{var K;$??($={}),$._zod.def=q,$._zod.bag=$._zod.bag||{},$._zod.version=ZX;let P=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))P.unshift($);for(let _ of P)for(let O of _._zod.onattach)O($);if(P.length===0)(K=$._zod).deferred??(K.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(O,j,z)=>{let J=r1(O),w;for(let G of j){if(G._zod.def.when){if(!G._zod.def.when(O))continue}else if(J)continue;let f=O.issues.length,A=G._zod.check(O);if(A instanceof Promise&&z?.async===!1)throw new K_;if(w||A instanceof Promise)w=(w??Promise.resolve()).then(async()=>{if(await A,O.issues.length===f)return;if(!J)J=r1(O,f)});else{if(O.issues.length===f)continue;if(!J)J=r1(O,f)}}if(w)return w.then(()=>{return O});return O};$._zod.run=(O,j)=>{let z=$._zod.parse(O,j);if(z instanceof Promise){if(j.async===!1)throw new K_;return z.then((J)=>_(J,P,j))}return _(z,P,j)}}$["~standard"]={validate:(_)=>{try{let O=TX($,_);return O.success?{value:O.data}:{issues:O.error?.issues}}catch(O){return wX($,_).then((j)=>j.success?{value:j.data}:{issues:j.error?.issues})}},vendor:"zod",version:1}});var XX=Q_("$ZodNever",($,q)=>{NR.init($,q),$._zod.parse=(K,P)=>{return K.issues.push({expected:"never",code:"invalid_type",input:K.value,inst:$}),K}});var aF=Symbol("ZodOutput"),QF=Symbol("ZodInput");class i1{constructor(){this._map=new Map,this._idmap=new Map}add($,...q){let K=q[0];if(this._map.set($,K),K&&typeof K==="object"&&"id"in K){if(this._idmap.has(K.id))throw Error(`ID ${K.id} already exists in the registry`);this._idmap.set(K.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let q=this._map.get($);if(q&&typeof q==="object"&&"id"in q)this._idmap.delete(q.id);return this._map.delete($),this}get($){let q=$._zod.parent;if(q){let K={...this.get(q)??{}};return delete K.id,{...K,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function CR(){return new i1}var p8=CR();function fX($,q){return new $({type:"never",...zX(q)})}class A2{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??p8,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,q={path:[],schemaPath:[]}){var K;let P=$._zod.def,_={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},O=this.seen.get($);if(O){if(O.count++,q.schemaPath.includes($))O.cycle=q.path;return O.schema}let j={schema:{},count:1,cycle:void 0,path:q.path};this.seen.set($,j);let z=$._zod.toJSONSchema?.();if(z)j.schema=z;else{let G={...q,schemaPath:[...q.schemaPath,$],path:q.path},f=$._zod.parent;if(f)j.ref=f,this.process(f,G),this.seen.get(f).isParent=!0;else{let A=j.schema;switch(P.type){case"string":{let V=A;V.type="string";let{minimum:C,maximum:E,format:R,patterns:I,contentEncoding:D}=$._zod.bag;if(typeof C==="number")V.minLength=C;if(typeof E==="number")V.maxLength=E;if(R){if(V.format=_[R]??R,V.format==="")delete V.format}if(D)V.contentEncoding=D;if(I&&I.size>0){let b=[...I];if(b.length===1)V.pattern=b[0].source;else if(b.length>1)j.schema.allOf=[...b.map((u)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:u.source}))]}break}case"number":{let V=A,{minimum:C,maximum:E,format:R,multipleOf:I,exclusiveMaximum:D,exclusiveMinimum:b}=$._zod.bag;if(typeof R==="string"&&R.includes("int"))V.type="integer";else V.type="number";if(typeof b==="number")V.exclusiveMinimum=b;if(typeof C==="number"){if(V.minimum=C,typeof b==="number")if(b>=C)delete V.minimum;else delete V.exclusiveMinimum}if(typeof D==="number")V.exclusiveMaximum=D;if(typeof E==="number"){if(V.maximum=E,typeof D==="number")if(D<=E)delete V.maximum;else delete V.exclusiveMaximum}if(typeof I==="number")V.multipleOf=I;break}case"boolean":{let V=A;V.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{A.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{A.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let V=A,{minimum:C,maximum:E}=$._zod.bag;if(typeof C==="number")V.minItems=C;if(typeof E==="number")V.maxItems=E;V.type="array",V.items=this.process(P.element,{...G,path:[...G.path,"items"]});break}case"object":{let V=A;V.type="object",V.properties={};let C=P.shape;for(let I in C)V.properties[I]=this.process(C[I],{...G,path:[...G.path,"properties",I]});let E=new Set(Object.keys(C)),R=new Set([...E].filter((I)=>{let D=P.shape[I]._zod;if(this.io==="input")return D.optin===void 0;else return D.optout===void 0}));if(R.size>0)V.required=Array.from(R);if(P.catchall?._zod.def.type==="never")V.additionalProperties=!1;else if(!P.catchall){if(this.io==="output")V.additionalProperties=!1}else if(P.catchall)V.additionalProperties=this.process(P.catchall,{...G,path:[...G.path,"additionalProperties"]});break}case"union":{let V=A;V.anyOf=P.options.map((C,E)=>this.process(C,{...G,path:[...G.path,"anyOf",E]}));break}case"intersection":{let V=A,C=this.process(P.left,{...G,path:[...G.path,"allOf",0]}),E=this.process(P.right,{...G,path:[...G.path,"allOf",1]}),R=(D)=>("allOf"in D)&&Object.keys(D).length===1,I=[...R(C)?C.allOf:[C],...R(E)?E.allOf:[E]];V.allOf=I;break}case"tuple":{let V=A;V.type="array";let C=P.items.map((I,D)=>this.process(I,{...G,path:[...G.path,"prefixItems",D]}));if(this.target==="draft-2020-12")V.prefixItems=C;else V.items=C;if(P.rest){let I=this.process(P.rest,{...G,path:[...G.path,"items"]});if(this.target==="draft-2020-12")V.items=I;else V.additionalItems=I}if(P.rest)V.items=this.process(P.rest,{...G,path:[...G.path,"items"]});let{minimum:E,maximum:R}=$._zod.bag;if(typeof E==="number")V.minItems=E;if(typeof R==="number")V.maxItems=R;break}case"record":{let V=A;V.type="object",V.propertyNames=this.process(P.keyType,{...G,path:[...G.path,"propertyNames"]}),V.additionalProperties=this.process(P.valueType,{...G,path:[...G.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let V=A,C=k2(P.entries);if(C.every((E)=>typeof E==="number"))V.type="number";if(C.every((E)=>typeof E==="string"))V.type="string";V.enum=C;break}case"literal":{let V=A,C=[];for(let E of P.values)if(E===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else C.push(Number(E));else C.push(E);if(C.length===0);else if(C.length===1){let E=C[0];V.type=E===null?"null":typeof E,V.const=E}else{if(C.every((E)=>typeof E==="number"))V.type="number";if(C.every((E)=>typeof E==="string"))V.type="string";if(C.every((E)=>typeof E==="boolean"))V.type="string";if(C.every((E)=>E===null))V.type="null";V.enum=C}break}case"file":{let V=A,C={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:R,mime:I}=$._zod.bag;if(E!==void 0)C.minLength=E;if(R!==void 0)C.maxLength=R;if(I)if(I.length===1)C.contentMediaType=I[0],Object.assign(V,C);else V.anyOf=I.map((D)=>{return{...C,contentMediaType:D}});else Object.assign(V,C);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let V=this.process(P.innerType,G);A.anyOf=[V,{type:"null"}];break}case"nonoptional":{this.process(P.innerType,G),j.ref=P.innerType;break}case"success":{let V=A;V.type="boolean";break}case"default":{this.process(P.innerType,G),j.ref=P.innerType,A.default=JSON.parse(JSON.stringify(P.defaultValue));break}case"prefault":{if(this.process(P.innerType,G),j.ref=P.innerType,this.io==="input")A._prefault=JSON.parse(JSON.stringify(P.defaultValue));break}case"catch":{this.process(P.innerType,G),j.ref=P.innerType;let V;try{V=P.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}A.default=V;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let V=A,C=$._zod.pattern;if(!C)throw Error("Pattern not found in template literal");V.type="string",V.pattern=C.source;break}case"pipe":{let V=this.io==="input"?P.in._zod.def.type==="transform"?P.out:P.in:P.out;this.process(V,G),j.ref=V;break}case"readonly":{this.process(P.innerType,G),j.ref=P.innerType,A.readOnly=!0;break}case"promise":{this.process(P.innerType,G),j.ref=P.innerType;break}case"optional":{this.process(P.innerType,G),j.ref=P.innerType;break}case"lazy":{let V=$._zod.innerType;this.process(V,G),j.ref=V;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let J=this.metadataRegistry.get($);if(J)Object.assign(j.schema,J);if(this.io==="input"&&qq($))delete j.schema.examples,delete j.schema.default;if(this.io==="input"&&j.schema._prefault)(K=j.schema).default??(K.default=j.schema._prefault);return delete j.schema._prefault,this.seen.get($).schema}emit($,q){let K={cycles:q?.cycles??"ref",reused:q?.reused??"inline",external:q?.external??void 0},P=this.seen.get($);if(!P)throw Error("Unprocessed schema. This is a bug in Zod.");let _=(w)=>{let G=this.target==="draft-2020-12"?"$defs":"definitions";if(K.external){let C=K.external.registry.get(w[0])?.id,E=K.external.uri??((I)=>I);if(C)return{ref:E(C)};let R=w[1].defId??w[1].schema.id??`schema${this.counter++}`;return w[1].defId=R,{defId:R,ref:`${E("__shared")}#/${G}/${R}`}}if(w[1]===P)return{ref:"#"};let A=`${"#"}/${G}/`,V=w[1].schema.id??`__schema${this.counter++}`;return{defId:V,ref:A+V}},O=(w)=>{if(w[1].schema.$ref)return;let G=w[1],{ref:f,defId:A}=_(w);if(G.def={...G.schema},A)G.defId=A;let V=G.schema;for(let C in V)delete V[C];V.$ref=f};if(K.cycles==="throw")for(let w of this.seen.entries()){let G=w[1];if(G.cycle)throw Error(`Cycle detected: #/${G.cycle?.join("/")}/<root>
|
|
96
|
+
`));return await j.blob()}var DF=Object.freeze({status:"aborted"});function Q_($,q,K){function P(z,J){var w;Object.defineProperty(z,"_zod",{value:z._zod??{},enumerable:!1}),(w=z._zod).traits??(w.traits=new Set),z._zod.traits.add($),q(z,J);for(let G in j.prototype)if(!(G in z))Object.defineProperty(z,G,{value:j.prototype[G].bind(z)});z._zod.constr=j,z._zod.def=J}let _=K?.Parent??Object;class O extends _{}Object.defineProperty(O,"name",{value:$});function j(z){var J;let w=K?.Parent?new O:this;P(w,z),(J=w._zod).deferred??(J.deferred=[]);for(let G of w._zod.deferred)G();return w}return Object.defineProperty(j,"init",{value:P}),Object.defineProperty(j,Symbol.hasInstance,{value:(z)=>{if(K?.Parent&&z instanceof K.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(j,"name",{value:$}),j}var gF=Symbol("zod_brand");class K_ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var f2={};function XP($){if($)Object.assign(f2,$);return f2}function k2($){let q=Object.values($).filter((P)=>typeof P==="number");return Object.entries($).filter(([P,_])=>q.indexOf(+P)===-1).map(([P,_])=>_)}function OX($,q){if(typeof q==="bigint")return q.toString();return q}function YX($){return{get value(){{let K=$();return Object.defineProperty(this,"value",{value:K}),K}throw Error("cached value already set")}}}var vX=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};var AR=YX(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function e_($,q,K){let P=new $._zod.constr(q??$._zod.def);if(!q||K?.parent)P._zod.parent=$;return P}function zX($){let q=$;if(!q)return{};if(typeof q==="string")return{error:()=>q};if(q?.message!==void 0){if(q?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");q.error=q.message}if(delete q.message,typeof q.error==="string")return{...q,error:()=>q.error};return q}var LF={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function r1($,q=0){for(let K=q;K<$.issues.length;K++)if($.issues[K]?.continue!==!0)return!0;return!1}function o1($){return typeof $==="string"?$:$?.message}function fP($,q,K){let P={...$,path:$.path??[]};if(!$.message){let _=o1($.inst?._zod.def?.error?.($))??o1(q?.error?.($))??o1(K.customError?.($))??o1(K.localeError?.($))??"Invalid input";P.message=_}if(delete P.inst,delete P.continue,!q?.reportInput)delete P.input;return P}var WX=($,q)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:q,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(q,OX,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},HX=Q_("$ZodError",WX),n1=Q_("$ZodError",WX,{Parent:Error});var VR=($)=>(q,K,P,_)=>{let O=P?Object.assign(P,{async:!1}):{async:!1},j=q._zod.run({value:K,issues:[]},O);if(j instanceof Promise)throw new K_;if(j.issues.length){let z=new(_?.Err??$)(j.issues.map((J)=>fP(J,O,XP())));throw vX(z,_?.callee),z}return j.value},JX=VR(n1);var SR=($)=>(q,K,P)=>{let _=P?{...P,async:!1}:{async:!1},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)throw new K_;return O.issues.length?{success:!1,error:new($??HX)(O.issues.map((j)=>fP(j,_,XP())))}:{success:!0,data:O.value}},TX=SR(n1),MR=($)=>async(q,K,P)=>{let _=P?Object.assign(P,{async:!0}):{async:!0},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)O=await O;return O.issues.length?{success:!1,error:new $(O.issues.map((j)=>fP(j,_,XP())))}:{success:!0,data:O.value}},wX=MR(n1);var ZX={major:4,minor:0,patch:0};var NR=Q_("$ZodType",($,q)=>{var K;$??($={}),$._zod.def=q,$._zod.bag=$._zod.bag||{},$._zod.version=ZX;let P=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))P.unshift($);for(let _ of P)for(let O of _._zod.onattach)O($);if(P.length===0)(K=$._zod).deferred??(K.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(O,j,z)=>{let J=r1(O),w;for(let G of j){if(G._zod.def.when){if(!G._zod.def.when(O))continue}else if(J)continue;let f=O.issues.length,A=G._zod.check(O);if(A instanceof Promise&&z?.async===!1)throw new K_;if(w||A instanceof Promise)w=(w??Promise.resolve()).then(async()=>{if(await A,O.issues.length===f)return;if(!J)J=r1(O,f)});else{if(O.issues.length===f)continue;if(!J)J=r1(O,f)}}if(w)return w.then(()=>{return O});return O};$._zod.run=(O,j)=>{let z=$._zod.parse(O,j);if(z instanceof Promise){if(j.async===!1)throw new K_;return z.then((J)=>_(J,P,j))}return _(z,P,j)}}$["~standard"]={validate:(_)=>{try{let O=TX($,_);return O.success?{value:O.data}:{issues:O.error?.issues}}catch(O){return wX($,_).then((j)=>j.success?{value:j.data}:{issues:j.error?.issues})}},vendor:"zod",version:1}});var XX=Q_("$ZodNever",($,q)=>{NR.init($,q),$._zod.parse=(K,P)=>{return K.issues.push({expected:"never",code:"invalid_type",input:K.value,inst:$}),K}});var QF=Symbol("ZodOutput"),eF=Symbol("ZodInput");class i1{constructor(){this._map=new Map,this._idmap=new Map}add($,...q){let K=q[0];if(this._map.set($,K),K&&typeof K==="object"&&"id"in K){if(this._idmap.has(K.id))throw Error(`ID ${K.id} already exists in the registry`);this._idmap.set(K.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let q=this._map.get($);if(q&&typeof q==="object"&&"id"in q)this._idmap.delete(q.id);return this._map.delete($),this}get($){let q=$._zod.parent;if(q){let K={...this.get(q)??{}};return delete K.id,{...K,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function CR(){return new i1}var p8=CR();function fX($,q){return new $({type:"never",...zX(q)})}class A2{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??p8,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,q={path:[],schemaPath:[]}){var K;let P=$._zod.def,_={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},O=this.seen.get($);if(O){if(O.count++,q.schemaPath.includes($))O.cycle=q.path;return O.schema}let j={schema:{},count:1,cycle:void 0,path:q.path};this.seen.set($,j);let z=$._zod.toJSONSchema?.();if(z)j.schema=z;else{let G={...q,schemaPath:[...q.schemaPath,$],path:q.path},f=$._zod.parent;if(f)j.ref=f,this.process(f,G),this.seen.get(f).isParent=!0;else{let A=j.schema;switch(P.type){case"string":{let V=A;V.type="string";let{minimum:C,maximum:E,format:R,patterns:I,contentEncoding:D}=$._zod.bag;if(typeof C==="number")V.minLength=C;if(typeof E==="number")V.maxLength=E;if(R){if(V.format=_[R]??R,V.format==="")delete V.format}if(D)V.contentEncoding=D;if(I&&I.size>0){let b=[...I];if(b.length===1)V.pattern=b[0].source;else if(b.length>1)j.schema.allOf=[...b.map((u)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:u.source}))]}break}case"number":{let V=A,{minimum:C,maximum:E,format:R,multipleOf:I,exclusiveMaximum:D,exclusiveMinimum:b}=$._zod.bag;if(typeof R==="string"&&R.includes("int"))V.type="integer";else V.type="number";if(typeof b==="number")V.exclusiveMinimum=b;if(typeof C==="number"){if(V.minimum=C,typeof b==="number")if(b>=C)delete V.minimum;else delete V.exclusiveMinimum}if(typeof D==="number")V.exclusiveMaximum=D;if(typeof E==="number"){if(V.maximum=E,typeof D==="number")if(D<=E)delete V.maximum;else delete V.exclusiveMaximum}if(typeof I==="number")V.multipleOf=I;break}case"boolean":{let V=A;V.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{A.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{A.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let V=A,{minimum:C,maximum:E}=$._zod.bag;if(typeof C==="number")V.minItems=C;if(typeof E==="number")V.maxItems=E;V.type="array",V.items=this.process(P.element,{...G,path:[...G.path,"items"]});break}case"object":{let V=A;V.type="object",V.properties={};let C=P.shape;for(let I in C)V.properties[I]=this.process(C[I],{...G,path:[...G.path,"properties",I]});let E=new Set(Object.keys(C)),R=new Set([...E].filter((I)=>{let D=P.shape[I]._zod;if(this.io==="input")return D.optin===void 0;else return D.optout===void 0}));if(R.size>0)V.required=Array.from(R);if(P.catchall?._zod.def.type==="never")V.additionalProperties=!1;else if(!P.catchall){if(this.io==="output")V.additionalProperties=!1}else if(P.catchall)V.additionalProperties=this.process(P.catchall,{...G,path:[...G.path,"additionalProperties"]});break}case"union":{let V=A;V.anyOf=P.options.map((C,E)=>this.process(C,{...G,path:[...G.path,"anyOf",E]}));break}case"intersection":{let V=A,C=this.process(P.left,{...G,path:[...G.path,"allOf",0]}),E=this.process(P.right,{...G,path:[...G.path,"allOf",1]}),R=(D)=>("allOf"in D)&&Object.keys(D).length===1,I=[...R(C)?C.allOf:[C],...R(E)?E.allOf:[E]];V.allOf=I;break}case"tuple":{let V=A;V.type="array";let C=P.items.map((I,D)=>this.process(I,{...G,path:[...G.path,"prefixItems",D]}));if(this.target==="draft-2020-12")V.prefixItems=C;else V.items=C;if(P.rest){let I=this.process(P.rest,{...G,path:[...G.path,"items"]});if(this.target==="draft-2020-12")V.items=I;else V.additionalItems=I}if(P.rest)V.items=this.process(P.rest,{...G,path:[...G.path,"items"]});let{minimum:E,maximum:R}=$._zod.bag;if(typeof E==="number")V.minItems=E;if(typeof R==="number")V.maxItems=R;break}case"record":{let V=A;V.type="object",V.propertyNames=this.process(P.keyType,{...G,path:[...G.path,"propertyNames"]}),V.additionalProperties=this.process(P.valueType,{...G,path:[...G.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let V=A,C=k2(P.entries);if(C.every((E)=>typeof E==="number"))V.type="number";if(C.every((E)=>typeof E==="string"))V.type="string";V.enum=C;break}case"literal":{let V=A,C=[];for(let E of P.values)if(E===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else C.push(Number(E));else C.push(E);if(C.length===0);else if(C.length===1){let E=C[0];V.type=E===null?"null":typeof E,V.const=E}else{if(C.every((E)=>typeof E==="number"))V.type="number";if(C.every((E)=>typeof E==="string"))V.type="string";if(C.every((E)=>typeof E==="boolean"))V.type="string";if(C.every((E)=>E===null))V.type="null";V.enum=C}break}case"file":{let V=A,C={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:R,mime:I}=$._zod.bag;if(E!==void 0)C.minLength=E;if(R!==void 0)C.maxLength=R;if(I)if(I.length===1)C.contentMediaType=I[0],Object.assign(V,C);else V.anyOf=I.map((D)=>{return{...C,contentMediaType:D}});else Object.assign(V,C);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let V=this.process(P.innerType,G);A.anyOf=[V,{type:"null"}];break}case"nonoptional":{this.process(P.innerType,G),j.ref=P.innerType;break}case"success":{let V=A;V.type="boolean";break}case"default":{this.process(P.innerType,G),j.ref=P.innerType,A.default=JSON.parse(JSON.stringify(P.defaultValue));break}case"prefault":{if(this.process(P.innerType,G),j.ref=P.innerType,this.io==="input")A._prefault=JSON.parse(JSON.stringify(P.defaultValue));break}case"catch":{this.process(P.innerType,G),j.ref=P.innerType;let V;try{V=P.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}A.default=V;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let V=A,C=$._zod.pattern;if(!C)throw Error("Pattern not found in template literal");V.type="string",V.pattern=C.source;break}case"pipe":{let V=this.io==="input"?P.in._zod.def.type==="transform"?P.out:P.in:P.out;this.process(V,G),j.ref=V;break}case"readonly":{this.process(P.innerType,G),j.ref=P.innerType,A.readOnly=!0;break}case"promise":{this.process(P.innerType,G),j.ref=P.innerType;break}case"optional":{this.process(P.innerType,G),j.ref=P.innerType;break}case"lazy":{let V=$._zod.innerType;this.process(V,G),j.ref=V;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let J=this.metadataRegistry.get($);if(J)Object.assign(j.schema,J);if(this.io==="input"&&qq($))delete j.schema.examples,delete j.schema.default;if(this.io==="input"&&j.schema._prefault)(K=j.schema).default??(K.default=j.schema._prefault);return delete j.schema._prefault,this.seen.get($).schema}emit($,q){let K={cycles:q?.cycles??"ref",reused:q?.reused??"inline",external:q?.external??void 0},P=this.seen.get($);if(!P)throw Error("Unprocessed schema. This is a bug in Zod.");let _=(w)=>{let G=this.target==="draft-2020-12"?"$defs":"definitions";if(K.external){let C=K.external.registry.get(w[0])?.id,E=K.external.uri??((I)=>I);if(C)return{ref:E(C)};let R=w[1].defId??w[1].schema.id??`schema${this.counter++}`;return w[1].defId=R,{defId:R,ref:`${E("__shared")}#/${G}/${R}`}}if(w[1]===P)return{ref:"#"};let A=`${"#"}/${G}/`,V=w[1].schema.id??`__schema${this.counter++}`;return{defId:V,ref:A+V}},O=(w)=>{if(w[1].schema.$ref)return;let G=w[1],{ref:f,defId:A}=_(w);if(G.def={...G.schema},A)G.defId=A;let V=G.schema;for(let C in V)delete V[C];V.$ref=f};if(K.cycles==="throw")for(let w of this.seen.entries()){let G=w[1];if(G.cycle)throw Error(`Cycle detected: #/${G.cycle?.join("/")}/<root>
|
|
97
97
|
|
|
98
98
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let w of this.seen.entries()){let G=w[1];if($===w[0]){O(w);continue}if(K.external){let A=K.external.registry.get(w[0])?.id;if($!==w[0]&&A){O(w);continue}}if(this.metadataRegistry.get(w[0])?.id){O(w);continue}if(G.cycle){O(w);continue}if(G.count>1){if(K.reused==="ref"){O(w);continue}}}let j=(w,G)=>{let f=this.seen.get(w),A=f.def??f.schema,V={...A};if(f.ref===null)return;let C=f.ref;if(f.ref=null,C){j(C,G);let E=this.seen.get(C).schema;if(E.$ref&&G.target==="draft-7")A.allOf=A.allOf??[],A.allOf.push(E);else Object.assign(A,E),Object.assign(A,V)}if(!f.isParent)this.override({zodSchema:w,jsonSchema:A,path:f.path??[]})};for(let w of[...this.seen.entries()].reverse())j(w[0],{target:this.target});let z={};if(this.target==="draft-2020-12")z.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")z.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);if(K.external?.uri){let w=K.external.registry.get($)?.id;if(!w)throw Error("Schema is missing an `id` property");z.$id=K.external.uri(w)}Object.assign(z,P.def);let J=K.external?.defs??{};for(let w of this.seen.entries()){let G=w[1];if(G.def&&G.defId)J[G.defId]=G.def}if(K.external);else if(Object.keys(J).length>0)if(this.target==="draft-2020-12")z.$defs=J;else z.definitions=J;try{return JSON.parse(JSON.stringify(z))}catch(w){throw Error("Error converting schema to JSON.")}}}function G2($,q){if($ instanceof i1){let P=new A2(q),_={};for(let z of $._idmap.entries()){let[J,w]=z;P.process(w)}let O={},j={registry:$,uri:q?.uri,defs:_};for(let z of $._idmap.entries()){let[J,w]=z;O[J]=P.emit(w,{...q,external:j})}if(Object.keys(_).length>0){let z=P.target==="draft-2020-12"?"$defs":"definitions";O.__shared={[z]:_}}return{schemas:O}}let K=new A2(q);return K.process($),K.emit($,q)}function qq($,q){let K=q??{seen:new Set};if(K.seen.has($))return!1;K.seen.add($);let _=$._zod.def;switch(_.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return qq(_.element,K);case"object":{for(let O in _.shape)if(qq(_.shape[O],K))return!0;return!1}case"union":{for(let O of _.options)if(qq(O,K))return!0;return!1}case"intersection":return qq(_.left,K)||qq(_.right,K);case"tuple":{for(let O of _.items)if(qq(O,K))return!0;if(_.rest&&qq(_.rest,K))return!0;return!1}case"record":return qq(_.keyType,K)||qq(_.valueType,K);case"map":return qq(_.keyType,K)||qq(_.valueType,K);case"set":return qq(_.valueType,K);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return qq(_.innerType,K);case"lazy":return qq(_.getter(),K);case"default":return qq(_.innerType,K);case"prefault":return qq(_.innerType,K);case"custom":return!1;case"transform":return!0;case"pipe":return qq(_.in,K)||qq(_.out,K);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${_.type}`)}var AX=Symbol("Let zodToJsonSchema decide on which parser to use");var kX={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},GX=($)=>typeof $==="string"?{...kX,name:$}:{...kX,...$};var VX=($)=>{let q=GX($),K=q.name!==void 0?[...q.basePath,q.definitionPath,q.name]:q.basePath;return{...q,flags:{hasReferencedOpenAiAnyType:!1},currentPath:K,propertyPath:void 0,seen:new Map(Object.entries(q.definitions).map(([P,_])=>[_._def,{def:_._def,path:[...q.basePath,q.definitionPath,P],jsonSchema:void 0}]))}};function V2($,q,K,P){if(!P?.errorMessages)return;if(K)$.errorMessage={...$.errorMessage,[q]:K}}function Z6($,q,K,P,_){$[q]=K,V2($,q,P,_)}var t1=($,q)=>{let K=0;for(;K<$.length&&K<q.length;K++)if($[K]!==q[K])break;return[($.length-K).toString(),...q.slice(K)].join("/")};var i$={};uq(i$,{xid:()=>Jg,void:()=>pg,uuidv7:()=>Pg,uuidv6:()=>_g,uuidv4:()=>Kg,uuid:()=>qg,util:()=>o$,url:()=>jg,uppercase:()=>iP,unknown:()=>H4,union:()=>qz,undefined:()=>ug,ulid:()=>Hg,uint64:()=>Lg,uint32:()=>Ig,tuple:()=>ff,trim:()=>QP,treeifyError:()=>L2,transform:()=>Pz,toUpperCase:()=>sP,toLowerCase:()=>eP,toJSONSchema:()=>Xv,templateLiteral:()=>sg,symbol:()=>bg,superRefine:()=>of,success:()=>ag,stringbool:()=>jL,stringFormat:()=>Sg,string:()=>bv,strictObject:()=>dg,startsWith:()=>BP,size:()=>oP,setErrorMap:()=>zL,set:()=>ig,safeParseAsync:()=>Nv,safeParse:()=>Mv,safeEncodeAsync:()=>gv,safeEncode:()=>Iv,safeDecodeAsync:()=>Lv,safeDecode:()=>Dv,registry:()=>k9,regexes:()=>z8,regex:()=>rP,refine:()=>lf,record:()=>kf,readonly:()=>yf,property:()=>zv,promise:()=>$L,prettifyError:()=>b2,preprocess:()=>YL,prefault:()=>Rf,positive:()=>jv,pipe:()=>U9,partialRecord:()=>rg,parseAsync:()=>Sv,parse:()=>Vv,overwrite:()=>jK,optional:()=>t9,object:()=>mg,number:()=>Kf,nullish:()=>Fg,nullable:()=>B9,null:()=>Yf,normalize:()=>aP,nonpositive:()=>Yv,nonoptional:()=>If,nonnegative:()=>vv,never:()=>sv,negative:()=>Ov,nativeEnum:()=>tg,nanoid:()=>vg,nan:()=>Qg,multipleOf:()=>Y_,minSize:()=>v_,minLength:()=>uK,mime:()=>FP,maxSize:()=>Y4,maxLength:()=>v4,map:()=>ng,lte:()=>W8,lt:()=>_K,lowercase:()=>nP,looseObject:()=>lg,locales:()=>cP,literal:()=>Bg,length:()=>z4,lazy:()=>cf,ksuid:()=>Tg,keyof:()=>cg,jwt:()=>Vg,json:()=>OL,iso:()=>n9,ipv6:()=>Zg,ipv4:()=>wg,intersection:()=>Zf,int64:()=>gg,int32:()=>Rg,int:()=>uv,instanceof:()=>PL,includes:()=>tP,httpUrl:()=>Og,hostname:()=>Mg,hex:()=>Ng,hash:()=>Cg,guid:()=>$g,gte:()=>lq,gt:()=>PK,globalRegistry:()=>m8,getErrorMap:()=>WL,function:()=>qL,formatError:()=>RP,float64:()=>hg,float32:()=>Eg,flattenError:()=>hP,file:()=>Ug,enum:()=>_z,endsWith:()=>UP,encodeAsync:()=>hv,encode:()=>Cv,emoji:()=>Yg,email:()=>sD,e164:()=>Gg,discriminatedUnion:()=>og,decodeAsync:()=>Rv,decode:()=>Ev,date:()=>xg,custom:()=>_L,cuid2:()=>Wg,cuid:()=>zg,core:()=>OK,config:()=>p6,coerce:()=>zz,codec:()=>eg,clone:()=>Dq,cidrv6:()=>fg,cidrv4:()=>Xg,check:()=>KL,catch:()=>Lf,boolean:()=>_f,bigint:()=>Dg,base64url:()=>Ag,base64:()=>kg,array:()=>Q9,any:()=>yg,_function:()=>qL,_default:()=>Ef,_ZodString:()=>yv,ZodXID:()=>ov,ZodVoid:()=>Hf,ZodUnknown:()=>zf,ZodUnion:()=>$z,ZodUndefined:()=>jf,ZodUUID:()=>YK,ZodURL:()=>F9,ZodULID:()=>lv,ZodType:()=>z6,ZodTuple:()=>Xf,ZodTransform:()=>Mf,ZodTemplateLiteral:()=>pf,ZodSymbol:()=>Pf,ZodSuccess:()=>Df,ZodStringFormat:()=>S6,ZodString:()=>q7,ZodSet:()=>Gf,ZodRecord:()=>Kz,ZodRealError:()=>oq,ZodReadonly:()=>uf,ZodPromise:()=>mf,ZodPrefault:()=>hf,ZodPipe:()=>Yz,ZodOptional:()=>jz,ZodObject:()=>e9,ZodNumberFormat:()=>J4,ZodNumber:()=>_7,ZodNullable:()=>Nf,ZodNull:()=>Of,ZodNonOptional:()=>Oz,ZodNever:()=>Wf,ZodNanoID:()=>cv,ZodNaN:()=>bf,ZodMap:()=>Af,ZodLiteral:()=>Vf,ZodLazy:()=>xf,ZodKSUID:()=>rv,ZodJWT:()=>Qv,ZodIssueCode:()=>vL,ZodIntersection:()=>wf,ZodISOTime:()=>o9,ZodISODuration:()=>r9,ZodISODateTime:()=>d9,ZodISODate:()=>l9,ZodIPv6:()=>iv,ZodIPv4:()=>nv,ZodGUID:()=>i9,ZodFunction:()=>df,ZodFirstPartyTypeKind:()=>$6,ZodFile:()=>Sf,ZodError:()=>QD,ZodEnum:()=>$7,ZodEmoji:()=>xv,ZodEmail:()=>pv,ZodE164:()=>av,ZodDiscriminatedUnion:()=>Tf,ZodDefault:()=>Cf,ZodDate:()=>a9,ZodCustomStringFormat:()=>K7,ZodCustom:()=>s9,ZodCodec:()=>vz,ZodCatch:()=>gf,ZodCUID2:()=>dv,ZodCUID:()=>mv,ZodCIDRv6:()=>Bv,ZodCIDRv4:()=>tv,ZodBoolean:()=>P7,ZodBigIntFormat:()=>ev,ZodBigInt:()=>j7,ZodBase64URL:()=>Fv,ZodBase64:()=>Uv,ZodArray:()=>Jf,ZodAny:()=>vf,TimePrecision:()=>g3,NEVER:()=>S2,$output:()=>h3,$input:()=>R3,$brand:()=>M2});var OK={};uq(OK,{version:()=>IY,util:()=>o$,treeifyError:()=>L2,toJSONSchema:()=>Xv,toDotPath:()=>hX,safeParseAsync:()=>y2,safeParse:()=>u2,safeEncodeAsync:()=>PI,safeEncode:()=>KI,safeDecodeAsync:()=>jI,safeDecode:()=>_I,registry:()=>k9,regexes:()=>z8,prettifyError:()=>b2,parseAsync:()=>a1,parse:()=>F1,locales:()=>cP,isValidJWT:()=>iX,isValidBase64URL:()=>nX,isValidBase64:()=>aY,globalRegistry:()=>m8,globalConfig:()=>AP,formatError:()=>RP,flattenError:()=>hP,encodeAsync:()=>$I,encode:()=>eR,decodeAsync:()=>qI,decode:()=>sR,config:()=>p6,clone:()=>Dq,_xid:()=>I9,_void:()=>qv,_uuidv7:()=>M9,_uuidv6:()=>S9,_uuidv4:()=>V9,_uuid:()=>G9,_url:()=>lP,_uppercase:()=>iP,_unknown:()=>s3,_union:()=>RD,_undefined:()=>a3,_ulid:()=>R9,_uint64:()=>U3,_uint32:()=>o3,_tuple:()=>gD,_trim:()=>QP,_transform:()=>cD,_toUpperCase:()=>sP,_toLowerCase:()=>eP,_templateLiteral:()=>BD,_symbol:()=>F3,_superRefine:()=>wv,_success:()=>rD,_stringbool:()=>Zv,_stringFormat:()=>W4,_string:()=>I3,_startsWith:()=>BP,_size:()=>oP,_set:()=>uD,_safeParseAsync:()=>j4,_safeParse:()=>P4,_safeEncodeAsync:()=>_9,_safeEncode:()=>q9,_safeDecodeAsync:()=>P9,_safeDecode:()=>K9,_regex:()=>rP,_refine:()=>Tv,_record:()=>LD,_readonly:()=>tD,_property:()=>zv,_promise:()=>FD,_positive:()=>jv,_pipe:()=>iD,_parseAsync:()=>_4,_parse:()=>K4,_overwrite:()=>jK,_optional:()=>mD,_number:()=>p3,_nullable:()=>dD,_null:()=>Q3,_normalize:()=>aP,_nonpositive:()=>Yv,_nonoptional:()=>oD,_nonnegative:()=>vv,_never:()=>$v,_negative:()=>Ov,_nativeEnum:()=>pD,_nanoid:()=>C9,_nan:()=>Pv,_multipleOf:()=>Y_,_minSize:()=>v_,_minLength:()=>uK,_min:()=>lq,_mime:()=>FP,_maxSize:()=>Y4,_maxLength:()=>v4,_max:()=>W8,_map:()=>bD,_lte:()=>W8,_lt:()=>_K,_lowercase:()=>nP,_literal:()=>xD,_length:()=>z4,_lazy:()=>UD,_ksuid:()=>D9,_jwt:()=>c9,_isoTime:()=>u3,_isoDuration:()=>y3,_isoDateTime:()=>L3,_isoDate:()=>b3,_ipv6:()=>L9,_ipv4:()=>g9,_intersection:()=>DD,_int64:()=>B3,_int32:()=>l3,_int:()=>c3,_includes:()=>tP,_guid:()=>dP,_gte:()=>lq,_gt:()=>PK,_float64:()=>d3,_float32:()=>m3,_file:()=>Hv,_enum:()=>yD,_endsWith:()=>UP,_encodeAsync:()=>s1,_encode:()=>Q1,_emoji:()=>N9,_email:()=>A9,_e164:()=>x9,_discriminatedUnion:()=>ID,_default:()=>lD,_decodeAsync:()=>$9,_decode:()=>e1,_date:()=>Kv,_custom:()=>Jv,_cuid2:()=>h9,_cuid:()=>E9,_coercedString:()=>D3,_coercedNumber:()=>x3,_coercedDate:()=>_v,_coercedBoolean:()=>n3,_coercedBigint:()=>t3,_cidrv6:()=>u9,_cidrv4:()=>b9,_check:()=>eX,_catch:()=>nD,_boolean:()=>r3,_bigint:()=>i3,_base64url:()=>p9,_base64:()=>y9,_array:()=>Wv,_any:()=>e3,TimePrecision:()=>g3,NEVER:()=>S2,JSONSchemaGenerator:()=>m9,JSONSchema:()=>sX,Doc:()=>v9,$output:()=>h3,$input:()=>R3,$constructor:()=>P$,$brand:()=>M2,$ZodXID:()=>dY,$ZodVoid:()=>W5,$ZodUnknown:()=>v5,$ZodUnion:()=>X9,$ZodUndefined:()=>j5,$ZodUUID:()=>LY,$ZodURL:()=>uY,$ZodULID:()=>mY,$ZodType:()=>q6,$ZodTuple:()=>f9,$ZodTransform:()=>S5,$ZodTemplateLiteral:()=>b5,$ZodSymbol:()=>P5,$ZodSuccess:()=>R5,$ZodStringFormat:()=>V6,$ZodString:()=>O_,$ZodSet:()=>k5,$ZodRegistry:()=>mP,$ZodRecord:()=>X5,$ZodRealError:()=>dq,$ZodReadonly:()=>L5,$ZodPromise:()=>y5,$ZodPrefault:()=>E5,$ZodPipe:()=>g5,$ZodOptional:()=>M5,$ZodObjectJIT:()=>T5,$ZodObject:()=>UX,$ZodNumberFormat:()=>K5,$ZodNumber:()=>w9,$ZodNullable:()=>N5,$ZodNull:()=>O5,$ZodNonOptional:()=>h5,$ZodNever:()=>z5,$ZodNanoID:()=>pY,$ZodNaN:()=>D5,$ZodMap:()=>f5,$ZodLiteral:()=>G5,$ZodLazy:()=>p5,$ZodKSUID:()=>lY,$ZodJWT:()=>$5,$ZodIntersection:()=>Z5,$ZodISOTime:()=>nY,$ZodISODuration:()=>iY,$ZodISODateTime:()=>oY,$ZodISODate:()=>rY,$ZodIPv6:()=>BY,$ZodIPv4:()=>tY,$ZodGUID:()=>gY,$ZodFunction:()=>u5,$ZodFile:()=>V5,$ZodError:()=>EP,$ZodEnum:()=>A5,$ZodEncodeError:()=>__,$ZodEmoji:()=>yY,$ZodEmail:()=>bY,$ZodE164:()=>sY,$ZodDiscriminatedUnion:()=>w5,$ZodDefault:()=>C5,$ZodDate:()=>H5,$ZodCustomStringFormat:()=>q5,$ZodCustom:()=>x5,$ZodCodec:()=>LP,$ZodCheckUpperCase:()=>SY,$ZodCheckStringFormat:()=>O4,$ZodCheckStartsWith:()=>NY,$ZodCheckSizeEquals:()=>XY,$ZodCheckRegex:()=>GY,$ZodCheckProperty:()=>EY,$ZodCheckOverwrite:()=>RY,$ZodCheckNumberFormat:()=>JY,$ZodCheckMultipleOf:()=>HY,$ZodCheckMinSize:()=>ZY,$ZodCheckMinLength:()=>kY,$ZodCheckMimeType:()=>hY,$ZodCheckMaxSize:()=>wY,$ZodCheckMaxLength:()=>fY,$ZodCheckLowerCase:()=>VY,$ZodCheckLessThan:()=>O9,$ZodCheckLengthEquals:()=>AY,$ZodCheckIncludes:()=>MY,$ZodCheckGreaterThan:()=>Y9,$ZodCheckEndsWith:()=>CY,$ZodCheckBigIntFormat:()=>TY,$ZodCheck:()=>N6,$ZodCatch:()=>I5,$ZodCUID2:()=>cY,$ZodCUID:()=>xY,$ZodCIDRv6:()=>FY,$ZodCIDRv4:()=>UY,$ZodBoolean:()=>gP,$ZodBigIntFormat:()=>_5,$ZodBigInt:()=>Z9,$ZodBase64URL:()=>eY,$ZodBase64:()=>QY,$ZodAsyncError:()=>x8,$ZodArray:()=>J5,$ZodAny:()=>Y5});var S2=Object.freeze({status:"aborted"});function P$($,q,K){function P(z,J){var w;Object.defineProperty(z,"_zod",{value:z._zod??{},enumerable:!1}),(w=z._zod).traits??(w.traits=new Set),z._zod.traits.add($),q(z,J);for(let G in j.prototype)if(!(G in z))Object.defineProperty(z,G,{value:j.prototype[G].bind(z)});z._zod.constr=j,z._zod.def=J}let _=K?.Parent??Object;class O extends _{}Object.defineProperty(O,"name",{value:$});function j(z){var J;let w=K?.Parent?new O:this;P(w,z),(J=w._zod).deferred??(J.deferred=[]);for(let G of w._zod.deferred)G();return w}return Object.defineProperty(j,"init",{value:P}),Object.defineProperty(j,Symbol.hasInstance,{value:(z)=>{if(K?.Parent&&z instanceof K.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(j,"name",{value:$}),j}var M2=Symbol("zod_brand");class x8 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class __ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var AP={};function p6($){if($)Object.assign(AP,$);return AP}var o$={};uq(o$,{unwrapMessage:()=>GP,uint8ArrayToHex:()=>aR,uint8ArrayToBase64url:()=>UR,uint8ArrayToBase64:()=>NX,stringifyPrimitive:()=>m$,shallowClone:()=>h2,safeExtend:()=>oR,required:()=>iR,randomString:()=>yR,propertyKeyTypes:()=>MP,promiseAllObject:()=>uR,primitiveTypes:()=>R2,prefixIssues:()=>eq,pick:()=>mR,partial:()=>nR,optionalKeys:()=>I2,omit:()=>dR,objectClone:()=>gR,numKeys:()=>pR,nullish:()=>IK,normalizeParams:()=>d$,mergeDefs:()=>gK,merge:()=>rR,jsonStringifyReplacer:()=>s_,joinValues:()=>z$,issue:()=>q4,isPlainObject:()=>LK,isObject:()=>P_,hexToUint8Array:()=>FR,getSizableOrigin:()=>NP,getParsedType:()=>xR,getLengthableOrigin:()=>CP,getEnumValues:()=>VP,getElementAtPath:()=>bR,floatSafeRemainder:()=>C2,finalizeIssue:()=>sq,extend:()=>lR,escapeRegex:()=>c8,esc:()=>B1,defineLazy:()=>T6,createTransparentProxy:()=>cR,cloneDef:()=>LR,clone:()=>Dq,cleanRegex:()=>SP,cleanEnum:()=>tR,captureStackTrace:()=>U1,cached:()=>$4,base64urlToUint8Array:()=>BR,base64ToUint8Array:()=>MX,assignProp:()=>DK,assertNotEqual:()=>hR,assertNever:()=>IR,assertIs:()=>RR,assertEqual:()=>ER,assert:()=>DR,allowsEval:()=>E2,aborted:()=>bK,NUMBER_FORMAT_RANGES:()=>D2,Class:()=>CX,BIGINT_FORMAT_RANGES:()=>g2});function ER($){return $}function hR($){return $}function RR($){}function IR($){throw Error()}function DR($){}function VP($){let q=Object.values($).filter((P)=>typeof P==="number");return Object.entries($).filter(([P,_])=>q.indexOf(+P)===-1).map(([P,_])=>_)}function z$($,q="|"){return $.map((K)=>m$(K)).join(q)}function s_($,q){if(typeof q==="bigint")return q.toString();return q}function $4($){return{get value(){{let K=$();return Object.defineProperty(this,"value",{value:K}),K}throw Error("cached value already set")}}}function IK($){return $===null||$===void 0}function SP($){let q=$.startsWith("^")?1:0,K=$.endsWith("$")?$.length-1:$.length;return $.slice(q,K)}function C2($,q){let K=($.toString().split(".")[1]||"").length,P=q.toString(),_=(P.split(".")[1]||"").length;if(_===0&&/\d?e-\d?/.test(P)){let J=P.match(/\d?e-(\d?)/);if(J?.[1])_=Number.parseInt(J[1])}let O=K>_?K:_,j=Number.parseInt($.toFixed(O).replace(".","")),z=Number.parseInt(q.toFixed(O).replace(".",""));return j%z/10**O}var SX=Symbol("evaluating");function T6($,q,K){let P=void 0;Object.defineProperty($,q,{get(){if(P===SX)return;if(P===void 0)P=SX,P=K();return P},set(_){Object.defineProperty($,q,{value:_})},configurable:!0})}function gR($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function DK($,q,K){Object.defineProperty($,q,{value:K,writable:!0,enumerable:!0,configurable:!0})}function gK(...$){let q={};for(let K of $){let P=Object.getOwnPropertyDescriptors(K);Object.assign(q,P)}return Object.defineProperties({},q)}function LR($){return gK($._zod.def)}function bR($,q){if(!q)return $;return q.reduce((K,P)=>K?.[P],$)}function uR($){let q=Object.keys($),K=q.map((P)=>$[P]);return Promise.all(K).then((P)=>{let _={};for(let O=0;O<q.length;O++)_[q[O]]=P[O];return _})}function yR($=10){let K="";for(let P=0;P<$;P++)K+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return K}function B1($){return JSON.stringify($)}var U1="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function P_($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var E2=$4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function LK($){if(P_($)===!1)return!1;let q=$.constructor;if(q===void 0)return!0;let K=q.prototype;if(P_(K)===!1)return!1;if(Object.prototype.hasOwnProperty.call(K,"isPrototypeOf")===!1)return!1;return!0}function h2($){if(LK($))return{...$};if(Array.isArray($))return[...$];return $}function pR($){let q=0;for(let K in $)if(Object.prototype.hasOwnProperty.call($,K))q++;return q}var xR=($)=>{let q=typeof $;switch(q){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${q}`)}},MP=new Set(["string","number","symbol"]),R2=new Set(["string","number","bigint","boolean","symbol","undefined"]);function c8($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dq($,q,K){let P=new $._zod.constr(q??$._zod.def);if(!q||K?.parent)P._zod.parent=$;return P}function d$($){let q=$;if(!q)return{};if(typeof q==="string")return{error:()=>q};if(q?.message!==void 0){if(q?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");q.error=q.message}if(delete q.message,typeof q.error==="string")return{...q,error:()=>q.error};return q}function cR($){let q;return new Proxy({},{get(K,P,_){return q??(q=$()),Reflect.get(q,P,_)},set(K,P,_,O){return q??(q=$()),Reflect.set(q,P,_,O)},has(K,P){return q??(q=$()),Reflect.has(q,P)},deleteProperty(K,P){return q??(q=$()),Reflect.deleteProperty(q,P)},ownKeys(K){return q??(q=$()),Reflect.ownKeys(q)},getOwnPropertyDescriptor(K,P){return q??(q=$()),Reflect.getOwnPropertyDescriptor(q,P)},defineProperty(K,P,_){return q??(q=$()),Reflect.defineProperty(q,P,_)}})}function m$($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function I2($){return Object.keys($).filter((q)=>{return $[q]._zod.optin==="optional"&&$[q]._zod.optout==="optional"})}var D2={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},g2={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function mR($,q){let K=$._zod.def,P=gK($._zod.def,{get shape(){let _={};for(let O in q){if(!(O in K.shape))throw Error(`Unrecognized key: "${O}"`);if(!q[O])continue;_[O]=K.shape[O]}return DK(this,"shape",_),_},checks:[]});return Dq($,P)}function dR($,q){let K=$._zod.def,P=gK($._zod.def,{get shape(){let _={...$._zod.def.shape};for(let O in q){if(!(O in K.shape))throw Error(`Unrecognized key: "${O}"`);if(!q[O])continue;delete _[O]}return DK(this,"shape",_),_},checks:[]});return Dq($,P)}function lR($,q){if(!LK(q))throw Error("Invalid input to extend: expected a plain object");let K=$._zod.def.checks;if(K&&K.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let _=gK($._zod.def,{get shape(){let O={...$._zod.def.shape,...q};return DK(this,"shape",O),O},checks:[]});return Dq($,_)}function oR($,q){if(!LK(q))throw Error("Invalid input to safeExtend: expected a plain object");let K={...$._zod.def,get shape(){let P={...$._zod.def.shape,...q};return DK(this,"shape",P),P},checks:$._zod.def.checks};return Dq($,K)}function rR($,q){let K=gK($._zod.def,{get shape(){let P={...$._zod.def.shape,...q._zod.def.shape};return DK(this,"shape",P),P},get catchall(){return q._zod.def.catchall},checks:[]});return Dq($,K)}function nR($,q,K){let P=gK(q._zod.def,{get shape(){let _=q._zod.def.shape,O={..._};if(K)for(let j in K){if(!(j in _))throw Error(`Unrecognized key: "${j}"`);if(!K[j])continue;O[j]=$?new $({type:"optional",innerType:_[j]}):_[j]}else for(let j in _)O[j]=$?new $({type:"optional",innerType:_[j]}):_[j];return DK(this,"shape",O),O},checks:[]});return Dq(q,P)}function iR($,q,K){let P=gK(q._zod.def,{get shape(){let _=q._zod.def.shape,O={..._};if(K)for(let j in K){if(!(j in O))throw Error(`Unrecognized key: "${j}"`);if(!K[j])continue;O[j]=new $({type:"nonoptional",innerType:_[j]})}else for(let j in _)O[j]=new $({type:"nonoptional",innerType:_[j]});return DK(this,"shape",O),O},checks:[]});return Dq(q,P)}function bK($,q=0){if($.aborted===!0)return!0;for(let K=q;K<$.issues.length;K++)if($.issues[K]?.continue!==!0)return!0;return!1}function eq($,q){return q.map((K)=>{var P;return(P=K).path??(P.path=[]),K.path.unshift($),K})}function GP($){return typeof $==="string"?$:$?.message}function sq($,q,K){let P={...$,path:$.path??[]};if(!$.message){let _=GP($.inst?._zod.def?.error?.($))??GP(q?.error?.($))??GP(K.customError?.($))??GP(K.localeError?.($))??"Invalid input";P.message=_}if(delete P.inst,delete P.continue,!q?.reportInput)delete P.input;return P}function NP($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function CP($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function q4(...$){let[q,K,P]=$;if(typeof q==="string")return{message:q,code:"custom",input:K,inst:P};return{...q}}function tR($){return Object.entries($).filter(([q,K])=>{return Number.isNaN(Number.parseInt(q,10))}).map((q)=>q[1])}function MX($){let q=atob($),K=new Uint8Array(q.length);for(let P=0;P<q.length;P++)K[P]=q.charCodeAt(P);return K}function NX($){let q="";for(let K=0;K<$.length;K++)q+=String.fromCharCode($[K]);return btoa(q)}function BR($){let q=$.replace(/-/g,"+").replace(/_/g,"/"),K="=".repeat((4-q.length%4)%4);return MX(q+K)}function UR($){return NX($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function FR($){let q=$.replace(/^0x/,"");if(q.length%2!==0)throw Error("Invalid hex string length");let K=new Uint8Array(q.length/2);for(let P=0;P<q.length;P+=2)K[P/2]=Number.parseInt(q.slice(P,P+2),16);return K}function aR($){return Array.from($).map((q)=>q.toString(16).padStart(2,"0")).join("")}class CX{constructor(...$){}}var EX=($,q)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:q,enumerable:!1}),$.message=JSON.stringify(q,s_,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},EP=P$("$ZodError",EX),dq=P$("$ZodError",EX,{Parent:Error});function hP($,q=(K)=>K.message){let K={},P=[];for(let _ of $.issues)if(_.path.length>0)K[_.path[0]]=K[_.path[0]]||[],K[_.path[0]].push(q(_));else P.push(q(_));return{formErrors:P,fieldErrors:K}}function RP($,q){let K=q||function(O){return O.message},P={_errors:[]},_=(O)=>{for(let j of O.issues)if(j.code==="invalid_union"&&j.errors.length)j.errors.map((z)=>_({issues:z}));else if(j.code==="invalid_key")_({issues:j.issues});else if(j.code==="invalid_element")_({issues:j.issues});else if(j.path.length===0)P._errors.push(K(j));else{let z=P,J=0;while(J<j.path.length){let w=j.path[J];if(J!==j.path.length-1)z[w]=z[w]||{_errors:[]};else z[w]=z[w]||{_errors:[]},z[w]._errors.push(K(j));z=z[w],J++}}};return _($),P}function L2($,q){let K=q||function(O){return O.message},P={errors:[]},_=(O,j=[])=>{var z,J;for(let w of O.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map((G)=>_({issues:G},w.path));else if(w.code==="invalid_key")_({issues:w.issues},w.path);else if(w.code==="invalid_element")_({issues:w.issues},w.path);else{let G=[...j,...w.path];if(G.length===0){P.errors.push(K(w));continue}let f=P,A=0;while(A<G.length){let V=G[A],C=A===G.length-1;if(typeof V==="string")f.properties??(f.properties={}),(z=f.properties)[V]??(z[V]={errors:[]}),f=f.properties[V];else f.items??(f.items=[]),(J=f.items)[V]??(J[V]={errors:[]}),f=f.items[V];if(C)f.errors.push(K(w));A++}}};return _($),P}function hX($){let q=[],K=$.map((P)=>typeof P==="object"?P.key:P);for(let P of K)if(typeof P==="number")q.push(`[${P}]`);else if(typeof P==="symbol")q.push(`[${JSON.stringify(String(P))}]`);else if(/[^\w$]/.test(P))q.push(`[${JSON.stringify(P)}]`);else{if(q.length)q.push(".");q.push(P)}return q.join("")}function b2($){let q=[],K=[...$.issues].sort((P,_)=>(P.path??[]).length-(_.path??[]).length);for(let P of K)if(q.push(`✖ ${P.message}`),P.path?.length)q.push(` → at ${hX(P.path)}`);return q.join(`
|
|
99
99
|
`)}var K4=($)=>(q,K,P,_)=>{let O=P?Object.assign(P,{async:!1}):{async:!1},j=q._zod.run({value:K,issues:[]},O);if(j instanceof Promise)throw new x8;if(j.issues.length){let z=new(_?.Err??$)(j.issues.map((J)=>sq(J,O,p6())));throw U1(z,_?.callee),z}return j.value},F1=K4(dq),_4=($)=>async(q,K,P,_)=>{let O=P?Object.assign(P,{async:!0}):{async:!0},j=q._zod.run({value:K,issues:[]},O);if(j instanceof Promise)j=await j;if(j.issues.length){let z=new(_?.Err??$)(j.issues.map((J)=>sq(J,O,p6())));throw U1(z,_?.callee),z}return j.value},a1=_4(dq),P4=($)=>(q,K,P)=>{let _=P?{...P,async:!1}:{async:!1},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)throw new x8;return O.issues.length?{success:!1,error:new($??EP)(O.issues.map((j)=>sq(j,_,p6())))}:{success:!0,data:O.value}},u2=P4(dq),j4=($)=>async(q,K,P)=>{let _=P?Object.assign(P,{async:!0}):{async:!0},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)O=await O;return O.issues.length?{success:!1,error:new $(O.issues.map((j)=>sq(j,_,p6())))}:{success:!0,data:O.value}},y2=j4(dq),Q1=($)=>(q,K,P)=>{let _=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return K4($)(q,K,_)},eR=Q1(dq),e1=($)=>(q,K,P)=>{return K4($)(q,K,P)},sR=e1(dq),s1=($)=>async(q,K,P)=>{let _=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return _4($)(q,K,_)},$I=s1(dq),$9=($)=>async(q,K,P)=>{return _4($)(q,K,P)},qI=$9(dq),q9=($)=>(q,K,P)=>{let _=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return P4($)(q,K,_)},KI=q9(dq),K9=($)=>(q,K,P)=>{return P4($)(q,K,P)},_I=K9(dq),_9=($)=>async(q,K,P)=>{let _=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return j4($)(q,K,_)},PI=_9(dq),P9=($)=>async(q,K,P)=>{return j4($)(q,K,P)},jI=P9(dq);var z8={};uq(z8,{xid:()=>m2,uuid7:()=>zI,uuid6:()=>vI,uuid4:()=>YI,uuid:()=>j_,uppercase:()=>WY,unicodeEmail:()=>RX,undefined:()=>vY,ulid:()=>c2,time:()=>$Y,string:()=>KY,sha512_hex:()=>RI,sha512_base64url:()=>DI,sha512_base64:()=>II,sha384_hex:()=>CI,sha384_base64url:()=>hI,sha384_base64:()=>EI,sha256_hex:()=>SI,sha256_base64url:()=>NI,sha256_base64:()=>MI,sha1_hex:()=>AI,sha1_base64url:()=>VI,sha1_base64:()=>GI,rfc5322Email:()=>HI,number:()=>jY,null:()=>YY,nanoid:()=>l2,md5_hex:()=>XI,md5_base64url:()=>kI,md5_base64:()=>fI,lowercase:()=>zY,ksuid:()=>d2,ipv6:()=>B2,ipv4:()=>t2,integer:()=>PY,idnEmail:()=>JI,html5Email:()=>WI,hostname:()=>Q2,hex:()=>ZI,guid:()=>r2,extendedDuration:()=>OI,emoji:()=>i2,email:()=>n2,e164:()=>e2,duration:()=>o2,domain:()=>wI,datetime:()=>qY,date:()=>s2,cuid2:()=>x2,cuid:()=>p2,cidrv6:()=>F2,cidrv4:()=>U2,browserEmail:()=>TI,boolean:()=>OY,bigint:()=>_Y,base64url:()=>j9,base64:()=>a2});var p2=/^[cC][^\s-]{8,}$/,x2=/^[0-9a-z]+$/,c2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,m2=/^[0-9a-vA-V]{20}$/,d2=/^[A-Za-z0-9]{27}$/,l2=/^[a-zA-Z0-9_-]{21}$/,o2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,OI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,r2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,j_=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},YI=j_(4),vI=j_(6),zI=j_(7),n2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,HI=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,RX=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,JI=RX,TI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function i2(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var t2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,B2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,U2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,F2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,a2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,j9=/^[A-Za-z0-9_-]*$/,Q2=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,wI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,e2=/^\+(?:[0-9]){6,14}[0-9]$/,IX="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",s2=new RegExp(`^${IX}$`);function DX($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function $Y($){return new RegExp(`^${DX($)}$`)}function qY($){let q=DX({precision:$.precision}),K=["Z"];if($.local)K.push("");if($.offset)K.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let P=`${q}(?:${K.join("|")})`;return new RegExp(`^${IX}T(?:${P})$`)}var KY=($)=>{let q=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${q}$`)},_Y=/^-?\d+n?$/,PY=/^-?\d+$/,jY=/^-?\d+(?:\.\d+)?/,OY=/^(?:true|false)$/i,YY=/^null$/i;var vY=/^undefined$/i;var zY=/^[^A-Z]*$/,WY=/^[^a-z]*$/,ZI=/^[0-9a-fA-F]*$/;function IP($,q){return new RegExp(`^[A-Za-z0-9+/]{${$}}${q}$`)}function DP($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var XI=/^[0-9a-fA-F]{32}$/,fI=IP(22,"=="),kI=DP(22),AI=/^[0-9a-fA-F]{40}$/,GI=IP(27,"="),VI=DP(27),SI=/^[0-9a-fA-F]{64}$/,MI=IP(43,"="),NI=DP(43),CI=/^[0-9a-fA-F]{96}$/,EI=IP(64,""),hI=DP(64),RI=/^[0-9a-fA-F]{128}$/,II=IP(86,"=="),DI=DP(86);var N6=P$("$ZodCheck",($,q)=>{var K;$._zod??($._zod={}),$._zod.def=q,(K=$._zod).onattach??(K.onattach=[])}),LX={number:"number",bigint:"bigint",object:"date"},O9=P$("$ZodCheckLessThan",($,q)=>{N6.init($,q);let K=LX[typeof q.value];$._zod.onattach.push((P)=>{let _=P._zod.bag,O=(q.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(q.value<O)if(q.inclusive)_.maximum=q.value;else _.exclusiveMaximum=q.value}),$._zod.check=(P)=>{if(q.inclusive?P.value<=q.value:P.value<q.value)return;P.issues.push({origin:K,code:"too_big",maximum:q.value,input:P.value,inclusive:q.inclusive,inst:$,continue:!q.abort})}}),Y9=P$("$ZodCheckGreaterThan",($,q)=>{N6.init($,q);let K=LX[typeof q.value];$._zod.onattach.push((P)=>{let _=P._zod.bag,O=(q.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(q.value>O)if(q.inclusive)_.minimum=q.value;else _.exclusiveMinimum=q.value}),$._zod.check=(P)=>{if(q.inclusive?P.value>=q.value:P.value>q.value)return;P.issues.push({origin:K,code:"too_small",minimum:q.value,input:P.value,inclusive:q.inclusive,inst:$,continue:!q.abort})}}),HY=P$("$ZodCheckMultipleOf",($,q)=>{N6.init($,q),$._zod.onattach.push((K)=>{var P;(P=K._zod.bag).multipleOf??(P.multipleOf=q.value)}),$._zod.check=(K)=>{if(typeof K.value!==typeof q.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof K.value==="bigint"?K.value%q.value===BigInt(0):C2(K.value,q.value)===0)return;K.issues.push({origin:typeof K.value,code:"not_multiple_of",divisor:q.value,input:K.value,inst:$,continue:!q.abort})}}),JY=P$("$ZodCheckNumberFormat",($,q)=>{N6.init($,q),q.format=q.format||"float64";let K=q.format?.includes("int"),P=K?"int":"number",[_,O]=D2[q.format];$._zod.onattach.push((j)=>{let z=j._zod.bag;if(z.format=q.format,z.minimum=_,z.maximum=O,K)z.pattern=PY}),$._zod.check=(j)=>{let z=j.value;if(K){if(!Number.isInteger(z)){j.issues.push({expected:P,format:q.format,code:"invalid_type",continue:!1,input:z,inst:$});return}if(!Number.isSafeInteger(z)){if(z>0)j.issues.push({input:z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:P,continue:!q.abort});else j.issues.push({input:z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:P,continue:!q.abort});return}}if(z<_)j.issues.push({origin:"number",input:z,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!q.abort});if(z>O)j.issues.push({origin:"number",input:z,code:"too_big",maximum:O,inst:$})}}),TY=P$("$ZodCheckBigIntFormat",($,q)=>{N6.init($,q);let[K,P]=g2[q.format];$._zod.onattach.push((_)=>{let O=_._zod.bag;O.format=q.format,O.minimum=K,O.maximum=P}),$._zod.check=(_)=>{let O=_.value;if(O<K)_.issues.push({origin:"bigint",input:O,code:"too_small",minimum:K,inclusive:!0,inst:$,continue:!q.abort});if(O>P)_.issues.push({origin:"bigint",input:O,code:"too_big",maximum:P,inst:$})}}),wY=P$("$ZodCheckMaxSize",($,q)=>{var K;N6.init($,q),(K=$._zod.def).when??(K.when=(P)=>{let _=P.value;return!IK(_)&&_.size!==void 0}),$._zod.onattach.push((P)=>{let _=P._zod.bag.maximum??Number.POSITIVE_INFINITY;if(q.maximum<_)P._zod.bag.maximum=q.maximum}),$._zod.check=(P)=>{let _=P.value;if(_.size<=q.maximum)return;P.issues.push({origin:NP(_),code:"too_big",maximum:q.maximum,inclusive:!0,input:_,inst:$,continue:!q.abort})}}),ZY=P$("$ZodCheckMinSize",($,q)=>{var K;N6.init($,q),(K=$._zod.def).when??(K.when=(P)=>{let _=P.value;return!IK(_)&&_.size!==void 0}),$._zod.onattach.push((P)=>{let _=P._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(q.minimum>_)P._zod.bag.minimum=q.minimum}),$._zod.check=(P)=>{let _=P.value;if(_.size>=q.minimum)return;P.issues.push({origin:NP(_),code:"too_small",minimum:q.minimum,inclusive:!0,input:_,inst:$,continue:!q.abort})}}),XY=P$("$ZodCheckSizeEquals",($,q)=>{var K;N6.init($,q),(K=$._zod.def).when??(K.when=(P)=>{let _=P.value;return!IK(_)&&_.size!==void 0}),$._zod.onattach.push((P)=>{let _=P._zod.bag;_.minimum=q.size,_.maximum=q.size,_.size=q.size}),$._zod.check=(P)=>{let _=P.value,O=_.size;if(O===q.size)return;let j=O>q.size;P.issues.push({origin:NP(_),...j?{code:"too_big",maximum:q.size}:{code:"too_small",minimum:q.size},inclusive:!0,exact:!0,input:P.value,inst:$,continue:!q.abort})}}),fY=P$("$ZodCheckMaxLength",($,q)=>{var K;N6.init($,q),(K=$._zod.def).when??(K.when=(P)=>{let _=P.value;return!IK(_)&&_.length!==void 0}),$._zod.onattach.push((P)=>{let _=P._zod.bag.maximum??Number.POSITIVE_INFINITY;if(q.maximum<_)P._zod.bag.maximum=q.maximum}),$._zod.check=(P)=>{let _=P.value;if(_.length<=q.maximum)return;let j=CP(_);P.issues.push({origin:j,code:"too_big",maximum:q.maximum,inclusive:!0,input:_,inst:$,continue:!q.abort})}}),kY=P$("$ZodCheckMinLength",($,q)=>{var K;N6.init($,q),(K=$._zod.def).when??(K.when=(P)=>{let _=P.value;return!IK(_)&&_.length!==void 0}),$._zod.onattach.push((P)=>{let _=P._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(q.minimum>_)P._zod.bag.minimum=q.minimum}),$._zod.check=(P)=>{let _=P.value;if(_.length>=q.minimum)return;let j=CP(_);P.issues.push({origin:j,code:"too_small",minimum:q.minimum,inclusive:!0,input:_,inst:$,continue:!q.abort})}}),AY=P$("$ZodCheckLengthEquals",($,q)=>{var K;N6.init($,q),(K=$._zod.def).when??(K.when=(P)=>{let _=P.value;return!IK(_)&&_.length!==void 0}),$._zod.onattach.push((P)=>{let _=P._zod.bag;_.minimum=q.length,_.maximum=q.length,_.length=q.length}),$._zod.check=(P)=>{let _=P.value,O=_.length;if(O===q.length)return;let j=CP(_),z=O>q.length;P.issues.push({origin:j,...z?{code:"too_big",maximum:q.length}:{code:"too_small",minimum:q.length},inclusive:!0,exact:!0,input:P.value,inst:$,continue:!q.abort})}}),O4=P$("$ZodCheckStringFormat",($,q)=>{var K,P;if(N6.init($,q),$._zod.onattach.push((_)=>{let O=_._zod.bag;if(O.format=q.format,q.pattern)O.patterns??(O.patterns=new Set),O.patterns.add(q.pattern)}),q.pattern)(K=$._zod).check??(K.check=(_)=>{if(q.pattern.lastIndex=0,q.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:q.format,input:_.value,...q.pattern?{pattern:q.pattern.toString()}:{},inst:$,continue:!q.abort})});else(P=$._zod).check??(P.check=()=>{})}),GY=P$("$ZodCheckRegex",($,q)=>{O4.init($,q),$._zod.check=(K)=>{if(q.pattern.lastIndex=0,q.pattern.test(K.value))return;K.issues.push({origin:"string",code:"invalid_format",format:"regex",input:K.value,pattern:q.pattern.toString(),inst:$,continue:!q.abort})}}),VY=P$("$ZodCheckLowerCase",($,q)=>{q.pattern??(q.pattern=zY),O4.init($,q)}),SY=P$("$ZodCheckUpperCase",($,q)=>{q.pattern??(q.pattern=WY),O4.init($,q)}),MY=P$("$ZodCheckIncludes",($,q)=>{N6.init($,q);let K=c8(q.includes),P=new RegExp(typeof q.position==="number"?`^.{${q.position}}${K}`:K);q.pattern=P,$._zod.onattach.push((_)=>{let O=_._zod.bag;O.patterns??(O.patterns=new Set),O.patterns.add(P)}),$._zod.check=(_)=>{if(_.value.includes(q.includes,q.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:q.includes,input:_.value,inst:$,continue:!q.abort})}}),NY=P$("$ZodCheckStartsWith",($,q)=>{N6.init($,q);let K=new RegExp(`^${c8(q.prefix)}.*`);q.pattern??(q.pattern=K),$._zod.onattach.push((P)=>{let _=P._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(K)}),$._zod.check=(P)=>{if(P.value.startsWith(q.prefix))return;P.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:q.prefix,input:P.value,inst:$,continue:!q.abort})}}),CY=P$("$ZodCheckEndsWith",($,q)=>{N6.init($,q);let K=new RegExp(`.*${c8(q.suffix)}$`);q.pattern??(q.pattern=K),$._zod.onattach.push((P)=>{let _=P._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(K)}),$._zod.check=(P)=>{if(P.value.endsWith(q.suffix))return;P.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:q.suffix,input:P.value,inst:$,continue:!q.abort})}});function gX($,q,K){if($.issues.length)q.issues.push(...eq(K,$.issues))}var EY=P$("$ZodCheckProperty",($,q)=>{N6.init($,q),$._zod.check=(K)=>{let P=q.schema._zod.run({value:K.value[q.property],issues:[]},{});if(P instanceof Promise)return P.then((_)=>gX(_,K,q.property));gX(P,K,q.property);return}}),hY=P$("$ZodCheckMimeType",($,q)=>{N6.init($,q);let K=new Set(q.mime);$._zod.onattach.push((P)=>{P._zod.bag.mime=q.mime}),$._zod.check=(P)=>{if(K.has(P.value.type))return;P.issues.push({code:"invalid_value",values:q.mime,input:P.value.type,inst:$,continue:!q.abort})}}),RY=P$("$ZodCheckOverwrite",($,q)=>{N6.init($,q),$._zod.check=(K)=>{K.value=q.tx(K.value)}});class v9{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let K=$.split(`
|
|
@@ -327,11 +327,11 @@ assembly `,`
|
|
|
327
327
|
|
|
328
328
|
`,`
|
|
329
329
|
`," ",""];else throw Error(`Language ${$} is not supported.`)}}var rW=Uq(mG(),1);var dG=($)=>{$=1831565813+($|=0)|0;let q=Math.imul($^$>>>15,1|$);return q=q+Math.imul(q^q>>>7,61|q)^q,((q^q>>>14)>>>0)/4294967296};class oG{constructor($){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;let{length:q,separator:K,dictionaries:P,style:_,seed:O}=$;this.dictionaries=P,this.separator=K,this.length=q,this.style=_,this.seed=O}generate(){if(!this.dictionaries)throw Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw Error("Invalid length provided");if(this.length>this.dictionaries.length)throw Error(`The length cannot be bigger than the number of dictionaries.
|
|
330
|
-
Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let $=this.seed;return this.dictionaries.slice(0,this.length).reduce((q,K)=>{let P;$?(P=((O)=>{if(typeof O=="string"){let j=O.split("").map((J)=>J.charCodeAt(0)).reduce((J,w)=>J+w,1),z=Math.floor(Number(j));return dG(z)}return dG(O)})($),$=4294967296*P):P=Math.random();let _=K[Math.floor(P*K.length)]||"";if(this.style==="lowerCase")_=_.toLowerCase();else if(this.style==="capital"){let[O,...j]=_.split("");_=O.toUpperCase()+j.join("")}else this.style==="upperCase"&&(_=_.toUpperCase());return q?`${q}${this.separator}${_}`:`${_}`},"")}}var lG={separator:"_",dictionaries:[]},Gj=($)=>{let q=[...$&&$.dictionaries||lG.dictionaries],K={...lG,...$,length:$&&$.length||q.length,dictionaries:q};if(!$||!$.dictionaries||!$.dictionaries.length)throw Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new oG(K).generate()};var Vj=["Aaren","Aarika","Abagael","Abagail","Abbe","Abbey","Abbi","Abbie","Abby","Abbye","Abigael","Abigail","Abigale","Abra","Ada","Adah","Adaline","Adan","Adara","Adda","Addi","Addia","Addie","Addy","Adel","Adela","Adelaida","Adelaide","Adele","Adelheid","Adelice","Adelina","Adelind","Adeline","Adella","Adelle","Adena","Adey","Adi","Adiana","Adina","Adora","Adore","Adoree","Adorne","Adrea","Adria","Adriaens","Adrian","Adriana","Adriane","Adrianna","Adrianne","Adriena","Adrienne","Aeriel","Aeriela","Aeriell","Afton","Ag","Agace","Agata","Agatha","Agathe","Aggi","Aggie","Aggy","Agna","Agnella","Agnes","Agnese","Agnesse","Agneta","Agnola","Agretha","Aida","Aidan","Aigneis","Aila","Aile","Ailee","Aileen","Ailene","Ailey","Aili","Ailina","Ailis","Ailsun","Ailyn","Aime","Aimee","Aimil","Aindrea","Ainslee","Ainsley","Ainslie","Ajay","Alaine","Alameda","Alana","Alanah","Alane","Alanna","Alayne","Alberta","Albertina","Albertine","Albina","Alecia","Aleda","Aleece","Aleen","Alejandra","Alejandrina","Alena","Alene","Alessandra","Aleta","Alethea","Alex","Alexa","Alexandra","Alexandrina","Alexi","Alexia","Alexina","Alexine","Alexis","Alfi","Alfie","Alfreda","Alfy","Ali","Alia","Alica","Alice","Alicea","Alicia","Alida","Alidia","Alie","Alika","Alikee","Alina","Aline","Alis","Alisa","Alisha","Alison","Alissa","Alisun","Alix","Aliza","Alla","Alleen","Allegra","Allene","Alli","Allianora","Allie","Allina","Allis","Allison","Allissa","Allix","Allsun","Allx","Ally","Allyce","Allyn","Allys","Allyson","Alma","Almeda","Almeria","Almeta","Almira","Almire","Aloise","Aloisia","Aloysia","Alta","Althea","Alvera","Alverta","Alvina","Alvinia","Alvira","Alyce","Alyda","Alys","Alysa","Alyse","Alysia","Alyson","Alyss","Alyssa","Amabel","Amabelle","Amalea","Amalee","Amaleta","Amalia","Amalie","Amalita","Amalle","Amanda","Amandi","Amandie","Amandy","Amara","Amargo","Amata","Amber","Amberly","Ambur","Ame","Amelia","Amelie","Amelina","Ameline","Amelita","Ami","Amie","Amii","Amil","Amitie","Amity","Ammamaria","Amy","Amye","Ana","Anabal","Anabel","Anabella","Anabelle","Analiese","Analise","Anallese","Anallise","Anastasia","Anastasie","Anastassia","Anatola","Andee","Andeee","Anderea","Andi","Andie","Andra","Andrea","Andreana","Andree","Andrei","Andria","Andriana","Andriette","Andromache","Andy","Anestassia","Anet","Anett","Anetta","Anette","Ange","Angel","Angela","Angele","Angelia","Angelica","Angelika","Angelina","Angeline","Angelique","Angelita","Angelle","Angie","Angil","Angy","Ania","Anica","Anissa","Anita","Anitra","Anjanette","Anjela","Ann","Ann-marie","Anna","Anna-diana","Anna-diane","Anna-maria","Annabal","Annabel","Annabela","Annabell","Annabella","Annabelle","Annadiana","Annadiane","Annalee","Annaliese","Annalise","Annamaria","Annamarie","Anne","Anne-corinne","Anne-marie","Annecorinne","Anneliese","Annelise","Annemarie","Annetta","Annette","Anni","Annice","Annie","Annis","Annissa","Annmaria","Annmarie","Annnora","Annora","Anny","Anselma","Ansley","Anstice","Anthe","Anthea","Anthia","Anthiathia","Antoinette","Antonella","Antonetta","Antonia","Antonie","Antonietta","Antonina","Anya","Appolonia","April","Aprilette","Ara","Arabel","Arabela","Arabele","Arabella","Arabelle","Arda","Ardath","Ardeen","Ardelia","Ardelis","Ardella","Ardelle","Arden","Ardene","Ardenia","Ardine","Ardis","Ardisj","Ardith","Ardra","Ardyce","Ardys","Ardyth","Aretha","Ariadne","Ariana","Aridatha","Ariel","Ariela","Ariella","Arielle","Arlana","Arlee","Arleen","Arlen","Arlena","Arlene","Arleta","Arlette","Arleyne","Arlie","Arliene","Arlina","Arlinda","Arline","Arluene","Arly","Arlyn","Arlyne","Aryn","Ashely","Ashia","Ashien","Ashil","Ashla","Ashlan","Ashlee","Ashleigh","Ashlen","Ashley","Ashli","Ashlie","Ashly","Asia","Astra","Astrid","Astrix","Atalanta","Athena","Athene","Atlanta","Atlante","Auberta","Aubine","Aubree","Aubrette","Aubrey","Aubrie","Aubry","Audi","Audie","Audra","Audre","Audrey","Audrie","Audry","Audrye","Audy","Augusta","Auguste","Augustina","Augustine","Aundrea","Aura","Aurea","Aurel","Aurelea","Aurelia","Aurelie","Auria","Aurie","Aurilia","Aurlie","Auroora","Aurora","Aurore","Austin","Austina","Austine","Ava","Aveline","Averil","Averyl","Avie","Avis","Aviva","Avivah","Avril","Avrit","Ayn","Bab","Babara","Babb","Babbette","Babbie","Babette","Babita","Babs","Bambi","Bambie","Bamby","Barb","Barbabra","Barbara","Barbara-anne","Barbaraanne","Barbe","Barbee","Barbette","Barbey","Barbi","Barbie","Barbra","Barby","Bari","Barrie","Barry","Basia","Bathsheba","Batsheva","Bea","Beatrice","Beatrisa","Beatrix","Beatriz","Bebe","Becca","Becka","Becki","Beckie","Becky","Bee","Beilul","Beitris","Bekki","Bel","Belia","Belicia","Belinda","Belita","Bell","Bella","Bellanca","Belle","Bellina","Belva","Belvia","Bendite","Benedetta","Benedicta","Benedikta","Benetta","Benita","Benni","Bennie","Benny","Benoite","Berenice","Beret","Berget","Berna","Bernadene","Bernadette","Bernadina","Bernadine","Bernardina","Bernardine","Bernelle","Bernete","Bernetta","Bernette","Berni","Bernice","Bernie","Bernita","Berny","Berri","Berrie","Berry","Bert","Berta","Berte","Bertha","Berthe","Berti","Bertie","Bertina","Bertine","Berty","Beryl","Beryle","Bess","Bessie","Bessy","Beth","Bethanne","Bethany","Bethena","Bethina","Betsey","Betsy","Betta","Bette","Bette-ann","Betteann","Betteanne","Betti","Bettina","Bettine","Betty","Bettye","Beulah","Bev","Beverie","Beverlee","Beverley","Beverlie","Beverly","Bevvy","Bianca","Bianka","Bibbie","Bibby","Bibbye","Bibi","Biddie","Biddy","Bidget","Bili","Bill","Billi","Billie","Billy","Billye","Binni","Binnie","Binny","Bird","Birdie","Birgit","Birgitta","Blair","Blaire","Blake","Blakelee","Blakeley","Blanca","Blanch","Blancha","Blanche","Blinni","Blinnie","Blinny","Bliss","Blisse","Blithe","Blondell","Blondelle","Blondie","Blondy","Blythe","Bobbe","Bobbee","Bobbette","Bobbi","Bobbie","Bobby","Bobbye","Bobette","Bobina","Bobine","Bobinette","Bonita","Bonnee","Bonni","Bonnibelle","Bonnie","Bonny","Brana","Brandais","Brande","Brandea","Brandi","Brandice","Brandie","Brandise","Brandy","Breanne","Brear","Bree","Breena","Bren","Brena","Brenda","Brenn","Brenna","Brett","Bria","Briana","Brianna","Brianne","Bride","Bridget","Bridgette","Bridie","Brier","Brietta","Brigid","Brigida","Brigit","Brigitta","Brigitte","Brina","Briney","Brinn","Brinna","Briny","Brit","Brita","Britney","Britni","Britt","Britta","Brittan","Brittaney","Brittani","Brittany","Britte","Britteny","Brittne","Brittney","Brittni","Brook","Brooke","Brooks","Brunhilda","Brunhilde","Bryana","Bryn","Bryna","Brynn","Brynna","Brynne","Buffy","Bunni","Bunnie","Bunny","Cacilia","Cacilie","Cahra","Cairistiona","Caitlin","Caitrin","Cal","Calida","Calla","Calley","Calli","Callida","Callie","Cally","Calypso","Cam","Camala","Camel","Camella","Camellia","Cami","Camila","Camile","Camilla","Camille","Cammi","Cammie","Cammy","Candace","Candi","Candice","Candida","Candide","Candie","Candis","Candra","Candy","Caprice","Cara","Caralie","Caren","Carena","Caresa","Caressa","Caresse","Carey","Cari","Caria","Carie","Caril","Carilyn","Carin","Carina","Carine","Cariotta","Carissa","Carita","Caritta","Carla","Carlee","Carleen","Carlen","Carlene","Carley","Carlie","Carlin","Carlina","Carline","Carlita","Carlota","Carlotta","Carly","Carlye","Carlyn","Carlynn","Carlynne","Carma","Carmel","Carmela","Carmelia","Carmelina","Carmelita","Carmella","Carmelle","Carmen","Carmencita","Carmina","Carmine","Carmita","Carmon","Caro","Carol","Carol-jean","Carola","Carolan","Carolann","Carole","Carolee","Carolin","Carolina","Caroline","Caroljean","Carolyn","Carolyne","Carolynn","Caron","Carree","Carri","Carrie","Carrissa","Carroll","Carry","Cary","Caryl","Caryn","Casandra","Casey","Casi","Casie","Cass","Cassandra","Cassandre","Cassandry","Cassaundra","Cassey","Cassi","Cassie","Cassondra","Cassy","Catarina","Cate","Caterina","Catha","Catharina","Catharine","Cathe","Cathee","Catherin","Catherina","Catherine","Cathi","Cathie","Cathleen","Cathlene","Cathrin","Cathrine","Cathryn","Cathy","Cathyleen","Cati","Catie","Catina","Catlaina","Catlee","Catlin","Catrina","Catriona","Caty","Caye","Cayla","Cecelia","Cecil","Cecile","Ceciley","Cecilia","Cecilla","Cecily","Ceil","Cele","Celene","Celesta","Celeste","Celestia","Celestina","Celestine","Celestyn","Celestyna","Celia","Celie","Celina","Celinda","Celine","Celinka","Celisse","Celka","Celle","Cesya","Chad","Chanda","Chandal","Chandra","Channa","Chantal","Chantalle","Charil","Charin","Charis","Charissa","Charisse","Charita","Charity","Charla","Charlean","Charleen","Charlena","Charlene","Charline","Charlot","Charlotta","Charlotte","Charmain","Charmaine","Charmane","Charmian","Charmine","Charmion","Charo","Charyl","Chastity","Chelsae","Chelsea","Chelsey","Chelsie","Chelsy","Cher","Chere","Cherey","Cheri","Cherianne","Cherice","Cherida","Cherie","Cherilyn","Cherilynn","Cherin","Cherise","Cherish","Cherlyn","Cherri","Cherrita","Cherry","Chery","Cherye","Cheryl","Cheslie","Chiarra","Chickie","Chicky","Chiquia","Chiquita","Chlo","Chloe","Chloette","Chloris","Chris","Chrissie","Chrissy","Christa","Christabel","Christabella","Christal","Christalle","Christan","Christean","Christel","Christen","Christi","Christian","Christiana","Christiane","Christie","Christin","Christina","Christine","Christy","Christye","Christyna","Chrysa","Chrysler","Chrystal","Chryste","Chrystel","Cicely","Cicily","Ciel","Cilka","Cinda","Cindee","Cindelyn","Cinderella","Cindi","Cindie","Cindra","Cindy","Cinnamon","Cissiee","Cissy","Clair","Claire","Clara","Clarabelle","Clare","Claresta","Clareta","Claretta","Clarette","Clarey","Clari","Claribel","Clarice","Clarie","Clarinda","Clarine","Clarissa","Clarisse","Clarita","Clary","Claude","Claudelle","Claudetta","Claudette","Claudia","Claudie","Claudina","Claudine","Clea","Clem","Clemence","Clementia","Clementina","Clementine","Clemmie","Clemmy","Cleo","Cleopatra","Clerissa","Clio","Clo","Cloe","Cloris","Clotilda","Clovis","Codee","Codi","Codie","Cody","Coleen","Colene","Coletta","Colette","Colleen","Collen","Collete","Collette","Collie","Colline","Colly","Con","Concettina","Conchita","Concordia","Conni","Connie","Conny","Consolata","Constance","Constancia","Constancy","Constanta","Constantia","Constantina","Constantine","Consuela","Consuelo","Cookie","Cora","Corabel","Corabella","Corabelle","Coral","Coralie","Coraline","Coralyn","Cordelia","Cordelie","Cordey","Cordi","Cordie","Cordula","Cordy","Coreen","Corella","Corenda","Corene","Coretta","Corette","Corey","Cori","Corie","Corilla","Corina","Corine","Corinna","Corinne","Coriss","Corissa","Corliss","Corly","Cornela","Cornelia","Cornelle","Cornie","Corny","Correna","Correy","Corri","Corrianne","Corrie","Corrina","Corrine","Corrinne","Corry","Cortney","Cory","Cosetta","Cosette","Costanza","Courtenay","Courtnay","Courtney","Crin","Cris","Crissie","Crissy","Crista","Cristabel","Cristal","Cristen","Cristi","Cristie","Cristin","Cristina","Cristine","Cristionna","Cristy","Crysta","Crystal","Crystie","Cthrine","Cyb","Cybil","Cybill","Cymbre","Cynde","Cyndi","Cyndia","Cyndie","Cyndy","Cynthea","Cynthia","Cynthie","Cynthy","Dacey","Dacia","Dacie","Dacy","Dael","Daffi","Daffie","Daffy","Dagmar","Dahlia","Daile","Daisey","Daisi","Daisie","Daisy","Dale","Dalenna","Dalia","Dalila","Dallas","Daloris","Damara","Damaris","Damita","Dana","Danell","Danella","Danette","Dani","Dania","Danica","Danice","Daniela","Daniele","Daniella","Danielle","Danika","Danila","Danit","Danita","Danna","Danni","Dannie","Danny","Dannye","Danya","Danyelle","Danyette","Daphene","Daphna","Daphne","Dara","Darb","Darbie","Darby","Darcee","Darcey","Darci","Darcie","Darcy","Darda","Dareen","Darell","Darelle","Dari","Daria","Darice","Darla","Darleen","Darlene","Darline","Darlleen","Daron","Darrelle","Darryl","Darsey","Darsie","Darya","Daryl","Daryn","Dasha","Dasi","Dasie","Dasya","Datha","Daune","Daveen","Daveta","Davida","Davina","Davine","Davita","Dawn","Dawna","Dayle","Dayna","Ddene","De","Deana","Deane","Deanna","Deanne","Deb","Debbi","Debbie","Debby","Debee","Debera","Debi","Debor","Debora","Deborah","Debra","Dede","Dedie","Dedra","Dee","Deeann","Deeanne","Deedee","Deena","Deerdre","Deeyn","Dehlia","Deidre","Deina","Deirdre","Del","Dela","Delcina","Delcine","Delia","Delila","Delilah","Delinda","Dell","Della","Delly","Delora","Delores","Deloria","Deloris","Delphine","Delphinia","Demeter","Demetra","Demetria","Demetris","Dena","Deni","Denice","Denise","Denna","Denni","Dennie","Denny","Deny","Denys","Denyse","Deonne","Desdemona","Desirae","Desiree","Desiri","Deva","Devan","Devi","Devin","Devina","Devinne","Devon","Devondra","Devonna","Devonne","Devora","Di","Diahann","Dian","Diana","Diandra","Diane","Diane-marie","Dianemarie","Diann","Dianna","Dianne","Diannne","Didi","Dido","Diena","Dierdre","Dina","Dinah","Dinnie","Dinny","Dion","Dione","Dionis","Dionne","Dita","Dix","Dixie","Dniren","Dode","Dodi","Dodie","Dody","Doe","Doll","Dolley","Dolli","Dollie","Dolly","Dolores","Dolorita","Doloritas","Domeniga","Dominga","Domini","Dominica","Dominique","Dona","Donella","Donelle","Donetta","Donia","Donica","Donielle","Donna","Donnamarie","Donni","Donnie","Donny","Dora","Doralia","Doralin","Doralyn","Doralynn","Doralynne","Dore","Doreen","Dorelia","Dorella","Dorelle","Dorena","Dorene","Doretta","Dorette","Dorey","Dori","Doria","Dorian","Dorice","Dorie","Dorine","Doris","Dorisa","Dorise","Dorita","Doro","Dorolice","Dorolisa","Dorotea","Doroteya","Dorothea","Dorothee","Dorothy","Dorree","Dorri","Dorrie","Dorris","Dorry","Dorthea","Dorthy","Dory","Dosi","Dot","Doti","Dotti","Dottie","Dotty","Dre","Dreddy","Dredi","Drona","Dru","Druci","Drucie","Drucill","Drucy","Drusi","Drusie","Drusilla","Drusy","Dulce","Dulcea","Dulci","Dulcia","Dulciana","Dulcie","Dulcine","Dulcinea","Dulcy","Dulsea","Dusty","Dyan","Dyana","Dyane","Dyann","Dyanna","Dyanne","Dyna","Dynah","Eachelle","Eada","Eadie","Eadith","Ealasaid","Eartha","Easter","Eba","Ebba","Ebonee","Ebony","Eda","Eddi","Eddie","Eddy","Ede","Edee","Edeline","Eden","Edi","Edie","Edin","Edita","Edith","Editha","Edithe","Ediva","Edna","Edwina","Edy","Edyth","Edythe","Effie","Eileen","Eilis","Eimile","Eirena","Ekaterina","Elaina","Elaine","Elana","Elane","Elayne","Elberta","Elbertina","Elbertine","Eleanor","Eleanora","Eleanore","Electra","Eleen","Elena","Elene","Eleni","Elenore","Eleonora","Eleonore","Elfie","Elfreda","Elfrida","Elfrieda","Elga","Elianora","Elianore","Elicia","Elie","Elinor","Elinore","Elisa","Elisabet","Elisabeth","Elisabetta","Elise","Elisha","Elissa","Elita","Eliza","Elizabet","Elizabeth","Elka","Elke","Ella","Elladine","Elle","Ellen","Ellene","Ellette","Elli","Ellie","Ellissa","Elly","Ellyn","Ellynn","Elmira","Elna","Elnora","Elnore","Eloisa","Eloise","Elonore","Elora","Elsa","Elsbeth","Else","Elset","Elsey","Elsi","Elsie","Elsinore","Elspeth","Elsy","Elva","Elvera","Elvina","Elvira","Elwira","Elyn","Elyse","Elysee","Elysha","Elysia","Elyssa","Em","Ema","Emalee","Emalia","Emelda","Emelia","Emelina","Emeline","Emelita","Emelyne","Emera","Emilee","Emili","Emilia","Emilie","Emiline","Emily","Emlyn","Emlynn","Emlynne","Emma","Emmalee","Emmaline","Emmalyn","Emmalynn","Emmalynne","Emmeline","Emmey","Emmi","Emmie","Emmy","Emmye","Emogene","Emyle","Emylee","Engracia","Enid","Enrica","Enrichetta","Enrika","Enriqueta","Eolanda","Eolande","Eran","Erda","Erena","Erica","Ericha","Ericka","Erika","Erin","Erina","Erinn","Erinna","Erma","Ermengarde","Ermentrude","Ermina","Erminia","Erminie","Erna","Ernaline","Ernesta","Ernestine","Ertha","Eryn","Esma","Esmaria","Esme","Esmeralda","Essa","Essie","Essy","Esta","Estel","Estele","Estell","Estella","Estelle","Ester","Esther","Estrella","Estrellita","Ethel","Ethelda","Ethelin","Ethelind","Etheline","Ethelyn","Ethyl","Etta","Etti","Ettie","Etty","Eudora","Eugenia","Eugenie","Eugine","Eula","Eulalie","Eunice","Euphemia","Eustacia","Eva","Evaleen","Evangelia","Evangelin","Evangelina","Evangeline","Evania","Evanne","Eve","Eveleen","Evelina","Eveline","Evelyn","Evey","Evie","Evita","Evonne","Evvie","Evvy","Evy","Eyde","Eydie","Ezmeralda","Fae","Faina","Faith","Fallon","Fan","Fanchette","Fanchon","Fancie","Fancy","Fanechka","Fania","Fanni","Fannie","Fanny","Fanya","Fara","Farah","Farand","Farica","Farra","Farrah","Farrand","Faun","Faunie","Faustina","Faustine","Fawn","Fawne","Fawnia","Fay","Faydra","Faye","Fayette","Fayina","Fayre","Fayth","Faythe","Federica","Fedora","Felecia","Felicdad","Felice","Felicia","Felicity","Felicle","Felipa","Felisha","Felita","Feliza","Fenelia","Feodora","Ferdinanda","Ferdinande","Fern","Fernanda","Fernande","Fernandina","Ferne","Fey","Fiann","Fianna","Fidela","Fidelia","Fidelity","Fifi","Fifine","Filia","Filide","Filippa","Fina","Fiona","Fionna","Fionnula","Fiorenze","Fleur","Fleurette","Flo","Flor","Flora","Florance","Flore","Florella","Florence","Florencia","Florentia","Florenza","Florette","Flori","Floria","Florida","Florie","Florina","Florinda","Floris","Florri","Florrie","Florry","Flory","Flossi","Flossie","Flossy","Flss","Fran","Francene","Frances","Francesca","Francine","Francisca","Franciska","Francoise","Francyne","Frank","Frankie","Franky","Franni","Frannie","Franny","Frayda","Fred","Freda","Freddi","Freddie","Freddy","Fredelia","Frederica","Fredericka","Frederique","Fredi","Fredia","Fredra","Fredrika","Freida","Frieda","Friederike","Fulvia","Gabbey","Gabbi","Gabbie","Gabey","Gabi","Gabie","Gabriel","Gabriela","Gabriell","Gabriella","Gabrielle","Gabriellia","Gabrila","Gaby","Gae","Gael","Gail","Gale","Galina","Garland","Garnet","Garnette","Gates","Gavra","Gavrielle","Gay","Gaye","Gayel","Gayla","Gayle","Gayleen","Gaylene","Gaynor","Gelya","Gena","Gene","Geneva","Genevieve","Genevra","Genia","Genna","Genni","Gennie","Gennifer","Genny","Genovera","Genvieve","George","Georgeanna","Georgeanne","Georgena","Georgeta","Georgetta","Georgette","Georgia","Georgiana","Georgianna","Georgianne","Georgie","Georgina","Georgine","Geralda","Geraldine","Gerda","Gerhardine","Geri","Gerianna","Gerianne","Gerladina","Germain","Germaine","Germana","Gerri","Gerrie","Gerrilee","Gerry","Gert","Gerta","Gerti","Gertie","Gertrud","Gertruda","Gertrude","Gertrudis","Gerty","Giacinta","Giana","Gianina","Gianna","Gigi","Gilberta","Gilberte","Gilbertina","Gilbertine","Gilda","Gilemette","Gill","Gillan","Gilli","Gillian","Gillie","Gilligan","Gilly","Gina","Ginelle","Ginevra","Ginger","Ginni","Ginnie","Ginnifer","Ginny","Giorgia","Giovanna","Gipsy","Giralda","Gisela","Gisele","Gisella","Giselle","Giuditta","Giulia","Giulietta","Giustina","Gizela","Glad","Gladi","Gladys","Gleda","Glen","Glenda","Glenine","Glenn","Glenna","Glennie","Glennis","Glori","Gloria","Gloriana","Gloriane","Glory","Glyn","Glynda","Glynis","Glynnis","Gnni","Godiva","Golda","Goldarina","Goldi","Goldia","Goldie","Goldina","Goldy","Grace","Gracia","Gracie","Grata","Gratia","Gratiana","Gray","Grayce","Grazia","Greer","Greta","Gretal","Gretchen","Grete","Gretel","Grethel","Gretna","Gretta","Grier","Griselda","Grissel","Guendolen","Guenevere","Guenna","Guglielma","Gui","Guillema","Guillemette","Guinevere","Guinna","Gunilla","Gus","Gusella","Gussi","Gussie","Gussy","Gusta","Gusti","Gustie","Gusty","Gwen","Gwendolen","Gwendolin","Gwendolyn","Gweneth","Gwenette","Gwenneth","Gwenni","Gwennie","Gwenny","Gwenora","Gwenore","Gwyn","Gwyneth","Gwynne","Gypsy","Hadria","Hailee","Haily","Haleigh","Halette","Haley","Hali","Halie","Halimeda","Halley","Halli","Hallie","Hally","Hana","Hanna","Hannah","Hanni","Hannie","Hannis","Hanny","Happy","Harlene","Harley","Harli","Harlie","Harmonia","Harmonie","Harmony","Harri","Harrie","Harriet","Harriett","Harrietta","Harriette","Harriot","Harriott","Hatti","Hattie","Hatty","Hayley","Hazel","Heath","Heather","Heda","Hedda","Heddi","Heddie","Hedi","Hedvig","Hedvige","Hedwig","Hedwiga","Hedy","Heida","Heidi","Heidie","Helaina","Helaine","Helen","Helen-elizabeth","Helena","Helene","Helenka","Helga","Helge","Helli","Heloise","Helsa","Helyn","Hendrika","Henka","Henrie","Henrieta","Henrietta","Henriette","Henryetta","Hephzibah","Hermia","Hermina","Hermine","Herminia","Hermione","Herta","Hertha","Hester","Hesther","Hestia","Hetti","Hettie","Hetty","Hilary","Hilda","Hildagard","Hildagarde","Hilde","Hildegaard","Hildegarde","Hildy","Hillary","Hilliary","Hinda","Holli","Hollie","Holly","Holly-anne","Hollyanne","Honey","Honor","Honoria","Hope","Horatia","Hortense","Hortensia","Hulda","Hyacinth","Hyacintha","Hyacinthe","Hyacinthia","Hyacinthie","Hynda","Ianthe","Ibbie","Ibby","Ida","Idalia","Idalina","Idaline","Idell","Idelle","Idette","Ileana","Ileane","Ilene","Ilise","Ilka","Illa","Ilsa","Ilse","Ilysa","Ilyse","Ilyssa","Imelda","Imogen","Imogene","Imojean","Ina","Indira","Ines","Inesita","Inessa","Inez","Inga","Ingaberg","Ingaborg","Inge","Ingeberg","Ingeborg","Inger","Ingrid","Ingunna","Inna","Iolande","Iolanthe","Iona","Iormina","Ira","Irena","Irene","Irina","Iris","Irita","Irma","Isa","Isabel","Isabelita","Isabella","Isabelle","Isadora","Isahella","Iseabal","Isidora","Isis","Isobel","Issi","Issie","Issy","Ivett","Ivette","Ivie","Ivonne","Ivory","Ivy","Izabel","Jacenta","Jacinda","Jacinta","Jacintha","Jacinthe","Jackelyn","Jacki","Jackie","Jacklin","Jacklyn","Jackquelin","Jackqueline","Jacky","Jaclin","Jaclyn","Jacquelin","Jacqueline","Jacquelyn","Jacquelynn","Jacquenetta","Jacquenette","Jacquetta","Jacquette","Jacqui","Jacquie","Jacynth","Jada","Jade","Jaime","Jaimie","Jaine","Jami","Jamie","Jamima","Jammie","Jan","Jana","Janaya","Janaye","Jandy","Jane","Janean","Janeczka","Janeen","Janel","Janela","Janella","Janelle","Janene","Janenna","Janessa","Janet","Janeta","Janetta","Janette","Janeva","Janey","Jania","Janice","Janie","Janifer","Janina","Janine","Janis","Janith","Janka","Janna","Jannel","Jannelle","Janot","Jany","Jaquelin","Jaquelyn","Jaquenetta","Jaquenette","Jaquith","Jasmin","Jasmina","Jasmine","Jayme","Jaymee","Jayne","Jaynell","Jazmin","Jean","Jeana","Jeane","Jeanelle","Jeanette","Jeanie","Jeanine","Jeanna","Jeanne","Jeannette","Jeannie","Jeannine","Jehanna","Jelene","Jemie","Jemima","Jemimah","Jemmie","Jemmy","Jen","Jena","Jenda","Jenelle","Jeni","Jenica","Jeniece","Jenifer","Jeniffer","Jenilee","Jenine","Jenn","Jenna","Jennee","Jennette","Jenni","Jennica","Jennie","Jennifer","Jennilee","Jennine","Jenny","Jeralee","Jere","Jeri","Jermaine","Jerrie","Jerrilee","Jerrilyn","Jerrine","Jerry","Jerrylee","Jess","Jessa","Jessalin","Jessalyn","Jessamine","Jessamyn","Jesse","Jesselyn","Jessi","Jessica","Jessie","Jessika","Jessy","Jewel","Jewell","Jewelle","Jill","Jillana","Jillane","Jillayne","Jilleen","Jillene","Jilli","Jillian","Jillie","Jilly","Jinny","Jo","Jo-ann","Jo-anne","Joan","Joana","Joane","Joanie","Joann","Joanna","Joanne","Joannes","Jobey","Jobi","Jobie","Jobina","Joby","Jobye","Jobyna","Jocelin","Joceline","Jocelyn","Jocelyne","Jodee","Jodi","Jodie","Jody","Joeann","Joela","Joelie","Joell","Joella","Joelle","Joellen","Joelly","Joellyn","Joelynn","Joete","Joey","Johanna","Johannah","Johna","Johnath","Johnette","Johnna","Joice","Jojo","Jolee","Joleen","Jolene","Joletta","Joli","Jolie","Joline","Joly","Jolyn","Jolynn","Jonell","Joni","Jonie","Jonis","Jordain","Jordan","Jordana","Jordanna","Jorey","Jori","Jorie","Jorrie","Jorry","Joscelin","Josee","Josefa","Josefina","Josepha","Josephina","Josephine","Josey","Josi","Josie","Josselyn","Josy","Jourdan","Joy","Joya","Joyan","Joyann","Joyce","Joycelin","Joye","Jsandye","Juana","Juanita","Judi","Judie","Judith","Juditha","Judy","Judye","Juieta","Julee","Juli","Julia","Juliana","Juliane","Juliann","Julianna","Julianne","Julie","Julienne","Juliet","Julieta","Julietta","Juliette","Julina","Juline","Julissa","Julita","June","Junette","Junia","Junie","Junina","Justina","Justine","Justinn","Jyoti","Kacey","Kacie","Kacy","Kaela","Kai","Kaia","Kaila","Kaile","Kailey","Kaitlin","Kaitlyn","Kaitlynn","Kaja","Kakalina","Kala","Kaleena","Kali","Kalie","Kalila","Kalina","Kalinda","Kalindi","Kalli","Kally","Kameko","Kamila","Kamilah","Kamillah","Kandace","Kandy","Kania","Kanya","Kara","Kara-lynn","Karalee","Karalynn","Kare","Karee","Karel","Karen","Karena","Kari","Karia","Karie","Karil","Karilynn","Karin","Karina","Karine","Kariotta","Karisa","Karissa","Karita","Karla","Karlee","Karleen","Karlen","Karlene","Karlie","Karlotta","Karlotte","Karly","Karlyn","Karmen","Karna","Karol","Karola","Karole","Karolina","Karoline","Karoly","Karon","Karrah","Karrie","Karry","Kary","Karyl","Karylin","Karyn","Kasey","Kass","Kassandra","Kassey","Kassi","Kassia","Kassie","Kat","Kata","Katalin","Kate","Katee","Katerina","Katerine","Katey","Kath","Katha","Katharina","Katharine","Katharyn","Kathe","Katherina","Katherine","Katheryn","Kathi","Kathie","Kathleen","Kathlin","Kathrine","Kathryn","Kathryne","Kathy","Kathye","Kati","Katie","Katina","Katine","Katinka","Katleen","Katlin","Katrina","Katrine","Katrinka","Katti","Kattie","Katuscha","Katusha","Katy","Katya","Kay","Kaycee","Kaye","Kayla","Kayle","Kaylee","Kayley","Kaylil","Kaylyn","Keeley","Keelia","Keely","Kelcey","Kelci","Kelcie","Kelcy","Kelila","Kellen","Kelley","Kelli","Kellia","Kellie","Kellina","Kellsie","Kelly","Kellyann","Kelsey","Kelsi","Kelsy","Kendra","Kendre","Kenna","Keri","Keriann","Kerianne","Kerri","Kerrie","Kerrill","Kerrin","Kerry","Kerstin","Kesley","Keslie","Kessia","Kessiah","Ketti","Kettie","Ketty","Kevina","Kevyn","Ki","Kiah","Kial","Kiele","Kiersten","Kikelia","Kiley","Kim","Kimberlee","Kimberley","Kimberli","Kimberly","Kimberlyn","Kimbra","Kimmi","Kimmie","Kimmy","Kinna","Kip","Kipp","Kippie","Kippy","Kira","Kirbee","Kirbie","Kirby","Kiri","Kirsten","Kirsteni","Kirsti","Kirstin","Kirstyn","Kissee","Kissiah","Kissie","Kit","Kitti","Kittie","Kitty","Kizzee","Kizzie","Klara","Klarika","Klarrisa","Konstance","Konstanze","Koo","Kora","Koral","Koralle","Kordula","Kore","Korella","Koren","Koressa","Kori","Korie","Korney","Korrie","Korry","Kris","Krissie","Krissy","Krista","Kristal","Kristan","Kriste","Kristel","Kristen","Kristi","Kristien","Kristin","Kristina","Kristine","Kristy","Kristyn","Krysta","Krystal","Krystalle","Krystle","Krystyna","Kyla","Kyle","Kylen","Kylie","Kylila","Kylynn","Kym","Kynthia","Kyrstin","Lacee","Lacey","Lacie","Lacy","Ladonna","Laetitia","Laina","Lainey","Lana","Lanae","Lane","Lanette","Laney","Lani","Lanie","Lanita","Lanna","Lanni","Lanny","Lara","Laraine","Lari","Larina","Larine","Larisa","Larissa","Lark","Laryssa","Latashia","Latia","Latisha","Latrena","Latrina","Laura","Lauraine","Laural","Lauralee","Laure","Lauree","Laureen","Laurel","Laurella","Lauren","Laurena","Laurene","Lauretta","Laurette","Lauri","Laurianne","Laurice","Laurie","Lauryn","Lavena","Laverna","Laverne","Lavina","Lavinia","Lavinie","Layla","Layne","Layney","Lea","Leah","Leandra","Leann","Leanna","Leanor","Leanora","Lebbie","Leda","Lee","Leeann","Leeanne","Leela","Leelah","Leena","Leesa","Leese","Legra","Leia","Leigh","Leigha","Leila","Leilah","Leisha","Lela","Lelah","Leland","Lelia","Lena","Lenee","Lenette","Lenka","Lenna","Lenora","Lenore","Leodora","Leoine","Leola","Leoline","Leona","Leonanie","Leone","Leonelle","Leonie","Leonora","Leonore","Leontine","Leontyne","Leora","Leshia","Lesley","Lesli","Leslie","Lesly","Lesya","Leta","Lethia","Leticia","Letisha","Letitia","Letizia","Letta","Letti","Lettie","Letty","Lexi","Lexie","Lexine","Lexis","Lexy","Leyla","Lezlie","Lia","Lian","Liana","Liane","Lianna","Lianne","Lib","Libbey","Libbi","Libbie","Libby","Licha","Lida","Lidia","Liesa","Lil","Lila","Lilah","Lilas","Lilia","Lilian","Liliane","Lilias","Lilith","Lilla","Lilli","Lillian","Lillis","Lilllie","Lilly","Lily","Lilyan","Lin","Lina","Lind","Linda","Lindi","Lindie","Lindsay","Lindsey","Lindsy","Lindy","Linea","Linell","Linet","Linette","Linn","Linnea","Linnell","Linnet","Linnie","Linzy","Lira","Lisa","Lisabeth","Lisbeth","Lise","Lisetta","Lisette","Lisha","Lishe","Lissa","Lissi","Lissie","Lissy","Lita","Liuka","Liv","Liva","Livia","Livvie","Livvy","Livvyy","Livy","Liz","Liza","Lizabeth","Lizbeth","Lizette","Lizzie","Lizzy","Loella","Lois","Loise","Lola","Loleta","Lolita","Lolly","Lona","Lonee","Loni","Lonna","Lonni","Lonnie","Lora","Lorain","Loraine","Loralee","Loralie","Loralyn","Loree","Loreen","Lorelei","Lorelle","Loren","Lorena","Lorene","Lorenza","Loretta","Lorette","Lori","Loria","Lorianna","Lorianne","Lorie","Lorilee","Lorilyn","Lorinda","Lorine","Lorita","Lorna","Lorne","Lorraine","Lorrayne","Lorri","Lorrie","Lorrin","Lorry","Lory","Lotta","Lotte","Lotti","Lottie","Lotty","Lou","Louella","Louisa","Louise","Louisette","Loutitia","Lu","Luce","Luci","Lucia","Luciana","Lucie","Lucienne","Lucila","Lucilia","Lucille","Lucina","Lucinda","Lucine","Lucita","Lucky","Lucretia","Lucy","Ludovika","Luella","Luelle","Luisa","Luise","Lula","Lulita","Lulu","Lura","Lurette","Lurleen","Lurlene","Lurline","Lusa","Luz","Lyda","Lydia","Lydie","Lyn","Lynda","Lynde","Lyndel","Lyndell","Lyndsay","Lyndsey","Lyndsie","Lyndy","Lynea","Lynelle","Lynett","Lynette","Lynn","Lynna","Lynne","Lynnea","Lynnell","Lynnelle","Lynnet","Lynnett","Lynnette","Lynsey","Lyssa","Mab","Mabel","Mabelle","Mable","Mada","Madalena","Madalyn","Maddalena","Maddi","Maddie","Maddy","Madel","Madelaine","Madeleine","Madelena","Madelene","Madelin","Madelina","Madeline","Madella","Madelle","Madelon","Madelyn","Madge","Madlen","Madlin","Madonna","Mady","Mae","Maegan","Mag","Magda","Magdaia","Magdalen","Magdalena","Magdalene","Maggee","Maggi","Maggie","Maggy","Mahala","Mahalia","Maia","Maible","Maiga","Maighdiln","Mair","Maire","Maisey","Maisie","Maitilde","Mala","Malanie","Malena","Malia","Malina","Malinda","Malinde","Malissa","Malissia","Mallissa","Mallorie","Mallory","Malorie","Malory","Malva","Malvina","Malynda","Mame","Mamie","Manda","Mandi","Mandie","Mandy","Manon","Manya","Mara","Marabel","Marcela","Marcelia","Marcella","Marcelle","Marcellina","Marcelline","Marchelle","Marci","Marcia","Marcie","Marcile","Marcille","Marcy","Mareah","Maren","Marena","Maressa","Marga","Margalit","Margalo","Margaret","Margareta","Margarete","Margaretha","Margarethe","Margaretta","Margarette","Margarita","Margaux","Marge","Margeaux","Margery","Marget","Margette","Margi","Margie","Margit","Margo","Margot","Margret","Marguerite","Margy","Mari","Maria","Mariam","Marian","Mariana","Mariann","Marianna","Marianne","Maribel","Maribelle","Maribeth","Marice","Maridel","Marie","Marie-ann","Marie-jeanne","Marieann","Mariejeanne","Mariel","Mariele","Marielle","Mariellen","Marietta","Mariette","Marigold","Marijo","Marika","Marilee","Marilin","Marillin","Marilyn","Marin","Marina","Marinna","Marion","Mariquilla","Maris","Marisa","Mariska","Marissa","Marita","Maritsa","Mariya","Marj","Marja","Marje","Marji","Marjie","Marjorie","Marjory","Marjy","Marketa","Marla","Marlane","Marleah","Marlee","Marleen","Marlena","Marlene","Marley","Marlie","Marline","Marlo","Marlyn","Marna","Marne","Marney","Marni","Marnia","Marnie","Marquita","Marrilee","Marris","Marrissa","Marsha","Marsiella","Marta","Martelle","Martguerita","Martha","Marthe","Marthena","Marti","Martica","Martie","Martina","Martita","Marty","Martynne","Mary","Marya","Maryann","Maryanna","Maryanne","Marybelle","Marybeth","Maryellen","Maryjane","Maryjo","Maryl","Marylee","Marylin","Marylinda","Marylou","Marylynne","Maryrose","Marys","Marysa","Masha","Matelda","Mathilda","Mathilde","Matilda","Matilde","Matti","Mattie","Matty","Maud","Maude","Maudie","Maura","Maure","Maureen","Maureene","Maurene","Maurine","Maurise","Maurita","Maurizia","Mavis","Mavra","Max","Maxi","Maxie","Maxine","Maxy","May","Maybelle","Maye","Mead","Meade","Meagan","Meaghan","Meara","Mechelle","Meg","Megan","Megen","Meggi","Meggie","Meggy","Meghan","Meghann","Mehetabel","Mei","Mel","Mela","Melamie","Melania","Melanie","Melantha","Melany","Melba","Melesa","Melessa","Melicent","Melina","Melinda","Melinde","Melisa","Melisande","Melisandra","Melisenda","Melisent","Melissa","Melisse","Melita","Melitta","Mella","Melli","Mellicent","Mellie","Mellisa","Mellisent","Melloney","Melly","Melodee","Melodie","Melody","Melonie","Melony","Melosa","Melva","Mercedes","Merci","Mercie","Mercy","Meredith","Meredithe","Meridel","Meridith","Meriel","Merilee","Merilyn","Meris","Merissa","Merl","Merla","Merle","Merlina","Merline","Merna","Merola","Merralee","Merridie","Merrie","Merrielle","Merrile","Merrilee","Merrili","Merrill","Merrily","Merry","Mersey","Meryl","Meta","Mia","Micaela","Michaela","Michaelina","Michaeline","Michaella","Michal","Michel","Michele","Michelina","Micheline","Michell","Michelle","Micki","Mickie","Micky","Midge","Mignon","Mignonne","Miguela","Miguelita","Mikaela","Mil","Mildred","Mildrid","Milena","Milicent","Milissent","Milka","Milli","Millicent","Millie","Millisent","Milly","Milzie","Mimi","Min","Mina","Minda","Mindy","Minerva","Minetta","Minette","Minna","Minnaminnie","Minne","Minni","Minnie","Minnnie","Minny","Minta","Miquela","Mira","Mirabel","Mirabella","Mirabelle","Miran","Miranda","Mireielle","Mireille","Mirella","Mirelle","Miriam","Mirilla","Mirna","Misha","Missie","Missy","Misti","Misty","Mitzi","Modesta","Modestia","Modestine","Modesty","Moina","Moira","Moll","Mollee","Molli","Mollie","Molly","Mommy","Mona","Monah","Monica","Monika","Monique","Mora","Moreen","Morena","Morgan","Morgana","Morganica","Morganne","Morgen","Moria","Morissa","Morna","Moselle","Moyna","Moyra","Mozelle","Muffin","Mufi","Mufinella","Muire","Mureil","Murial","Muriel","Murielle","Myra","Myrah","Myranda","Myriam","Myrilla","Myrle","Myrlene","Myrna","Myrta","Myrtia","Myrtice","Myrtie","Myrtle","Nada","Nadean","Nadeen","Nadia","Nadine","Nadiya","Nady","Nadya","Nalani","Nan","Nana","Nananne","Nance","Nancee","Nancey","Nanci","Nancie","Nancy","Nanete","Nanette","Nani","Nanice","Nanine","Nannette","Nanni","Nannie","Nanny","Nanon","Naoma","Naomi","Nara","Nari","Nariko","Nat","Nata","Natala","Natalee","Natalie","Natalina","Nataline","Natalya","Natasha","Natassia","Nathalia","Nathalie","Natividad","Natka","Natty","Neala","Neda","Nedda","Nedi","Neely","Neila","Neile","Neilla","Neille","Nelia","Nelie","Nell","Nelle","Nelli","Nellie","Nelly","Nerissa","Nerita","Nert","Nerta","Nerte","Nerti","Nertie","Nerty","Nessa","Nessi","Nessie","Nessy","Nesta","Netta","Netti","Nettie","Nettle","Netty","Nevsa","Neysa","Nichol","Nichole","Nicholle","Nicki","Nickie","Nicky","Nicol","Nicola","Nicole","Nicolea","Nicolette","Nicoli","Nicolina","Nicoline","Nicolle","Nikaniki","Nike","Niki","Nikki","Nikkie","Nikoletta","Nikolia","Nina","Ninetta","Ninette","Ninnetta","Ninnette","Ninon","Nissa","Nisse","Nissie","Nissy","Nita","Nixie","Noami","Noel","Noelani","Noell","Noella","Noelle","Noellyn","Noelyn","Noemi","Nola","Nolana","Nolie","Nollie","Nomi","Nona","Nonah","Noni","Nonie","Nonna","Nonnah","Nora","Norah","Norean","Noreen","Norene","Norina","Norine","Norma","Norri","Norrie","Norry","Novelia","Nydia","Nyssa","Octavia","Odele","Odelia","Odelinda","Odella","Odelle","Odessa","Odetta","Odette","Odilia","Odille","Ofelia","Ofella","Ofilia","Ola","Olenka","Olga","Olia","Olimpia","Olive","Olivette","Olivia","Olivie","Oliy","Ollie","Olly","Olva","Olwen","Olympe","Olympia","Olympie","Ondrea","Oneida","Onida","Oona","Opal","Opalina","Opaline","Ophelia","Ophelie","Ora","Oralee","Oralia","Oralie","Oralla","Oralle","Orel","Orelee","Orelia","Orelie","Orella","Orelle","Oriana","Orly","Orsa","Orsola","Ortensia","Otha","Othelia","Othella","Othilia","Othilie","Ottilie","Page","Paige","Paloma","Pam","Pamela","Pamelina","Pamella","Pammi","Pammie","Pammy","Pandora","Pansie","Pansy","Paola","Paolina","Papagena","Pat","Patience","Patrica","Patrice","Patricia","Patrizia","Patsy","Patti","Pattie","Patty","Paula","Paule","Pauletta","Paulette","Pauli","Paulie","Paulina","Pauline","Paulita","Pauly","Pavia","Pavla","Pearl","Pearla","Pearle","Pearline","Peg","Pegeen","Peggi","Peggie","Peggy","Pen","Penelopa","Penelope","Penni","Pennie","Penny","Pepi","Pepita","Peri","Peria","Perl","Perla","Perle","Perri","Perrine","Perry","Persis","Pet","Peta","Petra","Petrina","Petronella","Petronia","Petronilla","Petronille","Petunia","Phaedra","Phaidra","Phebe","Phedra","Phelia","Phil","Philipa","Philippa","Philippe","Philippine","Philis","Phillida","Phillie","Phillis","Philly","Philomena","Phoebe","Phylis","Phyllida","Phyllis","Phyllys","Phylys","Pia","Pier","Pierette","Pierrette","Pietra","Piper","Pippa","Pippy","Polly","Pollyanna","Pooh","Poppy","Portia","Pris","Prisca","Priscella","Priscilla","Prissie","Pru","Prudence","Prudi","Prudy","Prue","Queenie","Quentin","Querida","Quinn","Quinta","Quintana","Quintilla","Quintina","Rachael","Rachel","Rachele","Rachelle","Rae","Raeann","Raf","Rafa","Rafaela","Rafaelia","Rafaelita","Rahal","Rahel","Raina","Raine","Rakel","Ralina","Ramona","Ramonda","Rana","Randa","Randee","Randene","Randi","Randie","Randy","Ranee","Rani","Rania","Ranice","Ranique","Ranna","Raphaela","Raquel","Raquela","Rasia","Rasla","Raven","Ray","Raychel","Raye","Rayna","Raynell","Rayshell","Rea","Reba","Rebbecca","Rebe","Rebeca","Rebecca","Rebecka","Rebeka","Rebekah","Rebekkah","Ree","Reeba","Reena","Reeta","Reeva","Regan","Reggi","Reggie","Regina","Regine","Reiko","Reina","Reine","Remy","Rena","Renae","Renata","Renate","Rene","Renee","Renell","Renelle","Renie","Rennie","Reta","Retha","Revkah","Rey","Reyna","Rhea","Rheba","Rheta","Rhetta","Rhiamon","Rhianna","Rhianon","Rhoda","Rhodia","Rhodie","Rhody","Rhona","Rhonda","Riane","Riannon","Rianon","Rica","Ricca","Rici","Ricki","Rickie","Ricky","Riki","Rikki","Rina","Risa","Rita","Riva","Rivalee","Rivi","Rivkah","Rivy","Roana","Roanna","Roanne","Robbi","Robbie","Robbin","Robby","Robbyn","Robena","Robenia","Roberta","Robin","Robina","Robinet","Robinett","Robinetta","Robinette","Robinia","Roby","Robyn","Roch","Rochell","Rochella","Rochelle","Rochette","Roda","Rodi","Rodie","Rodina","Rois","Romola","Romona","Romonda","Romy","Rona","Ronalda","Ronda","Ronica","Ronna","Ronni","Ronnica","Ronnie","Ronny","Roobbie","Rora","Rori","Rorie","Rory","Ros","Rosa","Rosabel","Rosabella","Rosabelle","Rosaleen","Rosalia","Rosalie","Rosalind","Rosalinda","Rosalinde","Rosaline","Rosalyn","Rosalynd","Rosamond","Rosamund","Rosana","Rosanna","Rosanne","Rose","Roseann","Roseanna","Roseanne","Roselia","Roselin","Roseline","Rosella","Roselle","Rosemaria","Rosemarie","Rosemary","Rosemonde","Rosene","Rosetta","Rosette","Roshelle","Rosie","Rosina","Rosita","Roslyn","Rosmunda","Rosy","Row","Rowe","Rowena","Roxana","Roxane","Roxanna","Roxanne","Roxi","Roxie","Roxine","Roxy","Roz","Rozalie","Rozalin","Rozamond","Rozanna","Rozanne","Roze","Rozele","Rozella","Rozelle","Rozina","Rubetta","Rubi","Rubia","Rubie","Rubina","Ruby","Ruperta","Ruth","Ruthann","Ruthanne","Ruthe","Ruthi","Ruthie","Ruthy","Ryann","Rycca","Saba","Sabina","Sabine","Sabra","Sabrina","Sacha","Sada","Sadella","Sadie","Sadye","Saidee","Sal","Salaidh","Sallee","Salli","Sallie","Sally","Sallyann","Sallyanne","Saloma","Salome","Salomi","Sam","Samantha","Samara","Samaria","Sammy","Sande","Sandi","Sandie","Sandra","Sandy","Sandye","Sapphira","Sapphire","Sara","Sara-ann","Saraann","Sarah","Sarajane","Saree","Sarena","Sarene","Sarette","Sari","Sarina","Sarine","Sarita","Sascha","Sasha","Sashenka","Saudra","Saundra","Savina","Sayre","Scarlet","Scarlett","Sean","Seana","Seka","Sela","Selena","Selene","Selestina","Selia","Selie","Selina","Selinda","Seline","Sella","Selle","Selma","Sena","Sephira","Serena","Serene","Shae","Shaina","Shaine","Shalna","Shalne","Shana","Shanda","Shandee","Shandeigh","Shandie","Shandra","Shandy","Shane","Shani","Shanie","Shanna","Shannah","Shannen","Shannon","Shanon","Shanta","Shantee","Shara","Sharai","Shari","Sharia","Sharity","Sharl","Sharla","Sharleen","Sharlene","Sharline","Sharon","Sharona","Sharron","Sharyl","Shaun","Shauna","Shawn","Shawna","Shawnee","Shay","Shayla","Shaylah","Shaylyn","Shaylynn","Shayna","Shayne","Shea","Sheba","Sheela","Sheelagh","Sheelah","Sheena","Sheeree","Sheila","Sheila-kathryn","Sheilah","Shel","Shela","Shelagh","Shelba","Shelbi","Shelby","Shelia","Shell","Shelley","Shelli","Shellie","Shelly","Shena","Sher","Sheree","Sheri","Sherie","Sherill","Sherilyn","Sherline","Sherri","Sherrie","Sherry","Sherye","Sheryl","Shina","Shir","Shirl","Shirlee","Shirleen","Shirlene","Shirley","Shirline","Shoshana","Shoshanna","Siana","Sianna","Sib","Sibbie","Sibby","Sibeal","Sibel","Sibella","Sibelle","Sibilla","Sibley","Sibyl","Sibylla","Sibylle","Sidoney","Sidonia","Sidonnie","Sigrid","Sile","Sileas","Silva","Silvana","Silvia","Silvie","Simona","Simone","Simonette","Simonne","Sindee","Siobhan","Sioux","Siouxie","Sisely","Sisile","Sissie","Sissy","Siusan","Sofia","Sofie","Sondra","Sonia","Sonja","Sonni","Sonnie","Sonnnie","Sonny","Sonya","Sophey","Sophi","Sophia","Sophie","Sophronia","Sorcha","Sosanna","Stace","Stacee","Stacey","Staci","Stacia","Stacie","Stacy","Stafani","Star","Starla","Starlene","Starlin","Starr","Stefa","Stefania","Stefanie","Steffane","Steffi","Steffie","Stella","Stepha","Stephana","Stephani","Stephanie","Stephannie","Stephenie","Stephi","Stephie","Stephine","Stesha","Stevana","Stevena","Stoddard","Storm","Stormi","Stormie","Stormy","Sue","Suellen","Sukey","Suki","Sula","Sunny","Sunshine","Susan","Susana","Susanetta","Susann","Susanna","Susannah","Susanne","Susette","Susi","Susie","Susy","Suzann","Suzanna","Suzanne","Suzette","Suzi","Suzie","Suzy","Sybil","Sybila","Sybilla","Sybille","Sybyl","Sydel","Sydelle","Sydney","Sylvia","Tabatha","Tabbatha","Tabbi","Tabbie","Tabbitha","Tabby","Tabina","Tabitha","Taffy","Talia","Tallia","Tallie","Tallou","Tallulah","Tally","Talya","Talyah","Tamar","Tamara","Tamarah","Tamarra","Tamera","Tami","Tamiko","Tamma","Tammara","Tammi","Tammie","Tammy","Tamqrah","Tamra","Tana","Tandi","Tandie","Tandy","Tanhya","Tani","Tania","Tanitansy","Tansy","Tanya","Tara","Tarah","Tarra","Tarrah","Taryn","Tasha","Tasia","Tate","Tatiana","Tatiania","Tatum","Tawnya","Tawsha","Ted","Tedda","Teddi","Teddie","Teddy","Tedi","Tedra","Teena","Teirtza","Teodora","Tera","Teresa","Terese","Teresina","Teresita","Teressa","Teri","Teriann","Terra","Terri","Terrie","Terrijo","Terry","Terrye","Tersina","Terza","Tess","Tessa","Tessi","Tessie","Tessy","Thalia","Thea","Theadora","Theda","Thekla","Thelma","Theo","Theodora","Theodosia","Theresa","Therese","Theresina","Theresita","Theressa","Therine","Thia","Thomasa","Thomasin","Thomasina","Thomasine","Tiena","Tierney","Tiertza","Tiff","Tiffani","Tiffanie","Tiffany","Tiffi","Tiffie","Tiffy","Tilda","Tildi","Tildie","Tildy","Tillie","Tilly","Tim","Timi","Timmi","Timmie","Timmy","Timothea","Tina","Tine","Tiphani","Tiphanie","Tiphany","Tish","Tisha","Tobe","Tobey","Tobi","Toby","Tobye","Toinette","Toma","Tomasina","Tomasine","Tomi","Tommi","Tommie","Tommy","Toni","Tonia","Tonie","Tony","Tonya","Tonye","Tootsie","Torey","Tori","Torie","Torrie","Tory","Tova","Tove","Tracee","Tracey","Traci","Tracie","Tracy","Trenna","Tresa","Trescha","Tressa","Tricia","Trina","Trish","Trisha","Trista","Trix","Trixi","Trixie","Trixy","Truda","Trude","Trudey","Trudi","Trudie","Trudy","Trula","Tuesday","Twila","Twyla","Tybi","Tybie","Tyne","Ula","Ulla","Ulrica","Ulrika","Ulrikaumeko","Ulrike","Umeko","Una","Ursa","Ursala","Ursola","Ursula","Ursulina","Ursuline","Uta","Val","Valaree","Valaria","Vale","Valeda","Valencia","Valene","Valenka","Valentia","Valentina","Valentine","Valera","Valeria","Valerie","Valery","Valerye","Valida","Valina","Valli","Vallie","Vally","Valma","Valry","Van","Vanda","Vanessa","Vania","Vanna","Vanni","Vannie","Vanny","Vanya","Veda","Velma","Velvet","Venita","Venus","Vera","Veradis","Vere","Verena","Verene","Veriee","Verile","Verina","Verine","Verla","Verna","Vernice","Veronica","Veronika","Veronike","Veronique","Vevay","Vi","Vicki","Vickie","Vicky","Victoria","Vida","Viki","Vikki","Vikky","Vilhelmina","Vilma","Vin","Vina","Vinita","Vinni","Vinnie","Vinny","Viola","Violante","Viole","Violet","Violetta","Violette","Virgie","Virgina","Virginia","Virginie","Vita","Vitia","Vitoria","Vittoria","Viv","Viva","Vivi","Vivia","Vivian","Viviana","Vivianna","Vivianne","Vivie","Vivien","Viviene","Vivienne","Viviyan","Vivyan","Vivyanne","Vonni","Vonnie","Vonny","Vyky","Wallie","Wallis","Walliw","Wally","Waly","Wanda","Wandie","Wandis","Waneta","Wanids","Wenda","Wendeline","Wendi","Wendie","Wendy","Wendye","Wenona","Wenonah","Whitney","Wileen","Wilhelmina","Wilhelmine","Wilie","Willa","Willabella","Willamina","Willetta","Willette","Willi","Willie","Willow","Willy","Willyt","Wilma","Wilmette","Wilona","Wilone","Wilow","Windy","Wini","Winifred","Winna","Winnah","Winne","Winni","Winnie","Winnifred","Winny","Winona","Winonah","Wren","Wrennie","Wylma","Wynn","Wynne","Wynnie","Wynny","Xaviera","Xena","Xenia","Xylia","Xylina","Yalonda","Yasmeen","Yasmin","Yelena","Yetta","Yettie","Yetty","Yevette","Ynes","Ynez","Yoko","Yolanda","Yolande","Yolane","Yolanthe","Yoshi","Yoshiko","Yovonnda","Ysabel","Yvette","Yvonne","Zabrina","Zahara","Zandra","Zaneta","Zara","Zarah","Zaria","Zarla","Zea","Zelda","Zelma","Zena","Zenia","Zia","Zilvia","Zita","Zitella","Zoe","Zola","Zonda","Zondra","Zonnya","Zora","Zorah","Zorana","Zorina","Zorine","Zsazsa","Zulema","Zuzana"];function rG(){if(typeof process<"u"&&process.versions&&process.versions.node)return"node";if(typeof globalThis<"u"&&typeof globalThis.window<"u"&&typeof globalThis.window.document<"u")return"browser";return"unknown"}class nG{store={};constructor(){if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.ENV)this.store={...globalThis.window.ENV};if(typeof globalThis<"u"&&globalThis.__ENV__)this.store={...this.store,...globalThis.__ENV__}}get($){let q=this.store[$];return q!==void 0?String(q):void 0}set($,q){this.store[$]=q}has($){return $ in this.store}getAll(){return{...this.store}}}class iG{runtime;browserStore;cache=new Map;constructor(){if(this.runtime=rG(),this.runtime==="browser")this.browserStore=new nG}getRuntime(){return this.runtime}isNode(){return this.runtime==="node"}isBrowser(){return this.runtime==="browser"}get($,q){if(this.cache.has($)){let P=this.cache.get($);return P===void 0&&q!==void 0?q:P}let K;switch(this.runtime){case"node":if(typeof process<"u"&&process.env)K=process.env[$];break;case"browser":if(this.browserStore)K=this.browserStore.get($);break;default:K=void 0}return this.cache.set($,K),K===void 0&&q!==void 0?q:K}set($,q){let K=String(q);switch(this.cache.delete($),this.runtime){case"node":if(typeof process<"u"&&process.env)process.env[$]=K;break;case"browser":if(this.browserStore)this.browserStore.set($,q);break}}has($){return this.get($)!==void 0}getAll(){switch(this.runtime){case"node":if(typeof process<"u"&&process.env)return{...process.env};break;case"browser":if(this.browserStore)return this.browserStore.getAll();break}return{}}getBoolean($,q=!1){let K=this.get($);if(K===void 0)return q;return["true","1","yes","on"].includes(K.toLowerCase())}getNumber($,q){let K=this.get($);if(K===void 0)return q;let P=Number(K);return isNaN(P)?q:P}clearCache(){this.cache.clear()}}var TW=null;function N4(){if(!TW)TW=new iG;return TW}function xK($,q){return N4().get($,q)}function O8$($,q){N4().set($,q)}function Y8$($){return N4().has($)}function v8$($,q=!1){return N4().getBoolean($,q)}function tG($,q){return N4().getNumber($,q)}function z8$($){let q=N4();if(q.isBrowser())Object.entries($).forEach(([K,P])=>{if(P!==void 0)q.set(K,P)})}var W8$=rG();class Sj{globalStore;constructor($){this.globalStore=$}clear(){console.clear()}filterByLabel($){BG($,this.globalStore.cache).forEach((K)=>{G7(K)})}filterByNamespace(...$){UG($,this.globalStore.cache).forEach((K)=>{G7(K)})}filterByLevel($){FG($,this.globalStore.cache).forEach((K)=>{G7(K)})}renderAll(){this.globalStore.cache.forEach(($)=>{G7($)})}}class C4{config;pidCounter=1;labels=new Map;_listenerCounter=0;_levelsToListeners=new Map;_cache=[];constructor($={}){this.config=$}get cache(){return this._cache}get configuration(){return this.config}get pid(){let $=this.pidCounter;return this.pidCounter++,$}get tools(){return new Sj(this)}addLogToCache($){if(this._cache.length<(this.config.cacheSize??300))this._cache.push($)}clearCache(){this._cache=[]}getLabel($){return this.labels.get($)}setLabel($,q){this.labels.set($,q)}addListener($,q){let K=this._listenerCounter+=1;return V7({...q8.levels,...this.config.levels??{}},$).forEach((_)=>{if(this._levelsToListeners.has(_))this._levelsToListeners.get(_).set(K,q);else this._levelsToListeners.set(_,new Map([[K,q]]))}),K}removeListener($){this._levelsToListeners.forEach((q)=>{q.delete($)})}getListeners($){return Array.from(this._levelsToListeners.get($)?.values()??[])}}function wW($){return globalThis.$adzeGlobal=new C4($),globalThis.$adzeGlobal}function Mj($){let q=globalThis.$adzeGlobal;if(bc(q))return q;let K=new C4($);return globalThis.$adzeGlobal=K,K}function bc($){return $ instanceof C4}function TK(){return typeof window<"u"&&typeof window.location<"u"&&typeof window.navigator.userAgent<"u"&&!uc()}function uc(){return typeof Deno<"u"}function aG($){return TK()}function QG(){let $=!1;if(TK())$=new URLSearchParams(globalThis.location.search).get("ADZE_ENV")==="test";return globalThis.$ADZE_ENV==="test"||$}function eG(){let $=globalThis;if(aG($))return $.navigator.userAgent.includes("Firefox");return!1}function E4($){return Object.prototype.toString.call($)==="[object String]"}function h4($){return $!==null&&typeof $==="number"&&!isNaN(Number($))}function Nj($){return fW.includes($)}function sG($){return KV.includes($)}function $V($){return XW.includes($)}function ZW($){return $.every((q)=>E4(q))}function qV($){return Array.isArray($)&&$.length===3&&$[1]==="-"}function _V(){return Error().stack?.replace(/^Error\n/,`
|
|
331
|
-
`)}function PV($){if(h4($.activeLevel))return $.activeLevel;return $.levels[$.activeLevel].level}var GW=Uq(OV(),1),YV=GW.default??GW;function VW($){return $.charAt(0).toUpperCase()+$.slice(1)}function SW($){return Object.values($).map((q)=>q.level)}function MW($,q,K){return $.filter((P)=>P>=q&&P<=K)}function NW($,q=!1,K){let _=(q&&K?9+K.length:9)-$.length,O=$;for(let j=0;j<=_;j+=1)O+=" ";return O}function CW($,q){return q.reduce((K,P)=>{return YV[P](K)},$)}function G7($){if($.data)console[$.data.method](...$.data.message)}function vV($){return $.filter((q)=>q!=="")}function zV($){return typeof $==="object"&&$!==null}function V7($,q){if(q==="*")return Object.values($).map((K)=>K.level);if(E4(q))return[$[q].level];if(h4(q))return[q];if(qV(q)){if(ZW(q)){let K=$[q[0]].level,P=$[q[2]].level;return MW(SW($),K,P)}return MW(SW($),q[0],q[2])}if(Array.isArray(q)&&ZW(q))return q.map((K)=>$[K].level);return q}function EW($,q,K){if(q.length===0)return!1;return $==="include"?!q.includes(K):q.includes(K)}function hW($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return!q.map((K)=>$.includes(K)).includes(!0)}function RW($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return q.map((K)=>$.includes(K)).includes(!0)}function BG($,q){return q.filter((K)=>K.data?.label?.name===$)}function UG($,q){return q.filter((K)=>{if(K.data?.namespace)return K.data.namespace.map((_)=>$.includes(_)).includes(!0);return!1})}function FG($,q){return q.filter((K)=>{let P=V7(K.configuration.levels,$);if(K.data?.level===void 0)return!1;return EW("exclude",P,K.data.level)})}function IW($){if($&&$.length>0)return $.reduce((q,K)=>`${q}#${K} `,"");return""}function DW($){return $?`[${$.name}] `:""}function gW($){return $!==void 0?`(Count: ${$}) `:""}function LW($,q){return $!==void 0&&!$?`${q?"❌ ":""}Assertion failed:`:""}function bW($,q){return $!==void 0&&$?`${q?"✅ ":""}Expression passed:`:""}var Cj=-1,R4=0,I4=1,D4=2,S7=3,M7=4,N7=5,C7=6,Ej=7,hj=8;var WV=typeof self==="object"?self:globalThis,yc=($,q)=>{let K=(_,O)=>{return $.set(O,_),_},P=(_)=>{if($.has(_))return $.get(_);let[O,j]=q[_];switch(O){case R4:case Cj:return K(j,_);case I4:{let z=K([],_);for(let J of j)z.push(P(J));return z}case D4:{let z=K({},_);for(let[J,w]of j)z[P(J)]=P(w);return z}case S7:return K(new Date(j),_);case M7:{let{source:z,flags:J}=j;return K(new RegExp(z,J),_)}case N7:{let z=K(new Map,_);for(let[J,w]of j)z.set(P(J),P(w));return z}case C7:{let z=K(new Set,_);for(let J of j)z.add(P(J));return z}case Ej:{let{name:z,message:J}=j;return K(new WV[z](J),_)}case hj:return K(BigInt(j),_);case"BigInt":return K(Object(BigInt(j)),_)}return K(new WV[O](j),_)};return P},uW=($)=>yc(new Map,$)(0);var g4="",{toString:pc}={},{keys:xc}=Object,E7=($)=>{let q=typeof $;if(q!=="object"||!$)return[R4,q];let K=pc.call($).slice(8,-1);switch(K){case"Array":return[I4,g4];case"Object":return[D4,g4];case"Date":return[S7,g4];case"RegExp":return[M7,g4];case"Map":return[N7,g4];case"Set":return[C7,g4]}if(K.includes("Array"))return[I4,K];if(K.includes("Error"))return[Ej,K];return[D4,K]},Rj=([$,q])=>$===R4&&(q==="function"||q==="symbol"),cc=($,q,K,P)=>{let _=(j,z)=>{let J=P.push(j)-1;return K.set(z,J),J},O=(j)=>{if(K.has(j))return K.get(j);let[z,J]=E7(j);switch(z){case R4:{let G=j;switch(J){case"bigint":z=hj,G=j.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+J);G=null;break;case"undefined":return _([Cj],j)}return _([z,G],j)}case I4:{if(J)return _([J,[...j]],j);let G=[],f=_([z,G],j);for(let A of j)G.push(O(A));return f}case D4:{if(J)switch(J){case"BigInt":return _([J,j.toString()],j);case"Boolean":case"Number":case"String":return _([J,j.valueOf()],j)}if(q&&"toJSON"in j)return O(j.toJSON());let G=[],f=_([z,G],j);for(let A of xc(j))if($||!Rj(E7(j[A])))G.push([O(A),O(j[A])]);return f}case S7:return _([z,j.toISOString()],j);case M7:{let{source:G,flags:f}=j;return _([z,{source:G,flags:f}],j)}case N7:{let G=[],f=_([z,G],j);for(let[A,V]of j)if($||!(Rj(E7(A))||Rj(E7(V))))G.push([O(A),O(V)]);return f}case C7:{let G=[],f=_([z,G],j);for(let A of j)if($||!Rj(E7(A)))G.push(O(A));return f}}let{message:w}=j;return _([z,{name:J,message:w}],j)};return O},yW=($,{json:q,lossy:K}={})=>{let P=[];return cc(!(q||K),!!q,new Map,P)($),P};var pW=typeof structuredClone==="function"?($,q)=>q&&(("json"in q)||("lossy"in q))?uW(yW($,q)):structuredClone($):($,q)=>uW(yW($,q));function xW($,q,K,P){let{formatters:_,middleware:O=[],...j}=q.exportValues();return class extends ${_cfg=new L4({...pW(j),formatters:{..._},middleware:[...O]});_modifierData=pW(K);modifierQueue=[...P]}}function cW([$,q]){return`${$}s ${q/1e6}ms`}function HV(){return cW(Ij())}function Ij($){let q=performance.now()*0.001,K=Math.floor(q),P=Math.floor(q%1*1e9);if($===void 0)return[K,P];let _=K-$[0],O=P-$[1];if(O<0)_-=1,O+=1e9;return[_,O]}function b4($){let q=(O)=>`${Math.floor(Math.abs(O))}`.padStart(2,"0"),K=-$.getTimezoneOffset(),_=`${K>=0?"+":"-"}${q(K/60)}:${q(K%60)}`;return`${$.getFullYear()}-${q($.getMonth()+1)}-${q($.getDate())}T${q($.getHours())}:${q($.getMinutes())}:${q($.getSeconds())}${_}`}function JV($){let q=(E,R=2)=>String(E).padStart(R,"0"),K=q($.getDate()),_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][$.getMonth()],O=$.getFullYear(),j=q($.getHours()),z=q($.getMinutes()),J=q($.getSeconds()),w=-$.getTimezoneOffset(),G=w>=0?"+":"-",f=Math.abs(w),A=q(Math.floor(f/60)),V=q(f%60),C=`${G}${A}${V}`;return`${K}/${_}/${O}:${j}:${z}:${J} ${C}`}class E8{cfg;level;timestampFormatFunction=($)=>b4($);constructor($,q){this.cfg=$,this.level=q}get timestampFormatter(){return this.cfg.timestampFormatter?this.cfg.timestampFormatter:this.timestampFormatFunction}print($,q,K){if(this.level.level>PV(this.cfg))return[];if(this.failsFilters($))return[];if($.assertion===!0)return[];if($.if===!1)return[];if($.method&&!$V($.method)){if(sG($.method)&&Nj($.method))return K}let P=TK()?this.formatBrowser($,q,K):this.formatServer($,q,K);if($.stacktrace)P.push($.stacktrace);return P}failsFilters($){if(this.failsLevelSelector())return!0;if(this.failsNamespacesFilter($))return!0;if(this.failsLabelsFilter($))return!0;return!1}failsLevelSelector(){if(this.cfg.filters?.levels===void 0)return!1;let $=V7(this.cfg.levels,this.cfg.filters.levels.values);if(EW(this.cfg.filters.levels.type,$,this.level.level))return!0;return!1}failsNamespacesFilter($){if(this.cfg.filters?.namespaces===void 0)return!1;if(this.cfg.filters.namespaces.values.length>0&&$.namespace===void 0)return!0;if(this.cfg.filters.namespaces.type==="include"){let K=$.namespace??[];return hW(this.cfg.filters.namespaces.values,K)}let q=$.namespace??[];return RW(this.cfg.filters.namespaces.values,q)}failsLabelsFilter($){if(this.cfg.filters?.labels===void 0)return!1;if(this.cfg.filters.labels.values.length>0&&$.label===void 0)return!0;let q=$.label?[$.label.name]:[];if(this.cfg.filters.labels.type==="include")return hW(this.cfg.filters.labels.values,q);return RW(this.cfg.filters.labels.values,q)}}class Dj extends E8{timestampFormatFunction=($)=>JV($);formatBrowser($,q,K){return this.formatMessage($,q,K)}formatServer($,q,K){return this.formatMessage($,q,K)}formatMessage($,q,K){if(this.cfg.meta.hostname===void 0)console.warn(Error("Adze: 'hostname' is required for the common log format. Please provide this value in your log's meta data."));let P=this.cfg.meta.hostname,_=this.cfg.meta.ident??"-",O=this.cfg.meta.user??"-",j=K[0];return[`${P} ${_} ${O} [${q}] ${j}`]}}var TV=Dj;function wV($){return typeof $.name==="string"&&typeof $.hostname==="string"}class gj extends E8{timestampFormatFunction=($)=>b4($);formatBrowser($,q,K){return this.formatMessage($,q,K)}formatServer($,q,K){return this.formatMessage($,q,K)}formatMessage($,q,K){let P=Mj(),_=[...K],O=_.shift();if(wV(this.cfg.meta)){let{src:j,err:z,req_id:J,req:w,res:G,latency:f,hostname:A,name:V,...C}=this.cfg.meta,{namespace:E,label:R}=$,I={v:1,level:this.level.level,levelName:this.level.levelName,name:V,hostname:A,msg:O,args:_,pid:P.pid,time:q,meta:Object.keys(C).length>0?C:void 0,namespace:E,label:R?.name,src:j,err:z,req_id:J,req:w,res:G,latency:f};return[JSON.stringify(I)]}return console.warn(Error("Adze: Required fields are missing from the log meta for generating a JSON log.")),[..._]}}var ZV=gj;class Lj extends E8{formatBrowser($,q,K){let P=this.formatLeader(),_=this.formatMeta($,q);if(this.cfg.withEmoji)return[P,"font-size: 12px;",this.level.style,_,...K];return[P,this.level.style,_,...K]}formatServer($,q,K){let P=[],O=`${NW(this.formatLeader(!1),this.cfg.withEmoji,this.level.emoji)} `,j=this.formatMeta($,q),z=CW(O,this.level.terminalStyle);return P.push(z),j!==""&&P.push(j),[z,j,...K]}formatLeader($=!0){let q=$?"%c":"",K=" "+VW(this.level.levelName);if(this.cfg.withEmoji)return`${q}${this.formatEmoji($)}${q}${K}`;return`${q}${K}`}formatEmoji($){let q=$?" ":"";return this.level.emoji?`${this.level.emoji}${q}`:""}formatMeta($,q){let K=this.cfg.showTimestamp?`${q} `:"",P=IW($.namespace),_=DW($.label),O=this.formatTime($),j=gW($.label?.count),z=LW($.assertion,this.cfg.withEmoji),J=bW($.if,this.cfg.withEmoji),w=z!==""?z:J!==""?J:"";return K+P+_+O+j+w}formatTime($){let q=this.cfg.withEmoji?"⏱ ":"Time elapsed: ";if($.timeNow)return`(${q}${$.timeNow})`;return $.label?.timeElapsed?`(${q}${$.label.timeElapsed})`:""}}var mW=Lj;class h7 extends E8{timestampFormatFunction=($)=>b4($);formatBrowser($,q,K){return this.formatMessage(q,$,K)}formatServer($,q,K){return this.formatMessage(q,$,K)}formatMessage($,q,K){let P="",{appname:_,hostname:O,port:j}=this.cfg.meta,z=h4(j)?`/${j}`:"",J=E4(_)?`${_}${z}`:"",w=E4(O)?` on ${O}: `:"",G=this.formatNamespace(q.namespace),f=q.label?`[${q.label.name}] `:"";return P=`${J}${w}${G}${f}`,[`[${$}] ${this.level.levelName.toUpperCase()}: ${P}${K[0]} `,K.map((A)=>zV(A)?JSON.stringify(A):A).slice(1).join(" ")]}formatNamespace($){if($&&$.length>0)return`${$.reduce((K,P,_)=>{return _===$.length-1?`${K}${P}`:`${K}${P}/`},"")} `;return""}}var XW=["group","groupCollapsed"],XV=["dir","dirxml","table",...XW],fW=["error","warn","info","log","debug",...XV],kW=["clear","groupEnd"],KV=[...XV,...kW],uK$=[...fW,...kW];var q8={activeLevel:"log",cache:!1,cacheSize:300,dump:!1,format:"pretty",meta:{},middleware:[],showTimestamp:!1,silent:!1,withEmoji:!1,levels:{alert:mc(),error:dc(),warn:lc(),info:oc(),fail:rc(),success:nc(),log:ic(),debug:tc(),verbose:Bc()},formatters:{default:mW,pretty:mW,standard:h7,common:TV,json:ZV}};function mc($={}){return{levelName:"alert",level:0,style:"padding-right: 24px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fc8585, #fc2323); color: #fff; border-color: #b70101;",terminalStyle:["white","bold","bgRed"],method:"error",emoji:"\uD83D\uDEA8",...$}}function dc($={}){return{levelName:"error",level:1,style:"padding-right: 24px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fff, #ffd1d1); color: #a4000f; border-color: #e3bbbb;",terminalStyle:["white","bgRed"],method:"error",emoji:"\uD83D\uDD25",...$}}function lc($={}){return{levelName:"warn",level:2,style:`font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fff, #fff0a8); color: #715100; border-color: #e3d696; padding-right: ${eG()?"44px":"30px"};`,terminalStyle:["white","bgYellow"],method:"warn",emoji:"\uD83D\uDD14",...$}}function oc($={}){return{levelName:"info",level:3,style:"padding-right: 44px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #d8ebff, #b2d7ff); color: #465464; border-color: #96b5d7;",terminalStyle:["white","bgBlue"],method:"info",emoji:"ℹ️",...$}}function rc($={}){return{levelName:"fail",level:4,style:"padding-right: 44px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #ffe8e8, #ffd1d1); color: #a4000f; border-color: #e3bbbb;",terminalStyle:["white","bgRed"],method:"info",emoji:"❌",...$}}function nc($={}){return{levelName:"success",level:5,style:"font-size: 12px; border-radius: 4px; padding-right: 22px; background: linear-gradient(to right, #e6f6e4, #ceedc9); color: #4e594d; border-color: #b7d1b3;",terminalStyle:["white","bgGreen"],method:"info",emoji:"\uD83C\uDF89",...$}}function ic($={}){return{levelName:"log",level:6,style:"font-size: 12px; border-radius: 4px; padding-right: 51px; background: linear-gradient(to right, #ecedef, #d9dce0); color: #333435; border-color: #bfc1c5;",terminalStyle:["white","bgBlackBright"],method:"log",emoji:"\uD83E\uDEB5",...$}}function tc($={}){return{levelName:"debug",level:7,style:"font-size: 12px; padding-right: 36px; border-right: 1px solid #d9dce0; color: #465464; border-color: #999999;",terminalStyle:["white","bgBlack"],method:"debug",emoji:"\uD83D\uDC1E",...$}}function Bc($={}){return{levelName:"verbose",level:8,style:"font-size: 12px; padding-right: 22px; color: #999999;",terminalStyle:["black","italic"],method:"debug",emoji:"\uD83D\uDCAC",...$}}class L4{logCfg;glblCfg;constructor($){this.logCfg=$??{},this.glblCfg=globalThis.$adzeGlobal?.configuration}updateConfiguration($){this.logCfg=$}get activeLevel(){return this.glblCfg?.activeLevel??this.logCfg.activeLevel??q8.activeLevel}set activeLevel($){this.logCfg.activeLevel=$}get cache(){return this.glblCfg?.cache??this.logCfg.cache??q8.cache}set cache($){this.logCfg.cache=$}get cacheSize(){return this.glblCfg?.cacheSize??this.logCfg.cacheSize??q8.cacheSize}set cacheSize($){this.logCfg.cacheSize=$}get dump(){return this.glblCfg?.dump??this.logCfg.dump??q8.dump}set dump($){this.logCfg.dump=$}get meta(){return{...this.logCfg.meta,...this.glblCfg?.meta}}set meta($){this.logCfg.meta=$}get silent(){return this.glblCfg?.silent??this.logCfg.silent??q8.silent}set silent($){this.logCfg.silent=$}get showTimestamp(){return this.glblCfg?.showTimestamp??this.logCfg.showTimestamp??q8.showTimestamp}set showTimestamp($){this.logCfg.showTimestamp=$}get withEmoji(){return this.glblCfg?.withEmoji??this.logCfg.withEmoji??q8.withEmoji}set withEmoji($){this.logCfg.withEmoji=$}get format(){return this.glblCfg?.format??this.logCfg.format??q8.format}set format($){this.logCfg.format=$}get levels(){return{...q8.levels,...this.logCfg.levels??{},...this.glblCfg?.levels??{}}}set levels($){this.logCfg.levels=$}get middleware(){return[...this.glblCfg?.middleware??[],...this.logCfg.middleware??[]]}set middleware($){this.logCfg.middleware=$}get filters(){return this.glblCfg?.filters??this.logCfg.filters}set filters($){this.logCfg.filters=$}get timestampFormatter(){return this.glblCfg?.timestampFormatter??this.logCfg.timestampFormatter}set timestampFormatter($){this.logCfg.timestampFormatter=$}get formatters(){return{...q8.formatters,...this.logCfg.formatters??{},...this.glblCfg?.formatters??{}}}set formatters($){this.logCfg.formatters=$}exportValues(){return{activeLevel:this.logCfg.activeLevel,cache:this.logCfg.cache,cacheSize:this.logCfg.cacheSize,dump:this.logCfg.dump,meta:this.logCfg.meta,silent:this.logCfg.silent,showTimestamp:this.logCfg.showTimestamp,withEmoji:this.logCfg.withEmoji,format:this.logCfg.format,levels:this.logCfg.levels,middleware:this.logCfg.middleware,filters:this.logCfg.filters,timestampFormatter:this.logCfg.timestampFormatter,formatters:this.logCfg.formatters}}}function Uc($){return typeof $==="function"}class u4{globalStore;_cfg;_modifierData;_data;modifierQueue=[];constructor($,q){this.globalStore=Mj($),this._modifierData=q??{},this._cfg=new L4($),this.doHook((K)=>{if(K.constructed)K.constructed(this)})}get data(){return this._data}get modifierData(){return this._modifierData}get configuration(){return this._cfg}alert(...$){this.terminate("alert",$)}static alert(...$){new this().alert(...$)}error(...$){this.terminate("error",$)}static error(...$){new this().error(...$)}warn(...$){this.terminate("warn",$)}static warn(...$){new this().warn(...$)}info(...$){this.terminate("info",$)}static info(...$){new this().info(...$)}fail(...$){this.terminate("fail",$)}static fail(...$){new this().fail(...$)}success(...$){this.terminate("success",$)}static success(...$){new this().success(...$)}log(...$){this.terminate("log",$)}static log($,...q){new this().log(...[$,...q])}debug(...$){this.terminate("debug",$)}static debug(...$){new this().debug(...$)}verbose(...$){this.terminate("verbose",$)}static verbose(...$){new this().verbose(...$)}clear(){console.clear()}static clear(){console.clear()}clr(){console.clear()}static clr(){console.clear()}custom($,...q){if(!this._cfg.levels[$])return console.warn(Error("Custom log level not found in configuration.")),this;return this.terminate($,q),this}static custom($,...q){return new this().custom($,...q)}seal($){if($)this._cfg.updateConfiguration($);return xW(u4,this._cfg,this.modifierData,this.modifierQueue)}static seal($){return new this().seal($)}sealTag($,q){return this._cfg=new L4({...this._cfg.exportValues(),...q}),(K,...P)=>{let _=String.raw({raw:K},...P),O=xW(u4,this._cfg,this.modifierData,this.modifierQueue),j=$;if(Uc(O[j]))O[j](_)}}static sealTag($,q){return new this().sealTag($,q)}thread($,q){if(this.runModifierQueue(),this._modifierData.label){if(!this._modifierData.label.context)this._modifierData.label.context={};this._modifierData.label.context={...this._modifierData.label.context,[$]:q}}}static thread($,q){new this().thread($,q)}assert($){return this.modifierQueue.push(["assert",(q)=>{return q.assertion=$,q}]),this}static assert($){return new this().assert($)}get closeThread(){return this.modifierQueue.push(["closeThread",($)=>{if($.label?.context)$.label.context=void 0;return $}]),this}static get closeThread(){return new this().closeThread}get count(){return this.modifierQueue.push(["count",($)=>{if($.label)$.label.count=$.label.count!==void 0?$.label.count+1:1;return $}]),this}static get count(){return new this().count}get countClear(){return this.modifierQueue.push(["countClear",($)=>{if($.label)delete $.label.count;return $}]),this}static get countClear(){return new this().countClear}get countReset(){return this.modifierQueue.push(["countReset",($)=>{if($.label)$.label.count=0;return $}]),this}static get countReset(){return new this().countReset}get dir(){return this.modifierQueue.push(["dir",($)=>{return $.method="dir",$}]),this}static get dir(){return new this().dir}get dirxml(){return this.modifierQueue.push(["dirxml",($)=>{return $.method="dirxml",$}]),this}static get dirxml(){return new this().dirxml}get dump(){return this.modifierQueue.push(["dump",($,q)=>{return q._cfg.dump=!0,$}]),this}static get dump(){return new this().dump}format($){return this.modifierQueue.push(["format",(q,K)=>{if(Object.keys(K._cfg.formatters).includes($))return K._cfg.format=$,q;return console.warn(Error(`Adze: Formatter "${$}" not found in configuration.`)),q}]),this}static format($){return new this().format($)}get group(){return this.modifierQueue.push(["group",($)=>{return $.method="group",$}]),this}static get group(){return new this().group}get groupCollapsed(){return this.modifierQueue.push(["groupCollapsed",($)=>{return $.method="groupCollapsed",$}]),this}static get groupCollapsed(){return new this().groupCollapsed}get groupEnd(){return this.modifierQueue.push(["groupEnd",($)=>{return $.method="groupEnd",$}]),this}static get groupEnd(){return new this().groupEnd}if($){return this.modifierQueue.push(["if",(q)=>{return q.if=$,q}]),this}static if($){return new this().if($)}test($){return this.if($)}static test($){return new this().if($)}label($){return this.modifierQueue.unshift(["label",(q)=>{let K=this.globalStore.getLabel($)??{name:$};return q.label=K,this.globalStore.setLabel($,K),q}]),this}static label($){return new this().label($)}meta($){return this.modifierQueue.push(["meta",(q,K)=>{return K._cfg.meta={...K._cfg.meta,...$},q}]),this}static meta($){return new this().meta($)}namespace(...$){return this.modifierQueue.push(["namespace",(q)=>{let K=q.namespace??[];return q.namespace=K.length>0?[...K,...$]:$,q}]),this}static namespace(...$){return new this().namespace(...$)}ns(...$){return this.namespace(...$)}static ns(...$){return new this().namespace(...$)}get silent(){return this.modifierQueue.push(["silent",($,q)=>{return q._cfg.silent=!0,$}]),this}static get silent(){return new this().silent}get table(){return this.modifierQueue.push(["table",($)=>{return $.method="table",$}]),this}static get table(){return new this().table}get time(){return this.modifierQueue.push(["time",($)=>{let q=Ij();if($.label)$.label.timeStart=q;return $}]),this}static get time(){return new this().time}get timeEnd(){return this.modifierQueue.push(["timeEnd",($)=>{if($.label?.timeStart)$.label.timeElapsed=cW(Ij($.label.timeStart));return $}]),this}static get timeEnd(){return new this().timeEnd}get timeNow(){return this.modifierQueue.push(["timeNow",($)=>{return $.timeNow=HV(),$}]),this}static get timeNow(){return new this().timeNow}get timestamp(){return this.modifierQueue.push(["timestamp",($,q)=>{return q._cfg.showTimestamp=!0,$}]),this}static get timestamp(){return new this().timestamp}get trace(){return this.modifierQueue.push(["trace",($)=>{return $.stacktrace=_V(),$}]),this}static get trace(){return new this().trace}get withEmoji(){return this.modifierQueue.push(["withEmoji",($,q)=>{return q._cfg.withEmoji=!0,$}]),this}static get withEmoji(){return new this().withEmoji}print($){if(QG())return;if($.silent)return;if($.message.length<1)return;if(Nj($.method))console[$.method](...$.message);else console[$.method]()}terminate($,q){this.doHook((I)=>{if(I.beforeTerminated)I.beforeTerminated(this,$,q)}),this.runModifierQueue();let K=this.getLevelConfig($),_=new(this.selectFormatter(this._cfg.format))(this._cfg,K),O=_.timestampFormatter(new Date),j=vV(_.print(this.modifierData,O,q));if(this._cfg.dump&&this.modifierData.label?.context)j.push(this.modifierData.label.context);this.doHook((I)=>{if(I.beforeFormatApplied)j=I.beforeFormatApplied(this,this._cfg.format,j)});let{activeLevel:z,cache:J,cacheSize:w,dump:G,format:f,meta:A,showTimestamp:V,silent:C,withEmoji:E}=this._cfg,R={activeLevel:z,cache:J,cacheSize:w,dump:G,format:f,meta:A,showTimestamp:V,silent:C,withEmoji:E,...K,...this._modifierData,terminator:$,args:q,timestamp:O,message:j};if(this.doHook((I)=>{if(I.afterFormatApplied)I.afterFormatApplied(this,this._cfg.format,j)}),this._data=R,this._cfg.cache)this.globalStore.addLogToCache(this);this.doHook((I)=>{if(I.beforePrint)I.beforePrint(this)}),this.print(this._data),this.doHook((I)=>{if(I.afterTerminated)I.afterTerminated(this,$,q)}),this.globalStore.getListeners(K.level).forEach((I)=>{I(this)})}selectFormatter($){return this._cfg.formatters[$]}getLevelConfig($){return this._cfg.levels[$]}runModifierQueue(){this.modifierQueue.forEach(([$,q])=>{let K=q(this.modifierData,this);this.doHook((P)=>{if(P.beforeModifierApplied)P.beforeModifierApplied(this,$,K)}),this._modifierData=K,this.doHook((P)=>{if(P.afterModifierApplied)P.afterModifierApplied(this,$,K)})})}doHook($){this._cfg.middleware?.forEach((q)=>{$(q)})}}class Fc{targetEnvironment;environment=TK()?"browser":"server";dependencyLoaders=[];constructor($){if(this.targetEnvironment=$??"both",!TK()&&(this.targetEnvironment==="server"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadServerDependencies());if(TK()&&(this.targetEnvironment==="browser"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadBrowserDependencies())}async load(){await Promise.all(this.dependencyLoaders)}async loadServerDependencies(){}async loadBrowserDependencies(){}}var ac=["black","red","green","yellow","blue","magenta","cyan","white","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","reset","bold","dim","italic","underline","inverse","hidden","strikethrough"],fV=Object.freeze(ac);var kV=u4;var Y_$={__noop:()=>{}},bj={trace:10,verbose:10,debug:20,success:27,progress:28,log:29,info:30,warn:40,error:50,fatal:60,alert:60},Jm={10:"trace",20:"debug",27:"success",28:"progress",29:"log",30:"info",40:"warn",50:"error",60:"fatal"};function MV($,q){let K=bj[$.toLowerCase()]||30,P=bj[q.toLowerCase()]||30;return K>=P}function dW($){try{let q=new WeakSet;return JSON.stringify($,(K,P)=>{if(typeof P==="object"&&P!==null){if(q.has(P))return"[Circular]";q.add(P)}return P})}catch{return String($)}}function NV($){if(!$)return!1;let q=$.toLowerCase().trim();return q==="true"||q==="1"||q==="yes"||q==="on"}var Tm="info",uj=xK("LOG_LEVEL")||Tm,W_$={fatal:60,error:50,warn:40,info:30,log:29,progress:28,success:27,debug:20,trace:10},lW=NV(xK("LOG_JSON_FORMAT")),oW=NV(xK("LOG_TIMESTAMPS")??"true");function wm($=100){let q=[];return{write(K){if(q.push(K),q.length>$)q.shift()},clear(){q.length=0},recentLogs(){return q.map((K)=>{let P=oW?new Date(K.time).toISOString():"",_=Jm[K.level??30]||"info";return`${P} ${_} ${K.msg}`.trim()}).join(`
|
|
332
|
-
`)}}}var R7=wm(),CV=()=>{let $=uj.toLowerCase();if($==="trace")return"verbose";if($==="debug")return"debug";if($==="log")return"log";if($==="info")return"info";if($==="warn")return"warn";if($==="error")return"error";if($==="fatal")return"alert";return"info"},Zm=CV(),EV={alert:{levelName:"alert",level:0,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","white","bold"],method:"error",emoji:""},error:{levelName:"error",level:1,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","whiteBright","bold"],method:"error",emoji:""},warn:{levelName:"warn",level:2,style:"font-size: 12px; color: #ffaa00;",terminalStyle:["bgYellow","black","bold"],method:"warn",emoji:""},info:{levelName:"info",level:3,style:"font-size: 12px; color: #0099ff;",terminalStyle:["cyan"],method:"info",emoji:""},fail:{levelName:"fail",level:4,style:"font-size: 12px; color: #ff6600;",terminalStyle:["red","underline"],method:"error",emoji:""},success:{levelName:"success",level:5,style:"font-size: 12px; color: #00cc00;",terminalStyle:["green"],method:"log",emoji:""},log:{levelName:"log",level:6,style:"font-size: 12px; color: #888888;",terminalStyle:["white"],method:"log",emoji:""},debug:{levelName:"debug",level:7,style:"font-size: 12px; color: #9b59b6;",terminalStyle:["gray","dim"],method:"debug",emoji:""},verbose:{levelName:"verbose",level:8,style:"font-size: 12px; color: #666666;",terminalStyle:["gray","dim","italic"],method:"debug",emoji:""}},Xm=wW({activeLevel:Zm,format:lW?"json":"pretty",timestampFormatter:oW?void 0:()=>"",withEmoji:!1,levels:EV});Xm.addListener("*",($)=>{try{let q=$.data,K=Array.isArray(q?.message)?q.message.map((_)=>typeof _==="string"?_:dW(_)).join(" "):typeof q?.message==="string"?q.message:"",P={time:Date.now(),level:typeof q?.level==="number"?q.level:void 0,msg:K};R7.write(P)}catch{}});function fm($){let q=kV,K=[];if(typeof $.namespace==="string")K.push($.namespace);if(Array.isArray($.namespaces))K.push(...$.namespaces);if(K.length>0)q=q.ns(...K);let P={...$};if(delete P.namespace,delete P.namespaces,lW){if(!P.name)P.name="elizaos";if(!P.hostname){let O="unknown";if(typeof process<"u"&&process.platform)try{O=(SV(),w6(VV)).hostname()}catch{O="localhost"}else if(typeof window<"u"&&window.location)O=window.location.hostname||"browser";P.hostname=O}}let _={activeLevel:CV(),format:lW?"json":"pretty",timestampFormatter:oW?void 0:()=>"",withEmoji:!1,levels:EV};return q.meta(P).seal(_)}function km($){let q=uj,K={},P;if(typeof $==="object"&&$!==null){if("level"in $)q=$.level;if("maxMemoryLogs"in $&&typeof $.maxMemoryLogs==="number")P=$.maxMemoryLogs;let{level:_,maxMemoryLogs:O,...j}=$;K=j}return{level:q,base:K,maxMemoryLogs:P}}function I7($=!1){let{level:q,base:K,maxMemoryLogs:P}=km($);if(typeof P==="number"&&P>0)R7.clear();if(typeof $==="object"&&$&&"__forceType"in $&&$.__forceType==="browser"){let m=(typeof q==="number"?"info":q||uj).toLowerCase(),q$=(...r)=>{return r.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return dW(M)}).join(" ")},e=(r,...M)=>{if(!MV(r,m))return;let Y=q$(...M),H=r==="fatal"?"error":r==="trace"||r==="verbose"?"debug":r==="success"||r==="progress"?"info":r==="log"?"log":console[r]?r:"log";if(typeof console[H]==="function")console[H](Y)},l=(r,M,...Y)=>{if(typeof r==="string")return M!==void 0?[r,M,...Y]:[r,...Y];if(r instanceof Error)return M!==void 0?[r.message,M,...Y]:[r.message,...Y];if(M!==void 0)return[M,r,...Y];return[r,...Y]};return{level:m,trace:(r,M,...Y)=>e("trace",...l(r,M,...Y)),debug:(r,M,...Y)=>e("debug",...l(r,M,...Y)),info:(r,M,...Y)=>e("info",...l(r,M,...Y)),warn:(r,M,...Y)=>e("warn",...l(r,M,...Y)),error:(r,M,...Y)=>e("error",...l(r,M,...Y)),fatal:(r,M,...Y)=>e("fatal",...l(r,M,...Y)),success:(r,M,...Y)=>e("success",...l(r,M,...Y)),progress:(r,M,...Y)=>e("progress",...l(r,M,...Y)),log:(r,M,...Y)=>e("log",...l(r,M,...Y)),clear:()=>{if(typeof console.clear==="function")console.clear()},child:(r)=>I7({level:m,...K,...r,__forceType:"browser"})}}let O=fm(K),z=(typeof q==="number"?"info":q||uj).toLowerCase(),J=(c,m)=>{},w=(c,...m)=>{if(!MV(c,z))return;J(c,m);try{let l="";if(m.length>0)l=m.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return dW(M)}).join(" ");if(K.namespace)l=`#${K.namespace} ${l}`;let r={time:Date.now(),level:bj[c.toLowerCase()]||bj.info,msg:l};R7.write(r)}catch{}let q$=c,e=m;if(c==="fatal")q$="alert";else if(c==="progress")q$="info",e=["[PROGRESS]",...m];else if(c==="success")q$="info",e=["[SUCCESS]",...m];else if(c==="trace")q$="verbose";try{O[q$](...e)}catch(l){console.log(`[${c.toUpperCase()}]`,...m)}},G=(c,m,...q$)=>{if(typeof c==="string")return m!==void 0?[c,m,...q$]:[c,...q$];if(c instanceof Error)return m!==void 0?[c.message,{error:c},m,...q$]:[c.message,{error:c},...q$];if(m!==void 0)return[m,c,...q$];return[c,...q$]};return{level:z,trace:(c,m,...q$)=>w("verbose",...G(c,m,...q$)),debug:(c,m,...q$)=>w("debug",...G(c,m,...q$)),info:(c,m,...q$)=>w("info",...G(c,m,...q$)),warn:(c,m,...q$)=>w("warn",...G(c,m,...q$)),error:(c,m,...q$)=>w("error",...G(c,m,...q$)),fatal:(c,m,...q$)=>w("fatal",...G(c,m,...q$)),success:(c,m,...q$)=>w("success",...G(c,m,...q$)),progress:(c,m,...q$)=>w("progress",...G(c,m,...q$)),log:(c,m,...q$)=>w("log",...G(c,m,...q$)),clear:()=>{try{if(typeof console?.clear==="function")console.clear()}catch{}R7.clear()},child:(c)=>{return I7({level:z,...K,...c})}}}var c6=I7(),
|
|
330
|
+
Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let $=this.seed;return this.dictionaries.slice(0,this.length).reduce((q,K)=>{let P;$?(P=((O)=>{if(typeof O=="string"){let j=O.split("").map((J)=>J.charCodeAt(0)).reduce((J,w)=>J+w,1),z=Math.floor(Number(j));return dG(z)}return dG(O)})($),$=4294967296*P):P=Math.random();let _=K[Math.floor(P*K.length)]||"";if(this.style==="lowerCase")_=_.toLowerCase();else if(this.style==="capital"){let[O,...j]=_.split("");_=O.toUpperCase()+j.join("")}else this.style==="upperCase"&&(_=_.toUpperCase());return q?`${q}${this.separator}${_}`:`${_}`},"")}}var lG={separator:"_",dictionaries:[]},Gj=($)=>{let q=[...$&&$.dictionaries||lG.dictionaries],K={...lG,...$,length:$&&$.length||q.length,dictionaries:q};if(!$||!$.dictionaries||!$.dictionaries.length)throw Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new oG(K).generate()};var Vj=["Aaren","Aarika","Abagael","Abagail","Abbe","Abbey","Abbi","Abbie","Abby","Abbye","Abigael","Abigail","Abigale","Abra","Ada","Adah","Adaline","Adan","Adara","Adda","Addi","Addia","Addie","Addy","Adel","Adela","Adelaida","Adelaide","Adele","Adelheid","Adelice","Adelina","Adelind","Adeline","Adella","Adelle","Adena","Adey","Adi","Adiana","Adina","Adora","Adore","Adoree","Adorne","Adrea","Adria","Adriaens","Adrian","Adriana","Adriane","Adrianna","Adrianne","Adriena","Adrienne","Aeriel","Aeriela","Aeriell","Afton","Ag","Agace","Agata","Agatha","Agathe","Aggi","Aggie","Aggy","Agna","Agnella","Agnes","Agnese","Agnesse","Agneta","Agnola","Agretha","Aida","Aidan","Aigneis","Aila","Aile","Ailee","Aileen","Ailene","Ailey","Aili","Ailina","Ailis","Ailsun","Ailyn","Aime","Aimee","Aimil","Aindrea","Ainslee","Ainsley","Ainslie","Ajay","Alaine","Alameda","Alana","Alanah","Alane","Alanna","Alayne","Alberta","Albertina","Albertine","Albina","Alecia","Aleda","Aleece","Aleen","Alejandra","Alejandrina","Alena","Alene","Alessandra","Aleta","Alethea","Alex","Alexa","Alexandra","Alexandrina","Alexi","Alexia","Alexina","Alexine","Alexis","Alfi","Alfie","Alfreda","Alfy","Ali","Alia","Alica","Alice","Alicea","Alicia","Alida","Alidia","Alie","Alika","Alikee","Alina","Aline","Alis","Alisa","Alisha","Alison","Alissa","Alisun","Alix","Aliza","Alla","Alleen","Allegra","Allene","Alli","Allianora","Allie","Allina","Allis","Allison","Allissa","Allix","Allsun","Allx","Ally","Allyce","Allyn","Allys","Allyson","Alma","Almeda","Almeria","Almeta","Almira","Almire","Aloise","Aloisia","Aloysia","Alta","Althea","Alvera","Alverta","Alvina","Alvinia","Alvira","Alyce","Alyda","Alys","Alysa","Alyse","Alysia","Alyson","Alyss","Alyssa","Amabel","Amabelle","Amalea","Amalee","Amaleta","Amalia","Amalie","Amalita","Amalle","Amanda","Amandi","Amandie","Amandy","Amara","Amargo","Amata","Amber","Amberly","Ambur","Ame","Amelia","Amelie","Amelina","Ameline","Amelita","Ami","Amie","Amii","Amil","Amitie","Amity","Ammamaria","Amy","Amye","Ana","Anabal","Anabel","Anabella","Anabelle","Analiese","Analise","Anallese","Anallise","Anastasia","Anastasie","Anastassia","Anatola","Andee","Andeee","Anderea","Andi","Andie","Andra","Andrea","Andreana","Andree","Andrei","Andria","Andriana","Andriette","Andromache","Andy","Anestassia","Anet","Anett","Anetta","Anette","Ange","Angel","Angela","Angele","Angelia","Angelica","Angelika","Angelina","Angeline","Angelique","Angelita","Angelle","Angie","Angil","Angy","Ania","Anica","Anissa","Anita","Anitra","Anjanette","Anjela","Ann","Ann-marie","Anna","Anna-diana","Anna-diane","Anna-maria","Annabal","Annabel","Annabela","Annabell","Annabella","Annabelle","Annadiana","Annadiane","Annalee","Annaliese","Annalise","Annamaria","Annamarie","Anne","Anne-corinne","Anne-marie","Annecorinne","Anneliese","Annelise","Annemarie","Annetta","Annette","Anni","Annice","Annie","Annis","Annissa","Annmaria","Annmarie","Annnora","Annora","Anny","Anselma","Ansley","Anstice","Anthe","Anthea","Anthia","Anthiathia","Antoinette","Antonella","Antonetta","Antonia","Antonie","Antonietta","Antonina","Anya","Appolonia","April","Aprilette","Ara","Arabel","Arabela","Arabele","Arabella","Arabelle","Arda","Ardath","Ardeen","Ardelia","Ardelis","Ardella","Ardelle","Arden","Ardene","Ardenia","Ardine","Ardis","Ardisj","Ardith","Ardra","Ardyce","Ardys","Ardyth","Aretha","Ariadne","Ariana","Aridatha","Ariel","Ariela","Ariella","Arielle","Arlana","Arlee","Arleen","Arlen","Arlena","Arlene","Arleta","Arlette","Arleyne","Arlie","Arliene","Arlina","Arlinda","Arline","Arluene","Arly","Arlyn","Arlyne","Aryn","Ashely","Ashia","Ashien","Ashil","Ashla","Ashlan","Ashlee","Ashleigh","Ashlen","Ashley","Ashli","Ashlie","Ashly","Asia","Astra","Astrid","Astrix","Atalanta","Athena","Athene","Atlanta","Atlante","Auberta","Aubine","Aubree","Aubrette","Aubrey","Aubrie","Aubry","Audi","Audie","Audra","Audre","Audrey","Audrie","Audry","Audrye","Audy","Augusta","Auguste","Augustina","Augustine","Aundrea","Aura","Aurea","Aurel","Aurelea","Aurelia","Aurelie","Auria","Aurie","Aurilia","Aurlie","Auroora","Aurora","Aurore","Austin","Austina","Austine","Ava","Aveline","Averil","Averyl","Avie","Avis","Aviva","Avivah","Avril","Avrit","Ayn","Bab","Babara","Babb","Babbette","Babbie","Babette","Babita","Babs","Bambi","Bambie","Bamby","Barb","Barbabra","Barbara","Barbara-anne","Barbaraanne","Barbe","Barbee","Barbette","Barbey","Barbi","Barbie","Barbra","Barby","Bari","Barrie","Barry","Basia","Bathsheba","Batsheva","Bea","Beatrice","Beatrisa","Beatrix","Beatriz","Bebe","Becca","Becka","Becki","Beckie","Becky","Bee","Beilul","Beitris","Bekki","Bel","Belia","Belicia","Belinda","Belita","Bell","Bella","Bellanca","Belle","Bellina","Belva","Belvia","Bendite","Benedetta","Benedicta","Benedikta","Benetta","Benita","Benni","Bennie","Benny","Benoite","Berenice","Beret","Berget","Berna","Bernadene","Bernadette","Bernadina","Bernadine","Bernardina","Bernardine","Bernelle","Bernete","Bernetta","Bernette","Berni","Bernice","Bernie","Bernita","Berny","Berri","Berrie","Berry","Bert","Berta","Berte","Bertha","Berthe","Berti","Bertie","Bertina","Bertine","Berty","Beryl","Beryle","Bess","Bessie","Bessy","Beth","Bethanne","Bethany","Bethena","Bethina","Betsey","Betsy","Betta","Bette","Bette-ann","Betteann","Betteanne","Betti","Bettina","Bettine","Betty","Bettye","Beulah","Bev","Beverie","Beverlee","Beverley","Beverlie","Beverly","Bevvy","Bianca","Bianka","Bibbie","Bibby","Bibbye","Bibi","Biddie","Biddy","Bidget","Bili","Bill","Billi","Billie","Billy","Billye","Binni","Binnie","Binny","Bird","Birdie","Birgit","Birgitta","Blair","Blaire","Blake","Blakelee","Blakeley","Blanca","Blanch","Blancha","Blanche","Blinni","Blinnie","Blinny","Bliss","Blisse","Blithe","Blondell","Blondelle","Blondie","Blondy","Blythe","Bobbe","Bobbee","Bobbette","Bobbi","Bobbie","Bobby","Bobbye","Bobette","Bobina","Bobine","Bobinette","Bonita","Bonnee","Bonni","Bonnibelle","Bonnie","Bonny","Brana","Brandais","Brande","Brandea","Brandi","Brandice","Brandie","Brandise","Brandy","Breanne","Brear","Bree","Breena","Bren","Brena","Brenda","Brenn","Brenna","Brett","Bria","Briana","Brianna","Brianne","Bride","Bridget","Bridgette","Bridie","Brier","Brietta","Brigid","Brigida","Brigit","Brigitta","Brigitte","Brina","Briney","Brinn","Brinna","Briny","Brit","Brita","Britney","Britni","Britt","Britta","Brittan","Brittaney","Brittani","Brittany","Britte","Britteny","Brittne","Brittney","Brittni","Brook","Brooke","Brooks","Brunhilda","Brunhilde","Bryana","Bryn","Bryna","Brynn","Brynna","Brynne","Buffy","Bunni","Bunnie","Bunny","Cacilia","Cacilie","Cahra","Cairistiona","Caitlin","Caitrin","Cal","Calida","Calla","Calley","Calli","Callida","Callie","Cally","Calypso","Cam","Camala","Camel","Camella","Camellia","Cami","Camila","Camile","Camilla","Camille","Cammi","Cammie","Cammy","Candace","Candi","Candice","Candida","Candide","Candie","Candis","Candra","Candy","Caprice","Cara","Caralie","Caren","Carena","Caresa","Caressa","Caresse","Carey","Cari","Caria","Carie","Caril","Carilyn","Carin","Carina","Carine","Cariotta","Carissa","Carita","Caritta","Carla","Carlee","Carleen","Carlen","Carlene","Carley","Carlie","Carlin","Carlina","Carline","Carlita","Carlota","Carlotta","Carly","Carlye","Carlyn","Carlynn","Carlynne","Carma","Carmel","Carmela","Carmelia","Carmelina","Carmelita","Carmella","Carmelle","Carmen","Carmencita","Carmina","Carmine","Carmita","Carmon","Caro","Carol","Carol-jean","Carola","Carolan","Carolann","Carole","Carolee","Carolin","Carolina","Caroline","Caroljean","Carolyn","Carolyne","Carolynn","Caron","Carree","Carri","Carrie","Carrissa","Carroll","Carry","Cary","Caryl","Caryn","Casandra","Casey","Casi","Casie","Cass","Cassandra","Cassandre","Cassandry","Cassaundra","Cassey","Cassi","Cassie","Cassondra","Cassy","Catarina","Cate","Caterina","Catha","Catharina","Catharine","Cathe","Cathee","Catherin","Catherina","Catherine","Cathi","Cathie","Cathleen","Cathlene","Cathrin","Cathrine","Cathryn","Cathy","Cathyleen","Cati","Catie","Catina","Catlaina","Catlee","Catlin","Catrina","Catriona","Caty","Caye","Cayla","Cecelia","Cecil","Cecile","Ceciley","Cecilia","Cecilla","Cecily","Ceil","Cele","Celene","Celesta","Celeste","Celestia","Celestina","Celestine","Celestyn","Celestyna","Celia","Celie","Celina","Celinda","Celine","Celinka","Celisse","Celka","Celle","Cesya","Chad","Chanda","Chandal","Chandra","Channa","Chantal","Chantalle","Charil","Charin","Charis","Charissa","Charisse","Charita","Charity","Charla","Charlean","Charleen","Charlena","Charlene","Charline","Charlot","Charlotta","Charlotte","Charmain","Charmaine","Charmane","Charmian","Charmine","Charmion","Charo","Charyl","Chastity","Chelsae","Chelsea","Chelsey","Chelsie","Chelsy","Cher","Chere","Cherey","Cheri","Cherianne","Cherice","Cherida","Cherie","Cherilyn","Cherilynn","Cherin","Cherise","Cherish","Cherlyn","Cherri","Cherrita","Cherry","Chery","Cherye","Cheryl","Cheslie","Chiarra","Chickie","Chicky","Chiquia","Chiquita","Chlo","Chloe","Chloette","Chloris","Chris","Chrissie","Chrissy","Christa","Christabel","Christabella","Christal","Christalle","Christan","Christean","Christel","Christen","Christi","Christian","Christiana","Christiane","Christie","Christin","Christina","Christine","Christy","Christye","Christyna","Chrysa","Chrysler","Chrystal","Chryste","Chrystel","Cicely","Cicily","Ciel","Cilka","Cinda","Cindee","Cindelyn","Cinderella","Cindi","Cindie","Cindra","Cindy","Cinnamon","Cissiee","Cissy","Clair","Claire","Clara","Clarabelle","Clare","Claresta","Clareta","Claretta","Clarette","Clarey","Clari","Claribel","Clarice","Clarie","Clarinda","Clarine","Clarissa","Clarisse","Clarita","Clary","Claude","Claudelle","Claudetta","Claudette","Claudia","Claudie","Claudina","Claudine","Clea","Clem","Clemence","Clementia","Clementina","Clementine","Clemmie","Clemmy","Cleo","Cleopatra","Clerissa","Clio","Clo","Cloe","Cloris","Clotilda","Clovis","Codee","Codi","Codie","Cody","Coleen","Colene","Coletta","Colette","Colleen","Collen","Collete","Collette","Collie","Colline","Colly","Con","Concettina","Conchita","Concordia","Conni","Connie","Conny","Consolata","Constance","Constancia","Constancy","Constanta","Constantia","Constantina","Constantine","Consuela","Consuelo","Cookie","Cora","Corabel","Corabella","Corabelle","Coral","Coralie","Coraline","Coralyn","Cordelia","Cordelie","Cordey","Cordi","Cordie","Cordula","Cordy","Coreen","Corella","Corenda","Corene","Coretta","Corette","Corey","Cori","Corie","Corilla","Corina","Corine","Corinna","Corinne","Coriss","Corissa","Corliss","Corly","Cornela","Cornelia","Cornelle","Cornie","Corny","Correna","Correy","Corri","Corrianne","Corrie","Corrina","Corrine","Corrinne","Corry","Cortney","Cory","Cosetta","Cosette","Costanza","Courtenay","Courtnay","Courtney","Crin","Cris","Crissie","Crissy","Crista","Cristabel","Cristal","Cristen","Cristi","Cristie","Cristin","Cristina","Cristine","Cristionna","Cristy","Crysta","Crystal","Crystie","Cthrine","Cyb","Cybil","Cybill","Cymbre","Cynde","Cyndi","Cyndia","Cyndie","Cyndy","Cynthea","Cynthia","Cynthie","Cynthy","Dacey","Dacia","Dacie","Dacy","Dael","Daffi","Daffie","Daffy","Dagmar","Dahlia","Daile","Daisey","Daisi","Daisie","Daisy","Dale","Dalenna","Dalia","Dalila","Dallas","Daloris","Damara","Damaris","Damita","Dana","Danell","Danella","Danette","Dani","Dania","Danica","Danice","Daniela","Daniele","Daniella","Danielle","Danika","Danila","Danit","Danita","Danna","Danni","Dannie","Danny","Dannye","Danya","Danyelle","Danyette","Daphene","Daphna","Daphne","Dara","Darb","Darbie","Darby","Darcee","Darcey","Darci","Darcie","Darcy","Darda","Dareen","Darell","Darelle","Dari","Daria","Darice","Darla","Darleen","Darlene","Darline","Darlleen","Daron","Darrelle","Darryl","Darsey","Darsie","Darya","Daryl","Daryn","Dasha","Dasi","Dasie","Dasya","Datha","Daune","Daveen","Daveta","Davida","Davina","Davine","Davita","Dawn","Dawna","Dayle","Dayna","Ddene","De","Deana","Deane","Deanna","Deanne","Deb","Debbi","Debbie","Debby","Debee","Debera","Debi","Debor","Debora","Deborah","Debra","Dede","Dedie","Dedra","Dee","Deeann","Deeanne","Deedee","Deena","Deerdre","Deeyn","Dehlia","Deidre","Deina","Deirdre","Del","Dela","Delcina","Delcine","Delia","Delila","Delilah","Delinda","Dell","Della","Delly","Delora","Delores","Deloria","Deloris","Delphine","Delphinia","Demeter","Demetra","Demetria","Demetris","Dena","Deni","Denice","Denise","Denna","Denni","Dennie","Denny","Deny","Denys","Denyse","Deonne","Desdemona","Desirae","Desiree","Desiri","Deva","Devan","Devi","Devin","Devina","Devinne","Devon","Devondra","Devonna","Devonne","Devora","Di","Diahann","Dian","Diana","Diandra","Diane","Diane-marie","Dianemarie","Diann","Dianna","Dianne","Diannne","Didi","Dido","Diena","Dierdre","Dina","Dinah","Dinnie","Dinny","Dion","Dione","Dionis","Dionne","Dita","Dix","Dixie","Dniren","Dode","Dodi","Dodie","Dody","Doe","Doll","Dolley","Dolli","Dollie","Dolly","Dolores","Dolorita","Doloritas","Domeniga","Dominga","Domini","Dominica","Dominique","Dona","Donella","Donelle","Donetta","Donia","Donica","Donielle","Donna","Donnamarie","Donni","Donnie","Donny","Dora","Doralia","Doralin","Doralyn","Doralynn","Doralynne","Dore","Doreen","Dorelia","Dorella","Dorelle","Dorena","Dorene","Doretta","Dorette","Dorey","Dori","Doria","Dorian","Dorice","Dorie","Dorine","Doris","Dorisa","Dorise","Dorita","Doro","Dorolice","Dorolisa","Dorotea","Doroteya","Dorothea","Dorothee","Dorothy","Dorree","Dorri","Dorrie","Dorris","Dorry","Dorthea","Dorthy","Dory","Dosi","Dot","Doti","Dotti","Dottie","Dotty","Dre","Dreddy","Dredi","Drona","Dru","Druci","Drucie","Drucill","Drucy","Drusi","Drusie","Drusilla","Drusy","Dulce","Dulcea","Dulci","Dulcia","Dulciana","Dulcie","Dulcine","Dulcinea","Dulcy","Dulsea","Dusty","Dyan","Dyana","Dyane","Dyann","Dyanna","Dyanne","Dyna","Dynah","Eachelle","Eada","Eadie","Eadith","Ealasaid","Eartha","Easter","Eba","Ebba","Ebonee","Ebony","Eda","Eddi","Eddie","Eddy","Ede","Edee","Edeline","Eden","Edi","Edie","Edin","Edita","Edith","Editha","Edithe","Ediva","Edna","Edwina","Edy","Edyth","Edythe","Effie","Eileen","Eilis","Eimile","Eirena","Ekaterina","Elaina","Elaine","Elana","Elane","Elayne","Elberta","Elbertina","Elbertine","Eleanor","Eleanora","Eleanore","Electra","Eleen","Elena","Elene","Eleni","Elenore","Eleonora","Eleonore","Elfie","Elfreda","Elfrida","Elfrieda","Elga","Elianora","Elianore","Elicia","Elie","Elinor","Elinore","Elisa","Elisabet","Elisabeth","Elisabetta","Elise","Elisha","Elissa","Elita","Eliza","Elizabet","Elizabeth","Elka","Elke","Ella","Elladine","Elle","Ellen","Ellene","Ellette","Elli","Ellie","Ellissa","Elly","Ellyn","Ellynn","Elmira","Elna","Elnora","Elnore","Eloisa","Eloise","Elonore","Elora","Elsa","Elsbeth","Else","Elset","Elsey","Elsi","Elsie","Elsinore","Elspeth","Elsy","Elva","Elvera","Elvina","Elvira","Elwira","Elyn","Elyse","Elysee","Elysha","Elysia","Elyssa","Em","Ema","Emalee","Emalia","Emelda","Emelia","Emelina","Emeline","Emelita","Emelyne","Emera","Emilee","Emili","Emilia","Emilie","Emiline","Emily","Emlyn","Emlynn","Emlynne","Emma","Emmalee","Emmaline","Emmalyn","Emmalynn","Emmalynne","Emmeline","Emmey","Emmi","Emmie","Emmy","Emmye","Emogene","Emyle","Emylee","Engracia","Enid","Enrica","Enrichetta","Enrika","Enriqueta","Eolanda","Eolande","Eran","Erda","Erena","Erica","Ericha","Ericka","Erika","Erin","Erina","Erinn","Erinna","Erma","Ermengarde","Ermentrude","Ermina","Erminia","Erminie","Erna","Ernaline","Ernesta","Ernestine","Ertha","Eryn","Esma","Esmaria","Esme","Esmeralda","Essa","Essie","Essy","Esta","Estel","Estele","Estell","Estella","Estelle","Ester","Esther","Estrella","Estrellita","Ethel","Ethelda","Ethelin","Ethelind","Etheline","Ethelyn","Ethyl","Etta","Etti","Ettie","Etty","Eudora","Eugenia","Eugenie","Eugine","Eula","Eulalie","Eunice","Euphemia","Eustacia","Eva","Evaleen","Evangelia","Evangelin","Evangelina","Evangeline","Evania","Evanne","Eve","Eveleen","Evelina","Eveline","Evelyn","Evey","Evie","Evita","Evonne","Evvie","Evvy","Evy","Eyde","Eydie","Ezmeralda","Fae","Faina","Faith","Fallon","Fan","Fanchette","Fanchon","Fancie","Fancy","Fanechka","Fania","Fanni","Fannie","Fanny","Fanya","Fara","Farah","Farand","Farica","Farra","Farrah","Farrand","Faun","Faunie","Faustina","Faustine","Fawn","Fawne","Fawnia","Fay","Faydra","Faye","Fayette","Fayina","Fayre","Fayth","Faythe","Federica","Fedora","Felecia","Felicdad","Felice","Felicia","Felicity","Felicle","Felipa","Felisha","Felita","Feliza","Fenelia","Feodora","Ferdinanda","Ferdinande","Fern","Fernanda","Fernande","Fernandina","Ferne","Fey","Fiann","Fianna","Fidela","Fidelia","Fidelity","Fifi","Fifine","Filia","Filide","Filippa","Fina","Fiona","Fionna","Fionnula","Fiorenze","Fleur","Fleurette","Flo","Flor","Flora","Florance","Flore","Florella","Florence","Florencia","Florentia","Florenza","Florette","Flori","Floria","Florida","Florie","Florina","Florinda","Floris","Florri","Florrie","Florry","Flory","Flossi","Flossie","Flossy","Flss","Fran","Francene","Frances","Francesca","Francine","Francisca","Franciska","Francoise","Francyne","Frank","Frankie","Franky","Franni","Frannie","Franny","Frayda","Fred","Freda","Freddi","Freddie","Freddy","Fredelia","Frederica","Fredericka","Frederique","Fredi","Fredia","Fredra","Fredrika","Freida","Frieda","Friederike","Fulvia","Gabbey","Gabbi","Gabbie","Gabey","Gabi","Gabie","Gabriel","Gabriela","Gabriell","Gabriella","Gabrielle","Gabriellia","Gabrila","Gaby","Gae","Gael","Gail","Gale","Galina","Garland","Garnet","Garnette","Gates","Gavra","Gavrielle","Gay","Gaye","Gayel","Gayla","Gayle","Gayleen","Gaylene","Gaynor","Gelya","Gena","Gene","Geneva","Genevieve","Genevra","Genia","Genna","Genni","Gennie","Gennifer","Genny","Genovera","Genvieve","George","Georgeanna","Georgeanne","Georgena","Georgeta","Georgetta","Georgette","Georgia","Georgiana","Georgianna","Georgianne","Georgie","Georgina","Georgine","Geralda","Geraldine","Gerda","Gerhardine","Geri","Gerianna","Gerianne","Gerladina","Germain","Germaine","Germana","Gerri","Gerrie","Gerrilee","Gerry","Gert","Gerta","Gerti","Gertie","Gertrud","Gertruda","Gertrude","Gertrudis","Gerty","Giacinta","Giana","Gianina","Gianna","Gigi","Gilberta","Gilberte","Gilbertina","Gilbertine","Gilda","Gilemette","Gill","Gillan","Gilli","Gillian","Gillie","Gilligan","Gilly","Gina","Ginelle","Ginevra","Ginger","Ginni","Ginnie","Ginnifer","Ginny","Giorgia","Giovanna","Gipsy","Giralda","Gisela","Gisele","Gisella","Giselle","Giuditta","Giulia","Giulietta","Giustina","Gizela","Glad","Gladi","Gladys","Gleda","Glen","Glenda","Glenine","Glenn","Glenna","Glennie","Glennis","Glori","Gloria","Gloriana","Gloriane","Glory","Glyn","Glynda","Glynis","Glynnis","Gnni","Godiva","Golda","Goldarina","Goldi","Goldia","Goldie","Goldina","Goldy","Grace","Gracia","Gracie","Grata","Gratia","Gratiana","Gray","Grayce","Grazia","Greer","Greta","Gretal","Gretchen","Grete","Gretel","Grethel","Gretna","Gretta","Grier","Griselda","Grissel","Guendolen","Guenevere","Guenna","Guglielma","Gui","Guillema","Guillemette","Guinevere","Guinna","Gunilla","Gus","Gusella","Gussi","Gussie","Gussy","Gusta","Gusti","Gustie","Gusty","Gwen","Gwendolen","Gwendolin","Gwendolyn","Gweneth","Gwenette","Gwenneth","Gwenni","Gwennie","Gwenny","Gwenora","Gwenore","Gwyn","Gwyneth","Gwynne","Gypsy","Hadria","Hailee","Haily","Haleigh","Halette","Haley","Hali","Halie","Halimeda","Halley","Halli","Hallie","Hally","Hana","Hanna","Hannah","Hanni","Hannie","Hannis","Hanny","Happy","Harlene","Harley","Harli","Harlie","Harmonia","Harmonie","Harmony","Harri","Harrie","Harriet","Harriett","Harrietta","Harriette","Harriot","Harriott","Hatti","Hattie","Hatty","Hayley","Hazel","Heath","Heather","Heda","Hedda","Heddi","Heddie","Hedi","Hedvig","Hedvige","Hedwig","Hedwiga","Hedy","Heida","Heidi","Heidie","Helaina","Helaine","Helen","Helen-elizabeth","Helena","Helene","Helenka","Helga","Helge","Helli","Heloise","Helsa","Helyn","Hendrika","Henka","Henrie","Henrieta","Henrietta","Henriette","Henryetta","Hephzibah","Hermia","Hermina","Hermine","Herminia","Hermione","Herta","Hertha","Hester","Hesther","Hestia","Hetti","Hettie","Hetty","Hilary","Hilda","Hildagard","Hildagarde","Hilde","Hildegaard","Hildegarde","Hildy","Hillary","Hilliary","Hinda","Holli","Hollie","Holly","Holly-anne","Hollyanne","Honey","Honor","Honoria","Hope","Horatia","Hortense","Hortensia","Hulda","Hyacinth","Hyacintha","Hyacinthe","Hyacinthia","Hyacinthie","Hynda","Ianthe","Ibbie","Ibby","Ida","Idalia","Idalina","Idaline","Idell","Idelle","Idette","Ileana","Ileane","Ilene","Ilise","Ilka","Illa","Ilsa","Ilse","Ilysa","Ilyse","Ilyssa","Imelda","Imogen","Imogene","Imojean","Ina","Indira","Ines","Inesita","Inessa","Inez","Inga","Ingaberg","Ingaborg","Inge","Ingeberg","Ingeborg","Inger","Ingrid","Ingunna","Inna","Iolande","Iolanthe","Iona","Iormina","Ira","Irena","Irene","Irina","Iris","Irita","Irma","Isa","Isabel","Isabelita","Isabella","Isabelle","Isadora","Isahella","Iseabal","Isidora","Isis","Isobel","Issi","Issie","Issy","Ivett","Ivette","Ivie","Ivonne","Ivory","Ivy","Izabel","Jacenta","Jacinda","Jacinta","Jacintha","Jacinthe","Jackelyn","Jacki","Jackie","Jacklin","Jacklyn","Jackquelin","Jackqueline","Jacky","Jaclin","Jaclyn","Jacquelin","Jacqueline","Jacquelyn","Jacquelynn","Jacquenetta","Jacquenette","Jacquetta","Jacquette","Jacqui","Jacquie","Jacynth","Jada","Jade","Jaime","Jaimie","Jaine","Jami","Jamie","Jamima","Jammie","Jan","Jana","Janaya","Janaye","Jandy","Jane","Janean","Janeczka","Janeen","Janel","Janela","Janella","Janelle","Janene","Janenna","Janessa","Janet","Janeta","Janetta","Janette","Janeva","Janey","Jania","Janice","Janie","Janifer","Janina","Janine","Janis","Janith","Janka","Janna","Jannel","Jannelle","Janot","Jany","Jaquelin","Jaquelyn","Jaquenetta","Jaquenette","Jaquith","Jasmin","Jasmina","Jasmine","Jayme","Jaymee","Jayne","Jaynell","Jazmin","Jean","Jeana","Jeane","Jeanelle","Jeanette","Jeanie","Jeanine","Jeanna","Jeanne","Jeannette","Jeannie","Jeannine","Jehanna","Jelene","Jemie","Jemima","Jemimah","Jemmie","Jemmy","Jen","Jena","Jenda","Jenelle","Jeni","Jenica","Jeniece","Jenifer","Jeniffer","Jenilee","Jenine","Jenn","Jenna","Jennee","Jennette","Jenni","Jennica","Jennie","Jennifer","Jennilee","Jennine","Jenny","Jeralee","Jere","Jeri","Jermaine","Jerrie","Jerrilee","Jerrilyn","Jerrine","Jerry","Jerrylee","Jess","Jessa","Jessalin","Jessalyn","Jessamine","Jessamyn","Jesse","Jesselyn","Jessi","Jessica","Jessie","Jessika","Jessy","Jewel","Jewell","Jewelle","Jill","Jillana","Jillane","Jillayne","Jilleen","Jillene","Jilli","Jillian","Jillie","Jilly","Jinny","Jo","Jo-ann","Jo-anne","Joan","Joana","Joane","Joanie","Joann","Joanna","Joanne","Joannes","Jobey","Jobi","Jobie","Jobina","Joby","Jobye","Jobyna","Jocelin","Joceline","Jocelyn","Jocelyne","Jodee","Jodi","Jodie","Jody","Joeann","Joela","Joelie","Joell","Joella","Joelle","Joellen","Joelly","Joellyn","Joelynn","Joete","Joey","Johanna","Johannah","Johna","Johnath","Johnette","Johnna","Joice","Jojo","Jolee","Joleen","Jolene","Joletta","Joli","Jolie","Joline","Joly","Jolyn","Jolynn","Jonell","Joni","Jonie","Jonis","Jordain","Jordan","Jordana","Jordanna","Jorey","Jori","Jorie","Jorrie","Jorry","Joscelin","Josee","Josefa","Josefina","Josepha","Josephina","Josephine","Josey","Josi","Josie","Josselyn","Josy","Jourdan","Joy","Joya","Joyan","Joyann","Joyce","Joycelin","Joye","Jsandye","Juana","Juanita","Judi","Judie","Judith","Juditha","Judy","Judye","Juieta","Julee","Juli","Julia","Juliana","Juliane","Juliann","Julianna","Julianne","Julie","Julienne","Juliet","Julieta","Julietta","Juliette","Julina","Juline","Julissa","Julita","June","Junette","Junia","Junie","Junina","Justina","Justine","Justinn","Jyoti","Kacey","Kacie","Kacy","Kaela","Kai","Kaia","Kaila","Kaile","Kailey","Kaitlin","Kaitlyn","Kaitlynn","Kaja","Kakalina","Kala","Kaleena","Kali","Kalie","Kalila","Kalina","Kalinda","Kalindi","Kalli","Kally","Kameko","Kamila","Kamilah","Kamillah","Kandace","Kandy","Kania","Kanya","Kara","Kara-lynn","Karalee","Karalynn","Kare","Karee","Karel","Karen","Karena","Kari","Karia","Karie","Karil","Karilynn","Karin","Karina","Karine","Kariotta","Karisa","Karissa","Karita","Karla","Karlee","Karleen","Karlen","Karlene","Karlie","Karlotta","Karlotte","Karly","Karlyn","Karmen","Karna","Karol","Karola","Karole","Karolina","Karoline","Karoly","Karon","Karrah","Karrie","Karry","Kary","Karyl","Karylin","Karyn","Kasey","Kass","Kassandra","Kassey","Kassi","Kassia","Kassie","Kat","Kata","Katalin","Kate","Katee","Katerina","Katerine","Katey","Kath","Katha","Katharina","Katharine","Katharyn","Kathe","Katherina","Katherine","Katheryn","Kathi","Kathie","Kathleen","Kathlin","Kathrine","Kathryn","Kathryne","Kathy","Kathye","Kati","Katie","Katina","Katine","Katinka","Katleen","Katlin","Katrina","Katrine","Katrinka","Katti","Kattie","Katuscha","Katusha","Katy","Katya","Kay","Kaycee","Kaye","Kayla","Kayle","Kaylee","Kayley","Kaylil","Kaylyn","Keeley","Keelia","Keely","Kelcey","Kelci","Kelcie","Kelcy","Kelila","Kellen","Kelley","Kelli","Kellia","Kellie","Kellina","Kellsie","Kelly","Kellyann","Kelsey","Kelsi","Kelsy","Kendra","Kendre","Kenna","Keri","Keriann","Kerianne","Kerri","Kerrie","Kerrill","Kerrin","Kerry","Kerstin","Kesley","Keslie","Kessia","Kessiah","Ketti","Kettie","Ketty","Kevina","Kevyn","Ki","Kiah","Kial","Kiele","Kiersten","Kikelia","Kiley","Kim","Kimberlee","Kimberley","Kimberli","Kimberly","Kimberlyn","Kimbra","Kimmi","Kimmie","Kimmy","Kinna","Kip","Kipp","Kippie","Kippy","Kira","Kirbee","Kirbie","Kirby","Kiri","Kirsten","Kirsteni","Kirsti","Kirstin","Kirstyn","Kissee","Kissiah","Kissie","Kit","Kitti","Kittie","Kitty","Kizzee","Kizzie","Klara","Klarika","Klarrisa","Konstance","Konstanze","Koo","Kora","Koral","Koralle","Kordula","Kore","Korella","Koren","Koressa","Kori","Korie","Korney","Korrie","Korry","Kris","Krissie","Krissy","Krista","Kristal","Kristan","Kriste","Kristel","Kristen","Kristi","Kristien","Kristin","Kristina","Kristine","Kristy","Kristyn","Krysta","Krystal","Krystalle","Krystle","Krystyna","Kyla","Kyle","Kylen","Kylie","Kylila","Kylynn","Kym","Kynthia","Kyrstin","Lacee","Lacey","Lacie","Lacy","Ladonna","Laetitia","Laina","Lainey","Lana","Lanae","Lane","Lanette","Laney","Lani","Lanie","Lanita","Lanna","Lanni","Lanny","Lara","Laraine","Lari","Larina","Larine","Larisa","Larissa","Lark","Laryssa","Latashia","Latia","Latisha","Latrena","Latrina","Laura","Lauraine","Laural","Lauralee","Laure","Lauree","Laureen","Laurel","Laurella","Lauren","Laurena","Laurene","Lauretta","Laurette","Lauri","Laurianne","Laurice","Laurie","Lauryn","Lavena","Laverna","Laverne","Lavina","Lavinia","Lavinie","Layla","Layne","Layney","Lea","Leah","Leandra","Leann","Leanna","Leanor","Leanora","Lebbie","Leda","Lee","Leeann","Leeanne","Leela","Leelah","Leena","Leesa","Leese","Legra","Leia","Leigh","Leigha","Leila","Leilah","Leisha","Lela","Lelah","Leland","Lelia","Lena","Lenee","Lenette","Lenka","Lenna","Lenora","Lenore","Leodora","Leoine","Leola","Leoline","Leona","Leonanie","Leone","Leonelle","Leonie","Leonora","Leonore","Leontine","Leontyne","Leora","Leshia","Lesley","Lesli","Leslie","Lesly","Lesya","Leta","Lethia","Leticia","Letisha","Letitia","Letizia","Letta","Letti","Lettie","Letty","Lexi","Lexie","Lexine","Lexis","Lexy","Leyla","Lezlie","Lia","Lian","Liana","Liane","Lianna","Lianne","Lib","Libbey","Libbi","Libbie","Libby","Licha","Lida","Lidia","Liesa","Lil","Lila","Lilah","Lilas","Lilia","Lilian","Liliane","Lilias","Lilith","Lilla","Lilli","Lillian","Lillis","Lilllie","Lilly","Lily","Lilyan","Lin","Lina","Lind","Linda","Lindi","Lindie","Lindsay","Lindsey","Lindsy","Lindy","Linea","Linell","Linet","Linette","Linn","Linnea","Linnell","Linnet","Linnie","Linzy","Lira","Lisa","Lisabeth","Lisbeth","Lise","Lisetta","Lisette","Lisha","Lishe","Lissa","Lissi","Lissie","Lissy","Lita","Liuka","Liv","Liva","Livia","Livvie","Livvy","Livvyy","Livy","Liz","Liza","Lizabeth","Lizbeth","Lizette","Lizzie","Lizzy","Loella","Lois","Loise","Lola","Loleta","Lolita","Lolly","Lona","Lonee","Loni","Lonna","Lonni","Lonnie","Lora","Lorain","Loraine","Loralee","Loralie","Loralyn","Loree","Loreen","Lorelei","Lorelle","Loren","Lorena","Lorene","Lorenza","Loretta","Lorette","Lori","Loria","Lorianna","Lorianne","Lorie","Lorilee","Lorilyn","Lorinda","Lorine","Lorita","Lorna","Lorne","Lorraine","Lorrayne","Lorri","Lorrie","Lorrin","Lorry","Lory","Lotta","Lotte","Lotti","Lottie","Lotty","Lou","Louella","Louisa","Louise","Louisette","Loutitia","Lu","Luce","Luci","Lucia","Luciana","Lucie","Lucienne","Lucila","Lucilia","Lucille","Lucina","Lucinda","Lucine","Lucita","Lucky","Lucretia","Lucy","Ludovika","Luella","Luelle","Luisa","Luise","Lula","Lulita","Lulu","Lura","Lurette","Lurleen","Lurlene","Lurline","Lusa","Luz","Lyda","Lydia","Lydie","Lyn","Lynda","Lynde","Lyndel","Lyndell","Lyndsay","Lyndsey","Lyndsie","Lyndy","Lynea","Lynelle","Lynett","Lynette","Lynn","Lynna","Lynne","Lynnea","Lynnell","Lynnelle","Lynnet","Lynnett","Lynnette","Lynsey","Lyssa","Mab","Mabel","Mabelle","Mable","Mada","Madalena","Madalyn","Maddalena","Maddi","Maddie","Maddy","Madel","Madelaine","Madeleine","Madelena","Madelene","Madelin","Madelina","Madeline","Madella","Madelle","Madelon","Madelyn","Madge","Madlen","Madlin","Madonna","Mady","Mae","Maegan","Mag","Magda","Magdaia","Magdalen","Magdalena","Magdalene","Maggee","Maggi","Maggie","Maggy","Mahala","Mahalia","Maia","Maible","Maiga","Maighdiln","Mair","Maire","Maisey","Maisie","Maitilde","Mala","Malanie","Malena","Malia","Malina","Malinda","Malinde","Malissa","Malissia","Mallissa","Mallorie","Mallory","Malorie","Malory","Malva","Malvina","Malynda","Mame","Mamie","Manda","Mandi","Mandie","Mandy","Manon","Manya","Mara","Marabel","Marcela","Marcelia","Marcella","Marcelle","Marcellina","Marcelline","Marchelle","Marci","Marcia","Marcie","Marcile","Marcille","Marcy","Mareah","Maren","Marena","Maressa","Marga","Margalit","Margalo","Margaret","Margareta","Margarete","Margaretha","Margarethe","Margaretta","Margarette","Margarita","Margaux","Marge","Margeaux","Margery","Marget","Margette","Margi","Margie","Margit","Margo","Margot","Margret","Marguerite","Margy","Mari","Maria","Mariam","Marian","Mariana","Mariann","Marianna","Marianne","Maribel","Maribelle","Maribeth","Marice","Maridel","Marie","Marie-ann","Marie-jeanne","Marieann","Mariejeanne","Mariel","Mariele","Marielle","Mariellen","Marietta","Mariette","Marigold","Marijo","Marika","Marilee","Marilin","Marillin","Marilyn","Marin","Marina","Marinna","Marion","Mariquilla","Maris","Marisa","Mariska","Marissa","Marita","Maritsa","Mariya","Marj","Marja","Marje","Marji","Marjie","Marjorie","Marjory","Marjy","Marketa","Marla","Marlane","Marleah","Marlee","Marleen","Marlena","Marlene","Marley","Marlie","Marline","Marlo","Marlyn","Marna","Marne","Marney","Marni","Marnia","Marnie","Marquita","Marrilee","Marris","Marrissa","Marsha","Marsiella","Marta","Martelle","Martguerita","Martha","Marthe","Marthena","Marti","Martica","Martie","Martina","Martita","Marty","Martynne","Mary","Marya","Maryann","Maryanna","Maryanne","Marybelle","Marybeth","Maryellen","Maryjane","Maryjo","Maryl","Marylee","Marylin","Marylinda","Marylou","Marylynne","Maryrose","Marys","Marysa","Masha","Matelda","Mathilda","Mathilde","Matilda","Matilde","Matti","Mattie","Matty","Maud","Maude","Maudie","Maura","Maure","Maureen","Maureene","Maurene","Maurine","Maurise","Maurita","Maurizia","Mavis","Mavra","Max","Maxi","Maxie","Maxine","Maxy","May","Maybelle","Maye","Mead","Meade","Meagan","Meaghan","Meara","Mechelle","Meg","Megan","Megen","Meggi","Meggie","Meggy","Meghan","Meghann","Mehetabel","Mei","Mel","Mela","Melamie","Melania","Melanie","Melantha","Melany","Melba","Melesa","Melessa","Melicent","Melina","Melinda","Melinde","Melisa","Melisande","Melisandra","Melisenda","Melisent","Melissa","Melisse","Melita","Melitta","Mella","Melli","Mellicent","Mellie","Mellisa","Mellisent","Melloney","Melly","Melodee","Melodie","Melody","Melonie","Melony","Melosa","Melva","Mercedes","Merci","Mercie","Mercy","Meredith","Meredithe","Meridel","Meridith","Meriel","Merilee","Merilyn","Meris","Merissa","Merl","Merla","Merle","Merlina","Merline","Merna","Merola","Merralee","Merridie","Merrie","Merrielle","Merrile","Merrilee","Merrili","Merrill","Merrily","Merry","Mersey","Meryl","Meta","Mia","Micaela","Michaela","Michaelina","Michaeline","Michaella","Michal","Michel","Michele","Michelina","Micheline","Michell","Michelle","Micki","Mickie","Micky","Midge","Mignon","Mignonne","Miguela","Miguelita","Mikaela","Mil","Mildred","Mildrid","Milena","Milicent","Milissent","Milka","Milli","Millicent","Millie","Millisent","Milly","Milzie","Mimi","Min","Mina","Minda","Mindy","Minerva","Minetta","Minette","Minna","Minnaminnie","Minne","Minni","Minnie","Minnnie","Minny","Minta","Miquela","Mira","Mirabel","Mirabella","Mirabelle","Miran","Miranda","Mireielle","Mireille","Mirella","Mirelle","Miriam","Mirilla","Mirna","Misha","Missie","Missy","Misti","Misty","Mitzi","Modesta","Modestia","Modestine","Modesty","Moina","Moira","Moll","Mollee","Molli","Mollie","Molly","Mommy","Mona","Monah","Monica","Monika","Monique","Mora","Moreen","Morena","Morgan","Morgana","Morganica","Morganne","Morgen","Moria","Morissa","Morna","Moselle","Moyna","Moyra","Mozelle","Muffin","Mufi","Mufinella","Muire","Mureil","Murial","Muriel","Murielle","Myra","Myrah","Myranda","Myriam","Myrilla","Myrle","Myrlene","Myrna","Myrta","Myrtia","Myrtice","Myrtie","Myrtle","Nada","Nadean","Nadeen","Nadia","Nadine","Nadiya","Nady","Nadya","Nalani","Nan","Nana","Nananne","Nance","Nancee","Nancey","Nanci","Nancie","Nancy","Nanete","Nanette","Nani","Nanice","Nanine","Nannette","Nanni","Nannie","Nanny","Nanon","Naoma","Naomi","Nara","Nari","Nariko","Nat","Nata","Natala","Natalee","Natalie","Natalina","Nataline","Natalya","Natasha","Natassia","Nathalia","Nathalie","Natividad","Natka","Natty","Neala","Neda","Nedda","Nedi","Neely","Neila","Neile","Neilla","Neille","Nelia","Nelie","Nell","Nelle","Nelli","Nellie","Nelly","Nerissa","Nerita","Nert","Nerta","Nerte","Nerti","Nertie","Nerty","Nessa","Nessi","Nessie","Nessy","Nesta","Netta","Netti","Nettie","Nettle","Netty","Nevsa","Neysa","Nichol","Nichole","Nicholle","Nicki","Nickie","Nicky","Nicol","Nicola","Nicole","Nicolea","Nicolette","Nicoli","Nicolina","Nicoline","Nicolle","Nikaniki","Nike","Niki","Nikki","Nikkie","Nikoletta","Nikolia","Nina","Ninetta","Ninette","Ninnetta","Ninnette","Ninon","Nissa","Nisse","Nissie","Nissy","Nita","Nixie","Noami","Noel","Noelani","Noell","Noella","Noelle","Noellyn","Noelyn","Noemi","Nola","Nolana","Nolie","Nollie","Nomi","Nona","Nonah","Noni","Nonie","Nonna","Nonnah","Nora","Norah","Norean","Noreen","Norene","Norina","Norine","Norma","Norri","Norrie","Norry","Novelia","Nydia","Nyssa","Octavia","Odele","Odelia","Odelinda","Odella","Odelle","Odessa","Odetta","Odette","Odilia","Odille","Ofelia","Ofella","Ofilia","Ola","Olenka","Olga","Olia","Olimpia","Olive","Olivette","Olivia","Olivie","Oliy","Ollie","Olly","Olva","Olwen","Olympe","Olympia","Olympie","Ondrea","Oneida","Onida","Oona","Opal","Opalina","Opaline","Ophelia","Ophelie","Ora","Oralee","Oralia","Oralie","Oralla","Oralle","Orel","Orelee","Orelia","Orelie","Orella","Orelle","Oriana","Orly","Orsa","Orsola","Ortensia","Otha","Othelia","Othella","Othilia","Othilie","Ottilie","Page","Paige","Paloma","Pam","Pamela","Pamelina","Pamella","Pammi","Pammie","Pammy","Pandora","Pansie","Pansy","Paola","Paolina","Papagena","Pat","Patience","Patrica","Patrice","Patricia","Patrizia","Patsy","Patti","Pattie","Patty","Paula","Paule","Pauletta","Paulette","Pauli","Paulie","Paulina","Pauline","Paulita","Pauly","Pavia","Pavla","Pearl","Pearla","Pearle","Pearline","Peg","Pegeen","Peggi","Peggie","Peggy","Pen","Penelopa","Penelope","Penni","Pennie","Penny","Pepi","Pepita","Peri","Peria","Perl","Perla","Perle","Perri","Perrine","Perry","Persis","Pet","Peta","Petra","Petrina","Petronella","Petronia","Petronilla","Petronille","Petunia","Phaedra","Phaidra","Phebe","Phedra","Phelia","Phil","Philipa","Philippa","Philippe","Philippine","Philis","Phillida","Phillie","Phillis","Philly","Philomena","Phoebe","Phylis","Phyllida","Phyllis","Phyllys","Phylys","Pia","Pier","Pierette","Pierrette","Pietra","Piper","Pippa","Pippy","Polly","Pollyanna","Pooh","Poppy","Portia","Pris","Prisca","Priscella","Priscilla","Prissie","Pru","Prudence","Prudi","Prudy","Prue","Queenie","Quentin","Querida","Quinn","Quinta","Quintana","Quintilla","Quintina","Rachael","Rachel","Rachele","Rachelle","Rae","Raeann","Raf","Rafa","Rafaela","Rafaelia","Rafaelita","Rahal","Rahel","Raina","Raine","Rakel","Ralina","Ramona","Ramonda","Rana","Randa","Randee","Randene","Randi","Randie","Randy","Ranee","Rani","Rania","Ranice","Ranique","Ranna","Raphaela","Raquel","Raquela","Rasia","Rasla","Raven","Ray","Raychel","Raye","Rayna","Raynell","Rayshell","Rea","Reba","Rebbecca","Rebe","Rebeca","Rebecca","Rebecka","Rebeka","Rebekah","Rebekkah","Ree","Reeba","Reena","Reeta","Reeva","Regan","Reggi","Reggie","Regina","Regine","Reiko","Reina","Reine","Remy","Rena","Renae","Renata","Renate","Rene","Renee","Renell","Renelle","Renie","Rennie","Reta","Retha","Revkah","Rey","Reyna","Rhea","Rheba","Rheta","Rhetta","Rhiamon","Rhianna","Rhianon","Rhoda","Rhodia","Rhodie","Rhody","Rhona","Rhonda","Riane","Riannon","Rianon","Rica","Ricca","Rici","Ricki","Rickie","Ricky","Riki","Rikki","Rina","Risa","Rita","Riva","Rivalee","Rivi","Rivkah","Rivy","Roana","Roanna","Roanne","Robbi","Robbie","Robbin","Robby","Robbyn","Robena","Robenia","Roberta","Robin","Robina","Robinet","Robinett","Robinetta","Robinette","Robinia","Roby","Robyn","Roch","Rochell","Rochella","Rochelle","Rochette","Roda","Rodi","Rodie","Rodina","Rois","Romola","Romona","Romonda","Romy","Rona","Ronalda","Ronda","Ronica","Ronna","Ronni","Ronnica","Ronnie","Ronny","Roobbie","Rora","Rori","Rorie","Rory","Ros","Rosa","Rosabel","Rosabella","Rosabelle","Rosaleen","Rosalia","Rosalie","Rosalind","Rosalinda","Rosalinde","Rosaline","Rosalyn","Rosalynd","Rosamond","Rosamund","Rosana","Rosanna","Rosanne","Rose","Roseann","Roseanna","Roseanne","Roselia","Roselin","Roseline","Rosella","Roselle","Rosemaria","Rosemarie","Rosemary","Rosemonde","Rosene","Rosetta","Rosette","Roshelle","Rosie","Rosina","Rosita","Roslyn","Rosmunda","Rosy","Row","Rowe","Rowena","Roxana","Roxane","Roxanna","Roxanne","Roxi","Roxie","Roxine","Roxy","Roz","Rozalie","Rozalin","Rozamond","Rozanna","Rozanne","Roze","Rozele","Rozella","Rozelle","Rozina","Rubetta","Rubi","Rubia","Rubie","Rubina","Ruby","Ruperta","Ruth","Ruthann","Ruthanne","Ruthe","Ruthi","Ruthie","Ruthy","Ryann","Rycca","Saba","Sabina","Sabine","Sabra","Sabrina","Sacha","Sada","Sadella","Sadie","Sadye","Saidee","Sal","Salaidh","Sallee","Salli","Sallie","Sally","Sallyann","Sallyanne","Saloma","Salome","Salomi","Sam","Samantha","Samara","Samaria","Sammy","Sande","Sandi","Sandie","Sandra","Sandy","Sandye","Sapphira","Sapphire","Sara","Sara-ann","Saraann","Sarah","Sarajane","Saree","Sarena","Sarene","Sarette","Sari","Sarina","Sarine","Sarita","Sascha","Sasha","Sashenka","Saudra","Saundra","Savina","Sayre","Scarlet","Scarlett","Sean","Seana","Seka","Sela","Selena","Selene","Selestina","Selia","Selie","Selina","Selinda","Seline","Sella","Selle","Selma","Sena","Sephira","Serena","Serene","Shae","Shaina","Shaine","Shalna","Shalne","Shana","Shanda","Shandee","Shandeigh","Shandie","Shandra","Shandy","Shane","Shani","Shanie","Shanna","Shannah","Shannen","Shannon","Shanon","Shanta","Shantee","Shara","Sharai","Shari","Sharia","Sharity","Sharl","Sharla","Sharleen","Sharlene","Sharline","Sharon","Sharona","Sharron","Sharyl","Shaun","Shauna","Shawn","Shawna","Shawnee","Shay","Shayla","Shaylah","Shaylyn","Shaylynn","Shayna","Shayne","Shea","Sheba","Sheela","Sheelagh","Sheelah","Sheena","Sheeree","Sheila","Sheila-kathryn","Sheilah","Shel","Shela","Shelagh","Shelba","Shelbi","Shelby","Shelia","Shell","Shelley","Shelli","Shellie","Shelly","Shena","Sher","Sheree","Sheri","Sherie","Sherill","Sherilyn","Sherline","Sherri","Sherrie","Sherry","Sherye","Sheryl","Shina","Shir","Shirl","Shirlee","Shirleen","Shirlene","Shirley","Shirline","Shoshana","Shoshanna","Siana","Sianna","Sib","Sibbie","Sibby","Sibeal","Sibel","Sibella","Sibelle","Sibilla","Sibley","Sibyl","Sibylla","Sibylle","Sidoney","Sidonia","Sidonnie","Sigrid","Sile","Sileas","Silva","Silvana","Silvia","Silvie","Simona","Simone","Simonette","Simonne","Sindee","Siobhan","Sioux","Siouxie","Sisely","Sisile","Sissie","Sissy","Siusan","Sofia","Sofie","Sondra","Sonia","Sonja","Sonni","Sonnie","Sonnnie","Sonny","Sonya","Sophey","Sophi","Sophia","Sophie","Sophronia","Sorcha","Sosanna","Stace","Stacee","Stacey","Staci","Stacia","Stacie","Stacy","Stafani","Star","Starla","Starlene","Starlin","Starr","Stefa","Stefania","Stefanie","Steffane","Steffi","Steffie","Stella","Stepha","Stephana","Stephani","Stephanie","Stephannie","Stephenie","Stephi","Stephie","Stephine","Stesha","Stevana","Stevena","Stoddard","Storm","Stormi","Stormie","Stormy","Sue","Suellen","Sukey","Suki","Sula","Sunny","Sunshine","Susan","Susana","Susanetta","Susann","Susanna","Susannah","Susanne","Susette","Susi","Susie","Susy","Suzann","Suzanna","Suzanne","Suzette","Suzi","Suzie","Suzy","Sybil","Sybila","Sybilla","Sybille","Sybyl","Sydel","Sydelle","Sydney","Sylvia","Tabatha","Tabbatha","Tabbi","Tabbie","Tabbitha","Tabby","Tabina","Tabitha","Taffy","Talia","Tallia","Tallie","Tallou","Tallulah","Tally","Talya","Talyah","Tamar","Tamara","Tamarah","Tamarra","Tamera","Tami","Tamiko","Tamma","Tammara","Tammi","Tammie","Tammy","Tamqrah","Tamra","Tana","Tandi","Tandie","Tandy","Tanhya","Tani","Tania","Tanitansy","Tansy","Tanya","Tara","Tarah","Tarra","Tarrah","Taryn","Tasha","Tasia","Tate","Tatiana","Tatiania","Tatum","Tawnya","Tawsha","Ted","Tedda","Teddi","Teddie","Teddy","Tedi","Tedra","Teena","Teirtza","Teodora","Tera","Teresa","Terese","Teresina","Teresita","Teressa","Teri","Teriann","Terra","Terri","Terrie","Terrijo","Terry","Terrye","Tersina","Terza","Tess","Tessa","Tessi","Tessie","Tessy","Thalia","Thea","Theadora","Theda","Thekla","Thelma","Theo","Theodora","Theodosia","Theresa","Therese","Theresina","Theresita","Theressa","Therine","Thia","Thomasa","Thomasin","Thomasina","Thomasine","Tiena","Tierney","Tiertza","Tiff","Tiffani","Tiffanie","Tiffany","Tiffi","Tiffie","Tiffy","Tilda","Tildi","Tildie","Tildy","Tillie","Tilly","Tim","Timi","Timmi","Timmie","Timmy","Timothea","Tina","Tine","Tiphani","Tiphanie","Tiphany","Tish","Tisha","Tobe","Tobey","Tobi","Toby","Tobye","Toinette","Toma","Tomasina","Tomasine","Tomi","Tommi","Tommie","Tommy","Toni","Tonia","Tonie","Tony","Tonya","Tonye","Tootsie","Torey","Tori","Torie","Torrie","Tory","Tova","Tove","Tracee","Tracey","Traci","Tracie","Tracy","Trenna","Tresa","Trescha","Tressa","Tricia","Trina","Trish","Trisha","Trista","Trix","Trixi","Trixie","Trixy","Truda","Trude","Trudey","Trudi","Trudie","Trudy","Trula","Tuesday","Twila","Twyla","Tybi","Tybie","Tyne","Ula","Ulla","Ulrica","Ulrika","Ulrikaumeko","Ulrike","Umeko","Una","Ursa","Ursala","Ursola","Ursula","Ursulina","Ursuline","Uta","Val","Valaree","Valaria","Vale","Valeda","Valencia","Valene","Valenka","Valentia","Valentina","Valentine","Valera","Valeria","Valerie","Valery","Valerye","Valida","Valina","Valli","Vallie","Vally","Valma","Valry","Van","Vanda","Vanessa","Vania","Vanna","Vanni","Vannie","Vanny","Vanya","Veda","Velma","Velvet","Venita","Venus","Vera","Veradis","Vere","Verena","Verene","Veriee","Verile","Verina","Verine","Verla","Verna","Vernice","Veronica","Veronika","Veronike","Veronique","Vevay","Vi","Vicki","Vickie","Vicky","Victoria","Vida","Viki","Vikki","Vikky","Vilhelmina","Vilma","Vin","Vina","Vinita","Vinni","Vinnie","Vinny","Viola","Violante","Viole","Violet","Violetta","Violette","Virgie","Virgina","Virginia","Virginie","Vita","Vitia","Vitoria","Vittoria","Viv","Viva","Vivi","Vivia","Vivian","Viviana","Vivianna","Vivianne","Vivie","Vivien","Viviene","Vivienne","Viviyan","Vivyan","Vivyanne","Vonni","Vonnie","Vonny","Vyky","Wallie","Wallis","Walliw","Wally","Waly","Wanda","Wandie","Wandis","Waneta","Wanids","Wenda","Wendeline","Wendi","Wendie","Wendy","Wendye","Wenona","Wenonah","Whitney","Wileen","Wilhelmina","Wilhelmine","Wilie","Willa","Willabella","Willamina","Willetta","Willette","Willi","Willie","Willow","Willy","Willyt","Wilma","Wilmette","Wilona","Wilone","Wilow","Windy","Wini","Winifred","Winna","Winnah","Winne","Winni","Winnie","Winnifred","Winny","Winona","Winonah","Wren","Wrennie","Wylma","Wynn","Wynne","Wynnie","Wynny","Xaviera","Xena","Xenia","Xylia","Xylina","Yalonda","Yasmeen","Yasmin","Yelena","Yetta","Yettie","Yetty","Yevette","Ynes","Ynez","Yoko","Yolanda","Yolande","Yolane","Yolanthe","Yoshi","Yoshiko","Yovonnda","Ysabel","Yvette","Yvonne","Zabrina","Zahara","Zandra","Zaneta","Zara","Zarah","Zaria","Zarla","Zea","Zelda","Zelma","Zena","Zenia","Zia","Zilvia","Zita","Zitella","Zoe","Zola","Zonda","Zondra","Zonnya","Zora","Zorah","Zorana","Zorina","Zorine","Zsazsa","Zulema","Zuzana"];function rG(){if(typeof process<"u"&&process.versions&&process.versions.node)return"node";if(typeof globalThis<"u"&&typeof globalThis.window<"u"&&typeof globalThis.window.document<"u")return"browser";return"unknown"}class nG{store={};constructor(){if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.ENV)this.store={...globalThis.window.ENV};if(typeof globalThis<"u"&&globalThis.__ENV__)this.store={...this.store,...globalThis.__ENV__}}get($){let q=this.store[$];return q!==void 0?String(q):void 0}set($,q){this.store[$]=q}has($){return $ in this.store}getAll(){return{...this.store}}}class iG{runtime;browserStore;cache=new Map;constructor(){if(this.runtime=rG(),this.runtime==="browser")this.browserStore=new nG}getRuntime(){return this.runtime}isNode(){return this.runtime==="node"}isBrowser(){return this.runtime==="browser"}get($,q){if(this.cache.has($)){let P=this.cache.get($);return P===void 0&&q!==void 0?q:P}let K;switch(this.runtime){case"node":if(typeof process<"u"&&process.env)K=process.env[$];break;case"browser":if(this.browserStore)K=this.browserStore.get($);break;default:K=void 0}return this.cache.set($,K),K===void 0&&q!==void 0?q:K}set($,q){let K=String(q);switch(this.cache.delete($),this.runtime){case"node":if(typeof process<"u"&&process.env)process.env[$]=K;break;case"browser":if(this.browserStore)this.browserStore.set($,q);break}}has($){return this.get($)!==void 0}getAll(){switch(this.runtime){case"node":if(typeof process<"u"&&process.env)return{...process.env};break;case"browser":if(this.browserStore)return this.browserStore.getAll();break}return{}}getBoolean($,q=!1){let K=this.get($);if(K===void 0)return q;return["true","1","yes","on"].includes(K.toLowerCase())}getNumber($,q){let K=this.get($);if(K===void 0)return q;let P=Number(K);return isNaN(P)?q:P}clearCache(){this.cache.clear()}}var TW=null;function N4(){if(!TW)TW=new iG;return TW}function xK($,q){return N4().get($,q)}function Y8$($,q){N4().set($,q)}function v8$($){return N4().has($)}function z8$($,q=!1){return N4().getBoolean($,q)}function tG($,q){return N4().getNumber($,q)}function W8$($){let q=N4();if(q.isBrowser())Object.entries($).forEach(([K,P])=>{if(P!==void 0)q.set(K,P)})}var H8$=rG();class Sj{globalStore;constructor($){this.globalStore=$}clear(){console.clear()}filterByLabel($){BG($,this.globalStore.cache).forEach((K)=>{G7(K)})}filterByNamespace(...$){UG($,this.globalStore.cache).forEach((K)=>{G7(K)})}filterByLevel($){FG($,this.globalStore.cache).forEach((K)=>{G7(K)})}renderAll(){this.globalStore.cache.forEach(($)=>{G7($)})}}class C4{config;pidCounter=1;labels=new Map;_listenerCounter=0;_levelsToListeners=new Map;_cache=[];constructor($={}){this.config=$}get cache(){return this._cache}get configuration(){return this.config}get pid(){let $=this.pidCounter;return this.pidCounter++,$}get tools(){return new Sj(this)}addLogToCache($){if(this._cache.length<(this.config.cacheSize??300))this._cache.push($)}clearCache(){this._cache=[]}getLabel($){return this.labels.get($)}setLabel($,q){this.labels.set($,q)}addListener($,q){let K=this._listenerCounter+=1;return V7({...q8.levels,...this.config.levels??{}},$).forEach((_)=>{if(this._levelsToListeners.has(_))this._levelsToListeners.get(_).set(K,q);else this._levelsToListeners.set(_,new Map([[K,q]]))}),K}removeListener($){this._levelsToListeners.forEach((q)=>{q.delete($)})}getListeners($){return Array.from(this._levelsToListeners.get($)?.values()??[])}}function wW($){return globalThis.$adzeGlobal=new C4($),globalThis.$adzeGlobal}function Mj($){let q=globalThis.$adzeGlobal;if(bc(q))return q;let K=new C4($);return globalThis.$adzeGlobal=K,K}function bc($){return $ instanceof C4}function TK(){return typeof window<"u"&&typeof window.location<"u"&&typeof window.navigator.userAgent<"u"&&!uc()}function uc(){return typeof Deno<"u"}function aG($){return TK()}function QG(){let $=!1;if(TK())$=new URLSearchParams(globalThis.location.search).get("ADZE_ENV")==="test";return globalThis.$ADZE_ENV==="test"||$}function eG(){let $=globalThis;if(aG($))return $.navigator.userAgent.includes("Firefox");return!1}function E4($){return Object.prototype.toString.call($)==="[object String]"}function h4($){return $!==null&&typeof $==="number"&&!isNaN(Number($))}function Nj($){return fW.includes($)}function sG($){return KV.includes($)}function $V($){return XW.includes($)}function ZW($){return $.every((q)=>E4(q))}function qV($){return Array.isArray($)&&$.length===3&&$[1]==="-"}function _V(){return Error().stack?.replace(/^Error\n/,`
|
|
331
|
+
`)}function PV($){if(h4($.activeLevel))return $.activeLevel;return $.levels[$.activeLevel].level}var GW=Uq(OV(),1),YV=GW.default??GW;function VW($){return $.charAt(0).toUpperCase()+$.slice(1)}function SW($){return Object.values($).map((q)=>q.level)}function MW($,q,K){return $.filter((P)=>P>=q&&P<=K)}function NW($,q=!1,K){let _=(q&&K?9+K.length:9)-$.length,O=$;for(let j=0;j<=_;j+=1)O+=" ";return O}function CW($,q){return q.reduce((K,P)=>{return YV[P](K)},$)}function G7($){if($.data)console[$.data.method](...$.data.message)}function vV($){return $.filter((q)=>q!=="")}function zV($){return typeof $==="object"&&$!==null}function V7($,q){if(q==="*")return Object.values($).map((K)=>K.level);if(E4(q))return[$[q].level];if(h4(q))return[q];if(qV(q)){if(ZW(q)){let K=$[q[0]].level,P=$[q[2]].level;return MW(SW($),K,P)}return MW(SW($),q[0],q[2])}if(Array.isArray(q)&&ZW(q))return q.map((K)=>$[K].level);return q}function EW($,q,K){if(q.length===0)return!1;return $==="include"?!q.includes(K):q.includes(K)}function hW($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return!q.map((K)=>$.includes(K)).includes(!0)}function RW($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return q.map((K)=>$.includes(K)).includes(!0)}function BG($,q){return q.filter((K)=>K.data?.label?.name===$)}function UG($,q){return q.filter((K)=>{if(K.data?.namespace)return K.data.namespace.map((_)=>$.includes(_)).includes(!0);return!1})}function FG($,q){return q.filter((K)=>{let P=V7(K.configuration.levels,$);if(K.data?.level===void 0)return!1;return EW("exclude",P,K.data.level)})}function IW($){if($&&$.length>0)return $.reduce((q,K)=>`${q}#${K} `,"");return""}function DW($){return $?`[${$.name}] `:""}function gW($){return $!==void 0?`(Count: ${$}) `:""}function LW($,q){return $!==void 0&&!$?`${q?"❌ ":""}Assertion failed:`:""}function bW($,q){return $!==void 0&&$?`${q?"✅ ":""}Expression passed:`:""}var Cj=-1,R4=0,I4=1,D4=2,S7=3,M7=4,N7=5,C7=6,Ej=7,hj=8;var WV=typeof self==="object"?self:globalThis,yc=($,q)=>{let K=(_,O)=>{return $.set(O,_),_},P=(_)=>{if($.has(_))return $.get(_);let[O,j]=q[_];switch(O){case R4:case Cj:return K(j,_);case I4:{let z=K([],_);for(let J of j)z.push(P(J));return z}case D4:{let z=K({},_);for(let[J,w]of j)z[P(J)]=P(w);return z}case S7:return K(new Date(j),_);case M7:{let{source:z,flags:J}=j;return K(new RegExp(z,J),_)}case N7:{let z=K(new Map,_);for(let[J,w]of j)z.set(P(J),P(w));return z}case C7:{let z=K(new Set,_);for(let J of j)z.add(P(J));return z}case Ej:{let{name:z,message:J}=j;return K(new WV[z](J),_)}case hj:return K(BigInt(j),_);case"BigInt":return K(Object(BigInt(j)),_)}return K(new WV[O](j),_)};return P},uW=($)=>yc(new Map,$)(0);var g4="",{toString:pc}={},{keys:xc}=Object,E7=($)=>{let q=typeof $;if(q!=="object"||!$)return[R4,q];let K=pc.call($).slice(8,-1);switch(K){case"Array":return[I4,g4];case"Object":return[D4,g4];case"Date":return[S7,g4];case"RegExp":return[M7,g4];case"Map":return[N7,g4];case"Set":return[C7,g4]}if(K.includes("Array"))return[I4,K];if(K.includes("Error"))return[Ej,K];return[D4,K]},Rj=([$,q])=>$===R4&&(q==="function"||q==="symbol"),cc=($,q,K,P)=>{let _=(j,z)=>{let J=P.push(j)-1;return K.set(z,J),J},O=(j)=>{if(K.has(j))return K.get(j);let[z,J]=E7(j);switch(z){case R4:{let G=j;switch(J){case"bigint":z=hj,G=j.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+J);G=null;break;case"undefined":return _([Cj],j)}return _([z,G],j)}case I4:{if(J)return _([J,[...j]],j);let G=[],f=_([z,G],j);for(let A of j)G.push(O(A));return f}case D4:{if(J)switch(J){case"BigInt":return _([J,j.toString()],j);case"Boolean":case"Number":case"String":return _([J,j.valueOf()],j)}if(q&&"toJSON"in j)return O(j.toJSON());let G=[],f=_([z,G],j);for(let A of xc(j))if($||!Rj(E7(j[A])))G.push([O(A),O(j[A])]);return f}case S7:return _([z,j.toISOString()],j);case M7:{let{source:G,flags:f}=j;return _([z,{source:G,flags:f}],j)}case N7:{let G=[],f=_([z,G],j);for(let[A,V]of j)if($||!(Rj(E7(A))||Rj(E7(V))))G.push([O(A),O(V)]);return f}case C7:{let G=[],f=_([z,G],j);for(let A of j)if($||!Rj(E7(A)))G.push(O(A));return f}}let{message:w}=j;return _([z,{name:J,message:w}],j)};return O},yW=($,{json:q,lossy:K}={})=>{let P=[];return cc(!(q||K),!!q,new Map,P)($),P};var pW=typeof structuredClone==="function"?($,q)=>q&&(("json"in q)||("lossy"in q))?uW(yW($,q)):structuredClone($):($,q)=>uW(yW($,q));function xW($,q,K,P){let{formatters:_,middleware:O=[],...j}=q.exportValues();return class extends ${_cfg=new L4({...pW(j),formatters:{..._},middleware:[...O]});_modifierData=pW(K);modifierQueue=[...P]}}function cW([$,q]){return`${$}s ${q/1e6}ms`}function HV(){return cW(Ij())}function Ij($){let q=performance.now()*0.001,K=Math.floor(q),P=Math.floor(q%1*1e9);if($===void 0)return[K,P];let _=K-$[0],O=P-$[1];if(O<0)_-=1,O+=1e9;return[_,O]}function b4($){let q=(O)=>`${Math.floor(Math.abs(O))}`.padStart(2,"0"),K=-$.getTimezoneOffset(),_=`${K>=0?"+":"-"}${q(K/60)}:${q(K%60)}`;return`${$.getFullYear()}-${q($.getMonth()+1)}-${q($.getDate())}T${q($.getHours())}:${q($.getMinutes())}:${q($.getSeconds())}${_}`}function JV($){let q=(E,R=2)=>String(E).padStart(R,"0"),K=q($.getDate()),_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][$.getMonth()],O=$.getFullYear(),j=q($.getHours()),z=q($.getMinutes()),J=q($.getSeconds()),w=-$.getTimezoneOffset(),G=w>=0?"+":"-",f=Math.abs(w),A=q(Math.floor(f/60)),V=q(f%60),C=`${G}${A}${V}`;return`${K}/${_}/${O}:${j}:${z}:${J} ${C}`}class E8{cfg;level;timestampFormatFunction=($)=>b4($);constructor($,q){this.cfg=$,this.level=q}get timestampFormatter(){return this.cfg.timestampFormatter?this.cfg.timestampFormatter:this.timestampFormatFunction}print($,q,K){if(this.level.level>PV(this.cfg))return[];if(this.failsFilters($))return[];if($.assertion===!0)return[];if($.if===!1)return[];if($.method&&!$V($.method)){if(sG($.method)&&Nj($.method))return K}let P=TK()?this.formatBrowser($,q,K):this.formatServer($,q,K);if($.stacktrace)P.push($.stacktrace);return P}failsFilters($){if(this.failsLevelSelector())return!0;if(this.failsNamespacesFilter($))return!0;if(this.failsLabelsFilter($))return!0;return!1}failsLevelSelector(){if(this.cfg.filters?.levels===void 0)return!1;let $=V7(this.cfg.levels,this.cfg.filters.levels.values);if(EW(this.cfg.filters.levels.type,$,this.level.level))return!0;return!1}failsNamespacesFilter($){if(this.cfg.filters?.namespaces===void 0)return!1;if(this.cfg.filters.namespaces.values.length>0&&$.namespace===void 0)return!0;if(this.cfg.filters.namespaces.type==="include"){let K=$.namespace??[];return hW(this.cfg.filters.namespaces.values,K)}let q=$.namespace??[];return RW(this.cfg.filters.namespaces.values,q)}failsLabelsFilter($){if(this.cfg.filters?.labels===void 0)return!1;if(this.cfg.filters.labels.values.length>0&&$.label===void 0)return!0;let q=$.label?[$.label.name]:[];if(this.cfg.filters.labels.type==="include")return hW(this.cfg.filters.labels.values,q);return RW(this.cfg.filters.labels.values,q)}}class Dj extends E8{timestampFormatFunction=($)=>JV($);formatBrowser($,q,K){return this.formatMessage($,q,K)}formatServer($,q,K){return this.formatMessage($,q,K)}formatMessage($,q,K){if(this.cfg.meta.hostname===void 0)console.warn(Error("Adze: 'hostname' is required for the common log format. Please provide this value in your log's meta data."));let P=this.cfg.meta.hostname,_=this.cfg.meta.ident??"-",O=this.cfg.meta.user??"-",j=K[0];return[`${P} ${_} ${O} [${q}] ${j}`]}}var TV=Dj;function wV($){return typeof $.name==="string"&&typeof $.hostname==="string"}class gj extends E8{timestampFormatFunction=($)=>b4($);formatBrowser($,q,K){return this.formatMessage($,q,K)}formatServer($,q,K){return this.formatMessage($,q,K)}formatMessage($,q,K){let P=Mj(),_=[...K],O=_.shift();if(wV(this.cfg.meta)){let{src:j,err:z,req_id:J,req:w,res:G,latency:f,hostname:A,name:V,...C}=this.cfg.meta,{namespace:E,label:R}=$,I={v:1,level:this.level.level,levelName:this.level.levelName,name:V,hostname:A,msg:O,args:_,pid:P.pid,time:q,meta:Object.keys(C).length>0?C:void 0,namespace:E,label:R?.name,src:j,err:z,req_id:J,req:w,res:G,latency:f};return[JSON.stringify(I)]}return console.warn(Error("Adze: Required fields are missing from the log meta for generating a JSON log.")),[..._]}}var ZV=gj;class Lj extends E8{formatBrowser($,q,K){let P=this.formatLeader(),_=this.formatMeta($,q);if(this.cfg.withEmoji)return[P,"font-size: 12px;",this.level.style,_,...K];return[P,this.level.style,_,...K]}formatServer($,q,K){let P=[],O=`${NW(this.formatLeader(!1),this.cfg.withEmoji,this.level.emoji)} `,j=this.formatMeta($,q),z=CW(O,this.level.terminalStyle);return P.push(z),j!==""&&P.push(j),[z,j,...K]}formatLeader($=!0){let q=$?"%c":"",K=" "+VW(this.level.levelName);if(this.cfg.withEmoji)return`${q}${this.formatEmoji($)}${q}${K}`;return`${q}${K}`}formatEmoji($){let q=$?" ":"";return this.level.emoji?`${this.level.emoji}${q}`:""}formatMeta($,q){let K=this.cfg.showTimestamp?`${q} `:"",P=IW($.namespace),_=DW($.label),O=this.formatTime($),j=gW($.label?.count),z=LW($.assertion,this.cfg.withEmoji),J=bW($.if,this.cfg.withEmoji),w=z!==""?z:J!==""?J:"";return K+P+_+O+j+w}formatTime($){let q=this.cfg.withEmoji?"⏱ ":"Time elapsed: ";if($.timeNow)return`(${q}${$.timeNow})`;return $.label?.timeElapsed?`(${q}${$.label.timeElapsed})`:""}}var mW=Lj;class h7 extends E8{timestampFormatFunction=($)=>b4($);formatBrowser($,q,K){return this.formatMessage(q,$,K)}formatServer($,q,K){return this.formatMessage(q,$,K)}formatMessage($,q,K){let P="",{appname:_,hostname:O,port:j}=this.cfg.meta,z=h4(j)?`/${j}`:"",J=E4(_)?`${_}${z}`:"",w=E4(O)?` on ${O}: `:"",G=this.formatNamespace(q.namespace),f=q.label?`[${q.label.name}] `:"";return P=`${J}${w}${G}${f}`,[`[${$}] ${this.level.levelName.toUpperCase()}: ${P}${K[0]} `,K.map((A)=>zV(A)?JSON.stringify(A):A).slice(1).join(" ")]}formatNamespace($){if($&&$.length>0)return`${$.reduce((K,P,_)=>{return _===$.length-1?`${K}${P}`:`${K}${P}/`},"")} `;return""}}var XW=["group","groupCollapsed"],XV=["dir","dirxml","table",...XW],fW=["error","warn","info","log","debug",...XV],kW=["clear","groupEnd"],KV=[...XV,...kW],yK$=[...fW,...kW];var q8={activeLevel:"log",cache:!1,cacheSize:300,dump:!1,format:"pretty",meta:{},middleware:[],showTimestamp:!1,silent:!1,withEmoji:!1,levels:{alert:mc(),error:dc(),warn:lc(),info:oc(),fail:rc(),success:nc(),log:ic(),debug:tc(),verbose:Bc()},formatters:{default:mW,pretty:mW,standard:h7,common:TV,json:ZV}};function mc($={}){return{levelName:"alert",level:0,style:"padding-right: 24px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fc8585, #fc2323); color: #fff; border-color: #b70101;",terminalStyle:["white","bold","bgRed"],method:"error",emoji:"\uD83D\uDEA8",...$}}function dc($={}){return{levelName:"error",level:1,style:"padding-right: 24px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fff, #ffd1d1); color: #a4000f; border-color: #e3bbbb;",terminalStyle:["white","bgRed"],method:"error",emoji:"\uD83D\uDD25",...$}}function lc($={}){return{levelName:"warn",level:2,style:`font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fff, #fff0a8); color: #715100; border-color: #e3d696; padding-right: ${eG()?"44px":"30px"};`,terminalStyle:["white","bgYellow"],method:"warn",emoji:"\uD83D\uDD14",...$}}function oc($={}){return{levelName:"info",level:3,style:"padding-right: 44px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #d8ebff, #b2d7ff); color: #465464; border-color: #96b5d7;",terminalStyle:["white","bgBlue"],method:"info",emoji:"ℹ️",...$}}function rc($={}){return{levelName:"fail",level:4,style:"padding-right: 44px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #ffe8e8, #ffd1d1); color: #a4000f; border-color: #e3bbbb;",terminalStyle:["white","bgRed"],method:"info",emoji:"❌",...$}}function nc($={}){return{levelName:"success",level:5,style:"font-size: 12px; border-radius: 4px; padding-right: 22px; background: linear-gradient(to right, #e6f6e4, #ceedc9); color: #4e594d; border-color: #b7d1b3;",terminalStyle:["white","bgGreen"],method:"info",emoji:"\uD83C\uDF89",...$}}function ic($={}){return{levelName:"log",level:6,style:"font-size: 12px; border-radius: 4px; padding-right: 51px; background: linear-gradient(to right, #ecedef, #d9dce0); color: #333435; border-color: #bfc1c5;",terminalStyle:["white","bgBlackBright"],method:"log",emoji:"\uD83E\uDEB5",...$}}function tc($={}){return{levelName:"debug",level:7,style:"font-size: 12px; padding-right: 36px; border-right: 1px solid #d9dce0; color: #465464; border-color: #999999;",terminalStyle:["white","bgBlack"],method:"debug",emoji:"\uD83D\uDC1E",...$}}function Bc($={}){return{levelName:"verbose",level:8,style:"font-size: 12px; padding-right: 22px; color: #999999;",terminalStyle:["black","italic"],method:"debug",emoji:"\uD83D\uDCAC",...$}}class L4{logCfg;glblCfg;constructor($){this.logCfg=$??{},this.glblCfg=globalThis.$adzeGlobal?.configuration}updateConfiguration($){this.logCfg=$}get activeLevel(){return this.glblCfg?.activeLevel??this.logCfg.activeLevel??q8.activeLevel}set activeLevel($){this.logCfg.activeLevel=$}get cache(){return this.glblCfg?.cache??this.logCfg.cache??q8.cache}set cache($){this.logCfg.cache=$}get cacheSize(){return this.glblCfg?.cacheSize??this.logCfg.cacheSize??q8.cacheSize}set cacheSize($){this.logCfg.cacheSize=$}get dump(){return this.glblCfg?.dump??this.logCfg.dump??q8.dump}set dump($){this.logCfg.dump=$}get meta(){return{...this.logCfg.meta,...this.glblCfg?.meta}}set meta($){this.logCfg.meta=$}get silent(){return this.glblCfg?.silent??this.logCfg.silent??q8.silent}set silent($){this.logCfg.silent=$}get showTimestamp(){return this.glblCfg?.showTimestamp??this.logCfg.showTimestamp??q8.showTimestamp}set showTimestamp($){this.logCfg.showTimestamp=$}get withEmoji(){return this.glblCfg?.withEmoji??this.logCfg.withEmoji??q8.withEmoji}set withEmoji($){this.logCfg.withEmoji=$}get format(){return this.glblCfg?.format??this.logCfg.format??q8.format}set format($){this.logCfg.format=$}get levels(){return{...q8.levels,...this.logCfg.levels??{},...this.glblCfg?.levels??{}}}set levels($){this.logCfg.levels=$}get middleware(){return[...this.glblCfg?.middleware??[],...this.logCfg.middleware??[]]}set middleware($){this.logCfg.middleware=$}get filters(){return this.glblCfg?.filters??this.logCfg.filters}set filters($){this.logCfg.filters=$}get timestampFormatter(){return this.glblCfg?.timestampFormatter??this.logCfg.timestampFormatter}set timestampFormatter($){this.logCfg.timestampFormatter=$}get formatters(){return{...q8.formatters,...this.logCfg.formatters??{},...this.glblCfg?.formatters??{}}}set formatters($){this.logCfg.formatters=$}exportValues(){return{activeLevel:this.logCfg.activeLevel,cache:this.logCfg.cache,cacheSize:this.logCfg.cacheSize,dump:this.logCfg.dump,meta:this.logCfg.meta,silent:this.logCfg.silent,showTimestamp:this.logCfg.showTimestamp,withEmoji:this.logCfg.withEmoji,format:this.logCfg.format,levels:this.logCfg.levels,middleware:this.logCfg.middleware,filters:this.logCfg.filters,timestampFormatter:this.logCfg.timestampFormatter,formatters:this.logCfg.formatters}}}function Uc($){return typeof $==="function"}class u4{globalStore;_cfg;_modifierData;_data;modifierQueue=[];constructor($,q){this.globalStore=Mj($),this._modifierData=q??{},this._cfg=new L4($),this.doHook((K)=>{if(K.constructed)K.constructed(this)})}get data(){return this._data}get modifierData(){return this._modifierData}get configuration(){return this._cfg}alert(...$){this.terminate("alert",$)}static alert(...$){new this().alert(...$)}error(...$){this.terminate("error",$)}static error(...$){new this().error(...$)}warn(...$){this.terminate("warn",$)}static warn(...$){new this().warn(...$)}info(...$){this.terminate("info",$)}static info(...$){new this().info(...$)}fail(...$){this.terminate("fail",$)}static fail(...$){new this().fail(...$)}success(...$){this.terminate("success",$)}static success(...$){new this().success(...$)}log(...$){this.terminate("log",$)}static log($,...q){new this().log(...[$,...q])}debug(...$){this.terminate("debug",$)}static debug(...$){new this().debug(...$)}verbose(...$){this.terminate("verbose",$)}static verbose(...$){new this().verbose(...$)}clear(){console.clear()}static clear(){console.clear()}clr(){console.clear()}static clr(){console.clear()}custom($,...q){if(!this._cfg.levels[$])return console.warn(Error("Custom log level not found in configuration.")),this;return this.terminate($,q),this}static custom($,...q){return new this().custom($,...q)}seal($){if($)this._cfg.updateConfiguration($);return xW(u4,this._cfg,this.modifierData,this.modifierQueue)}static seal($){return new this().seal($)}sealTag($,q){return this._cfg=new L4({...this._cfg.exportValues(),...q}),(K,...P)=>{let _=String.raw({raw:K},...P),O=xW(u4,this._cfg,this.modifierData,this.modifierQueue),j=$;if(Uc(O[j]))O[j](_)}}static sealTag($,q){return new this().sealTag($,q)}thread($,q){if(this.runModifierQueue(),this._modifierData.label){if(!this._modifierData.label.context)this._modifierData.label.context={};this._modifierData.label.context={...this._modifierData.label.context,[$]:q}}}static thread($,q){new this().thread($,q)}assert($){return this.modifierQueue.push(["assert",(q)=>{return q.assertion=$,q}]),this}static assert($){return new this().assert($)}get closeThread(){return this.modifierQueue.push(["closeThread",($)=>{if($.label?.context)$.label.context=void 0;return $}]),this}static get closeThread(){return new this().closeThread}get count(){return this.modifierQueue.push(["count",($)=>{if($.label)$.label.count=$.label.count!==void 0?$.label.count+1:1;return $}]),this}static get count(){return new this().count}get countClear(){return this.modifierQueue.push(["countClear",($)=>{if($.label)delete $.label.count;return $}]),this}static get countClear(){return new this().countClear}get countReset(){return this.modifierQueue.push(["countReset",($)=>{if($.label)$.label.count=0;return $}]),this}static get countReset(){return new this().countReset}get dir(){return this.modifierQueue.push(["dir",($)=>{return $.method="dir",$}]),this}static get dir(){return new this().dir}get dirxml(){return this.modifierQueue.push(["dirxml",($)=>{return $.method="dirxml",$}]),this}static get dirxml(){return new this().dirxml}get dump(){return this.modifierQueue.push(["dump",($,q)=>{return q._cfg.dump=!0,$}]),this}static get dump(){return new this().dump}format($){return this.modifierQueue.push(["format",(q,K)=>{if(Object.keys(K._cfg.formatters).includes($))return K._cfg.format=$,q;return console.warn(Error(`Adze: Formatter "${$}" not found in configuration.`)),q}]),this}static format($){return new this().format($)}get group(){return this.modifierQueue.push(["group",($)=>{return $.method="group",$}]),this}static get group(){return new this().group}get groupCollapsed(){return this.modifierQueue.push(["groupCollapsed",($)=>{return $.method="groupCollapsed",$}]),this}static get groupCollapsed(){return new this().groupCollapsed}get groupEnd(){return this.modifierQueue.push(["groupEnd",($)=>{return $.method="groupEnd",$}]),this}static get groupEnd(){return new this().groupEnd}if($){return this.modifierQueue.push(["if",(q)=>{return q.if=$,q}]),this}static if($){return new this().if($)}test($){return this.if($)}static test($){return new this().if($)}label($){return this.modifierQueue.unshift(["label",(q)=>{let K=this.globalStore.getLabel($)??{name:$};return q.label=K,this.globalStore.setLabel($,K),q}]),this}static label($){return new this().label($)}meta($){return this.modifierQueue.push(["meta",(q,K)=>{return K._cfg.meta={...K._cfg.meta,...$},q}]),this}static meta($){return new this().meta($)}namespace(...$){return this.modifierQueue.push(["namespace",(q)=>{let K=q.namespace??[];return q.namespace=K.length>0?[...K,...$]:$,q}]),this}static namespace(...$){return new this().namespace(...$)}ns(...$){return this.namespace(...$)}static ns(...$){return new this().namespace(...$)}get silent(){return this.modifierQueue.push(["silent",($,q)=>{return q._cfg.silent=!0,$}]),this}static get silent(){return new this().silent}get table(){return this.modifierQueue.push(["table",($)=>{return $.method="table",$}]),this}static get table(){return new this().table}get time(){return this.modifierQueue.push(["time",($)=>{let q=Ij();if($.label)$.label.timeStart=q;return $}]),this}static get time(){return new this().time}get timeEnd(){return this.modifierQueue.push(["timeEnd",($)=>{if($.label?.timeStart)$.label.timeElapsed=cW(Ij($.label.timeStart));return $}]),this}static get timeEnd(){return new this().timeEnd}get timeNow(){return this.modifierQueue.push(["timeNow",($)=>{return $.timeNow=HV(),$}]),this}static get timeNow(){return new this().timeNow}get timestamp(){return this.modifierQueue.push(["timestamp",($,q)=>{return q._cfg.showTimestamp=!0,$}]),this}static get timestamp(){return new this().timestamp}get trace(){return this.modifierQueue.push(["trace",($)=>{return $.stacktrace=_V(),$}]),this}static get trace(){return new this().trace}get withEmoji(){return this.modifierQueue.push(["withEmoji",($,q)=>{return q._cfg.withEmoji=!0,$}]),this}static get withEmoji(){return new this().withEmoji}print($){if(QG())return;if($.silent)return;if($.message.length<1)return;if(Nj($.method))console[$.method](...$.message);else console[$.method]()}terminate($,q){this.doHook((I)=>{if(I.beforeTerminated)I.beforeTerminated(this,$,q)}),this.runModifierQueue();let K=this.getLevelConfig($),_=new(this.selectFormatter(this._cfg.format))(this._cfg,K),O=_.timestampFormatter(new Date),j=vV(_.print(this.modifierData,O,q));if(this._cfg.dump&&this.modifierData.label?.context)j.push(this.modifierData.label.context);this.doHook((I)=>{if(I.beforeFormatApplied)j=I.beforeFormatApplied(this,this._cfg.format,j)});let{activeLevel:z,cache:J,cacheSize:w,dump:G,format:f,meta:A,showTimestamp:V,silent:C,withEmoji:E}=this._cfg,R={activeLevel:z,cache:J,cacheSize:w,dump:G,format:f,meta:A,showTimestamp:V,silent:C,withEmoji:E,...K,...this._modifierData,terminator:$,args:q,timestamp:O,message:j};if(this.doHook((I)=>{if(I.afterFormatApplied)I.afterFormatApplied(this,this._cfg.format,j)}),this._data=R,this._cfg.cache)this.globalStore.addLogToCache(this);this.doHook((I)=>{if(I.beforePrint)I.beforePrint(this)}),this.print(this._data),this.doHook((I)=>{if(I.afterTerminated)I.afterTerminated(this,$,q)}),this.globalStore.getListeners(K.level).forEach((I)=>{I(this)})}selectFormatter($){return this._cfg.formatters[$]}getLevelConfig($){return this._cfg.levels[$]}runModifierQueue(){this.modifierQueue.forEach(([$,q])=>{let K=q(this.modifierData,this);this.doHook((P)=>{if(P.beforeModifierApplied)P.beforeModifierApplied(this,$,K)}),this._modifierData=K,this.doHook((P)=>{if(P.afterModifierApplied)P.afterModifierApplied(this,$,K)})})}doHook($){this._cfg.middleware?.forEach((q)=>{$(q)})}}class Fc{targetEnvironment;environment=TK()?"browser":"server";dependencyLoaders=[];constructor($){if(this.targetEnvironment=$??"both",!TK()&&(this.targetEnvironment==="server"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadServerDependencies());if(TK()&&(this.targetEnvironment==="browser"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadBrowserDependencies())}async load(){await Promise.all(this.dependencyLoaders)}async loadServerDependencies(){}async loadBrowserDependencies(){}}var ac=["black","red","green","yellow","blue","magenta","cyan","white","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","reset","bold","dim","italic","underline","inverse","hidden","strikethrough"],fV=Object.freeze(ac);var kV=u4;var v_$={__noop:()=>{}},bj={trace:10,verbose:10,debug:20,success:27,progress:28,log:29,info:30,warn:40,error:50,fatal:60,alert:60},Jm={10:"trace",20:"debug",27:"success",28:"progress",29:"log",30:"info",40:"warn",50:"error",60:"fatal"};function MV($,q){let K=bj[$.toLowerCase()]||30,P=bj[q.toLowerCase()]||30;return K>=P}function dW($){try{let q=new WeakSet;return JSON.stringify($,(K,P)=>{if(typeof P==="object"&&P!==null){if(q.has(P))return"[Circular]";q.add(P)}return P})}catch{return String($)}}function NV($){if(!$)return!1;let q=$.toLowerCase().trim();return q==="true"||q==="1"||q==="yes"||q==="on"}var Tm="info",uj=xK("LOG_LEVEL")||Tm,H_$={fatal:60,error:50,warn:40,info:30,log:29,progress:28,success:27,debug:20,trace:10},lW=NV(xK("LOG_JSON_FORMAT")),oW=NV(xK("LOG_TIMESTAMPS")??"true");function wm($=100){let q=[];return{write(K){if(q.push(K),q.length>$)q.shift()},clear(){q.length=0},recentLogs(){return q.map((K)=>{let P=oW?new Date(K.time).toISOString():"",_=Jm[K.level??30]||"info";return`${P} ${_} ${K.msg}`.trim()}).join(`
|
|
332
|
+
`)}}}var R7=wm(),CV=()=>{let $=uj.toLowerCase();if($==="trace")return"verbose";if($==="debug")return"debug";if($==="log")return"log";if($==="info")return"info";if($==="warn")return"warn";if($==="error")return"error";if($==="fatal")return"alert";return"info"},Zm=CV(),EV={alert:{levelName:"alert",level:0,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","white","bold"],method:"error",emoji:""},error:{levelName:"error",level:1,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","whiteBright","bold"],method:"error",emoji:""},warn:{levelName:"warn",level:2,style:"font-size: 12px; color: #ffaa00;",terminalStyle:["bgYellow","black","bold"],method:"warn",emoji:""},info:{levelName:"info",level:3,style:"font-size: 12px; color: #0099ff;",terminalStyle:["cyan"],method:"info",emoji:""},fail:{levelName:"fail",level:4,style:"font-size: 12px; color: #ff6600;",terminalStyle:["red","underline"],method:"error",emoji:""},success:{levelName:"success",level:5,style:"font-size: 12px; color: #00cc00;",terminalStyle:["green"],method:"log",emoji:""},log:{levelName:"log",level:6,style:"font-size: 12px; color: #888888;",terminalStyle:["white"],method:"log",emoji:""},debug:{levelName:"debug",level:7,style:"font-size: 12px; color: #9b59b6;",terminalStyle:["gray","dim"],method:"debug",emoji:""},verbose:{levelName:"verbose",level:8,style:"font-size: 12px; color: #666666;",terminalStyle:["gray","dim","italic"],method:"debug",emoji:""}},Xm=wW({activeLevel:Zm,format:lW?"json":"pretty",timestampFormatter:oW?void 0:()=>"",withEmoji:!1,levels:EV});Xm.addListener("*",($)=>{try{let q=$.data,K=Array.isArray(q?.message)?q.message.map((_)=>typeof _==="string"?_:dW(_)).join(" "):typeof q?.message==="string"?q.message:"",P={time:Date.now(),level:typeof q?.level==="number"?q.level:void 0,msg:K};R7.write(P)}catch{}});function fm($){let q=kV,K=[];if(typeof $.namespace==="string")K.push($.namespace);if(Array.isArray($.namespaces))K.push(...$.namespaces);if(K.length>0)q=q.ns(...K);let P={...$};if(delete P.namespace,delete P.namespaces,lW){if(!P.name)P.name="elizaos";if(!P.hostname){let O="unknown";if(typeof process<"u"&&process.platform)try{O=(SV(),w6(VV)).hostname()}catch{O="localhost"}else if(typeof window<"u"&&window.location)O=window.location.hostname||"browser";P.hostname=O}}let _={activeLevel:CV(),format:lW?"json":"pretty",timestampFormatter:oW?void 0:()=>"",withEmoji:!1,levels:EV};return q.meta(P).seal(_)}function km($){let q=uj,K={},P;if(typeof $==="object"&&$!==null){if("level"in $)q=$.level;if("maxMemoryLogs"in $&&typeof $.maxMemoryLogs==="number")P=$.maxMemoryLogs;let{level:_,maxMemoryLogs:O,...j}=$;K=j}return{level:q,base:K,maxMemoryLogs:P}}function I7($=!1){let{level:q,base:K,maxMemoryLogs:P}=km($);if(typeof P==="number"&&P>0)R7.clear();if(typeof $==="object"&&$&&"__forceType"in $&&$.__forceType==="browser"){let m=(typeof q==="number"?"info":q||uj).toLowerCase(),q$=(...r)=>{return r.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return dW(M)}).join(" ")},e=(r,...M)=>{if(!MV(r,m))return;let Y=q$(...M),H=r==="fatal"?"error":r==="trace"||r==="verbose"?"debug":r==="success"||r==="progress"?"info":r==="log"?"log":console[r]?r:"log";if(typeof console[H]==="function")console[H](Y)},l=(r,M,...Y)=>{if(typeof r==="string")return M!==void 0?[r,M,...Y]:[r,...Y];if(r instanceof Error)return M!==void 0?[r.message,M,...Y]:[r.message,...Y];if(M!==void 0)return[M,r,...Y];return[r,...Y]};return{level:m,trace:(r,M,...Y)=>e("trace",...l(r,M,...Y)),debug:(r,M,...Y)=>e("debug",...l(r,M,...Y)),info:(r,M,...Y)=>e("info",...l(r,M,...Y)),warn:(r,M,...Y)=>e("warn",...l(r,M,...Y)),error:(r,M,...Y)=>e("error",...l(r,M,...Y)),fatal:(r,M,...Y)=>e("fatal",...l(r,M,...Y)),success:(r,M,...Y)=>e("success",...l(r,M,...Y)),progress:(r,M,...Y)=>e("progress",...l(r,M,...Y)),log:(r,M,...Y)=>e("log",...l(r,M,...Y)),clear:()=>{if(typeof console.clear==="function")console.clear()},child:(r)=>I7({level:m,...K,...r,__forceType:"browser"})}}let O=fm(K),z=(typeof q==="number"?"info":q||uj).toLowerCase(),J=(c,m)=>{},w=(c,...m)=>{if(!MV(c,z))return;J(c,m);try{let l="";if(m.length>0)l=m.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return dW(M)}).join(" ");if(K.namespace)l=`#${K.namespace} ${l}`;let r={time:Date.now(),level:bj[c.toLowerCase()]||bj.info,msg:l};R7.write(r)}catch{}let q$=c,e=m;if(c==="fatal")q$="alert";else if(c==="progress")q$="info",e=["[PROGRESS]",...m];else if(c==="success")q$="info",e=["[SUCCESS]",...m];else if(c==="trace")q$="verbose";try{O[q$](...e)}catch(l){console.log(`[${c.toUpperCase()}]`,...m)}},G=(c,m,...q$)=>{if(typeof c==="string")return m!==void 0?[c,m,...q$]:[c,...q$];if(c instanceof Error)return m!==void 0?[c.message,{error:c},m,...q$]:[c.message,{error:c},...q$];if(m!==void 0)return[m,c,...q$];return[c,...q$]};return{level:z,trace:(c,m,...q$)=>w("verbose",...G(c,m,...q$)),debug:(c,m,...q$)=>w("debug",...G(c,m,...q$)),info:(c,m,...q$)=>w("info",...G(c,m,...q$)),warn:(c,m,...q$)=>w("warn",...G(c,m,...q$)),error:(c,m,...q$)=>w("error",...G(c,m,...q$)),fatal:(c,m,...q$)=>w("fatal",...G(c,m,...q$)),success:(c,m,...q$)=>w("success",...G(c,m,...q$)),progress:(c,m,...q$)=>w("progress",...G(c,m,...q$)),log:(c,m,...q$)=>w("log",...G(c,m,...q$)),clear:()=>{try{if(typeof console?.clear==="function")console.clear()}catch{}R7.clear()},child:(c)=>{return I7({level:z,...K,...c})}}}var c6=I7(),J_$=c6,T_$=()=>R7.recentLogs();var r8=c6;function RV($){return $.replace(/(?<!{){{(?![{#\/!>])([\s\S]*?)}}/g,(q,K)=>{if(K.trim()==="else")return`{{${K}}}`;return`{{{${K}}}}`})}var IV=({state:$,template:q})=>{let K=typeof q==="function"?q({state:$}):q,P=rW.default.compile(RV(K));return DV(P($),10)},S_$=({state:$,template:q})=>{let K=typeof q==="function"?q({state:$}):q,P=rW.default.compile(RV(K)),j=Object.keys($).filter((J)=>!["text","values","data"].includes(J)).reduce((J,w)=>{return J[w]=$[w],J},{});return DV(P({...j,...$.values}),10)},M_$=($,q)=>{return q.length>0?`${$?`${$}
|
|
333
333
|
`:$}${q}
|
|
334
|
-
`:""},DV=($,q)=>{let K=Array.from({length:q},()=>Gj({dictionaries:[Vj]})),P=$;for(let _=0;_<K.length;_++)P=P.replaceAll(`{{name${_+1}}}`,K[_]);return P},
|
|
334
|
+
`:""},DV=($,q)=>{let K=Array.from({length:q},()=>Gj({dictionaries:[Vj]})),P=$;for(let _=0;_<K.length;_++)P=P.replaceAll(`{{name${_+1}}}`,K[_]);return P},N_$=({messages:$,entities:q,conversationHeader:K=!0})=>{let P={};return $.forEach((j)=>{if(j.roomId){if(!P[j.roomId])P[j.roomId]=[];P[j.roomId].push(j)}}),Object.values(P).forEach((j)=>{j.sort((z,J)=>(z.createdAt||0)-(J.createdAt||0))}),Object.entries(P).sort(([,j],[,z])=>(z[z.length-1]?.createdAt||0)-(j[j.length-1]?.createdAt||0)).map(([j,z])=>{let J=z.filter((G)=>G.entityId).map((G)=>{let f=q.find((C)=>C.id===G.entityId);if(!f)r8.warn({entityId:G.entityId},"core::prompts:formatPosts - no entity for");let A=f?.names[0]||"Unknown User",V=f?.names[0]||"unknown";return`Name: ${A} (@${V} EntityID:${G.entityId})
|
|
335
335
|
MessageID: ${G.id}${G.content.inReplyTo?`
|
|
336
336
|
In reply to: ${G.content.inReplyTo}`:""}
|
|
337
337
|
Source: ${G.content.source}
|
|
@@ -342,15 +342,15 @@ ${G.content.text}`});return`${K?`Conversation: ${j.slice(-5)}
|
|
|
342
342
|
|
|
343
343
|
`)}`}).join(`
|
|
344
344
|
|
|
345
|
-
`)},
|
|
345
|
+
`)},C_$=({messages:$,entities:q})=>{return $.reverse().filter((P)=>P.entityId).map((P)=>{let _=P.content.text,O=P.content.actions,j=P.content.thought,z=q.find((u)=>u.id===P.entityId)?.names[0]||"Unknown User",J=P.content.attachments,w=J&&J.length>0?` (Attachments: ${J.map((u)=>{let y=[`[${u.id} - ${u.title} (${u.url})]`];if(u.text)y.push(`Text: ${u.text}`);if(u.description)y.push(`Description: ${u.description}`);return y.join(`
|
|
346
346
|
`)}).join(J.every((u)=>!u.text&&!u.description)?", ":`
|
|
347
347
|
`)})`:null,G=new Date(P.createdAt||0),f=G.getHours().toString().padStart(2,"0"),A=G.getMinutes().toString().padStart(2,"0"),V=`${f}:${A}`,C=gV(P.createdAt||0),E=j?`(${z}'s internal thought: ${j})`:null,R=`${V} (${C}) [${P.entityId}]`,I=_?`${R} ${z}: ${_}`:null,D=O&&O.length>0?`${I?"":R} (${z}'s actions: ${O.join(", ")})`:null;return[I,E,D,w].filter(Boolean).join(`
|
|
348
348
|
`)}).join(`
|
|
349
|
-
`)},gV=($)=>{let K=new Date().getTime()-$,P=Math.abs(K),_=Math.floor(P/1000),O=Math.floor(_/60),j=Math.floor(O/60),z=Math.floor(j/24);if(P<60000)return"just now";if(O<60)return`${O} minute${O!==1?"s":""} ago`;if(j<24)return`${j} hour${j!==1?"s":""} ago`;return`${z} day${z!==1?"s":""} ago`},Am=/```json\n([\s\S]*?)\n```/;function LV($){if(!$)return null;let q=$.match(/<response>([\s\S]*?)<\/response>/),K;if(q)K=q[1],r8.debug("Found response XML block");else{let z=((J)=>{let w=0,G=J.length;while(w<G){let f=J.indexOf("<",w);if(f===-1)break;if(J.startsWith("</",f)||J.startsWith("<!--",f)||J.startsWith("<?",f)){w=f+1;continue}let A=f+1,V="";while(A<G){let b=J[A];if(/^[A-Za-z0-9_-]$/.test(b)){V+=b,A++;continue}break}if(!V){w=f+1;continue}let C=J.indexOf(">",A);if(C===-1)break;let E=J.slice(f,C+1);if(/\/\s*>$/.test(E)){w=C+1;continue}let R=`</${V}>`,I=1,D=C+1;while(I>0&&D<G){let b=J.indexOf(`<${V}`,D),u=J.indexOf(R,D);if(u===-1)break;if(b!==-1&&b<u){let y=J.indexOf(">",b+1);if(y===-1)break;let c=J.slice(b,y+1);if(/\/\s*>$/.test(c))D=y+1;else I++,D=y+1}else I--,D=u+R.length}if(I===0){let b=D-R.length,u=J.slice(C+1,b);return{tag:V,content:u}}w=C+1}return null})($);if(!z)return r8.warn("Could not find XML block in text"),r8.debug({textPreview:$.substring(0,200)+"..."},"Text content"),null;K=z.content,r8.debug(`Found XML block with tag: ${z.tag}`)}let P={},O=((j)=>{let z=[],J=j.length,w=0;while(w<J){let G=j.indexOf("<",w);if(G===-1)break;if(j.startsWith("</",G)||j.startsWith("<!--",G)||j.startsWith("<?",G)){w=G+1;continue}let f=G+1,A="";while(f<J){let y=j[f];if(/^[A-Za-z0-9_-]$/.test(y)){A+=y,f++;continue}break}if(!A){w=G+1;continue}let V=j.indexOf(">",f);if(V===-1)break;let C=j.slice(G,V+1);if(/\/\s*>$/.test(C)){w=V+1;continue}let E=`</${A}>`,R=1,I=V+1;while(R>0&&I<J){let y=j.indexOf(`<${A}`,I),c=j.indexOf(E,I);if(c===-1)break;if(y!==-1&&y<c){let m=j.indexOf(">",y+1);if(m===-1)break;let q$=j.slice(y,m+1);if(!/\/\s*>$/.test(q$))R++;I=m+1}else R--,I=c+E.length}if(R!==0){w=V+1;continue}let D=I-E.length,u=j.slice(V+1,D).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").trim();z.push({key:A,value:u}),w=I}return z})(K);for(let{key:j,value:z}of O)if(j==="actions"||j==="providers"||j==="evaluators")P[j]=z?z.split(",").map((J)=>J.trim()):[];else if(j==="simple")P[j]=z.toLowerCase()==="true";else P[j]=z;if(Object.keys(P).length===0)return r8.warn("No key-value pairs extracted from XML content"),r8.debug({xmlPreview:K.substring(0,200)+"..."},"XML content was"),null;return P}function C_$($){let q=null,K=$.match(Am);try{if(K)q=JSON.parse(hV(K[1].trim()));else q=JSON.parse(hV($.trim()))}catch(P){return null}if(q&&typeof q==="object"&&!Array.isArray(q))return q;return null}var hV=($)=>{return $=$.replace(/\{\s+/,"{").replace(/\s+\}/,"}").trim(),$=$.replace(/("[\w\d_-]+")\s*: \s*(?!"|\[)([\s\S]+?)(?=(,\s*"|\}$))/g,'$1: "$2"'),$=$.replace(/"([^"]+)"\s*:\s*'([^']*)'/g,(q,K,P)=>`"${K}": "${P}"`),$=$.replace(/("[\w\d_-]+")\s*:\s*([A-Za-z_]+)(?!["\w])/g,'$1: "$2"'),$};function E_$($,q){if($.length<=q)return $;let K=$.lastIndexOf(".",q-1);if(K!==-1){let O=$.slice(0,K+1).trim();if(O.length>0)return O}let P=$.lastIndexOf(" ",q-1);if(P!==-1){let O=$.slice(0,P).trim();if(O.length>0)return`${O}...`}return`${$.slice(0,q-3).trim()}...`}async function h_$($,q=512,K=20){r8.debug("[splitChunks] Starting text split");let P=3.5,O=await new z7({chunkSize:Number(Math.floor(q*P)),chunkOverlap:Number(Math.floor(K*P))}).splitText($);return r8.debug({numberOfChunks:O.length,averageChunkSize:O.reduce((j,z)=>j+z.length,0)/O.length},"[splitChunks] Split complete"),O}async function R_$($,q,K){if(!$)throw Error("Trim tokens received a null prompt");if($.length<q/5)return $;if(q<=0)throw Error("maxTokens must be positive");let P=await K.useModel(Sq.TEXT_TOKENIZER_ENCODE,{prompt:$});if(P.length<=q)return $;let _=P.slice(-q);return await K.useModel(Sq.TEXT_TOKENIZER_DECODE,{tokens:_})}function nW(){let $=new WeakSet;return function(q,K){if(typeof K==="object"&&K!==null){if($.has(K))return"[Circular]";$.add(K)}return K}}function I_$($){if(!$)return!1;let q=["YES","Y","TRUE","T","1","ON","ENABLE"],K=["NO","N","FALSE","F","0","OFF","DISABLE"],P=$.trim().toUpperCase();if(q.includes(P))return!0;if(K.includes(P))return!1;return!1}var Gm=i$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format");function Vm($){let q=Gm.safeParse($);return q.success?q.data:null}function D7($){if(typeof $==="number")$=$.toString();if(typeof $!=="string")throw TypeError("Value must be string");let q=Vm($);if(q)return q;let K=encodeURIComponent($),_=Sm(K).slice(0,16);return _[8]=_[8]&63|128,_[6]=_[6]&15|0,Nm(_)}async function D_$($){if(!iW())return;let q=$.map(async(K)=>{let P=encodeURIComponent(K),_=await bV(P);f_.set(P,_)});await Promise.all(q)}var f_=new Map,yj=null;function iW(){if(yj!==null)return yj;try{if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle&&typeof globalThis.crypto.subtle.digest==="function")return yj=!0,!0}catch{}return yj=!1,!1}function Sm($){let q=f_.get($);if(q)return q;let K=uV($);if(f_.set($,K),iW())bV($).then((P)=>{f_.set($,P)}).catch(()=>{});if(f_.size>1e4)Array.from(f_.keys()).slice(0,5000).forEach((_)=>f_.delete(_));return K}async function bV($){if(iW())try{let K=new TextEncoder().encode($),P=await globalThis.crypto.subtle.digest("SHA-1",K);return new Uint8Array(P)}catch{}return uV($)}function uV($){let q=Mm($),K=q.length,P=new Uint8Array(K+9+63>>>6<<6);P.set(q),P[K]=128;let _=K*8,O=new DataView(P.buffer);O.setUint32(P.length-4,_>>>0,!1),O.setUint32(P.length-8,Math.floor(_/4294967296)>>>0,!1);let j=1732584193,z=4023233417,J=2562383102,w=271733878,G=3285377520,f=new Uint32Array(80);for(let C=0;C<P.length;C+=64){for(let u=0;u<16;u++)f[u]=O.getUint32(C+u*4,!1);for(let u=16;u<80;u++){let y=f[u-3]^f[u-8]^f[u-14]^f[u-16];f[u]=y<<1|y>>>31}let E=j,R=z,I=J,D=w,b=G;for(let u=0;u<80;u++){let y,c;if(u<20)y=R&I|~R&D,c=1518500249;else if(u<40)y=R^I^D,c=1859775393;else if(u<60)y=R&I|R&D|I&D,c=2400959708;else y=R^I^D,c=3395469782;let m=(E<<5|E>>>27)+y+b+c+f[u]>>>0;b=D,D=I,I=(R<<30|R>>>2)>>>0,R=E,E=m}j=j+E>>>0,z=z+R>>>0,J=J+I>>>0,w=w+D>>>0,G=G+b>>>0}let A=new Uint8Array(20),V=new DataView(A.buffer);return V.setUint32(0,j,!1),V.setUint32(4,z,!1),V.setUint32(8,J,!1),V.setUint32(12,w,!1),V.setUint32(16,G,!1),A}function Mm($){if(typeof TextEncoder<"u")return new TextEncoder().encode($);let q=[];for(let K=0;K<$.length;K++){let P=$.charCodeAt(K);if(P<128)q.push(P);else if(P<2048)q.push(192|P>>6,128|P&63);else if(P<55296||P>=57344)q.push(224|P>>12,128|P>>6&63,128|P&63);else{K++;let _=65536+((P&1023)<<10|$.charCodeAt(K)&1023);q.push(240|_>>18,128|_>>12&63,128|_>>6&63,128|_&63)}}return new Uint8Array(q)}function Nm($){let q=[];for(let K=0;K<$.length;K++){let P=$[K].toString(16).padStart(2,"0");q.push(P)}return q.slice(0,4).join("")+"-"+q.slice(4,6).join("")+"-"+q.slice(6,8).join("")+"-"+q.slice(8,10).join("")+"-"+q.slice(10,16).join("")}var g_$=($)=>{if($.startsWith("image/"))return"image";if($.startsWith("video/"))return"video";if($.startsWith("audio/"))return"audio";if($.includes("pdf")||$.includes("document")||$.startsWith("text/"))return"document";return};function L_$($){return`http://localhost:${xK("SERVER_PORT","3000")}${$}`}var yV=i$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format"),Cm=i$.object({text:i$.string().optional(),thought:i$.string().optional(),actions:i$.array(i$.string()).optional(),providers:i$.array(i$.string()).optional(),source:i$.string().optional(),target:i$.string().optional(),url:i$.string().optional(),inReplyTo:yV.optional(),attachments:i$.array(i$.any()).optional(),channelType:i$.nativeEnum(l7).optional()}).passthrough(),Em=i$.object({name:i$.string(),content:Cm}),hm=i$.object({directory:i$.string(),shared:i$.boolean().optional()}),Rm=i$.union([i$.string(),i$.object({path:i$.string(),shared:i$.boolean().optional()}),hm]),Im=i$.union([i$.string(),i$.function().optional()]),Dm=i$.object({all:i$.array(i$.string()).optional(),chat:i$.array(i$.string()).optional(),post:i$.array(i$.string()).optional()}).optional(),gm=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number(),i$.any()])).optional(),Lm=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number()])).optional(),bm=i$.object({id:yV.optional(),name:i$.string().min(1,"Character name is required"),username:i$.string().optional(),system:i$.string().optional(),templates:i$.record(i$.string(),Im).optional(),bio:i$.union([i$.string(),i$.array(i$.string())]),messageExamples:i$.array(i$.array(Em)).optional(),postExamples:i$.array(i$.string()).optional(),topics:i$.array(i$.string()).optional(),adjectives:i$.array(i$.string()).optional(),knowledge:i$.array(Rm).optional(),plugins:i$.array(i$.string()).optional(),settings:gm,secrets:Lm,style:Dm}).strict();function pV($){let q=bm.safeParse($);if(q.success)return{success:!0,data:q.data};return{success:!1,error:{message:`Character validation failed: ${q.error.message}`,issues:q.error.issues}}}function p_$($){try{let q=JSON.parse($);return pV(q)}catch(q){return{success:!1,error:{message:`Invalid JSON: ${q instanceof Error?q.message:"Unknown JSON parsing error"}`}}}}function x_$($){return pV($).success}function B8(){return typeof Buffer<"u"&&typeof Buffer.from==="function"}function Uo($){let q=$.replace(/[^0-9a-fA-F]/g,"");if(B8())return Buffer.from(q,"hex");let K=new Uint8Array(q.length/2);for(let P=0;P<K.length;P++)K[P]=parseInt(q.substr(P*2,2),16);return K}function Fo($,q="utf8"){if(B8()){let P=q==="utf-8"?"utf8":q;return Buffer.from($,P)}if(q==="base64"){let P=atob($),_=new Uint8Array(P.length);for(let O=0;O<P.length;O++)_[O]=P.charCodeAt(O);return _}return new TextEncoder().encode($)}function PM($){if(B8()&&Buffer.isBuffer($))return $.toString("hex");let q=$ instanceof Uint8Array?$:new Uint8Array($),K="";for(let P=0;P<q.length;P++){let _=q[P].toString(16);K+=_.length===1?"0"+_:_}return K}function ao($,q="utf8"){if(B8()&&Buffer.isBuffer($)){let _=q==="utf-8"?"utf8":q;return $.toString(_)}let K=$ instanceof Uint8Array?$:new Uint8Array($);if(q==="hex")return PM(K);if(q==="base64"){let _="";for(let O=0;O<K.length;O++)_+=String.fromCharCode(K[O]);return btoa(_)}return new TextDecoder().decode(K)}function Qo($){if(!$)return!1;if(B8()&&Buffer.isBuffer($))return!0;return $ instanceof Uint8Array||$ instanceof ArrayBuffer||typeof $==="object"&&$.buffer instanceof ArrayBuffer&&typeof $.byteLength==="number"&&!Array.isArray($)}function eo($){if(B8())return Buffer.alloc($);return new Uint8Array($)}function so($){if(B8())return Buffer.from($);return new Uint8Array($)}function $r($){if(B8()&&$.every((_)=>Buffer.isBuffer(_)))return Buffer.concat($);let q=0;for(let _ of $)q+=_.length;let K=new Uint8Array(q),P=0;for(let _ of $){let O=_ instanceof Uint8Array?_:new Uint8Array(_);K.set(O,P),P+=O.length}return K}function qr($,q,K){if(B8()&&Buffer.isBuffer($))return $.slice(q,K);return($ instanceof Uint8Array?$:new Uint8Array($)).slice(q,K)}function Kr($,q){if($.length!==q.length)return!1;let K=$ instanceof Uint8Array?$:new Uint8Array($),P=q instanceof Uint8Array?q:new Uint8Array(q);for(let _=0;_<K.length;_++)if(K[_]!==P[_])return!1;return!0}function _r($){return $.length}function Pr($){if(B8())try{return(Bq(),w6(tq)).randomBytes($)}catch{}let q=new Uint8Array($);if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.getRandomValues)globalThis.crypto.getRandomValues(q);else for(let K=0;K<$;K++)q[K]=Math.floor(Math.random()*256);return q}var oK={fromHex:Uo,fromString:Fo,fromBytes:so,toHex:PM,toString:ao,isBuffer:Qo,alloc:eo,concat:$r,slice:qr,equals:Kr,byteLength:_r,randomBytes:Pr};var o_$=($,q)=>{if(!$.length||q<=0)return"";let K=$.filter((j)=>j.examples&&Array.isArray(j.examples)&&j.examples.length>0);if(!K.length)return"";let P=K.map((j)=>[...j.examples||[]]),_=[],O=P.map((j,z)=>j.length>0?z:-1).filter((j)=>j!==-1);while(_.length<q&&O.length>0){let j=Math.floor(Math.random()*O.length),z=O[j],J=P[z],w=Math.floor(Math.random()*J.length);if(_.push(J.splice(w,1)[0]),J.length===0)O.splice(j,1)}return jr(_)},jr=($)=>{return $.map((K)=>{let P=Array.from({length:5},()=>Gj({dictionaries:[Vj]}));return`
|
|
349
|
+
`)},gV=($)=>{let K=new Date().getTime()-$,P=Math.abs(K),_=Math.floor(P/1000),O=Math.floor(_/60),j=Math.floor(O/60),z=Math.floor(j/24);if(P<60000)return"just now";if(O<60)return`${O} minute${O!==1?"s":""} ago`;if(j<24)return`${j} hour${j!==1?"s":""} ago`;return`${z} day${z!==1?"s":""} ago`},Am=/```json\n([\s\S]*?)\n```/;function LV($){if(!$)return null;let q=$.match(/<response>([\s\S]*?)<\/response>/),K;if(q)K=q[1],r8.debug("Found response XML block");else{let z=((J)=>{let w=0,G=J.length;while(w<G){let f=J.indexOf("<",w);if(f===-1)break;if(J.startsWith("</",f)||J.startsWith("<!--",f)||J.startsWith("<?",f)){w=f+1;continue}let A=f+1,V="";while(A<G){let b=J[A];if(/^[A-Za-z0-9_-]$/.test(b)){V+=b,A++;continue}break}if(!V){w=f+1;continue}let C=J.indexOf(">",A);if(C===-1)break;let E=J.slice(f,C+1);if(/\/\s*>$/.test(E)){w=C+1;continue}let R=`</${V}>`,I=1,D=C+1;while(I>0&&D<G){let b=J.indexOf(`<${V}`,D),u=J.indexOf(R,D);if(u===-1)break;if(b!==-1&&b<u){let y=J.indexOf(">",b+1);if(y===-1)break;let c=J.slice(b,y+1);if(/\/\s*>$/.test(c))D=y+1;else I++,D=y+1}else I--,D=u+R.length}if(I===0){let b=D-R.length,u=J.slice(C+1,b);return{tag:V,content:u}}w=C+1}return null})($);if(!z)return r8.warn("Could not find XML block in text"),r8.debug({textPreview:$.substring(0,200)+"..."},"Text content"),null;K=z.content,r8.debug(`Found XML block with tag: ${z.tag}`)}let P={},O=((j)=>{let z=[],J=j.length,w=0;while(w<J){let G=j.indexOf("<",w);if(G===-1)break;if(j.startsWith("</",G)||j.startsWith("<!--",G)||j.startsWith("<?",G)){w=G+1;continue}let f=G+1,A="";while(f<J){let y=j[f];if(/^[A-Za-z0-9_-]$/.test(y)){A+=y,f++;continue}break}if(!A){w=G+1;continue}let V=j.indexOf(">",f);if(V===-1)break;let C=j.slice(G,V+1);if(/\/\s*>$/.test(C)){w=V+1;continue}let E=`</${A}>`,R=1,I=V+1;while(R>0&&I<J){let y=j.indexOf(`<${A}`,I),c=j.indexOf(E,I);if(c===-1)break;if(y!==-1&&y<c){let m=j.indexOf(">",y+1);if(m===-1)break;let q$=j.slice(y,m+1);if(!/\/\s*>$/.test(q$))R++;I=m+1}else R--,I=c+E.length}if(R!==0){w=V+1;continue}let D=I-E.length,u=j.slice(V+1,D).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").trim();z.push({key:A,value:u}),w=I}return z})(K);for(let{key:j,value:z}of O)if(j==="actions"||j==="providers"||j==="evaluators")P[j]=z?z.split(",").map((J)=>J.trim()):[];else if(j==="simple")P[j]=z.toLowerCase()==="true";else P[j]=z;if(Object.keys(P).length===0)return r8.warn("No key-value pairs extracted from XML content"),r8.debug({xmlPreview:K.substring(0,200)+"..."},"XML content was"),null;return P}function E_$($){let q=null,K=$.match(Am);try{if(K)q=JSON.parse(hV(K[1].trim()));else q=JSON.parse(hV($.trim()))}catch(P){return null}if(q&&typeof q==="object"&&!Array.isArray(q))return q;return null}var hV=($)=>{return $=$.replace(/\{\s+/,"{").replace(/\s+\}/,"}").trim(),$=$.replace(/("[\w\d_-]+")\s*: \s*(?!"|\[)([\s\S]+?)(?=(,\s*"|\}$))/g,'$1: "$2"'),$=$.replace(/"([^"]+)"\s*:\s*'([^']*)'/g,(q,K,P)=>`"${K}": "${P}"`),$=$.replace(/("[\w\d_-]+")\s*:\s*([A-Za-z_]+)(?!["\w])/g,'$1: "$2"'),$};function h_$($,q){if($.length<=q)return $;let K=$.lastIndexOf(".",q-1);if(K!==-1){let O=$.slice(0,K+1).trim();if(O.length>0)return O}let P=$.lastIndexOf(" ",q-1);if(P!==-1){let O=$.slice(0,P).trim();if(O.length>0)return`${O}...`}return`${$.slice(0,q-3).trim()}...`}async function R_$($,q=512,K=20){r8.debug("[splitChunks] Starting text split");let P=3.5,O=await new z7({chunkSize:Number(Math.floor(q*P)),chunkOverlap:Number(Math.floor(K*P))}).splitText($);return r8.debug({numberOfChunks:O.length,averageChunkSize:O.reduce((j,z)=>j+z.length,0)/O.length},"[splitChunks] Split complete"),O}async function I_$($,q,K){if(!$)throw Error("Trim tokens received a null prompt");if($.length<q/5)return $;if(q<=0)throw Error("maxTokens must be positive");let P=await K.useModel(Sq.TEXT_TOKENIZER_ENCODE,{prompt:$});if(P.length<=q)return $;let _=P.slice(-q);return await K.useModel(Sq.TEXT_TOKENIZER_DECODE,{tokens:_})}function nW(){let $=new WeakSet;return function(q,K){if(typeof K==="object"&&K!==null){if($.has(K))return"[Circular]";$.add(K)}return K}}function D_$($){if(!$)return!1;let q=["YES","Y","TRUE","T","1","ON","ENABLE"],K=["NO","N","FALSE","F","0","OFF","DISABLE"],P=$.trim().toUpperCase();if(q.includes(P))return!0;if(K.includes(P))return!1;return!1}var Gm=i$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format");function Vm($){let q=Gm.safeParse($);return q.success?q.data:null}function D7($){if(typeof $==="number")$=$.toString();if(typeof $!=="string")throw TypeError("Value must be string");let q=Vm($);if(q)return q;let K=encodeURIComponent($),_=Sm(K).slice(0,16);return _[8]=_[8]&63|128,_[6]=_[6]&15|0,Nm(_)}async function g_$($){if(!iW())return;let q=$.map(async(K)=>{let P=encodeURIComponent(K),_=await bV(P);f_.set(P,_)});await Promise.all(q)}var f_=new Map,yj=null;function iW(){if(yj!==null)return yj;try{if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle&&typeof globalThis.crypto.subtle.digest==="function")return yj=!0,!0}catch{}return yj=!1,!1}function Sm($){let q=f_.get($);if(q)return q;let K=uV($);if(f_.set($,K),iW())bV($).then((P)=>{f_.set($,P)}).catch(()=>{});if(f_.size>1e4)Array.from(f_.keys()).slice(0,5000).forEach((_)=>f_.delete(_));return K}async function bV($){if(iW())try{let K=new TextEncoder().encode($),P=await globalThis.crypto.subtle.digest("SHA-1",K);return new Uint8Array(P)}catch{}return uV($)}function uV($){let q=Mm($),K=q.length,P=new Uint8Array(K+9+63>>>6<<6);P.set(q),P[K]=128;let _=K*8,O=new DataView(P.buffer);O.setUint32(P.length-4,_>>>0,!1),O.setUint32(P.length-8,Math.floor(_/4294967296)>>>0,!1);let j=1732584193,z=4023233417,J=2562383102,w=271733878,G=3285377520,f=new Uint32Array(80);for(let C=0;C<P.length;C+=64){for(let u=0;u<16;u++)f[u]=O.getUint32(C+u*4,!1);for(let u=16;u<80;u++){let y=f[u-3]^f[u-8]^f[u-14]^f[u-16];f[u]=y<<1|y>>>31}let E=j,R=z,I=J,D=w,b=G;for(let u=0;u<80;u++){let y,c;if(u<20)y=R&I|~R&D,c=1518500249;else if(u<40)y=R^I^D,c=1859775393;else if(u<60)y=R&I|R&D|I&D,c=2400959708;else y=R^I^D,c=3395469782;let m=(E<<5|E>>>27)+y+b+c+f[u]>>>0;b=D,D=I,I=(R<<30|R>>>2)>>>0,R=E,E=m}j=j+E>>>0,z=z+R>>>0,J=J+I>>>0,w=w+D>>>0,G=G+b>>>0}let A=new Uint8Array(20),V=new DataView(A.buffer);return V.setUint32(0,j,!1),V.setUint32(4,z,!1),V.setUint32(8,J,!1),V.setUint32(12,w,!1),V.setUint32(16,G,!1),A}function Mm($){if(typeof TextEncoder<"u")return new TextEncoder().encode($);let q=[];for(let K=0;K<$.length;K++){let P=$.charCodeAt(K);if(P<128)q.push(P);else if(P<2048)q.push(192|P>>6,128|P&63);else if(P<55296||P>=57344)q.push(224|P>>12,128|P>>6&63,128|P&63);else{K++;let _=65536+((P&1023)<<10|$.charCodeAt(K)&1023);q.push(240|_>>18,128|_>>12&63,128|_>>6&63,128|_&63)}}return new Uint8Array(q)}function Nm($){let q=[];for(let K=0;K<$.length;K++){let P=$[K].toString(16).padStart(2,"0");q.push(P)}return q.slice(0,4).join("")+"-"+q.slice(4,6).join("")+"-"+q.slice(6,8).join("")+"-"+q.slice(8,10).join("")+"-"+q.slice(10,16).join("")}var L_$=($)=>{if($.startsWith("image/"))return"image";if($.startsWith("video/"))return"video";if($.startsWith("audio/"))return"audio";if($.includes("pdf")||$.includes("document")||$.startsWith("text/"))return"document";return};function b_$($){return`http://localhost:${xK("SERVER_PORT","3000")}${$}`}var yV=i$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format"),Cm=i$.object({text:i$.string().optional(),thought:i$.string().optional(),actions:i$.array(i$.string()).optional(),providers:i$.array(i$.string()).optional(),source:i$.string().optional(),target:i$.string().optional(),url:i$.string().optional(),inReplyTo:yV.optional(),attachments:i$.array(i$.any()).optional(),channelType:i$.nativeEnum(l7).optional()}).passthrough(),Em=i$.object({name:i$.string(),content:Cm}),hm=i$.object({directory:i$.string(),shared:i$.boolean().optional()}),Rm=i$.union([i$.string(),i$.object({path:i$.string(),shared:i$.boolean().optional()}),hm]),Im=i$.union([i$.string(),i$.function().optional()]),Dm=i$.object({all:i$.array(i$.string()).optional(),chat:i$.array(i$.string()).optional(),post:i$.array(i$.string()).optional()}).optional(),gm=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number(),i$.any()])).optional(),Lm=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number()])).optional(),bm=i$.object({id:yV.optional(),name:i$.string().min(1,"Character name is required"),username:i$.string().optional(),system:i$.string().optional(),templates:i$.record(i$.string(),Im).optional(),bio:i$.union([i$.string(),i$.array(i$.string())]),messageExamples:i$.array(i$.array(Em)).optional(),postExamples:i$.array(i$.string()).optional(),topics:i$.array(i$.string()).optional(),adjectives:i$.array(i$.string()).optional(),knowledge:i$.array(Rm).optional(),plugins:i$.array(i$.string()).optional(),settings:gm,secrets:Lm,style:Dm}).strict();function pV($){let q=bm.safeParse($);if(q.success)return{success:!0,data:q.data};return{success:!1,error:{message:`Character validation failed: ${q.error.message}`,issues:q.error.issues}}}function x_$($){try{let q=JSON.parse($);return pV(q)}catch(q){return{success:!1,error:{message:`Invalid JSON: ${q instanceof Error?q.message:"Unknown JSON parsing error"}`}}}}function c_$($){return pV($).success}function B8(){return typeof Buffer<"u"&&typeof Buffer.from==="function"}function Uo($){let q=$.replace(/[^0-9a-fA-F]/g,"");if(B8())return Buffer.from(q,"hex");let K=new Uint8Array(q.length/2);for(let P=0;P<K.length;P++)K[P]=parseInt(q.substr(P*2,2),16);return K}function Fo($,q="utf8"){if(B8()){let P=q==="utf-8"?"utf8":q;return Buffer.from($,P)}if(q==="base64"){let P=atob($),_=new Uint8Array(P.length);for(let O=0;O<P.length;O++)_[O]=P.charCodeAt(O);return _}return new TextEncoder().encode($)}function PM($){if(B8()&&Buffer.isBuffer($))return $.toString("hex");let q=$ instanceof Uint8Array?$:new Uint8Array($),K="";for(let P=0;P<q.length;P++){let _=q[P].toString(16);K+=_.length===1?"0"+_:_}return K}function ao($,q="utf8"){if(B8()&&Buffer.isBuffer($)){let _=q==="utf-8"?"utf8":q;return $.toString(_)}let K=$ instanceof Uint8Array?$:new Uint8Array($);if(q==="hex")return PM(K);if(q==="base64"){let _="";for(let O=0;O<K.length;O++)_+=String.fromCharCode(K[O]);return btoa(_)}return new TextDecoder().decode(K)}function Qo($){if(!$)return!1;if(B8()&&Buffer.isBuffer($))return!0;return $ instanceof Uint8Array||$ instanceof ArrayBuffer||typeof $==="object"&&$.buffer instanceof ArrayBuffer&&typeof $.byteLength==="number"&&!Array.isArray($)}function eo($){if(B8())return Buffer.alloc($);return new Uint8Array($)}function so($){if(B8())return Buffer.from($);return new Uint8Array($)}function $r($){if(B8()&&$.every((_)=>Buffer.isBuffer(_)))return Buffer.concat($);let q=0;for(let _ of $)q+=_.length;let K=new Uint8Array(q),P=0;for(let _ of $){let O=_ instanceof Uint8Array?_:new Uint8Array(_);K.set(O,P),P+=O.length}return K}function qr($,q,K){if(B8()&&Buffer.isBuffer($))return $.slice(q,K);return($ instanceof Uint8Array?$:new Uint8Array($)).slice(q,K)}function Kr($,q){if($.length!==q.length)return!1;let K=$ instanceof Uint8Array?$:new Uint8Array($),P=q instanceof Uint8Array?q:new Uint8Array(q);for(let _=0;_<K.length;_++)if(K[_]!==P[_])return!1;return!0}function _r($){return $.length}function Pr($){if(B8())try{return(Bq(),w6(tq)).randomBytes($)}catch{}let q=new Uint8Array($);if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.getRandomValues)globalThis.crypto.getRandomValues(q);else for(let K=0;K<$;K++)q[K]=Math.floor(Math.random()*256);return q}var oK={fromHex:Uo,fromString:Fo,fromBytes:so,toHex:PM,toString:ao,isBuffer:Qo,alloc:eo,concat:$r,slice:qr,equals:Kr,byteLength:_r,randomBytes:Pr};var r_$=($,q)=>{if(!$.length||q<=0)return"";let K=$.filter((j)=>j.examples&&Array.isArray(j.examples)&&j.examples.length>0);if(!K.length)return"";let P=K.map((j)=>[...j.examples||[]]),_=[],O=P.map((j,z)=>j.length>0?z:-1).filter((j)=>j!==-1);while(_.length<q&&O.length>0){let j=Math.floor(Math.random()*O.length),z=O[j],J=P[z],w=Math.floor(Math.random()*J.length);if(_.push(J.splice(w,1)[0]),J.length===0)O.splice(j,1)}return jr(_)},jr=($)=>{return $.map((K)=>{let P=Array.from({length:5},()=>Gj({dictionaries:[Vj]}));return`
|
|
350
350
|
${K.map((O)=>{let j=`${O.name}: ${O.content.text}`;for(let z=0;z<P.length;z++)j=j.replaceAll(`{{name${z+1}}}`,P[z]);return j}).join(`
|
|
351
351
|
`)}`}).join(`
|
|
352
|
-
`)};function
|
|
353
|
-
`)}class Or{db}function
|
|
352
|
+
`)};function n_$($){if(!$?.length)return"";return[...$].sort(()=>Math.random()-0.5).map((q)=>q.name).join(", ")}function i_$($){if(!$?.length)return"";return[...$].sort(()=>Math.random()-0.5).map((q)=>`- **${q.name}**: ${q.description||"No description available"}`).join(`
|
|
353
|
+
`)}class Or{db}function U_$($){return{...$,createdAt:Date.now(),metadata:{type:"message",timestamp:Date.now(),scope:$.agentId?"private":"shared"}}}function F_$($){return $.type==="document"}function a_$($){return $.type==="fragment"}function Q_$($){return $.type==="message"}function e_$($){return $.type==="description"}function s_$($){return $.type!=="document"&&$.type!=="fragment"&&$.type!=="message"&&$.type!=="description"}function $4$($){return $.metadata?.type==="document"}function q4$($){return $.metadata?.type==="fragment"}function K4$($,q=""){return $.content.text??q}var P4$=`<task>Decide on behalf of {{agentName}} whether they should respond to the message, ignore it or stop the conversation.</task>
|
|
354
354
|
|
|
355
355
|
<providers>
|
|
356
356
|
{{providers}}
|
|
@@ -373,7 +373,7 @@ Respond using XML format like this:
|
|
|
373
373
|
</response>
|
|
374
374
|
|
|
375
375
|
IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.
|
|
376
|
-
</output>`,
|
|
376
|
+
</output>`,j4$=`<task>Generate dialog and actions for the character {{agentName}}.</task>
|
|
377
377
|
|
|
378
378
|
<providers>
|
|
379
379
|
{{providers}}
|
|
@@ -432,7 +432,7 @@ Respond using XML format like this:
|
|
|
432
432
|
</response>
|
|
433
433
|
|
|
434
434
|
IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.
|
|
435
|
-
</output>`,
|
|
435
|
+
</output>`,O4$=`# Task: Create a post in the voice and style and perspective of {{agentName}} @{{twitterUserName}}.
|
|
436
436
|
|
|
437
437
|
Example task outputs:
|
|
438
438
|
1. A post about the importance of AI in our lives
|
|
@@ -476,7 +476,7 @@ The "thought" field should be a short description of what the agent is thinking
|
|
|
476
476
|
Do NOT include any thinking, reasoning, or <think> sections in your response.
|
|
477
477
|
Go directly to the XML response format without any preamble or explanation.
|
|
478
478
|
|
|
479
|
-
IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`,
|
|
479
|
+
IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`,Y4$="Respond with only a YES or a NO.",v4$=`<task>Analyze the provided image and generate a comprehensive description with multiple levels of detail.</task>
|
|
480
480
|
|
|
481
481
|
<instructions>
|
|
482
482
|
Carefully examine the image and provide:
|
|
@@ -499,7 +499,7 @@ Respond using XML format like this:
|
|
|
499
499
|
</response>
|
|
500
500
|
|
|
501
501
|
IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.
|
|
502
|
-
</output>`,
|
|
502
|
+
</output>`,z4$=`<task>
|
|
503
503
|
Determine the next step the assistant should take in this conversation to help the user reach their goal.
|
|
504
504
|
</task>
|
|
505
505
|
|
|
@@ -543,7 +543,7 @@ These are the actions or data provider calls that have already been used in this
|
|
|
543
543
|
<providers>PROVIDER1,PROVIDER2</providers>
|
|
544
544
|
<isFinish>true | false</isFinish>
|
|
545
545
|
</response>
|
|
546
|
-
</output>`,
|
|
546
|
+
</output>`,W4$=`<task>
|
|
547
547
|
Summarize what the assistant has done so far and provide a final response to the user based on the completed steps.
|
|
548
548
|
</task>
|
|
549
549
|
|
|
@@ -580,10 +580,10 @@ Here are the actions taken by the assistant to fulfill the request:
|
|
|
580
580
|
<text>Your final message to the user</text>
|
|
581
581
|
</response>
|
|
582
582
|
</output>
|
|
583
|
-
`;async function T4$($,q,K){let P=N_($,K),_=await $.getWorld(P);if(!_||!_.metadata?.roles)return"NONE";if(_.metadata.roles[q])return _.metadata.roles[q];if(_.metadata.roles[q])return _.metadata.roles[q];return"NONE"}async function w4$($,q){if(!q)return c6.error("User ID is required to find server"),null;let K=await $.getAllWorlds();if(!K||K.length===0)return c6.info("No worlds found for this agent"),null;let P=[];for(let _ of K)if(_.metadata?.ownership?.ownerId===q)P.push(_);return P.length?P:null}var kq=[];for(let $=0;$<256;++$)kq.push(($+256).toString(16).slice(1));function jM($,q=0){return(kq[$[q+0]]+kq[$[q+1]]+kq[$[q+2]]+kq[$[q+3]]+"-"+kq[$[q+4]]+kq[$[q+5]]+"-"+kq[$[q+6]]+kq[$[q+7]]+"-"+kq[$[q+8]]+kq[$[q+9]]+"-"+kq[$[q+10]]+kq[$[q+11]]+kq[$[q+12]]+kq[$[q+13]]+kq[$[q+14]]+kq[$[q+15]]).toLowerCase()}var NH,Yr=new Uint8Array(16);function CH(){if(!NH){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");NH=crypto.getRandomValues.bind(crypto)}return NH(Yr)}var vr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),EH={randomUUID:vr};function zr($,q,K){if(EH.randomUUID&&!q&&!$)return EH.randomUUID();$=$||{};let P=$.random??$.rng?.()??CH();if(P.length<16)throw Error("Random bytes length must be >= 16");if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){if(K=K||0,K<0||K+16>q.length)throw RangeError(`UUID byte range ${K}:${K+15} is out of buffer bounds`);for(let _=0;_<16;++_)q[K+_]=P[_];return q}return jM(P)}var U8=zr;var kK=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:return!0;default:return!1}},Wr=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:case 119:case 120:case 89:return!0;default:return!1}},Hr=($)=>{switch($){case 99:case 100:case 101:case 103:case 104:case 107:case 109:case 110:case 114:case 116:return!0;default:return!1}},Jr=($)=>{switch($){case 98:case 100:case 102:case 103:case 109:case 110:case 112:case 114:case 116:return!0;default:return!1}},OM=($,q)=>{return q>=2&&kK($[q-2])&&(q===2&&!kK($[q-1])||q>=3&&!kK($[q-3])&&!Wr($[q-1]))},Tr=($)=>{if($.length<3)return $;if($.length<=6)switch($){case"ski":return"ski";case"skies":return"sky";case"dying":return"die";case"lying":return"lie";case"tying":return"tie";case"idly":return"idl";case"gently":return"gentl";case"ugly":return"ugli";case"early":return"earli";case"only":return"onli";case"singly":return"singl";case"sky":case"news":case"howe":case"atlas":case"cosmos":case"bias":case"andes":return $}let q=$.charCodeAt(0)===39?1:0,K=$.length-q,P=Array(K),_=!1;for(let G=0;G<K;++G){let f=$.charCodeAt(G+q);if(f===121&&(G===0||kK(P[G-1]))){_=!0,P[G]=89;continue}P[G]=f}if(P[K-1]===39)--K;if(K>=2&&P[K-2]===39&&P[K-1]===115)K-=2;let O=0;while(O<K&&!kK(P[O]))++O;if(O<K)++O;let j=O;if(K>=5&&(P[0]===103&&P[1]===101&&P[2]===110&&P[3]===101&&P[4]===114||P[0]===97&&P[1]===114&&P[2]===115&&P[3]===101&&P[4]===110))j=5;else if(K>=6&&P[0]===99&&P[1]===111&&P[2]===109&&P[3]===109&&P[4]===117&&P[5]===110)j=6;else{while(j<K&&kK(P[j]))++j;if(j<K)++j}let z=j;while(z<K&&!kK(P[z]))++z;while(z<K&&kK(P[z]))++z;if(z<K)++z;if(K>=3){if(P[K-1]===115){if(K>=4&&P[K-2]===101&&P[K-3]===115&&P[K-4]===115)K-=2;else if(P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1;else if(P[K-2]!==117&&P[K-2]!==115&&O<K-1)K-=1}else if(P[K-1]===100&&P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1}if(K===6&&(P[0]===105&&P[1]===110&&P[2]===110&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===111&&P[1]===117&&P[2]===116&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===101&&P[1]===120&&P[2]===99&&P[3]===101&&P[4]===101&&P[5]===100)||K===7&&(P[0]===99&&P[1]===97&&P[2]===110&&P[3]===110&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===104&&P[1]===101&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===101&&P[1]===97&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===112&&P[1]===114&&P[2]===111&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100||P[0]===115&&P[1]===117&&P[2]===99&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100)){let G="";for(let f=0;f<K;++f)G+=String.fromCharCode(P[f]);return G}let J=K>=2&&P[K-1]===121&&P[K-2]===108?K-2:K;if(J>=3)if(P[J-3]===101&&P[J-2]===101&&P[J-1]===100){if(J>=j+3)K=J-1}else{if(P[J-2]===101&&P[J-1]===100)J-=2;else if(P[J-3]===105&&P[J-2]===110&&P[J-1]===103)J-=3;else J=-1;if(J>=0&&O<=J){if(K=J,K>=2){if(P[K-1]===116&&P[K-2]===97||P[K-1]===108&&P[K-2]===98||P[K-1]===122&&P[K-2]===105)P[K]=101,++K;else if(P[K-2]===P[K-1]&&Jr(P[K-1]))--K;else if(j>=K&&OM(P,K))P[K]=101,++K}}}if(K>=3&&(P[K-1]===89||P[K-1]===121)&&!kK(P[K-2]))P[K-1]=105;if(K>=j+2)switch(P[K-1]){case 108:if(K>=j+6&&P[K-2]===97&&P[K-3]===110&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2;break;case 110:if(K>=j+5&&P[K-2]===111&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)if(K>=7&&P[K-6]===122&&P[K-7]===105){if(K>=j+7)K-=4,P[K-1]=101}else K-=2,P[K-1]=101;break;case 114:if(K>=j+4){if(P[K-2]===101){if(P[K-3]===122&&P[K-4]===105)--K}else if(P[K-2]===111){if(P[K-3]===116&&P[K-4]===97)--K,P[K-1]=101}}break;case 115:if(K>=j+7&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110&&(P[K-5]===108&&P[K-6]===117&&P[K-7]===102||P[K-5]===115&&P[K-6]===117&&P[K-7]===111||P[K-5]===101&&P[K-6]===118&&P[K-7]===105))K-=4;break;case 109:if(K>=j+5&&P[K-2]===115&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3;break;case 105:if(P[K-2]===99){if(K>=j+4&&(P[K-4]===101||P[K-4]===97)&&P[K-3]===110)P[K-1]=101}else if(P[K-2]===103){if(K>=j+3&&K>=4&&P[K-2]===103&&P[K-3]===111&&P[K-4]===108)--K}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===105){if(P[K-4]===108){if(K>=6&&P[K-5]===105&&P[K-6]===98){if(K>=j+6)K-=3,P[K-2]=108,P[K-1]=101}else if(P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-4]===118&&P[K-5]===105)K-=2,P[K-1]=101}}else if(P[K-2]===108&&K>=3){if(P[K-3]===98){if(K>=4&&P[K-4]===97){if(K>=j+4)P[K-1]=101}else if(K>=j+3)P[K-1]=101}else if(P[K-3]===108){if(K>=5&&P[K-4]===117&&P[K-5]===102){if(K>=j+5)K-=2}else if(K>=j+4&&P[K-4]===97)K-=2}else if(P[K-3]===115){if(K>=6&&P[K-4]===115&&P[K-5]===101&&P[K-6]===108){if(K>=j+6)K-=2}else if(K>=j+5&&P[K-4]===117&&P[K-5]===111)K-=2}else if(K>=5&&P[K-3]===116&&P[K-4]===110&&P[K-5]===101){if(K>=j+5)K-=2}else if(Hr(P[K-3]))K-=2}}if(K>=j+3)switch(P[K-1]){case 108:if(P[K-3]===99){if(K>=j+4&&P[K-4]===105&&P[K-2]===97)K-=2}else if(P[K-3]===102){if(P[K-2]===117)K-=3}else if(P[K-3]===110){if(K>=j+6&&P[K-2]===97&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2}break;case 101:if(P[K-2]===122){if(K>=j+5&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===97&&P[K-4]===99&&P[K-5]===105)K-=3}else if(P[K-2]===118){if(K>=z+5&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)K-=5}break;case 105:if(K>=j+5&&P[K-2]===116&&P[K-3]===105&&P[K-4]===99&&P[K-5]===105)K-=3;break;case 115:if(K>=j+4&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110)K-=4}if(K>=z+2)switch(P[K-1]){case 110:if(K>=z+3&&P[K-2]===111&&P[K-3]===105&&(P[K-4]===115||P[K-4]===116))K-=3;break;case 108:if(P[K-2]===97)K-=2;break;case 114:if(P[K-2]===101)K-=2;break;case 99:if(P[K-2]===105)K-=2;break;case 109:if(K>=z+3&&P[K-2]===115&&P[K-3]===105)K-=3;break;case 105:if(K>=z+3&&P[K-2]===116&&P[K-3]===105)K-=3;break;case 115:if(K>=z+3&&P[K-2]===117&&P[K-3]===111)K-=3;break;case 116:if(K>=z+3&&P[K-2]===110){if(P[K-3]===97)K-=3;else if(P[K-3]===101)if(K>=4&&P[K-4]===109){if(K>=5&&P[K-5]===101){if(K>=z+5)K-=5}else if(K>=z+4)K-=4}else K-=3}break;case 101:if(P[K-2]===99){if(K>=z+4&&P[K-3]===110&&(P[K-4]===97||P[K-4]===101))K-=4}else if(P[K-2]===108){if(K>=z+4&&P[K-3]===98&&(P[K-4]===97||P[K-4]===105))K-=4}else if(P[K-2]===116){if(K>=z+3&&P[K-3]===97)K-=3}else if(K>=z+3&&(P[K-2]===118||P[K-2]===122)&&P[K-3]===105)K-=3}if(K>=j+1&&(K>=z+1&&P[K-1]===108&&P[K-2]===108||P[K-1]===101&&(K>=z+1||!OM(P,K-1))))--K;let w="";if(_)for(let G=0;G<K;++G)w+=String.fromCharCode(P[G]===89?121:P[G]);else for(let G=0;G<K;++G)w+=String.fromCharCode(P[G]);return w},wr={k1:1.2,b:0.75,minLength:2,stopWords:new Set(["a","an","and","are","as","at","be","by","for","from","has","he","in","is","it","its","of","on","that","the","to","was","were","will","with"]),stemming:!1,stemWords:($)=>$};class hH{stopWords;minLength;stemming;stemmingRules;static DEFAULT_OPTIONS={stopWords:new Set,minLength:2,stemming:!1,stemmingRules:[]};constructor($={}){let q={...hH.DEFAULT_OPTIONS,...$};this.stopWords=q.stopWords,this.minLength=q.minLength,this.stemming=q.stemming,this.stemmingRules=q.stemmingRules.map((K)=>({...K,pattern:typeof K.pattern==="string"?new RegExp(K.pattern):K.pattern}))}tokenize($,q=!1){if(!$)throw Error("Input text cannot be null or empty");let K=Date.now(),P=$.split(/\s+/).filter((z)=>z.length>0),O=this.cleanText($).split(/\s+/).filter((z)=>this.isValidToken(z)).map((z)=>this.stemming?this.stemWord(z):z),j=q?{originalWordCount:P.length,stopWordsRemoved:P.length-O.length,stemmedWords:this.stemming?O.length:0,processingTimeMs:Date.now()-K}:{originalWordCount:0,stopWordsRemoved:0,stemmedWords:0,processingTimeMs:0};return{tokens:O,stats:j}}cleanText($){return $.toLowerCase().normalize("NFKD").replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF]/g,"").replace(/[\u0300-\u036f]/g,"").replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu,"").replace(/[™®©℠‼]/g,"").replace(/[\p{P}]/gu," ").replace(/[^a-z0-9\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\s]/gu," ").replace(/\s+/g," ").trim()}isValidToken($){let q=/^\d+$/.test($);return($.length>=this.minLength||q)&&!this.stopWords.has($)}stemWord($){if($.length<3)return $;let q=!1,K=$;for(let P of this.stemmingRules){let _=K.match(P.pattern);if(_){if(!P.minMeasure||this.measure(K.substring(0,_.index))>=P.minMeasure){if(typeof P.replacement==="string")K=K.replace(P.pattern,P.replacement);else K=K.replace(P.pattern,(...O)=>P.replacement(...O));q=!0}}}if(q&&K!==$)return K;return Tr(K)}isConsonant($,q){let K=$[q];if("aeiou".includes(K))return!1;return K!=="y"||(q===0?!0:!this.isConsonant($,q-1))}measure($){let q=0,K=!1;for(let P=0;P<$.length;P++)if(this.isConsonant($,P)){if(K)q++,K=!1}else K=!0;return q}}class RH{termFrequencySaturation;lengthNormalizationFactor;tokenizer;documentLengths;averageDocLength;termToIndex;documentFrequency;termFrequencies;fieldBoosts;documents;constructor($,q={}){let K={...wr,...q};if(this.termFrequencySaturation=K.k1,this.lengthNormalizationFactor=K.b,this.tokenizer=new hH(K),this.fieldBoosts=K.fieldBoosts||{},this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex=new Map,this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies=new Map,$&&$.length>0){this.documents=[...$];let{documentLengths:P,termToIndex:_,documentFrequency:O,averageDocLength:j,termFrequencies:z}=this.processDocuments($);this.documentLengths=P,this.termToIndex=_,this.documentFrequency=O,this.averageDocLength=j,this.termFrequencies=z}}processDocuments($){let q=$.length,K=new Uint32Array(q),P=new Map,_=new Map,O=new Map,j=0,z=0;$.forEach((w,G)=>{let f=0,A=new Map;Object.entries(w).forEach(([V,C])=>{if(typeof C!=="string")return;let E=this.fieldBoosts[V]||1,{tokens:R}=this.tokenizer.tokenize(C),I=R.length*E;f+=I,R.forEach((D)=>{if(!P.has(D))P.set(D,z++);let b=P.get(D);if(!_.has(D))_.set(D,new Set);_.get(D).add(G);let u=A.get(b)||0;A.set(b,u+E)})}),K[G]=f,j+=f,A.forEach((V,C)=>{if(!O.has(C))O.set(C,new Map);O.get(C).set(G,V)})});let J=new Uint32Array(P.size);return _.forEach((w,G)=>{let f=P.get(G);J[f]=w.size}),{documentLengths:K,termToIndex:P,documentFrequency:J,averageDocLength:q>0?j/q:0,termFrequencies:O}}recalculateAverageLength(){if(this.documentLengths.length===0){this.averageDocLength=0;return}let $=this.documentLengths.reduce((q,K)=>q+K,0);this.averageDocLength=$/this.documentLengths.length}search($,q=10){let{tokens:K}=this.tokenizer.tokenize($),P=new Float32Array(this.documentLengths.length).fill(0);return K.forEach((_)=>{let O=this.termToIndex.get(_);if(O===void 0)return;let j=this.calculateIdf(O);if(j<=0)return;let z=this.termFrequencies.get(O);if(!z)return;z.forEach((J,w)=>{let G=this.documentLengths[w],f=J*(this.termFrequencySaturation+1),A=J+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*G/this.averageDocLength);P[w]+=j*(f/A)})}),Array.from({length:P.length},(_,O)=>({index:O,score:P[O]})).filter((_)=>_.score>0).sort((_,O)=>O.score-_.score).slice(0,q)}searchPhrase($,q=10){let{tokens:K}=this.tokenizer.tokenize($);if(K.length===0)return[];let P=null;for(let O of K){let j=this.termToIndex.get(O);if(j===void 0)return[];let z=this.termFrequencies.get(j)?.keys();if(!z)return[];let J=new Set(z);if(P===null)P=J;else P=new Set([...P].filter((w)=>J.has(w)));if(P.size===0)return[]}if(P===null||P.size===0)return[];let _=new Map;return P.forEach((O)=>{let j=this.getDocument(O),z=!1;Object.entries(j).forEach(([J,w])=>{if(typeof w!=="string"||z)return;let G=this.fieldBoosts[J]||1,{tokens:f}=this.tokenizer.tokenize(w);for(let A=0;A<=f.length-K.length;A++){let V=!0;for(let C=0;C<K.length;C++)if(f[A+C]!==K[C]){V=!1;break}if(V){let C=this.calculatePhraseScore(K,O)*G;_.set(O,(_.get(O)||0)+C),z=!0;break}}})}),Array.from(_.entries()).map(([O,j])=>({index:O,score:j})).sort((O,j)=>j.score-O.score).slice(0,q)}calculatePhraseScore($,q){return $.reduce((K,P)=>{let _=this.termToIndex.get(P);if(_===void 0)return K;let O=this.calculateIdf(_),j=this.termFrequencies.get(_)?.get(q)||0,z=this.documentLengths[q],J=j*(this.termFrequencySaturation+1),w=j+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*z/this.averageDocLength);return K+O*(J/w)},0)}async addDocument($){if(!$)throw Error("Document cannot be null");let q=this.documentLengths.length;this.documents.push($);let K=new Uint32Array(q+1);K.set(this.documentLengths,0),this.documentLengths=K;let P=0,_=new Map;Object.entries($).forEach(([O,j])=>{if(typeof j!=="string")return;let z=this.fieldBoosts[O]||1,{tokens:J}=this.tokenizer.tokenize(j);P+=J.length*z,J.forEach((w)=>{let G;if(!this.termToIndex.has(w)){if(G=this.termToIndex.size,this.termToIndex.set(w,G),this.documentFrequency.length<=G){let A=this.documentFrequency,V=Math.max(G+1,A.length*2||1);this.documentFrequency=new Uint32Array(V),this.documentFrequency.set(A,0)}this.documentFrequency[G]=0}else G=this.termToIndex.get(w);let f=_.get(G)||0;_.set(G,f+z)})}),this.documentLengths[q]=P,_.forEach((O,j)=>{if(!this.termFrequencies.has(j))this.termFrequencies.set(j,new Map);if(this.termFrequencies.get(j).set(q,O),j<this.documentFrequency.length)this.documentFrequency[j]++;else console.error(`Error: termIndexVal ${j} is out of bounds for documentFrequency (length ${this.documentFrequency.length}). This indicates an issue with array resizing or term indexing.`)}),this.recalculateAverageLength()}calculateIdf($){if($<0||$>=this.documentFrequency.length)return 0;let q=this.documentFrequency[$];if(q<=0||q>this.documentLengths.length)return 0;let P=this.documentLengths.length-q+0.5,_=q+0.5;return Math.log(1+P/_)}getTermFrequency($,q){return this.termFrequencies.get($)?.get(q)||0}getDocument($){if($<0||$>=this.documents.length)throw Error(`Document index ${$} out of bounds (0-${this.documents.length-1})`);return this.documents[$]}clearDocuments(){this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex.clear(),this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies.clear()}getDocumentCount(){return this.documents.length}async addDocuments($){return Promise.all($.map((q)=>this.addDocument(q)))}}var Zr={};class Xr{permits;waiting=[];constructor($){this.permits=$}async acquire(){if(this.permits>0)return this.permits-=1,Promise.resolve();return new Promise(($)=>{this.waiting.push($)})}release(){this.permits+=1;let $=this.waiting.shift();if($&&this.permits>0)this.permits-=1,$()}}class IH{#$=32;agentId;character;adapter;actions=[];evaluators=[];providers=[];plugins=[];events={};stateCache=new Map;fetch=fetch;services=new Map;serviceTypes=new Map;models=new Map;routes=[];taskWorkers=new Map;sendHandlers=new Map;eventHandlers=new Map;allAvailablePlugins=new Map;characterPlugins=[];logger;settings;servicePromiseHandlers=new Map;servicePromises=new Map;serviceRegistrationStatus=new Map;initPromise;initResolver;initRejecter;migratedPlugins=new Set;currentRunId;currentActionContext;maxWorkingMemoryEntries=50;constructor($){if(this.agentId=$.character?.id??$?.agentId??D7($.character?.name??U8()+$.character?.username),this.character=$.character,this.initPromise=new Promise((q,K)=>{this.initResolver=q,this.initRejecter=K}),this.logger=I7({namespace:this.character?.name}),this.#$=$.conversationLength??this.#$,$.adapter)this.registerDatabaseAdapter($.adapter);if(this.fetch=$.fetch??this.fetch,this.settings=$.settings??Zr,this.plugins=[],this.characterPlugins=$?.plugins??[],$.allAvailablePlugins){for(let q of $.allAvailablePlugins)if(q?.name)this.allAvailablePlugins.set(q.name,q)}if(this.logger.debug(`Success: Agent ID: ${this.agentId}`),this.currentRunId=void 0,$.settings?.MAX_WORKING_MEMORY_ENTRIES)this.maxWorkingMemoryEntries=parseInt($.settings.MAX_WORKING_MEMORY_ENTRIES,10)||50;else this.maxWorkingMemoryEntries=tG("MAX_WORKING_MEMORY_ENTRIES",50)}createRunId(){return U8()}startRun(){return this.currentRunId=this.createRunId(),this.currentRunId}endRun(){this.currentRunId=void 0}getCurrentRunId(){if(!this.currentRunId)this.currentRunId=this.createRunId();return this.currentRunId}async registerPlugin($){if(!$?.name)throw this.logger.error("*** registerPlugin: Plugin or plugin name is undefined"),Error("*** registerPlugin: Plugin or plugin name is undefined");if(this.plugins.find((K)=>K.name===$.name)){this.logger.warn(`${this.character.name}(${this.agentId}) - Plugin ${$.name} is already registered. Skipping re-registration.`);return}if(this.plugins.push($),this.logger.debug(`Success: Plugin ${$.name} added to active plugins for ${this.character.name}(${this.agentId}).`),$.init)try{await $.init($.config||{},this),this.logger.debug(`Success: Plugin ${$.name} initialized successfully`)}catch(K){let P=K instanceof Error?K.message:String(K);if(P.includes("API key")||P.includes("environment variables")||P.includes("Invalid plugin configuration"))console.warn(`Plugin ${$.name} requires configuration. ${P}`),console.warn("Please check your environment variables and ensure all required API keys are set."),console.warn("You can set these in your .env file.");else throw K}if($.adapter)this.logger.debug(`Registering database adapter for plugin ${$.name}`),this.registerDatabaseAdapter($.adapter);if($.actions)for(let K of $.actions)this.registerAction(K);if($.evaluators)for(let K of $.evaluators)this.registerEvaluator(K);if($.providers)for(let K of $.providers)this.registerProvider(K);if($.models)for(let[K,P]of Object.entries($.models))this.registerModel(K,P,$.name,$?.priority);if($.routes)for(let K of $.routes){let P=K.path.startsWith("/")?K.path:`/${K.path}`;this.routes.push({...K,path:"/"+$.name+P})}if($.events)for(let[K,P]of Object.entries($.events))for(let _ of P)this.registerEvent(K,_);if($.services)for(let K of $.services){if(!this.servicePromises.has(K.serviceType))this._createServiceResolver(K.serviceType);this.serviceRegistrationStatus.set(K.serviceType,"pending"),this.registerService(K).catch((P)=>{this.logger.error(`Service registration failed for ${K.serviceType}: ${P instanceof Error?P.message:String(P)}`);let _=this.servicePromiseHandlers.get(K.serviceType);if(_){let O=Error(`Service ${K.serviceType} failed to register: ${P instanceof Error?P.message:String(P)}`);_.reject(O),this.servicePromiseHandlers.delete(K.serviceType),this.servicePromises.delete(K.serviceType)}this.serviceRegistrationStatus.set(K.serviceType,"failed")})}}getAllServices(){return this.services}async stop(){this.logger.debug(`runtime::stop - character ${this.character.name}`);for(let[$,q]of this.services){this.logger.debug(`runtime::stop - requesting service stop for ${$}`);for(let K of q)await K.stop()}}async initialize(){try{let $=[],q=this.characterPlugins;for(let z of q)if(z)$.push(this.registerPlugin(z));if(await Promise.all($),!this.adapter)throw this.logger.error("Database adapter not initialized. Make sure @elizaos/plugin-sql is included in your plugins."),Error("Database adapter not initialized. The SQL plugin (@elizaos/plugin-sql) is required for agent initialization. Please ensure it is included in your character configuration.");if(!await this.adapter.isReady())await this.adapter.init();this.logger.info("Running plugin migrations..."),await this.runPluginMigrations(),this.logger.info("Plugin migrations completed.");let K=await this.ensureAgentExists(this.character);if(!K){let z=`Agent ${this.character.name} does not exist in database after ensureAgentExists call`;throw Error(z)}let P=await this.getEntityById(this.agentId);if(!P){if(!await this.createEntity({id:this.agentId,names:[this.character.name],metadata:{},agentId:K.id})){let J=`Failed to create entity for agent ${this.agentId}`;throw Error(J)}if(P=await this.getEntityById(this.agentId),!P)throw Error(`Agent entity not found for ${this.agentId}`);this.logger.debug(`Success: Agent entity created successfully for ${this.character.name}`)}if(!await this.getRoom(this.agentId))await this.createRoom({id:this.agentId,name:this.character.name,source:"elizaos",type:"SELF",channelId:this.agentId,serverId:this.agentId,worldId:this.agentId});if(!(await this.adapter.getParticipantsForRoom(this.agentId)).includes(this.agentId)){if(!await this.addParticipant(this.agentId,this.agentId)){let J=`Failed to add agent ${this.agentId} as participant to its own room`;throw Error(J)}this.logger.debug(`Agent ${this.character.name} linked to its own room successfully`)}if(!this.getModel(Sq.TEXT_EMBEDDING))this.logger.warn(`[AgentRuntime][${this.character.name}] No TEXT_EMBEDDING model registered. Skipping embedding dimension setup.`);else await this.ensureEmbeddingDimension();if(this.initResolver)this.initResolver(),this.initResolver=void 0}catch($){let q=$ instanceof Error?$.message:String($);if(this.logger.error(`Runtime initialization failed: ${q}`),this.initRejecter)this.initRejecter($),this.initRejecter=void 0;for(let[K,P]of this.servicePromises){let _=this.servicePromiseHandlers.get(K);if(_){let O=Error(`Service ${K} failed to start due to runtime initialization failure: ${q}`);_.reject(O),this.servicePromiseHandlers.delete(K),this.servicePromises.delete(K),this.serviceRegistrationStatus.set(K,"failed")}}throw $}}async runPluginMigrations(){if(!this.adapter){this.logger.warn("Database adapter not found, skipping plugin migrations.");return}if(typeof this.adapter.runPluginMigrations!=="function"){this.logger.warn("Database adapter does not support plugin migrations.");return}let $=this.plugins.filter((q)=>q.schema).map((q)=>({name:q.name,schema:q.schema}));if($.length===0){this.logger.info("No plugins with schemas found, skipping migrations.");return}this.logger.info(`Found ${$.length} plugins with schemas to migrate.`);try{let P={verbose:!0,force:process.env.ELIZA_ALLOW_DESTRUCTIVE_MIGRATIONS==="true",dryRun:!1};await this.adapter.runPluginMigrations($,P),this.logger.info("Plugin migrations completed successfully.")}catch(q){throw this.logger.error(q instanceof Error?q:Error(String(q)),"Failed to run plugin migrations"),q}}async getConnection(){if(!this.adapter)throw Error("Database adapter not registered");return this.adapter.getConnection()}setSetting($,q,K=!1){if(K){if(!this.character.secrets)this.character.secrets={};this.character.secrets[$]=q}else{if(!this.character.settings)this.character.settings={};this.character.settings[$]=q}}getSetting($){let q=this.character.secrets?.[$]||this.character.settings?.[$]||typeof this.character.settings==="object"&&this.character.settings!==null&&"secrets"in this.character.settings&&this.character.settings.secrets?.[$]||this.settings[$],K=Qj(q,C_());if(K==="true")return!0;if(K==="false")return!1;return K||null}getConversationLength(){return this.#$}registerDatabaseAdapter($){if(this.adapter)this.logger.warn("Database adapter already registered. Additional adapters will be ignored. This may lead to unexpected behavior.");else this.adapter=$,this.logger.debug("Success: Database adapter registered successfully.")}registerProvider($){this.providers.push($),this.logger.debug(`Success: Provider ${$.name} registered successfully.`)}registerAction($){if(this.actions.find((q)=>q.name===$.name))this.logger.warn(`${this.character.name}(${this.agentId}) - Action ${$.name} already exists. Skipping registration.`);else try{this.actions.push($),this.logger.success(`${this.character.name}(${this.agentId}) - Action ${$.name} registered successfully.`)}catch(q){console.error("Error registering action",q)}}registerEvaluator($){this.evaluators.push($)}updateActionPlan($,q){return{...$,...q}}updateActionStep($,q,K){if(!$.steps||q<0||q>=$.steps.length)return this.logger.warn(`Invalid step index: ${q} for plan with ${$.steps?.length||0} steps`),$;return{...$,steps:$.steps.map((P,_)=>_===q?{...P,...K}:P)}}async processActions($,q,K,P){let _=[];for(let G of q)if(G.content?.actions&&G.content.actions.length>0)_.push(...G.content.actions);let O=_.length>1,j=this.getCurrentRunId(),z=this.createRunId(),J=null;if(O){let G=q[0]?.content?.thought||`Executing ${_.length} actions: ${_.join(", ")}`;J={runId:z,totalSteps:_.length,currentStep:0,steps:_.map((f)=>({action:f,status:"pending"})),thought:G,startTime:Date.now()}}let w=0;for(let G of q){let C=function(E){return E.toLowerCase().replace(/_/g,"")};if(!G.content?.actions||G.content.actions.length===0){this.logger.warn("No action found in the response content.");continue}let f=G.content.actions,A=[],V=K;this.logger.debug(`Found actions: ${this.actions.map((E)=>C(E.name))}`);for(let E of f){if(J)J=this.updateActionPlan(J,{currentStep:w+1});if(V=await this.composeState($,["RECENT_MESSAGES","ACTION_STATE"]),J&&V.data)V.data.actionPlan=J,V.data.actionResults=A;this.logger.debug(`Success: Calling action: ${E}`);let R=C(E),I=this.actions.find((D)=>C(D.name)===R);if(!I)I=this.actions.find((D)=>C(D.name).includes(R)||R.includes(C(D.name)));if(I)this.logger.debug(`Success: Found action: ${I?.name}`);else{this.logger.debug("Attempting to find action in similes.");for(let D of this.actions){if(D.similes?.find((y)=>C(y)===R)){I=D,this.logger.debug(`Success: Action found in similes (exact match): ${I.name}`);break}if(D.similes?.find((y)=>C(y).includes(R)||R.includes(C(y)))){I=D,this.logger.debug(`Success: Action found in similes (fuzzy match): ${I.name}`);break}}}if(!I){let D=`No action found for: ${E}`;if(this.logger.error(D),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:D});let b={id:U8(),entityId:$.entityId,roomId:$.roomId,worldId:$.worldId,content:{thought:D,source:"auto",type:"action_result",actionName:E,actionStatus:"failed",runId:z}};await this.createMemory(b,"messages"),w++;continue}if(!I.handler){if(this.logger.error(`Action ${I.name} has no handler.`),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:"No handler"});w++;continue}try{this.logger.debug(`Executing handler for action: ${I.name}`);let D=U8();this.currentActionContext={actionName:I.name,actionId:D,prompts:[]};let u={actionContext:{previousResults:A,getPreviousResult:(r)=>{return A.find((M)=>M.data?.actionName===r)}}};if(J)u.actionPlan={totalSteps:J.totalSteps,currentStep:J.currentStep,steps:J.steps,thought:J.thought};try{this.logger.debug(`Creating action start message for: ${I.name}`),await this.emitEvent("ACTION_STARTED",{messageId:D,roomId:$.roomId,world:$.worldId,content:{text:`Executing action: ${I.name}`,actions:[I.name],actionStatus:"executing",actionId:D,runId:z,type:"agent_action",thought:J?.thought,source:$.content?.source}})}catch(r){this.logger.error("Failed to create action start message:",String(r))}let y=[],c=async(r)=>{return y.push(r),[]},m=await I.handler(this,$,V,u,c,q),q$=m===void 0||m===null||typeof m==="boolean",e=null;if(!q$){if(typeof m==="object"&&m!==null&&(("values"in m)||("data"in m)||("text"in m)))e={...m,success:"success"in m?m.success:!0};else e={success:!0,data:{actionName:I.name,legacyResult:m}};if(A.push(e),e.values)V={...V,values:{...V.values,...e.values},data:{...V.data||{},actionResults:[...V.data?.actionResults||[],e],actionPlan:J}};if(e&&V.data){if(!V.data.workingMemory)V.data.workingMemory={};let r=`action_${E}_${U8()}`,M={actionName:I.name,result:e,timestamp:Date.now()};V.data.workingMemory[r]=M;let Y=Object.entries(V.data.workingMemory);if(Y.length>this.maxWorkingMemoryEntries){let H=Y.sort((T,W)=>{let Z=T[1],S=W[1],N=Z?.timestamp??0;return(S?.timestamp??0)-N});V.data.workingMemory=Object.fromEntries(H.slice(0,this.maxWorkingMemoryEntries))}}if(J&&J.steps[w])J=this.updateActionStep(J,w,{status:"completed",result:e})}try{let M=e?.success!==!1?"completed":"failed";await this.emitEvent("ACTION_COMPLETED",{messageId:D,roomId:$.roomId,world:$.worldId,content:{text:`Action ${I.name} ${M}`,actions:[I.name],actionStatus:M,actionId:D,type:"agent_action",actionResult:e,source:$.content?.source}})}catch(r){let M=r instanceof Error?r.message:String(r);this.logger.error(`Failed to emit ACTION_COMPLETED event for action ${I.name} (${D}): ${M}`)}if(P)for(let r of y)await P(r);let l={id:D,entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,content:{text:e?.text||`Executed action: ${I.name}`,source:"action",type:"action_result",actionName:I.name,actionStatus:e?.success?"completed":"failed",actionResult:q$?{legacy:m}:e,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},metadata:{type:"action_result",actionName:I.name,runId:z,parentRunId:j,actionId:D,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};await this.createMemory(l,"messages"),this.logger.debug(`Action ${I.name} completed`,JSON.stringify({isLegacyReturn:q$,result:q$?m:void 0,hasValues:e?!!e.values:!1,hasData:e?!!e.data:!1,hasText:e?!!e.text:!1})),await this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"action",body:{action:I.name,actionId:D,message:$.content.text,messageId:$.id,state:V,responses:q,result:q$?{legacy:m}:e,isLegacyReturn:q$,prompts:this.currentActionContext?.prompts||[],promptCount:this.currentActionContext?.prompts.length||0,runId:z,parentRunId:j,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}}}),this.currentActionContext=void 0}catch(D){let b=D instanceof Error?D.message:String(D);if(this.logger.error(D),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:b});this.currentActionContext=void 0;let u={success:!1,data:{actionName:I.name,error:b,errorObject:D}};A.push(u);let y={id:U8(),content:{thought:b,source:"auto",type:"action_result",actionName:I.name,actionStatus:"failed",error:b,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,metadata:{type:"action_result",actionName:I.name,runId:z,parentRunId:j,error:!0,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};if(await this.createMemory(y,"messages"),D?.critical||D?.code==="CRITICAL_ERROR")throw D}w++}if($.id)this.stateCache.set(`${$.id}_action_results`,{values:{actionResults:A},data:{actionResults:A,actionPlan:J},text:JSON.stringify(A)})}}async evaluate($,q,K,P,_){let O=this.evaluators.map(async(z)=>{if(!z.handler)return null;if(!K&&!z.alwaysRun)return null;if(await z.validate(this,$,q))return z;return null}),j=(await Promise.all(O)).filter(Boolean);if(j.length===0)return[];return q=await this.composeState($,["RECENT_MESSAGES","EVALUATORS"]),await Promise.all(j.map(async(z)=>{if(z.handler)await z.handler(this,$,q,{},P,_),this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"evaluator",body:{evaluator:z.name,messageId:$.id,message:$.content.text,state:q,runId:this.getCurrentRunId()}})})),j}async ensureConnections($,q,K,P){if(!$){console.trace(),this.logger.error("ensureConnections - no entities");return}if(!q||q.length===0){console.trace(),this.logger.error("ensureConnections - no rooms");return}await this.ensureWorldExists({...P,agentId:this.agentId});let _=q[0],O=(u,y)=>u.reduce((c,m,q$)=>{if(q$%y===0)c.push([]);return c[c.length-1].push(m),c},[]),j=q.map((u)=>u.id),J=(await this.getRoomsByIds(j))?.map((u)=>u.id),w=j.filter((u)=>!J?.includes(u)),G={worldId:P.id,serverId:P.serverId,source:K,agentId:this.agentId};if(w.length){this.logger.debug("runtime/ensureConnections - create",w.length.toLocaleString(),"rooms");let u=q.filter((y)=>w.includes(y.id)).map((y)=>({...y,...G}));await this.createRooms(u)}let f=$.map((u)=>u.id),V=(await this.adapter.getEntitiesByIds(f))?.map((u)=>u.id),C=$.filter((u)=>!V?.includes(u.id)),E={roomId:_.id,channelId:_.channelId,type:_.type},R={worldId:P.id,serverId:P.serverId};if(C.length){this.logger.debug("runtime/ensureConnections - creating",C.length.toLocaleString(),"entities...");let u={...E,...R,source:K,agentId:this.agentId},y=C.map((m)=>({...m,...u})),c=O(y,5000);for(let m of c)await this.createEntities(m)}await this.ensureParticipantInRoom(this.agentId,_.id);let D=(await this.getParticipantsForRoom(_.id)).filter(Boolean),b=f.filter((u)=>!D.includes(u));if(b.length){this.logger.debug("runtime/ensureConnections - Missing",b.length.toLocaleString(),"connections in",_.id);let u=O(b,5000);for(let y of u)await this.addParticipantsRoom(y,_.id)}this.logger.success("Success: Successfully connected world")}async ensureConnection({entityId:$,roomId:q,worldId:K,worldName:P,userName:_,name:O,source:j,type:z,channelId:J,serverId:w,userId:G,metadata:f}){if(!K&&w)K=N_(this,w);let A=[O,_].filter(Boolean),V={[j]:{id:G,name:O,userName:_}};try{let C=await this.getEntityById($);if(!C)try{if(await this.createEntity({id:$,names:A,metadata:V,agentId:this.agentId}))this.logger.debug(`Created new entity ${$} for user ${O||_||"unknown"}`);else throw Error(`Failed to create entity ${$}`)}catch(E){if(E.message?.includes("duplicate key")||E.code==="23505")this.logger.debug(`Entity ${$} exists in database but not for this agent. This is normal in multi-agent setups.`);else throw E}else await this.adapter.updateEntity({id:$,names:[...new Set([...C.names||[],...A])].filter(Boolean),metadata:{...C.metadata,[j]:{...C.metadata?.[j],id:G,name:O,userName:_}},agentId:this.agentId});await this.ensureWorldExists({id:K,name:P||w?`World for server ${w}`:`World for room ${q}`,agentId:this.agentId,serverId:w||"default",metadata:f}),await this.ensureRoomExists({id:q,name:O||"default",source:j||"default",type:z||"DM",channelId:J,serverId:w,worldId:K});try{await this.ensureParticipantInRoom($,q)}catch(E){if(E.message?.includes("not found")){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);this.logger.debug(`Added participant ${$} to room ${q} directly`)}else throw E}await this.ensureParticipantInRoom(this.agentId,q),this.logger.debug(`Success: Successfully connected entity ${$} in room ${q}`)}catch(C){throw this.logger.error(`Failed to ensure connection: ${C instanceof Error?C.message:String(C)}`),C}}async ensureParticipantInRoom($,q){let K=await this.getEntityById($);if(!K&&$!==this.agentId)this.logger.warn(`Entity ${$} not directly accessible to agent ${this.agentId}. Will attempt to add as participant anyway.`);else if(!K&&$===this.agentId)throw Error(`Agent entity ${$} not found, cannot add as participant.`);else if(!K)throw Error(`User entity ${$} not found, cannot add as participant.`);if(!(await this.adapter.getParticipantsForRoom(q)).includes($)){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);if($===this.agentId)this.logger.debug(`Agent ${this.character.name} linked to room ${q} successfully.`);else this.logger.debug(`User ${$} linked to room ${q} successfully.`)}}async removeParticipant($,q){return await this.adapter.removeParticipant($,q)}async getParticipantsForEntity($){return await this.adapter.getParticipantsForEntity($)}async getParticipantsForRoom($){return await this.adapter.getParticipantsForRoom($)}async addParticipant($,q){return await this.adapter.addParticipantsRoom([$],q)}async addParticipantsRoom($,q){return await this.adapter.addParticipantsRoom($,q)}async ensureWorldExists({id:$,name:q,serverId:K,metadata:P}){if(!await this.getWorld($))this.logger.debug("Creating world:",JSON.stringify({id:$,name:q,serverId:K,agentId:this.agentId})),await this.adapter.createWorld({id:$,name:q,agentId:this.agentId,serverId:K||"default",metadata:P}),this.logger.debug(`World ${$} created successfully.`)}async ensureRoomExists({id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}){if(!j)throw Error("worldId is required");if(!await this.getRoom($))await this.createRoom({id:$,name:q,agentId:this.agentId,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}),this.logger.debug(`Room ${$} created successfully.`)}async composeState($,q=null,K=!1,P=!1){let _=K?q:null,O={values:{},data:{},text:""},j=P||!$.id?O:await this.stateCache.get($.id)||O,z=new Set;if(_&&_.length>0)_.forEach((E)=>z.add(E));else this.providers.filter((E)=>!E.private&&!E.dynamic).forEach((E)=>z.add(E.name));if(!_&&q&&q.length>0)q.forEach((E)=>z.add(E));let J=Array.from(new Set(this.providers.filter((E)=>z.has(E.name)))).sort((E,R)=>(E.position||0)-(R.position||0)),w=await Promise.all(J.map(async(E)=>{let R=Date.now();try{let I=await E.get(this,$,j),D=Date.now()-R;if(D>100)this.logger.debug(`${E.name} Provider took ${D}ms to respond`);return{...I,providerName:E.name}}catch(I){return console.error("provider error",E.name,I),{values:{},text:"",data:{},providerName:E.name}}})),G={...j.data?.providers||{}};for(let E of w)G[E.providerName]=E;let f=[];for(let E of J){let R=G[E.name];if(R&&R.text&&R.text.trim()!=="")f.push(R.text)}let A=f.join(`
|
|
583
|
+
`;async function w4$($,q,K){let P=N_($,K),_=await $.getWorld(P);if(!_||!_.metadata?.roles)return"NONE";if(_.metadata.roles[q])return _.metadata.roles[q];if(_.metadata.roles[q])return _.metadata.roles[q];return"NONE"}async function Z4$($,q){if(!q)return c6.error("User ID is required to find server"),null;let K=await $.getAllWorlds();if(!K||K.length===0)return c6.info("No worlds found for this agent"),null;let P=[];for(let _ of K)if(_.metadata?.ownership?.ownerId===q)P.push(_);return P.length?P:null}var kq=[];for(let $=0;$<256;++$)kq.push(($+256).toString(16).slice(1));function jM($,q=0){return(kq[$[q+0]]+kq[$[q+1]]+kq[$[q+2]]+kq[$[q+3]]+"-"+kq[$[q+4]]+kq[$[q+5]]+"-"+kq[$[q+6]]+kq[$[q+7]]+"-"+kq[$[q+8]]+kq[$[q+9]]+"-"+kq[$[q+10]]+kq[$[q+11]]+kq[$[q+12]]+kq[$[q+13]]+kq[$[q+14]]+kq[$[q+15]]).toLowerCase()}var NH,Yr=new Uint8Array(16);function CH(){if(!NH){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");NH=crypto.getRandomValues.bind(crypto)}return NH(Yr)}var vr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),EH={randomUUID:vr};function zr($,q,K){$=$||{};let P=$.random??$.rng?.()??CH();if(P.length<16)throw Error("Random bytes length must be >= 16");if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){if(K=K||0,K<0||K+16>q.length)throw RangeError(`UUID byte range ${K}:${K+15} is out of buffer bounds`);for(let _=0;_<16;++_)q[K+_]=P[_];return q}return jM(P)}function Wr($,q,K){if(EH.randomUUID&&!q&&!$)return EH.randomUUID();return zr($,q,K)}var U8=Wr;var kK=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:return!0;default:return!1}},Hr=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:case 119:case 120:case 89:return!0;default:return!1}},Jr=($)=>{switch($){case 99:case 100:case 101:case 103:case 104:case 107:case 109:case 110:case 114:case 116:return!0;default:return!1}},Tr=($)=>{switch($){case 98:case 100:case 102:case 103:case 109:case 110:case 112:case 114:case 116:return!0;default:return!1}},OM=($,q)=>{return q>=2&&kK($[q-2])&&(q===2&&!kK($[q-1])||q>=3&&!kK($[q-3])&&!Hr($[q-1]))},wr=($)=>{if($.length<3)return $;if($.length<=6)switch($){case"ski":return"ski";case"skies":return"sky";case"dying":return"die";case"lying":return"lie";case"tying":return"tie";case"idly":return"idl";case"gently":return"gentl";case"ugly":return"ugli";case"early":return"earli";case"only":return"onli";case"singly":return"singl";case"sky":case"news":case"howe":case"atlas":case"cosmos":case"bias":case"andes":return $}let q=$.charCodeAt(0)===39?1:0,K=$.length-q,P=Array(K),_=!1;for(let G=0;G<K;++G){let f=$.charCodeAt(G+q);if(f===121&&(G===0||kK(P[G-1]))){_=!0,P[G]=89;continue}P[G]=f}if(P[K-1]===39)--K;if(K>=2&&P[K-2]===39&&P[K-1]===115)K-=2;let O=0;while(O<K&&!kK(P[O]))++O;if(O<K)++O;let j=O;if(K>=5&&(P[0]===103&&P[1]===101&&P[2]===110&&P[3]===101&&P[4]===114||P[0]===97&&P[1]===114&&P[2]===115&&P[3]===101&&P[4]===110))j=5;else if(K>=6&&P[0]===99&&P[1]===111&&P[2]===109&&P[3]===109&&P[4]===117&&P[5]===110)j=6;else{while(j<K&&kK(P[j]))++j;if(j<K)++j}let z=j;while(z<K&&!kK(P[z]))++z;while(z<K&&kK(P[z]))++z;if(z<K)++z;if(K>=3){if(P[K-1]===115){if(K>=4&&P[K-2]===101&&P[K-3]===115&&P[K-4]===115)K-=2;else if(P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1;else if(P[K-2]!==117&&P[K-2]!==115&&O<K-1)K-=1}else if(P[K-1]===100&&P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1}if(K===6&&(P[0]===105&&P[1]===110&&P[2]===110&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===111&&P[1]===117&&P[2]===116&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===101&&P[1]===120&&P[2]===99&&P[3]===101&&P[4]===101&&P[5]===100)||K===7&&(P[0]===99&&P[1]===97&&P[2]===110&&P[3]===110&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===104&&P[1]===101&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===101&&P[1]===97&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===112&&P[1]===114&&P[2]===111&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100||P[0]===115&&P[1]===117&&P[2]===99&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100)){let G="";for(let f=0;f<K;++f)G+=String.fromCharCode(P[f]);return G}let J=K>=2&&P[K-1]===121&&P[K-2]===108?K-2:K;if(J>=3)if(P[J-3]===101&&P[J-2]===101&&P[J-1]===100){if(J>=j+3)K=J-1}else{if(P[J-2]===101&&P[J-1]===100)J-=2;else if(P[J-3]===105&&P[J-2]===110&&P[J-1]===103)J-=3;else J=-1;if(J>=0&&O<=J){if(K=J,K>=2){if(P[K-1]===116&&P[K-2]===97||P[K-1]===108&&P[K-2]===98||P[K-1]===122&&P[K-2]===105)P[K]=101,++K;else if(P[K-2]===P[K-1]&&Tr(P[K-1]))--K;else if(j>=K&&OM(P,K))P[K]=101,++K}}}if(K>=3&&(P[K-1]===89||P[K-1]===121)&&!kK(P[K-2]))P[K-1]=105;if(K>=j+2)switch(P[K-1]){case 108:if(K>=j+6&&P[K-2]===97&&P[K-3]===110&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2;break;case 110:if(K>=j+5&&P[K-2]===111&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)if(K>=7&&P[K-6]===122&&P[K-7]===105){if(K>=j+7)K-=4,P[K-1]=101}else K-=2,P[K-1]=101;break;case 114:if(K>=j+4){if(P[K-2]===101){if(P[K-3]===122&&P[K-4]===105)--K}else if(P[K-2]===111){if(P[K-3]===116&&P[K-4]===97)--K,P[K-1]=101}}break;case 115:if(K>=j+7&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110&&(P[K-5]===108&&P[K-6]===117&&P[K-7]===102||P[K-5]===115&&P[K-6]===117&&P[K-7]===111||P[K-5]===101&&P[K-6]===118&&P[K-7]===105))K-=4;break;case 109:if(K>=j+5&&P[K-2]===115&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3;break;case 105:if(P[K-2]===99){if(K>=j+4&&(P[K-4]===101||P[K-4]===97)&&P[K-3]===110)P[K-1]=101}else if(P[K-2]===103){if(K>=j+3&&K>=4&&P[K-2]===103&&P[K-3]===111&&P[K-4]===108)--K}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===105){if(P[K-4]===108){if(K>=6&&P[K-5]===105&&P[K-6]===98){if(K>=j+6)K-=3,P[K-2]=108,P[K-1]=101}else if(P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-4]===118&&P[K-5]===105)K-=2,P[K-1]=101}}else if(P[K-2]===108&&K>=3){if(P[K-3]===98){if(K>=4&&P[K-4]===97){if(K>=j+4)P[K-1]=101}else if(K>=j+3)P[K-1]=101}else if(P[K-3]===108){if(K>=5&&P[K-4]===117&&P[K-5]===102){if(K>=j+5)K-=2}else if(K>=j+4&&P[K-4]===97)K-=2}else if(P[K-3]===115){if(K>=6&&P[K-4]===115&&P[K-5]===101&&P[K-6]===108){if(K>=j+6)K-=2}else if(K>=j+5&&P[K-4]===117&&P[K-5]===111)K-=2}else if(K>=5&&P[K-3]===116&&P[K-4]===110&&P[K-5]===101){if(K>=j+5)K-=2}else if(Jr(P[K-3]))K-=2}}if(K>=j+3)switch(P[K-1]){case 108:if(P[K-3]===99){if(K>=j+4&&P[K-4]===105&&P[K-2]===97)K-=2}else if(P[K-3]===102){if(P[K-2]===117)K-=3}else if(P[K-3]===110){if(K>=j+6&&P[K-2]===97&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2}break;case 101:if(P[K-2]===122){if(K>=j+5&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===97&&P[K-4]===99&&P[K-5]===105)K-=3}else if(P[K-2]===118){if(K>=z+5&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)K-=5}break;case 105:if(K>=j+5&&P[K-2]===116&&P[K-3]===105&&P[K-4]===99&&P[K-5]===105)K-=3;break;case 115:if(K>=j+4&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110)K-=4}if(K>=z+2)switch(P[K-1]){case 110:if(K>=z+3&&P[K-2]===111&&P[K-3]===105&&(P[K-4]===115||P[K-4]===116))K-=3;break;case 108:if(P[K-2]===97)K-=2;break;case 114:if(P[K-2]===101)K-=2;break;case 99:if(P[K-2]===105)K-=2;break;case 109:if(K>=z+3&&P[K-2]===115&&P[K-3]===105)K-=3;break;case 105:if(K>=z+3&&P[K-2]===116&&P[K-3]===105)K-=3;break;case 115:if(K>=z+3&&P[K-2]===117&&P[K-3]===111)K-=3;break;case 116:if(K>=z+3&&P[K-2]===110){if(P[K-3]===97)K-=3;else if(P[K-3]===101)if(K>=4&&P[K-4]===109){if(K>=5&&P[K-5]===101){if(K>=z+5)K-=5}else if(K>=z+4)K-=4}else K-=3}break;case 101:if(P[K-2]===99){if(K>=z+4&&P[K-3]===110&&(P[K-4]===97||P[K-4]===101))K-=4}else if(P[K-2]===108){if(K>=z+4&&P[K-3]===98&&(P[K-4]===97||P[K-4]===105))K-=4}else if(P[K-2]===116){if(K>=z+3&&P[K-3]===97)K-=3}else if(K>=z+3&&(P[K-2]===118||P[K-2]===122)&&P[K-3]===105)K-=3}if(K>=j+1&&(K>=z+1&&P[K-1]===108&&P[K-2]===108||P[K-1]===101&&(K>=z+1||!OM(P,K-1))))--K;let w="";if(_)for(let G=0;G<K;++G)w+=String.fromCharCode(P[G]===89?121:P[G]);else for(let G=0;G<K;++G)w+=String.fromCharCode(P[G]);return w},Zr={k1:1.2,b:0.75,minLength:2,stopWords:new Set(["a","an","and","are","as","at","be","by","for","from","has","he","in","is","it","its","of","on","that","the","to","was","were","will","with"]),stemming:!1,stemWords:($)=>$};class hH{stopWords;minLength;stemming;stemmingRules;static DEFAULT_OPTIONS={stopWords:new Set,minLength:2,stemming:!1,stemmingRules:[]};constructor($={}){let q={...hH.DEFAULT_OPTIONS,...$};this.stopWords=q.stopWords,this.minLength=q.minLength,this.stemming=q.stemming,this.stemmingRules=q.stemmingRules.map((K)=>({...K,pattern:typeof K.pattern==="string"?new RegExp(K.pattern):K.pattern}))}tokenize($,q=!1){if(!$)throw Error("Input text cannot be null or empty");let K=Date.now(),P=$.split(/\s+/).filter((z)=>z.length>0),O=this.cleanText($).split(/\s+/).filter((z)=>this.isValidToken(z)).map((z)=>this.stemming?this.stemWord(z):z),j=q?{originalWordCount:P.length,stopWordsRemoved:P.length-O.length,stemmedWords:this.stemming?O.length:0,processingTimeMs:Date.now()-K}:{originalWordCount:0,stopWordsRemoved:0,stemmedWords:0,processingTimeMs:0};return{tokens:O,stats:j}}cleanText($){return $.toLowerCase().normalize("NFKD").replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF]/g,"").replace(/[\u0300-\u036f]/g,"").replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu,"").replace(/[™®©℠‼]/g,"").replace(/[\p{P}]/gu," ").replace(/[^a-z0-9\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\s]/gu," ").replace(/\s+/g," ").trim()}isValidToken($){let q=/^\d+$/.test($);return($.length>=this.minLength||q)&&!this.stopWords.has($)}stemWord($){if($.length<3)return $;let q=!1,K=$;for(let P of this.stemmingRules){let _=K.match(P.pattern);if(_){if(!P.minMeasure||this.measure(K.substring(0,_.index))>=P.minMeasure){if(typeof P.replacement==="string")K=K.replace(P.pattern,P.replacement);else K=K.replace(P.pattern,(...O)=>P.replacement(...O));q=!0}}}if(q&&K!==$)return K;return wr(K)}isConsonant($,q){let K=$[q];if("aeiou".includes(K))return!1;return K!=="y"||(q===0?!0:!this.isConsonant($,q-1))}measure($){let q=0,K=!1;for(let P=0;P<$.length;P++)if(this.isConsonant($,P)){if(K)q++,K=!1}else K=!0;return q}}class RH{termFrequencySaturation;lengthNormalizationFactor;tokenizer;documentLengths;averageDocLength;termToIndex;documentFrequency;termFrequencies;fieldBoosts;documents;constructor($,q={}){let K={...Zr,...q};if(this.termFrequencySaturation=K.k1,this.lengthNormalizationFactor=K.b,this.tokenizer=new hH(K),this.fieldBoosts=K.fieldBoosts||{},this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex=new Map,this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies=new Map,$&&$.length>0){this.documents=[...$];let{documentLengths:P,termToIndex:_,documentFrequency:O,averageDocLength:j,termFrequencies:z}=this.processDocuments($);this.documentLengths=P,this.termToIndex=_,this.documentFrequency=O,this.averageDocLength=j,this.termFrequencies=z}}processDocuments($){let q=$.length,K=new Uint32Array(q),P=new Map,_=new Map,O=new Map,j=0,z=0;$.forEach((w,G)=>{let f=0,A=new Map;Object.entries(w).forEach(([V,C])=>{if(typeof C!=="string")return;let E=this.fieldBoosts[V]||1,{tokens:R}=this.tokenizer.tokenize(C),I=R.length*E;f+=I,R.forEach((D)=>{if(!P.has(D))P.set(D,z++);let b=P.get(D);if(!_.has(D))_.set(D,new Set);_.get(D).add(G);let u=A.get(b)||0;A.set(b,u+E)})}),K[G]=f,j+=f,A.forEach((V,C)=>{if(!O.has(C))O.set(C,new Map);O.get(C).set(G,V)})});let J=new Uint32Array(P.size);return _.forEach((w,G)=>{let f=P.get(G);J[f]=w.size}),{documentLengths:K,termToIndex:P,documentFrequency:J,averageDocLength:q>0?j/q:0,termFrequencies:O}}recalculateAverageLength(){if(this.documentLengths.length===0){this.averageDocLength=0;return}let $=this.documentLengths.reduce((q,K)=>q+K,0);this.averageDocLength=$/this.documentLengths.length}search($,q=10){let{tokens:K}=this.tokenizer.tokenize($),P=new Float32Array(this.documentLengths.length).fill(0);return K.forEach((_)=>{let O=this.termToIndex.get(_);if(O===void 0)return;let j=this.calculateIdf(O);if(j<=0)return;let z=this.termFrequencies.get(O);if(!z)return;z.forEach((J,w)=>{let G=this.documentLengths[w],f=J*(this.termFrequencySaturation+1),A=J+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*G/this.averageDocLength);P[w]+=j*(f/A)})}),Array.from({length:P.length},(_,O)=>({index:O,score:P[O]})).filter((_)=>_.score>0).sort((_,O)=>O.score-_.score).slice(0,q)}searchPhrase($,q=10){let{tokens:K}=this.tokenizer.tokenize($);if(K.length===0)return[];let P=null;for(let O of K){let j=this.termToIndex.get(O);if(j===void 0)return[];let z=this.termFrequencies.get(j)?.keys();if(!z)return[];let J=new Set(z);if(P===null)P=J;else P=new Set([...P].filter((w)=>J.has(w)));if(P.size===0)return[]}if(P===null||P.size===0)return[];let _=new Map;return P.forEach((O)=>{let j=this.getDocument(O),z=!1;Object.entries(j).forEach(([J,w])=>{if(typeof w!=="string"||z)return;let G=this.fieldBoosts[J]||1,{tokens:f}=this.tokenizer.tokenize(w);for(let A=0;A<=f.length-K.length;A++){let V=!0;for(let C=0;C<K.length;C++)if(f[A+C]!==K[C]){V=!1;break}if(V){let C=this.calculatePhraseScore(K,O)*G;_.set(O,(_.get(O)||0)+C),z=!0;break}}})}),Array.from(_.entries()).map(([O,j])=>({index:O,score:j})).sort((O,j)=>j.score-O.score).slice(0,q)}calculatePhraseScore($,q){return $.reduce((K,P)=>{let _=this.termToIndex.get(P);if(_===void 0)return K;let O=this.calculateIdf(_),j=this.termFrequencies.get(_)?.get(q)||0,z=this.documentLengths[q],J=j*(this.termFrequencySaturation+1),w=j+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*z/this.averageDocLength);return K+O*(J/w)},0)}async addDocument($){if(!$)throw Error("Document cannot be null");let q=this.documentLengths.length;this.documents.push($);let K=new Uint32Array(q+1);K.set(this.documentLengths,0),this.documentLengths=K;let P=0,_=new Map;Object.entries($).forEach(([O,j])=>{if(typeof j!=="string")return;let z=this.fieldBoosts[O]||1,{tokens:J}=this.tokenizer.tokenize(j);P+=J.length*z,J.forEach((w)=>{let G;if(!this.termToIndex.has(w)){if(G=this.termToIndex.size,this.termToIndex.set(w,G),this.documentFrequency.length<=G){let A=this.documentFrequency,V=Math.max(G+1,A.length*2||1);this.documentFrequency=new Uint32Array(V),this.documentFrequency.set(A,0)}this.documentFrequency[G]=0}else G=this.termToIndex.get(w);let f=_.get(G)||0;_.set(G,f+z)})}),this.documentLengths[q]=P,_.forEach((O,j)=>{if(!this.termFrequencies.has(j))this.termFrequencies.set(j,new Map);if(this.termFrequencies.get(j).set(q,O),j<this.documentFrequency.length)this.documentFrequency[j]++;else console.error(`Error: termIndexVal ${j} is out of bounds for documentFrequency (length ${this.documentFrequency.length}). This indicates an issue with array resizing or term indexing.`)}),this.recalculateAverageLength()}calculateIdf($){if($<0||$>=this.documentFrequency.length)return 0;let q=this.documentFrequency[$];if(q<=0||q>this.documentLengths.length)return 0;let P=this.documentLengths.length-q+0.5,_=q+0.5;return Math.log(1+P/_)}getTermFrequency($,q){return this.termFrequencies.get($)?.get(q)||0}getDocument($){if($<0||$>=this.documents.length)throw Error(`Document index ${$} out of bounds (0-${this.documents.length-1})`);return this.documents[$]}clearDocuments(){this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex.clear(),this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies.clear()}getDocumentCount(){return this.documents.length}async addDocuments($){return Promise.all($.map((q)=>this.addDocument(q)))}}var Xr={};class fr{permits;waiting=[];constructor($){this.permits=$}async acquire(){if(this.permits>0)return this.permits-=1,Promise.resolve();return new Promise(($)=>{this.waiting.push($)})}release(){this.permits+=1;let $=this.waiting.shift();if($&&this.permits>0)this.permits-=1,$()}}class IH{#$=32;agentId;character;adapter;actions=[];evaluators=[];providers=[];plugins=[];events={};stateCache=new Map;fetch=fetch;services=new Map;serviceTypes=new Map;models=new Map;routes=[];taskWorkers=new Map;sendHandlers=new Map;eventHandlers=new Map;allAvailablePlugins=new Map;characterPlugins=[];logger;settings;servicePromiseHandlers=new Map;servicePromises=new Map;serviceRegistrationStatus=new Map;initPromise;initResolver;initRejecter;migratedPlugins=new Set;currentRunId;currentActionContext;maxWorkingMemoryEntries=50;constructor($){if(this.agentId=$.character?.id??$?.agentId??D7($.character?.name??U8()+$.character?.username),this.character=$.character,this.initPromise=new Promise((q,K)=>{this.initResolver=q,this.initRejecter=K}),this.logger=I7({namespace:this.character?.name}),this.#$=$.conversationLength??this.#$,$.adapter)this.registerDatabaseAdapter($.adapter);if(this.fetch=$.fetch??this.fetch,this.settings=$.settings??Xr,this.plugins=[],this.characterPlugins=$?.plugins??[],$.allAvailablePlugins){for(let q of $.allAvailablePlugins)if(q?.name)this.allAvailablePlugins.set(q.name,q)}if(this.logger.debug(`Success: Agent ID: ${this.agentId}`),this.currentRunId=void 0,$.settings?.MAX_WORKING_MEMORY_ENTRIES)this.maxWorkingMemoryEntries=parseInt($.settings.MAX_WORKING_MEMORY_ENTRIES,10)||50;else this.maxWorkingMemoryEntries=tG("MAX_WORKING_MEMORY_ENTRIES",50)}createRunId(){return U8()}startRun(){return this.currentRunId=this.createRunId(),this.currentRunId}endRun(){this.currentRunId=void 0}getCurrentRunId(){if(!this.currentRunId)this.currentRunId=this.createRunId();return this.currentRunId}async registerPlugin($){if(!$?.name)throw this.logger.error("*** registerPlugin: Plugin or plugin name is undefined"),Error("*** registerPlugin: Plugin or plugin name is undefined");if(this.plugins.find((K)=>K.name===$.name)){this.logger.warn(`${this.character.name}(${this.agentId}) - Plugin ${$.name} is already registered. Skipping re-registration.`);return}if(this.plugins.push($),this.logger.debug(`Success: Plugin ${$.name} added to active plugins for ${this.character.name}(${this.agentId}).`),$.init)try{await $.init($.config||{},this),this.logger.debug(`Success: Plugin ${$.name} initialized successfully`)}catch(K){let P=K instanceof Error?K.message:String(K);if(P.includes("API key")||P.includes("environment variables")||P.includes("Invalid plugin configuration"))console.warn(`Plugin ${$.name} requires configuration. ${P}`),console.warn("Please check your environment variables and ensure all required API keys are set."),console.warn("You can set these in your .env file.");else throw K}if($.adapter)this.logger.debug(`Registering database adapter for plugin ${$.name}`),this.registerDatabaseAdapter($.adapter);if($.actions)for(let K of $.actions)this.registerAction(K);if($.evaluators)for(let K of $.evaluators)this.registerEvaluator(K);if($.providers)for(let K of $.providers)this.registerProvider(K);if($.models)for(let[K,P]of Object.entries($.models))this.registerModel(K,P,$.name,$?.priority);if($.routes)for(let K of $.routes){let P=K.path.startsWith("/")?K.path:`/${K.path}`;this.routes.push({...K,path:"/"+$.name+P})}if($.events)for(let[K,P]of Object.entries($.events))for(let _ of P)this.registerEvent(K,_);if($.services)for(let K of $.services){if(!this.servicePromises.has(K.serviceType))this._createServiceResolver(K.serviceType);this.serviceRegistrationStatus.set(K.serviceType,"pending"),this.registerService(K).catch((P)=>{this.logger.error(`Service registration failed for ${K.serviceType}: ${P instanceof Error?P.message:String(P)}`);let _=this.servicePromiseHandlers.get(K.serviceType);if(_){let O=Error(`Service ${K.serviceType} failed to register: ${P instanceof Error?P.message:String(P)}`);_.reject(O),this.servicePromiseHandlers.delete(K.serviceType),this.servicePromises.delete(K.serviceType)}this.serviceRegistrationStatus.set(K.serviceType,"failed")})}}getAllServices(){return this.services}async stop(){this.logger.debug(`runtime::stop - character ${this.character.name}`);for(let[$,q]of this.services){this.logger.debug(`runtime::stop - requesting service stop for ${$}`);for(let K of q)await K.stop()}}async initialize(){try{let $=[],q=this.characterPlugins;for(let z of q)if(z)$.push(this.registerPlugin(z));if(await Promise.all($),!this.adapter)throw this.logger.error("Database adapter not initialized. Make sure @elizaos/plugin-sql is included in your plugins."),Error("Database adapter not initialized. The SQL plugin (@elizaos/plugin-sql) is required for agent initialization. Please ensure it is included in your character configuration.");if(!await this.adapter.isReady())await this.adapter.init();this.logger.info("Running plugin migrations..."),await this.runPluginMigrations(),this.logger.info("Plugin migrations completed.");let K=await this.ensureAgentExists(this.character);if(!K){let z=`Agent ${this.character.name} does not exist in database after ensureAgentExists call`;throw Error(z)}let P=await this.getEntityById(this.agentId);if(!P){if(!await this.createEntity({id:this.agentId,names:[this.character.name],metadata:{},agentId:K.id})){let J=`Failed to create entity for agent ${this.agentId}`;throw Error(J)}if(P=await this.getEntityById(this.agentId),!P)throw Error(`Agent entity not found for ${this.agentId}`);this.logger.debug(`Success: Agent entity created successfully for ${this.character.name}`)}if(!await this.getRoom(this.agentId))await this.createRoom({id:this.agentId,name:this.character.name,source:"elizaos",type:"SELF",channelId:this.agentId,serverId:this.agentId,worldId:this.agentId});if(!(await this.adapter.getParticipantsForRoom(this.agentId)).includes(this.agentId)){if(!await this.addParticipant(this.agentId,this.agentId)){let J=`Failed to add agent ${this.agentId} as participant to its own room`;throw Error(J)}this.logger.debug(`Agent ${this.character.name} linked to its own room successfully`)}if(!this.getModel(Sq.TEXT_EMBEDDING))this.logger.warn(`[AgentRuntime][${this.character.name}] No TEXT_EMBEDDING model registered. Skipping embedding dimension setup.`);else await this.ensureEmbeddingDimension();if(this.initResolver)this.initResolver(),this.initResolver=void 0}catch($){let q=$ instanceof Error?$.message:String($);if(this.logger.error(`Runtime initialization failed: ${q}`),this.initRejecter)this.initRejecter($),this.initRejecter=void 0;for(let[K,P]of this.servicePromises){let _=this.servicePromiseHandlers.get(K);if(_){let O=Error(`Service ${K} failed to start due to runtime initialization failure: ${q}`);_.reject(O),this.servicePromiseHandlers.delete(K),this.servicePromises.delete(K),this.serviceRegistrationStatus.set(K,"failed")}}throw $}}async runPluginMigrations(){if(!this.adapter){this.logger.warn("Database adapter not found, skipping plugin migrations.");return}if(typeof this.adapter.runPluginMigrations!=="function"){this.logger.warn("Database adapter does not support plugin migrations.");return}let $=this.plugins.filter((q)=>q.schema).map((q)=>({name:q.name,schema:q.schema}));if($.length===0){this.logger.info("No plugins with schemas found, skipping migrations.");return}this.logger.info(`Found ${$.length} plugins with schemas to migrate.`);try{let P={verbose:!0,force:process.env.ELIZA_ALLOW_DESTRUCTIVE_MIGRATIONS==="true",dryRun:!1};await this.adapter.runPluginMigrations($,P),this.logger.info("Plugin migrations completed successfully.")}catch(q){throw this.logger.error(q instanceof Error?q:Error(String(q)),"Failed to run plugin migrations"),q}}async getConnection(){if(!this.adapter)throw Error("Database adapter not registered");return this.adapter.getConnection()}setSetting($,q,K=!1){if(K){if(!this.character.secrets)this.character.secrets={};this.character.secrets[$]=q}else{if(!this.character.settings)this.character.settings={};this.character.settings[$]=q}}getSetting($){let q=this.character.secrets?.[$]||this.character.settings?.[$]||typeof this.character.settings==="object"&&this.character.settings!==null&&"secrets"in this.character.settings&&this.character.settings.secrets?.[$]||this.settings[$],K=Qj(q,C_());if(K==="true")return!0;if(K==="false")return!1;return K||null}getConversationLength(){return this.#$}registerDatabaseAdapter($){if(this.adapter)this.logger.warn("Database adapter already registered. Additional adapters will be ignored. This may lead to unexpected behavior.");else this.adapter=$,this.logger.debug("Success: Database adapter registered successfully.")}registerProvider($){this.providers.push($),this.logger.debug(`Success: Provider ${$.name} registered successfully.`)}registerAction($){if(this.actions.find((q)=>q.name===$.name))this.logger.warn(`${this.character.name}(${this.agentId}) - Action ${$.name} already exists. Skipping registration.`);else try{this.actions.push($),this.logger.success(`${this.character.name}(${this.agentId}) - Action ${$.name} registered successfully.`)}catch(q){console.error("Error registering action",q)}}registerEvaluator($){this.evaluators.push($)}updateActionPlan($,q){return{...$,...q}}updateActionStep($,q,K){if(!$.steps||q<0||q>=$.steps.length)return this.logger.warn(`Invalid step index: ${q} for plan with ${$.steps?.length||0} steps`),$;return{...$,steps:$.steps.map((P,_)=>_===q?{...P,...K}:P)}}async processActions($,q,K,P){let _=[];for(let G of q)if(G.content?.actions&&G.content.actions.length>0)_.push(...G.content.actions);let O=_.length>1,j=this.getCurrentRunId(),z=this.createRunId(),J=null;if(O){let G=q[0]?.content?.thought||`Executing ${_.length} actions: ${_.join(", ")}`;J={runId:z,totalSteps:_.length,currentStep:0,steps:_.map((f)=>({action:f,status:"pending"})),thought:G,startTime:Date.now()}}let w=0;for(let G of q){let C=function(E){return E.toLowerCase().replace(/_/g,"")};if(!G.content?.actions||G.content.actions.length===0){this.logger.warn("No action found in the response content.");continue}let f=G.content.actions,A=[],V=K;this.logger.debug(`Found actions: ${this.actions.map((E)=>C(E.name))}`);for(let E of f){if(J)J=this.updateActionPlan(J,{currentStep:w+1});if(V=await this.composeState($,["RECENT_MESSAGES","ACTION_STATE"]),J&&V.data)V.data.actionPlan=J,V.data.actionResults=A;this.logger.debug(`Success: Calling action: ${E}`);let R=C(E),I=this.actions.find((D)=>C(D.name)===R);if(!I)I=this.actions.find((D)=>C(D.name).includes(R)||R.includes(C(D.name)));if(I)this.logger.debug(`Success: Found action: ${I?.name}`);else{this.logger.debug("Attempting to find action in similes.");for(let D of this.actions){if(D.similes?.find((y)=>C(y)===R)){I=D,this.logger.debug(`Success: Action found in similes (exact match): ${I.name}`);break}if(D.similes?.find((y)=>C(y).includes(R)||R.includes(C(y)))){I=D,this.logger.debug(`Success: Action found in similes (fuzzy match): ${I.name}`);break}}}if(!I){let D=`No action found for: ${E}`;if(this.logger.error(D),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:D});let b={id:U8(),entityId:$.entityId,roomId:$.roomId,worldId:$.worldId,content:{thought:D,source:"auto",type:"action_result",actionName:E,actionStatus:"failed",runId:z}};await this.createMemory(b,"messages"),w++;continue}if(!I.handler){if(this.logger.error(`Action ${I.name} has no handler.`),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:"No handler"});w++;continue}try{this.logger.debug(`Executing handler for action: ${I.name}`);let D=U8();this.currentActionContext={actionName:I.name,actionId:D,prompts:[]};let u={actionContext:{previousResults:A,getPreviousResult:(r)=>{return A.find((M)=>M.data?.actionName===r)}}};if(J)u.actionPlan={totalSteps:J.totalSteps,currentStep:J.currentStep,steps:J.steps,thought:J.thought};try{this.logger.debug(`Creating action start message for: ${I.name}`),await this.emitEvent("ACTION_STARTED",{messageId:D,roomId:$.roomId,world:$.worldId,content:{text:`Executing action: ${I.name}`,actions:[I.name],actionStatus:"executing",actionId:D,runId:z,type:"agent_action",thought:J?.thought,source:$.content?.source}})}catch(r){this.logger.error("Failed to create action start message:",String(r))}let y=[],c=async(r)=>{return y.push(r),[]},m=await I.handler(this,$,V,u,c,q),q$=m===void 0||m===null||typeof m==="boolean",e=null;if(!q$){if(typeof m==="object"&&m!==null&&(("values"in m)||("data"in m)||("text"in m)))e={...m,success:"success"in m?m.success:!0};else e={success:!0,data:{actionName:I.name,legacyResult:m}};if(A.push(e),e.values)V={...V,values:{...V.values,...e.values},data:{...V.data||{},actionResults:[...V.data?.actionResults||[],e],actionPlan:J}};if(e&&V.data){if(!V.data.workingMemory)V.data.workingMemory={};let r=`action_${E}_${U8()}`,M={actionName:I.name,result:e,timestamp:Date.now()};V.data.workingMemory[r]=M;let Y=Object.entries(V.data.workingMemory);if(Y.length>this.maxWorkingMemoryEntries){let H=Y.sort((T,W)=>{let Z=T[1],S=W[1],N=Z?.timestamp??0;return(S?.timestamp??0)-N});V.data.workingMemory=Object.fromEntries(H.slice(0,this.maxWorkingMemoryEntries))}}if(J&&J.steps[w])J=this.updateActionStep(J,w,{status:"completed",result:e})}try{let M=e?.success!==!1?"completed":"failed";await this.emitEvent("ACTION_COMPLETED",{messageId:D,roomId:$.roomId,world:$.worldId,content:{text:`Action ${I.name} ${M}`,actions:[I.name],actionStatus:M,actionId:D,type:"agent_action",actionResult:e,source:$.content?.source}})}catch(r){let M=r instanceof Error?r.message:String(r);this.logger.error(`Failed to emit ACTION_COMPLETED event for action ${I.name} (${D}): ${M}`)}if(P)for(let r of y)await P(r);let l={id:D,entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,content:{text:e?.text||`Executed action: ${I.name}`,source:"action",type:"action_result",actionName:I.name,actionStatus:e?.success?"completed":"failed",actionResult:q$?{legacy:m}:e,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},metadata:{type:"action_result",actionName:I.name,runId:z,parentRunId:j,actionId:D,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};await this.createMemory(l,"messages"),this.logger.debug(`Action ${I.name} completed`,JSON.stringify({isLegacyReturn:q$,result:q$?m:void 0,hasValues:e?!!e.values:!1,hasData:e?!!e.data:!1,hasText:e?!!e.text:!1})),await this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"action",body:{action:I.name,actionId:D,message:$.content.text,messageId:$.id,state:V,responses:q,result:q$?{legacy:m}:e,isLegacyReturn:q$,prompts:this.currentActionContext?.prompts||[],promptCount:this.currentActionContext?.prompts.length||0,runId:z,parentRunId:j,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}}}),this.currentActionContext=void 0}catch(D){let b=D instanceof Error?D.message:String(D);if(this.logger.error(D),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:b});this.currentActionContext=void 0;let u={success:!1,data:{actionName:I.name,error:b,errorObject:D}};A.push(u);let y={id:U8(),content:{thought:b,source:"auto",type:"action_result",actionName:I.name,actionStatus:"failed",error:b,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,metadata:{type:"action_result",actionName:I.name,runId:z,parentRunId:j,error:!0,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};if(await this.createMemory(y,"messages"),D?.critical||D?.code==="CRITICAL_ERROR")throw D}w++}if($.id)this.stateCache.set(`${$.id}_action_results`,{values:{actionResults:A},data:{actionResults:A,actionPlan:J},text:JSON.stringify(A)})}}async evaluate($,q,K,P,_){let O=this.evaluators.map(async(z)=>{if(!z.handler)return null;if(!K&&!z.alwaysRun)return null;if(await z.validate(this,$,q))return z;return null}),j=(await Promise.all(O)).filter(Boolean);if(j.length===0)return[];return q=await this.composeState($,["RECENT_MESSAGES","EVALUATORS"]),await Promise.all(j.map(async(z)=>{if(z.handler)await z.handler(this,$,q,{},P,_),this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"evaluator",body:{evaluator:z.name,messageId:$.id,message:$.content.text,state:q,runId:this.getCurrentRunId()}})})),j}async ensureConnections($,q,K,P){if(!$){console.trace(),this.logger.error("ensureConnections - no entities");return}if(!q||q.length===0){console.trace(),this.logger.error("ensureConnections - no rooms");return}await this.ensureWorldExists({...P,agentId:this.agentId});let _=q[0],O=(u,y)=>u.reduce((c,m,q$)=>{if(q$%y===0)c.push([]);return c[c.length-1].push(m),c},[]),j=q.map((u)=>u.id),J=(await this.getRoomsByIds(j))?.map((u)=>u.id),w=j.filter((u)=>!J?.includes(u)),G={worldId:P.id,serverId:P.serverId,source:K,agentId:this.agentId};if(w.length){this.logger.debug("runtime/ensureConnections - create",w.length.toLocaleString(),"rooms");let u=q.filter((y)=>w.includes(y.id)).map((y)=>({...y,...G}));await this.createRooms(u)}let f=$.map((u)=>u.id),V=(await this.adapter.getEntitiesByIds(f))?.map((u)=>u.id),C=$.filter((u)=>!V?.includes(u.id)),E={roomId:_.id,channelId:_.channelId,type:_.type},R={worldId:P.id,serverId:P.serverId};if(C.length){this.logger.debug("runtime/ensureConnections - creating",C.length.toLocaleString(),"entities...");let u={...E,...R,source:K,agentId:this.agentId},y=C.map((m)=>({...m,...u})),c=O(y,5000);for(let m of c)await this.createEntities(m)}await this.ensureParticipantInRoom(this.agentId,_.id);let D=(await this.getParticipantsForRoom(_.id)).filter(Boolean),b=f.filter((u)=>!D.includes(u));if(b.length){this.logger.debug("runtime/ensureConnections - Missing",b.length.toLocaleString(),"connections in",_.id);let u=O(b,5000);for(let y of u)await this.addParticipantsRoom(y,_.id)}this.logger.success("Success: Successfully connected world")}async ensureConnection({entityId:$,roomId:q,worldId:K,worldName:P,userName:_,name:O,source:j,type:z,channelId:J,serverId:w,userId:G,metadata:f}){if(!K&&w)K=N_(this,w);let A=[O,_].filter(Boolean),V={[j]:{id:G,name:O,userName:_}};try{let C=await this.getEntityById($);if(!C)try{if(await this.createEntity({id:$,names:A,metadata:V,agentId:this.agentId}))this.logger.debug(`Created new entity ${$} for user ${O||_||"unknown"}`);else throw Error(`Failed to create entity ${$}`)}catch(E){if(E.message?.includes("duplicate key")||E.code==="23505")this.logger.debug(`Entity ${$} exists in database but not for this agent. This is normal in multi-agent setups.`);else throw E}else await this.adapter.updateEntity({id:$,names:[...new Set([...C.names||[],...A])].filter(Boolean),metadata:{...C.metadata,[j]:{...C.metadata?.[j],id:G,name:O,userName:_}},agentId:this.agentId});await this.ensureWorldExists({id:K,name:P||w?`World for server ${w}`:`World for room ${q}`,agentId:this.agentId,serverId:w||"default",metadata:f}),await this.ensureRoomExists({id:q,name:O||"default",source:j||"default",type:z||"DM",channelId:J,serverId:w,worldId:K});try{await this.ensureParticipantInRoom($,q)}catch(E){if(E.message?.includes("not found")){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);this.logger.debug(`Added participant ${$} to room ${q} directly`)}else throw E}await this.ensureParticipantInRoom(this.agentId,q),this.logger.debug(`Success: Successfully connected entity ${$} in room ${q}`)}catch(C){throw this.logger.error(`Failed to ensure connection: ${C instanceof Error?C.message:String(C)}`),C}}async ensureParticipantInRoom($,q){let K=await this.getEntityById($);if(!K&&$!==this.agentId)this.logger.warn(`Entity ${$} not directly accessible to agent ${this.agentId}. Will attempt to add as participant anyway.`);else if(!K&&$===this.agentId)throw Error(`Agent entity ${$} not found, cannot add as participant.`);else if(!K)throw Error(`User entity ${$} not found, cannot add as participant.`);if(!(await this.adapter.getParticipantsForRoom(q)).includes($)){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);if($===this.agentId)this.logger.debug(`Agent ${this.character.name} linked to room ${q} successfully.`);else this.logger.debug(`User ${$} linked to room ${q} successfully.`)}}async removeParticipant($,q){return await this.adapter.removeParticipant($,q)}async getParticipantsForEntity($){return await this.adapter.getParticipantsForEntity($)}async getParticipantsForRoom($){return await this.adapter.getParticipantsForRoom($)}async addParticipant($,q){return await this.adapter.addParticipantsRoom([$],q)}async addParticipantsRoom($,q){return await this.adapter.addParticipantsRoom($,q)}async ensureWorldExists({id:$,name:q,serverId:K,metadata:P}){if(!await this.getWorld($))this.logger.debug("Creating world:",JSON.stringify({id:$,name:q,serverId:K,agentId:this.agentId})),await this.adapter.createWorld({id:$,name:q,agentId:this.agentId,serverId:K||"default",metadata:P}),this.logger.debug(`World ${$} created successfully.`)}async ensureRoomExists({id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}){if(!j)throw Error("worldId is required");if(!await this.getRoom($))await this.createRoom({id:$,name:q,agentId:this.agentId,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}),this.logger.debug(`Room ${$} created successfully.`)}async composeState($,q=null,K=!1,P=!1){let _=K?q:null,O={values:{},data:{},text:""},j=P||!$.id?O:await this.stateCache.get($.id)||O,z=new Set;if(_&&_.length>0)_.forEach((E)=>z.add(E));else this.providers.filter((E)=>!E.private&&!E.dynamic).forEach((E)=>z.add(E.name));if(!_&&q&&q.length>0)q.forEach((E)=>z.add(E));let J=Array.from(new Set(this.providers.filter((E)=>z.has(E.name)))).sort((E,R)=>(E.position||0)-(R.position||0)),w=await Promise.all(J.map(async(E)=>{let R=Date.now();try{let I=await E.get(this,$,j),D=Date.now()-R;if(D>100)this.logger.debug(`${E.name} Provider took ${D}ms to respond`);return{...I,providerName:E.name}}catch(I){return console.error("provider error",E.name,I),{values:{},text:"",data:{},providerName:E.name}}})),G={...j.data?.providers||{}};for(let E of w)G[E.providerName]=E;let f=[];for(let E of J){let R=G[E.name];if(R&&R.text&&R.text.trim()!=="")f.push(R.text)}let A=f.join(`
|
|
584
584
|
`),V={...j.values||{}};for(let E of J){let R=G[E.name];if(R&&R.values&&typeof R.values==="object")Object.assign(V,R.values)}for(let E in G)if(!J.some((R)=>R.name===E)){let R=G[E];if(R&&R.values&&typeof R.values==="object")Object.assign(V,R.values)}let C={values:{...V,providers:A},data:{...j.data||{},providers:G},text:A};if($.id)this.stateCache.set($.id,C);return C}getService($){let q=this.services.get($);if(!q||q.length===0)return this.logger.debug(`Service ${$} not found`),null;return q[0]}getTypedService($){return this.getService($)}getServicesByType($){let q=this.services.get($);if(!q||q.length===0)return this.logger.debug(`No services found for type ${$}`),[];return q}getRegisteredServiceTypes(){return Array.from(this.services.keys())}hasService($){let q=this.services.get($);return q!==void 0&&q.length>0}getServiceRegistrationStatus($){return this.serviceRegistrationStatus.get($)||"unknown"}getServiceHealth(){let $={};for(let[q,K]of this.services)$[q]={status:this.getServiceRegistrationStatus(q),instances:K.length,hasPromise:this.servicePromises.has(q)};for(let[q,K]of this.serviceRegistrationStatus)if(!$[q])$[q]={status:K,instances:0,hasPromise:this.servicePromises.has(q)};return $}async registerService($){let q=$.serviceType;if(!q){this.logger.warn(`Service ${$.name} is missing serviceType. Please define a static serviceType property.`);return}this.logger.debug(`${this.character.name}(${this.agentId}) - Registering service:`,q),this.serviceRegistrationStatus.set(q,"registering");try{this.logger.debug(`Service ${q} waiting for initialization...`);let K=new Promise((O,j)=>{setTimeout(()=>{j(Error(`Service ${q} registration timed out waiting for runtime initialization (30s timeout)`))},30000)});await Promise.race([this.initPromise,K]),this.logger.debug(`Service ${q} proceeding - initialization complete`);let P=await $.start(this);if(!this.services.has(q))this.services.set(q,[]);if(!this.serviceTypes.has(q))this.serviceTypes.set(q,[]);this.services.get(q).push(P),this.serviceTypes.get(q).push($);let _=this.servicePromiseHandlers.get(q);if(_)_.resolve(P),this.servicePromiseHandlers.delete(q);else this.logger.debug(`${this.character.name} - Service ${q} has no servicePromiseHandler`);if(typeof $.registerSendHandlers==="function")$.registerSendHandlers(this,P);this.serviceRegistrationStatus.set(q,"registered"),this.logger.debug(`${this.character.name}(${this.agentId}) - Service ${q} registered successfully`)}catch(K){let P=K instanceof Error?K.message:String(K);if(this.logger.error(`${this.character.name}(${this.agentId}) - Failed to register service ${q}: ${P}`),K?.message?.includes("timed out waiting for runtime initialization"))this.logger.error(`Service ${q} failed due to runtime initialization timeout. Check if runtime.initialize() is being called and completing successfully.`);else if(K?.message?.includes("Service")&&K?.message?.includes("failed to start"))this.logger.error(`Service ${q} failed to start. Check service implementation and dependencies.`);this.serviceRegistrationStatus.set(q,"failed");let _=this.servicePromiseHandlers.get(q);if(_)_.reject(K),this.servicePromiseHandlers.delete(q),this.servicePromises.delete(q);throw K}}_createServiceResolver($){let q,K;if(this.servicePromises.set($,new Promise((P,_)=>{q=P,K=_})),!q)throw Error(`Failed to create resolver for service ${$}`);if(!K)throw Error(`Failed to create rejecter for service ${$}`);return this.servicePromiseHandlers.set($,{resolve:q,reject:K}),this.servicePromises.get($)}getServiceLoadPromise($){let q=this.servicePromises.get($);if(!q)q=this._createServiceResolver($);return q}registerModel($,q,K,P){let _=typeof $==="string"?$:Sq[$];if(!this.models.has(_))this.models.set(_,[]);let O=Date.now();this.models.get(_)?.push({handler:q,provider:K,priority:P||0,registrationOrder:O}),this.models.get(_)?.sort((j,z)=>{if((z.priority||0)!==(j.priority||0))return(z.priority||0)-(j.priority||0);return(j.registrationOrder||0)-(z.registrationOrder||0)})}getModel($,q){let K=typeof $==="string"?$:Sq[$],P=this.models.get(K);if(!P?.length)return;if(q){let _=P.find((O)=>O.provider===q);if(_)return this.logger.debug(`[AgentRuntime][${this.character.name}] Using model ${K} from provider ${q}`),_.handler;else this.logger.warn(`[AgentRuntime][${this.character.name}] No model found for provider ${q}`)}return this.logger.debug(`[AgentRuntime][${this.character.name}] Using model ${K} from provider ${P[0].provider}`),P[0].handler}getModelSettings($){let q={},K=(z,J)=>{if($){let A=`${$}_${z}`,V=this.getSetting(A);if(V!==null&&V!==void 0){let C=Number(V);if(!isNaN(C))return C}}let w=`DEFAULT_${z}`,G=this.getSetting(w);if(G!==null&&G!==void 0){let A=Number(G);if(!isNaN(A))return A}let f=this.getSetting(J);if(f!==null&&f!==void 0){let A=Number(f);if(!isNaN(A))return A}return null},P=K("MAX_TOKENS",r4.MODEL_MAX_TOKEN),_=K("TEMPERATURE",r4.MODEL_TEMPERATURE),O=K("FREQUENCY_PENALTY",r4.MODEL_FREQ_PENALTY),j=K("PRESENCE_PENALTY",r4.MODEL_PRESENCE_PENALTY);if(P!==null)q.maxTokens=P;if(_!==null)q.temperature=_;if(O!==null)q.frequencyPenalty=O;if(j!==null)q.presencePenalty=j;return Object.keys(q).length>0?q:null}async useModel($,q,K){let P=typeof $==="string"?$:Sq[$],_=q?.prompt||q?.input||(Array.isArray(q?.messages)?JSON.stringify(q.messages):null),O=this.getModel(P,K);if(!O){let J=`No handler found for delegate type: ${P}`;throw Error(J)}this.logger.debug(`[useModel] ${P} input: `+JSON.stringify(q,nW(),2).replace(/\\n/g,`
|
|
585
585
|
`));let j;if(q===null||q===void 0||typeof q!=="object"||Array.isArray(q)||oK.isBuffer(q))j=q;else{let J=this.getModelSettings(P);if(J)j={...J,...q};else j=q}let z=typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now();try{let J=await O(this,j),w=(typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now())-z;if(this.logger.debug(`[useModel] ${P} output (took ${Number(w.toFixed(2)).toLocaleString()}ms):`,Array.isArray(J)?`${JSON.stringify(J.slice(0,5))}...${JSON.stringify(J.slice(-5))} (${J.length} items)`:JSON.stringify(J,nW(),2).replace(/\\n/g,`
|
|
586
|
-
`)),P!==Sq.TEXT_EMBEDDING&&_){if(this.currentActionContext)this.currentActionContext.prompts.push({modelType:P,prompt:_,timestamp:Date.now()})}return this.adapter.log({entityId:this.agentId,roomId:this.agentId,body:{modelType:$,modelKey:P,params:{...typeof q==="object"&&!Array.isArray(q)&&q?q:{},prompt:_},prompt:_,runId:this.getCurrentRunId(),timestamp:Date.now(),executionTime:w,provider:K||this.models.get(P)?.[0]?.provider||"unknown",actionContext:this.currentActionContext?{actionName:this.currentActionContext.actionName,actionId:this.currentActionContext.actionId}:void 0,response:Array.isArray(J)&&J.every((G)=>typeof G==="number")?"[array]":J},type:`useModel:${P}`}),J}catch(J){throw J}}registerEvent($,q){if(!this.events[$])this.events[$]=[];this.events[$].push(q)}getEvent($){return this.events[$]}async emitEvent($,q){let K=Array.isArray($)?$:[$];for(let P of K){let _=this.events[P];if(!_)continue;try{let O={runtime:this};if(typeof q==="object"&&q)O={...q,...O};await Promise.all(_.map((j)=>j(O)))}catch(O){this.logger.error(`Error during emitEvent for ${P} (handler execution): ${O}`)}}}async ensureEmbeddingDimension(){if(this.logger.debug(`[AgentRuntime][${this.character.name}] Starting ensureEmbeddingDimension`),!this.adapter)throw Error(`[AgentRuntime][${this.character.name}] Database adapter not initialized before ensureEmbeddingDimension`);try{if(!this.getModel(Sq.TEXT_EMBEDDING))throw Error(`[AgentRuntime][${this.character.name}] No TEXT_EMBEDDING model registered`);this.logger.debug(`[AgentRuntime][${this.character.name}] Getting embedding dimensions`);let q=await this.useModel(Sq.TEXT_EMBEDDING,null);if(!q||!q.length)throw Error(`[AgentRuntime][${this.character.name}] Invalid embedding received`);this.logger.debug(`[AgentRuntime][${this.character.name}] Setting embedding dimension: ${q.length}`),await this.adapter.ensureEmbeddingDimension(q.length),this.logger.debug(`[AgentRuntime][${this.character.name}] Successfully set embedding dimension`)}catch($){throw this.logger.debug(`[AgentRuntime][${this.character.name}] Error in ensureEmbeddingDimension: ${$}`),$}}registerTaskWorker($){if(this.taskWorkers.has($.name))this.logger.warn(`Task definition ${$.name} already registered. Will be overwritten.`);this.taskWorkers.set($.name,$)}getTaskWorker($){return this.taskWorkers.get($)}get db(){return this.adapter.db}async init(){await this.adapter.init()}async close(){if(this.adapter)await this.adapter.close()}async getAgent($){return await this.adapter.getAgent($)}async getAgents(){return await this.adapter.getAgents()}async createAgent($){return await this.adapter.createAgent($)}async updateAgent($,q){return await this.adapter.updateAgent($,q)}async deleteAgent($){return await this.adapter.deleteAgent($)}async ensureAgentExists($){if(!$.name)throw Error("Agent name is required");let K=(await this.adapter.getAgents()).find((O)=>O.name===$.name)?.id;if(K){let O={...$,id:K,updatedAt:Date.now()};await this.adapter.updateAgent(K,O);let j=await this.adapter.getAgent(K);if(!j)throw Error(`Failed to retrieve agent after update: ${K}`);return this.logger.debug(`Updated existing agent ${$.name} on restart`),j}let P={...$,id:D7($.name)};if(!await this.adapter.createAgent(P))throw Error(`Failed to create agent: ${$.name}`);return this.logger.debug(`Created new agent ${$.name}`),P}async getEntityById($){let q=await this.adapter.getEntitiesByIds([$]);if(!q?.length)return null;return q[0]}async getEntitiesByIds($){return await this.adapter.getEntitiesByIds($)}async getEntitiesForRoom($,q){return await this.adapter.getEntitiesForRoom($,q)}async createEntity($){if(!$.agentId)$.agentId=this.agentId;return await this.createEntities([$])}async createEntities($){return $.forEach((q)=>{q.agentId=this.agentId}),await this.adapter.createEntities($)}async updateEntity($){await this.adapter.updateEntity($)}async getComponent($,q,K,P){return await this.adapter.getComponent($,q,K,P)}async getComponents($,q,K){return await this.adapter.getComponents($,q,K)}async createComponent($){return await this.adapter.createComponent($)}async updateComponent($){await this.adapter.updateComponent($)}async deleteComponent($){await this.adapter.deleteComponent($)}async addEmbeddingToMemory($){if($.embedding)return $;let q=$.content.text;if(!q)throw Error("Cannot generate embedding: Memory content is empty");try{$.embedding=await this.useModel(Sq.TEXT_EMBEDDING,{text:q})}catch(K){this.logger.error("Failed to generate embedding:",K),$.embedding=await this.useModel(Sq.TEXT_EMBEDDING,null)}return $}async queueEmbeddingGeneration($,q){if(q=q||"normal",!$)return;if($.embedding)return;if(!$.content?.text){this.logger.debug("Skipping embedding generation for memory without text content");return}await this.emitEvent("EMBEDDING_GENERATION_REQUESTED",{runtime:this,memory:$,priority:q,source:"runtime",retryCount:0,maxRetries:3,runId:this.getCurrentRunId()})}async getMemories($){return await this.adapter.getMemories($)}async getAllMemories(){let $=["memories","messages","facts","documents"],q=[];for(let K of $)try{let P=await this.adapter.getMemories({agentId:this.agentId,tableName:K,count:1e4});q.push(...P)}catch(P){this.logger.debug(`Failed to get memories from table ${K}: ${P}`)}return q}async getMemoryById($){return await this.adapter.getMemoryById($)}async getMemoriesByIds($,q){return await this.adapter.getMemoriesByIds($,q)}async getMemoriesByRoomIds($){return await this.adapter.getMemoriesByRoomIds($)}async getCachedEmbeddings($){return await this.adapter.getCachedEmbeddings($)}async log($){await this.adapter.log($)}async searchMemories($){let q=await this.adapter.searchMemories($);if($.query)return await this.rerankMemories($.query,q);return q}async rerankMemories($,q){let K=q.map((O)=>({title:O.id,content:O.content.text}));return new RH(K).search($,q.length).map((O)=>q[O.index])}async createMemory($,q,K){if(K!==void 0)$.unique=K;return await this.adapter.createMemory($,q,K)}async updateMemory($){return await this.adapter.updateMemory($)}async deleteMemory($){await this.adapter.deleteMemory($)}async deleteManyMemories($){await this.adapter.deleteManyMemories($)}async clearAllAgentMemories(){this.logger.info(`Clearing all memories for agent ${this.character.name} (${this.agentId})`);let q=(await this.getAllMemories()).map((K)=>K.id).filter((K)=>K!==void 0);if(q.length===0){this.logger.info("No memories found to delete");return}this.logger.info(`Found ${q.length} memories to delete`),await this.adapter.deleteManyMemories(q),this.logger.info(`Successfully cleared all ${q.length} memories for agent`)}async deleteAllMemories($,q){await this.adapter.deleteAllMemories($,q)}async countMemories($,q,K){return await this.adapter.countMemories($,q,K)}async getLogs($){return await this.adapter.getLogs($)}async deleteLog($){await this.adapter.deleteLog($)}async createWorld($){return await this.adapter.createWorld($)}async getWorld($){return await this.adapter.getWorld($)}async removeWorld($){await this.adapter.removeWorld($)}async getAllWorlds(){return await this.adapter.getAllWorlds()}async updateWorld($){await this.adapter.updateWorld($)}async getRoom($){let q=await this.adapter.getRoomsByIds([$]);if(!q?.length)return null;return q[0]}async getRoomsByIds($){return await this.adapter.getRoomsByIds($)}async createRoom({id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j}){if(!j)throw Error("worldId is required");let z=await this.adapter.createRooms([{id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j}]);if(!z.length)throw Error("Failed to create room");return z[0]}async createRooms($){return await this.adapter.createRooms($)}async deleteRoom($){await this.adapter.deleteRoom($)}async deleteRoomsByWorldId($){await this.adapter.deleteRoomsByWorldId($)}async updateRoom($){await this.adapter.updateRoom($)}async getRoomsForParticipant($){return await this.adapter.getRoomsForParticipant($)}async getRoomsForParticipants($){return await this.adapter.getRoomsForParticipants($)}async getRooms($){return await this.adapter.getRoomsByWorld($)}async getRoomsByWorld($){return await this.adapter.getRoomsByWorld($)}async getParticipantUserState($,q){return await this.adapter.getParticipantUserState($,q)}async setParticipantUserState($,q,K){await this.adapter.setParticipantUserState($,q,K)}async createRelationship($){return await this.adapter.createRelationship($)}async updateRelationship($){await this.adapter.updateRelationship($)}async getRelationship($){return await this.adapter.getRelationship($)}async getRelationships($){return await this.adapter.getRelationships($)}async getCache($){return await this.adapter.getCache($)}async setCache($,q){return await this.adapter.setCache($,q)}async deleteCache($){return await this.adapter.deleteCache($)}async createTask($){return await this.adapter.createTask($)}async getTasks($){return await this.adapter.getTasks($)}async getTask($){return await this.adapter.getTask($)}async getTasksByName($){return await this.adapter.getTasksByName($)}async updateTask($,q){await this.adapter.updateTask($,q)}async deleteTask($){await this.adapter.deleteTask($)}on($,q){if(!this.eventHandlers.has($))this.eventHandlers.set($,[]);this.eventHandlers.get($)?.push(q)}off($,q){if(!this.eventHandlers.has($))return;let K=this.eventHandlers.get($),P=K.indexOf(q);if(P!==-1)K.splice(P,1)}emit($,q){if(!this.eventHandlers.has($))return;for(let K of this.eventHandlers.get($))K(q)}async sendControlMessage($){try{let{roomId:q,action:K,target:P}=$,_={type:"control",payload:{action:K,target:P},roomId:q};await this.emitEvent("CONTROL_MESSAGE",{runtime:this,message:_,source:"agent"}),this.logger.debug(`Sent control message: ${K} to room ${q}`)}catch(q){this.logger.error(`Error sending control message: ${q}`)}}registerSendHandler($,q){if(this.sendHandlers.has($))this.logger.warn(`Send handler for source '${$}' already registered. Overwriting.`);this.sendHandlers.set($,q),this.logger.info(`Registered send handler for source: ${$}`)}async sendMessageToTarget($,q){let K=this.sendHandlers.get($.source);if(!K){let P=`No send handler registered for source: ${$.source}`;throw this.logger.error(P),Error(P)}try{await K(this,$,q)}catch(P){throw this.logger.error(`Error executing send handler for source ${$.source}:`,P),P}}async getMemoriesByWorldId($){return await this.adapter.getMemoriesByWorldId($)}async runMigrations($){if(this.adapter&&"runMigrations"in this.adapter)await this.adapter.runMigrations($);else this.logger.warn("Database adapter does not support migrations.")}async isReady(){if(!this.adapter)throw Error("Database adapter not registered");return await this.adapter.isReady()}}import ej from"crypto-browserify";function fr($){return{name:$.name,description:$.description,usageDescription:$.usageDescription||"",value:null,required:$.required,validation:$.validation||void 0,public:$.public||!1,secret:$.secret||!1,dependsOn:$.dependsOn||[],onSetAction:$.onSetAction||void 0,visibleIf:$.visibleIf||void 0}}var d4=null,DH=!1,kr=300000;function C_(){let $=xK("SECRET_SALT","secretsalt")||"secretsalt",q=Date.now();if(d4!==null){if(q-d4.timestamp<kr&&d4.value===$)return d4.value}if($==="secretsalt"&&!DH)c6.warn("SECRET_SALT is not set or using default value"),DH=!0;return d4={value:$,timestamp:q},$}function o4$(){d4=null,DH=!1}function zM($,q){if($===void 0||$===null)return c6.debug("Attempted to encrypt undefined or null value"),$;if(typeof $==="boolean"||typeof $==="number")return c6.debug("Value is a boolean or number, returning as is"),$;if(typeof $!=="string")return c6.debug(`Value is not a string (type: ${typeof $}), returning as is`),$;let K=$.split(":");if(K.length===2)try{if(oK.fromHex(K[0]).length===16)return c6.debug("Value appears to be already encrypted, skipping re-encryption"),$}catch(z){}let P=ej.createHash("sha256").update(q).digest().slice(0,32),_=oK.randomBytes(16),O=ej.createCipheriv("aes-256-cbc",P,_),j=O.update($,"utf8","hex");return j+=O.final("hex"),`${oK.toHex(_)}:${j}`}function Qj($,q){try{if($===void 0||$===null)return $;if(typeof $==="boolean"||typeof $==="number")return $;if(typeof $!=="string")return c6.debug(`Value is not a string (type: ${typeof $}), returning as is`),$;let K=$.split(":");if(K.length!==2)return $;let P=oK.fromHex(K[0]),_=K[1];if(P.length!==16){if(P.length)c6.debug(`Invalid IV length (${P.length}) - expected 16 bytes`);return $}let O=ej.createHash("sha256").update(q).digest().slice(0,32),j=ej.createDecipheriv("aes-256-cbc",O,P),z=j.update(_,"hex","utf8");return z+=j.final("utf8"),z}catch(K){return c6.error(`Error decrypting value: ${K}`),$}}function Ar($,q){let K={...$};if($.secret===!0&&typeof $.value==="string"&&$.value)K.value=zM($.value,q);return K}function Gr($,q){let K={...$};if($.secret===!0&&typeof $.value==="string"&&$.value)K.value=Qj($.value,q);return K}function Vr($,q){let K={};for(let[P,_]of Object.entries($))K[P]=Ar(_,q);return K}function WM($,q){let K={};for(let[P,_]of Object.entries($))K[P]=Gr(_,q);return K}async function r4$($,q,K){let P=N_($,q),_=await $.getWorld(P);if(!_)return c6.error(`No world found for server ${q}`),!1;if(!_.metadata)_.metadata={};let O=C_(),j=Vr(K,O);return _.metadata.settings=j,await $.updateWorld(_),!0}async function n4$($,q){let K=N_($,q),P=await $.getWorld(K);if(!P||!P.metadata?.settings)return null;let _=P.metadata.settings,O=C_();return WM(_,O)}async function i4$($,q,K){if(q.metadata?.settings){c6.info(`Onboarding state already exists for server ${q.serverId}`);let _=q.metadata.settings,O=C_();return WM(_,O)}let P={};if(K.settings)for(let[_,O]of Object.entries(K.settings))P[_]=fr(O);if(!q.metadata)q.metadata={};return q.metadata.settings=P,await $.updateWorld(q),c6.info(`Initialized settings config for server ${q.serverId}`),P}function t4$($){let q=JSON.parse(JSON.stringify($)),K=C_();if(q.settings?.secrets)q.settings.secrets=YM(q.settings.secrets,K);if(q.secrets)q.secrets=YM(q.secrets,K);return q}function B4$($,q){let K=JSON.parse(JSON.stringify($)),P=C_();if(K.settings?.secrets)K.settings.secrets=vM(K.settings.secrets,P);if(K.secrets)K.secrets=vM(K.secrets,P);return K}function YM($,q){let K={};for(let[P,_]of Object.entries($))if(typeof _==="string"&&_)K[P]=zM(_,q);else K[P]=_;return K}function vM($,q){let K={};for(let[P,_]of Object.entries($))if(typeof _==="string"&&_)K[P]=Qj(_,q);else K[P]=_;return K}class HM{serviceType;startFn;stopFn;description;constructor($){this.serviceType=$,this.description=""}withDescription($){return this.description=$,this}withStart($){return this.startFn=$,this}withStop($){return this.stopFn=$,this}build(){let $=this.serviceType,q=this.description,K=this.startFn,P=this.stopFn;return class extends KO{static serviceType=$;capabilityDescription=q;static async start(_){if(!K)throw Error(`Start function not defined for service ${$}`);return K(_)}async stop(){if(P)await P()}}}}function Sr($){return new HM($)}function a4$($){return Sr($.serviceType).withDescription($.description).withStart($.start).withStop($.stop||(()=>Promise.resolve())).build()}class Mr extends EventTarget{runtimes=new Map;editableMode=!1;async addAgents($){let q=$.map(async(P)=>{let _=new IH({character:P.character,plugins:P.plugins||[],settings:P.settings||{}});return this.runtimes.set(_.agentId,_),this.dispatchEvent(new CustomEvent("agent:added",{detail:{agentId:_.agentId,character:P.character}})),_.agentId}),K=await Promise.all(q);return this.dispatchEvent(new CustomEvent("agents:added",{detail:{agentIds:K,count:K.length}})),K}registerAgent($){if(this.runtimes.has($.agentId))throw Error(`Agent ${$.agentId} already registered`);this.runtimes.set($.agentId,$),this.dispatchEvent(new CustomEvent("agent:registered",{detail:{agentId:$.agentId,runtime:$}}))}async updateAgent($,q){if(!this.editableMode)throw Error("Editable mode not enabled");let K=this.runtimes.get($);if(!K)throw Error(`Agent ${$} not found`);Object.assign(K.character,q),this.dispatchEvent(new CustomEvent("agent:updated",{detail:{agentId:$,updates:q}}))}async deleteAgents($){await this.stopAgents($);for(let q of $)this.runtimes.delete(q);this.dispatchEvent(new CustomEvent("agents:deleted",{detail:{agentIds:$,count:$.length}}))}async startAgents($){let q=$||Array.from(this.runtimes.keys());await Promise.all(q.map(async(K)=>{let P=this.runtimes.get(K);if(!P)throw Error(`Agent ${K} not found`);await P.initialize(),this.dispatchEvent(new CustomEvent("agent:started",{detail:{agentId:K}}))})),this.dispatchEvent(new CustomEvent("agents:started",{detail:{agentIds:q,count:q.length}}))}async stopAgents($){let q=$||Array.from(this.runtimes.keys());await Promise.all(q.map(async(K)=>{let P=this.runtimes.get(K);if(P)await P.stop()})),this.dispatchEvent(new CustomEvent("agents:stopped",{detail:{agentIds:q,count:q.length}}))}getAgent($){return this.runtimes.get($)}getAgents(){return Array.from(this.runtimes.values())}getAgentsByIds($){return $.map((q)=>this.runtimes.get(q)).filter((q)=>q!==void 0)}getAgentsByNames($){let q=new Set($.map((K)=>K.toLowerCase()));return this.getAgents().filter((K)=>q.has(K.character.name.toLowerCase()))}getAgentById($){return this.getAgent($)}getAgentByName($){let q=$.toLowerCase();return this.getAgents().find((K)=>K.character.name.toLowerCase()===q)}getAgentByCharacterName($){return this.getAgentByName($)}getAgentByCharacterId($){return this.getAgents().find((q)=>q.character.id===$)}async sendMessage($,q,K){let P=this.runtimes.get($);if(!P)throw Error(`Agent ${$} not found`);let _=typeof q==="string"?{id:U8(),entityId:K?.userId||"system",agentId:$,roomId:K?.roomId||$,content:{text:q},createdAt:Date.now(),metadata:K?.metadata}:q,O=[];return await P.processActions(_,O),this.dispatchEvent(new CustomEvent("message:sent",{detail:{agentId:$,message:_,responses:O}})),O}async sendMessages($){let q=await Promise.all($.map(async({agentId:K,message:P,options:_})=>{try{let O=await this.sendMessage(K,P,_);return{agentId:K,responses:O}}catch(O){return{agentId:K,responses:[],error:O instanceof Error?O:Error(String(O))}}}));return this.dispatchEvent(new CustomEvent("messages:sent",{detail:{results:q,count:$.length}})),q}async validateApiKeys($){let q=new Map,K=$||Array.from(this.runtimes.keys());for(let P of K){let _=this.runtimes.get(P);if(_){let O=!!(_.getSetting("OPENAI_API_KEY")||_.getSetting("ANTHROPIC_API_KEY"));q.set(P,O)}}return q}async healthCheck($){let q=new Map,K=$||Array.from(this.runtimes.keys());for(let P of K){let O={alive:!!this.runtimes.get(P),responsive:!0};if(typeof process<"u")O.memoryUsage=process.memoryUsage().heapUsed,O.uptime=process.uptime();q.set(P,O)}return q}getRuntimeAccessor(){return{getAgent:($)=>this.getAgent($),getAgents:()=>this.getAgents(),getState:($)=>{let q=this.getAgent($);if(!q)return;let K=q;if(K.stateCache&&K.stateCache.size>0){let P=Array.from(K.stateCache.values());return P[P.length-1]}return}}}enableEditableMode(){this.editableMode=!0,this.dispatchEvent(new CustomEvent("mode:editable",{detail:{editable:!0}}))}}var Nr=`# Task: Resolve Entity Name
|
|
586
|
+
`)),P!==Sq.TEXT_EMBEDDING&&_){if(this.currentActionContext)this.currentActionContext.prompts.push({modelType:P,prompt:_,timestamp:Date.now()})}return this.adapter.log({entityId:this.agentId,roomId:this.agentId,body:{modelType:$,modelKey:P,params:{...typeof q==="object"&&!Array.isArray(q)&&q?q:{},prompt:_},prompt:_,runId:this.getCurrentRunId(),timestamp:Date.now(),executionTime:w,provider:K||this.models.get(P)?.[0]?.provider||"unknown",actionContext:this.currentActionContext?{actionName:this.currentActionContext.actionName,actionId:this.currentActionContext.actionId}:void 0,response:Array.isArray(J)&&J.every((G)=>typeof G==="number")?"[array]":J},type:`useModel:${P}`}),J}catch(J){throw J}}registerEvent($,q){if(!this.events[$])this.events[$]=[];this.events[$].push(q)}getEvent($){return this.events[$]}async emitEvent($,q){let K=Array.isArray($)?$:[$];for(let P of K){let _=this.events[P];if(!_)continue;try{let O={runtime:this};if(typeof q==="object"&&q)O={...q,...O};await Promise.all(_.map((j)=>j(O)))}catch(O){this.logger.error(`Error during emitEvent for ${P} (handler execution): ${O}`)}}}async ensureEmbeddingDimension(){if(this.logger.debug(`[AgentRuntime][${this.character.name}] Starting ensureEmbeddingDimension`),!this.adapter)throw Error(`[AgentRuntime][${this.character.name}] Database adapter not initialized before ensureEmbeddingDimension`);try{if(!this.getModel(Sq.TEXT_EMBEDDING))throw Error(`[AgentRuntime][${this.character.name}] No TEXT_EMBEDDING model registered`);this.logger.debug(`[AgentRuntime][${this.character.name}] Getting embedding dimensions`);let q=await this.useModel(Sq.TEXT_EMBEDDING,null);if(!q||!q.length)throw Error(`[AgentRuntime][${this.character.name}] Invalid embedding received`);this.logger.debug(`[AgentRuntime][${this.character.name}] Setting embedding dimension: ${q.length}`),await this.adapter.ensureEmbeddingDimension(q.length),this.logger.debug(`[AgentRuntime][${this.character.name}] Successfully set embedding dimension`)}catch($){throw this.logger.debug(`[AgentRuntime][${this.character.name}] Error in ensureEmbeddingDimension: ${$}`),$}}registerTaskWorker($){if(this.taskWorkers.has($.name))this.logger.warn(`Task definition ${$.name} already registered. Will be overwritten.`);this.taskWorkers.set($.name,$)}getTaskWorker($){return this.taskWorkers.get($)}get db(){return this.adapter.db}async init(){await this.adapter.init()}async close(){if(this.adapter)await this.adapter.close()}async getAgent($){return await this.adapter.getAgent($)}async getAgents(){return await this.adapter.getAgents()}async createAgent($){return await this.adapter.createAgent($)}async updateAgent($,q){return await this.adapter.updateAgent($,q)}async deleteAgent($){return await this.adapter.deleteAgent($)}async ensureAgentExists($){if(!$.name)throw Error("Agent name is required");let K=(await this.adapter.getAgents()).find((O)=>O.name===$.name)?.id;if(K){let O={...$,id:K,updatedAt:Date.now()};await this.adapter.updateAgent(K,O);let j=await this.adapter.getAgent(K);if(!j)throw Error(`Failed to retrieve agent after update: ${K}`);return this.logger.debug(`Updated existing agent ${$.name} on restart`),j}let P={...$,id:D7($.name)};if(!await this.adapter.createAgent(P))throw Error(`Failed to create agent: ${$.name}`);return this.logger.debug(`Created new agent ${$.name}`),P}async getEntityById($){let q=await this.adapter.getEntitiesByIds([$]);if(!q?.length)return null;return q[0]}async getEntitiesByIds($){return await this.adapter.getEntitiesByIds($)}async getEntitiesForRoom($,q){return await this.adapter.getEntitiesForRoom($,q)}async createEntity($){if(!$.agentId)$.agentId=this.agentId;return await this.createEntities([$])}async createEntities($){return $.forEach((q)=>{q.agentId=this.agentId}),await this.adapter.createEntities($)}async updateEntity($){await this.adapter.updateEntity($)}async getComponent($,q,K,P){return await this.adapter.getComponent($,q,K,P)}async getComponents($,q,K){return await this.adapter.getComponents($,q,K)}async createComponent($){return await this.adapter.createComponent($)}async updateComponent($){await this.adapter.updateComponent($)}async deleteComponent($){await this.adapter.deleteComponent($)}async addEmbeddingToMemory($){if($.embedding)return $;let q=$.content.text;if(!q)throw Error("Cannot generate embedding: Memory content is empty");try{$.embedding=await this.useModel(Sq.TEXT_EMBEDDING,{text:q})}catch(K){this.logger.error("Failed to generate embedding:",K),$.embedding=await this.useModel(Sq.TEXT_EMBEDDING,null)}return $}async queueEmbeddingGeneration($,q){if(q=q||"normal",!$)return;if($.embedding)return;if(!$.content?.text){this.logger.debug("Skipping embedding generation for memory without text content");return}await this.emitEvent("EMBEDDING_GENERATION_REQUESTED",{runtime:this,memory:$,priority:q,source:"runtime",retryCount:0,maxRetries:3,runId:this.getCurrentRunId()})}async getMemories($){return await this.adapter.getMemories($)}async getAllMemories(){let $=["memories","messages","facts","documents"],q=[];for(let K of $)try{let P=await this.adapter.getMemories({agentId:this.agentId,tableName:K,count:1e4});q.push(...P)}catch(P){this.logger.debug(`Failed to get memories from table ${K}: ${P}`)}return q}async getMemoryById($){return await this.adapter.getMemoryById($)}async getMemoriesByIds($,q){return await this.adapter.getMemoriesByIds($,q)}async getMemoriesByRoomIds($){return await this.adapter.getMemoriesByRoomIds($)}async getCachedEmbeddings($){return await this.adapter.getCachedEmbeddings($)}async log($){await this.adapter.log($)}async searchMemories($){let q=await this.adapter.searchMemories($);if($.query)return await this.rerankMemories($.query,q);return q}async rerankMemories($,q){let K=q.map((O)=>({title:O.id,content:O.content.text}));return new RH(K).search($,q.length).map((O)=>q[O.index])}async createMemory($,q,K){if(K!==void 0)$.unique=K;return await this.adapter.createMemory($,q,K)}async updateMemory($){return await this.adapter.updateMemory($)}async deleteMemory($){await this.adapter.deleteMemory($)}async deleteManyMemories($){await this.adapter.deleteManyMemories($)}async clearAllAgentMemories(){this.logger.info(`Clearing all memories for agent ${this.character.name} (${this.agentId})`);let q=(await this.getAllMemories()).map((K)=>K.id).filter((K)=>K!==void 0);if(q.length===0){this.logger.info("No memories found to delete");return}this.logger.info(`Found ${q.length} memories to delete`),await this.adapter.deleteManyMemories(q),this.logger.info(`Successfully cleared all ${q.length} memories for agent`)}async deleteAllMemories($,q){await this.adapter.deleteAllMemories($,q)}async countMemories($,q,K){return await this.adapter.countMemories($,q,K)}async getLogs($){return await this.adapter.getLogs($)}async deleteLog($){await this.adapter.deleteLog($)}async createWorld($){return await this.adapter.createWorld($)}async getWorld($){return await this.adapter.getWorld($)}async removeWorld($){await this.adapter.removeWorld($)}async getAllWorlds(){return await this.adapter.getAllWorlds()}async updateWorld($){await this.adapter.updateWorld($)}async getRoom($){let q=await this.adapter.getRoomsByIds([$]);if(!q?.length)return null;return q[0]}async getRoomsByIds($){return await this.adapter.getRoomsByIds($)}async createRoom({id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j}){if(!j)throw Error("worldId is required");let z=await this.adapter.createRooms([{id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j}]);if(!z.length)throw Error("Failed to create room");return z[0]}async createRooms($){return await this.adapter.createRooms($)}async deleteRoom($){await this.adapter.deleteRoom($)}async deleteRoomsByWorldId($){await this.adapter.deleteRoomsByWorldId($)}async updateRoom($){await this.adapter.updateRoom($)}async getRoomsForParticipant($){return await this.adapter.getRoomsForParticipant($)}async getRoomsForParticipants($){return await this.adapter.getRoomsForParticipants($)}async getRooms($){return await this.adapter.getRoomsByWorld($)}async getRoomsByWorld($){return await this.adapter.getRoomsByWorld($)}async getParticipantUserState($,q){return await this.adapter.getParticipantUserState($,q)}async setParticipantUserState($,q,K){await this.adapter.setParticipantUserState($,q,K)}async createRelationship($){return await this.adapter.createRelationship($)}async updateRelationship($){await this.adapter.updateRelationship($)}async getRelationship($){return await this.adapter.getRelationship($)}async getRelationships($){return await this.adapter.getRelationships($)}async getCache($){return await this.adapter.getCache($)}async setCache($,q){return await this.adapter.setCache($,q)}async deleteCache($){return await this.adapter.deleteCache($)}async createTask($){return await this.adapter.createTask($)}async getTasks($){return await this.adapter.getTasks($)}async getTask($){return await this.adapter.getTask($)}async getTasksByName($){return await this.adapter.getTasksByName($)}async updateTask($,q){await this.adapter.updateTask($,q)}async deleteTask($){await this.adapter.deleteTask($)}on($,q){if(!this.eventHandlers.has($))this.eventHandlers.set($,[]);this.eventHandlers.get($)?.push(q)}off($,q){if(!this.eventHandlers.has($))return;let K=this.eventHandlers.get($),P=K.indexOf(q);if(P!==-1)K.splice(P,1)}emit($,q){if(!this.eventHandlers.has($))return;for(let K of this.eventHandlers.get($))K(q)}async sendControlMessage($){try{let{roomId:q,action:K,target:P}=$,_={type:"control",payload:{action:K,target:P},roomId:q};await this.emitEvent("CONTROL_MESSAGE",{runtime:this,message:_,source:"agent"}),this.logger.debug(`Sent control message: ${K} to room ${q}`)}catch(q){this.logger.error(`Error sending control message: ${q}`)}}registerSendHandler($,q){if(this.sendHandlers.has($))this.logger.warn(`Send handler for source '${$}' already registered. Overwriting.`);this.sendHandlers.set($,q),this.logger.info(`Registered send handler for source: ${$}`)}async sendMessageToTarget($,q){let K=this.sendHandlers.get($.source);if(!K){let P=`No send handler registered for source: ${$.source}`;throw this.logger.error(P),Error(P)}try{await K(this,$,q)}catch(P){throw this.logger.error(`Error executing send handler for source ${$.source}:`,P),P}}async getMemoriesByWorldId($){return await this.adapter.getMemoriesByWorldId($)}async runMigrations($){if(this.adapter&&"runMigrations"in this.adapter)await this.adapter.runMigrations($);else this.logger.warn("Database adapter does not support migrations.")}async isReady(){if(!this.adapter)throw Error("Database adapter not registered");return await this.adapter.isReady()}}import ej from"crypto-browserify";function kr($){return{name:$.name,description:$.description,usageDescription:$.usageDescription||"",value:null,required:$.required,validation:$.validation||void 0,public:$.public||!1,secret:$.secret||!1,dependsOn:$.dependsOn||[],onSetAction:$.onSetAction||void 0,visibleIf:$.visibleIf||void 0}}var d4=null,DH=!1,Ar=300000;function C_(){let $=xK("SECRET_SALT","secretsalt")||"secretsalt",q=Date.now();if(d4!==null){if(q-d4.timestamp<Ar&&d4.value===$)return d4.value}if($==="secretsalt"&&!DH)c6.warn("SECRET_SALT is not set or using default value"),DH=!0;return d4={value:$,timestamp:q},$}function r4$(){d4=null,DH=!1}function zM($,q){if($===void 0||$===null)return c6.debug("Attempted to encrypt undefined or null value"),$;if(typeof $==="boolean"||typeof $==="number")return c6.debug("Value is a boolean or number, returning as is"),$;if(typeof $!=="string")return c6.debug(`Value is not a string (type: ${typeof $}), returning as is`),$;let K=$.split(":");if(K.length===2)try{if(oK.fromHex(K[0]).length===16)return c6.debug("Value appears to be already encrypted, skipping re-encryption"),$}catch(z){}let P=ej.createHash("sha256").update(q).digest().slice(0,32),_=oK.randomBytes(16),O=ej.createCipheriv("aes-256-cbc",P,_),j=O.update($,"utf8","hex");return j+=O.final("hex"),`${oK.toHex(_)}:${j}`}function Qj($,q){try{if($===void 0||$===null)return $;if(typeof $==="boolean"||typeof $==="number")return $;if(typeof $!=="string")return c6.debug(`Value is not a string (type: ${typeof $}), returning as is`),$;let K=$.split(":");if(K.length!==2)return $;let P=oK.fromHex(K[0]),_=K[1];if(P.length!==16){if(P.length)c6.debug(`Invalid IV length (${P.length}) - expected 16 bytes`);return $}let O=ej.createHash("sha256").update(q).digest().slice(0,32),j=ej.createDecipheriv("aes-256-cbc",O,P),z=j.update(_,"hex","utf8");return z+=j.final("utf8"),z}catch(K){return c6.error(`Error decrypting value: ${K}`),$}}function Gr($,q){let K={...$};if($.secret===!0&&typeof $.value==="string"&&$.value)K.value=zM($.value,q);return K}function Vr($,q){let K={...$};if($.secret===!0&&typeof $.value==="string"&&$.value)K.value=Qj($.value,q);return K}function Sr($,q){let K={};for(let[P,_]of Object.entries($))K[P]=Gr(_,q);return K}function WM($,q){let K={};for(let[P,_]of Object.entries($))K[P]=Vr(_,q);return K}async function n4$($,q,K){let P=N_($,q),_=await $.getWorld(P);if(!_)return c6.error(`No world found for server ${q}`),!1;if(!_.metadata)_.metadata={};let O=C_(),j=Sr(K,O);return _.metadata.settings=j,await $.updateWorld(_),!0}async function i4$($,q){let K=N_($,q),P=await $.getWorld(K);if(!P||!P.metadata?.settings)return null;let _=P.metadata.settings,O=C_();return WM(_,O)}async function t4$($,q,K){if(q.metadata?.settings){c6.info(`Onboarding state already exists for server ${q.serverId}`);let _=q.metadata.settings,O=C_();return WM(_,O)}let P={};if(K.settings)for(let[_,O]of Object.entries(K.settings))P[_]=kr(O);if(!q.metadata)q.metadata={};return q.metadata.settings=P,await $.updateWorld(q),c6.info(`Initialized settings config for server ${q.serverId}`),P}function B4$($){let q=JSON.parse(JSON.stringify($)),K=C_();if(q.settings?.secrets)q.settings.secrets=YM(q.settings.secrets,K);if(q.secrets)q.secrets=YM(q.secrets,K);return q}function U4$($,q){let K=JSON.parse(JSON.stringify($)),P=C_();if(K.settings?.secrets)K.settings.secrets=vM(K.settings.secrets,P);if(K.secrets)K.secrets=vM(K.secrets,P);return K}function YM($,q){let K={};for(let[P,_]of Object.entries($))if(typeof _==="string"&&_)K[P]=zM(_,q);else K[P]=_;return K}function vM($,q){let K={};for(let[P,_]of Object.entries($))if(typeof _==="string"&&_)K[P]=Qj(_,q);else K[P]=_;return K}class HM{serviceType;startFn;stopFn;description;constructor($){this.serviceType=$,this.description=""}withDescription($){return this.description=$,this}withStart($){return this.startFn=$,this}withStop($){return this.stopFn=$,this}build(){let $=this.serviceType,q=this.description,K=this.startFn,P=this.stopFn;return class extends KO{static serviceType=$;capabilityDescription=q;static async start(_){if(!K)throw Error(`Start function not defined for service ${$}`);return K(_)}async stop(){if(P)await P()}}}}function Mr($){return new HM($)}function Q4$($){return Mr($.serviceType).withDescription($.description).withStart($.start).withStop($.stop||(()=>Promise.resolve())).build()}class Nr extends EventTarget{runtimes=new Map;editableMode=!1;async addAgents($){let q=$.map(async(P)=>{let _=new IH({character:P.character,plugins:P.plugins||[],settings:P.settings||{}});return this.runtimes.set(_.agentId,_),this.dispatchEvent(new CustomEvent("agent:added",{detail:{agentId:_.agentId,character:P.character}})),_.agentId}),K=await Promise.all(q);return this.dispatchEvent(new CustomEvent("agents:added",{detail:{agentIds:K,count:K.length}})),K}registerAgent($){if(this.runtimes.has($.agentId))throw Error(`Agent ${$.agentId} already registered`);this.runtimes.set($.agentId,$),this.dispatchEvent(new CustomEvent("agent:registered",{detail:{agentId:$.agentId,runtime:$}}))}async updateAgent($,q){if(!this.editableMode)throw Error("Editable mode not enabled");let K=this.runtimes.get($);if(!K)throw Error(`Agent ${$} not found`);Object.assign(K.character,q),this.dispatchEvent(new CustomEvent("agent:updated",{detail:{agentId:$,updates:q}}))}async deleteAgents($){await this.stopAgents($);for(let q of $)this.runtimes.delete(q);this.dispatchEvent(new CustomEvent("agents:deleted",{detail:{agentIds:$,count:$.length}}))}async startAgents($){let q=$||Array.from(this.runtimes.keys());await Promise.all(q.map(async(K)=>{let P=this.runtimes.get(K);if(!P)throw Error(`Agent ${K} not found`);await P.initialize(),this.dispatchEvent(new CustomEvent("agent:started",{detail:{agentId:K}}))})),this.dispatchEvent(new CustomEvent("agents:started",{detail:{agentIds:q,count:q.length}}))}async stopAgents($){let q=$||Array.from(this.runtimes.keys());await Promise.all(q.map(async(K)=>{let P=this.runtimes.get(K);if(P)await P.stop()})),this.dispatchEvent(new CustomEvent("agents:stopped",{detail:{agentIds:q,count:q.length}}))}getAgent($){return this.runtimes.get($)}getAgents(){return Array.from(this.runtimes.values())}getAgentsByIds($){return $.map((q)=>this.runtimes.get(q)).filter((q)=>q!==void 0)}getAgentsByNames($){let q=new Set($.map((K)=>K.toLowerCase()));return this.getAgents().filter((K)=>q.has(K.character.name.toLowerCase()))}getAgentById($){return this.getAgent($)}getAgentByName($){let q=$.toLowerCase();return this.getAgents().find((K)=>K.character.name.toLowerCase()===q)}getAgentByCharacterName($){return this.getAgentByName($)}getAgentByCharacterId($){return this.getAgents().find((q)=>q.character.id===$)}async sendMessage($,q,K){let P=this.runtimes.get($);if(!P)throw Error(`Agent ${$} not found`);let _=typeof q==="string"?{id:U8(),entityId:K?.userId||"system",agentId:$,roomId:K?.roomId||$,content:{text:q},createdAt:Date.now(),metadata:K?.metadata}:q,O=[];return await P.processActions(_,O),this.dispatchEvent(new CustomEvent("message:sent",{detail:{agentId:$,message:_,responses:O}})),O}async sendMessages($){let q=await Promise.all($.map(async({agentId:K,message:P,options:_})=>{try{let O=await this.sendMessage(K,P,_);return{agentId:K,responses:O}}catch(O){return{agentId:K,responses:[],error:O instanceof Error?O:Error(String(O))}}}));return this.dispatchEvent(new CustomEvent("messages:sent",{detail:{results:q,count:$.length}})),q}async validateApiKeys($){let q=new Map,K=$||Array.from(this.runtimes.keys());for(let P of K){let _=this.runtimes.get(P);if(_){let O=!!(_.getSetting("OPENAI_API_KEY")||_.getSetting("ANTHROPIC_API_KEY"));q.set(P,O)}}return q}async healthCheck($){let q=new Map,K=$||Array.from(this.runtimes.keys());for(let P of K){let O={alive:!!this.runtimes.get(P),responsive:!0};if(typeof process<"u")O.memoryUsage=process.memoryUsage().heapUsed,O.uptime=process.uptime();q.set(P,O)}return q}getRuntimeAccessor(){return{getAgent:($)=>this.getAgent($),getAgents:()=>this.getAgents(),getState:($)=>{let q=this.getAgent($);if(!q)return;let K=q;if(K.stateCache&&K.stateCache.size>0){let P=Array.from(K.stateCache.values());return P[P.length-1]}return}}}enableEditableMode(){this.editableMode=!0,this.dispatchEvent(new CustomEvent("mode:editable",{detail:{editable:!0}}))}}var Cr=`# Task: Resolve Entity Name
|
|
587
587
|
Message Sender: {{senderName}} (ID: {{senderId}})
|
|
588
588
|
Agent: {{agentName}} (ID: {{agentId}})
|
|
589
589
|
|
|
@@ -617,12 +617,12 @@ Return an XML response with:
|
|
|
617
617
|
</matches>
|
|
618
618
|
</response>
|
|
619
619
|
|
|
620
|
-
IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`;async function
|
|
620
|
+
IMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.`;async function Er($,q,K,P,_){let O=[],j=await $.getMemories({tableName:"messages",roomId:P,count:20});for(let z of K){let J=[],w=0,G=j.filter((V)=>V.entityId===q&&V.content.inReplyTo===z.id||V.entityId===z.id&&V.content.inReplyTo===q);J.push(...G);let f=_.find((V)=>V.sourceEntityId===q&&V.targetEntityId===z.id||V.targetEntityId===q&&V.sourceEntityId===z.id);if(f?.metadata?.interactions)w=f.metadata.interactions;w+=G.length;let A=[...new Set(J)];O.push({entity:z,interactions:A.slice(-5),count:Math.round(w)})}return O.sort((z,J)=>J.count-z.count)}async function YP$($,q,K){let P=K.data.room??await $.getRoom(q.roomId);if(!P)return c6.warn("Room not found for entity search"),null;let _=P.worldId?await $.getWorld(P.worldId):null,O=await $.getEntitiesForRoom(P.id,!0),j=await Promise.all(O.map(async(E)=>{if(!E.components)return E;let R=_?.metadata?.roles||{};return E.components=E.components.filter((I)=>{if(I.sourceEntityId===q.entityId)return!0;if(_&&I.sourceEntityId){let D=R[I.sourceEntityId];if(D==="OWNER"||D==="ADMIN")return!0}if(I.sourceEntityId===$.agentId)return!0;return!1}),E})),z=await $.getRelationships({entityId:q.entityId}),J=await Promise.all(z.map(async(E)=>{let R=E.sourceEntityId===q.entityId?E.targetEntityId:E.sourceEntityId;return $.getEntityById(R)})),w=[...j,...J.filter((E)=>E!==null)],G=await Er($,q.entityId,w,P.id,z),f=IV({state:{roomName:P.name||P.id,worldName:_?.name||"Unknown",entitiesInRoom:JSON.stringify(j,null,2),entityId:q.entityId,senderId:q.entityId},template:Cr}),A=await $.useModel(Sq.TEXT_SMALL,{prompt:f,stopSequences:[]}),V=LV(A);if(!V)return c6.warn("Failed to parse entity resolution result"),null;if(V.type==="EXACT_MATCH"&&V.entityId){let E=await $.getEntityById(V.entityId);if(E){if(E.components){let R=_?.metadata?.roles||{};E.components=E.components.filter((I)=>{if(I.sourceEntityId===q.entityId)return!0;if(_&&I.sourceEntityId){let D=R[I.sourceEntityId];if(D==="OWNER"||D==="ADMIN")return!0}if(I.sourceEntityId===$.agentId)return!0;return!1})}return E}}let C=[];if(V.matches?.match)C=Array.isArray(V.matches.match)?V.matches.match:[V.matches.match];if(C.length>0&&C[0]?.name){let E=C[0].name.toLowerCase(),R=w.find((I)=>{if(I.names.some((D)=>D.toLowerCase()===E))return!0;return I.components?.some((D)=>D.data.username?.toLowerCase()===E||D.data.handle?.toLowerCase()===E)});if(R)if(V.type==="RELATIONSHIP_MATCH"){let I=G.find((D)=>D.entity.id===R.id);if(I&&I.count>0)return R}else return R}return null}var N_=($,q)=>{if(q===$.agentId)return $.agentId;let K=`${q}:${$.agentId}`;return D7(K)};async function vP$({runtime:$,roomId:q}){let[K,P]=await Promise.all([$.getRoom(q),$.getEntitiesForRoom(q,!0)]),_=new Map;for(let O of P){if(_.has(O.id))continue;let j={};for(let J of O.components||[])Object.assign(j,J.data);let z={};for(let[J,w]of Object.entries(j)){if(!z[J]){z[J]=w;continue}if(Array.isArray(z[J])&&Array.isArray(w))z[J]=[...new Set([...z[J],...w])];else if(typeof z[J]==="object"&&typeof w==="object")z[J]={...z[J],...w}}_.set(O.id,{id:O.id,name:K?.source?O.metadata[K.source]?.name||O.names[0]:O.names[0],names:O.names,data:JSON.stringify({...z,...O.metadata})})}return Array.from(_.values())}function zP$({entities:$}){return $.map((K)=>{return`"${K.names.join('" aka "')}"
|
|
621
621
|
ID: ${K.id}${K.metadata&&Object.keys(K.metadata).length>0?`
|
|
622
622
|
Data: ${JSON.stringify(K.metadata)}
|
|
623
623
|
`:`
|
|
624
624
|
`}`}).join(`
|
|
625
|
-
`)}var
|
|
625
|
+
`)}var HP$=!0,JP$=!1,TP$={check:async()=>({status:"not-applicable",environment:"browser"}),isHealthy:()=>!0};export{Vm as validateUuid,pV as validateCharacter,n4$ as updateWorldSettings,WM as unsaltWorldSettings,Vr as unsaltSettingValue,h_$ as truncateToCompleteSentence,I_$ as trimTokens,ao as toString,PM as toHex,D7 as stringToUuid,R_$ as splitChunks,qr as slice,P4$ as shouldRespondTemplate,Y8$ as setEnv,TP$ as serverHealth,Sr as saltWorldSettings,Gr as saltSettingValue,nW as safeReplacer,T_$ as recentLogs,Pr as randomBytes,g_$ as prewarmUuidCache,O4$ as postCreationTemplate,LV as parseKeyValueXml,E_$ as parseJSONObjectFromText,D_$ as parseBooleanFromText,x_$ as parseAndValidateCharacter,hV as normalizeJsonString,W4$ as multiStepSummaryTemplate,z4$ as multiStepDecisionTemplate,j4$ as messageHandlerTemplate,c6 as logger,c_$ as isValidCharacter,JP$ as isNode,Q_$ as isMessageMetadata,a_$ as isFragmentMetadata,q4$ as isFragmentMemory,F_$ as isDocumentMetadata,$4$ as isDocumentMemory,e_$ as isDescriptionMetadata,s_$ as isCustomMetadata,Qo as isBuffer,HP$ as isBrowser,t4$ as initializeOnboarding,W8$ as initBrowserEnvironment,v4$ as imageDescriptionTemplate,v8$ as hasEnv,i4$ as getWorldSettings,w4$ as getUserServerRole,ur as getTypedService,C_ as getSalt,tG as getNumberEnv,K4$ as getMemoryText,b_$ as getLocalServerUrl,N4 as getEnvironment,xK as getEnv,vP$ as getEntityDetails,L_$ as getContentTypeFromMimeType,z8$ as getBooleanEnv,Fo as fromString,Uo as fromHex,so as fromBytes,gV as formatTimestamp,N_$ as formatPosts,C_$ as formatMessages,zP$ as formatEntities,i_$ as formatActions,n_$ as formatActionNames,Z4$ as findWorldsForOwner,YP$ as findEntityByName,Kr as equals,B4$ as encryptedCharacter,zM as encryptStringValue,YM as encryptObjectValues,J_$ as elizaLogger,rG as detectEnvironment,Q4$ as defineService,U4$ as decryptedCharacter,Qj as decryptStringValue,Qj as decryptSecret,vM as decryptObjectValues,H_$ as customLevels,H8$ as currentRuntime,N_ as createUniqueUuid,kr as createSettingFromConfig,yr as createServiceError,Mr as createService,U_$ as createMessageMemory,I7 as createLogger,$r as concat,S_$ as composePromptFromState,IV as composePrompt,r_$ as composeActionExamples,r4$ as clearSaltCache,bm as characterSchema,_r as byteLength,Y4$ as booleanFooter,Rr as asUUID,eo as alloc,M_$ as addHeader,v_$ as __loggerTestHooks,cr as VECTOR_DIMS,GM as TeeType,AM as TEEMode,br as ServiceType,HM as ServiceBuilder,KO as Service,fr as Semaphore,VM as SOCKET_MESSAGE_TYPE,XM as Role,kM as PlatformPrefix,Sq as ModelType,ZM as MemoryType,r4 as MODEL_SETTINGS,yH as EventType,iG as Environment,Nr as ElizaOS,Or as DatabaseAdapter,uH as ContentType,l7 as ChannelType,oK as BufferUtils,RH as BM25,fM as AgentStatus,IH as AgentRuntime};
|
|
626
626
|
|
|
627
|
-
//# debugId=
|
|
627
|
+
//# debugId=BC9C9AE8A84BBB7E64756E2164756E21
|
|
628
628
|
//# sourceMappingURL=index.browser.js.map
|