@arcgis/ai-components 5.0.0-next.133 → 5.0.0-next.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{UC4HPCM3.js → 2I6RIEM7.js} +2 -2
- package/dist/cdn/{BCCDWQP4.js → 3YJ4XNZB.js} +2 -2
- package/dist/cdn/{GRXZ64LO.js → 45J72RA5.js} +2 -2
- package/dist/cdn/{MXHQFIP3.js → 4BKDN7AJ.js} +2 -2
- package/dist/cdn/{PEFKT7JJ.js → 4JWSHGI3.js} +1 -1
- package/dist/cdn/{AD7WB3RO.js → 4KXPB47L.js} +2 -2
- package/dist/cdn/{LILVLE37.js → 5EXI6IBC.js} +3 -3
- package/dist/cdn/{J62NTCLN.js → 5GP65UDI.js} +2 -2
- package/dist/cdn/{AB32PU6M.js → 6JIAN4EB.js} +2 -2
- package/dist/cdn/{FYKWTA6C.js → 7VXM3PHG.js} +2 -2
- package/dist/cdn/{KMV7W5OL.js → AENVX2C7.js} +2 -2
- package/dist/cdn/{N4CYINOF.js → BSFH6ITF.js} +2 -2
- package/dist/cdn/{A3UHOE4Q.js → D5B4XO32.js} +2 -2
- package/dist/cdn/{7QPPUNQ3.js → ETNHCA5Y.js} +2 -2
- package/dist/cdn/{TCNLHL43.js → FQP72TZH.js} +2 -2
- package/dist/cdn/{A7BGJLHS.js → GNYKVIRC.js} +3 -3
- package/dist/cdn/{ASKBAWPQ.js → H6HTZ2RZ.js} +2 -2
- package/dist/cdn/{YXLN5DSL.js → I54YR7UU.js} +1 -1
- package/dist/cdn/{EJW7PCMD.js → IBW6D6XX.js} +2 -2
- package/dist/cdn/{Q34AELDL.js → IHQXGVXR.js} +2 -2
- package/dist/cdn/{NR6PK4OK.js → JRSCOKGO.js} +2 -2
- package/dist/cdn/{UIUJKONY.js → K4DOBIBC.js} +1 -1
- package/dist/cdn/{GZUY3255.js → KXZ5YZL6.js} +2 -2
- package/dist/cdn/{Q3MKHRXI.js → LA353F4X.js} +2 -2
- package/dist/cdn/{CF42OIDB.js → LQKHGIXO.js} +2 -2
- package/dist/cdn/{2KGO3SIH.js → NCD5D6JY.js} +2 -2
- package/dist/cdn/{2OKOKVH3.js → NPQWPRM6.js} +2 -2
- package/dist/cdn/{WOP5ENGJ.js → ODYS7BCT.js} +4 -4
- package/dist/cdn/{W4LEGPD2.js → PZRNLUV2.js} +2 -2
- package/dist/cdn/{ZQEX3TGK.js → QFWBH3U2.js} +2 -2
- package/dist/cdn/{ID5STKZH.js → RTUKNJRX.js} +2 -2
- package/dist/cdn/SQPT22F4.js +4 -0
- package/dist/cdn/{G7XEFTIR.js → UROLRFUN.js} +2 -2
- package/dist/cdn/{PA2KCYKL.js → VY47US65.js} +2 -2
- package/dist/cdn/{FORRN75L.js → XOXI7KQN.js} +2 -2
- package/dist/cdn/{USJ5YVZN.js → XULCWMYE.js} +2 -2
- package/dist/cdn/{46CNQJRX.js → YQVK2H7R.js} +1 -1
- package/dist/cdn/{QIU4T2DV.js → ZHEJLKZX.js} +2 -2
- package/dist/cdn/{CGGGHCIN.js → ZZIAB76W.js} +2 -2
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/components/arcgis-assistant/customElement.js +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-card/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-card-content/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-shell/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +6 -6
- package/dist/cdn/HPGCDT6I.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import"./
|
|
3
|
+
v5.0.0-next.135 */
|
|
4
|
+
import"./YQVK2H7R.js";var e=`## Navigation Agent - Tool Intent Classifier
|
|
5
5
|
|
|
6
6
|
You are an assistant that classifies user intent for navigation agent.
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import d from"./
|
|
3
|
+
v5.0.0-next.135 */
|
|
4
|
+
import d from"./GNYKVIRC.js";import{a as i,b as e}from"./XOXI7KQN.js";import c from"./ODYS7BCT.js";import"./4JWSHGI3.js";import"./K4DOBIBC.js";import{p as a,t as s}from"./I54YR7UU.js";import b from"./QFWBH3U2.js";import"./5EXI6IBC.js";import"./YQVK2H7R.js";export default $arcgis.t(([,,{a:r}])=>{var t=class extends a{constructor(){super(...arguments),this.agent=r}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await i(this,"arcgis-assistant-navigation-agent"),e(this)}};s("arcgis-assistant-navigation-agent",t);return t},b,c,d)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import"./
|
|
3
|
+
v5.0.0-next.135 */
|
|
4
|
+
import"./YQVK2H7R.js";var e=`## GIS Feature Layer Intent Classifier
|
|
5
5
|
|
|
6
6
|
You are an assistant that classifies user intent in ArcGIS Online Map Viewer.
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import"./
|
|
3
|
+
v5.0.0-next.135 */
|
|
4
|
+
import"./YQVK2H7R.js";var e=`## LinkChart Agent - Tool Intent Classifier
|
|
5
5
|
|
|
6
6
|
You are an assistant that classifies user intent for linkChart agent.
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
3
|
+
v5.0.0-next.135 */
|
|
4
4
|
function n(e){return e?typeof e=="string"?document.querySelector(e):e:null}export{n as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as u}from"./
|
|
3
|
+
v5.0.0-next.135 */
|
|
4
|
+
import{a as u}from"./NCD5D6JY.js";import"./K4DOBIBC.js";import{g as i,h as s,k as a,n as r,o as n,p as c,r as o,t as l}from"./I54YR7UU.js";import"./YQVK2H7R.js";export default $arcgis.t(([{watch:h}])=>{var d=i`.assistant-chat-entry__input-container{display:flex;flex-direction:column}.assistant-chat-entry__footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.assistant-chat-entry__footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.assistant-chat-entry__status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.assistant-chat-entry__status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.assistant-chat-entry__status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.assistant-chat-entry__status-text{text-transform:capitalize}`,e=class extends c{constructor(){super(...arguments),this.#t=r(),this._messages=u({blocking:!0}),this.enterKeySubmits=!0,this.awaitingResponse=!1,this.inputValue="",this.arcgisCancel=a(),this.arcgisSubmit=a()}static{this.properties={enterKeySubmits:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1}}static{this.styles=d}#t;loaded(){this.manager.onLifecycle(()=>[h(()=>this.inputValue,t=>{this.#t.value&&(this.#t.value.value=t)},{initial:!0})])}async _submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.#t.value?.value.trim();t&&(this.arcgisSubmit.emit(t),this.#t.value&&(this.#t.value.value="",await this.#t.value.setFocus()))}render(){return s`<div class="assistant-chat-entry__input-container"><calcite-text-area .value=${this.#t.value?.value} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} @keydown=${async t=>{t.key==="Enter"&&!t.shiftKey&&this.enterKeySubmits&&(t.preventDefault(),await this._submitMessage())}} ${n(this.#t)}><div slot=footer-start class="assistant-chat-entry__footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="assistant-chat-entry__footer-end">${this.status?s`<div id=tooltip-status class="assistant-chat-entry__status-indicator" data-status=${this.status??o}></div><calcite-tooltip reference-element=tooltip-status offset-distance=12><span class="assistant-chat-entry__status-text">${this.status}</span></calcite-tooltip>`:null}<calcite-button .iconStart=${this.awaitingResponse?"circle-stop":"send"} slot=footer-end round @click=${()=>void this._submitMessage()}>${this.awaitingResponse?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></div></calcite-text-area></div>`}};l("arcgis-assistant-chat-entry",e);return e},"core/reactiveUtils")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as P,b as le,c as ot}from"./46CNQJRX.js";var Ko=P((Iv,Jo)=>{"use strict";Jo.exports=function(r,e){if(typeof r!="string")throw new TypeError("Expected a string");return e=typeof e>"u"?"_":e,r.replace(/([a-z\d])([A-Z])/g,"$1"+e+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+e+"$2").toLowerCase()}});var ru=P((Av,zs)=>{"use strict";var Ip=/[\p{Lu}]/u,Ap=/[\p{Ll}]/u,Wo=/^[\p{Lu}](?![\p{Lu}])/gu,Qo=/([\p{Alpha}\p{N}_]|$)/u,eu=/[_.\- ]+/,kp=new RegExp("^"+eu.source),Yo=new RegExp(eu.source+Qo.source,"gu"),Xo=new RegExp("\\d+"+Qo.source,"gu"),Pp=(r,e,t)=>{let n=!1,i=!1,s=!1;for(let a=0;a<r.length;a++){let o=r[a];n&&Ip.test(o)?(r=r.slice(0,a)+"-"+r.slice(a),n=!1,s=i,i=!0,a++):i&&s&&Ap.test(o)?(r=r.slice(0,a-1)+"-"+r.slice(a-1),s=i,i=!1,n=!0):(n=e(o)===o&&t(o)!==o,s=i,i=t(o)===o&&e(o)!==o)}return r},Rp=(r,e)=>(Wo.lastIndex=0,r.replace(Wo,t=>e(t))),Np=(r,e)=>(Yo.lastIndex=0,Xo.lastIndex=0,r.replace(Yo,(t,n)=>e(n)).replace(Xo,t=>e(t))),tu=(r,e)=>{if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(s=>s.trim()).filter(s=>s.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?s=>s.toLowerCase():s=>s.toLocaleLowerCase(e.locale),n=e.locale===!1?s=>s.toUpperCase():s=>s.toLocaleUpperCase(e.locale);return r.length===1?e.pascalCase?n(r):t(r):(r!==t(r)&&(r=Pp(r,t,n)),r=r.replace(kp,""),e.preserveConsecutiveUppercase?r=Rp(r,t):r=t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),Np(r,n))};zs.exports=tu;zs.exports.default=tu});var Ou=P((bE,Tu)=>{function He(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.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))}Tu.exports=He;He.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};He.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};He.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},t),this._options.unref&&this._timer.unref(),!0};He.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};He.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};He.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};He.prototype.start=He.prototype.try;He.prototype.errors=function(){return this._errors};He.prototype.attempts=function(){return this._attempts};He.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,a=(r[s]||0)+1;r[s]=a,a>=t&&(e=i,t=a)}return e}});var $u=P(ur=>{var rm=Ou();ur.operation=function(r){var e=ur.timeouts(r);return new rm(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};ur.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return r&&r.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,a){return s-a}),n};ur.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,n=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return n=Math.min(n,e.maxTimeout),n};ur.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var n in r)typeof r[n]=="function"&&t.push(n)}for(var i=0;i<t.length;i++){var s=t[i],a=r[s];r[s]=function(u){var c=ur.operation(e),l=Array.prototype.slice.call(arguments,1),d=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){u.apply(r,l)})}.bind(r,a),r[s].options=e}}});var Au=P((vE,Iu)=>{Iu.exports=$u()});var ri=P((xE,ti)=>{"use strict";var nm=Au(),im=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],ei=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},sm=(r,e,t)=>{let n=t.retries-(e-1);return r.attemptNumber=e,r.retriesLeft=n,r},am=r=>im.includes(r),ku=(r,e)=>new Promise((t,n)=>{e={onFailedAttempt:()=>{},retries:10,...e};let i=nm.operation(e);i.attempt(async s=>{try{t(await r(s))}catch(a){if(!(a instanceof Error)){n(new TypeError(`Non-error was thrown: "${a}". You should only throw errors.`));return}if(a instanceof ei)i.stop(),n(a.originalError);else if(a instanceof TypeError&&!am(a.message))i.stop(),n(a);else{sm(a,s,e);try{await e.onFailedAttempt(a)}catch(o){n(o);return}i.retry(a)||n(i.mainError())}}})});ti.exports=ku;ti.exports.default=ku;ti.exports.AbortError=ei});var Sc=P((C0,ya)=>{"use strict";var Fm=Object.prototype.hasOwnProperty,xe="~";function on(){}Object.create&&(on.prototype=Object.create(null),new on().__proto__||(xe=!1));function Zm(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function Ec(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new Zm(t,n||r,i),a=xe?xe+e:e;return r._events[a]?r._events[a].fn?r._events[a]=[r._events[a],s]:r._events[a].push(s):(r._events[a]=s,r._eventsCount++),r}function vi(r,e){--r._eventsCount===0?r._events=new on:delete r._events[e]}function be(){this._events=new on,this._eventsCount=0}be.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)Fm.call(t,n)&&e.push(xe?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};be.prototype.listeners=function(e){var t=xe?xe+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=new Array(s);i<s;i++)a[i]=n[i].fn;return a};be.prototype.listenerCount=function(e){var t=xe?xe+e:e,n=this._events[t];return n?n.fn?1:n.length:0};be.prototype.emit=function(e,t,n,i,s,a){var o=xe?xe+e:e;if(!this._events[o])return!1;var u=this._events[o],c=arguments.length,l,d;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,i),!0;case 5:return u.fn.call(u.context,t,n,i,s),!0;case 6:return u.fn.call(u.context,t,n,i,s,a),!0}for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u.fn.apply(u.context,l)}else{var f=u.length,p;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(e,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,t);break;case 3:u[d].fn.call(u[d].context,t,n);break;case 4:u[d].fn.call(u[d].context,t,n,i);break;default:if(!l)for(p=1,l=new Array(c-1);p<c;p++)l[p-1]=arguments[p];u[d].fn.apply(u[d].context,l)}}return!0};be.prototype.on=function(e,t,n){return Ec(this,e,t,n,!1)};be.prototype.once=function(e,t,n){return Ec(this,e,t,n,!0)};be.prototype.removeListener=function(e,t,n,i){var s=xe?xe+e:e;if(!this._events[s])return this;if(!t)return vi(this,s),this;var a=this._events[s];if(a.fn)a.fn===t&&(!i||a.once)&&(!n||a.context===n)&&vi(this,s);else{for(var o=0,u=[],c=a.length;o<c;o++)(a[o].fn!==t||i&&!a[o].once||n&&a[o].context!==n)&&u.push(a[o]);u.length?this._events[s]=u.length===1?u[0]:u:vi(this,s)}return this};be.prototype.removeAllListeners=function(e){var t;return e?(t=xe?xe+e:e,this._events[t]&&vi(this,t)):(this._events=new on,this._eventsCount=0),this};be.prototype.off=be.prototype.removeListener;be.prototype.addListener=be.prototype.on;be.prefixed=xe;be.EventEmitter=be;typeof ya<"u"&&(ya.exports=be)});var Oc=P((j0,Tc)=>{"use strict";Tc.exports=(r,e)=>(e=e||(()=>{}),r.then(t=>new Promise(n=>{n(e())}).then(()=>t),t=>new Promise(n=>{n(e())}).then(()=>{throw t})))});var Ic=P((L0,Ei)=>{"use strict";var Bm=Oc(),xi=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},$c=(r,e,t)=>new Promise((n,i)=>{if(typeof e!="number"||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0){n(r);return}let s=setTimeout(()=>{if(typeof t=="function"){try{n(t())}catch(u){i(u)}return}let a=typeof t=="string"?t:`Promise timed out after ${e} milliseconds`,o=t instanceof Error?t:new xi(a);typeof r.cancel=="function"&&r.cancel(),i(o)},e);Bm(r.then(n,i),()=>{clearTimeout(s)})});Ei.exports=$c;Ei.exports.default=$c;Ei.exports.TimeoutError=xi});var Ac=P(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});function Gm(r,e,t){let n=0,i=r.length;for(;i>0;){let s=i/2|0,a=n+s;t(r[a],e)<=0?(n=++a,i-=s+1):i=s}return n}ba.default=Gm});var kc=P(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var qm=Ac(),wa=class{constructor(){this._queue=[]}enqueue(e,t){t=Object.assign({priority:0},t);let n={priority:t.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority){this._queue.push(n);return}let i=qm.default(this._queue,n,(s,a)=>a.priority-s.priority);this._queue.splice(i,0,n)}dequeue(){let e=this._queue.shift();return e?.run}filter(e){return this._queue.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this._queue.length}};va.default=wa});var Ti=P(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var Vm=Sc(),Pc=Ic(),Hm=kc(),Si=()=>{},Jm=new Pc.TimeoutError,xa=class extends Vm{constructor(e){var t,n,i,s;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=Si,this._resolveIdle=Si,e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Hm.default},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||e.interval===0,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=e.throwOnTimeout===!0,this._isPaused=e.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(){this._resolveEmpty(),this._resolveEmpty=Si,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=Si,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let e=Date.now();if(this._intervalId===void 0){let t=this._intervalEnd-e;if(t<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},t)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let t=this._queue.dequeue();return t?(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){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(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise((n,i)=>{let s=async()=>{this._pendingCount++,this._intervalCount++;try{let a=this._timeout===void 0&&t.timeout===void 0?e():Pc.default(Promise.resolve(e()),t.timeout===void 0?this._timeout:t.timeout,()=>{(t.throwOnTimeout===void 0?this._throwOnTimeout:t.throwOnTimeout)&&i(Jm)});n(await a)}catch(a){i(a)}this._next()};this._queue.enqueue(s,t),this._tryToStartAnother(),this.emit("add")})}async addAll(e,t){return Promise.all(e.map(async n=>this.add(n,t)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(e=>{let t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(e=>{let t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}};Ea.default=xa});var ln=P((G0,Cc)=>{"use strict";var Ym="2.0.0",Xm=Number.MAX_SAFE_INTEGER||9007199254740991,Qm=16,eg=250,tg=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Cc.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Qm,MAX_SAFE_BUILD_LENGTH:eg,MAX_SAFE_INTEGER:Xm,RELEASE_TYPES:tg,SEMVER_SPEC_VERSION:Ym,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var dn=P((q0,jc)=>{"use strict";var rg=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};jc.exports=rg});var jr=P((pt,Lc)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Oa,MAX_SAFE_BUILD_LENGTH:ng,MAX_LENGTH:ig}=ln(),sg=dn();pt=Lc.exports={};var ag=pt.re=[],og=pt.safeRe=[],T=pt.src=[],ug=pt.safeSrc=[],O=pt.t={},cg=0,$a="[a-zA-Z0-9-]",lg=[["\\s",1],["\\d",ig],[$a,ng]],dg=r=>{for(let[e,t]of lg)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},Z=(r,e,t)=>{let n=dg(e),i=cg++;sg(r,i,e),O[r]=i,T[i]=e,ug[i]=n,ag[i]=new RegExp(e,t?"g":void 0),og[i]=new RegExp(n,t?"g":void 0)};Z("NUMERICIDENTIFIER","0|[1-9]\\d*");Z("NUMERICIDENTIFIERLOOSE","\\d+");Z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${$a}*`);Z("MAINVERSION",`(${T[O.NUMERICIDENTIFIER]})\\.(${T[O.NUMERICIDENTIFIER]})\\.(${T[O.NUMERICIDENTIFIER]})`);Z("MAINVERSIONLOOSE",`(${T[O.NUMERICIDENTIFIERLOOSE]})\\.(${T[O.NUMERICIDENTIFIERLOOSE]})\\.(${T[O.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASEIDENTIFIER",`(?:${T[O.NONNUMERICIDENTIFIER]}|${T[O.NUMERICIDENTIFIER]})`);Z("PRERELEASEIDENTIFIERLOOSE",`(?:${T[O.NONNUMERICIDENTIFIER]}|${T[O.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASE",`(?:-(${T[O.PRERELEASEIDENTIFIER]}(?:\\.${T[O.PRERELEASEIDENTIFIER]})*))`);Z("PRERELEASELOOSE",`(?:-?(${T[O.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${T[O.PRERELEASEIDENTIFIERLOOSE]})*))`);Z("BUILDIDENTIFIER",`${$a}+`);Z("BUILD",`(?:\\+(${T[O.BUILDIDENTIFIER]}(?:\\.${T[O.BUILDIDENTIFIER]})*))`);Z("FULLPLAIN",`v?${T[O.MAINVERSION]}${T[O.PRERELEASE]}?${T[O.BUILD]}?`);Z("FULL",`^${T[O.FULLPLAIN]}$`);Z("LOOSEPLAIN",`[v=\\s]*${T[O.MAINVERSIONLOOSE]}${T[O.PRERELEASELOOSE]}?${T[O.BUILD]}?`);Z("LOOSE",`^${T[O.LOOSEPLAIN]}$`);Z("GTLT","((?:<|>)?=?)");Z("XRANGEIDENTIFIERLOOSE",`${T[O.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Z("XRANGEIDENTIFIER",`${T[O.NUMERICIDENTIFIER]}|x|X|\\*`);Z("XRANGEPLAIN",`[v=\\s]*(${T[O.XRANGEIDENTIFIER]})(?:\\.(${T[O.XRANGEIDENTIFIER]})(?:\\.(${T[O.XRANGEIDENTIFIER]})(?:${T[O.PRERELEASE]})?${T[O.BUILD]}?)?)?`);Z("XRANGEPLAINLOOSE",`[v=\\s]*(${T[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[O.XRANGEIDENTIFIERLOOSE]})(?:${T[O.PRERELEASELOOSE]})?${T[O.BUILD]}?)?)?`);Z("XRANGE",`^${T[O.GTLT]}\\s*${T[O.XRANGEPLAIN]}$`);Z("XRANGELOOSE",`^${T[O.GTLT]}\\s*${T[O.XRANGEPLAINLOOSE]}$`);Z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Oa}})(?:\\.(\\d{1,${Oa}}))?(?:\\.(\\d{1,${Oa}}))?`);Z("COERCE",`${T[O.COERCEPLAIN]}(?:$|[^\\d])`);Z("COERCEFULL",T[O.COERCEPLAIN]+`(?:${T[O.PRERELEASE]})?(?:${T[O.BUILD]})?(?:$|[^\\d])`);Z("COERCERTL",T[O.COERCE],!0);Z("COERCERTLFULL",T[O.COERCEFULL],!0);Z("LONETILDE","(?:~>?)");Z("TILDETRIM",`(\\s*)${T[O.LONETILDE]}\\s+`,!0);pt.tildeTrimReplace="$1~";Z("TILDE",`^${T[O.LONETILDE]}${T[O.XRANGEPLAIN]}$`);Z("TILDELOOSE",`^${T[O.LONETILDE]}${T[O.XRANGEPLAINLOOSE]}$`);Z("LONECARET","(?:\\^)");Z("CARETTRIM",`(\\s*)${T[O.LONECARET]}\\s+`,!0);pt.caretTrimReplace="$1^";Z("CARET",`^${T[O.LONECARET]}${T[O.XRANGEPLAIN]}$`);Z("CARETLOOSE",`^${T[O.LONECARET]}${T[O.XRANGEPLAINLOOSE]}$`);Z("COMPARATORLOOSE",`^${T[O.GTLT]}\\s*(${T[O.LOOSEPLAIN]})$|^$`);Z("COMPARATOR",`^${T[O.GTLT]}\\s*(${T[O.FULLPLAIN]})$|^$`);Z("COMPARATORTRIM",`(\\s*)${T[O.GTLT]}\\s*(${T[O.LOOSEPLAIN]}|${T[O.XRANGEPLAIN]})`,!0);pt.comparatorTrimReplace="$1$2$3";Z("HYPHENRANGE",`^\\s*(${T[O.XRANGEPLAIN]})\\s+-\\s+(${T[O.XRANGEPLAIN]})\\s*$`);Z("HYPHENRANGELOOSE",`^\\s*(${T[O.XRANGEPLAINLOOSE]})\\s+-\\s+(${T[O.XRANGEPLAINLOOSE]})\\s*$`);Z("STAR","(<|>)?=?\\s*\\*");Z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var $i=P((V0,zc)=>{"use strict";var fg=Object.freeze({loose:!0}),pg=Object.freeze({}),hg=r=>r?typeof r!="object"?fg:r:pg;zc.exports=hg});var Ia=P((H0,Uc)=>{"use strict";var Mc=/^[0-9]+$/,Dc=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=Mc.test(r),n=Mc.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},mg=(r,e)=>Dc(e,r);Uc.exports={compareIdentifiers:Dc,rcompareIdentifiers:mg}});var we=P((J0,Zc)=>{"use strict";var Ii=dn(),{MAX_LENGTH:Fc,MAX_SAFE_INTEGER:Ai}=ln(),{safeRe:ki,t:Pi}=jr(),gg=$i(),{compareIdentifiers:Aa}=Ia(),ka=class r{constructor(e,t){if(t=gg(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Fc)throw new TypeError(`version is longer than ${Fc} characters`);Ii("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?ki[Pi.LOOSE]:ki[Pi.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ai||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ai||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ai||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<Ai)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ii("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(Ii("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Aa(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(Ii("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Aa(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?ki[Pi.PRERELEASELOOSE]:ki[Pi.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];n===!1&&(s=[t]),Aa(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Zc.exports=ka});var pr=P((K0,Gc)=>{"use strict";var Bc=we(),_g=(r,e,t=!1)=>{if(r instanceof Bc)return r;try{return new Bc(r,e)}catch(n){if(!t)return null;throw n}};Gc.exports=_g});var Vc=P((W0,qc)=>{"use strict";var yg=pr(),bg=(r,e)=>{let t=yg(r,e);return t?t.version:null};qc.exports=bg});var Jc=P((Y0,Hc)=>{"use strict";var wg=pr(),vg=(r,e)=>{let t=wg(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Hc.exports=vg});var Yc=P((X0,Wc)=>{"use strict";var Kc=we(),xg=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Kc(r instanceof Kc?r.version:r,t).inc(e,n,i).version}catch{return null}};Wc.exports=xg});var el=P((Q0,Qc)=>{"use strict";var Xc=pr(),Eg=(r,e)=>{let t=Xc(r,null,!0),n=Xc(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,a=s?t:n,o=s?n:t,u=!!a.prerelease.length;if(!!o.prerelease.length&&!u){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let l=u?"pre":"";return t.major!==n.major?l+"major":t.minor!==n.minor?l+"minor":t.patch!==n.patch?l+"patch":"prerelease"};Qc.exports=Eg});var rl=P((eS,tl)=>{"use strict";var Sg=we(),Tg=(r,e)=>new Sg(r,e).major;tl.exports=Tg});var il=P((tS,nl)=>{"use strict";var Og=we(),$g=(r,e)=>new Og(r,e).minor;nl.exports=$g});var al=P((rS,sl)=>{"use strict";var Ig=we(),Ag=(r,e)=>new Ig(r,e).patch;sl.exports=Ag});var ul=P((nS,ol)=>{"use strict";var kg=pr(),Pg=(r,e)=>{let t=kg(r,e);return t&&t.prerelease.length?t.prerelease:null};ol.exports=Pg});var Je=P((iS,ll)=>{"use strict";var cl=we(),Rg=(r,e,t)=>new cl(r,t).compare(new cl(e,t));ll.exports=Rg});var fl=P((sS,dl)=>{"use strict";var Ng=Je(),Cg=(r,e,t)=>Ng(e,r,t);dl.exports=Cg});var hl=P((aS,pl)=>{"use strict";var jg=Je(),Lg=(r,e)=>jg(r,e,!0);pl.exports=Lg});var Ri=P((oS,gl)=>{"use strict";var ml=we(),zg=(r,e,t)=>{let n=new ml(r,t),i=new ml(e,t);return n.compare(i)||n.compareBuild(i)};gl.exports=zg});var yl=P((uS,_l)=>{"use strict";var Mg=Ri(),Dg=(r,e)=>r.sort((t,n)=>Mg(t,n,e));_l.exports=Dg});var wl=P((cS,bl)=>{"use strict";var Ug=Ri(),Fg=(r,e)=>r.sort((t,n)=>Ug(n,t,e));bl.exports=Fg});var fn=P((lS,vl)=>{"use strict";var Zg=Je(),Bg=(r,e,t)=>Zg(r,e,t)>0;vl.exports=Bg});var Ni=P((dS,xl)=>{"use strict";var Gg=Je(),qg=(r,e,t)=>Gg(r,e,t)<0;xl.exports=qg});var Pa=P((fS,El)=>{"use strict";var Vg=Je(),Hg=(r,e,t)=>Vg(r,e,t)===0;El.exports=Hg});var Ra=P((pS,Sl)=>{"use strict";var Jg=Je(),Kg=(r,e,t)=>Jg(r,e,t)!==0;Sl.exports=Kg});var Ci=P((hS,Tl)=>{"use strict";var Wg=Je(),Yg=(r,e,t)=>Wg(r,e,t)>=0;Tl.exports=Yg});var ji=P((mS,Ol)=>{"use strict";var Xg=Je(),Qg=(r,e,t)=>Xg(r,e,t)<=0;Ol.exports=Qg});var Na=P((gS,$l)=>{"use strict";var e_=Pa(),t_=Ra(),r_=fn(),n_=Ci(),i_=Ni(),s_=ji(),a_=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return e_(r,t,n);case"!=":return t_(r,t,n);case">":return r_(r,t,n);case">=":return n_(r,t,n);case"<":return i_(r,t,n);case"<=":return s_(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};$l.exports=a_});var Al=P((_S,Il)=>{"use strict";var o_=we(),u_=pr(),{safeRe:Li,t:zi}=jr(),c_=(r,e)=>{if(r instanceof o_)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?Li[zi.COERCEFULL]:Li[zi.COERCE]);else{let u=e.includePrerelease?Li[zi.COERCERTLFULL]:Li[zi.COERCERTL],c;for(;(c=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",o=e.includePrerelease&&t[6]?`+${t[6]}`:"";return u_(`${n}.${i}.${s}${a}${o}`,e)};Il.exports=c_});var Pl=P((yS,kl)=>{"use strict";var Ca=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};kl.exports=Ca});var Ke=P((bS,jl)=>{"use strict";var l_=/\s+/g,ja=class r{constructor(e,t){if(t=f_(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof La)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(l_," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!Nl(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&b_(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&__)|(this.options.loose&&y_))+":"+e,i=Rl.get(n);if(i)return i;let s=this.options.loose,a=s?Ee[ve.HYPHENRANGELOOSE]:Ee[ve.HYPHENRANGE];e=e.replace(a,A_(this.options.includePrerelease)),Y("hyphen replace",e),e=e.replace(Ee[ve.COMPARATORTRIM],h_),Y("comparator trim",e),e=e.replace(Ee[ve.TILDETRIM],m_),Y("tilde trim",e),e=e.replace(Ee[ve.CARETTRIM],g_),Y("caret trim",e);let o=e.split(" ").map(d=>w_(d,this.options)).join(" ").split(/\s+/).map(d=>I_(d,this.options));s&&(o=o.filter(d=>(Y("loose invalid filter",d,this.options),!!d.match(Ee[ve.COMPARATORLOOSE])))),Y("range list",o);let u=new Map,c=o.map(d=>new La(d,this.options));for(let d of c){if(Nl(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return Rl.set(n,l),l}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>Cl(n,t)&&e.set.some(i=>Cl(i,t)&&n.every(s=>i.every(a=>s.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new p_(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(k_(this.set[t],e,this.options))return!0;return!1}};jl.exports=ja;var d_=Pl(),Rl=new d_,f_=$i(),La=pn(),Y=dn(),p_=we(),{safeRe:Ee,t:ve,comparatorTrimReplace:h_,tildeTrimReplace:m_,caretTrimReplace:g_}=jr(),{FLAG_INCLUDE_PRERELEASE:__,FLAG_LOOSE:y_}=ln(),Nl=r=>r.value==="<0.0.0-0",b_=r=>r.value==="",Cl=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},w_=(r,e)=>(r=r.replace(Ee[ve.BUILD],""),Y("comp",r,e),r=E_(r,e),Y("caret",r),r=v_(r,e),Y("tildes",r),r=T_(r,e),Y("xrange",r),r=$_(r,e),Y("stars",r),r),Se=r=>!r||r.toLowerCase()==="x"||r==="*",v_=(r,e)=>r.trim().split(/\s+/).map(t=>x_(t,e)).join(" "),x_=(r,e)=>{let t=e.loose?Ee[ve.TILDELOOSE]:Ee[ve.TILDE];return r.replace(t,(n,i,s,a,o)=>{Y("tilde",r,n,i,s,a,o);let u;return Se(i)?u="":Se(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:Se(a)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:o?(Y("replaceTilde pr",o),u=`>=${i}.${s}.${a}-${o} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`,Y("tilde return",u),u})},E_=(r,e)=>r.trim().split(/\s+/).map(t=>S_(t,e)).join(" "),S_=(r,e)=>{Y("caret",r,e);let t=e.loose?Ee[ve.CARETLOOSE]:Ee[ve.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,a,o,u)=>{Y("caret",r,i,s,a,o,u);let c;return Se(s)?c="":Se(a)?c=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Se(o)?s==="0"?c=`>=${s}.${a}.0${n} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.0${n} <${+s+1}.0.0-0`:u?(Y("replaceCaret pr",u),s==="0"?a==="0"?c=`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(Y("no pr"),s==="0"?a==="0"?c=`>=${s}.${a}.${o}${n} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}${n} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o} <${+s+1}.0.0-0`),Y("caret return",c),c})},T_=(r,e)=>(Y("replaceXRanges",r,e),r.split(/\s+/).map(t=>O_(t,e)).join(" ")),O_=(r,e)=>{r=r.trim();let t=e.loose?Ee[ve.XRANGELOOSE]:Ee[ve.XRANGE];return r.replace(t,(n,i,s,a,o,u)=>{Y("xRange",r,n,i,s,a,o,u);let c=Se(s),l=c||Se(a),d=l||Se(o),f=d;return i==="="&&f&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(a=0),o=0,i===">"?(i=">=",l?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):i==="<="&&(i="<",l?s=+s+1:a=+a+1),i==="<"&&(u="-0"),n=`${i+s}.${a}.${o}${u}`):l?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:d&&(n=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),Y("xRange return",n),n})},$_=(r,e)=>(Y("replaceStars",r,e),r.trim().replace(Ee[ve.STAR],"")),I_=(r,e)=>(Y("replaceGTE0",r,e),r.trim().replace(Ee[e.includePrerelease?ve.GTE0PRE:ve.GTE0],"")),A_=r=>(e,t,n,i,s,a,o,u,c,l,d,f)=>(Se(n)?t="":Se(i)?t=`>=${n}.0.0${r?"-0":""}`:Se(s)?t=`>=${n}.${i}.0${r?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,Se(c)?u="":Se(l)?u=`<${+c+1}.0.0-0`:Se(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:r?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),k_=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(Y(r[n].semver),r[n].semver!==La.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var pn=P((wS,Fl)=>{"use strict";var hn=Symbol("SemVer ANY"),Da=class r{static get ANY(){return hn}constructor(e,t){if(t=Ll(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ma("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===hn?this.value="":this.value=this.operator+this.semver.version,Ma("comp",this)}parse(e){let t=this.options.loose?zl[Ml.COMPARATORLOOSE]:zl[Ml.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Dl(n[2],this.options.loose):this.semver=hn}toString(){return this.value}test(e){if(Ma("Comparator.test",e,this.options.loose),this.semver===hn||e===hn)return!0;if(typeof e=="string")try{e=new Dl(e,this.options)}catch{return!1}return za(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Ul(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Ul(this.value,t).test(e.semver):(t=Ll(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||za(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||za(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Fl.exports=Da;var Ll=$i(),{safeRe:zl,t:Ml}=jr(),za=Na(),Ma=dn(),Dl=we(),Ul=Ke()});var mn=P((vS,Zl)=>{"use strict";var P_=Ke(),R_=(r,e,t)=>{try{e=new P_(e,t)}catch{return!1}return e.test(r)};Zl.exports=R_});var Gl=P((xS,Bl)=>{"use strict";var N_=Ke(),C_=(r,e)=>new N_(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Bl.exports=C_});var Vl=P((ES,ql)=>{"use strict";var j_=we(),L_=Ke(),z_=(r,e,t)=>{let n=null,i=null,s=null;try{s=new L_(e,t)}catch{return null}return r.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new j_(n,t))}),n};ql.exports=z_});var Jl=P((SS,Hl)=>{"use strict";var M_=we(),D_=Ke(),U_=(r,e,t)=>{let n=null,i=null,s=null;try{s=new D_(e,t)}catch{return null}return r.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new M_(n,t))}),n};Hl.exports=U_});var Yl=P((TS,Wl)=>{"use strict";var Ua=we(),F_=Ke(),Kl=fn(),Z_=(r,e)=>{r=new F_(r,e);let t=new Ua("0.0.0");if(r.test(t)||(t=new Ua("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(a=>{let o=new Ua(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||Kl(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!t||Kl(t,s))&&(t=s)}return t&&r.test(t)?t:null};Wl.exports=Z_});var Ql=P((OS,Xl)=>{"use strict";var B_=Ke(),G_=(r,e)=>{try{return new B_(r,e).range||"*"}catch{return null}};Xl.exports=G_});var Mi=P(($S,nd)=>{"use strict";var q_=we(),rd=pn(),{ANY:V_}=rd,H_=Ke(),J_=mn(),ed=fn(),td=Ni(),K_=ji(),W_=Ci(),Y_=(r,e,t,n)=>{r=new q_(r,n),e=new H_(e,n);let i,s,a,o,u;switch(t){case">":i=ed,s=K_,a=td,o=">",u=">=";break;case"<":i=td,s=W_,a=ed,o="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(J_(r,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],d=null,f=null;if(l.forEach(p=>{p.semver===V_&&(p=new rd(">=0.0.0")),d=d||p,f=f||p,i(p.semver,d.semver,n)?d=p:a(p.semver,f.semver,n)&&(f=p)}),d.operator===o||d.operator===u||(!f.operator||f.operator===o)&&s(r,f.semver))return!1;if(f.operator===u&&a(r,f.semver))return!1}return!0};nd.exports=Y_});var sd=P((IS,id)=>{"use strict";var X_=Mi(),Q_=(r,e,t)=>X_(r,e,">",t);id.exports=Q_});var od=P((AS,ad)=>{"use strict";var ey=Mi(),ty=(r,e,t)=>ey(r,e,"<",t);ad.exports=ty});var ld=P((kS,cd)=>{"use strict";var ud=Ke(),ry=(r,e,t)=>(r=new ud(r,t),e=new ud(e,t),r.intersects(e,t));cd.exports=ry});var fd=P((PS,dd)=>{"use strict";var ny=mn(),iy=Je();dd.exports=(r,e,t)=>{let n=[],i=null,s=null,a=r.sort((l,d)=>iy(l,d,t));for(let l of a)ny(l,e,t)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let o=[];for(let[l,d]of n)l===d?o.push(l):!d&&l===a[0]?o.push("*"):d?l===a[0]?o.push(`<=${d}`):o.push(`${l} - ${d}`):o.push(`>=${l}`);let u=o.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var yd=P((RS,_d)=>{"use strict";var pd=Ke(),Za=pn(),{ANY:Fa}=Za,gn=mn(),Ba=Je(),sy=(r,e,t={})=>{if(r===e)return!0;r=new pd(r,t),e=new pd(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let a=oy(i,s,t);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},ay=[new Za(">=0.0.0-0")],hd=[new Za(">=0.0.0")],oy=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Fa){if(e.length===1&&e[0].semver===Fa)return!0;t.includePrerelease?r=ay:r=hd}if(e.length===1&&e[0].semver===Fa){if(t.includePrerelease)return!0;e=hd}let n=new Set,i,s;for(let p of r)p.operator===">"||p.operator===">="?i=md(i,p,t):p.operator==="<"||p.operator==="<="?s=gd(s,p,t):n.add(p.semver);if(n.size>1)return null;let a;if(i&&s){if(a=Ba(i.semver,s.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let p of n){if(i&&!gn(p,String(i),t)||s&&!gn(p,String(s),t))return null;for(let h of e)if(!gn(p,String(h),t))return!1;return!0}let o,u,c,l,d=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",c=c||p.operator==="<"||p.operator==="<=",i){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator===">"||p.operator===">="){if(o=md(i,p,t),o===p&&o!==i)return!1}else if(i.operator===">="&&!gn(i.semver,String(p),t))return!1}if(s){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator==="<"||p.operator==="<="){if(u=gd(s,p,t),u===p&&u!==s)return!1}else if(s.operator==="<="&&!gn(s.semver,String(p),t))return!1}if(!p.operator&&(s||i)&&a!==0)return!1}return!(i&&c&&!s&&a!==0||s&&l&&!i&&a!==0||f||d)},md=(r,e,t)=>{if(!r)return e;let n=Ba(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},gd=(r,e,t)=>{if(!r)return e;let n=Ba(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};_d.exports=sy});var xd=P((NS,vd)=>{"use strict";var Ga=jr(),bd=ln(),uy=we(),wd=Ia(),cy=pr(),ly=Vc(),dy=Jc(),fy=Yc(),py=el(),hy=rl(),my=il(),gy=al(),_y=ul(),yy=Je(),by=fl(),wy=hl(),vy=Ri(),xy=yl(),Ey=wl(),Sy=fn(),Ty=Ni(),Oy=Pa(),$y=Ra(),Iy=Ci(),Ay=ji(),ky=Na(),Py=Al(),Ry=pn(),Ny=Ke(),Cy=mn(),jy=Gl(),Ly=Vl(),zy=Jl(),My=Yl(),Dy=Ql(),Uy=Mi(),Fy=sd(),Zy=od(),By=ld(),Gy=fd(),qy=yd();vd.exports={parse:cy,valid:ly,clean:dy,inc:fy,diff:py,major:hy,minor:my,patch:gy,prerelease:_y,compare:yy,rcompare:by,compareLoose:wy,compareBuild:vy,sort:xy,rsort:Ey,gt:Sy,lt:Ty,eq:Oy,neq:$y,gte:Iy,lte:Ay,cmp:ky,coerce:Py,Comparator:Ry,Range:Ny,satisfies:Cy,toComparators:jy,maxSatisfying:Ly,minSatisfying:zy,minVersion:My,validRange:Dy,outside:Uy,gtr:Fy,ltr:Zy,intersects:By,simplifyRange:Gy,subset:qy,SemVer:uy,re:Ga.re,src:Ga.src,tokens:Ga.t,SEMVER_SPEC_VERSION:bd.SEMVER_SPEC_VERSION,RELEASE_TYPES:bd.RELEASE_TYPES,compareIdentifiers:wd.compareIdentifiers,rcompareIdentifiers:wd.rcompareIdentifiers}});var Bd=P((gT,Zd)=>{"use strict";var Ud=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Fd=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`;function yb(){let r=new Map,e={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]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,n]of Object.entries(e)){for(let[i,s]of Object.entries(n))e[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[i]=e[i],r.set(s[0],s[1]);Object.defineProperty(e,t,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi256=Ud(),e.color.ansi16m=Fd(),e.bgColor.ansi256=Ud(10),e.bgColor.ansi16m=Fd(10),Object.defineProperties(e,{rgbToAnsi256:{value:(t,n,i)=>t===n&&n===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!n)return[0,0,0];let{colorString:i}=n.groups;i.length===3&&(i=i.split("").map(a=>a+a).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1}}),e}Object.defineProperty(Zd,"exports",{enumerable:!0,get:yb})});var qp={};le(qp,{BasePromptValue:()=>Sr,ChatPromptValue:()=>Fs,ImagePromptValue:()=>Zs,StringPromptValue:()=>Qr});var Dp={};le(Dp,{Serializable:()=>Ze,get_lc_unique_name:()=>Mn});var nu=ot(Ko(),1),iu=ot(ru(),1);function su(r,e){return e?.[r]||(0,nu.default)(r)}function kv(r,e){return e?.[r]||(0,iu.default)(r)}function au(r,e,t){let n={};for(let i in r)Object.hasOwn(r,i)&&(n[e(i,t)]=r[i]);return n}var zn="__lc_escaped__";function Cp(r){return"lc"in r||Object.keys(r).length===1&&zn in r}function jp(r){return{[zn]:r}}function Lp(r){return Object.keys(r).length===1&&zn in r}function zp(r){return r!==null&&typeof r=="object"&&"lc_serializable"in r&&typeof r.toJSON=="function"}function Ln(r){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){if(zp(r))return r;let e=r;if(Cp(e))return jp(e);let t={};for(let[n,i]of Object.entries(e))t[n]=Ln(i);return t}return Array.isArray(r)?r.map(e=>Ln(e)):r}function ou(r){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let e=r;if(Lp(e))return e[zn];let t={};for(let[n,i]of Object.entries(e))t[n]=ou(i);return t}return Array.isArray(r)?r.map(e=>ou(e)):r}function uu(r){return Array.isArray(r)?[...r]:{...r}}function Mp(r,e){let t=uu(r);for(let[n,i]of Object.entries(e)){let[s,...a]=n.split(".").reverse(),o=t;for(let u of a.reverse()){if(o[u]===void 0)break;o[u]=uu(o[u]),o=o[u]}o[s]!==void 0&&(o[s]={lc:1,type:"secret",id:[i]})}return t}function Mn(r){let e=Object.getPrototypeOf(r);return typeof r.lc_name=="function"&&(typeof e.lc_name!="function"||r.lc_name()!==e.lc_name())?r.lc_name():r.name}var Ze=class r{static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,Mn(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(e,...t){Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"lc_kwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(e||{}).filter(([n])=>this.lc_serializable_keys?.includes(n))):this.lc_kwargs=e??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof r||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let e={},t={},n=Object.keys(this.lc_kwargs).reduce((o,u)=>(o[u]=u in this?this[u]:this.lc_kwargs[u],o),{});for(let o=Object.getPrototypeOf(this);o;o=Object.getPrototypeOf(o))Object.assign(e,Reflect.get(o,"lc_aliases",this)),Object.assign(t,Reflect.get(o,"lc_secrets",this)),Object.assign(n,Reflect.get(o,"lc_attributes",this));Object.keys(t).forEach(o=>{let u=this,c=n,[l,...d]=o.split(".").reverse();for(let f of d.reverse()){if(!(f in u)||u[f]===void 0)return;(!(f in c)||c[f]===void 0)&&(typeof u[f]=="object"&&u[f]!=null?c[f]={}:Array.isArray(u[f])&&(c[f]=[])),u=u[f],c=c[f]}l in u&&u[l]!==void 0&&(c[l]=c[l]||u[l])});let i={};for(let[o,u]of Object.entries(n))i[o]=Ln(u);let s=Object.keys(t).length?Mp(i,t):i,a=au(s,su,e);return{lc:1,type:"constructor",id:this.lc_id,kwargs:a}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}};function kt(r){return typeof r=="object"&&r!==null&&"type"in r&&typeof r.type=="string"&&"source_type"in r&&(r.source_type==="url"||r.source_type==="base64"||r.source_type==="text"||r.source_type==="id")}function jv(r){return kt(r)&&r.source_type==="url"&&"url"in r&&typeof r.url=="string"}function Lv(r){return kt(r)&&r.source_type==="base64"&&"data"in r&&typeof r.data=="string"}function zv(r){return kt(r)&&r.source_type==="text"&&"text"in r&&typeof r.text=="string"}function Mv(r){return kt(r)&&r.source_type==="id"&&"id"in r&&typeof r.id=="string"}function Dv(r){if(kt(r)){if(r.source_type==="url")return{type:"image_url",image_url:{url:r.url}};if(r.source_type==="base64"){if(!r.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${r.mime_type};base64,${r.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function Uv(r){let e=r.split(";")[0].split("/");if(e.length!==2)throw new Error(`Invalid mime type: "${r}" - does not match type/subtype format.`);let t=e[0].trim(),n=e[1].trim();if(t===""||n==="")throw new Error(`Invalid mime type: "${r}" - type or subtype is empty.`);let i={};for(let s of r.split(";").slice(1)){let a=s.split("=");if(a.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${r}".`);let o=a[0].trim(),u=a[1].trim();if(o==="")throw new Error(`Invalid parameter syntax in mime type: "${r}".`);i[o]=u}return{type:t,subtype:n,parameters:i}}function Fv({dataUrl:r,asTypedArray:e=!1}){let t=r.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/),n;if(t){n=t[1].toLowerCase();let i=e?Uint8Array.from(atob(t[2]),s=>s.charCodeAt(0)):t[2];return{mime_type:n,data:i}}}function Zv(r,e){if(r.type==="text"){if(!e.fromStandardTextBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardTextBlock\` method.`);return e.fromStandardTextBlock(r)}if(r.type==="image"){if(!e.fromStandardImageBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardImageBlock\` method.`);return e.fromStandardImageBlock(r)}if(r.type==="audio"){if(!e.fromStandardAudioBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardAudioBlock\` method.`);return e.fromStandardAudioBlock(r)}if(r.type==="file"){if(!e.fromStandardFileBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardFileBlock\` method.`);return e.fromStandardFileBlock(r)}throw new Error(`Unable to convert content block type '${r.type}' to provider-specific format: not recognized.`)}function Be(r,e){return typeof r=="string"?r===""?e:typeof e=="string"?r+e:Array.isArray(e)&&e.some(t=>kt(t))?[{type:"text",source_type:"text",text:r},...e]:[{type:"text",text:r},...e]:Array.isArray(e)?Wr(r,e)??[...r,...e]:e===""?r:Array.isArray(r)&&r.some(t=>kt(t))?[...r,{type:"file",source_type:"text",text:e}]:[...r,{type:"text",text:e}]}function cu(r,e){return r==="error"||e==="error"?"error":"success"}function Up(r,e){function t(n,i){if(typeof n!="object"||n===null||n===void 0)return n;if(i>=e)return Array.isArray(n)?"[Array]":"[Object]";if(Array.isArray(n))return n.map(a=>t(a,i+1));let s={};for(let a of Object.keys(n))s[a]=t(n[a],i+1);return s}return JSON.stringify(t(r,0),null,2)}var de=class extends Ze{get lc_aliases(){return{additional_kwargs:"additional_kwargs",response_metadata:"response_metadata"}}get text(){return typeof this.content=="string"?this.content:Array.isArray(this.content)?this.content.map(e=>typeof e=="string"?e:e.type==="text"?e.text:"").join(""):""}getType(){return this._getType()}constructor(e,t){typeof e=="string"&&(e={content:e,additional_kwargs:t,response_metadata:{}}),e.additional_kwargs||(e.additional_kwargs={}),e.response_metadata||(e.response_metadata={}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","messages"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"additional_kwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response_metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.content=e.content,this.additional_kwargs=e.additional_kwargs,this.response_metadata=e.response_metadata,this.id=e.id}toDict(){return{type:this._getType(),data:this.toJSON().kwargs}}static lc_name(){return"BaseMessage"}get _printableFields(){return{id:this.id,content:this.content,name:this.name,additional_kwargs:this.additional_kwargs,response_metadata:this.response_metadata}}_updateId(e){this.id=e,this.lc_kwargs.id=e}get[Symbol.toStringTag](){return this.constructor.lc_name()}[Symbol.for("nodejs.util.inspect.custom")](e){if(e===null)return this;let t=Up(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${t}`}};function Vv(r){return Array.isArray(r)&&r.every(e=>typeof e.index=="number")}function re(r,e){let t={...r};for(let[n,i]of Object.entries(e))if(t[n]==null)t[n]=i;else{if(i==null)continue;if(typeof t[n]!=typeof i||Array.isArray(t[n])!==Array.isArray(i))throw new Error(`field[${n}] already exists in the message chunk, but with a different type.`);if(typeof t[n]=="string"){if(n==="type")continue;["id","name","output_version","model_provider"].includes(n)?t[n]=i:t[n]+=i}else if(typeof t[n]=="object"&&!Array.isArray(t[n]))t[n]=re(t[n],i);else if(Array.isArray(t[n]))t[n]=Wr(t[n],i);else{if(t[n]===i)continue;console.warn(`field[${n}] already exists in this message chunk and value has unsupported type.`)}}return t}function Wr(r,e){if(!(r===void 0&&e===void 0)){if(r===void 0||e===void 0)return r||e;{let t=[...r];for(let n of e)if(typeof n=="object"&&n!==null&&"index"in n&&typeof n.index=="number"){let i=t.findIndex(s=>{let a=typeof s=="object",o="index"in s&&s.index===n.index,u="id"in s&&"id"in n&&s?.id===n?.id,c=!("id"in s)||!s?.id||!("id"in n)||!n?.id;return a&&o&&(u||c)});i!==-1&&typeof t[i]=="object"&&t[i]!==null?t[i]=re(t[i],n):t.push(n)}else{if(typeof n=="object"&&n!==null&&"text"in n&&n.text==="")continue;t.push(n)}return t}}}function lu(r,e){if(!r&&!e)throw new Error("Cannot merge two undefined objects.");if(!r||!e)return r||e;if(typeof r!=typeof e)throw new Error(`Cannot merge objects of different types.
|
|
3
|
+
v5.0.0-next.135 */
|
|
4
|
+
import{a as P,b as le,c as ot}from"./YQVK2H7R.js";var Ko=P((Iv,Jo)=>{"use strict";Jo.exports=function(r,e){if(typeof r!="string")throw new TypeError("Expected a string");return e=typeof e>"u"?"_":e,r.replace(/([a-z\d])([A-Z])/g,"$1"+e+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+e+"$2").toLowerCase()}});var ru=P((Av,zs)=>{"use strict";var Ip=/[\p{Lu}]/u,Ap=/[\p{Ll}]/u,Wo=/^[\p{Lu}](?![\p{Lu}])/gu,Qo=/([\p{Alpha}\p{N}_]|$)/u,eu=/[_.\- ]+/,kp=new RegExp("^"+eu.source),Yo=new RegExp(eu.source+Qo.source,"gu"),Xo=new RegExp("\\d+"+Qo.source,"gu"),Pp=(r,e,t)=>{let n=!1,i=!1,s=!1;for(let a=0;a<r.length;a++){let o=r[a];n&&Ip.test(o)?(r=r.slice(0,a)+"-"+r.slice(a),n=!1,s=i,i=!0,a++):i&&s&&Ap.test(o)?(r=r.slice(0,a-1)+"-"+r.slice(a-1),s=i,i=!1,n=!0):(n=e(o)===o&&t(o)!==o,s=i,i=t(o)===o&&e(o)!==o)}return r},Rp=(r,e)=>(Wo.lastIndex=0,r.replace(Wo,t=>e(t))),Np=(r,e)=>(Yo.lastIndex=0,Xo.lastIndex=0,r.replace(Yo,(t,n)=>e(n)).replace(Xo,t=>e(t))),tu=(r,e)=>{if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(s=>s.trim()).filter(s=>s.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?s=>s.toLowerCase():s=>s.toLocaleLowerCase(e.locale),n=e.locale===!1?s=>s.toUpperCase():s=>s.toLocaleUpperCase(e.locale);return r.length===1?e.pascalCase?n(r):t(r):(r!==t(r)&&(r=Pp(r,t,n)),r=r.replace(kp,""),e.preserveConsecutiveUppercase?r=Rp(r,t):r=t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),Np(r,n))};zs.exports=tu;zs.exports.default=tu});var Ou=P((bE,Tu)=>{function He(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.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))}Tu.exports=He;He.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};He.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};He.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},t),this._options.unref&&this._timer.unref(),!0};He.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};He.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};He.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};He.prototype.start=He.prototype.try;He.prototype.errors=function(){return this._errors};He.prototype.attempts=function(){return this._attempts};He.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,a=(r[s]||0)+1;r[s]=a,a>=t&&(e=i,t=a)}return e}});var $u=P(ur=>{var rm=Ou();ur.operation=function(r){var e=ur.timeouts(r);return new rm(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};ur.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return r&&r.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,a){return s-a}),n};ur.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,n=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return n=Math.min(n,e.maxTimeout),n};ur.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var n in r)typeof r[n]=="function"&&t.push(n)}for(var i=0;i<t.length;i++){var s=t[i],a=r[s];r[s]=function(u){var c=ur.operation(e),l=Array.prototype.slice.call(arguments,1),d=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){u.apply(r,l)})}.bind(r,a),r[s].options=e}}});var Au=P((vE,Iu)=>{Iu.exports=$u()});var ri=P((xE,ti)=>{"use strict";var nm=Au(),im=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],ei=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},sm=(r,e,t)=>{let n=t.retries-(e-1);return r.attemptNumber=e,r.retriesLeft=n,r},am=r=>im.includes(r),ku=(r,e)=>new Promise((t,n)=>{e={onFailedAttempt:()=>{},retries:10,...e};let i=nm.operation(e);i.attempt(async s=>{try{t(await r(s))}catch(a){if(!(a instanceof Error)){n(new TypeError(`Non-error was thrown: "${a}". You should only throw errors.`));return}if(a instanceof ei)i.stop(),n(a.originalError);else if(a instanceof TypeError&&!am(a.message))i.stop(),n(a);else{sm(a,s,e);try{await e.onFailedAttempt(a)}catch(o){n(o);return}i.retry(a)||n(i.mainError())}}})});ti.exports=ku;ti.exports.default=ku;ti.exports.AbortError=ei});var Sc=P((C0,ya)=>{"use strict";var Fm=Object.prototype.hasOwnProperty,xe="~";function on(){}Object.create&&(on.prototype=Object.create(null),new on().__proto__||(xe=!1));function Zm(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function Ec(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new Zm(t,n||r,i),a=xe?xe+e:e;return r._events[a]?r._events[a].fn?r._events[a]=[r._events[a],s]:r._events[a].push(s):(r._events[a]=s,r._eventsCount++),r}function vi(r,e){--r._eventsCount===0?r._events=new on:delete r._events[e]}function be(){this._events=new on,this._eventsCount=0}be.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)Fm.call(t,n)&&e.push(xe?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};be.prototype.listeners=function(e){var t=xe?xe+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=new Array(s);i<s;i++)a[i]=n[i].fn;return a};be.prototype.listenerCount=function(e){var t=xe?xe+e:e,n=this._events[t];return n?n.fn?1:n.length:0};be.prototype.emit=function(e,t,n,i,s,a){var o=xe?xe+e:e;if(!this._events[o])return!1;var u=this._events[o],c=arguments.length,l,d;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,i),!0;case 5:return u.fn.call(u.context,t,n,i,s),!0;case 6:return u.fn.call(u.context,t,n,i,s,a),!0}for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u.fn.apply(u.context,l)}else{var f=u.length,p;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(e,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,t);break;case 3:u[d].fn.call(u[d].context,t,n);break;case 4:u[d].fn.call(u[d].context,t,n,i);break;default:if(!l)for(p=1,l=new Array(c-1);p<c;p++)l[p-1]=arguments[p];u[d].fn.apply(u[d].context,l)}}return!0};be.prototype.on=function(e,t,n){return Ec(this,e,t,n,!1)};be.prototype.once=function(e,t,n){return Ec(this,e,t,n,!0)};be.prototype.removeListener=function(e,t,n,i){var s=xe?xe+e:e;if(!this._events[s])return this;if(!t)return vi(this,s),this;var a=this._events[s];if(a.fn)a.fn===t&&(!i||a.once)&&(!n||a.context===n)&&vi(this,s);else{for(var o=0,u=[],c=a.length;o<c;o++)(a[o].fn!==t||i&&!a[o].once||n&&a[o].context!==n)&&u.push(a[o]);u.length?this._events[s]=u.length===1?u[0]:u:vi(this,s)}return this};be.prototype.removeAllListeners=function(e){var t;return e?(t=xe?xe+e:e,this._events[t]&&vi(this,t)):(this._events=new on,this._eventsCount=0),this};be.prototype.off=be.prototype.removeListener;be.prototype.addListener=be.prototype.on;be.prefixed=xe;be.EventEmitter=be;typeof ya<"u"&&(ya.exports=be)});var Oc=P((j0,Tc)=>{"use strict";Tc.exports=(r,e)=>(e=e||(()=>{}),r.then(t=>new Promise(n=>{n(e())}).then(()=>t),t=>new Promise(n=>{n(e())}).then(()=>{throw t})))});var Ic=P((L0,Ei)=>{"use strict";var Bm=Oc(),xi=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},$c=(r,e,t)=>new Promise((n,i)=>{if(typeof e!="number"||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0){n(r);return}let s=setTimeout(()=>{if(typeof t=="function"){try{n(t())}catch(u){i(u)}return}let a=typeof t=="string"?t:`Promise timed out after ${e} milliseconds`,o=t instanceof Error?t:new xi(a);typeof r.cancel=="function"&&r.cancel(),i(o)},e);Bm(r.then(n,i),()=>{clearTimeout(s)})});Ei.exports=$c;Ei.exports.default=$c;Ei.exports.TimeoutError=xi});var Ac=P(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});function Gm(r,e,t){let n=0,i=r.length;for(;i>0;){let s=i/2|0,a=n+s;t(r[a],e)<=0?(n=++a,i-=s+1):i=s}return n}ba.default=Gm});var kc=P(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var qm=Ac(),wa=class{constructor(){this._queue=[]}enqueue(e,t){t=Object.assign({priority:0},t);let n={priority:t.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority){this._queue.push(n);return}let i=qm.default(this._queue,n,(s,a)=>a.priority-s.priority);this._queue.splice(i,0,n)}dequeue(){let e=this._queue.shift();return e?.run}filter(e){return this._queue.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this._queue.length}};va.default=wa});var Ti=P(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var Vm=Sc(),Pc=Ic(),Hm=kc(),Si=()=>{},Jm=new Pc.TimeoutError,xa=class extends Vm{constructor(e){var t,n,i,s;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=Si,this._resolveIdle=Si,e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Hm.default},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(i=e.interval)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||e.interval===0,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=e.throwOnTimeout===!0,this._isPaused=e.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(){this._resolveEmpty(),this._resolveEmpty=Si,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=Si,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let e=Date.now();if(this._intervalId===void 0){let t=this._intervalEnd-e;if(t<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},t)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let t=this._queue.dequeue();return t?(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){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(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise((n,i)=>{let s=async()=>{this._pendingCount++,this._intervalCount++;try{let a=this._timeout===void 0&&t.timeout===void 0?e():Pc.default(Promise.resolve(e()),t.timeout===void 0?this._timeout:t.timeout,()=>{(t.throwOnTimeout===void 0?this._throwOnTimeout:t.throwOnTimeout)&&i(Jm)});n(await a)}catch(a){i(a)}this._next()};this._queue.enqueue(s,t),this._tryToStartAnother(),this.emit("add")})}async addAll(e,t){return Promise.all(e.map(async n=>this.add(n,t)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(e=>{let t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(e=>{let t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}};Ea.default=xa});var ln=P((G0,Cc)=>{"use strict";var Ym="2.0.0",Xm=Number.MAX_SAFE_INTEGER||9007199254740991,Qm=16,eg=250,tg=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Cc.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Qm,MAX_SAFE_BUILD_LENGTH:eg,MAX_SAFE_INTEGER:Xm,RELEASE_TYPES:tg,SEMVER_SPEC_VERSION:Ym,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var dn=P((q0,jc)=>{"use strict";var rg=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};jc.exports=rg});var jr=P((pt,Lc)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Oa,MAX_SAFE_BUILD_LENGTH:ng,MAX_LENGTH:ig}=ln(),sg=dn();pt=Lc.exports={};var ag=pt.re=[],og=pt.safeRe=[],T=pt.src=[],ug=pt.safeSrc=[],O=pt.t={},cg=0,$a="[a-zA-Z0-9-]",lg=[["\\s",1],["\\d",ig],[$a,ng]],dg=r=>{for(let[e,t]of lg)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},Z=(r,e,t)=>{let n=dg(e),i=cg++;sg(r,i,e),O[r]=i,T[i]=e,ug[i]=n,ag[i]=new RegExp(e,t?"g":void 0),og[i]=new RegExp(n,t?"g":void 0)};Z("NUMERICIDENTIFIER","0|[1-9]\\d*");Z("NUMERICIDENTIFIERLOOSE","\\d+");Z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${$a}*`);Z("MAINVERSION",`(${T[O.NUMERICIDENTIFIER]})\\.(${T[O.NUMERICIDENTIFIER]})\\.(${T[O.NUMERICIDENTIFIER]})`);Z("MAINVERSIONLOOSE",`(${T[O.NUMERICIDENTIFIERLOOSE]})\\.(${T[O.NUMERICIDENTIFIERLOOSE]})\\.(${T[O.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASEIDENTIFIER",`(?:${T[O.NONNUMERICIDENTIFIER]}|${T[O.NUMERICIDENTIFIER]})`);Z("PRERELEASEIDENTIFIERLOOSE",`(?:${T[O.NONNUMERICIDENTIFIER]}|${T[O.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASE",`(?:-(${T[O.PRERELEASEIDENTIFIER]}(?:\\.${T[O.PRERELEASEIDENTIFIER]})*))`);Z("PRERELEASELOOSE",`(?:-?(${T[O.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${T[O.PRERELEASEIDENTIFIERLOOSE]})*))`);Z("BUILDIDENTIFIER",`${$a}+`);Z("BUILD",`(?:\\+(${T[O.BUILDIDENTIFIER]}(?:\\.${T[O.BUILDIDENTIFIER]})*))`);Z("FULLPLAIN",`v?${T[O.MAINVERSION]}${T[O.PRERELEASE]}?${T[O.BUILD]}?`);Z("FULL",`^${T[O.FULLPLAIN]}$`);Z("LOOSEPLAIN",`[v=\\s]*${T[O.MAINVERSIONLOOSE]}${T[O.PRERELEASELOOSE]}?${T[O.BUILD]}?`);Z("LOOSE",`^${T[O.LOOSEPLAIN]}$`);Z("GTLT","((?:<|>)?=?)");Z("XRANGEIDENTIFIERLOOSE",`${T[O.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Z("XRANGEIDENTIFIER",`${T[O.NUMERICIDENTIFIER]}|x|X|\\*`);Z("XRANGEPLAIN",`[v=\\s]*(${T[O.XRANGEIDENTIFIER]})(?:\\.(${T[O.XRANGEIDENTIFIER]})(?:\\.(${T[O.XRANGEIDENTIFIER]})(?:${T[O.PRERELEASE]})?${T[O.BUILD]}?)?)?`);Z("XRANGEPLAINLOOSE",`[v=\\s]*(${T[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[O.XRANGEIDENTIFIERLOOSE]})(?:${T[O.PRERELEASELOOSE]})?${T[O.BUILD]}?)?)?`);Z("XRANGE",`^${T[O.GTLT]}\\s*${T[O.XRANGEPLAIN]}$`);Z("XRANGELOOSE",`^${T[O.GTLT]}\\s*${T[O.XRANGEPLAINLOOSE]}$`);Z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Oa}})(?:\\.(\\d{1,${Oa}}))?(?:\\.(\\d{1,${Oa}}))?`);Z("COERCE",`${T[O.COERCEPLAIN]}(?:$|[^\\d])`);Z("COERCEFULL",T[O.COERCEPLAIN]+`(?:${T[O.PRERELEASE]})?(?:${T[O.BUILD]})?(?:$|[^\\d])`);Z("COERCERTL",T[O.COERCE],!0);Z("COERCERTLFULL",T[O.COERCEFULL],!0);Z("LONETILDE","(?:~>?)");Z("TILDETRIM",`(\\s*)${T[O.LONETILDE]}\\s+`,!0);pt.tildeTrimReplace="$1~";Z("TILDE",`^${T[O.LONETILDE]}${T[O.XRANGEPLAIN]}$`);Z("TILDELOOSE",`^${T[O.LONETILDE]}${T[O.XRANGEPLAINLOOSE]}$`);Z("LONECARET","(?:\\^)");Z("CARETTRIM",`(\\s*)${T[O.LONECARET]}\\s+`,!0);pt.caretTrimReplace="$1^";Z("CARET",`^${T[O.LONECARET]}${T[O.XRANGEPLAIN]}$`);Z("CARETLOOSE",`^${T[O.LONECARET]}${T[O.XRANGEPLAINLOOSE]}$`);Z("COMPARATORLOOSE",`^${T[O.GTLT]}\\s*(${T[O.LOOSEPLAIN]})$|^$`);Z("COMPARATOR",`^${T[O.GTLT]}\\s*(${T[O.FULLPLAIN]})$|^$`);Z("COMPARATORTRIM",`(\\s*)${T[O.GTLT]}\\s*(${T[O.LOOSEPLAIN]}|${T[O.XRANGEPLAIN]})`,!0);pt.comparatorTrimReplace="$1$2$3";Z("HYPHENRANGE",`^\\s*(${T[O.XRANGEPLAIN]})\\s+-\\s+(${T[O.XRANGEPLAIN]})\\s*$`);Z("HYPHENRANGELOOSE",`^\\s*(${T[O.XRANGEPLAINLOOSE]})\\s+-\\s+(${T[O.XRANGEPLAINLOOSE]})\\s*$`);Z("STAR","(<|>)?=?\\s*\\*");Z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var $i=P((V0,zc)=>{"use strict";var fg=Object.freeze({loose:!0}),pg=Object.freeze({}),hg=r=>r?typeof r!="object"?fg:r:pg;zc.exports=hg});var Ia=P((H0,Uc)=>{"use strict";var Mc=/^[0-9]+$/,Dc=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=Mc.test(r),n=Mc.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},mg=(r,e)=>Dc(e,r);Uc.exports={compareIdentifiers:Dc,rcompareIdentifiers:mg}});var we=P((J0,Zc)=>{"use strict";var Ii=dn(),{MAX_LENGTH:Fc,MAX_SAFE_INTEGER:Ai}=ln(),{safeRe:ki,t:Pi}=jr(),gg=$i(),{compareIdentifiers:Aa}=Ia(),ka=class r{constructor(e,t){if(t=gg(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Fc)throw new TypeError(`version is longer than ${Fc} characters`);Ii("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?ki[Pi.LOOSE]:ki[Pi.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ai||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ai||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ai||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<Ai)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ii("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(Ii("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Aa(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(Ii("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Aa(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?ki[Pi.PRERELEASELOOSE]:ki[Pi.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];n===!1&&(s=[t]),Aa(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Zc.exports=ka});var pr=P((K0,Gc)=>{"use strict";var Bc=we(),_g=(r,e,t=!1)=>{if(r instanceof Bc)return r;try{return new Bc(r,e)}catch(n){if(!t)return null;throw n}};Gc.exports=_g});var Vc=P((W0,qc)=>{"use strict";var yg=pr(),bg=(r,e)=>{let t=yg(r,e);return t?t.version:null};qc.exports=bg});var Jc=P((Y0,Hc)=>{"use strict";var wg=pr(),vg=(r,e)=>{let t=wg(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Hc.exports=vg});var Yc=P((X0,Wc)=>{"use strict";var Kc=we(),xg=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Kc(r instanceof Kc?r.version:r,t).inc(e,n,i).version}catch{return null}};Wc.exports=xg});var el=P((Q0,Qc)=>{"use strict";var Xc=pr(),Eg=(r,e)=>{let t=Xc(r,null,!0),n=Xc(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,a=s?t:n,o=s?n:t,u=!!a.prerelease.length;if(!!o.prerelease.length&&!u){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let l=u?"pre":"";return t.major!==n.major?l+"major":t.minor!==n.minor?l+"minor":t.patch!==n.patch?l+"patch":"prerelease"};Qc.exports=Eg});var rl=P((eS,tl)=>{"use strict";var Sg=we(),Tg=(r,e)=>new Sg(r,e).major;tl.exports=Tg});var il=P((tS,nl)=>{"use strict";var Og=we(),$g=(r,e)=>new Og(r,e).minor;nl.exports=$g});var al=P((rS,sl)=>{"use strict";var Ig=we(),Ag=(r,e)=>new Ig(r,e).patch;sl.exports=Ag});var ul=P((nS,ol)=>{"use strict";var kg=pr(),Pg=(r,e)=>{let t=kg(r,e);return t&&t.prerelease.length?t.prerelease:null};ol.exports=Pg});var Je=P((iS,ll)=>{"use strict";var cl=we(),Rg=(r,e,t)=>new cl(r,t).compare(new cl(e,t));ll.exports=Rg});var fl=P((sS,dl)=>{"use strict";var Ng=Je(),Cg=(r,e,t)=>Ng(e,r,t);dl.exports=Cg});var hl=P((aS,pl)=>{"use strict";var jg=Je(),Lg=(r,e)=>jg(r,e,!0);pl.exports=Lg});var Ri=P((oS,gl)=>{"use strict";var ml=we(),zg=(r,e,t)=>{let n=new ml(r,t),i=new ml(e,t);return n.compare(i)||n.compareBuild(i)};gl.exports=zg});var yl=P((uS,_l)=>{"use strict";var Mg=Ri(),Dg=(r,e)=>r.sort((t,n)=>Mg(t,n,e));_l.exports=Dg});var wl=P((cS,bl)=>{"use strict";var Ug=Ri(),Fg=(r,e)=>r.sort((t,n)=>Ug(n,t,e));bl.exports=Fg});var fn=P((lS,vl)=>{"use strict";var Zg=Je(),Bg=(r,e,t)=>Zg(r,e,t)>0;vl.exports=Bg});var Ni=P((dS,xl)=>{"use strict";var Gg=Je(),qg=(r,e,t)=>Gg(r,e,t)<0;xl.exports=qg});var Pa=P((fS,El)=>{"use strict";var Vg=Je(),Hg=(r,e,t)=>Vg(r,e,t)===0;El.exports=Hg});var Ra=P((pS,Sl)=>{"use strict";var Jg=Je(),Kg=(r,e,t)=>Jg(r,e,t)!==0;Sl.exports=Kg});var Ci=P((hS,Tl)=>{"use strict";var Wg=Je(),Yg=(r,e,t)=>Wg(r,e,t)>=0;Tl.exports=Yg});var ji=P((mS,Ol)=>{"use strict";var Xg=Je(),Qg=(r,e,t)=>Xg(r,e,t)<=0;Ol.exports=Qg});var Na=P((gS,$l)=>{"use strict";var e_=Pa(),t_=Ra(),r_=fn(),n_=Ci(),i_=Ni(),s_=ji(),a_=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return e_(r,t,n);case"!=":return t_(r,t,n);case">":return r_(r,t,n);case">=":return n_(r,t,n);case"<":return i_(r,t,n);case"<=":return s_(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};$l.exports=a_});var Al=P((_S,Il)=>{"use strict";var o_=we(),u_=pr(),{safeRe:Li,t:zi}=jr(),c_=(r,e)=>{if(r instanceof o_)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?Li[zi.COERCEFULL]:Li[zi.COERCE]);else{let u=e.includePrerelease?Li[zi.COERCERTLFULL]:Li[zi.COERCERTL],c;for(;(c=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",o=e.includePrerelease&&t[6]?`+${t[6]}`:"";return u_(`${n}.${i}.${s}${a}${o}`,e)};Il.exports=c_});var Pl=P((yS,kl)=>{"use strict";var Ca=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};kl.exports=Ca});var Ke=P((bS,jl)=>{"use strict";var l_=/\s+/g,ja=class r{constructor(e,t){if(t=f_(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof La)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(l_," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!Nl(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&b_(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&__)|(this.options.loose&&y_))+":"+e,i=Rl.get(n);if(i)return i;let s=this.options.loose,a=s?Ee[ve.HYPHENRANGELOOSE]:Ee[ve.HYPHENRANGE];e=e.replace(a,A_(this.options.includePrerelease)),Y("hyphen replace",e),e=e.replace(Ee[ve.COMPARATORTRIM],h_),Y("comparator trim",e),e=e.replace(Ee[ve.TILDETRIM],m_),Y("tilde trim",e),e=e.replace(Ee[ve.CARETTRIM],g_),Y("caret trim",e);let o=e.split(" ").map(d=>w_(d,this.options)).join(" ").split(/\s+/).map(d=>I_(d,this.options));s&&(o=o.filter(d=>(Y("loose invalid filter",d,this.options),!!d.match(Ee[ve.COMPARATORLOOSE])))),Y("range list",o);let u=new Map,c=o.map(d=>new La(d,this.options));for(let d of c){if(Nl(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return Rl.set(n,l),l}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>Cl(n,t)&&e.set.some(i=>Cl(i,t)&&n.every(s=>i.every(a=>s.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new p_(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(k_(this.set[t],e,this.options))return!0;return!1}};jl.exports=ja;var d_=Pl(),Rl=new d_,f_=$i(),La=pn(),Y=dn(),p_=we(),{safeRe:Ee,t:ve,comparatorTrimReplace:h_,tildeTrimReplace:m_,caretTrimReplace:g_}=jr(),{FLAG_INCLUDE_PRERELEASE:__,FLAG_LOOSE:y_}=ln(),Nl=r=>r.value==="<0.0.0-0",b_=r=>r.value==="",Cl=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},w_=(r,e)=>(r=r.replace(Ee[ve.BUILD],""),Y("comp",r,e),r=E_(r,e),Y("caret",r),r=v_(r,e),Y("tildes",r),r=T_(r,e),Y("xrange",r),r=$_(r,e),Y("stars",r),r),Se=r=>!r||r.toLowerCase()==="x"||r==="*",v_=(r,e)=>r.trim().split(/\s+/).map(t=>x_(t,e)).join(" "),x_=(r,e)=>{let t=e.loose?Ee[ve.TILDELOOSE]:Ee[ve.TILDE];return r.replace(t,(n,i,s,a,o)=>{Y("tilde",r,n,i,s,a,o);let u;return Se(i)?u="":Se(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:Se(a)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:o?(Y("replaceTilde pr",o),u=`>=${i}.${s}.${a}-${o} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`,Y("tilde return",u),u})},E_=(r,e)=>r.trim().split(/\s+/).map(t=>S_(t,e)).join(" "),S_=(r,e)=>{Y("caret",r,e);let t=e.loose?Ee[ve.CARETLOOSE]:Ee[ve.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,a,o,u)=>{Y("caret",r,i,s,a,o,u);let c;return Se(s)?c="":Se(a)?c=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Se(o)?s==="0"?c=`>=${s}.${a}.0${n} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.0${n} <${+s+1}.0.0-0`:u?(Y("replaceCaret pr",u),s==="0"?a==="0"?c=`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(Y("no pr"),s==="0"?a==="0"?c=`>=${s}.${a}.${o}${n} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}${n} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o} <${+s+1}.0.0-0`),Y("caret return",c),c})},T_=(r,e)=>(Y("replaceXRanges",r,e),r.split(/\s+/).map(t=>O_(t,e)).join(" ")),O_=(r,e)=>{r=r.trim();let t=e.loose?Ee[ve.XRANGELOOSE]:Ee[ve.XRANGE];return r.replace(t,(n,i,s,a,o,u)=>{Y("xRange",r,n,i,s,a,o,u);let c=Se(s),l=c||Se(a),d=l||Se(o),f=d;return i==="="&&f&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(a=0),o=0,i===">"?(i=">=",l?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):i==="<="&&(i="<",l?s=+s+1:a=+a+1),i==="<"&&(u="-0"),n=`${i+s}.${a}.${o}${u}`):l?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:d&&(n=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),Y("xRange return",n),n})},$_=(r,e)=>(Y("replaceStars",r,e),r.trim().replace(Ee[ve.STAR],"")),I_=(r,e)=>(Y("replaceGTE0",r,e),r.trim().replace(Ee[e.includePrerelease?ve.GTE0PRE:ve.GTE0],"")),A_=r=>(e,t,n,i,s,a,o,u,c,l,d,f)=>(Se(n)?t="":Se(i)?t=`>=${n}.0.0${r?"-0":""}`:Se(s)?t=`>=${n}.${i}.0${r?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,Se(c)?u="":Se(l)?u=`<${+c+1}.0.0-0`:Se(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:r?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),k_=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(Y(r[n].semver),r[n].semver!==La.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var pn=P((wS,Fl)=>{"use strict";var hn=Symbol("SemVer ANY"),Da=class r{static get ANY(){return hn}constructor(e,t){if(t=Ll(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ma("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===hn?this.value="":this.value=this.operator+this.semver.version,Ma("comp",this)}parse(e){let t=this.options.loose?zl[Ml.COMPARATORLOOSE]:zl[Ml.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Dl(n[2],this.options.loose):this.semver=hn}toString(){return this.value}test(e){if(Ma("Comparator.test",e,this.options.loose),this.semver===hn||e===hn)return!0;if(typeof e=="string")try{e=new Dl(e,this.options)}catch{return!1}return za(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Ul(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Ul(this.value,t).test(e.semver):(t=Ll(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||za(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||za(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Fl.exports=Da;var Ll=$i(),{safeRe:zl,t:Ml}=jr(),za=Na(),Ma=dn(),Dl=we(),Ul=Ke()});var mn=P((vS,Zl)=>{"use strict";var P_=Ke(),R_=(r,e,t)=>{try{e=new P_(e,t)}catch{return!1}return e.test(r)};Zl.exports=R_});var Gl=P((xS,Bl)=>{"use strict";var N_=Ke(),C_=(r,e)=>new N_(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Bl.exports=C_});var Vl=P((ES,ql)=>{"use strict";var j_=we(),L_=Ke(),z_=(r,e,t)=>{let n=null,i=null,s=null;try{s=new L_(e,t)}catch{return null}return r.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new j_(n,t))}),n};ql.exports=z_});var Jl=P((SS,Hl)=>{"use strict";var M_=we(),D_=Ke(),U_=(r,e,t)=>{let n=null,i=null,s=null;try{s=new D_(e,t)}catch{return null}return r.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new M_(n,t))}),n};Hl.exports=U_});var Yl=P((TS,Wl)=>{"use strict";var Ua=we(),F_=Ke(),Kl=fn(),Z_=(r,e)=>{r=new F_(r,e);let t=new Ua("0.0.0");if(r.test(t)||(t=new Ua("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(a=>{let o=new Ua(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||Kl(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!t||Kl(t,s))&&(t=s)}return t&&r.test(t)?t:null};Wl.exports=Z_});var Ql=P((OS,Xl)=>{"use strict";var B_=Ke(),G_=(r,e)=>{try{return new B_(r,e).range||"*"}catch{return null}};Xl.exports=G_});var Mi=P(($S,nd)=>{"use strict";var q_=we(),rd=pn(),{ANY:V_}=rd,H_=Ke(),J_=mn(),ed=fn(),td=Ni(),K_=ji(),W_=Ci(),Y_=(r,e,t,n)=>{r=new q_(r,n),e=new H_(e,n);let i,s,a,o,u;switch(t){case">":i=ed,s=K_,a=td,o=">",u=">=";break;case"<":i=td,s=W_,a=ed,o="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(J_(r,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],d=null,f=null;if(l.forEach(p=>{p.semver===V_&&(p=new rd(">=0.0.0")),d=d||p,f=f||p,i(p.semver,d.semver,n)?d=p:a(p.semver,f.semver,n)&&(f=p)}),d.operator===o||d.operator===u||(!f.operator||f.operator===o)&&s(r,f.semver))return!1;if(f.operator===u&&a(r,f.semver))return!1}return!0};nd.exports=Y_});var sd=P((IS,id)=>{"use strict";var X_=Mi(),Q_=(r,e,t)=>X_(r,e,">",t);id.exports=Q_});var od=P((AS,ad)=>{"use strict";var ey=Mi(),ty=(r,e,t)=>ey(r,e,"<",t);ad.exports=ty});var ld=P((kS,cd)=>{"use strict";var ud=Ke(),ry=(r,e,t)=>(r=new ud(r,t),e=new ud(e,t),r.intersects(e,t));cd.exports=ry});var fd=P((PS,dd)=>{"use strict";var ny=mn(),iy=Je();dd.exports=(r,e,t)=>{let n=[],i=null,s=null,a=r.sort((l,d)=>iy(l,d,t));for(let l of a)ny(l,e,t)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let o=[];for(let[l,d]of n)l===d?o.push(l):!d&&l===a[0]?o.push("*"):d?l===a[0]?o.push(`<=${d}`):o.push(`${l} - ${d}`):o.push(`>=${l}`);let u=o.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var yd=P((RS,_d)=>{"use strict";var pd=Ke(),Za=pn(),{ANY:Fa}=Za,gn=mn(),Ba=Je(),sy=(r,e,t={})=>{if(r===e)return!0;r=new pd(r,t),e=new pd(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let a=oy(i,s,t);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},ay=[new Za(">=0.0.0-0")],hd=[new Za(">=0.0.0")],oy=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Fa){if(e.length===1&&e[0].semver===Fa)return!0;t.includePrerelease?r=ay:r=hd}if(e.length===1&&e[0].semver===Fa){if(t.includePrerelease)return!0;e=hd}let n=new Set,i,s;for(let p of r)p.operator===">"||p.operator===">="?i=md(i,p,t):p.operator==="<"||p.operator==="<="?s=gd(s,p,t):n.add(p.semver);if(n.size>1)return null;let a;if(i&&s){if(a=Ba(i.semver,s.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let p of n){if(i&&!gn(p,String(i),t)||s&&!gn(p,String(s),t))return null;for(let h of e)if(!gn(p,String(h),t))return!1;return!0}let o,u,c,l,d=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",c=c||p.operator==="<"||p.operator==="<=",i){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator===">"||p.operator===">="){if(o=md(i,p,t),o===p&&o!==i)return!1}else if(i.operator===">="&&!gn(i.semver,String(p),t))return!1}if(s){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator==="<"||p.operator==="<="){if(u=gd(s,p,t),u===p&&u!==s)return!1}else if(s.operator==="<="&&!gn(s.semver,String(p),t))return!1}if(!p.operator&&(s||i)&&a!==0)return!1}return!(i&&c&&!s&&a!==0||s&&l&&!i&&a!==0||f||d)},md=(r,e,t)=>{if(!r)return e;let n=Ba(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},gd=(r,e,t)=>{if(!r)return e;let n=Ba(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};_d.exports=sy});var xd=P((NS,vd)=>{"use strict";var Ga=jr(),bd=ln(),uy=we(),wd=Ia(),cy=pr(),ly=Vc(),dy=Jc(),fy=Yc(),py=el(),hy=rl(),my=il(),gy=al(),_y=ul(),yy=Je(),by=fl(),wy=hl(),vy=Ri(),xy=yl(),Ey=wl(),Sy=fn(),Ty=Ni(),Oy=Pa(),$y=Ra(),Iy=Ci(),Ay=ji(),ky=Na(),Py=Al(),Ry=pn(),Ny=Ke(),Cy=mn(),jy=Gl(),Ly=Vl(),zy=Jl(),My=Yl(),Dy=Ql(),Uy=Mi(),Fy=sd(),Zy=od(),By=ld(),Gy=fd(),qy=yd();vd.exports={parse:cy,valid:ly,clean:dy,inc:fy,diff:py,major:hy,minor:my,patch:gy,prerelease:_y,compare:yy,rcompare:by,compareLoose:wy,compareBuild:vy,sort:xy,rsort:Ey,gt:Sy,lt:Ty,eq:Oy,neq:$y,gte:Iy,lte:Ay,cmp:ky,coerce:Py,Comparator:Ry,Range:Ny,satisfies:Cy,toComparators:jy,maxSatisfying:Ly,minSatisfying:zy,minVersion:My,validRange:Dy,outside:Uy,gtr:Fy,ltr:Zy,intersects:By,simplifyRange:Gy,subset:qy,SemVer:uy,re:Ga.re,src:Ga.src,tokens:Ga.t,SEMVER_SPEC_VERSION:bd.SEMVER_SPEC_VERSION,RELEASE_TYPES:bd.RELEASE_TYPES,compareIdentifiers:wd.compareIdentifiers,rcompareIdentifiers:wd.rcompareIdentifiers}});var Bd=P((gT,Zd)=>{"use strict";var Ud=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Fd=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`;function yb(){let r=new Map,e={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]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,n]of Object.entries(e)){for(let[i,s]of Object.entries(n))e[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[i]=e[i],r.set(s[0],s[1]);Object.defineProperty(e,t,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi256=Ud(),e.color.ansi16m=Fd(),e.bgColor.ansi256=Ud(10),e.bgColor.ansi16m=Fd(10),Object.defineProperties(e,{rgbToAnsi256:{value:(t,n,i)=>t===n&&n===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!n)return[0,0,0];let{colorString:i}=n.groups;i.length===3&&(i=i.split("").map(a=>a+a).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1}}),e}Object.defineProperty(Zd,"exports",{enumerable:!0,get:yb})});var qp={};le(qp,{BasePromptValue:()=>Sr,ChatPromptValue:()=>Fs,ImagePromptValue:()=>Zs,StringPromptValue:()=>Qr});var Dp={};le(Dp,{Serializable:()=>Ze,get_lc_unique_name:()=>Mn});var nu=ot(Ko(),1),iu=ot(ru(),1);function su(r,e){return e?.[r]||(0,nu.default)(r)}function kv(r,e){return e?.[r]||(0,iu.default)(r)}function au(r,e,t){let n={};for(let i in r)Object.hasOwn(r,i)&&(n[e(i,t)]=r[i]);return n}var zn="__lc_escaped__";function Cp(r){return"lc"in r||Object.keys(r).length===1&&zn in r}function jp(r){return{[zn]:r}}function Lp(r){return Object.keys(r).length===1&&zn in r}function zp(r){return r!==null&&typeof r=="object"&&"lc_serializable"in r&&typeof r.toJSON=="function"}function Ln(r){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){if(zp(r))return r;let e=r;if(Cp(e))return jp(e);let t={};for(let[n,i]of Object.entries(e))t[n]=Ln(i);return t}return Array.isArray(r)?r.map(e=>Ln(e)):r}function ou(r){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let e=r;if(Lp(e))return e[zn];let t={};for(let[n,i]of Object.entries(e))t[n]=ou(i);return t}return Array.isArray(r)?r.map(e=>ou(e)):r}function uu(r){return Array.isArray(r)?[...r]:{...r}}function Mp(r,e){let t=uu(r);for(let[n,i]of Object.entries(e)){let[s,...a]=n.split(".").reverse(),o=t;for(let u of a.reverse()){if(o[u]===void 0)break;o[u]=uu(o[u]),o=o[u]}o[s]!==void 0&&(o[s]={lc:1,type:"secret",id:[i]})}return t}function Mn(r){let e=Object.getPrototypeOf(r);return typeof r.lc_name=="function"&&(typeof e.lc_name!="function"||r.lc_name()!==e.lc_name())?r.lc_name():r.name}var Ze=class r{static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,Mn(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(e,...t){Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"lc_kwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(e||{}).filter(([n])=>this.lc_serializable_keys?.includes(n))):this.lc_kwargs=e??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof r||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let e={},t={},n=Object.keys(this.lc_kwargs).reduce((o,u)=>(o[u]=u in this?this[u]:this.lc_kwargs[u],o),{});for(let o=Object.getPrototypeOf(this);o;o=Object.getPrototypeOf(o))Object.assign(e,Reflect.get(o,"lc_aliases",this)),Object.assign(t,Reflect.get(o,"lc_secrets",this)),Object.assign(n,Reflect.get(o,"lc_attributes",this));Object.keys(t).forEach(o=>{let u=this,c=n,[l,...d]=o.split(".").reverse();for(let f of d.reverse()){if(!(f in u)||u[f]===void 0)return;(!(f in c)||c[f]===void 0)&&(typeof u[f]=="object"&&u[f]!=null?c[f]={}:Array.isArray(u[f])&&(c[f]=[])),u=u[f],c=c[f]}l in u&&u[l]!==void 0&&(c[l]=c[l]||u[l])});let i={};for(let[o,u]of Object.entries(n))i[o]=Ln(u);let s=Object.keys(t).length?Mp(i,t):i,a=au(s,su,e);return{lc:1,type:"constructor",id:this.lc_id,kwargs:a}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}};function kt(r){return typeof r=="object"&&r!==null&&"type"in r&&typeof r.type=="string"&&"source_type"in r&&(r.source_type==="url"||r.source_type==="base64"||r.source_type==="text"||r.source_type==="id")}function jv(r){return kt(r)&&r.source_type==="url"&&"url"in r&&typeof r.url=="string"}function Lv(r){return kt(r)&&r.source_type==="base64"&&"data"in r&&typeof r.data=="string"}function zv(r){return kt(r)&&r.source_type==="text"&&"text"in r&&typeof r.text=="string"}function Mv(r){return kt(r)&&r.source_type==="id"&&"id"in r&&typeof r.id=="string"}function Dv(r){if(kt(r)){if(r.source_type==="url")return{type:"image_url",image_url:{url:r.url}};if(r.source_type==="base64"){if(!r.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${r.mime_type};base64,${r.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function Uv(r){let e=r.split(";")[0].split("/");if(e.length!==2)throw new Error(`Invalid mime type: "${r}" - does not match type/subtype format.`);let t=e[0].trim(),n=e[1].trim();if(t===""||n==="")throw new Error(`Invalid mime type: "${r}" - type or subtype is empty.`);let i={};for(let s of r.split(";").slice(1)){let a=s.split("=");if(a.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${r}".`);let o=a[0].trim(),u=a[1].trim();if(o==="")throw new Error(`Invalid parameter syntax in mime type: "${r}".`);i[o]=u}return{type:t,subtype:n,parameters:i}}function Fv({dataUrl:r,asTypedArray:e=!1}){let t=r.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/),n;if(t){n=t[1].toLowerCase();let i=e?Uint8Array.from(atob(t[2]),s=>s.charCodeAt(0)):t[2];return{mime_type:n,data:i}}}function Zv(r,e){if(r.type==="text"){if(!e.fromStandardTextBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardTextBlock\` method.`);return e.fromStandardTextBlock(r)}if(r.type==="image"){if(!e.fromStandardImageBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardImageBlock\` method.`);return e.fromStandardImageBlock(r)}if(r.type==="audio"){if(!e.fromStandardAudioBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardAudioBlock\` method.`);return e.fromStandardAudioBlock(r)}if(r.type==="file"){if(!e.fromStandardFileBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardFileBlock\` method.`);return e.fromStandardFileBlock(r)}throw new Error(`Unable to convert content block type '${r.type}' to provider-specific format: not recognized.`)}function Be(r,e){return typeof r=="string"?r===""?e:typeof e=="string"?r+e:Array.isArray(e)&&e.some(t=>kt(t))?[{type:"text",source_type:"text",text:r},...e]:[{type:"text",text:r},...e]:Array.isArray(e)?Wr(r,e)??[...r,...e]:e===""?r:Array.isArray(r)&&r.some(t=>kt(t))?[...r,{type:"file",source_type:"text",text:e}]:[...r,{type:"text",text:e}]}function cu(r,e){return r==="error"||e==="error"?"error":"success"}function Up(r,e){function t(n,i){if(typeof n!="object"||n===null||n===void 0)return n;if(i>=e)return Array.isArray(n)?"[Array]":"[Object]";if(Array.isArray(n))return n.map(a=>t(a,i+1));let s={};for(let a of Object.keys(n))s[a]=t(n[a],i+1);return s}return JSON.stringify(t(r,0),null,2)}var de=class extends Ze{get lc_aliases(){return{additional_kwargs:"additional_kwargs",response_metadata:"response_metadata"}}get text(){return typeof this.content=="string"?this.content:Array.isArray(this.content)?this.content.map(e=>typeof e=="string"?e:e.type==="text"?e.text:"").join(""):""}getType(){return this._getType()}constructor(e,t){typeof e=="string"&&(e={content:e,additional_kwargs:t,response_metadata:{}}),e.additional_kwargs||(e.additional_kwargs={}),e.response_metadata||(e.response_metadata={}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","messages"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"additional_kwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response_metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.content=e.content,this.additional_kwargs=e.additional_kwargs,this.response_metadata=e.response_metadata,this.id=e.id}toDict(){return{type:this._getType(),data:this.toJSON().kwargs}}static lc_name(){return"BaseMessage"}get _printableFields(){return{id:this.id,content:this.content,name:this.name,additional_kwargs:this.additional_kwargs,response_metadata:this.response_metadata}}_updateId(e){this.id=e,this.lc_kwargs.id=e}get[Symbol.toStringTag](){return this.constructor.lc_name()}[Symbol.for("nodejs.util.inspect.custom")](e){if(e===null)return this;let t=Up(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${t}`}};function Vv(r){return Array.isArray(r)&&r.every(e=>typeof e.index=="number")}function re(r,e){let t={...r};for(let[n,i]of Object.entries(e))if(t[n]==null)t[n]=i;else{if(i==null)continue;if(typeof t[n]!=typeof i||Array.isArray(t[n])!==Array.isArray(i))throw new Error(`field[${n}] already exists in the message chunk, but with a different type.`);if(typeof t[n]=="string"){if(n==="type")continue;["id","name","output_version","model_provider"].includes(n)?t[n]=i:t[n]+=i}else if(typeof t[n]=="object"&&!Array.isArray(t[n]))t[n]=re(t[n],i);else if(Array.isArray(t[n]))t[n]=Wr(t[n],i);else{if(t[n]===i)continue;console.warn(`field[${n}] already exists in this message chunk and value has unsupported type.`)}}return t}function Wr(r,e){if(!(r===void 0&&e===void 0)){if(r===void 0||e===void 0)return r||e;{let t=[...r];for(let n of e)if(typeof n=="object"&&n!==null&&"index"in n&&typeof n.index=="number"){let i=t.findIndex(s=>{let a=typeof s=="object",o="index"in s&&s.index===n.index,u="id"in s&&"id"in n&&s?.id===n?.id,c=!("id"in s)||!s?.id||!("id"in n)||!n?.id;return a&&o&&(u||c)});i!==-1&&typeof t[i]=="object"&&t[i]!==null?t[i]=re(t[i],n):t.push(n)}else{if(typeof n=="object"&&n!==null&&"text"in n&&n.text==="")continue;t.push(n)}return t}}}function lu(r,e){if(!r&&!e)throw new Error("Cannot merge two undefined objects.");if(!r||!e)return r||e;if(typeof r!=typeof e)throw new Error(`Cannot merge objects of different types.
|
|
5
5
|
Left ${typeof r}
|
|
6
6
|
Right ${typeof e}`);if(typeof r=="string"&&typeof e=="string")return r+e;if(Array.isArray(r)&&Array.isArray(e))return Wr(r,e);if(typeof r=="object"&&typeof e=="object")return re(r,e);if(r===e)return r;throw new Error(`Can not merge objects of different types.
|
|
7
7
|
Left ${r}
|
|
@@ -78,7 +78,7 @@ data: ${JSON.stringify(i)}
|
|
|
78
78
|
`));n.enqueue(e.encode(`event: end
|
|
79
79
|
|
|
80
80
|
`)),n.close()}});return ge.fromReadableStream(t)}function Ao(r){return typeof r=="object"&&r!==null&&typeof r[Symbol.iterator]=="function"&&typeof r.next=="function"}var gp=r=>r!=null&&typeof r=="object"&&"next"in r&&typeof r.next=="function";function ws(r){return typeof r=="object"&&r!==null&&typeof r[Symbol.asyncIterator]=="function"}function*ko(r,e){for(;;){let{value:t,done:n}=Ue.runWithConfig(It(r),e.next.bind(e),!0);if(n)break;yield t}}async function*vs(r,e){let t=e[Symbol.asyncIterator]();for(;;){let{value:n,done:i}=await Ue.runWithConfig(It(r),t.next.bind(e),!0);if(i)break;yield n}}function oe(r,e){return r&&!Array.isArray(r)&&!(r instanceof Date)&&typeof r=="object"?r:{[e]:r}}var ue=class extends Ze{constructor(){super(...arguments),Object.defineProperty(this,"lc_runnable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}getName(e){let t=this.name??this.constructor.lc_name()??this.constructor.name;return e?`${t}${e}`:t}bind(e){return new vr({bound:this,kwargs:e,config:{}})}map(){return new Ro({bound:this})}withRetry(e){return new xs({bound:this,kwargs:{},config:{},maxAttemptNumber:e?.stopAfterAttempt,...e})}withConfig(e){return new vr({bound:this,config:e,kwargs:{}})}withFallbacks(e){let t=Array.isArray(e)?e:e.fallbacks;return new Co({runnable:this,fallbacks:t})}_getOptionsList(e,t=0){if(Array.isArray(e)&&e.length!==t)throw new Error(`Passed "options" must be an array with the same length as the inputs, but got ${e.length} options for ${t} inputs`);if(Array.isArray(e))return e.map(W);if(t>1&&!Array.isArray(e)&&e.runId){console.warn("Provided runId will be used only for the first element of the batch.");let n=Object.fromEntries(Object.entries(e).filter(([i])=>i!=="runId"));return Array.from({length:t},(i,s)=>W(s===0?e:n))}return Array.from({length:t},()=>W(e))}async batch(e,t,n){let i=this._getOptionsList(t??{},e.length),s=i[0]?.maxConcurrency??n?.maxConcurrency,a=new yn({maxConcurrency:s,onFailedAttempt:u=>{throw u}}),o=e.map((u,c)=>a.call(async()=>{try{return await this.invoke(u,i[c])}catch(l){if(n?.returnExceptions)return l;throw l}}));return Promise.all(o)}async*_streamIterator(e,t){yield this.invoke(e,t)}async stream(e,t){let n=W(t),i=new mt({generator:this._streamIterator(e,n),config:n});return await i.setup,ge.fromAsyncGenerator(i)}_separateRunnableConfigFromCallOptions(e){let t;e===void 0?t=W(e):t=W({callbacks:e.callbacks,tags:e.tags,metadata:e.metadata,runName:e.runName,configurable:e.configurable,recursionLimit:e.recursionLimit,maxConcurrency:e.maxConcurrency,runId:e.runId,timeout:e.timeout,signal:e.signal});let n={...e};return delete n.callbacks,delete n.tags,delete n.metadata,delete n.runName,delete n.configurable,delete n.recursionLimit,delete n.maxConcurrency,delete n.runId,delete n.timeout,delete n.signal,[t,n]}async _callWithConfig(e,t,n){let i=W(n),a=await(await Xe(i))?.handleChainStart(this.toJSON(),oe(t,"input"),i.runId,i?.runType,void 0,void 0,i?.runName??this.getName());delete i.runId;let o;try{let u=e.call(this,t,i,a);o=await ht(u,n?.signal)}catch(u){throw await a?.handleChainError(u),u}return await a?.handleChainEnd(oe(o,"output")),o}async _batchWithConfig(e,t,n,i){let s=this._getOptionsList(n??{},t.length),a=await Promise.all(s.map(Xe)),o=await Promise.all(a.map(async(c,l)=>{let d=await c?.handleChainStart(this.toJSON(),oe(t[l],"input"),s[l].runId,s[l].runType,void 0,void 0,s[l].runName??this.getName());return delete s[l].runId,d})),u;try{let c=e.call(this,t,s,o,i);u=await ht(c,s?.[0]?.signal)}catch(c){throw await Promise.all(o.map(l=>l?.handleChainError(c))),c}return await Promise.all(o.map(c=>c?.handleChainEnd(oe(u,"output")))),u}_concatOutputChunks(e,t){return ns(e,t)}async*_transformStreamWithConfig(e,t,n){let i,s=!0,a,o=!0,u=W(n),c=await Xe(u),l=this;async function*d(){for await(let p of e){if(s)if(i===void 0)i=p;else try{i=l._concatOutputChunks(i,p)}catch{i=void 0,s=!1}yield p}}let f;try{let p=await ao(t.bind(this),d(),async()=>c?.handleChainStart(this.toJSON(),{input:""},u.runId,u.runType,void 0,void 0,u.runName??this.getName()),n?.signal,u);delete u.runId,f=p.setup;let h=f?.handlers.find(Qd),m=p.output;h!==void 0&&f!==void 0&&(m=h.tapOutputIterable(f.runId,m));let g=f?.handlers.find(oo);g!==void 0&&f!==void 0&&(m=g.tapOutputIterable(f.runId,m));for await(let _ of m)if(yield _,o)if(a===void 0)a=_;else try{a=this._concatOutputChunks(a,_)}catch{a=void 0,o=!1}}catch(p){throw await f?.handleChainError(p,void 0,void 0,void 0,{inputs:oe(i,"input")}),p}await f?.handleChainEnd(a??{},void 0,void 0,void 0,{inputs:oe(i,"input")})}getGraph(e){let t=new $n,n=t.addNode({name:`${this.getName()}Input`,schema:Tt.any()}),i=t.addNode(this),s=t.addNode({name:`${this.getName()}Output`,schema:Tt.any()});return t.addEdge(n,i),t.addEdge(i,s),t}pipe(e){return new Es({first:this,last:wr(e)})}pick(e){return this.pipe(new Lo(e))}assign(e){return this.pipe(new jo(new Br({steps:e})))}async*transform(e,t){let n;for await(let i of e)n===void 0?n=i:n=this._concatOutputChunks(n,i);yield*this._streamIterator(n,W(t))}async*streamLog(e,t,n){let i=new Ur({...n,autoClose:!1,_schemaFormat:"original"}),s=W(t);yield*this._streamLog(e,i,s)}async*_streamLog(e,t,n){let{callbacks:i}=n;if(i===void 0)n.callbacks=[t];else if(Array.isArray(i))n.callbacks=i.concat([t]);else{let u=i.copy();u.addHandler(t,!0),n.callbacks=u}let s=this.stream(e,n);async function a(){try{let u=await s;for await(let c of u){let l=new Qe({ops:[{op:"add",path:"/streamed_output/-",value:c}]});await t.writer.write(l)}}finally{await t.writer.close()}}let o=a();try{for await(let u of t)yield u}finally{await o}}streamEvents(e,t,n){let i;if(t.version==="v1")i=this._streamEventsV1(e,t,n);else if(t.version==="v2")i=this._streamEventsV2(e,t,n);else throw new Error('Only versions "v1" and "v2" of the schema are currently supported.');return t.encoding==="text/event-stream"?mp(i):ge.fromAsyncGenerator(i)}async*_streamEventsV2(e,t,n){let i=new ss({...n,autoClose:!1}),s=W(t),a=s.runId??Ne();s.runId=a;let o=s.callbacks;if(o===void 0)s.callbacks=[i];else if(Array.isArray(o))s.callbacks=o.concat(i);else{let h=o.copy();h.addHandler(i,!0),s.callbacks=h}let u=new AbortController,c=this;async function l(){let h,m=null;try{t?.signal?"any"in AbortSignal?h=AbortSignal.any([u.signal,t.signal]):(h=t.signal,m=()=>{u.abort()},t.signal.addEventListener("abort",m,{once:!0})):h=u.signal;let g=await c.stream(e,{...s,signal:h}),_=i.tapOutputIterable(a,g);for await(let w of _)if(u.signal.aborted)break}finally{await i.finish(),h&&m&&h.removeEventListener("abort",m)}}let d=l(),f=!1,p;try{for await(let h of i){if(!f){h.data.input=e,f=!0,p=h.run_id,yield h;continue}h.run_id===p&&h.event.endsWith("_end")&&h.data?.input&&delete h.data.input,yield h}}finally{u.abort(),await d}}async*_streamEventsV1(e,t,n){let i,s=!1,a=W(t),o=a.tags??[],u=a.metadata??{},c=a.runName??this.getName(),l=new Ur({...n,autoClose:!1,_schemaFormat:"streaming_events"}),d=new os({...n}),f=this._streamLog(e,l,a);for await(let h of f){if(i?i=i.concat(h):i=Dr.fromRunLogPatch(h),i.state===void 0)throw new Error('Internal error: "streamEvents" state is missing. Please open a bug report.');if(!s){s=!0;let w={...i.state},v={run_id:w.id,event:`on_${w.type}_start`,name:c,tags:o,metadata:u,data:{input:e}};d.includeEvent(v,w.type)&&(yield v)}let m=h.ops.filter(w=>w.path.startsWith("/logs/")).map(w=>w.path.split("/")[2]),g=[...new Set(m)];for(let w of g){let v,N={},I=i.state.logs[w];if(I.end_time===void 0?I.streamed_output.length>0?v="stream":v="start":v="end",v==="start")I.inputs!==void 0&&(N.input=I.inputs);else if(v==="end")I.inputs!==void 0&&(N.input=I.inputs),N.output=I.final_output;else if(v==="stream"){let H=I.streamed_output.length;if(H!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${H} instead. Encountered in: "${I.name}"`);N={chunk:I.streamed_output[0]},I.streamed_output=[]}yield{event:`on_${I.type}_${v}`,name:I.name,run_id:I.id,tags:I.tags,metadata:I.metadata,data:N}}let{state:_}=i;if(_.streamed_output.length>0){let w=_.streamed_output.length;if(w!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${w} instead. Encountered in: "${_.name}"`);let v={chunk:_.streamed_output[0]};_.streamed_output=[];let N={event:`on_${_.type}_stream`,run_id:_.id,tags:o,metadata:u,name:c,data:v};d.includeEvent(N,_.type)&&(yield N)}}let p=i?.state;if(p!==void 0){let h={event:`on_${p.type}_end`,name:c,run_id:p.id,tags:o,metadata:u,data:{output:p.final_output}};d.includeEvent(h,p.type)&&(yield h)}}static isRunnable(e){return wn(e)}withListeners({onStart:e,onEnd:t,onError:n}){return new vr({bound:this,config:{},configFactories:[i=>({callbacks:[new bn({config:i,onStart:e,onEnd:t,onError:n})]})]})}asTool(e){return ov(this,e)}},vr=class r extends ue{static lc_name(){return"RunnableBinding"}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"bound",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"kwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"configFactories",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.bound=e.bound,this.kwargs=e.kwargs,this.config=e.config,this.configFactories=e.configFactories}getName(e){return this.bound.getName(e)}async _mergeConfig(...e){let t=so(this.config,...e);return so(t,...this.configFactories?await Promise.all(this.configFactories.map(async n=>await n(t))):[])}bind(e){return new this.constructor({bound:this.bound,kwargs:{...this.kwargs,...e},config:this.config})}withConfig(e){return new this.constructor({bound:this.bound,kwargs:this.kwargs,config:{...this.config,...e}})}withRetry(e){return new xs({bound:this.bound,kwargs:this.kwargs,config:this.config,maxAttemptNumber:e?.stopAfterAttempt,...e})}async invoke(e,t){return this.bound.invoke(e,await this._mergeConfig(W(t),this.kwargs))}async batch(e,t,n){let i=Array.isArray(t)?await Promise.all(t.map(async s=>this._mergeConfig(W(s),this.kwargs))):await this._mergeConfig(W(t),this.kwargs);return this.bound.batch(e,i,n)}_concatOutputChunks(e,t){return this.bound._concatOutputChunks(e,t)}async*_streamIterator(e,t){yield*this.bound._streamIterator(e,await this._mergeConfig(W(t),this.kwargs))}async stream(e,t){return this.bound.stream(e,await this._mergeConfig(W(t),this.kwargs))}async*transform(e,t){yield*this.bound.transform(e,await this._mergeConfig(W(t),this.kwargs))}streamEvents(e,t,n){let i=this,s=async function*(){yield*i.bound.streamEvents(e,{...await i._mergeConfig(W(t),i.kwargs),version:t.version},n)};return ge.fromAsyncGenerator(s())}static isRunnableBinding(e){return e.bound&&ue.isRunnable(e.bound)}withListeners({onStart:e,onEnd:t,onError:n}){return new r({bound:this.bound,kwargs:this.kwargs,config:this.config,configFactories:[i=>({callbacks:[new bn({config:i,onStart:e,onEnd:t,onError:n})]})]})}},Ro=class r extends ue{static lc_name(){return"RunnableEach"}constructor(e){super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"bound",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.bound=e.bound}bind(e){return new r({bound:this.bound.bind(e)})}async invoke(e,t){return this._callWithConfig(this._invoke.bind(this),e,t)}async _invoke(e,t,n){return this.bound.batch(e,me(t,{callbacks:n?.getChild()}))}withListeners({onStart:e,onEnd:t,onError:n}){return new r({bound:this.bound.withListeners({onStart:e,onEnd:t,onError:n})})}},xs=class extends vr{static lc_name(){return"RunnableRetry"}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"maxAttemptNumber",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"onFailedAttempt",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),this.maxAttemptNumber=e.maxAttemptNumber??this.maxAttemptNumber,this.onFailedAttempt=e.onFailedAttempt??this.onFailedAttempt}_patchConfigForRetry(e,t,n){let i=e>1?`retry:attempt:${e}`:void 0;return me(t,{callbacks:n?.getChild(i)})}async _invoke(e,t,n){return(0,Po.default)(i=>super.invoke(e,this._patchConfigForRetry(i,t,n)),{onFailedAttempt:i=>this.onFailedAttempt(i,e),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}async invoke(e,t){return this._callWithConfig(this._invoke.bind(this),e,t)}async _batch(e,t,n,i){let s={};try{await(0,Po.default)(async a=>{let o=e.map((f,p)=>p).filter(f=>s[f.toString()]===void 0||s[f.toString()]instanceof Error),u=o.map(f=>e[f]),c=o.map(f=>this._patchConfigForRetry(a,t?.[f],n?.[f])),l=await super.batch(u,c,{...i,returnExceptions:!0}),d;for(let f=0;f<l.length;f+=1){let p=l[f],h=o[f];p instanceof Error&&d===void 0&&(d=p,d.input=u[f]),s[h.toString()]=p}if(d)throw d;return l},{onFailedAttempt:a=>this.onFailedAttempt(a,a.input),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}catch(a){if(i?.returnExceptions!==!0)throw a}return Object.keys(s).sort((a,o)=>parseInt(a,10)-parseInt(o,10)).map(a=>s[parseInt(a,10)])}async batch(e,t,n){return this._batchWithConfig(this._batch.bind(this),e,t,n)}},Es=class r extends ue{static lc_name(){return"RunnableSequence"}constructor(e){super(e),Object.defineProperty(this,"first",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"middle",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"last",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"omitSequenceTags",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),this.first=e.first,this.middle=e.middle??this.middle,this.last=e.last,this.name=e.name,this.omitSequenceTags=e.omitSequenceTags??this.omitSequenceTags}get steps(){return[this.first,...this.middle,this.last]}async invoke(e,t){let n=W(t),s=await(await Xe(n))?.handleChainStart(this.toJSON(),oe(e,"input"),n.runId,void 0,void 0,void 0,n?.runName);delete n.runId;let a=e,o;try{let u=[this.first,...this.middle];for(let c=0;c<u.length;c+=1){let d=u[c].invoke(a,me(n,{callbacks:s?.getChild(this.omitSequenceTags?void 0:`seq:step:${c+1}`)}));a=await ht(d,t?.signal)}if(t?.signal?.aborted)throw new Error("Aborted");o=await this.last.invoke(a,me(n,{callbacks:s?.getChild(this.omitSequenceTags?void 0:`seq:step:${this.steps.length}`)}))}catch(u){throw await s?.handleChainError(u),u}return await s?.handleChainEnd(oe(o,"output")),o}async batch(e,t,n){let i=this._getOptionsList(t??{},e.length),s=await Promise.all(i.map(Xe)),a=await Promise.all(s.map(async(u,c)=>{let l=await u?.handleChainStart(this.toJSON(),oe(e[c],"input"),i[c].runId,void 0,void 0,void 0,i[c].runName);return delete i[c].runId,l})),o=e;try{for(let u=0;u<this.steps.length;u+=1){let l=this.steps[u].batch(o,a.map((d,f)=>{let p=d?.getChild(this.omitSequenceTags?void 0:`seq:step:${u+1}`);return me(i[f],{callbacks:p})}),n);o=await ht(l,i[0]?.signal)}}catch(u){throw await Promise.all(a.map(c=>c?.handleChainError(u))),u}return await Promise.all(a.map(u=>u?.handleChainEnd(oe(o,"output")))),o}_concatOutputChunks(e,t){return this.last._concatOutputChunks(e,t)}async*_streamIterator(e,t){let n=await Xe(t),{runId:i,...s}=t??{},a=await n?.handleChainStart(this.toJSON(),oe(e,"input"),i,void 0,void 0,void 0,s?.runName),o=[this.first,...this.middle,this.last],u=!0,c;async function*l(){yield e}try{let d=o[0].transform(l(),me(s,{callbacks:a?.getChild(this.omitSequenceTags?void 0:"seq:step:1")}));for(let f=1;f<o.length;f+=1)d=await o[f].transform(d,me(s,{callbacks:a?.getChild(this.omitSequenceTags?void 0:`seq:step:${f+1}`)}));for await(let f of d)if(t?.signal?.throwIfAborted(),yield f,u)if(c===void 0)c=f;else try{c=this._concatOutputChunks(c,f)}catch{c=void 0,u=!1}}catch(d){throw await a?.handleChainError(d),d}await a?.handleChainEnd(oe(c,"output"))}getGraph(e){let t=new $n,n=null;return this.steps.forEach((i,s)=>{let a=i.getGraph(e);s!==0&&a.trimFirstNode(),s!==this.steps.length-1&&a.trimLastNode(),t.extend(a);let o=a.firstNode();if(!o)throw new Error(`Runnable ${i} has no first node`);n&&t.addEdge(n,o),n=a.lastNode()}),t}pipe(e){return r.isRunnableSequence(e)?new r({first:this.first,middle:this.middle.concat([this.last,e.first,...e.middle]),last:e.last,name:this.name??e.name}):new r({first:this.first,middle:[...this.middle,this.last],last:wr(e),name:this.name})}static isRunnableSequence(e){return Array.isArray(e.middle)&&ue.isRunnable(e)}static from([e,...t],n){let i={};return typeof n=="string"?i.name=n:n!==void 0&&(i=n),new r({...i,first:wr(e),middle:t.slice(0,-1).map(wr),last:wr(t[t.length-1])})}},Br=class r extends ue{static lc_name(){return"RunnableMap"}getStepsKeys(){return Object.keys(this.steps)}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"steps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.steps={};for(let[t,n]of Object.entries(e.steps))this.steps[t]=wr(n)}static from(e){return new r({steps:e})}async invoke(e,t){let n=W(t),s=await(await Xe(n))?.handleChainStart(this.toJSON(),{input:e},n.runId,void 0,void 0,void 0,n?.runName);delete n.runId;let a={};try{let o=Object.entries(this.steps).map(async([u,c])=>{a[u]=await c.invoke(e,me(n,{callbacks:s?.getChild(`map:key:${u}`)}))});await ht(Promise.all(o),t?.signal)}catch(o){throw await s?.handleChainError(o),o}return await s?.handleChainEnd(a),a}async*_transform(e,t,n){let i={...this.steps},s=rs(e,Object.keys(i).length),a=new Map(Object.entries(i).map(([o,u],c)=>{let l=u.transform(s[c],me(n,{callbacks:t?.getChild(`map:key:${o}`)}));return[o,l.next().then(d=>({key:o,gen:l,result:d}))]}));for(;a.size;){let o=Promise.race(a.values()),{key:u,result:c,gen:l}=await ht(o,n?.signal);a.delete(u),c.done||(yield{[u]:c.value},a.set(u,l.next().then(d=>({key:u,gen:l,result:d}))))}}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let i=W(t),s=new mt({generator:this.transform(n(),i),config:i});return await s.setup,ge.fromAsyncGenerator(s)}},No=class r extends ue{constructor(e){if(super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"func",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!si(e.func))throw new Error("RunnableTraceable requires a function that is wrapped in traceable higher-order function");this.func=e.func}async invoke(e,t){let[n]=this._getOptionsList(t??{},1),i=await Xe(n),s=this.func(me(n,{callbacks:i}),e);return ht(s,n?.signal)}async*_streamIterator(e,t){let[n]=this._getOptionsList(t??{},1),i=await this.invoke(e,t);if(ws(i)){for await(let s of i)n?.signal?.throwIfAborted(),yield s;return}if(gp(i)){for(;;){n?.signal?.throwIfAborted();let s=i.next();if(s.done)break;yield s.value}return}yield i}static from(e){return new r({func:e})}};function av(r){if(si(r))throw new Error("RunnableLambda requires a function that is not wrapped in traceable higher-order function. This shouldn't happen.")}var Ss=class r extends ue{static lc_name(){return"RunnableLambda"}constructor(e){if(si(e.func))return No.from(e.func);super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"func",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),av(e.func),this.func=e.func}static from(e){return new r({func:e})}async _invoke(e,t,n){return new Promise((i,s)=>{let a=me(t,{callbacks:n?.getChild(),recursionLimit:(t?.recursionLimit??ts)-1});Ue.runWithConfig(It(a),async()=>{try{let o=await this.func(e,{...a});if(o&&ue.isRunnable(o)){if(t?.recursionLimit===0)throw new Error("Recursion limit reached.");o=await o.invoke(e,{...a,recursionLimit:(a.recursionLimit??ts)-1})}else if(ws(o)){let u;for await(let c of vs(a,o))if(t?.signal?.throwIfAborted(),u===void 0)u=c;else try{u=this._concatOutputChunks(u,c)}catch{u=c}o=u}else if(Ao(o)){let u;for(let c of ko(a,o))if(t?.signal?.throwIfAborted(),u===void 0)u=c;else try{u=this._concatOutputChunks(u,c)}catch{u=c}o=u}i(o)}catch(o){s(o)}})})}async invoke(e,t){return this._callWithConfig(this._invoke.bind(this),e,t)}async*_transform(e,t,n){let i;for await(let o of e)if(i===void 0)i=o;else try{i=this._concatOutputChunks(i,o)}catch{i=o}let s=me(n,{callbacks:t?.getChild(),recursionLimit:(n?.recursionLimit??ts)-1}),a=await new Promise((o,u)=>{Ue.runWithConfig(It(s),async()=>{try{let c=await this.func(i,{...s,config:s});o(c)}catch(c){u(c)}})});if(a&&ue.isRunnable(a)){if(n?.recursionLimit===0)throw new Error("Recursion limit reached.");let o=await a.stream(i,s);for await(let u of o)yield u}else if(ws(a))for await(let o of vs(s,a))n?.signal?.throwIfAborted(),yield o;else if(Ao(a))for(let o of ko(s,a))n?.signal?.throwIfAborted(),yield o;else yield a}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let i=W(t),s=new mt({generator:this.transform(n(),i),config:i});return await s.setup,ge.fromAsyncGenerator(s)}},_p=class extends Br{},Co=class extends ue{static lc_name(){return"RunnableWithFallbacks"}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"runnable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fallbacks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.runnable=e.runnable,this.fallbacks=e.fallbacks}*runnables(){yield this.runnable;for(let e of this.fallbacks)yield e}async invoke(e,t){let n=W(t),i=await Xe(n),{runId:s,...a}=n,o=await i?.handleChainStart(this.toJSON(),oe(e,"input"),s,void 0,void 0,void 0,a?.runName),u=me(a,{callbacks:o?.getChild()});return await Ue.runWithConfig(u,async()=>{let l;for(let d of this.runnables()){n?.signal?.throwIfAborted();try{let f=await d.invoke(e,u);return await o?.handleChainEnd(oe(f,"output")),f}catch(f){l===void 0&&(l=f)}}throw l===void 0?new Error("No error stored at end of fallback."):(await o?.handleChainError(l),l)})}async*_streamIterator(e,t){let n=W(t),i=await Xe(n),{runId:s,...a}=n,o=await i?.handleChainStart(this.toJSON(),oe(e,"input"),s,void 0,void 0,void 0,a?.runName),u,c;for(let d of this.runnables()){n?.signal?.throwIfAborted();let f=me(a,{callbacks:o?.getChild()});try{let p=await d.stream(e,f);c=vs(f,p);break}catch(p){u===void 0&&(u=p)}}if(c===void 0){let d=u??new Error("No error stored at end of fallback.");throw await o?.handleChainError(d),d}let l;try{for await(let d of c){yield d;try{l=l===void 0?l:this._concatOutputChunks(l,d)}catch{l=void 0}}}catch(d){throw await o?.handleChainError(d),d}await o?.handleChainEnd(oe(l,"output"))}async batch(e,t,n){if(n?.returnExceptions)throw new Error("Not implemented.");let i=this._getOptionsList(t??{},e.length),s=await Promise.all(i.map(u=>Xe(u))),a=await Promise.all(s.map(async(u,c)=>{let l=await u?.handleChainStart(this.toJSON(),oe(e[c],"input"),i[c].runId,void 0,void 0,void 0,i[c].runName);return delete i[c].runId,l})),o;for(let u of this.runnables()){i[0].signal?.throwIfAborted();try{let c=await u.batch(e,a.map((l,d)=>me(i[d],{callbacks:l?.getChild()})),n);return await Promise.all(a.map((l,d)=>l?.handleChainEnd(oe(c[d],"output")))),c}catch(c){o===void 0&&(o=c)}}throw o?(await Promise.all(a.map(u=>u?.handleChainError(o))),o):new Error("No error stored at end of fallbacks.")}};function wr(r){if(typeof r=="function")return new Ss({func:r});if(ue.isRunnable(r))return r;if(!Array.isArray(r)&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))e[t]=wr(n);return new Br({steps:e})}else throw new Error(`Expected a Runnable, function or object.
|
|
81
|
-
Instead got an unsupported type.`)}var jo=class extends ue{static lc_name(){return"RunnableAssign"}constructor(e){e instanceof Br&&(e={mapper:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"mapper",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.mapper=e.mapper}async invoke(e,t){let n=await this.mapper.invoke(e,t);return{...e,...n}}async*_transform(e,t,n){let i=this.mapper.getStepsKeys(),[s,a]=rs(e),o=this.mapper.transform(a,me(n,{callbacks:t?.getChild()})),u=o.next();for await(let c of s){if(typeof c!="object"||Array.isArray(c))throw new Error(`RunnableAssign can only be used with objects as input, got ${typeof c}`);let l=Object.fromEntries(Object.entries(c).filter(([d])=>!i.includes(d)));Object.keys(l).length>0&&(yield l)}yield(await u).value;for await(let c of o)yield c}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let i=W(t),s=new mt({generator:this.transform(n(),i),config:i});return await s.setup,ge.fromAsyncGenerator(s)}},Lo=class extends ue{static lc_name(){return"RunnablePick"}constructor(e){(typeof e=="string"||Array.isArray(e))&&(e={keys:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"keys",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.keys=e.keys}async _pick(e){if(typeof this.keys=="string")return e[this.keys];{let t=this.keys.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0);return t.length===0?void 0:Object.fromEntries(t)}}async invoke(e,t){return this._callWithConfig(this._pick.bind(this),e,t)}async*_transform(e){for await(let t of e){let n=await this._pick(t);n!==void 0&&(yield n)}}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let i=W(t),s=new mt({generator:this.transform(n(),i),config:i});return await s.setup,ge.fromAsyncGenerator(s)}},Ts=class extends vr{constructor(e){let t=Es.from([Ss.from(async n=>{let i;if(Zn(n))try{i=await cp(this.schema,n.args)}catch{throw new Fn("Received tool input did not match expected schema",JSON.stringify(n.args))}else i=n;return i}).withConfig({runName:`${e.name}:parse_input`}),e.bound]).withConfig({runName:e.name});super({bound:t,config:e.config??{}}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.description=e.description,this.schema=e.schema}static lc_name(){return"RunnableToolLike"}};function ov(r,e){let t=e.name??r.getName(),n=e.description??lp(e.schema);return dp(e.schema)?new Ts({name:t,description:n,schema:Tt.object({input:Tt.string()}).transform(i=>i.input),bound:r}):new Ts({name:t,description:n,schema:e.schema,bound:r})}var Os=class extends ue{get lc_attributes(){return{partialVariables:void 0}}constructor(e){super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts",this._getPromptType()]}),Object.defineProperty(this,"inputVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"partialVariables",{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,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let{inputVariables:t}=e;if(t.includes("stop"))throw new Error("Cannot have an input variable named 'stop', as it is used internally, please rename.");Object.assign(this,e)}async mergePartialAndUserVariables(e){let t=this.partialVariables??{},n={};for(let[s,a]of Object.entries(t))typeof a=="string"?n[s]=a:n[s]=await a();return{...n,...e}}async invoke(e,t){let n={...this.metadata,...t?.metadata},i=[...this.tags??[],...t?.tags??[]];return this._callWithConfig(s=>this.formatPromptValue(s),e,{...t,tags:i,metadata:n,runType:"prompt"})}serialize(){throw new Error("Use .toJSON() instead")}static async deserialize(e){switch(e._type){case"prompt":{let{PromptTemplate:t}=await import("./
|
|
81
|
+
Instead got an unsupported type.`)}var jo=class extends ue{static lc_name(){return"RunnableAssign"}constructor(e){e instanceof Br&&(e={mapper:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"mapper",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.mapper=e.mapper}async invoke(e,t){let n=await this.mapper.invoke(e,t);return{...e,...n}}async*_transform(e,t,n){let i=this.mapper.getStepsKeys(),[s,a]=rs(e),o=this.mapper.transform(a,me(n,{callbacks:t?.getChild()})),u=o.next();for await(let c of s){if(typeof c!="object"||Array.isArray(c))throw new Error(`RunnableAssign can only be used with objects as input, got ${typeof c}`);let l=Object.fromEntries(Object.entries(c).filter(([d])=>!i.includes(d)));Object.keys(l).length>0&&(yield l)}yield(await u).value;for await(let c of o)yield c}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let i=W(t),s=new mt({generator:this.transform(n(),i),config:i});return await s.setup,ge.fromAsyncGenerator(s)}},Lo=class extends ue{static lc_name(){return"RunnablePick"}constructor(e){(typeof e=="string"||Array.isArray(e))&&(e={keys:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","runnables"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"keys",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.keys=e.keys}async _pick(e){if(typeof this.keys=="string")return e[this.keys];{let t=this.keys.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0);return t.length===0?void 0:Object.fromEntries(t)}}async invoke(e,t){return this._callWithConfig(this._pick.bind(this),e,t)}async*_transform(e){for await(let t of e){let n=await this._pick(t);n!==void 0&&(yield n)}}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let i=W(t),s=new mt({generator:this.transform(n(),i),config:i});return await s.setup,ge.fromAsyncGenerator(s)}},Ts=class extends vr{constructor(e){let t=Es.from([Ss.from(async n=>{let i;if(Zn(n))try{i=await cp(this.schema,n.args)}catch{throw new Fn("Received tool input did not match expected schema",JSON.stringify(n.args))}else i=n;return i}).withConfig({runName:`${e.name}:parse_input`}),e.bound]).withConfig({runName:e.name});super({bound:t,config:e.config??{}}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.description=e.description,this.schema=e.schema}static lc_name(){return"RunnableToolLike"}};function ov(r,e){let t=e.name??r.getName(),n=e.description??lp(e.schema);return dp(e.schema)?new Ts({name:t,description:n,schema:Tt.object({input:Tt.string()}).transform(i=>i.input),bound:r}):new Ts({name:t,description:n,schema:e.schema,bound:r})}var Os=class extends ue{get lc_attributes(){return{partialVariables:void 0}}constructor(e){super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts",this._getPromptType()]}),Object.defineProperty(this,"inputVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"partialVariables",{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,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let{inputVariables:t}=e;if(t.includes("stop"))throw new Error("Cannot have an input variable named 'stop', as it is used internally, please rename.");Object.assign(this,e)}async mergePartialAndUserVariables(e){let t=this.partialVariables??{},n={};for(let[s,a]of Object.entries(t))typeof a=="string"?n[s]=a:n[s]=await a();return{...n,...e}}async invoke(e,t){let n={...this.metadata,...t?.metadata},i=[...this.tags??[],...t?.tags??[]];return this._callWithConfig(s=>this.formatPromptValue(s),e,{...t,tags:i,metadata:n,runType:"prompt"})}serialize(){throw new Error("Use .toJSON() instead")}static async deserialize(e){switch(e._type){case"prompt":{let{PromptTemplate:t}=await import("./IBW6D6XX.js");return t.deserialize(e)}case void 0:{let{PromptTemplate:t}=await import("./IBW6D6XX.js");return t.deserialize({...e,_type:"prompt"})}case"few_shot":{let{FewShotPromptTemplate:t}=await import("./SQPT22F4.js").then(m=>m.default);return t.deserialize(e)}default:throw new Error(`Invalid prompt type in config: ${e._type}`)}}};var $s=class extends Os{async formatPromptValue(e){let t=await this.format(e);return new Qr(t)}};var uv=Object.prototype.toString,qr=Array.isArray||function(e){return uv.call(e)==="[object Array]"};function Mo(r){return typeof r=="function"}function cv(r){return qr(r)?"array":typeof r}function zo(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function yp(r,e){return r!=null&&typeof r=="object"&&e in r}function lv(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var dv=RegExp.prototype.test;function fv(r,e){return dv.call(r,e)}var pv=/\S/;function hv(r){return!fv(pv,r)}var mv={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function gv(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return mv[t]})}var _v=/\s*/,yv=/\s+/,bp=/\s*=/,bv=/\s*\}/,wv=/#|\^|\/|>|\{|&|=|!/;function vv(r,e){if(!r)return[];var t=!1,n=[],i=[],s=[],a=!1,o=!1,u="",c=0;function l(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var d,f,p;function h(J){if(typeof J=="string"&&(J=J.split(yv,2)),!qr(J)||J.length!==2)throw new Error("Invalid tags: "+J);d=new RegExp(zo(J[0])+"\\s*"),f=new RegExp("\\s*"+zo(J[1])),p=new RegExp("\\s*"+zo("}"+J[1]))}h(e||et.tags);for(var m=new An(r),g,_,w,v,N,I;!m.eos();){if(g=m.pos,w=m.scanUntil(d),w)for(var H=0,K=w.length;H<K;++H)v=w.charAt(H),hv(v)?(s.push(i.length),u+=v):(o=!0,t=!0,u+=" "),i.push(["text",v,g,g+1]),g+=1,v===`
|
|
82
82
|
`&&(l(),u="",c=0,t=!1);if(!m.scan(d))break;if(a=!0,_=m.scan(wv)||"name",m.scan(_v),_==="="?(w=m.scanUntil(bp),m.scan(bp),m.scanUntil(f)):_==="{"?(w=m.scanUntil(p),m.scan(bv),m.scanUntil(f),_="&"):w=m.scanUntil(f),!m.scan(f))throw new Error("Unclosed tag at "+m.pos);if(_==">"?N=[_,w,g,m.pos,u,c,t]:N=[_,w,g,m.pos],c++,i.push(N),_==="#"||_==="^")n.push(N);else if(_==="/"){if(I=n.pop(),!I)throw new Error('Unopened section "'+w+'" at '+g);if(I[1]!==w)throw new Error('Unclosed section "'+I[1]+'" at '+g)}else _==="name"||_==="{"||_==="&"?o=!0:_==="="&&h(w)}if(l(),I=n.pop(),I)throw new Error('Unclosed section "'+I[1]+'" at '+m.pos);return Ev(xv(i))}function xv(r){for(var e=[],t,n,i=0,s=r.length;i<s;++i)t=r[i],t&&(t[0]==="text"&&n&&n[0]==="text"?(n[1]+=t[1],n[3]=t[3]):(e.push(t),n=t));return e}function Ev(r){for(var e=[],t=e,n=[],i,s,a=0,o=r.length;a<o;++a)switch(i=r[a],i[0]){case"#":case"^":t.push(i),n.push(i),t=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],t=n.length>0?n[n.length-1][4]:e;break;default:t.push(i)}return e}function An(r){this.string=r,this.tail=r,this.pos=0}An.prototype.eos=function(){return this.tail===""};An.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};An.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function Gr(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Gr.prototype.push=function(e){return new Gr(e,this)};Gr.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var i=this,s,a,o,u=!1;i;){if(e.indexOf(".")>0)for(s=i.view,a=e.split("."),o=0;s!=null&&o<a.length;)o===a.length-1&&(u=yp(s,a[o])||lv(s,a[o])),s=s[a[o++]];else s=i.view[e],u=yp(i.view,e);if(u){n=s;break}i=i.parent}t[e]=n}return Mo(n)&&(n=n.call(this.view)),n};function Ie(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Ie.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Ie.prototype.parse=function(e,t){var n=this.templateCache,i=e+":"+(t||et.tags).join(":"),s=typeof n<"u",a=s?n.get(i):void 0;return a==null&&(a=vv(e,t),s&&n.set(i,a)),a};Ie.prototype.render=function(e,t,n,i){var s=this.getConfigTags(i),a=this.parse(e,s),o=t instanceof Gr?t:new Gr(t,void 0);return this.renderTokens(a,o,n,e,i)};Ie.prototype.renderTokens=function(e,t,n,i,s){for(var a="",o,u,c,l=0,d=e.length;l<d;++l)c=void 0,o=e[l],u=o[0],u==="#"?c=this.renderSection(o,t,n,i,s):u==="^"?c=this.renderInverted(o,t,n,i,s):u===">"?c=this.renderPartial(o,t,n,s):u==="&"?c=this.unescapedValue(o,t):u==="name"?c=this.escapedValue(o,t,s):u==="text"&&(c=this.rawValue(o)),c!==void 0&&(a+=c);return a};Ie.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function c(f){return a.render(f,t,n,s)}if(u){if(qr(u))for(var l=0,d=u.length;l<d;++l)o+=this.renderTokens(e[4],t.push(u[l]),n,i,s);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(e[4],t.push(u),n,i,s);else if(Mo(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(t.view,i.slice(e[3],e[5]),c),u!=null&&(o+=u)}else o+=this.renderTokens(e[4],t,n,i,s);return o}};Ie.prototype.renderInverted=function(e,t,n,i,s){var a=t.lookup(e[1]);if(!a||qr(a)&&a.length===0)return this.renderTokens(e[4],t,n,i,s)};Ie.prototype.indentPartial=function(e,t,n){for(var i=t.replace(/[^ \t]/g,""),s=e.split(`
|
|
83
83
|
`),a=0;a<s.length;a++)s[a].length&&(a>0||!n)&&(s[a]=i+s[a]);return s.join(`
|
|
84
84
|
`)};Ie.prototype.renderPartial=function(e,t,n,i){if(n){var s=this.getConfigTags(i),a=Mo(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],u=e[5],c=e[4],l=a;u==0&&c&&(l=this.indentPartial(a,c,o));var d=this.parse(l,s);return this.renderTokens(d,t,n,l,i)}}};Ie.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Ie.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||et.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===et.escape?String(s):i(s)};Ie.prototype.rawValue=function(e){return e[1]};Ie.prototype.getConfigTags=function(e){return qr(e)?e:e&&typeof e=="object"?e.tags:void 0};Ie.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!qr(e))return e.escape};var et={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){In.templateCache=r},get templateCache(){return In.templateCache}},In=new Ie;et.clearCache=function(){return In.clearCache()};et.parse=function(e,t){return In.parse(e,t)};et.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+cv(e)+'" was given as the first argument for mustache#render(template, view, partials)');return In.render(e,t,n,i)};et.escape=gv;et.Scanner=An;et.Context=Gr;et.Writer=Ie;var Is=et;function wp(){Is.escape=r=>r}var vp=r=>{let e=r.split(""),t=[],n=(s,a)=>{for(let o=a;o<e.length;o+=1)if(s.includes(e[o]))return o;return-1},i=0;for(;i<e.length;)if(e[i]==="{"&&i+1<e.length&&e[i+1]==="{")t.push({type:"literal",text:"{"}),i+=2;else if(e[i]==="}"&&i+1<e.length&&e[i+1]==="}")t.push({type:"literal",text:"}"}),i+=2;else if(e[i]==="{"){let s=n("}",i);if(s<0)throw new Error("Unclosed '{' in template.");t.push({type:"variable",name:e.slice(i+1,s).join("")}),i=s+1}else{if(e[i]==="}")throw new Error("Single '}' in template.");{let s=n("{}",i),a=(s<0?e.slice(i):e.slice(i,s)).join("");t.push({type:"literal",text:a}),i=s<0?e.length:s}}return t},xp=(r,e=[])=>{let t=[];for(let n of r)if(n[0]==="name"){let i=n[1].includes(".")?n[1].split(".")[0]:n[1];t.push({type:"variable",name:i})}else if(["#","&","^",">"].includes(n[0])){if(t.push({type:"variable",name:n[1]}),n[0]==="#"&&n.length>4&&Array.isArray(n[4])){let i=[...e,n[1]],s=xp(n[4],i);t.push(...s)}}else t.push({type:"literal",text:n[1]});return t},Sv=r=>{wp();let e=Is.parse(r);return xp(e)},Tv=(r,e)=>vp(r).reduce((t,n)=>{if(n.type==="variable"){if(n.name in e){let i=typeof e[n.name]=="string"?e[n.name]:JSON.stringify(e[n.name]);return t+i}throw new Error(`(f-string) Missing value for input ${n.name}`)}return t+n.text},""),Ov=(r,e)=>(wp(),Is.render(r,e)),Do={"f-string":Tv,mustache:Ov},$v={"f-string":vp,mustache:Sv},Vr=(r,e,t)=>{try{return Do[e](r,t)}catch(n){throw Un(n,"INVALID_PROMPT_INPUT")}},Ep=(r,e)=>$v[e](r),Sp=(r,e,t)=>{if(!(e in Do)){let n=Object.keys(Do);throw new Error(`Invalid template format. Got \`${e}\`;
|