commit 5518b9c94ec0f3ef20e15d7a05284d5dd2013efa Author: akovalov81 Date: Wed Jul 15 10:12:07 2026 +0300 vault backup: 2026-07-15 10:12:05 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e57e997 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# Ігноруємо системні файли ОС +.DS_Store +Thumbs.db + +# Ігноруємо внутрішній кеш Obsidian (але зберігаємо конфігурацію) +.obsidian/workspace.json +.obsidian/workspace-mobile.json +.obsidian/cache/ \ No newline at end of file diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..18e4ad4 --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,4 @@ +{ + "showLineNumber": false, + "alwaysUpdateLinks": true +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json new file mode 100644 index 0000000..d3f66fa --- /dev/null +++ b/.obsidian/community-plugins.json @@ -0,0 +1,3 @@ +[ + "obsidian-git" +] \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..0faa60d --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/.obsidian/daily-notes.json b/.obsidian/daily-notes.json new file mode 100644 index 0000000..986abf9 --- /dev/null +++ b/.obsidian/daily-notes.json @@ -0,0 +1,5 @@ +{ + "autorun": false, + "folder": "1.Projects/Щоденник", + "template": "0.FILES/2.Шаблони/Шаблон Щоденника." +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json new file mode 100644 index 0000000..26ce634 --- /dev/null +++ b/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 0.7132754626224406, + "close": true +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/data.json b/.obsidian/plugins/obsidian-git/data.json new file mode 100644 index 0000000..af5dd65 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/data.json @@ -0,0 +1,67 @@ +{ + "commitMessage": "vault backup: {{date}}", + "autoCommitMessage": "vault backup: {{date}}", + "commitMessageScript": "", + "commitDateFormat": "YYYY-MM-DD HH:mm:ss", + "autoSaveInterval": 20, + "autoPushInterval": 0, + "autoPullInterval": 0, + "autoPullOnBoot": false, + "autoCommitOnlyStaged": false, + "disablePush": false, + "pullBeforePush": true, + "disablePopups": false, + "showErrorNotices": true, + "disablePopupsForNoChanges": false, + "listChangedFilesInMessageBody": false, + "showStatusBar": true, + "updateSubmodules": false, + "syncMethod": "merge", + "mergeStrategy": "none", + "customMessageOnAutoBackup": false, + "autoBackupAfterFileChange": false, + "treeStructure": false, + "refreshSourceControl": true, + "basePath": "", + "differentIntervalCommitAndPush": false, + "changedFilesInStatusBar": false, + "showedMobileNotice": true, + "refreshSourceControlTimer": 7000, + "showBranchStatusBar": true, + "setLastSaveToLastCommit": false, + "submoduleRecurseCheckout": false, + "gitDir": "", + "showFileMenu": true, + "authorInHistoryView": "hide", + "dateInHistoryView": false, + "diffStyle": "split", + "hunks": { + "showSigns": false, + "hunkCommands": false, + "statusBar": "disabled" + }, + "lineAuthor": { + "show": false, + "followMovement": "inactive", + "authorDisplay": "initials", + "showCommitHash": false, + "dateTimeFormatOptions": "date", + "dateTimeFormatCustomString": "YYYY-MM-DD HH:mm", + "dateTimeTimezone": "viewer-local", + "coloringMaxAge": "1y", + "colorNew": { + "r": 255, + "g": 150, + "b": 150 + }, + "colorOld": { + "r": 120, + "g": 160, + "b": 255 + }, + "textColorCss": "var(--text-muted)", + "ignoreWhitespace": false, + "lastShownAuthorDisplay": "initials", + "lastShownDateTimeFormatOptions": "date" + } +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js new file mode 100644 index 0000000..3efd1dd --- /dev/null +++ b/.obsidian/plugins/obsidian-git/main.js @@ -0,0 +1,415 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git) +*/ + +var TF=Object.create;var vc=Object.defineProperty;var PF=Object.getOwnPropertyDescriptor;var RF=Object.getOwnPropertyNames;var $F=Object.getPrototypeOf,FF=Object.prototype.hasOwnProperty;var yb=t=>{throw TypeError(t)};var IF=(t,e,r)=>e in t?vc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var MF=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var U=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},DF=(t,e)=>{for(var r in e)vc(t,r,{get:e[r],enumerable:!0})},xb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of RF(e))!FF.call(t,n)&&n!==r&&vc(t,n,{get:()=>e[n],enumerable:!(i=PF(e,n))||i.enumerable});return t};var Gt=(t,e,r)=>(r=t!=null?TF($F(t)):{},xb(e||!t||!t.__esModule?vc(r,"default",{value:t,enumerable:!0}):r,t)),OF=t=>xb(vc({},"__esModule",{value:!0}),t);var He=(t,e,r)=>IF(t,typeof e!="symbol"?e+"":e,r),Yp=(t,e,r)=>e.has(t)||yb("Cannot "+r);var F=(t,e,r)=>(Yp(t,e,"read from private field"),r?r.call(t):e.get(t)),ge=(t,e,r)=>e.has(t)?yb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),pe=(t,e,r,i)=>(Yp(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),Ae=(t,e,r)=>(Yp(t,e,"access private method"),r);var kb=U(Cf=>{"use strict";m();Cf.byteLength=NF;Cf.toByteArray=HF;Cf.fromByteArray=jF;var on=[],pi=[],LF=typeof Uint8Array!="undefined"?Uint8Array:Array,Zp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ia=0,Eb=Zp.length;ia0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function NF(t){var e=Sb(t),r=e[0],i=e[1];return(r+i)*3/4-i}function BF(t,e,r){return(e+r)*3/4-r}function HF(t){var e,r=Sb(t),i=r[0],n=r[1],s=new LF(BF(t,i,n)),a=0,o=n>0?i-4:i,l;for(l=0;l>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=pi[t.charCodeAt(l)]<<2|pi[t.charCodeAt(l+1)]>>4,s[a++]=e&255),n===1&&(e=pi[t.charCodeAt(l)]<<10|pi[t.charCodeAt(l+1)]<<4|pi[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function UF(t){return on[t>>18&63]+on[t>>12&63]+on[t>>6&63]+on[t&63]}function GF(t,e,r){for(var i,n=[],s=e;so?o:a+s));return i===1?(e=t[r-1],n.push(on[e>>2]+on[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(on[e>>10]+on[e>>4&63]+on[e<<2&63]+"=")),n.join("")}});var Ab=U(Kp=>{m();Kp.read=function(t,e,r,i,n){var s,a,o=n*8-i-1,l=(1<>1,u=-7,f=r?n-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=s*256+t[e+f],f+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=i;u>0;a=a*256+t[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-c}return(h?-1:1)*a*Math.pow(2,s-i)};Kp.write=function(t,e,r,i,n,s){var a,o,l,c=s*8-n-1,u=(1<>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,p=i?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*l-1)*Math.pow(2,n),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[r+h]=o&255,h+=p,o/=256,n-=8);for(a=a<0;t[r+h]=a&255,h+=p,a/=256,c-=8);t[r+h-p]|=g*128}});var sm=U(So=>{"use strict";m();var Xp=kb(),xo=Ab(),Cb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;So.Buffer=O;So.SlowBuffer=ZF;So.INSPECT_MAX_BYTES=50;var Tf=2147483647;So.kMaxLength=Tf;O.TYPED_ARRAY_SUPPORT=VF();!O.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function VF(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}});Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function Bn(t){if(t>Tf)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,O.prototype),e}function O(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return tm(t)}return $b(t,e,r)}O.poolSize=8192;function $b(t,e,r){if(typeof t=="string")return WF(t,e);if(ArrayBuffer.isView(t))return qF(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(ln(t,ArrayBuffer)||t&&ln(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ln(t,SharedArrayBuffer)||t&&ln(t.buffer,SharedArrayBuffer)))return Jp(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return O.from(i,e,r);let n=YF(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return O.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}O.from=function(t,e,r){return $b(t,e,r)};Object.setPrototypeOf(O.prototype,Uint8Array.prototype);Object.setPrototypeOf(O,Uint8Array);function Fb(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function zF(t,e,r){return Fb(t),t<=0?Bn(t):e!==void 0?typeof r=="string"?Bn(t).fill(e,r):Bn(t).fill(e):Bn(t)}O.alloc=function(t,e,r){return zF(t,e,r)};function tm(t){return Fb(t),Bn(t<0?0:rm(t)|0)}O.allocUnsafe=function(t){return tm(t)};O.allocUnsafeSlow=function(t){return tm(t)};function WF(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!O.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Ib(t,e)|0,i=Bn(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Qp(t){let e=t.length<0?0:rm(t.length)|0,r=Bn(e);for(let i=0;i=Tf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tf.toString(16)+" bytes");return t|0}function ZF(t){return+t!=t&&(t=0),O.alloc(+t)}O.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==O.prototype};O.compare=function(e,r){if(ln(e,Uint8Array)&&(e=O.from(e,e.offset,e.byteLength)),ln(r,Uint8Array)&&(r=O.from(r,r.offset,r.byteLength)),!O.isBuffer(e)||!O.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,a=Math.min(i,n);sn.length?(O.isBuffer(a)||(a=O.from(a)),a.copy(n,s)):Uint8Array.prototype.set.call(n,a,s);else if(O.isBuffer(a))a.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n};function Ib(t,e){if(O.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||ln(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return em(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Gb(t).length;default:if(n)return i?-1:em(t).length;e=(""+e).toLowerCase(),n=!0}}O.byteLength=Ib;function KF(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return aI(this,e,r);case"utf8":case"utf-8":return Db(this,e,r);case"ascii":return nI(this,e,r);case"latin1":case"binary":return sI(this,e,r);case"base64":return rI(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oI(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}O.prototype._isBuffer=!0;function na(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}O.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};Cb&&(O.prototype[Cb]=O.prototype.inspect);O.prototype.compare=function(e,r,i,n,s){if(ln(e,Uint8Array)&&(e=O.from(e,e.offset,e.byteLength)),!O.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let a=s-n,o=i-r,l=Math.min(a,o),c=this.slice(n,s),u=e.slice(r,i);for(let f=0;f2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,nm(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=O.from(e,i)),O.isBuffer(e))return e.length===0?-1:Tb(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Tb(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Tb(t,e,r,i,n){let s=1,a=t.length,o=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,o/=2,r/=2}function l(u,f){return s===1?u[f]:u.readUInt16BE(f*s)}let c;if(n){let u=-1;for(c=r;ca&&(r=a-o),c=r;c>=0;c--){let u=!0;for(let f=0;fn&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let a;for(a=0;a>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return XF(this,e,r,i);case"utf8":case"utf-8":return QF(this,e,r,i);case"ascii":case"latin1":case"binary":return JF(this,e,r,i);case"base64":return eI(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tI(this,e,r,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rI(t,e,r){return e===0&&r===t.length?Xp.fromByteArray(t):Xp.fromByteArray(t.slice(e,r))}function Db(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n239?4:s>223?3:s>191?2:1;if(n+o<=r){let l,c,u,f;switch(o){case 1:s<128&&(a=s);break;case 2:l=t[n+1],(l&192)===128&&(f=(s&31)<<6|l&63,f>127&&(a=f));break;case 3:l=t[n+1],c=t[n+2],(l&192)===128&&(c&192)===128&&(f=(s&15)<<12|(l&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:l=t[n+1],c=t[n+2],u=t[n+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(f=(s&15)<<18|(l&63)<<12|(c&63)<<6|u&63,f>65535&&f<1114112&&(a=f))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=o}return iI(i)}var Pb=4096;function iI(t){let e=t.length;if(e<=Pb)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii)&&(r=i);let n="";for(let s=e;si&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),rr)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||jt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a>>0,r=r>>>0,i||jt(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};O.prototype.readUint8=O.prototype.readUInt8=function(e,r){return e=e>>>0,r||jt(e,1,this.length),this[e]};O.prototype.readUint16LE=O.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||jt(e,2,this.length),this[e]|this[e+1]<<8};O.prototype.readUint16BE=O.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||jt(e,2,this.length),this[e]<<8|this[e+1]};O.prototype.readUint32LE=O.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};O.prototype.readUint32BE=O.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};O.prototype.readBigUInt64LE=vs(function(e){e=e>>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<>>0,r=r>>>0,i||jt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a=s&&(n-=Math.pow(2,8*r)),n};O.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||jt(e,r,this.length);let n=r,s=1,a=this[e+--n];for(;n>0&&(s*=256);)a+=this[e+--n]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*r)),a};O.prototype.readInt8=function(e,r){return e=e>>>0,r||jt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};O.prototype.readInt16LE=function(e,r){e=e>>>0,r||jt(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};O.prototype.readInt16BE=function(e,r){e=e>>>0,r||jt(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};O.prototype.readInt32LE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};O.prototype.readInt32BE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};O.prototype.readBigInt64LE=vs(function(e){e=e>>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,r||jt(e,4,this.length),xo.read(this,e,!0,23,4)};O.prototype.readFloatBE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),xo.read(this,e,!1,23,4)};O.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||jt(e,8,this.length),xo.read(this,e,!0,52,8)};O.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||jt(e,8,this.length),xo.read(this,e,!1,52,8)};function $r(t,e,r,i,n,s){if(!O.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;$r(this,e,r,i,o,0)}let s=1,a=0;for(this[r]=e&255;++a>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;$r(this,e,r,i,o,0)}let s=i-1,a=1;for(this[r+s]=e&255;--s>=0&&(a*=256);)this[r+s]=e/a&255;return r+i};O.prototype.writeUint8=O.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,1,255,0),this[r]=e&255,r+1};O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Ob(t,e,r,i,n){Ub(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function Lb(t,e,r,i,n){Ub(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}O.prototype.writeBigUInt64LE=vs(function(e,r=0){return Ob(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeBigUInt64BE=vs(function(e,r=0){return Lb(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);$r(this,e,r,i,l-1,-l)}let s=0,a=1,o=0;for(this[r]=e&255;++s>0)-o&255;return r+i};O.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);$r(this,e,r,i,l-1,-l)}let s=i-1,a=1,o=0;for(this[r+s]=e&255;--s>=0&&(a*=256);)e<0&&o===0&&this[r+s+1]!==0&&(o=1),this[r+s]=(e/a>>0)-o&255;return r+i};O.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};O.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};O.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};O.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};O.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};O.prototype.writeBigInt64LE=vs(function(e,r=0){return Ob(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});O.prototype.writeBigInt64BE=vs(function(e,r=0){return Lb(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Nb(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Bb(t,e,r,i,n){return e=+e,r=r>>>0,n||Nb(t,e,r,4,34028234663852886e22,-34028234663852886e22),xo.write(t,e,r,i,23,4),r+4}O.prototype.writeFloatLE=function(e,r,i){return Bb(this,e,r,!0,i)};O.prototype.writeFloatBE=function(e,r,i){return Bb(this,e,r,!1,i)};function Hb(t,e,r,i,n){return e=+e,r=r>>>0,n||Nb(t,e,r,8,17976931348623157e292,-17976931348623157e292),xo.write(t,e,r,i,52,8),r+8}O.prototype.writeDoubleLE=function(e,r,i){return Hb(this,e,r,!0,i)};O.prototype.writeDoubleBE=function(e,r,i){return Hb(this,e,r,!1,i)};O.prototype.copy=function(e,r,i,n){if(!O.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s2**32?n=Rb(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Rb(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Rb(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function lI(t,e,r){Eo(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&wc(e,t.length-(r+1))}function Ub(t,e,r,i,n,s){if(t>r||t3?e===0||e===BigInt(0)?o=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:o=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:o=`>= ${e}${a} and <= ${r}${a}`,new yo.ERR_OUT_OF_RANGE("value",o,t)}lI(i,n,s)}function Eo(t,e){if(typeof t!="number")throw new yo.ERR_INVALID_ARG_TYPE(e,"number",t)}function wc(t,e,r){throw Math.floor(t)!==t?(Eo(t,r),new yo.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new yo.ERR_BUFFER_OUT_OF_BOUNDS:new yo.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var cI=/[^+/0-9A-Za-z-_]/g;function uI(t){if(t=t.split("=")[0],t=t.trim().replace(cI,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function em(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let a=0;a55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function fI(t){let e=[];for(let r=0;r>8,n=r%256,s.push(n),s.push(i);return s}function Gb(t){return Xp.toByteArray(uI(t))}function Pf(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function ln(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function nm(t){return t!==t}var hI=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e})();function vs(t){return typeof BigInt=="undefined"?pI:t}function pI(){throw new Error("BigInt not supported")}});var jb,am,E,m=MF(()=>{jb=require("obsidian");jb.Platform.isMobileApp?am=sm().Buffer:am=global.Buffer;E=am});var zb=U((SG,Vb)=>{"use strict";m();var Yr=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process=="undefined"||typeof process.domain=="undefined")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||Yr.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||Yr.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||Yr.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=Yr.DEFAULT_MAX_PENDING};Yr.DEFAULT_TIMEOUT=0;Yr.DEFAULT_MAX_OCCUPATION_TIME=0;Yr.DEFAULT_MAX_EXECUTION_TIME=0;Yr.DEFAULT_MAX_PENDING=1e3;Yr.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,s=null,a=null;typeof r!="function"&&(i=r,r=null,a=new this.Promise(function(b,S){n=b,s=S})),i=i||{};var o=!1,l=null,c=null,u=null,f=this,d=function(b,S,C){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(f.queues[t]&&f.queues[t].length===0&&delete f.queues[t],f.domainReentrant&&delete f.domains[t]),o||(a?S?s(S):n(C):typeof r=="function"&&r(S,C),o=!0),b&&f.queues[t]&&f.queues[t].length>0&&f.queues[t].shift()()},h=function(b){if(o)return d(b);l&&(clearTimeout(l),l=null),f.domainReentrant&&b&&(f.domains[t]=process.domain);var S=i.maxExecutionTime||f.maxExecutionTime;if(S&&(u=setTimeout(function(){f.queues[t]&&d(b,new Error("Maximum execution time is exceeded "+t))},S)),e.length===1){var C=!1;try{e(function(A,k){C||(C=!0,d(b,A,k))})}catch(A){C||(C=!0,d(b,A))}}else f._promiseTry(function(){return e()}).then(function(A){d(b,void 0,A)},function(A){d(b,A)})};f.domainReentrant&&process.domain&&(h=process.domain.bind(h));var p=i.maxPending||f.maxPending;if(!f.queues[t])f.queues[t]=[],h(!0);else if(f.domainReentrant&&process.domain&&process.domain===f.domains[t])h(!1);else if(f.queues[t].length>=p)d(!1,new Error("Too many pending tasks in queue "+t));else{var g=function(){h(!0)};i.skipQueue?f.queues[t].unshift(g):f.queues[t].push(g);var w=i.timeout||f.timeout;w&&(l=setTimeout(function(){l=null,d(!1,new Error("async-lock timed out in queue "+t))},w))}var y=i.maxOccupationTime||f.maxOccupationTime;if(y&&(c=setTimeout(function(){f.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},y)),a)return a};Yr.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,s=function(o,l){return function(c){n.acquire(o,l,c,i)}},a=t.reduceRight(function(o,l){return s(l,o)},e);if(typeof r=="function")a(r);else return new this.Promise(function(o,l){a.length===1?a(function(c,u){c?l(c):o(u)}):o(a())})};Yr.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};Yr.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};Vb.exports=Yr});var qb=U((AG,Wb)=>{"use strict";m();Wb.exports=zb()});var Yb=U((TG,om)=>{m();typeof Object.create=="function"?om.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:om.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var $f=U((lm,Kb)=>{m();var Rf=sm(),cn=Rf.Buffer;function Zb(t,e){for(var r in t)e[r]=t[r]}cn.from&&cn.alloc&&cn.allocUnsafe&&cn.allocUnsafeSlow?Kb.exports=Rf:(Zb(Rf,lm),lm.Buffer=sa);function sa(t,e,r){return cn(t,e,r)}sa.prototype=Object.create(cn.prototype);Zb(cn,sa);sa.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return cn(t,e,r)};sa.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=cn(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};sa.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return cn(t)};sa.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Rf.SlowBuffer(t)}});var Qb=U(($G,Xb)=>{m();var mI={}.toString;Xb.exports=Array.isArray||function(t){return mI.call(t)=="[object Array]"}});var ko=U((IG,Jb)=>{"use strict";m();Jb.exports=TypeError});var cm=U((DG,e_)=>{"use strict";m();e_.exports=Object});var r_=U((LG,t_)=>{"use strict";m();t_.exports=Error});var n_=U((BG,i_)=>{"use strict";m();i_.exports=EvalError});var a_=U((UG,s_)=>{"use strict";m();s_.exports=RangeError});var l_=U((jG,o_)=>{"use strict";m();o_.exports=ReferenceError});var um=U((zG,c_)=>{"use strict";m();c_.exports=SyntaxError});var f_=U((qG,u_)=>{"use strict";m();u_.exports=URIError});var h_=U((ZG,d_)=>{"use strict";m();d_.exports=Math.abs});var m_=U((XG,p_)=>{"use strict";m();p_.exports=Math.floor});var v_=U((JG,g_)=>{"use strict";m();g_.exports=Math.max});var b_=U((tj,w_)=>{"use strict";m();w_.exports=Math.min});var y_=U((ij,__)=>{"use strict";m();__.exports=Math.pow});var E_=U((sj,x_)=>{"use strict";m();x_.exports=Math.round});var k_=U((oj,S_)=>{"use strict";m();S_.exports=Number.isNaN||function(e){return e!==e}});var C_=U((cj,A_)=>{"use strict";m();var gI=k_();A_.exports=function(e){return gI(e)||e===0?e:e<0?-1:1}});var P_=U((fj,T_)=>{"use strict";m();T_.exports=Object.getOwnPropertyDescriptor});var Ao=U((hj,R_)=>{"use strict";m();var Ff=P_();if(Ff)try{Ff([],"length")}catch(t){Ff=null}R_.exports=Ff});var bc=U((mj,$_)=>{"use strict";m();var If=Object.defineProperty||!1;if(If)try{If({},"a",{value:1})}catch(t){If=!1}$_.exports=If});var fm=U((vj,F_)=>{"use strict";m();F_.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==!0)return!1}return!0}});var D_=U((bj,M_)=>{"use strict";m();var I_=typeof Symbol!="undefined"&&Symbol,vI=fm();M_.exports=function(){return typeof I_!="function"||typeof Symbol!="function"||typeof I_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vI()}});var dm=U((yj,O_)=>{"use strict";m();O_.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var hm=U((Ej,L_)=>{"use strict";m();var wI=cm();L_.exports=wI.getPrototypeOf||null});var H_=U((kj,B_)=>{"use strict";m();var bI="Function.prototype.bind called on incompatible ",_I=Object.prototype.toString,yI=Math.max,xI="[object Function]",N_=function(e,r){for(var i=[],n=0;n{"use strict";m();var kI=H_();U_.exports=Function.prototype.bind||kI});var Mf=U((Pj,G_)=>{"use strict";m();G_.exports=Function.prototype.call});var Df=U(($j,j_)=>{"use strict";m();j_.exports=Function.prototype.apply});var z_=U((Ij,V_)=>{"use strict";m();V_.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var pm=U((Dj,W_)=>{"use strict";m();var AI=Co(),CI=Df(),TI=Mf(),PI=z_();W_.exports=PI||AI.call(TI,CI)});var Of=U((Lj,q_)=>{"use strict";m();var RI=Co(),$I=ko(),FI=Mf(),II=pm();q_.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new $I("a function is required");return II(RI,FI,e)}});var J_=U((Bj,Q_)=>{"use strict";m();var MI=Of(),Y_=Ao(),K_;try{K_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var mm=!!K_&&Y_&&Y_(Object.prototype,"__proto__"),X_=Object,Z_=X_.getPrototypeOf;Q_.exports=mm&&typeof mm.get=="function"?MI([mm.get]):typeof Z_=="function"?function(e){return Z_(e==null?e:X_(e))}:!1});var gm=U((Uj,iy)=>{"use strict";m();var ey=dm(),ty=hm(),ry=J_();iy.exports=ey?function(e){return ey(e)}:ty?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return ty(e)}:ry?function(e){return ry(e)}:null});var sy=U((jj,ny)=>{"use strict";m();var DI=Function.prototype.call,OI=Object.prototype.hasOwnProperty,LI=Co();ny.exports=LI.call(DI,OI)});var bm=U((zj,fy)=>{"use strict";m();var Te,NI=cm(),BI=r_(),HI=n_(),UI=a_(),GI=l_(),$o=um(),Ro=ko(),jI=f_(),VI=h_(),zI=m_(),WI=v_(),qI=b_(),YI=y_(),ZI=E_(),KI=C_(),cy=Function,vm=function(t){try{return cy('"use strict"; return ('+t+").constructor;")()}catch(e){}},_c=Ao(),XI=bc(),wm=function(){throw new Ro},QI=_c?(function(){try{return arguments.callee,wm}catch(t){try{return _c(arguments,"callee").get}catch(e){return wm}}})():wm,To=D_()(),Vt=gm(),JI=hm(),eM=dm(),uy=Df(),yc=Mf(),Po={},tM=typeof Uint8Array=="undefined"||!Vt?Te:Vt(Uint8Array),aa={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Te:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Te:ArrayBuffer,"%ArrayIteratorPrototype%":To&&Vt?Vt([][Symbol.iterator]()):Te,"%AsyncFromSyncIteratorPrototype%":Te,"%AsyncFunction%":Po,"%AsyncGenerator%":Po,"%AsyncGeneratorFunction%":Po,"%AsyncIteratorPrototype%":Po,"%Atomics%":typeof Atomics=="undefined"?Te:Atomics,"%BigInt%":typeof BigInt=="undefined"?Te:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Te:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Te:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Te:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":BI,"%eval%":eval,"%EvalError%":HI,"%Float16Array%":typeof Float16Array=="undefined"?Te:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Te:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Te:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Te:FinalizationRegistry,"%Function%":cy,"%GeneratorFunction%":Po,"%Int8Array%":typeof Int8Array=="undefined"?Te:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Te:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Te:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":To&&Vt?Vt(Vt([][Symbol.iterator]())):Te,"%JSON%":typeof JSON=="object"?JSON:Te,"%Map%":typeof Map=="undefined"?Te:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!To||!Vt?Te:Vt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":NI,"%Object.getOwnPropertyDescriptor%":_c,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Te:Promise,"%Proxy%":typeof Proxy=="undefined"?Te:Proxy,"%RangeError%":UI,"%ReferenceError%":GI,"%Reflect%":typeof Reflect=="undefined"?Te:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Te:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!To||!Vt?Te:Vt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Te:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":To&&Vt?Vt(""[Symbol.iterator]()):Te,"%Symbol%":To?Symbol:Te,"%SyntaxError%":$o,"%ThrowTypeError%":QI,"%TypedArray%":tM,"%TypeError%":Ro,"%Uint8Array%":typeof Uint8Array=="undefined"?Te:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Te:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Te:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Te:Uint32Array,"%URIError%":jI,"%WeakMap%":typeof WeakMap=="undefined"?Te:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Te:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Te:WeakSet,"%Function.prototype.call%":yc,"%Function.prototype.apply%":uy,"%Object.defineProperty%":XI,"%Object.getPrototypeOf%":JI,"%Math.abs%":VI,"%Math.floor%":zI,"%Math.max%":WI,"%Math.min%":qI,"%Math.pow%":YI,"%Math.round%":ZI,"%Math.sign%":KI,"%Reflect.getPrototypeOf%":eM};if(Vt)try{null.error}catch(t){ay=Vt(Vt(t)),aa["%Error.prototype%"]=ay}var ay,rM=function t(e){var r;if(e==="%AsyncFunction%")r=vm("async function () {}");else if(e==="%GeneratorFunction%")r=vm("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=vm("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Vt&&(r=Vt(n.prototype))}return aa[e]=r,r},oy={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xc=Co(),Lf=sy(),iM=xc.call(yc,Array.prototype.concat),nM=xc.call(uy,Array.prototype.splice),ly=xc.call(yc,String.prototype.replace),Nf=xc.call(yc,String.prototype.slice),sM=xc.call(yc,RegExp.prototype.exec),aM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,oM=/\\(\\)?/g,lM=function(e){var r=Nf(e,0,1),i=Nf(e,-1);if(r==="%"&&i!=="%")throw new $o("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new $o("invalid intrinsic syntax, expected opening `%`");var n=[];return ly(e,aM,function(s,a,o,l){n[n.length]=o?ly(l,oM,"$1"):a||s}),n},cM=function(e,r){var i=e,n;if(Lf(oy,i)&&(n=oy[i],i="%"+n[0]+"%"),Lf(aa,i)){var s=aa[i];if(s===Po&&(s=rM(i)),typeof s=="undefined"&&!r)throw new Ro("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new $o("intrinsic "+e+" does not exist!")};fy.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Ro("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ro('"allowMissing" argument must be a boolean');if(sM(/^%?[^%]*%?$/,e)===null)throw new $o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=lM(e),n=i.length>0?i[0]:"",s=cM("%"+n+"%",r),a=s.name,o=s.value,l=!1,c=s.alias;c&&(n=c[0],nM(i,iM([0,1],c)));for(var u=1,f=!0;u=i.length){var g=_c(o,d);f=!!g,f&&"get"in g&&!("originalValue"in g.get)?o=g.get:o=o[d]}else f=Lf(o,d),o=o[d];f&&!l&&(aa[a]=o)}}return o}});var _m=U((qj,py)=>{"use strict";m();var dy=bm(),hy=Of(),uM=hy([dy("%String.prototype.indexOf%")]);py.exports=function(e,r){var i=dy(e,!!r);return typeof i=="function"&&uM(e,".prototype.")>-1?hy([i]):i}});var wy=U((Zj,vy)=>{"use strict";m();var gy=Function.prototype.toString,Fo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,xm,Bf;if(typeof Fo=="function"&&typeof Object.defineProperty=="function")try{xm=Object.defineProperty({},"length",{get:function(){throw Bf}}),Bf={},Fo(function(){throw 42},null,xm)}catch(t){t!==Bf&&(Fo=null)}else Fo=null;var fM=/^\s*class\b/,Em=function(e){try{var r=gy.call(e);return fM.test(r)}catch(i){return!1}},ym=function(e){try{return Em(e)?!1:(gy.call(e),!0)}catch(r){return!1}},Hf=Object.prototype.toString,dM="[object Object]",hM="[object Function]",pM="[object GeneratorFunction]",mM="[object HTMLAllCollection]",gM="[object HTML document.all class]",vM="[object HTMLCollection]",wM=typeof Symbol=="function"&&!!Symbol.toStringTag,bM=!(0 in[,]),Sm=function(){return!1};typeof document=="object"&&(my=document.all,Hf.call(my)===Hf.call(document.all)&&(Sm=function(e){if((bM||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var r=Hf.call(e);return(r===mM||r===gM||r===vM||r===dM)&&e("")==null}catch(i){}return!1}));var my;vy.exports=Fo?function(e){if(Sm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Fo(e,null,xm)}catch(r){if(r!==Bf)return!1}return!Em(e)&&ym(e)}:function(e){if(Sm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(wM)return ym(e);if(Em(e))return!1;var r=Hf.call(e);return r!==hM&&r!==pM&&!/^\[object HTML/.test(r)?!1:ym(e)}});var yy=U((Xj,_y)=>{"use strict";m();var _M=wy(),yM=Object.prototype.toString,by=Object.prototype.hasOwnProperty,xM=function(e,r,i){for(var n=0,s=e.length;n=3&&(n=i),kM(e)?xM(e,r,n):typeof e=="string"?EM(e,r,n):SM(e,r,n)}});var Ey=U((Jj,xy)=>{"use strict";m();xy.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var ky=U((tV,Sy)=>{"use strict";m();var km=Ey(),AM=typeof globalThis=="undefined"?global:globalThis;Sy.exports=function(){for(var e=[],r=0;r{"use strict";m();var Ay=bc(),CM=um(),Io=ko(),Cy=Ao();Ty.exports=function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new Io("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Io("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Io("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Io("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Io("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Io("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,l=!!Cy&&Cy(e,r);if(Ay)Ay(e,r,{configurable:a===null&&l?l.configurable:!a,enumerable:n===null&&l?l.enumerable:!n,value:i,writable:s===null&&l?l.writable:!s});else if(o||!n&&!s&&!a)e[r]=i;else throw new CM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Fy=U((sV,$y)=>{"use strict";m();var Am=bc(),Ry=function(){return!!Am};Ry.hasArrayLengthDefineBug=function(){if(!Am)return null;try{return Am([],"length",{value:1}).length!==1}catch(e){return!0}};$y.exports=Ry});var Ly=U((oV,Oy)=>{"use strict";m();var TM=bm(),Iy=Py(),PM=Fy()(),My=Ao(),Dy=ko(),RM=TM("%Math.floor%");Oy.exports=function(e,r){if(typeof e!="function")throw new Dy("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||RM(r)!==r)throw new Dy("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in e&&My){var a=My(e,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(s=!1)}return(n||s||!i)&&(PM?Iy(e,"length",r,!0,!0):Iy(e,"length",r)),e}});var By=U((cV,Ny)=>{"use strict";m();var $M=Co(),FM=Df(),IM=pm();Ny.exports=function(){return IM($M,FM,arguments)}});var Gy=U((fV,Uf)=>{"use strict";m();var MM=Ly(),Hy=bc(),DM=Of(),Uy=By();Uf.exports=function(e){var r=DM(arguments),i=1+e.length-(arguments.length-1);return MM(r,i>0?i:0,!0)};Hy?Hy(Uf.exports,"apply",{value:Uy}):Uf.exports.apply=Uy});var Vy=U((hV,jy)=>{"use strict";m();var OM=fm();jy.exports=function(){return OM()&&!!Symbol.toStringTag}});var Zy=U((mV,Yy)=>{"use strict";m();var Vf=yy(),LM=ky(),zy=Gy(),Tm=_m(),jf=Ao(),Gf=gm(),NM=Tm("Object.prototype.toString"),qy=Vy()(),Wy=typeof globalThis=="undefined"?global:globalThis,Cm=LM(),Pm=Tm("String.prototype.slice"),BM=Tm("Array.prototype.indexOf",!0)||function(e,r){for(var i=0;i-1}Yy.exports=function(e){if(!e||typeof e!="object")return!1;if(!qy){var r=Pm(NM(e),8,-1);return GM(r)?r:r!=="Object"?!1:UM(e)}return jf?HM(e):null}});var Xy=U((vV,Ky)=>{"use strict";m();var jM=Zy();Ky.exports=function(e){return!!jM(e)}});var Jy=U((bV,Qy)=>{"use strict";m();var VM=ko(),zM=_m(),WM=zM("TypedArray.prototype.buffer",!0),qM=Xy();Qy.exports=WM||function(e){if(!qM(e))throw new VM("Not a Typed Array");return e.buffer}});var rx=U((yV,tx)=>{"use strict";m();var Ni=$f().Buffer,YM=Qb(),ZM=Jy(),KM=ArrayBuffer.isView||function(e){try{return ZM(e),!0}catch(r){return!1}},XM=typeof Uint8Array!="undefined",ex=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined",QM=ex&&(Ni.prototype instanceof Uint8Array||Ni.TYPED_ARRAY_SUPPORT);tx.exports=function(e,r){if(Ni.isBuffer(e))return e.constructor&&!("isBuffer"in e)?Ni.from(e):e;if(typeof e=="string")return Ni.from(e,r);if(ex&&KM(e)){if(e.byteLength===0)return Ni.alloc(0);if(QM){var i=Ni.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=Ni.from(n);if(s.length===e.byteLength)return s}if(XM&&e instanceof Uint8Array)return Ni.from(e);var a=YM(e);if(a)for(var o=0;o255||~~l!==l)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||Ni.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return Ni.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var nx=U((EV,ix)=>{"use strict";m();var JM=$f().Buffer,eD=rx();function Wf(t,e){this._block=JM.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Wf.prototype.update=function(t,e){t=eD(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};Wf.prototype._update=function(){throw new Error("_update must be implemented by subclass")};ix.exports=Wf});var ox=U((kV,ax)=>{"use strict";m();var tD=Yb(),sx=nx(),rD=$f().Buffer,iD=[1518500249,1859775393,-1894007588,-899497514],nD=new Array(80);function Ec(){this.init(),this._w=nD,sx.call(this,64,56)}tD(Ec,sx);Ec.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function sD(t){return t<<1|t>>>31}function aD(t){return t<<5|t>>>27}function oD(t){return t<<30|t>>>2}function lD(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}Ec.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=sD(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=aD(r)+lD(c,i,n,s)+a+e[l]+iD[c]|0;a=s,s=n,n=oD(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Ec.prototype._hash=function(){var t=rD.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};ax.exports=Ec});var cx=U(Rm=>{m();var lx;(function(t){typeof DO_NOT_EXPORT_CRC=="undefined"?typeof Rm=="object"?t(Rm):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(lx={}):t(lx={})})(function(t){t.version="1.2.2";function e(){for(var v=0,x=new Array(256),_=0;_!=256;++_)v=_,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,x[_]=v;return typeof Int32Array!="undefined"?new Int32Array(x):x}var r=e();function i(v){var x=0,_=0,P=0,T=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)T[P]=v[P];for(P=0;P!=256;++P)for(_=v[P],x=256+P;x<4096;x+=256)_=T[x]=_>>>8^v[_&255];var M=[];for(P=1;P!=16;++P)M[P-1]=typeof Int32Array!="undefined"?T.subarray(P*256,P*256+256):T.slice(P*256,P*256+256);return M}var n=i(r),s=n[0],a=n[1],o=n[2],l=n[3],c=n[4],u=n[5],f=n[6],d=n[7],h=n[8],p=n[9],g=n[10],w=n[11],y=n[12],b=n[13],S=n[14];function C(v,x){for(var _=x^-1,P=0,T=v.length;P>>8^r[(_^v.charCodeAt(P++))&255];return~_}function A(v,x){for(var _=x^-1,P=v.length-15,T=0;T>8&255]^y[v[T++]^_>>16&255]^w[v[T++]^_>>>24]^g[v[T++]]^p[v[T++]]^h[v[T++]]^d[v[T++]]^f[v[T++]]^u[v[T++]]^c[v[T++]]^l[v[T++]]^o[v[T++]]^a[v[T++]]^s[v[T++]]^r[v[T++]];for(P+=15;T>>8^r[(_^v[T++])&255];return~_}function k(v,x){for(var _=x^-1,P=0,T=v.length,M=0,$=0;P>>8^r[(_^M)&255]:M<2048?(_=_>>>8^r[(_^(192|M>>6&31))&255],_=_>>>8^r[(_^(128|M&63))&255]):M>=55296&&M<57344?(M=(M&1023)+64,$=v.charCodeAt(P++)&1023,_=_>>>8^r[(_^(240|M>>8&7))&255],_=_>>>8^r[(_^(128|M>>2&63))&255],_=_>>>8^r[(_^(128|$>>6&15|(M&3)<<4))&255],_=_>>>8^r[(_^(128|$&63))&255]):(_=_>>>8^r[(_^(224|M>>12&15))&255],_=_>>>8^r[(_^(128|M>>6&63))&255],_=_>>>8^r[(_^(128|M&63))&255]);return~_}t.table=r,t.bstr=C,t.buf=A,t.str=k})});var Hn=U(wr=>{"use strict";m();var cD=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function uD(t,e){return Object.prototype.hasOwnProperty.call(t,e)}wr.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)uD(r,i)&&(t[i]=r[i])}}return t};wr.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var fD={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var s=0;s{"use strict";m();var hD=Hn(),pD=4,ux=0,fx=1,mD=2;function Do(t){for(var e=t.length;--e>=0;)t[e]=0}var gD=0,vx=1,vD=2,wD=3,bD=258,Lm=29,Pc=256,kc=Pc+1+Lm,Mo=30,Nm=19,wx=2*kc+1,oa=15,$m=16,_D=7,Bm=256,bx=16,_x=17,yx=18,Dm=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],qf=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],yD=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],xx=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],xD=512,Un=new Array((kc+2)*2);Do(Un);var Sc=new Array(Mo*2);Do(Sc);var Ac=new Array(xD);Do(Ac);var Cc=new Array(bD-wD+1);Do(Cc);var Hm=new Array(Lm);Do(Hm);var Yf=new Array(Mo);Do(Yf);function Fm(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var Ex,Sx,kx;function Im(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Ax(t){return t<256?Ac[t]:Ac[256+(t>>>7)]}function Tc(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function Fr(t,e,r){t.bi_valid>$m-r?(t.bi_buf|=e<>$m-t.bi_valid,t.bi_valid+=r-$m):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function ED(t){t.bi_valid===16?(Tc(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function SD(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,u,f,d,h,p,g=0;for(d=0;d<=oa;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;cl&&(d=l,g++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,h=0,u>=o&&(h=a[u-o]),p=r[u*2],t.opt_len+=p*(d+h),s&&(t.static_len+=p*(n[u*2+1]+h)));if(g!==0){do{for(d=l-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(d=l;d!==0;d--)for(u=t.bl_count[d];u!==0;)f=t.heap[--c],!(f>i)&&(r[f*2+1]!==d&&(t.opt_len+=(d-r[f*2+1])*r[f*2],r[f*2+1]=d),u--)}}function Tx(t,e,r){var i=new Array(oa+1),n=0,s,a;for(s=1;s<=oa;s++)i[s]=n=n+r[s-1]<<1;for(a=0;a<=e;a++){var o=t[a*2+1];o!==0&&(t[a*2]=Cx(i[o]++,o))}}function kD(){var t,e,r,i,n,s=new Array(oa+1);for(r=0,i=0;i>=7;i8?Tc(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function AD(t,e,r,i){Rx(t),i&&(Tc(t,r),Tc(t,~r)),hD.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function dx(t,e,r,i){var n=e*2,s=r*2;return t[n]>1;a>=1;a--)Mm(t,r,a);c=s;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Mm(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=o,r[c*2]=r[a*2]+r[o*2],t.depth[c]=(t.depth[a]>=t.depth[o]?t.depth[a]:t.depth[o])+1,r[a*2+1]=r[o*2+1]=c,t.heap[1]=c++,Mm(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],SD(t,e),Tx(r,l,t.bl_count)}function px(t,e,r){var i,n=-1,s,a=e[1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)s=a,a=e[(i+1)*2+1],!(++o=3&&t.bl_tree[xx[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function TD(t,e,r,i){var n;for(Fr(t,e-257,5),Fr(t,r-1,5),Fr(t,i-4,4),n=0;n>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return ux;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return fx;for(r=32;r0?(t.strm.data_type===mD&&(t.strm.data_type=PD(t)),Om(t,t.l_desc),Om(t,t.d_desc),a=CD(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=r+5,r+4<=n&&e!==-1?$x(t,e,r,i):t.strategy===pD||s===n?(Fr(t,(vx<<1)+(i?1:0),3),hx(t,Un,Sc)):(Fr(t,(vD<<1)+(i?1:0),3),TD(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),hx(t,t.dyn_ltree,t.dyn_dtree)),Px(t),i&&Rx(t)}function ID(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Cc[r]+Pc+1)*2]++,t.dyn_dtree[Ax(e)*2]++),t.last_lit===t.lit_bufsize-1}Oo._tr_init=RD;Oo._tr_stored_block=$x;Oo._tr_flush_block=FD;Oo._tr_tally=ID;Oo._tr_align=$D});var Um=U((IV,Ix)=>{"use strict";m();function MD(t,e,r,i){for(var n=t&65535|0,s=t>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do n=n+e[i++]|0,s=s+n|0;while(--a);n%=65521,s%=65521}return n|s<<16|0}Ix.exports=MD});var Gm=U((DV,Mx)=>{"use strict";m();function DD(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var OD=DD();function LD(t,e,r,i){var n=OD,s=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return t^-1}Mx.exports=LD});var Zf=U((LV,Dx)=>{"use strict";m();Dx.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Vx=U(hn=>{"use strict";m();var br=Hn(),mi=Fx(),Bx=Um(),ws=Gm(),ND=Zf(),fa=0,BD=1,HD=3,Es=4,Ox=5,dn=0,Lx=1,gi=-2,UD=-3,jm=-5,GD=-1,jD=1,Kf=2,VD=3,zD=4,WD=0,qD=2,td=8,YD=9,ZD=15,KD=8,XD=29,QD=256,zm=QD+1+XD,JD=30,eO=19,tO=2*zm+1,rO=15,$e=3,ys=258,Bi=ys+$e+1,iO=32,rd=42,Wm=69,Xf=73,Qf=91,Jf=103,la=113,$c=666,Ft=1,Fc=2,ca=3,Bo=4,nO=3;function xs(t,e){return t.msg=ND[e],e}function Nx(t){return(t<<1)-(t>4?9:0)}function _s(t){for(var e=t.length;--e>=0;)t[e]=0}function bs(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(br.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function Kt(t,e){mi._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,bs(t.strm)}function Oe(t,e){t.pending_buf[t.pending++]=e}function Rc(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function sO(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,br.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=Bx(t.adler,e,n,r):t.state.wrap===2&&(t.adler=ws(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function Hx(t,e){var r=t.max_chain_length,i=t.strstart,n,s,a=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-Bi?t.strstart-(t.w_size-Bi):0,c=t.window,u=t.w_mask,f=t.prev,d=t.strstart+ys,h=c[i+a-1],p=c[i+a];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do if(n=e,!(c[n+a]!==p||c[n+a-1]!==h||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&ia){if(t.match_start=e,a=s,s>=o)break;h=c[i+a-1],p=c[i+a]}}while((e=f[e&u])>l&&--r!==0);return a<=t.lookahead?a:t.lookahead}function ua(t){var e=t.w_size,r,i,n,s,a;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Bi)){br.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);s+=e}if(t.strm.avail_in===0)break;if(i=sO(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=$e)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ua(t),t.lookahead===0&&e===fa)return Ft;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,Kt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Bi&&(Kt(t,!1),t.strm.avail_out===0))return Ft}return t.insert=0,e===Es?(Kt(t,!0),t.strm.avail_out===0?ca:Bo):(t.strstart>t.block_start&&(Kt(t,!1),t.strm.avail_out===0),Ft)}function Vm(t,e){for(var r,i;;){if(t.lookahead=$e&&(t.ins_h=(t.ins_h<=$e)if(i=mi._tr_tally(t,t.strstart-t.match_start,t.match_length-$e),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=$e){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=$e&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=$e-1)),t.prev_length>=$e&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-$e,i=mi._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-$e),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<=$e&&t.strstart>0&&(n=t.strstart-1,i=a[n],i===a[++n]&&i===a[++n]&&i===a[++n])){s=t.strstart+ys;do;while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=$e?(r=mi._tr_tally(t,1,t.match_length-$e),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=mi._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Kt(t,!1),t.strm.avail_out===0))return Ft}return t.insert=0,e===Es?(Kt(t,!0),t.strm.avail_out===0?ca:Bo):t.last_lit&&(Kt(t,!1),t.strm.avail_out===0)?Ft:Fc}function lO(t,e){for(var r;;){if(t.lookahead===0&&(ua(t),t.lookahead===0)){if(e===fa)return Ft;break}if(t.match_length=0,r=mi._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Kt(t,!1),t.strm.avail_out===0))return Ft}return t.insert=0,e===Es?(Kt(t,!0),t.strm.avail_out===0?ca:Bo):t.last_lit&&(Kt(t,!1),t.strm.avail_out===0)?Ft:Fc}function fn(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var No;No=[new fn(0,0,0,0,aO),new fn(4,4,8,4,Vm),new fn(4,5,16,8,Vm),new fn(4,6,32,32,Vm),new fn(4,4,16,16,Lo),new fn(8,16,32,32,Lo),new fn(8,16,128,128,Lo),new fn(8,32,128,256,Lo),new fn(32,128,258,1024,Lo),new fn(32,258,258,4096,Lo)];function cO(t){t.window_size=2*t.w_size,_s(t.head),t.max_lazy_match=No[t.level].max_lazy,t.good_match=No[t.level].good_length,t.nice_match=No[t.level].nice_length,t.max_chain_length=No[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=$e-1,t.match_available=0,t.ins_h=0}function uO(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=td,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new br.Buf16(tO*2),this.dyn_dtree=new br.Buf16((2*JD+1)*2),this.bl_tree=new br.Buf16((2*eO+1)*2),_s(this.dyn_ltree),_s(this.dyn_dtree),_s(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new br.Buf16(rO+1),this.heap=new br.Buf16(2*zm+1),_s(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new br.Buf16(2*zm+1),_s(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ux(t){var e;return!t||!t.state?xs(t,gi):(t.total_in=t.total_out=0,t.data_type=qD,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?rd:la,t.adler=e.wrap===2?0:1,e.last_flush=fa,mi._tr_init(e),dn)}function Gx(t){var e=Ux(t);return e===dn&&cO(t.state),e}function fO(t,e){return!t||!t.state||t.state.wrap!==2?gi:(t.state.gzhead=e,dn)}function jx(t,e,r,i,n,s){if(!t)return gi;var a=1;if(e===GD&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>YD||r!==td||i<8||i>15||e<0||e>9||s<0||s>zD)return xs(t,gi);i===8&&(i=9);var o=new uO;return t.state=o,o.strm=t,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<Ox||e<0)return t?xs(t,gi):gi;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===$c&&e!==Es)return xs(t,t.avail_out===0?jm:gi);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===rd)if(i.wrap===2)t.adler=0,Oe(i,31),Oe(i,139),Oe(i,8),i.gzhead?(Oe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Oe(i,i.gzhead.time&255),Oe(i,i.gzhead.time>>8&255),Oe(i,i.gzhead.time>>16&255),Oe(i,i.gzhead.time>>24&255),Oe(i,i.level===9?2:i.strategy>=Kf||i.level<2?4:0),Oe(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Oe(i,i.gzhead.extra.length&255),Oe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=ws(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Wm):(Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,i.level===9?2:i.strategy>=Kf||i.level<2?4:0),Oe(i,nO),i.status=la);else{var a=td+(i.w_bits-8<<4)<<8,o=-1;i.strategy>=Kf||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,a|=o<<6,i.strstart!==0&&(a|=iO),a+=31-a%31,i.status=la,Rc(i,a),i.strstart!==0&&(Rc(i,t.adler>>>16),Rc(i,t.adler&65535)),t.adler=1}if(i.status===Wm)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),bs(t),n=i.pending,i.pending===i.pending_buf_size));)Oe(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Xf)}else i.status=Xf;if(i.status===Xf)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),bs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.gzindex=0,i.status=Qf)}else i.status=Qf;if(i.status===Qf)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),bs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.status=Jf)}else i.status=Jf;if(i.status===Jf&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&bs(t),i.pending+2<=i.pending_buf_size&&(Oe(i,t.adler&255),Oe(i,t.adler>>8&255),t.adler=0,i.status=la)):i.status=la),i.pending!==0){if(bs(t),t.avail_out===0)return i.last_flush=-1,dn}else if(t.avail_in===0&&Nx(e)<=Nx(r)&&e!==Es)return xs(t,jm);if(i.status===$c&&t.avail_in!==0)return xs(t,jm);if(t.avail_in!==0||i.lookahead!==0||e!==fa&&i.status!==$c){var l=i.strategy===Kf?lO(i,e):i.strategy===VD?oO(i,e):No[i.level].func(i,e);if((l===ca||l===Bo)&&(i.status=$c),l===Ft||l===ca)return t.avail_out===0&&(i.last_flush=-1),dn;if(l===Fc&&(e===BD?mi._tr_align(i):e!==Ox&&(mi._tr_stored_block(i,0,0,!1),e===HD&&(_s(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),bs(t),t.avail_out===0))return i.last_flush=-1,dn}return e!==Es?dn:i.wrap<=0?Lx:(i.wrap===2?(Oe(i,t.adler&255),Oe(i,t.adler>>8&255),Oe(i,t.adler>>16&255),Oe(i,t.adler>>24&255),Oe(i,t.total_in&255),Oe(i,t.total_in>>8&255),Oe(i,t.total_in>>16&255),Oe(i,t.total_in>>24&255)):(Rc(i,t.adler>>>16),Rc(i,t.adler&65535)),bs(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?dn:Lx)}function pO(t){var e;return!t||!t.state?gi:(e=t.state.status,e!==rd&&e!==Wm&&e!==Xf&&e!==Qf&&e!==Jf&&e!==la&&e!==$c?xs(t,gi):(t.state=null,e===la?xs(t,UD):dn))}function mO(t,e){var r=e.length,i,n,s,a,o,l,c,u;if(!t||!t.state||(i=t.state,a=i.wrap,a===2||a===1&&i.status!==rd||i.lookahead))return gi;for(a===1&&(t.adler=Bx(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(a===0&&(_s(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new br.Buf8(i.w_size),br.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),o=t.avail_in,l=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,ua(i);i.lookahead>=$e;){n=i.strstart,s=i.lookahead-($e-1);do i.ins_h=(i.ins_h<{"use strict";m();var id=Hn(),zx=!0,Wx=!0;try{String.fromCharCode.apply(null,[0])}catch(t){zx=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Wx=!1}var Ic=new id.Buf8(256);for(Gn=0;Gn<256;Gn++)Ic[Gn]=Gn>=252?6:Gn>=248?5:Gn>=240?4:Gn>=224?3:Gn>=192?2:1;var Gn;Ic[254]=Ic[254]=1;Ho.string2buf=function(t){var e,r,i,n,s,a=t.length,o=0;for(n=0;n>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function qx(t,e){if(e<65534&&(t.subarray&&Wx||!t.subarray&&zx))return String.fromCharCode.apply(null,id.shrinkBuf(t,e));for(var r="",i=0;i4){o[i++]=65533,r+=s-1;continue}for(n&=s===2?31:s===3?15:7;s>1&&r1){o[i++]=65533;continue}n<65536?o[i++]=n:(n-=65536,o[i++]=55296|n>>10&1023,o[i++]=56320|n&1023)}return qx(o,i)};Ho.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Ic[t[r]]>e?r:e}});var Ym=U((jV,Yx)=>{"use strict";m();function gO(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Yx.exports=gO});var Qx=U(Oc=>{"use strict";m();var Mc=Vx(),Dc=Hn(),Km=qm(),Xm=Zf(),vO=Ym(),Xx=Object.prototype.toString,wO=0,Zm=4,Uo=0,Zx=1,Kx=2,bO=-1,_O=0,yO=8;function da(t){if(!(this instanceof da))return new da(t);this.options=Dc.assign({level:bO,method:yO,chunkSize:16384,windowBits:15,memLevel:8,strategy:_O,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vO,this.strm.avail_out=0;var r=Mc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Uo)throw new Error(Xm[r]);if(e.header&&Mc.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=Km.string2buf(e.dictionary):Xx.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=Mc.deflateSetDictionary(this.strm,i),r!==Uo)throw new Error(Xm[r]);this._dict_set=!0}}da.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Zm:wO,typeof t=="string"?r.input=Km.string2buf(t):Xx.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Dc.Buf8(i),r.next_out=0,r.avail_out=i),n=Mc.deflate(r,s),n!==Zx&&n!==Uo)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Zm||s===Kx))&&(this.options.to==="string"?this.onData(Km.buf2binstring(Dc.shrinkBuf(r.output,r.next_out))):this.onData(Dc.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==Zx);return s===Zm?(n=Mc.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Uo):(s===Kx&&(this.onEnd(Uo),r.avail_out=0),!0)};da.prototype.onData=function(t){this.chunks.push(t)};da.prototype.onEnd=function(t){t===Uo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Dc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Qm(t,e){var r=new da(e);if(r.push(t,!0),r.err)throw r.msg||Xm[r.err];return r.result}function xO(t,e){return e=e||{},e.raw=!0,Qm(t,e)}function EO(t,e){return e=e||{},e.gzip=!0,Qm(t,e)}Oc.Deflate=da;Oc.deflate=Qm;Oc.deflateRaw=xO;Oc.gzip=EO});var e1=U((qV,Jx)=>{"use strict";m();var nd=30,SO=12;Jx.exports=function(e,r){var i,n,s,a,o,l,c,u,f,d,h,p,g,w,y,b,S,C,A,k,v,x,_,P,T;i=e.state,n=e.next_in,P=e.input,s=n+(e.avail_in-5),a=e.next_out,T=e.output,o=a-(r-e.avail_out),l=a+(e.avail_out-257),c=i.dmax,u=i.wsize,f=i.whave,d=i.wnext,h=i.window,p=i.hold,g=i.bits,w=i.lencode,y=i.distcode,b=(1<>>24,p>>>=A,g-=A,A=C>>>16&255,A===0)T[a++]=C&65535;else if(A&16){k=C&65535,A&=15,A&&(g>>=A,g-=A),g<15&&(p+=P[n++]<>>24,p>>>=A,g-=A,A=C>>>16&255,A&16){if(v=C&65535,A&=15,gc){e.msg="invalid distance too far back",i.mode=nd;break e}if(p>>>=A,g-=A,A=a-o,v>A){if(A=v-A,A>f&&i.sane){e.msg="invalid distance too far back",i.mode=nd;break e}if(x=0,_=h,d===0){if(x+=u-A,A2;)T[a++]=_[x++],T[a++]=_[x++],T[a++]=_[x++],k-=3;k&&(T[a++]=_[x++],k>1&&(T[a++]=_[x++]))}else{x=a-v;do T[a++]=T[x++],T[a++]=T[x++],T[a++]=T[x++],k-=3;while(k>2);k&&(T[a++]=T[x++],k>1&&(T[a++]=T[x++]))}}else if((A&64)===0){C=y[(C&65535)+(p&(1<>3,n-=k,g-=k<<3,p&=(1<{"use strict";m();var t1=Hn(),Go=15,r1=852,i1=592,n1=0,Jm=1,s1=2,kO=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],AO=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],CO=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],TO=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];a1.exports=function(e,r,i,n,s,a,o,l){var c=l.bits,u=0,f=0,d=0,h=0,p=0,g=0,w=0,y=0,b=0,S=0,C,A,k,v,x,_=null,P=0,T,M=new t1.Buf16(Go+1),$=new t1.Buf16(Go+1),D=null,Q=0,ye,de,J;for(u=0;u<=Go;u++)M[u]=0;for(f=0;f=1&&M[h]===0;h--);if(p>h&&(p=h),h===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d0&&(e===n1||h!==1))return-1;for($[1]=0,u=1;ur1||e===s1&&b>i1)return 1;for(;;){ye=u-w,o[f]T?(de=D[Q+o[f]],J=_[P+o[f]]):(de=96,J=0),C=1<>w)+A]=ye<<24|de<<16|J|0;while(A!==0);for(C=1<>=1;if(C!==0?(S&=C-1,S+=C):S=0,f++,--M[u]===0){if(u===h)break;u=r[i+o[f]]}if(u>p&&(S&v)!==k){for(w===0&&(w=p),x+=d,g=u-w,y=1<r1||e===s1&&b>i1)return 1;k=S&v,s[k]=p<<24|g<<16|x-a|0}}return S!==0&&(s[x+S]=u-w<<24|64<<16|0),l.bits=p,0}});var G1=U(Hi=>{"use strict";m();var Zr=Hn(),sg=Um(),pn=Gm(),PO=e1(),Lc=o1(),RO=0,I1=1,M1=2,l1=4,$O=5,sd=6,ha=0,FO=1,IO=2,vi=-2,D1=-3,ag=-4,MO=-5,c1=8,O1=1,u1=2,f1=3,d1=4,h1=5,p1=6,m1=7,g1=8,v1=9,w1=10,ld=11,jn=12,eg=13,b1=14,tg=15,_1=16,y1=17,x1=18,E1=19,ad=20,od=21,S1=22,k1=23,A1=24,C1=25,T1=26,rg=27,P1=28,R1=29,nt=30,og=31,DO=32,OO=852,LO=592,NO=15,BO=NO;function $1(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function HO(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Zr.Buf16(320),this.work=new Zr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function L1(t){var e;return!t||!t.state?vi:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=O1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Zr.Buf32(OO),e.distcode=e.distdyn=new Zr.Buf32(LO),e.sane=1,e.back=-1,ha)}function N1(t){var e;return!t||!t.state?vi:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,L1(t))}function B1(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?vi:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,N1(t))}function H1(t,e){var r,i;return t?(i=new HO,t.state=i,i.window=null,r=B1(t,e),r!==ha&&(t.state=null),r):vi}function UO(t){return H1(t,BO)}var F1=!0,ig,ng;function GO(t){if(F1){var e;for(ig=new Zr.Buf32(512),ng=new Zr.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Lc(I1,t.lens,0,288,ig,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Lc(M1,t.lens,0,32,ng,0,t.work,{bits:5}),F1=!1}t.lencode=ig,t.lenbits=9,t.distcode=ng,t.distbits=5}function U1(t,e,r,i){var n,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(Zr.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),Zr.arraySet(s.window,e,r-i,n,s.wnext),i-=n,i?(Zr.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=pn(r.check,_,2,0),c=0,u=0,r.mode=u1;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=nt;break}if((c&15)!==c1){t.msg="unknown compression method",r.mode=nt;break}if(c>>>=4,u-=4,v=(c&15)+8,r.wbits===0)r.wbits=v;else if(v>r.wbits){t.msg="invalid window size",r.mode=nt;break}r.dmax=1<>8&1),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=pn(r.check,_,2,0)),c=0,u=0,r.mode=f1;case f1:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,r.check=pn(r.check,_,4,0)),c=0,u=0,r.mode=d1;case d1:for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>8),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=pn(r.check,_,2,0)),c=0,u=0,r.mode=h1;case h1:if(r.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>>8&255,r.check=pn(r.check,_,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=p1;case p1:if(r.flags&1024&&(h=r.length,h>o&&(h=o),h&&(r.head&&(v=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Zr.arraySet(r.head.extra,i,s,h,v)),r.flags&512&&(r.check=pn(r.check,i,h,s)),o-=h,s+=h,r.length-=h),r.length))break e;r.length=0,r.mode=m1;case m1:if(r.flags&2048){if(o===0)break e;h=0;do v=i[s+h++],r.head&&v&&r.length<65536&&(r.head.name+=String.fromCharCode(v));while(v&&h>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=jn;break;case w1:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>=u&7,u-=u&7,r.mode=rg;break}for(;u<3;){if(o===0)break e;o--,c+=i[s++]<>>=1,u-=1,c&3){case 0:r.mode=b1;break;case 1:if(GO(r),r.mode=ad,e===sd){c>>>=2,u-=2;break e}break;case 2:r.mode=y1;break;case 3:t.msg="invalid block type",r.mode=nt}c>>>=2,u-=2;break;case b1:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=nt;break}if(r.length=c&65535,c=0,u=0,r.mode=tg,e===sd)break e;case tg:r.mode=_1;case _1:if(h=r.length,h){if(h>o&&(h=o),h>l&&(h=l),h===0)break e;Zr.arraySet(n,i,s,h,a),o-=h,s+=h,l-=h,a+=h,r.length-=h;break}r.mode=jn;break;case y1:for(;u<14;){if(o===0)break e;o--,c+=i[s++]<>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=nt;break}r.have=0,r.mode=x1;case x1:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[M[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},x=Lc(RO,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid code lengths set",r.mode=nt;break}r.have=0,r.mode=E1;case E1:for(;r.have>>24,b=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=i[s++]<>>=y,u-=y,r.lens[r.have++]=S;else{if(S===16){for(T=y+2;u>>=y,u-=y,r.have===0){t.msg="invalid bit length repeat",r.mode=nt;break}v=r.lens[r.have-1],h=3+(c&3),c>>>=2,u-=2}else if(S===17){for(T=y+3;u>>=y,u-=y,v=0,h=3+(c&7),c>>>=3,u-=3}else{for(T=y+7;u>>=y,u-=y,v=0,h=11+(c&127),c>>>=7,u-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=nt;break}for(;h--;)r.lens[r.have++]=v}}if(r.mode===nt)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=nt;break}if(r.lenbits=9,P={bits:r.lenbits},x=Lc(I1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid literal/lengths set",r.mode=nt;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},x=Lc(M1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,x){t.msg="invalid distances set",r.mode=nt;break}if(r.mode=ad,e===sd)break e;case ad:r.mode=od;case od:if(o>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=s,t.avail_in=o,r.hold=c,r.bits=u,PO(t,d),a=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,c=r.hold,u=r.bits,r.mode===jn&&(r.back=-1);break}for(r.back=0;w=r.lencode[c&(1<>>24,b=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=i[s++]<>C)],y=w>>>24,b=w>>>16&255,S=w&65535,!(C+y<=u);){if(o===0)break e;o--,c+=i[s++]<>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,r.length=S,b===0){r.mode=T1;break}if(b&32){r.back=-1,r.mode=jn;break}if(b&64){t.msg="invalid literal/length code",r.mode=nt;break}r.extra=b&15,r.mode=S1;case S1:if(r.extra){for(T=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=k1;case k1:for(;w=r.distcode[c&(1<>>24,b=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=i[s++]<>C)],y=w>>>24,b=w>>>16&255,S=w&65535,!(C+y<=u);){if(o===0)break e;o--,c+=i[s++]<>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,b&64){t.msg="invalid distance code",r.mode=nt;break}r.offset=S,r.extra=b&15,r.mode=A1;case A1:if(r.extra){for(T=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=nt;break}r.mode=C1;case C1:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=nt;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),g=r.window}else g=n,p=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do n[a++]=g[p++];while(--h);r.length===0&&(r.mode=od);break;case T1:if(l===0)break e;n[a++]=r.length,l--,r.mode=od;break;case rg:if(r.wrap){for(;u<32;){if(o===0)break e;o--,c|=i[s++]<{"use strict";m();j1.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var z1=U((tz,V1)=>{"use strict";m();function qO(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}V1.exports=qO});var q1=U(Bc=>{"use strict";m();var jo=G1(),Nc=Hn(),cd=qm(),bt=lg(),cg=Zf(),YO=Ym(),ZO=z1(),W1=Object.prototype.toString;function pa(t){if(!(this instanceof pa))return new pa(t);this.options=Nc.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new YO,this.strm.avail_out=0;var r=jo.inflateInit2(this.strm,e.windowBits);if(r!==bt.Z_OK)throw new Error(cg[r]);if(this.header=new ZO,jo.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=cd.string2buf(e.dictionary):W1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=jo.inflateSetDictionary(this.strm,e.dictionary),r!==bt.Z_OK)))throw new Error(cg[r])}pa.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,s,a,o,l,c,u=!1;if(this.ended)return!1;a=e===~~e?e:e===!0?bt.Z_FINISH:bt.Z_NO_FLUSH,typeof t=="string"?r.input=cd.binstring2buf(t):W1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Nc.Buf8(i),r.next_out=0,r.avail_out=i),s=jo.inflate(r,bt.Z_NO_FLUSH),s===bt.Z_NEED_DICT&&n&&(s=jo.inflateSetDictionary(this.strm,n)),s===bt.Z_BUF_ERROR&&u===!0&&(s=bt.Z_OK,u=!1),s!==bt.Z_STREAM_END&&s!==bt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===bt.Z_STREAM_END||r.avail_in===0&&(a===bt.Z_FINISH||a===bt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=cd.utf8border(r.output,r.next_out),l=r.next_out-o,c=cd.buf2string(r.output,o),r.next_out=l,r.avail_out=i-l,l&&Nc.arraySet(r.output,r.output,o,l,0),this.onData(c)):this.onData(Nc.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==bt.Z_STREAM_END);return s===bt.Z_STREAM_END&&(a=bt.Z_FINISH),a===bt.Z_FINISH?(s=jo.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===bt.Z_OK):(a===bt.Z_SYNC_FLUSH&&(this.onEnd(bt.Z_OK),r.avail_out=0),!0)};pa.prototype.onData=function(t){this.chunks.push(t)};pa.prototype.onEnd=function(t){t===bt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Nc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ug(t,e){var r=new pa(e);if(r.push(t,!0),r.err)throw r.msg||cg[r.err];return r.result}function KO(t,e){return e=e||{},e.raw=!0,ug(t,e)}Bc.Inflate=pa;Bc.inflate=ug;Bc.inflateRaw=KO;Bc.ungzip=ug});var K1=U((sz,Z1)=>{"use strict";m();var XO=Hn().assign,QO=Qx(),JO=q1(),eL=lg(),Y1={};XO(Y1,QO,JO,eL);Z1.exports=Y1});var J1=U((oz,Q1)=>{"use strict";m();var X1=(t,e)=>function(...r){let i=e.promiseModule;return new i((n,s)=>{e.multiArgs?r.push((...a)=>{e.errorFirst?a[0]?s(a):(a.shift(),n(a)):n(a)}):e.errorFirst?r.push((a,o)=>{a?s(a):n(o)}):r.push(n),t.apply(this,r)})};Q1.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=s=>{let a=o=>typeof o=="string"?s===o:o.test(s);return e.include?e.include.some(a):!e.exclude.some(a)},n;r==="function"?n=function(...s){return e.excludeMain?t(...s):X1(t,e).apply(this,s)}:n=Object.create(Object.getPrototypeOf(t));for(let s in t){let a=t[s];n[s]=typeof a=="function"&&i(s)?X1(a,e):a}return n}});var lE=U((cz,oE)=>{m();function eE(t){return Array.isArray(t)?t:[t]}var hg="",tE=" ",fg="\\",tL=/^\s+$/,rL=/(?:[^\\]|^)\\$/,iL=/^\\!/,nL=/^\\#/,sL=/\r?\n/g,aL=/^\.*\/|^\.+$/,dg="/",nE="node-ignore";typeof Symbol!="undefined"&&(nE=Symbol.for("node-ignore"));var rE=nE,oL=(t,e,r)=>Object.defineProperty(t,e,{value:r}),lL=/([0-z])-([0-z])/g,sE=()=>!1,cL=t=>t.replace(lL,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:hg),uL=t=>{let{length:e}=t;return t.slice(0,e-e%2)},fL=[[/^\uFEFF/,()=>hg],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?tE:hg)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+tE}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>fg],[/\\\\/g,()=>fg],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===fg?`\\[${r}${uL(i)}${n}`:n==="]"&&i.length%2===0?`[${cL(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],iE=Object.create(null),dL=(t,e)=>{let r=iE[t];return r||(r=fL.reduce((i,[n,s])=>i.replace(n,s.bind(t)),t),iE[t]=r),e?new RegExp(r,"i"):new RegExp(r)},gg=t=>typeof t=="string",hL=t=>t&&gg(t)&&!tL.test(t)&&!rL.test(t)&&t.indexOf("#")!==0,pL=t=>t.split(sL),pg=class{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}},mL=(t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(iL,"!").replace(nL,"#");let n=dL(t,e);return new pg(r,t,i,n)},gL=(t,e)=>{throw new e(t)},Vn=(t,e,r)=>gg(t)?t?Vn.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),aE=t=>aL.test(t);Vn.isNotRelative=aE;Vn.convert=t=>t;var mg=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){oL(this,rE,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[rE]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(hL(e)){let r=mL(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,eE(gg(e)?pL(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(s=>{let{negative:a}=s;if(n===a&&i!==n||a&&!i&&!n&&!r)return;s.regex.test(e)&&(i=!a,n=a)}),{ignored:i,unignored:n}}_test(e,r,i,n){let s=e&&Vn.convert(e);return Vn(s,e,this._allowRelativePaths?sE:gL),this._t(s,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(dg)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let s=this._t(n.join(dg)+dg,r,i,n);return r[e]=s.ignored?s:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return eE(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},ud=t=>new mg(t),vL=t=>Vn(t&&Vn.convert(t),t,sE);ud.isPathValid=vL;ud.default=ud;oE.exports=ud;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Vn.convert=t;let e=/^[a-z]:\//i;Vn.isNotRelative=r=>e.test(r)||aE(r)}});var uE=U((fz,cE)=>{"use strict";m();function wL(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mn(t,e,r){return e=e instanceof RegExp?e:new RegExp(wL(e),"g"),t.replace(e,r)}var bL={clean:function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=mn(e,"./","/"),e=mn(e,"..","."),e=mn(e," ","-"),e=mn(e,/^[~^:?*\\\-]/g,""),e=mn(e,/[~^:?*\\]/g,"-"),e=mn(e,/[~^:?*\\\-]$/g,""),e=mn(e,"@{","-"),e=mn(e,/\.$/g,""),e=mn(e,/\/$/g,""),e=mn(e,/\.lock$/g,""),e}};cE.exports=bL});var dE=U((hz,fE)=>{m();fE.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=null,l=n+1,c=[],u=[],f=[],d="",h=-1,p=0,g=1,w,y,b=function(){n>=s&&(w=r,y=n,r=i,i=w,n=s,s=y,a=!0,l=n+1)},S=function(v,x,_){return{x:v,y:x,k:_}},C=function(v,x){return{elem:v,t:x}},A=function(v,x,_){var P,T,M;for(x>_?P=c[v-1+l]:P=c[v+1+l],M=Math.max(x,_),T=M-v;T=0;--M)for(;PT-P?(a?f[f.length]=new C(i[T],h):f[f.length]=new C(i[T],g),++_,++T):v[M].y-v[M].x=v+1;--D)_[D+l]=A(D,_[D-1+l]+1,_[D+1+l]);_[v+l]=A(v,_[v-1+l]+1,_[v+1+l])}while(_[v+l]!==s);for(o=v+2*P,T=c[v+l],M=[];T!==-1;)M[M.length]=new S(u[T].x,u[T].y,null),T=u[T].k;k(M)}}}});var mE=U((mz,pE)=>{m();var _L=dE();function yL(t,e){var r=new _L(t,e);r.compose();for(var i=r.getses(),n,s,a=t.length-1,o=e.length-1,l=i.length-1;l>=0;--l)i[l].t===r.SES_COMMON?(s?(s.chain={file1index:a,file2index:o,chain:null},s=s.chain):(n={file1index:a,file2index:o,chain:null},s=n),a--,o--):i[l].t===r.SES_DELETE?a--:i[l].t===r.SES_ADD&&o--;var c={file1index:-1,file2index:-1,chain:null};return s?(s.chain=c,n):c}function hE(t,e){for(var r=[],i=t.length,n=e.length,s=yL(t,e);s!==null;s=s.chain){var a=i-s.file1index-1,o=n-s.file2index-1;i=s.file1index,n=s.file2index,(a||o)&&r.push({file1:[i+1,a],file2:[n+1,o]})}return r.reverse(),r}function xL(t,e,r){var i,n=hE(e,t),s=hE(e,r),a=[];function o($,D){a.push([$.file1[0],D,$.file1[1],$.file2[0],$.file2[1]])}for(i=0;ic&&(l.push([1,c,$-c]),c=$)}for(var f=0;fg)break;g=Math.max(g,y+w[2]),f++}if(u(p),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var S=h[1],C=b[S],A=h[0],k=A+h[2],v=h[3],x=v+h[4];C[0]=Math.min(v,C[0]),C[1]=Math.max(x,C[1]),C[2]=Math.min(A,C[2]),C[3]=Math.max(k,C[3])}var _=b[0][0]+(p-b[0][2]),P=b[0][1]+(g-b[0][3]),T=b[2][0]+(p-b[2][2]),M=b[2][1]+(g-b[2][3]);l.push([-1,_,P-_,p,g-p,T,M-T])}c=g}return u(e.length),l}function EL(t,e,r){var i=[],n=[t,e,r],s=xL(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var p=0;p{"use strict";m();Object.defineProperty(Z,"__esModule",{value:!0});function Fs(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Uc=Fs(qb()),BE=Fs(ox()),SL=Fs(cx()),Ug=Fs(K1()),fd=Fs(J1()),kL=Fs(lE()),Gc=Fs(uE()),AL=Fs(mE()),Pe=class t extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new t(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}},jc=class t extends Pe{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=t.code,this.data={filepaths:e}}};jc.code="UnmergedPathsError";var me=class t extends Pe{constructor(e){super(`An internal error caused this command to fail. + +If you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment. + +Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=t.code,this.data={message:e}}};me.code="InternalError";var zo=class t extends Pe{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=t.code,this.data={filepath:e}}};zo.code="UnsafeFilepathError";var wi=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};function Sd(t,e){return-(te)}function HE(t,e){return Sd(t.path,e.path)}function UE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}var gn=2**32;function gE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),s=(r-n*1e3)*1e6;return[n,s]}function Wo(t){let[e,r]=gE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=gE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%gn,ctimeNanoseconds:r%gn,mtimeSeconds:i%gn,mtimeNanoseconds:n%gn,dev:t.dev%gn,ino:t.ino%gn,mode:UE(t.mode%gn),uid:t.uid%gn,gid:t.gid%gn,size:t.size>-1?t.size%gn:0}}function CL(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}var vg=null;async function wn(t){return vg===null&&(vg=await PL()),vg?GE(t):TL(t)}function TL(t){return new BE().update(t).digest("hex")}async function GE(t){let e=await crypto.subtle.digest("SHA-1",t);return CL(e)}async function PL(){try{return await GE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(t){}return!1}function RL(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function $L(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(E.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}var Pg=class t{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(E.isBuffer(e))return t.fromBuffer(e);if(e===null)return new t(null);throw new me("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new me("Index file is empty (.git/index)");let r=new t,i=new wi(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new me(`Invalid dircache magic file number: ${n}`);let s=await wn(e.slice(0,-20)),a=e.slice(-20).toString("hex");if(a!==s)throw new me(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${s}`);let o=i.readUInt32BE();if(o!==2)throw new me(`Unsupported dircache version: ${o}`);let l=i.readUInt32BE(),c=0;for(;!i.eof()&&ce.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=Wo(r);let s=E.from(e),a={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:s.length<4095?s.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(` +`)}static async _entryToBuffer(e){let r=E.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=E.alloc(i),s=new wi(n),a=Wo(e);return s.writeUInt32BE(a.ctimeSeconds),s.writeUInt32BE(a.ctimeNanoseconds),s.writeUInt32BE(a.mtimeSeconds),s.writeUInt32BE(a.mtimeNanoseconds),s.writeUInt32BE(a.dev),s.writeUInt32BE(a.ino),s.writeUInt32BE(a.mode),s.writeUInt32BE(a.uid),s.writeUInt32BE(a.gid),s.writeUInt32BE(a.size),s.write(e.oid,20,"hex"),s.writeUInt16BE($L(e)),s.write(e.path,r.length,"utf8"),n}async toObject(){let e=E.alloc(12),r=new wi(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let o of this.entries)if(i.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&i.push(t._entryToBuffer(l));i=await Promise.all(i);let n=E.concat(i),s=E.concat([e,n]),a=await wn(s);return E.concat([s,E.from(a,"hex")])}};function pd(t,e,r=!0,i=!0){let n=Wo(t),s=Wo(e);return r&&n.mode!==s.mode||n.mtimeSeconds!==s.mtimeSeconds||n.ctimeSeconds!==s.ctimeSeconds||n.uid!==s.uid||n.gid!==s.gid||i&&n.ino!==s.ino||n.size!==s.size}var wg=null,bg=Symbol("IndexCache");function FL(){return{map:new Map,stats:new Map}}async function IL(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),s=await Pg.from(n);r.map.set(e,s),r.stats.set(e,i)}async function ML(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:pd(i,n)}var dt=class{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},s){i[bg]||(i[bg]=FL());let a=`${r}/index`;wg===null&&(wg=new Uc({maxPending:1/0}));let o,l=[];return await wg.acquire(a,async()=>{let c=i[bg];await ML(e,a,c)&&await IL(e,a,c);let u=c.map.get(a);if(l=u.unmergedPaths,l.length&&!n)throw new jc(l);if(o=await s(u),u._dirty){let f=await u.toObject();await e.write(a,f),c.stats.set(a,await e.lstat(a)),u._dirty=!1}}),o}};function md(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function va(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function jE(t){let e=new Map,r=function(n){if(!e.has(n)){let s={type:"tree",fullpath:n,basename:md(n),metadata:{},children:[]};e.set(n,s),s.parent=r(va(n)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(n)},i=function(n,s){if(!e.has(n)){let a={type:"blob",fullpath:n,basename:md(n),metadata:s,parent:r(va(n)),children:[]};a.parent&&a.parent.children.push(a),e.set(n,a)}return e.get(n)};r(".");for(let n of t)i(n.path,n);return e}function DL(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new me(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var Rg=class{constructor({fs:e,gitdir:r,cache:i}){this.treePromise=dt.acquire({fs:e,gitdir:r,cache:i},async function(s){return jE(s.entries)});let n=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let s=n.children.map(a=>a.fullpath);return s.sort(Sd),s}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:Wo(i.metadata);e._type=i.type==="tree"?"tree":DL(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}},kd=Symbol("GitWalkSymbol");function Ea(){let t=Object.create(null);return Object.defineProperty(t,kd,{value:function({fs:e,gitdir:r,cache:i}){return new Rg({fs:e,gitdir:r,cache:i})}}),Object.freeze(t),t}var Ge=class t extends Pe{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};Ge.code="NotFoundError";var _r=class t extends Pe{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};_r.code="ObjectTypeError";var As=class t extends Pe{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};As.code="InvalidOidError";var Vc=class t extends Pe{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following: +[remote "${e}"] + fetch = +refs/heads/*:refs/remotes/origin/* +`),this.code=this.name=t.code,this.data={remote:e}}};Vc.code="NoRefspecError";var gd=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(` +`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let s=i.slice(1);return this.refs.set(r+"^{}",s),{line:i,ref:r,peeled:s}}else{let s=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,s),{line:i,ref:r,oid:s}}})}return this}static from(e){return new t(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(` +`)+` +`}},vd=class t{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,s,a]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=n==="*";if(l!==(a==="*"))throw new me("Invalid refspec");return new t({remotePath:i,localPath:s,force:o,matchPrefix:l})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}},$g=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(vd.from(i));return new t(r)}add(e){let r=vd.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let s=i.translate(n);s&&r.push([n,s])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function OL(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(ri);return n===0?t.endsWith("^{}")?1:-1:n}function LL(t,e){let r="",i=0,n=-1,s=0,a="\0";for(let o=0;o<=t.length;++o){if(o2){let l=r.lastIndexOf("/");l===-1?(r="",i=0):(r=r.slice(0,l),i=r.length-1-r.lastIndexOf("/")),n=o,s=0;continue}else if(r.length!==0){r="",i=0,n=o,s=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,o):r=t.slice(n+1,o),i=o-n-1;n=o,s=0}else a==="."&&s!==-1?++s:s=-1}return r}function NL(t){if(!t.length)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=LL(t,!e),t.length?(r&&(t+="/"),e?`/${t}`:t):e?"/":r?"./":"."}function H(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":NL(e)}var BL=t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},Hc=t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},vE={core:{filemode:Hc,bare:Hc,logallrefupdates:Hc,symlinks:Hc,ignorecase:Hc,bigFileThreshold:BL}},HL=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,UL=/^[A-Za-z0-9-.]+$/,GL=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,jL=/^[A-Za-z][A-Za-z-]*$/,VL=/^(.*?)( *[#;].*)$/,zL=t=>{let e=HL.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},WL=t=>{let e=GL.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=qL(i),s=YL(n);return[r,s]}return null},qL=t=>{let e=VL.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return wE(r)&&wE(i)?`${r}${i}`:r},wE=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,YL=t=>t.split("").reduce((e,r,i,n)=>{let s=r==='"'&&n[i-1]!=="\\",a=r==="\\"&&n[i+1]==='"';return s||a?e:e+r},""),bE=t=>t!=null?t.toLowerCase():null,Fg=(t,e,r)=>[bE(t),e,bE(r)].filter(i=>i!=null).join("."),_E=t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:Fg(r,n,i),sectionPath:Fg(r,n,null),isSection:!!r}},ZL=(t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),Ig=class t{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(` +`).map(n=>{let s=null,a=null,o=n.trim(),l=zL(o),c=l!=null;if(c)[r,i]=l;else{let f=WL(o);f!=null&&([s,a]=f)}let u=Fg(r,i,s);return{line:n,isSection:c,section:r,subsection:i,name:s,value:a,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let i=_E(e).path,n=this.parsedConfig.filter(s=>s.path===i).map(({section:s,name:a,value:o})=>{let l=vE[s]&&vE[s][a];return l?l(o):o});return r?n:n.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:s,name:a,path:o,sectionPath:l,isSection:c}=_E(e),u=ZL(this.parsedConfig,f=>f.path===o);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let f=this.parsedConfig[u],d=Object.assign({},f,{name:a,value:r,modified:!0});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:n,subsection:s,name:a,value:r,modified:!0,path:o};if(UL.test(n)&&jL.test(a))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:n,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:s,modified:a=!1})=>a?n!=null&&s!=null?typeof s=="string"&&/[#;]/.test(s)?` ${n} = "${s}"`:` ${n} = ${s}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(` +`)}},ht=class{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return Ig.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}},dd=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],KL=["config","description","index","shallow","commondir"],_g;async function Ss(t,e){return _g===void 0&&(_g=new Uc),_g.acquire(t,e)}var q=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:s,tags:a,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let w of n.values())if(!w.match(/[0-9a-f]{40}/))throw new As(w);let u=await ht.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${i}.fetch`),o.length===0)throw new Vc(i);o.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let f=$g.from(o),d=new Map;if(c){let w=await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:r,refs:w.map(y=>`refs/tags/${y}`)})}if(a){for(let w of n.keys())if(w.startsWith("refs/tags")&&!w.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:w})){let y=n.get(w);d.set(w,y)}}let h=f.translate([...n.keys()]);for(let[w,y]of h){let b=n.get(w);d.set(y,b)}let p=f.translate([...s.keys()]);for(let[w,y]of p){let b=s.get(w),S=f.translateOne(b);S&&d.set(y,`ref: ${S}`)}let g=[];if(l){for(let w of f.localNamespaces()){let y=(await t.listRefs({fs:e,gitdir:r,filepath:w})).map(b=>`${w}/${b}`);for(let b of y)d.has(b)||g.push(b)}g.length>0&&await t.deleteRefs({fs:e,gitdir:r,refs:g})}for(let[w,y]of d)await Ss(w,async()=>e.write(H(r,w),`${y.trim()} +`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new As(n);await Ss(i,async()=>e.write(H(r,i),`${n.trim()} +`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await Ss(i,async()=>e.write(H(r,i),`ref: ${n.trim()} +`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return t.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(o=>e.rm(H(r,o))));let n=await Ss("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),s=gd.from(n),a=s.refs.size;for(let o of i)s.refs.has(o)&&s.delete(o);s.refs.sizee.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),t.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let s=await t.packedRefs({fs:e,gitdir:r}),a=dd(i).filter(o=>!KL.includes(o));for(let o of a){let l=await Ss(o,async()=>await e.read(`${r}/${o}`,{encoding:"utf8"})||s.get(o));if(l)return t.resolve({fs:e,gitdir:r,ref:l.trim(),depth:n})}throw new Ge(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await t.expand({fs:e,gitdir:r,ref:i}),!0}catch(n){return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await t.packedRefs({fs:e,gitdir:r}),s=dd(i);for(let a of s)if(await Ss(a,async()=>e.exists(`${r}/${a}`))||n.has(a))return a;throw new Ge(i)}static async expandAgainstMap({ref:e,map:r}){let i=dd(e);for(let n of i)if(await r.has(n))return n;throw new Ge(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let s=dd(e);for(let a of s){let o=n.get(a);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:a,depth:i,map:n})}throw new Ge(e)}static async packedRefs({fs:e,gitdir:r}){let i=await Ss("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return gd.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=t.packedRefs({fs:e,gitdir:r}),s=null;try{s=await e.readdirDeep(`${r}/${i}`),s=s.map(a=>a.replace(`${r}/${i}/`,""))}catch(a){s=[]}for(let a of(await n).keys())a.startsWith(i)&&(a=a.replace(i+"/",""),s.includes(a)||s.push(a));return s.sort(OL),s}static async listBranches({fs:e,gitdir:r,remote:i}){return i?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):t.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(n=>!n.endsWith("^{}"))}};function XL(t,e){return Sd(yE(t),yE(e))}function yE(t){return t.mode==="040000"?t.path+"/":t.path}function VE(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new me(`Unexpected GitTree entry mode: ${t}`)}function QL(t){let e=[],r=0;for(;r`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(` +`)}toObject(){let e=[...this._entries];return e.sort(XL),E.concat(e.map(r=>{let i=E.from(r.mode.replace(/^0/,"")),n=E.from(" "),s=E.from(r.path,"utf8"),a=E.from([0]),o=E.from(r.oid,"hex");return E.concat([i,n,s,a,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},Cs=class{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,s=n+r.length,a=new Uint8Array(s);for(let o=0;o>=1,n+=8;return i}function SE(t,e){let r=t.readUInt8(),i=128,n=15,s=112;if(r&i){let a=EE(t,r&n,4),o=EE(t,(r&s)>>4,3);return o===0&&(o=65536),e.slice(a,a+o)}else return t.slice(r)}function rN(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function WE(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:rN(t)}var wd=class{constructor(e){if(typeof E=="undefined")throw new Error("Missing Buffer dependency");this.stream=WE(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?E.alloc(0):(r&&(r=E.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>iN(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=E.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function iN(t){return t.reduce((e,r)=>e+r.length,0)}async function nN(t,e){let r=new wd(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new me(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new me(`Invalid packfile version: ${n}`);let s=await r.read(4);if(s=s.readUInt32BE(0),!(s<1))for(;!r.eof()&&s--;){let a=r.tell(),{type:o,length:l,ofs:c,reference:u}=await sN(r),f=new Ug.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new me(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new me("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-f.strm.avail_in);let h=r.tell();await e({data:f.result,type:o,num:s,offset:a,end:h,reference:u,ofs:c})}}}}async function sN(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let a=4;do e=await t.byte(),i|=(e&127)<n+1<<7|s,-1)}function cN(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<2048*1024*1024)throw new me("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+1020);let a=i.readUInt32BE(),o=[];for(let u=0;u{u===null&&(u=C);let A=Math.floor((u-C)*100/u);A!==f&&i&&await i({phase:"Receiving objects",loaded:u-C,total:u}),f=A,y=n[y],["commit","tree","blob","tag"].includes(y)?s[S]={type:y,offset:S}:y==="ofs-delta"?s[S]={type:y,offset:S}:y==="ref-delta"&&(s[S]={type:y,offset:S})});let d=Object.keys(s).map(Number);for(let[w,y]of d.entries()){let b=w+1===d.length?e.byteLength-20:d[w+1],S=s[y],C=SL.buf(e.slice(y,b))>>>0;S.end=b,S.crc=C}let h=new t({pack:Promise.resolve(e),packfileSha:a,crcs:l,hashes:o,offsets:c,getExternalRefDelta:r});f=null;let p=0,g=[0,0,0,0,0,0,0,0,0,0,0,0];for(let w in s){w=Number(w);let y=Math.floor(p*100/u);y!==f&&i&&await i({phase:"Resolving deltas",loaded:p,total:u}),p++,f=y;let b=s[w];if(!b.oid)try{h.readDepth=0,h.externalReadDepth=0;let{type:S,object:C}=await h.readSlice({start:w});g[h.readDepth]+=1;let A=await wn(Cs.wrap({type:S,object:C}));b.oid=A,o.push(A),c.set(A,w),l[A]=b.crc}catch(S){continue}}return o.sort(),h}async toBuffer(){let e=[],r=(c,u)=>{e.push(E.from(c,u))};r("ff744f63","hex"),r("00000002","hex");let i=new wi(E.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let f of this.hashes)parseInt(f.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new wi(E.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let s=new wi(E.alloc(this.hashes.length*4));for(let c of this.hashes)s.writeUInt32BE(this.offsets.get(c));e.push(s.buffer),r(this.packfileSha,"hex");let a=E.concat(e),o=await wn(a),l=E.alloc(20);return l.write(o,"hex"),E.concat([a,l])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new me(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"},i=await this.pack;if(!i)throw new me("Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.");let n=i.slice(e),s=new wi(n),a=s.readUInt8(),o=a&112,l=r[o];if(l===void 0)throw new me("Unrecognized type: 0b"+o.toString(2));let c=a&15,u=c;a&128&&(u=cN(s,c));let d=null,h=null;if(l==="ofs_delta"){let g=lN(s),w=e-g;({object:d,type:l}=await this.readSlice({start:w}))}if(l==="ref_delta"){let g=s.slice(20).toString("hex");({object:d,type:l}=await this.read({oid:g}))}let p=n.slice(s.tell());if(h=E.from(await qE(p)),h.byteLength!==u)throw new me(`Packfile told us object would have length ${u} but it had length ${h.byteLength}`);return d&&(h=E.from(tN(h,d))),this.readDepth>3&&(this.offsetCache[e]={type:l,object:h}),{type:l,format:"content",object:h}}},hd=Symbol("PackfileCache");async function uN({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let s=await t.read(e);return zc.fromIdx({idx:s,getExternalRefDelta:r})}function Gg({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}){e[hd]||(e[hd]=new Map);let a=e[hd].get(r);return a||(a=uN({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}),e[hd].set(r,a)),a}async function fN({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:s}){let a=await t.readdir(H(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await Gg({fs:t,cache:e,filename:l,getExternalRefDelta:s});if(c.error)throw new me(c.error);if(c.offsets.has(i)){let u=l.replace(/idx$/,"pack");c.pack||(c.pack=t.read(u));let f=await c.pack;if(!f)throw c.pack=null,new me(`Could not read packfile at ${u}. The file may be missing, corrupted, or too large to read into memory.`);if(!c._checksumVerified){let h=c.packfileSha,p=f.subarray(-20),g=Array.from(p).map(b=>b.toString(16).padStart(2,"0")).join("");if(g!==h)throw new me(`Packfile trailer mismatch: expected ${h}, got ${g}. The packfile may be corrupted.`);let w=f.subarray(0,-20),y=await wn(w);if(y!==h)throw new me(`Packfile payload corrupted: calculated ${y} but expected ${h}. The packfile may have been tampered with.`);c._checksumVerified=!0}let d=await c.read({oid:i,getExternalRefDelta:s});return d.format="content",d.source=`objects/pack/${o.replace(/idx$/,"pack")}`,d}}return null}async function et({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=u=>et({fs:t,cache:e,gitdir:r,oid:u}),a;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(a={format:"wrapped",object:E.from("tree 0\0")}),a||(a=await zE({fs:t,gitdir:r,oid:i})),!a){if(a=await fN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s}),!a)throw new Ge(i);return a}if(n==="deflated"||(a.format==="deflated"&&(a.object=E.from(await qE(a.object)),a.format="wrapped"),n==="wrapped"))return a;let o=await wn(a.object);if(o!==i)throw new me(`SHA check failed! Expected ${i}, computed ${o}`);let{object:l,type:c}=Cs.unwrap(a.object);if(a.type=c,a.object=l,a.format="content",n==="content")return a;throw new me(`invalid requested format "${n}"`)}var Ui=class t extends Pe{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=t.code,this.data={noun:e,where:r,canForce:i}}};Ui.code="AlreadyExistsError";var Wc=class t extends Pe{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=t.code,this.data={nouns:e,short:r,matches:i}}};Wc.code="AmbiguousError";var qc=class t extends Pe{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=t.code,this.data={filepaths:e}}};qc.code="CheckoutConflictError";var Yc=class t extends Pe{constructor(e,r){super(`Cannot cherry-pick merge commit ${e}. Merge commits have ${r} parents and require specifying which parent to use as the base.`),this.code=this.name=t.code,this.data={oid:e,parentCount:r}}};Yc.code="CherryPickMergeCommitError";var Zc=class t extends Pe{constructor(e){super(`Cannot cherry-pick root commit ${e}. Root commits have no parents.`),this.code=this.name=t.code,this.data={oid:e}}};Zc.code="CherryPickRootCommitError";var Kc=class t extends Pe{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=t.code,this.data={ref:e,oid:r}}};Kc.code="CommitNotFetchedError";var Xc=class t extends Pe{constructor(){super("Empty response from git server."),this.code=this.name=t.code,this.data={}}};Xc.code="EmptyServerResponseError";var Qc=class t extends Pe{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=t.code,this.data={}}};Qc.code="FastForwardError";var Jc=class t extends Pe{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=t.code,this.data={prettyDetails:e,result:r}}};Jc.code="GitPushError";var qo=class t extends Pe{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=t.code,this.data={statusCode:e,statusMessage:r,response:i}}};qo.code="HttpError";var Ts=class t extends Pe{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=t.code,this.data={reason:e}}};Ts.code="InvalidFilepathError";var Gi=class t extends Pe{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=t.code,this.data={ref:e,suggestion:r}}};Gi.code="InvalidRefNameError";var eu=class t extends Pe{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=t.code,this.data={depth:e}}};eu.code="MaxDepthError";var Yo=class t extends Pe{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=t.code,this.data={}}};Yo.code="MergeNotSupportedError";var wa=class t extends Pe{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=t.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};wa.code="MergeConflictError";var Xt=class t extends Pe{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=t.code,this.data={role:e}}};Xt.code="MissingNameError";var Ir=class t extends Pe{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=t.code,this.data={parameter:e}}};Ir.code="MissingParameterError";var tu=class t extends Pe{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=t.code,this.data={errors:e},this.errors=e}};tu.code="MultipleGitError";var ba=class t extends Pe{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=t.code,this.data={expected:e,actual:r}}};ba.code="ParseError";var Zo=class t extends Pe{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=t.code,this.data={reason:e}}};Zo.code="PushRejectedError";var ks=class t extends Pe{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=t.code,this.data={capability:e,parameter:r}}};ks.code="RemoteCapabilityError";var ru=class t extends Pe{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=t.code,this.data={preview:e,response:r}}};ru.code="SmartHttpError";var iu=class t extends Pe{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=t.code,this.data={url:e,transport:r,suggestion:i}}};iu.code="UnknownTransportError";var nu=class t extends Pe{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=t.code,this.data={url:e}}};nu.code="UrlParseError";var Ko=class t extends Pe{constructor(){super("The operation was canceled."),this.code=this.name=t.code,this.data={}}};Ko.code="UserCanceledError";var su=class t extends Pe{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=t.code,this.data={filepath:e}}};su.code="IndexResetError";var au=class t extends Pe{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=t.code,this.data={ref:e}}};au.code="NoCommitError";var YE=Object.freeze({__proto__:null,AlreadyExistsError:Ui,AmbiguousError:Wc,CheckoutConflictError:qc,CherryPickMergeCommitError:Yc,CherryPickRootCommitError:Zc,CommitNotFetchedError:Kc,EmptyServerResponseError:Xc,FastForwardError:Qc,GitPushError:Jc,HttpError:qo,InternalError:me,InvalidFilepathError:Ts,InvalidOidError:As,InvalidRefNameError:Gi,MaxDepthError:eu,MergeNotSupportedError:Yo,MergeConflictError:wa,MissingNameError:Xt,MissingParameterError:Ir,MultipleGitError:tu,NoRefspecError:Vc,NotFoundError:Ge,ObjectTypeError:_r,ParseError:ba,PushRejectedError:Zo,RemoteCapabilityError:ks,SmartHttpError:ru,UnknownTransportError:iu,UnsafeFilepathError:zo,UrlParseError:nu,UserCanceledError:Ko,UnmergedPathsError:jc,IndexResetError:su,NoCommitError:au});function Mg({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=dN(i),`${t} <${e}> ${r} ${i}`}function dN(t){let e=hN(pN(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}function hN(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}function pN(t){return t===0?t:-t}function zn(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+` +`,t}function bd(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:mN(n)}}function mN(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),gN(i)}function gN(t){return t===0?t:-t}var Xr=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(E.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new me("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new t(e)}static render(e){return`object ${e.object} +type ${e.type} +tag ${e.tag} +tagger ${Mg(e.tagger)} + +${e.message} +${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(` + +`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(` + +`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(` +`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.tagger&&(i.tagger=bd(i.tagger)),i.committer&&(i.committer=bd(i.committer)),i}withoutSignature(){let e=zn(this._tag);return e.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(` +-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return zn(e)}payload(){return this.withoutSignature()+` +`}toObject(){return E.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:s}=await r({payload:n,secretKey:i});s=zn(s);let a=n+s;return t.from(a)}};function xg(t){return t.trim().split(` +`).map(e=>" "+e).join(` +`)+` +`}function vN(t){return t.split(` +`).map(e=>e.replace(/^ /,"")).join(` +`)}var Dr=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(E.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new me("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let i=t.justHeaders(e),n=t.justMessage(e),s=zn(i+` +gpgsig`+xg(r)+` +`+n);return new t(s)}static from(e){return new t(e)}toObject(){return E.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return t.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return zn(e.slice(e.indexOf(` + +`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(` + +`))}parseHeaders(){let e=t.justHeaders(this._commit).split(` +`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.author&&(i.author=bd(i.author)),i.committer&&(i.committer=bd(i.committer)),i}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree} +`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +`,e.parent){if(e.parent.length===void 0)throw new me("commit 'parent' property should be an array");for(let s of e.parent)r+=`parent ${s} +`}let i=e.author;r+=`author ${Mg(i)} +`;let n=e.committer||e.author;return r+=`committer ${Mg(n)} +`,e.gpgsig&&(r+="gpgsig"+xg(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+` +`+zn(e.message)}render(){return this._commit}withoutSignature(){let e=zn(this._commit);if(e.indexOf(` +gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(` +gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE----- +`)+28);return zn(r+` +`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return vN(e)}static async sign(e,r,i){let n=e.withoutSignature(),s=t.justMessage(e._commit),{signature:a}=await r({payload:n,secretKey:i});a=zn(a);let l=t.justHeaders(e._commit)+` +gpgsig`+xg(a)+` +`+s;return t.from(l)}};async function Xo({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Mr.from([]),oid:i};let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Xr.from(s).parse().object,Xo({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=Dr.from(s).parse().tree,Xo({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new _r(i,n,"tree");return{tree:Mr.from(s),oid:i}}var Dg=class{constructor({fs:e,gitdir:r,ref:i,cache:n}){this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let a=new Map,o;try{o=await q.resolve({fs:e,gitdir:r,ref:i})}catch(c){c instanceof Ge&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Xo({fs:e,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",a.set(".",l),a})();let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,cache:n,gitdir:s}=this,a=await this.mapPromise,o=a.get(r);if(!o)throw new Error(`No obj for ${r}`);let l=o.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!=="tree")return null;let{type:c,object:u}=await et({fs:i,cache:n,gitdir:s,oid:l});if(c!==o.type)throw new _r(l,c,o.type);let f=Mr.from(u);for(let d of f)a.set(H(r,d.path),d);return f.entries().map(d=>H(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=UE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:s}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await et({fs:i,cache:n,gitdir:s,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};function Kr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,kd,{value:function({fs:r,gitdir:i,cache:n}){return new Dg({fs:r,gitdir:i,ref:t,cache:n})}}),Object.freeze(e),e}var Og=class{constructor({fs:e,dir:r,gitdir:i,cache:n}){this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,this.config=null;let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,dir:n}=this,s=await i.readdir(H(n,r));return s===null?null:s.map(a=>H(r,a))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=n.isDirectory()?"tree":"blob";s==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(s="special"),e._type=s,n=Wo(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await r.readlink(`${i}/${e._fullpath}`);else{let o=await(await this._getGitConfig(r,n)).get("core.autocrlf");s=await r.read(`${i}/${e._fullpath}`,{autocrlf:o})}e._actualSize=s.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(s)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:i,gitdir:n,cache:s}=this,a;await dt.acquire({fs:i,gitdir:n,cache:s},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||pd(c,l,f,d)){let h=await e.content();h===void 0?a=void 0:(a=await wn(Cs.wrap({type:"blob",object:h})),l&&a===l.oid&&(!f||c.mode===l.mode)&&pd(c,l,f,d)&&o.insert({filepath:e._fullpath,stats:c,oid:a}))}else a=l.oid}),e._oid=a}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await ht.get({fs:e,gitdir:r}),this.config)}};function tl(){let t=Object.create(null);return Object.defineProperty(t,kd,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new Og({fs:e,dir:r,gitdir:i,cache:n})}}),Object.freeze(t),t}function wN(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}var ZE=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),Lg=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:ec,reduce:a=async(l,c)=>{let u=ZE(c);return l!==void 0&&u.unshift(l),u},iterate:o=(l,c)=>Promise.all([...c].map(l))}){let l=n.map(h=>h[kd]({fs:t,dir:r,gitdir:i,cache:e})),c=new Array(l.length).fill("."),u=wN(0,l.length),f=async h=>{u.forEach(w=>{let y=h[w];h[w]=y&&new l[w].ConstructEntry(y)});let g=(await Promise.all(u.map(w=>{let y=h[w];return y?l[w].readdir(y):[]}))).map(w=>(w===null?[]:w)[Symbol.iterator]());return{entries:h,children:bN(g)}},d=async h=>{let{entries:p,children:g}=await f(h),w=p.find(b=>b&&b._fullpath)._fullpath,y=await s(w,p);if(y!==null){let b=await o(d,g);return b=b.filter(S=>S!==void 0),a(y,b)}};return d(c)}async function Ng(t,e){let r=await t.readdir(e);r==null?await t.rm(e):r.length?await Promise.all(r.map(i=>{let n=H(e,i);return t.lstat(n).then(s=>{if(s)return s.isDirectory()?Ng(t,n):t.rm(n)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}function _N(t){return yN(t)&&kE(t.then)&&kE(t.catch)}function yN(t){return t&&typeof t=="object"}function kE(t){return typeof t=="function"}function AE(t){return _N((r=>{try{return r.readFile().catch(i=>i)}catch(i){return i}})(t))}var CE=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function TE(t,e){if(AE(e))for(let r of CE)t[`_${r}`]=e[r].bind(e);else for(let r of CE)t[`_${r}`]=fd(e[r].bind(e));AE(e)?(e.cp&&(t._cp=e.cp.bind(e)),e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=Ng.bind(null,t)):(e.cp&&(t._cp=fd(e.cp.bind(e))),e.rm?t._rm=fd(e.rm.bind(e)):e.rmdir.length>2?t._rm=fd(e.rmdir.bind(e)):t._rm=Ng.bind(null,t))}var te=class{constructor(e){if(typeof e._original_unwrapped_fs!="undefined")return e;let r=Object.getOwnPropertyDescriptor(e,"promises");r&&r.enumerable?TE(this,e.promises):TE(this,e),this._original_unwrapped_fs=e}async exists(e,r={}){try{return await this._stat(e),!0}catch(i){if(i.code==="ENOENT"||i.code==="ENOTDIR"||(i.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',i),i}}async read(e,r={}){try{let i=await this._readFile(e,r);if(r.autocrlf==="true")try{i=new TextDecoder("utf8",{fatal:!0}).decode(i),i=i.replace(/\r\n/g,` +`),i=new TextEncoder().encode(i)}catch(n){}return typeof i!="string"&&(i=E.from(i)),i}catch(i){return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i)}catch(n){await this.mkdir(va(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e)}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=va(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Sd),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let s=e+"/"+n;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((n,s)=>n.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return E.isBuffer(i)?i:E.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function R(t,e){if(e===void 0)throw new Ir(t)}function xN(t){return t.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(t)}async function ie({fsp:t,dotgit:e}){R("fsp",t),R("dotgit",e);let r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(i=>i.trimRight().substr(8)).then(i=>xN(i)?i:H(va(e),i)):e}async function _d(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}async function KE({fs:t,dir:e,gitdir:r=H(e,".git"),commit:i="HEAD",cache:n={}}){try{R("fs",t),R("dir",e),R("gitdir",r);let s=new te(t),a=[Kr({ref:i}),tl(),Ea()],o=[],l=await ie({fsp:s,dotgit:r});await dt.acquire({fs:s,gitdir:l,cache:n},async function(u){o=u.unmergedPaths});let c=await Ps({fs:s,cache:n,dir:e,gitdir:l,trees:a,map:async function(u,[f,d,h]){let p=!await _d(d,h),g=o.includes(u),w=!await _d(h,f);if(p||g)return f?{path:u,mode:await f.mode(),oid:await f.oid(),type:await f.type(),content:await f.content()}:void 0;if(w)return!1;throw new su(u)}});await dt.acquire({fs:s,gitdir:l,cache:n},async function(u){for(let f of c)if(f!==!1){if(!f){await s.rmdir(`${e}/${f.path}`,{recursive:!0}),u.delete({filepath:f.path});continue}if(f.type==="blob"){let d=new TextDecoder().decode(f.content);await s.write(`${e}/${f.path}`,d,{mode:f.mode}),u.insert({filepath:f.path,oid:f.oid,stage:0})}}})}catch(s){throw s.caller="git.abortMerge",s}}var Rs=class{static async isIgnored({fs:e,dir:r,gitdir:i=H(r,".git"),filepath:n}){if(md(n)===".git")return!0;if(n===".")return!1;let s="",a=H(i,"info","exclude");await e.exists(a)&&(s=await e.read(a,"utf8"));let o=[{gitignore:H(r,".gitignore"),filepath:n}],l=n.split("/").filter(Boolean);for(let u=1;u{let f=await(await ht.get({fs:o,gitdir:l})).get("core.autocrlf");return Bg({dir:e,gitdir:l,fs:o,filepath:i,index:c,force:s,parallel:a,autocrlf:f})})}catch(o){throw o.caller="git.add",o}}async function Bg({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:s,parallel:a,autocrlf:o}){i=Array.isArray(i)?i:[i];let l=i.map(async d=>{if(!s&&await Rs.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let h=await r.lstat(H(t,d));if(!h)throw new Ge(d);if(h.isDirectory()){let p=await r.readdir(H(t,d));if(a){let g=p.map(w=>Bg({dir:t,gitdir:e,fs:r,filepath:[H(d,w)],index:n,force:s,parallel:a,autocrlf:o}));await Promise.all(g)}else for(let g of p)await Bg({dir:t,gitdir:e,fs:r,filepath:[H(d,g)],index:n,force:s,parallel:a,autocrlf:o})}else{let p=h.isSymbolicLink()?await r.readlink(H(t,d)).then(QE):await r.read(H(t,d),{autocrlf:o});if(p===null)throw new Ge(d);let g=await Or({fs:r,gitdir:e,type:"blob",object:p});n.insert({filepath:d,stats:h,oid:g})}}),c=await Promise.allSettled(l),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new tu(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function ou({fs:t,gitdir:e,path:r}){return(await ht.get({fs:t,gitdir:e})).get(r)}function eS(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}async function $s({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),s={name:await ou({fs:t,gitdir:e,path:"user.name"}),email:await ou({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},a=eS({},s,i?i.author:void 0,r);if(a.name!==void 0)return a}async function _a({fs:t,gitdir:e,author:r,committer:i,commit:n}){let s=Math.floor(Date.now()/1e3),a={name:await ou({fs:t,gitdir:e,path:"user.name"}),email:await ou({fs:t,gitdir:e,path:"user.email"})||"",timestamp:s,timezoneOffset:new Date(s*1e3).getTimezoneOffset()},o=eS({},a,n?n.committer:void 0,r,i);if(o.name!==void 0)return o}async function tS({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Xr.from(s).parse().object,tS({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new _r(i,n,"commit");return{commit:Dr.from(s),oid:i}}async function vn({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:s}=await tS({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,commit:n.parse(),payload:n.withoutSignature()}}async function cu({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h}){let p=!1,g=!1;f||(g=!(await t.read(`${i}/HEAD`,{encoding:"utf8"})).startsWith("ref:"),f=await q.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let w,y;try{w=await q.resolve({fs:t,gitdir:i,ref:f}),y=await vn({fs:t,gitdir:i,oid:w,cache:{}})}catch(C){p=!0}if(l&&p)throw new au(f);let b=l?await $s({fs:t,gitdir:i,author:s,commit:y.commit}):await $s({fs:t,gitdir:i,author:s});if(!b)throw new Xt("author");let S=l?await _a({fs:t,gitdir:i,author:b,committer:a,commit:y.commit}):await _a({fs:t,gitdir:i,author:b,committer:a});if(!S)throw new Xt("committer");return dt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(C){let k=jE(C.entries).get(".");if(h||(h=await rS({fs:t,gitdir:i,inode:k,dryRun:c})),d?d=await Promise.all(d.map(_=>q.resolve({fs:t,gitdir:i,ref:_}))):l?d=y.commit.parent:d=w?[w]:[],!n)if(l)n=y.commit.message;else throw new Ir("message");let v=Dr.from({tree:h,parent:d,author:b,committer:S,message:n});o&&(v=await Dr.sign(v,r,o));let x=await Or({fs:t,gitdir:i,type:"commit",object:v.toObject(),dryRun:c});return!u&&!c&&await q.writeRef({fs:t,gitdir:i,ref:g?"HEAD":f,value:x}),x})}async function rS({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let l of n)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await rS({fs:t,gitdir:e,inode:l,dryRun:i}));let s=n.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),a=Mr.from(s);return await Or({fs:t,gitdir:e,type:"tree",object:a.toObject(),dryRun:i})}async function uu({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Ts("leading-slash");if(n.endsWith("/"))throw new Ts("trailing-slash");let s=i,a=await Xo({fs:t,cache:e,gitdir:r,oid:i}),o=a.tree;if(n==="")i=a.oid;else{let l=n.split("/");i=await iS({fs:t,cache:e,gitdir:r,tree:o,pathArray:l,oid:s,filepath:n})}return i}async function iS({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a}){let o=n.shift();for(let l of i)if(l.path===o){if(n.length===0)return l.oid;{let{type:c,object:u}=await et({fs:t,cache:e,gitdir:r,oid:l.oid});if(c!=="tree")throw new _r(s,c,"tree",a);return i=Mr.from(u),iS({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a})}}throw new Ge(`file or directory found at "${s}:${a}"`)}async function rl({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await uu({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:s,oid:a}=await Xo({fs:t,cache:e,gitdir:r,oid:i});return{oid:a,tree:s.entries()}}async function fu({fs:t,gitdir:e,tree:r}){let i=Mr.from(r).toObject();return await Or({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}async function AN({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:s,note:a,force:o,author:l,committer:c,signingKey:u}){let f;try{f=await q.resolve({gitdir:i,fs:t,ref:n})}catch(y){if(!(y instanceof Ge))throw y}let h=(await rl({fs:t,cache:e,gitdir:i,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(o)h=h.filter(y=>y.path!==s);else for(let y of h)if(y.path===s)throw new Ui("note",s);typeof a=="string"&&(a=E.from(a,"utf8"));let p=await Or({fs:t,gitdir:i,type:"blob",object:a,format:"content"});h.push({mode:"100644",path:s,oid:p,type:"blob"});let g=await fu({fs:t,gitdir:i,tree:h});return await cu({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:g,parent:f&&[f],message:`Note added by 'isomorphic-git addNote' +`,author:l,committer:c,signingKey:u})}async function nS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n="refs/notes/commits",oid:s,note:a,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{R("fs",t),R("gitdir",i),R("oid",s),R("note",a),u&&R("onSign",e);let d=new te(t),h=await $s({fs:d,gitdir:i,author:l});if(!h)throw new Xt("author");let p=await _a({fs:d,gitdir:i,author:h,committer:c});if(!p)throw new Xt("committer");let g=await ie({fsp:d,dotgit:i});return await AN({fs:d,cache:f,onSign:e,gitdir:g,ref:n,oid:s,note:a,force:o,author:h,committer:p,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}var CN=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function lu(t,e){if(typeof t!="string")throw new TypeError("Reference name must be a string");return!CN.test(t)&&(!!e||t.includes("/"))}async function sS({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let s=await ht.get({fs:t,gitdir:e});if(!n&&(await s.getSubsections("remote")).includes(r)&&i!==await s.get(`remote.${r}.url`))throw new Ui("remote",r);await s.set(`remote.${r}.url`,i),await s.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await ht.save({fs:t,gitdir:e,config:s})}async function aS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i,url:n,force:s=!1}){try{R("fs",t),R("gitdir",r),R("remote",i),R("url",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await sS({fs:a,gitdir:o,remote:i,url:n,force:s})}catch(a){throw a.caller="git.addRemote",a}}async function TN({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await q.exists({fs:t,gitdir:i,ref:n}))throw new Ui("tag",n);let f=await q.resolve({fs:t,gitdir:i,ref:l||"HEAD"}),{type:d}=await et({fs:t,cache:e,gitdir:i,oid:f}),h=Xr.from({object:f,type:d,tag:n.replace("refs/tags/",""),tagger:s,message:a,gpgsig:o});c&&(h=await Xr.sign(h,r,c));let p=await Or({fs:t,gitdir:i,type:"tag",object:h.toObject()});await q.writeRef({fs:t,gitdir:i,ref:n,value:p})}async function oS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{R("fs",t),R("gitdir",i),R("ref",n),c&&R("onSign",e);let d=new te(t),h=await ie({fsp:d,dotgit:i}),p=await $s({fs:d,gitdir:h,author:s});if(!p)throw new Xt("tagger");return await TN({fs:d,cache:f,onSign:e,gitdir:h,ref:n,tagger:p,message:a,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function PN({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:s=!1}){if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let a=`refs/heads/${r}`;if(!s&&await q.exists({fs:t,gitdir:e,ref:a}))throw new Ui("branch",r,!1);let o;try{o=await q.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(l){}o&&await q.writeRef({fs:t,gitdir:e,ref:a,value:o}),n&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function lS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,object:n,checkout:s=!1,force:a=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let o=new te(t),l=await ie({fsp:o,dotgit:r});return await PN({fs:o,gitdir:l,ref:i,object:n,checkout:s,force:a})}catch(o){throw o.caller="git.branch",o}}var cS=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function jg({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:s,remote:a,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,nonBlocking:p=!1,batchSize:g=100}){let w;if(i)try{w=await q.resolve({fs:t,gitdir:s,ref:"HEAD"})}catch(b){w="0000000000000000000000000000000000000000"}let y;try{y=await q.resolve({fs:t,gitdir:s,ref:o})}catch(b){if(o==="HEAD")throw b;let S=`${a}/${o}`;if(y=await q.resolve({fs:t,gitdir:s,ref:S}),h){let C=await ht.get({fs:t,gitdir:s});await C.set(`branch.${o}.remote`,a),await C.set(`branch.${o}.merge`,`refs/heads/${o}`),await ht.save({fs:t,gitdir:s,config:C})}await q.writeRef({fs:t,gitdir:s,ref:`refs/heads/${o}`,value:y})}if(!c){let b;try{b=await RN({fs:t,cache:e,onProgress:r,dir:n,gitdir:s,ref:o,force:d,filepaths:l})}catch(v){throw v instanceof Ge&&v.data.what===y?new Kc(o,y):v}let S=b.filter(([v])=>v==="conflict").map(([v,x])=>x);if(S.length>0)throw new qc(S);let C=b.filter(([v])=>v==="error").map(([v,x])=>x);if(C.length>0)throw new me(C.join(", "));if(f){i&&await i({previousHead:w,newHead:y,type:l!=null&&l.length>0?"file":"branch"});return}let A=0,k=b.length;if(await dt.acquire({fs:t,gitdir:s,cache:e},async function(v){await Promise.all(b.filter(([x])=>x==="delete"||x==="delete-index").map(async function([x,_]){let P=`${n}/${_}`;x==="delete"&&await t.rm(P),v.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}))}),await dt.acquire({fs:t,gitdir:s,cache:e},async function(v){for(let[x,_]of b)if(x==="rmdir"||x==="rmdir-index"){let P=`${n}/${_}`;try{x==="rmdir"&&await t.rmdir(P),v.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}catch(T){if(T.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw T}}}),await Promise.all(b.filter(([v])=>v==="mkdir"||v==="mkdir-index").map(async function([v,x]){let _=`${n}/${x}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++A,total:k})})),p){let v=b.filter(([_])=>_==="create"||_==="create-index"||_==="update"||_==="mkdir-index"),x=await PE("Update Working Dir",v.map(([_,P,T,M,$])=>()=>FN({fs:t,cache:e,gitdir:s,dir:n},[_,P,T,M,$])),r,g);await dt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(_){await PE("Update Index",x.map(([P,T,M])=>()=>$N({index:_,fullpath:P,oid:T,stats:M})),r,g)})}else await dt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(v){await Promise.all(b.filter(([x])=>x==="create"||x==="create-index"||x==="update"||x==="mkdir-index").map(async function([x,_,P,T,M]){let $=`${n}/${_}`;try{if(x!=="create-index"&&x!=="mkdir-index"){let{object:Q}=await et({fs:t,cache:e,gitdir:s,oid:P});if(M&&await t.rm($),T===33188)await t.write($,Q);else if(T===33261)await t.write($,Q,{mode:511});else if(T===40960)await t.writelink($,Q);else throw new me(`Invalid mode 0o${T.toString(8)} detected in blob ${P}`)}let D=await t.lstat($);T===33261&&(D.mode=493),x==="mkdir-index"&&(D.mode=57344),v.insert({filepath:_,stats:D,oid:P}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}catch(D){console.log(D)}}))});i&&await i({previousHead:w,newHead:y,type:l!=null&&l.length>0?"file":"branch"})}if(!u){let b=await q.expand({fs:t,gitdir:s,ref:o});b.startsWith("refs/heads")?await q.writeSymbolicRef({fs:t,gitdir:s,ref:"HEAD",value:b}):await q.writeRef({fs:t,gitdir:s,ref:"HEAD",value:y})}}async function RN({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:s,force:a,filepaths:o}){let l=0;return Ps({fs:t,cache:e,dir:i,gitdir:n,trees:[Kr({ref:s}),tl(),Ea()],map:async function(c,[u,f,d]){if(c===".")return;if(o&&!o.some(p=>cS(c,p)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++l}),[!!d,!!u,!!f].map(Number).join("")){case"000":return;case"001":return a&&o&&o.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await f.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await f.oid()?a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]:await u.mode()!==await f.mode()?a?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await f.oid()?a?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!a)return;if(f){if(await f.oid()!==await d.oid()&&await f.oid()!==await u.oid())return a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]}else if(a)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=ZE(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function $N({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}async function FN({fs:t,cache:e,gitdir:r,dir:i},[n,s,a,o,l]){let c=`${i}/${s}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:f}=await et({fs:t,cache:e,gitdir:r,oid:a});if(l&&await t.rm(c),o===33188)await t.write(c,f);else if(o===33261)await t.write(c,f,{mode:511});else if(o===40960)await t.writelink(c,f);else throw new me(`Invalid mode 0o${o.toString(8)} detected in blob ${a}`)}let u=await t.lstat(c);return o===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[s,a,u]}async function PE(t,e,r,i){let n=[];try{for(let s=0;sl());(await Promise.allSettled(a)).forEach(l=>{l.status==="fulfilled"&&n.push(l.value)}),r&&await r({phase:"Updating workdir",loaded:s+a.length,total:e.length})}return n}catch(s){console.error(`Error during ${t}: ${s}`)}return n}async function Vg({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=H(i,".git"),remote:s="origin",ref:a,filepaths:o,noCheckout:l=!1,noUpdateHead:c=a===void 0,dryRun:u=!1,force:f=!1,track:d=!0,cache:h={},nonBlocking:p=!1,batchSize:g=100}){try{R("fs",t),R("dir",i),R("gitdir",n);let w=a||"HEAD",y=new te(t),b=await ie({fsp:y,dotgit:n});return await jg({fs:y,cache:h,onProgress:e,onPostCheckout:r,dir:i,gitdir:b,remote:s,ref:w,filepaths:o,noCheckout:l,noUpdateHead:c,dryRun:u,force:f,track:d,nonBlocking:p,batchSize:g})}catch(w){throw w.caller="git.checkout",w}}var Sg=/^.*(\r?\n|$)/gm;function IN({branches:t,contents:e}){let r=t[1],i=t[2],n=e[0],s=e[1],a=e[2],o=s.match(Sg),l=n.match(Sg),c=a.match(Sg),u=AL(o,l,c),f=7,d="",h=!0;for(let p of u)p.ok&&(d+=p.ok.join("")),p.conflict&&(h=!1,d+=`${"<".repeat(f)} ${r} +`,d+=p.conflict.a.join(""),d+=`${"=".repeat(f)} +`,d+=p.conflict.b.join(""),d+=`${">".repeat(f)} ${i} +`);return{cleanMerge:h,mergedText:d}}async function uS({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),index:n,ourOid:s,baseOid:a,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let p=Kr({ref:s}),g=Kr({ref:a}),w=Kr({ref:o}),y=[],b=[],S=[],C=[],A=await Ps({fs:t,cache:e,dir:r,gitdir:i,trees:[p,g,w],map:async function(k,[v,x,_]){let P=md(k),T=await _d(v,x),M=await _d(_,x);switch(`${T}-${M}`){case"false-false":return{mode:await x.mode(),path:P,oid:await x.oid(),type:await x.type()};case"false-true":return!_&&await v.type()==="tree"?{mode:await v.mode(),path:P,oid:await v.oid(),type:await v.type()}:_?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!v&&await _.type()==="tree"?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:v?{mode:await v.mode(),path:P,oid:await v.oid(),type:await v.type()}:void 0;case"true-true":{if(v&&_&&await v.type()==="tree"&&await _.type()==="tree")return{mode:await v.mode(),path:P,oid:await v.oid(),type:"tree"};if(v&&_&&await v.type()==="blob"&&await _.type()==="blob")return MN({fs:t,gitdir:i,path:P,ours:v,base:x,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async $=>{if($.cleanMerge)d||n.insert({filepath:k,oid:$.mergeResult.oid,stage:0});else if(y.push(k),b.push(k),!d){let D="";x&&await x.type()==="blob"&&(D=await x.oid());let Q=await v.oid(),ye=await _.oid();n.delete({filepath:k}),D&&n.insert({filepath:k,oid:D,stage:1}),n.insert({filepath:k,oid:Q,stage:2}),n.insert({filepath:k,oid:ye,stage:3})}return $.mergeResult});if(x&&!v&&_&&await x.type()==="blob"&&await _.type()==="blob"){if(y.push(k),S.push(k),!d){let $=await x.oid(),D=await _.oid();n.delete({filepath:k}),n.insert({filepath:k,oid:$,stage:1}),n.insert({filepath:k,oid:D,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:P}}if(x&&v&&!_&&await x.type()==="blob"&&await v.type()==="blob"){if(y.push(k),C.push(k),!d){let $=await x.oid(),D=await v.oid();n.delete({filepath:k}),n.insert({filepath:k,oid:$,stage:1}),n.insert({filepath:k,oid:D,stage:2})}return{mode:await v.mode(),oid:await v.oid(),type:"blob",path:P}}if(x&&!v&&!_&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new Yo}}},reduce:y.length!==0&&(!r||d)?void 0:async(k,v)=>{let x=v.filter(Boolean);if(k&&!(k&&k.type==="tree"&&x.length===0&&k.path!==".")){if(x.length>0||k.path==="."&&x.length===0){let P=new Mr(x).toObject(),T=await Or({fs:t,gitdir:i,type:"tree",object:P,dryRun:f});k.oid=T}return k}}});return y.length!==0?(r&&!d&&await Ps({fs:t,cache:e,dir:r,gitdir:i,trees:[Kr({ref:A.oid})],map:async function(k,[v]){let x=`${r}/${k}`;if(await v.type()==="blob"){let _=await v.mode(),P=new TextDecoder().decode(await v.content());await t.write(x,P,{mode:_})}return!0}}),new wa(y,b,S,C)):A.oid}async function MN({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:s,ourName:a,theirName:o,baseName:l,dryRun:c,mergeDriver:u=IN}){let f="blob",d="100755",h="",p="";n&&await n.type()==="blob"&&(d=await n.mode(),h=await n.oid(),p=E.from(await n.content()).toString("utf8"));let g=d===await i.mode()?await s.mode():await i.mode();if(await i.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};if(await i.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await s.oid(),type:f}};if(await s.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};let w=E.from(await i.content()).toString("utf8"),y=E.from(await s.content()).toString("utf8"),{mergedText:b,cleanMerge:S}=await u({branches:[l,a,o],contents:[p,w,y],path:r}),C=await Or({fs:t,gitdir:e,type:"blob",object:E.from(b,"utf8"),dryRun:c});return{cleanMerge:S,mergeResult:{mode:g,path:r,oid:C,type:f}}}var DN={stage:Ea,workdir:tl},kg;async function Qo(t,e){return kg===void 0&&(kg=new Uc),kg.acquire(t,e)}async function ON(t,e,r,i,n=null){let s=H(r,i),a=await t.lstat(s);if(!a)throw new Ge(s);if(a.isDirectory())throw new me(`${s}: file expected, but found directory`);let o=n?await zE({fs:t,gitdir:e,oid:n}):void 0,l=o?n:void 0;return o||await Qo({fs:t,gitdir:e,currentFilepath:s},async()=>{let c=a.isSymbolicLink()?await t.readlink(s).then(QE):await t.read(s);if(c===null)throw new Ge(s);l=await Or({fs:t,gitdir:e,type:"blob",object:c})}),l}async function LN({fs:t,dir:e,gitdir:r,entries:i}){async function n(s){if(s.type==="tree"){if(!s.oid){let a=await Promise.all(s.children.map(n));s.oid=await fu({fs:t,gitdir:r,tree:a}),s.mode=16384}}else s.type==="blob"&&(s.oid=await ON(t,r,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(i.map(n))}async function RE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",s=i.map(h=>typeof h=="string"?DN[h]():h),a=[],u=await Ps({fs:t,cache:{},dir:e,gitdir:r,trees:s,map:async(h,[p,g])=>{if(!(h==="."||await Rs.isIgnored({fs:t,dir:e,gitdir:r,filepath:h}))&&g)return(!p||await p.oid()!==await g.oid()&&await g.oid()!==void 0)&&a.push([p,g]),{mode:await g.mode(),path:h,oid:await g.oid(),type:await g.type()}},reduce:async(h,p)=>(p=p.filter(Boolean),h?(h.children=p,h):p.length>0?p:void 0),iterate:async(h,p)=>{let g=[];for(let w of p){let[y,b]=w;n?b&&(await t.exists(`${e}/${b.toString()}`)?g.push(w):a.push([null,b])):y&&(b?g.push(w):a.push([y,null]))}return g.length?Promise.all(g.map(h)):[]}});if(a.length===0||u.length===0)return null;let d=(await LN({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return fu({fs:t,gitdir:r,tree:d})}async function fS({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:s}){let a=[],o=[],l=await Ps({fs:t,cache:{},dir:e,gitdir:r,trees:[Kr({ref:n}),Kr({ref:i})],map:async(c,[u,f])=>{if(c==="."||await Rs.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=f?await f.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!f&&u){let p=d==="tree"?"rmdir":"rm";return d==="tree"&&a.push(c),d==="blob"&&s&&o.push({filepath:c,oid:await u.oid()}),{method:p,filepath:c}}let h=await f.oid();if(!u||await u.oid()!==h)return d==="tree"?{method:"mkdir",filepath:c}:(s&&o.push({filepath:c,oid:h,stats:await t.lstat(H(e,c))}),{method:"write",filepath:c,oid:h})}});await Qo({fs:t,gitdir:r,dirRemoved:a,ops:l},async()=>{for(let c of l){let u=H(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!a.some(f=>u.startsWith(f))){let{object:f}=await et({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,f)}break}}}),await dt.acquire({fs:t,gitdir:r,cache:{}},async c=>{o.forEach(({filepath:u,stats:f,oid:d})=>{c.insert({filepath:u,stats:f,oid:d})})})}async function $E({fs:t,cache:e,dir:r,gitdir:i,oid:n,dryRun:s=!1,noUpdateBranch:a=!1,abortOnConflict:o=!0,committer:l,mergeDriver:c}){let{commit:u,oid:f}=await vn({fs:t,cache:e,gitdir:i,oid:n});if(u.parent.length>1)throw new Yc(f,u.parent.length);if(u.parent.length===0)throw new Zc(f);let d=await q.resolve({fs:t,gitdir:i,ref:"HEAD"}),{commit:h}=await vn({fs:t,cache:e,gitdir:i,oid:d}),p=u.parent[0],{commit:g}=await vn({fs:t,cache:e,gitdir:i,oid:p}),w=await dt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async b=>uS({fs:t,cache:e,dir:r,gitdir:i,index:b,ourOid:h.tree,baseOid:g.tree,theirOid:u.tree,ourName:"HEAD",baseName:`parent of ${f.slice(0,7)}`,theirName:f.slice(0,7),dryRun:s,abortOnConflict:o,mergeDriver:c}));if(w instanceof wa)throw w;let y=await cu({fs:t,cache:e,gitdir:i,message:u.message,tree:w,parent:[d],author:u.author,committer:l,dryRun:s,noUpdateBranch:a});return r&&!s&&!a&&await fS({fs:t,dir:r,gitdir:i,stashCommit:y,parentCommit:d,wasStaged:!0}),y}async function dS({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={},committer:s,dryRun:a=!1,noUpdateBranch:o=!1,abortOnConflict:l=!0,mergeDriver:c}){try{R("fs",t),R("gitdir",r),R("oid",i);let u=new te(t),f=await ie({fsp:u,dotgit:r}),{commit:d}=await vn({fs:u,cache:n,gitdir:f,oid:i});if(d.parent&&d.parent.length>1)return await $E({fs:u,cache:n,dir:e,gitdir:f,oid:i,dryRun:a,noUpdateBranch:o,abortOnConflict:l,committer:void 0,mergeDriver:c});let h=await _a({fs:u,gitdir:f,committer:s});if(!h)throw new Xt("committer");return await $E({fs:u,cache:n,dir:e,gitdir:f,oid:i,dryRun:a,noUpdateBranch:o,abortOnConflict:l,committer:h,mergeDriver:c})}catch(u){throw u.caller="git.cherryPick",u}}var NN=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function ga(t){let e=NN.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}async function Is({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await q.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await q.resolve({fs:t,gitdir:e,ref:n})}catch(s){return}if(n.startsWith("refs/"))return r?n:ga(n)}function BN(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}function hS({username:t="",password:e=""}){return`Basic ${E.from(`${t}:${e}`).toString("base64")}`}async function du(t,e){let r=WE(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}async function yd(t){let e=0,r=[];await du(t,s=>{r.push(s),e+=s.byteLength});let i=new Uint8Array(e),n=0;for(let s of r)i.set(s,n),n+=s.byteLength;return i}function FE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}function Hg(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}var lt=class{static flush(){return E.from("0000","utf8")}static delim(){return E.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=E.from(e));let r=e.length+4,i=Hg(4,r);return E.concat([E.from(i,"utf8"),e])}static streamReader(e){let r=new wd(e);return async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let s=await r.read(n-4);return s==null?!0:s}catch(n){return e.error=n,!0}}}};async function IE(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),s=r.slice(i+1);e[n]=s}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}async function ME(t,{service:e}){let r=new Set,i=new Map,n=new Map,s=lt.streamReader(t),a=await s();for(;a===null;)a=await s();if(a===!0)throw new Xc;if(a.includes("version 2"))return IE(s);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new ba(`# service=${e}\\n`,a.toString("utf8"));let o=await s();for(;o===null;)o=await s();if(o===!0)return{capabilities:r,refs:i,symrefs:n};if(o=o.toString("utf8"),o.includes("version 2"))return IE(s);let[l,c]=Ag(o,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,f]=Ag(l," "," ");for(i.set(f,u);;){let d=await s();if(d===!0)break;if(d!==null){let[h,p]=Ag(d.toString("utf8")," "," ");i.set(p,h)}}}for(let u of r)if(u.startsWith("symref=")){let f=u.match(/symref=([^:]+):(.*)/);f.length===3&&n.set(f[1],f[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}function Ag(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new ba(`Two strings separated by '${r}'`,t.toString("utf8"));return i}var DE=(t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,OE=(t,e)=>{(e.username||e.password)&&(t.Authorization=hS(e)),e.headers&&Object.assign(t,e.headers)},Cg=async t=>{try{let e=E.from(await yd(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch(e){return{}}},Jo=class{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:s,corsProxy:a,service:o,url:l,headers:c,protocolVersion:u}){let{url:f,auth:d}=FE(l),h=a?DE(a,f):f;(d.username||d.password)&&(c.Authorization=hS(d)),u===2&&(c["Git-Protocol"]="version=2");let p,g,w=!1;do if(p=await e.request({onProgress:r,method:"GET",url:`${h}/info/refs?service=${o}`,headers:c}),g=!1,p.statusCode===401||p.statusCode===203){let y=w?s:i;if(y){if(d=await y(f,{...d,headers:{...c}}),d&&d.cancel)throw new Ko;d&&(OE(c,d),w=!0,g=!0)}}else p.statusCode===200&&w&&n&&await n(f,d);while(g);if(p.statusCode!==200){let{response:y}=await Cg(p);throw new qo(p.statusCode,p.statusMessage,y)}if(p.headers["content-type"]===`application/x-${o}-advertisement`){let y=await ME(p.body,{service:o});return y.auth=d,y}else{let{preview:y,response:b,data:S}=await Cg(p);try{let C=await ME([S],{service:o});return C.auth=d,C}catch(C){throw new ru(y,b)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:s,auth:a,body:o,headers:l}){let c=FE(s);c&&(s=c.url),i&&(s=DE(i,s)),l["content-type"]=`application/x-${n}-request`,l.accept=`application/x-${n}-result`,OE(l,a);let u=await e.request({onProgress:r,method:"POST",url:`${s}/${n}`,body:o,headers:l});if(u.statusCode!==200){let{response:f}=Cg(u);throw new qo(u.statusCode,u.statusMessage,f)}return u}},el=class{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",Jo),r.set("https",Jo);let i=HN({url:e});if(!i)throw new nu(e);if(r.has(i.transport))return r.get(i.transport);throw new iu(e,i.transport,i.transport==="ssh"?BN(e):void 0)}};function HN({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}var ma=null,ya=class{static async read({fs:e,gitdir:r}){ma===null&&(ma=new Uc);let i=H(r,"shallow"),n=new Set;return await ma.acquire(i,async function(){let s=await e.read(i,{encoding:"utf8"});if(s===null||s.trim()==="")return n;s.trim().split(` +`).map(a=>n.add(a))}),n}static async write({fs:e,gitdir:r,oids:i}){ma===null&&(ma=new Uc);let n=H(r,"shallow");if(i.size>0){let s=[...i].join(` +`)+` +`;await ma.acquire(n,async function(){await e.write(n,s,{encoding:"utf8"})})}else await ma.acquire(n,async function(){await e.rm(n)})}};async function UN({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}async function GN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=await t.readdir(H(r,"objects/pack"));s=s.filter(a=>a.endsWith(".idx"));for(let a of s){let o=`${r}/objects/pack/${a}`,l=await Gg({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(l.error)throw new me(l.error);if(l.offsets.has(i))return!0}return!1}async function LE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=o=>et({fs:t,cache:e,gitdir:r,oid:o}),a=await UN({fs:t,gitdir:r,oid:i});return a||(a=await GN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s})),a}function jN(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}function pS(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}var Ad={name:"isomorphic-git",version:"1.37.4",agent:"git/isomorphic-git@1.37.4"},Vo=class{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};function VN(t){let e=t.indexOf("\r"),r=t.indexOf(` +`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}function mS(t){let e=new Vo,r="";return(async()=>(await du(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=VN(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}var xd=class{static demux(e){let r=lt.streamReader(e),i=new Vo,n=new Vo,s=new Vo,a=async function(){let o=await r();if(o===null)return a();if(o===!0){i.end(),s.end(),e.error?n.destroy(e.error):n.end();return}switch(o[0]){case 1:{n.write(o.slice(1));break}case 2:{s.write(o.slice(1));break}case 3:{let l=o.slice(1);s.write(l),i.end(),s.end(),n.destroy(new Error(l.toString("utf8")));return}default:i.write(o)}a()};return a(),{packetlines:i,packfile:n,progress:s}}};async function zN(t){let{packetlines:e,packfile:r,progress:i}=xd.demux(t),n=[],s=[],a=[],o=!1,l=!1;return new Promise((c,u)=>{du(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new As(h)),n.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new As(h)),s.push(h)}else if(d.startsWith("ACK")){let[,h,p]=d.split(" ");a.push({oid:h,status:p}),p||(l=!0)}else d.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))})})}function WN({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:s=null,exclude:a=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(lt.encode(`want ${c}${l} +`)),l="";for(let c of i)o.push(lt.encode(`shallow ${c} +`));n!==null&&o.push(lt.encode(`deepen ${n} +`)),s!==null&&o.push(lt.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)} +`));for(let c of a)o.push(lt.encode(`deepen-not ${c} +`));o.push(lt.flush());for(let c of r)o.push(lt.encode(`have ${c} +`));return o.push(lt.encode(`done +`)),o}async function zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:p=null,since:g=null,exclude:w=[],relative:y=!1,tags:b=!1,singleBranch:S=!1,headers:C={},prune:A=!1,pruneTags:k=!1}){let v=c||await Is({fs:t,gitdir:l,test:!0}),x=await ht.get({fs:t,gitdir:l}),_=f||v&&await x.get(`branch.${v}.remote`)||"origin",P=d||await x.get(`remote.${_}.url`);if(typeof P=="undefined")throw new Ir("remote OR url");let T=u||v&&await x.get(`branch.${v}.merge`)||c||"HEAD";h===void 0&&(h=await x.get("http.corsProxy"));let M=el.getRemoteHelperFor({url:P}),$=await M.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:P,headers:C,protocolVersion:1}),D=$.auth,Q=$.refs;if(Q.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!$.capabilities.has("shallow"))throw new ks("shallow","depth");if(g!==null&&!$.capabilities.has("deepen-since"))throw new ks("deepen-since","since");if(w.length>0&&!$.capabilities.has("deepen-not"))throw new ks("deepen-not","exclude");if(y===!0&&!$.capabilities.has("deepen-relative"))throw new ks("deepen-relative","relative");let{oid:ye,fullref:de}=q.resolveAgainstMap({ref:T,map:Q});for(let B of Q.keys())B===de||B==="HEAD"||B.startsWith("refs/heads/")||b&&B.startsWith("refs/tags/")||Q.delete(B);let J=pS([...$.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Ad.agent}`]);y&&J.push("deepen-relative");let X=S?[ye]:Q.values(),he=S?[v]:await q.listRefs({fs:t,gitdir:l,filepath:"refs"}),z=[];for(let B of he)try{B=await q.expand({fs:t,gitdir:l,ref:B});let N=await q.resolve({fs:t,gitdir:l,ref:B});await LE({fs:t,cache:e,gitdir:l,oid:N})&&z.push(N)}catch(N){}z=[...new Set(z)];let K=await ya.read({fs:t,gitdir:l}),G=$.capabilities.has("shallow")?[...K]:[],Me=WN({capabilities:J,wants:X,haves:z,shallows:G,depth:p,since:g,exclude:w}),Et=E.from(await yd(Me)),Ht=await M.connect({http:r,onProgress:i,corsProxy:h,service:"git-upload-pack",url:P,auth:D,body:[Et],headers:C}),De=await zN(Ht.body);Ht.headers&&(De.headers=Ht.headers);for(let B of De.shallows)if(!K.has(B))try{let{object:N}=await et({fs:t,cache:e,gitdir:l,oid:B}),ue=new Dr(N),Re=await Promise.all(ue.headers().parent.map(Pr=>LE({fs:t,cache:e,gitdir:l,oid:Pr})));Re.length===0||Re.every(Pr=>Pr)||K.add(B)}catch(N){K.add(B)}for(let B of De.unshallows)K.delete(B);if(await ya.write({fs:t,gitdir:l,oids:K}),S){let B=new Map([[de,ye]]),N=new Map,ue=10,Re=de;for(;ue--;){let vo=$.symrefs.get(Re);if(vo===void 0)break;N.set(Re,vo),Re=vo}let Ut=Q.get(Re);Ut&&B.set(Re,Ut);let{pruned:Pr}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:B,symrefs:N,tags:b,prune:A});A&&(De.pruned=Pr)}else{let{pruned:B}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:Q,symrefs:$.symrefs,tags:b,prune:A,pruneTags:k});A&&(De.pruned=B)}if(De.HEAD=$.symrefs.get("HEAD"),De.HEAD===void 0){let{oid:B}=q.resolveAgainstMap({ref:"HEAD",map:Q});for(let[N,ue]of Q.entries())if(N!=="HEAD"&&ue===B){De.HEAD=N;break}}let Rt=de.startsWith("refs/tags")?"tag":"branch";if(De.FETCH_HEAD={oid:ye,description:`${Rt} '${ga(de)}' of ${P}`},i||n){let B=mS(De.progress);du(B,async N=>{if(n&&await n(N),i){let ue=N.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);ue&&await i({phase:ue[1].trim(),loaded:parseInt(ue[2],10),total:parseInt(ue[3],10)})}})}let $t=E.from(await yd(De.packfile));if(Ht.body.error)throw Ht.body.error;let Xe=$t.slice(-20).toString("hex"),re={defaultBranch:De.HEAD,fetchHead:De.FETCH_HEAD.oid,fetchHeadDescription:De.FETCH_HEAD.description};if(De.headers&&(re.headers=De.headers),A&&(re.pruned=De.pruned),Xe!==""&&!jN($t)){re.packfile=`objects/pack/pack-${Xe}.pack`;let B=H(l,re.packfile);await t.write(B,$t);let N=Re=>et({fs:t,cache:e,gitdir:l,oid:Re}),ue=await zc.fromPack({pack:$t,getExternalRefDelta:N,onProgress:i});await t.write(B.replace(/\.pack$/,".idx"),await ue.toBuffer())}return re}async function gS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:H(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(a=>i+"/"+a);for(let a of s)await t.mkdir(a);await t.write(i+"/config",`[core] + repositoryformatversion = 0 + filemode = false + bare = ${e} +`+(e?"":` logallrefupdates = true +`)+` symlinks = false + ignorecase = true +`),await t.write(i+"/HEAD",`ref: refs/heads/${n} +`)}async function qN({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:p,depth:g,since:w,exclude:y,relative:b,singleBranch:S,noCheckout:C,noTags:A,headers:k,nonBlocking:v,batchSize:x=100}){try{if(await gS({fs:t,gitdir:u}),await sS({fs:t,gitdir:u,remote:p,url:f,force:!1}),d){let T=await ht.get({fs:t,gitdir:u});await T.set("http.corsProxy",d),await ht.save({fs:t,gitdir:u,config:T})}let{defaultBranch:_,fetchHead:P}=await zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:u,ref:h,remote:p,corsProxy:d,depth:g,since:w,exclude:y,relative:b,singleBranch:S,headers:k,tags:!A});if(P===null)return;h=h||_,h=h.replace("refs/heads/",""),await jg({fs:t,cache:e,onProgress:i,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:C,nonBlocking:v,batchSize:x})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}async function vS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:c=H(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:p=void 0,since:g=void 0,exclude:w=[],relative:y=!1,singleBranch:b=!1,noCheckout:S=!1,noTags:C=!1,headers:A={},cache:k={},nonBlocking:v=!1,batchSize:x=100}){try{R("fs",t),R("http",e),R("gitdir",c),S||R("dir",l),R("url",u);let _=new te(t),P=await ie({fsp:_,dotgit:c});return await qN({fs:_,cache:k,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:P,url:u,corsProxy:f,ref:d,remote:h,depth:p,since:g,exclude:w,relative:y,singleBranch:b,noCheckout:S,noTags:C,headers:A,nonBlocking:v,batchSize:x})}catch(_){throw _.caller="git.clone",_}}async function wS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:p={}}){try{R("fs",t),l||R("message",n),o&&R("onSign",e);let g=new te(t),w=await ie({fsp:g,dotgit:i});return await cu({fs:g,cache:p,onSign:e,gitdir:w,message:n,author:s,committer:a,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(g){throw g.caller="git.commit",g}}async function bS({fs:t,dir:e,gitdir:r=H(e,".git"),fullname:i=!1,test:n=!1}){try{R("fs",t),R("gitdir",r);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await Is({fs:s,gitdir:a,fullname:i,test:n})}catch(s){throw s.caller="git.currentBranch",s}}async function YN({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await q.exists({fs:t,gitdir:e,ref:r}))throw new Ge(r);let n=await q.expand({fs:t,gitdir:e,ref:r}),s=await Is({fs:t,gitdir:e,fullname:!0});if(n===s){let l=await q.resolve({fs:t,gitdir:e,ref:n});await q.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await q.deleteRef({fs:t,gitdir:e,ref:n});let a=ga(r),o=await ht.get({fs:t,gitdir:e});await o.deleteSection("branch",a),await ht.save({fs:t,gitdir:e,config:o})}async function _S({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await YN({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}async function yS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});await q.deleteRef({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}async function ZN({fs:t,gitdir:e,remote:r}){let i=await ht.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await ht.save({fs:t,gitdir:e,config:i})}async function xS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i}){try{R("fs",t),R("remote",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await ZN({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}async function KN({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await q.deleteRef({fs:t,gitdir:e,ref:r})}async function ES({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await KN({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}async function XN({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(s=>`${i}${s}`).filter(s=>s.startsWith(r))}async function QN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=[],a=await t.readdir(H(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await Gg({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(c.error)throw new me(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&s.push(u)}return s}async function JN({fs:t,cache:e,gitdir:r,oid:i}){let n=o=>et({fs:t,cache:e,gitdir:r,oid:o}),s=await XN({fs:t,gitdir:r,oid:i}),a=await QN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let o of a)s.indexOf(o)===-1&&s.push(o);if(s.length===1)return s[0];throw s.length>1?new Wc("oids",i,s):new Ge(`an object matching "${i}"`)}async function SS({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await JN({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.expandOid",s}}async function kS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("gitdir",r),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await q.expand({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.expandRef",n}}async function Wg({fs:t,cache:e,gitdir:r,oids:i}){let n={},s=i.length,a=i.map((o,l)=>({index:l,oid:o}));for(;a.length;){let o=new Set;for(let{oid:c,index:u}of a)n[c]||(n[c]=new Set),n[c].add(u),n[c].size===s&&o.add(c);if(o.size>0)return[...o];let l=new Map;for(let{oid:c,index:u}of a)try{let{object:f}=await et({fs:t,cache:e,gitdir:r,oid:c}),d=Dr.from(f),{parent:h}=d.parseHeaders();for(let p of h)(!n[p]||!n[p].has(u))&&l.set(p+":"+u,{oid:p,index:u})}catch(f){}a=Array.from(l.values())}return[]}async function AS({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,onSign:g,mergeDriver:w,allowUnrelatedHistories:y=!1}){n===void 0&&(n=await Is({fs:t,gitdir:i,fullname:!0})),n=await q.expand({fs:t,gitdir:i,ref:n}),s=await q.expand({fs:t,gitdir:i,ref:s});let b=await q.resolve({fs:t,gitdir:i,ref:n}),S=await q.resolve({fs:t,gitdir:i,ref:s}),C=await Wg({fs:t,cache:e,gitdir:i,oids:[b,S]});if(C.length!==1)if(C.length===0&&y)C.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new Yo;let A=C[0];if(A===S)return{oid:b,alreadyMerged:!0};if(a&&A===b)return!l&&!c&&await q.writeRef({fs:t,gitdir:i,ref:n,value:S}),{oid:S,fastForward:!0};{if(o)throw new Qc;let k=await dt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async x=>uS({fs:t,cache:e,dir:r,gitdir:i,index:x,ourOid:b,theirOid:S,baseOid:A,ourName:ga(n),baseName:"base",theirName:ga(s),dryRun:l,abortOnConflict:u,mergeDriver:w}));if(k instanceof wa)throw k;return f||(f=`Merge branch '${ga(s)}' into ${ga(n)}`),{oid:await cu({fs:t,cache:e,gitdir:i,message:f,ref:n,tree:k,parent:[b,S],author:d,committer:h,signingKey:p,onSign:g,dryRun:l,noUpdateBranch:c}),tree:k,mergeCommit:!0}}}async function CS({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,dir:l,gitdir:c,ref:u,url:f,remote:d,remoteRef:h,prune:p,pruneTags:g,fastForward:w,fastForwardOnly:y,corsProxy:b,singleBranch:S,headers:C,author:A,committer:k,signingKey:v}){try{if(!u){let P=await Is({fs:t,gitdir:c});if(!P)throw new Ir("ref");u=P}let{fetchHead:x,fetchHeadDescription:_}=await zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:c,corsProxy:b,ref:u,url:f,remote:d,remoteRef:h,singleBranch:S,headers:C,prune:p,pruneTags:g});await AS({fs:t,cache:e,gitdir:c,ours:u,theirs:x,fastForward:w,fastForwardOnly:y,message:`Merge ${_}`,author:A,committer:k,signingKey:v,dryRun:!1,noUpdateBranch:!1}),await jg({fs:t,cache:e,onProgress:i,dir:l,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(x){throw x.caller="git.pull",x}}async function TS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=H(o,".git"),ref:c,url:u,remote:f,remoteRef:d,corsProxy:h,singleBranch:p,headers:g={},cache:w={}}){try{R("fs",t),R("http",e),R("gitdir",l);let y={name:"",email:"",timestamp:Date.now(),timezoneOffset:0},b=new te(t),S=await ie({fsp:b,dotgit:l});return await CS({fs:b,cache:w,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:S,ref:c,url:u,remote:f,remoteRef:d,fastForwardOnly:!0,corsProxy:h,singleBranch:p,headers:g,author:y,committer:y})}catch(y){throw y.caller="git.fastForward",y}}async function PS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=H(o,".git"),ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:p=null,since:g=null,exclude:w=[],relative:y=!1,tags:b=!1,singleBranch:S=!1,headers:C={},prune:A=!1,pruneTags:k=!1,cache:v={}}){try{R("fs",t),R("http",e),R("gitdir",l);let x=new te(t),_=await ie({fsp:x,dotgit:l});return await zg({fs:x,cache:v,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,gitdir:_,ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:p,since:g,exclude:w,relative:y,tags:b,singleBranch:S,headers:C,prune:A,pruneTags:k})}catch(x){throw x.caller="git.fetch",x}}async function RS({fs:t,dir:e,gitdir:r=H(e,".git"),oids:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oids",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await Wg({fs:s,cache:n,gitdir:a,oids:i})}catch(s){throw s.caller="git.findMergeBase",s}}async function $S({fs:t,filepath:e}){if(await t.exists(H(e,".git")))return e;{let r=va(e);if(r===e)throw new Ge(`git root for ${e}`);return $S({fs:t,filepath:r})}}async function FS({fs:t,filepath:e}){try{return R("fs",t),R("filepath",e),await $S({fs:new te(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}async function IS({fs:t,dir:e,gitdir:r=H(e,".git"),path:i}){try{R("fs",t),R("gitdir",r),R("path",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await ou({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfig",n}}async function eB({fs:t,gitdir:e,path:r}){return(await ht.get({fs:t,gitdir:e})).getall(r)}async function MS({fs:t,dir:e,gitdir:r=H(e,".git"),path:i}){try{R("fs",t),R("gitdir",r),R("path",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await eB({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}async function DS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1}){try{R("http",t),R("url",s);let c=await el.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[f,d]of c.refs){let h=f.split("/"),p=h.pop(),g=u;for(let w of h)g[w]=g[w]||{},g=g[w];g[p]=d}for(let[f,d]of c.symrefs){let h=f.split("/"),p=h.pop(),g=u;for(let w of h)g[w]=g[w]||{},g=g[w];g[p]=d}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function OS(t,e,r,i){let n=[];for(let[s,a]of t.refs){if(e&&!s.startsWith(e))continue;if(s.endsWith("^{}")){if(i){let l=s.replace("^{}",""),c=n[n.length-1],u=c.ref===l?c:n.find(f=>f.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=a}continue}let o={ref:s,oid:a};r&&t.symrefs.has(s)&&(o.target=t.symrefs.get(s)),n.push(o)}return n}async function LS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2}){try{R("http",t),R("url",s);let u=await el.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let f={};for(let d of u.capabilities){let[h,p]=d.split("=");p?f[h]=p:f[h]=!0}return{protocolVersion:1,capabilities:f,refs:OS(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function tB({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Cs.wrap({type:t,object:e})),i=await wn(e)),{oid:i,object:e}}async function NS({object:t}){try{R("object",t),typeof t=="string"?t=E.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await tB({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}async function rB({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:s}){try{s=H(i,s);let a=await t.read(s),o=c=>et({fs:t,cache:e,gitdir:n,oid:c}),l=await zc.fromPack({pack:a,getExternalRefDelta:o,onProgress:r});return await t.write(s.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(a){throw a.caller="git.indexPack",a}}async function BS({fs:t,onProgress:e,dir:r,gitdir:i=H(r,".git"),filepath:n,cache:s={}}){try{R("fs",t),R("dir",r),R("gitdir",r),R("filepath",n);let a=new te(t),o=await ie({fsp:a,dotgit:i});return await rB({fs:a,cache:s,onProgress:e,dir:r,gitdir:o,filepath:n})}catch(a){throw a.caller="git.indexPack",a}}async function HS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:H(r,".git"),defaultBranch:n="master"}){try{R("fs",t),R("gitdir",i),e||R("dir",r);let s=new te(t),a=await ie({fsp:s,dotgit:i});return await gS({fs:s,bare:e,dir:r,gitdir:a,defaultBranch:n})}catch(s){throw s.caller="git.init",s}}async function US({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:s}){let a=await ya.read({fs:t,gitdir:r});if(!i)throw new Ir("oid");if(!n)throw new Ir("ancestor");if(i===n)return!1;let o=[i],l=new Set,c=0;for(;o.length;){if(c++===s)throw new eu(s);let u=o.shift(),{type:f,object:d}=await et({fs:t,cache:e,gitdir:r,oid:u});if(f!=="commit")throw new _r(u,f,"commit");let h=Dr.from(d).parse();for(let p of h.parent)if(p===n)return!0;if(!a.has(u))for(let p of h.parent)l.has(p)||(o.push(p),l.add(p))}return!1}async function GS({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,ancestor:n,depth:s=-1,cache:a={}}){try{R("fs",t),R("gitdir",r),R("oid",i),R("ancestor",n);let o=new te(t),l=await ie({fsp:o,dotgit:r});return await US({fs:o,cache:a,gitdir:l,oid:i,ancestor:n,depth:s})}catch(o){throw o.caller="git.isDescendent",o}}async function jS({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i}){try{R("fs",t),R("dir",e),R("gitdir",r),R("filepath",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return Rs.isIgnored({fs:n,dir:e,gitdir:s,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}async function VS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i}){try{R("fs",t),R("gitdir",r);let n=new te(t),s=await ie({fsp:n,dotgit:r});return q.listBranches({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.listBranches",n}}async function iB({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await q.resolve({gitdir:e,fs:t,ref:r}),s=[];return await zS({fs:t,cache:i,gitdir:e,oid:n,filenames:s,prefix:""}),s}else return dt.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(s=>s.path)})}async function zS({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:s}){let{tree:a}=await rl({fs:t,cache:e,gitdir:r,oid:i});for(let o of a)o.type==="tree"?await zS({fs:t,cache:e,gitdir:r,oid:o.oid,filenames:n,prefix:H(s,o.path)}):n.push(H(s,o.path))}async function WS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,cache:n={}}){try{R("fs",t),R("gitdir",r);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await iB({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listFiles",s}}async function nB({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await q.resolve({gitdir:r,fs:t,ref:i})}catch(o){if(o instanceof Ge)return[]}return(await rl({fs:t,cache:e,gitdir:r,oid:n})).tree.map(o=>({target:o.path,note:o.oid}))}async function qS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{R("fs",t),R("gitdir",r),R("ref",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await nB({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listNotes",s}}async function YS({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i}){try{R("fs",t),R("gitdir",r);let n=new te(t),s=await ie({fsp:n,dotgit:r});return q.listRefs({fs:n,gitdir:s,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}async function sB({fs:t,gitdir:e}){let r=await ht.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async s=>{let a=await r.get(`remote.${s}.url`);return{remote:s,url:a}}))}async function ZS({fs:t,dir:e,gitdir:r=H(e,".git")}){try{R("fs",t),R("gitdir",r);let i=new te(t),n=await ie({fsp:i,dotgit:r});return await sB({fs:i,gitdir:n})}catch(i){throw i.caller="git.listRemotes",i}}async function aB(t){let e=lt.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,s,...a]=i.split(" "),o={ref:s,oid:n};for(let l of a){let[c,u]=l.split(":");c==="symref-target"?o.target=u:c==="peeled"&&(o.peeled=u)}r.push(o)}return r}async function oB({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(lt.encode(`command=ls-refs +`)),i.push(lt.encode(`agent=${Ad.agent} +`)),(r||e||t)&&i.push(lt.delim()),r&&i.push(lt.encode("peel")),e&&i.push(lt.encode("symrefs")),t&&i.push(lt.encode(`ref-prefix ${t}`)),i.push(lt.flush()),i}async function KS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{R("http",t),R("url",s);let d=await Jo.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(d.protocolVersion===1)return OS(d,c,u,f);let h=await oB({prefix:c,symrefs:u,peelTags:f}),p=await Jo.connect({http:t,auth:d.auth,headers:a,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,body:h});return aB(p.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function XS({fs:t,dir:e,gitdir:r=H(e,".git")}){try{R("fs",t),R("gitdir",r);let i=new te(t),n=await ie({fsp:i,dotgit:r});return q.listTags({fs:i,gitdir:n})}catch(i){throw i.caller="git.listTags",i}}function lB(t,e){return t.committer.timestamp-e.committer.timestamp}var cB="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function NE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===cB)return;let s=i,a,o=await Xo({fs:t,cache:e,gitdir:r,oid:i}),l=o.tree;return n===o.oid?a=o.path:(a=await QS({fs:t,cache:e,gitdir:r,tree:l,fileId:n,oid:s}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function QS({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:s,filepaths:a=[],parentPath:o=""}){let l=i.entries().map(function(c){let u;return c.oid===n?(u=H(o,c.path),a.push(u)):c.type==="tree"&&(u=et({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return QS({fs:t,cache:e,gitdir:r,tree:Mr.from(f),fileId:n,oid:s,filepaths:a,parentPath:H(o,c.path)})})),u});return await Promise.all(l),a}async function uB({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:s,since:a,force:o,follow:l}){let c=typeof a=="undefined"?void 0:Math.floor(a.valueOf()/1e3),u=[],f=await ya.read({fs:t,gitdir:r}),d=await q.resolve({fs:t,gitdir:r,ref:n}),h=[await vn({fs:t,cache:e,gitdir:r,oid:d})],p,g,w;function y(b){w&&i&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(i){let S;try{S=await uu({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:i}),g&&p!==S&&u.push(g),p=S,g=b,w=!0}catch(C){if(C instanceof Ge){let A=l&&p;if(A&&(A=await NE({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:p}),A))if(Array.isArray(A)){if(g){let k=await NE({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:p});if(Array.isArray(k))if(A=A.filter(v=>k.indexOf(v)===-1),A.length===1)A=A[0],i=A,g&&u.push(g);else{A=!1,g&&u.push(g);break}}}else i=A,g&&u.push(g);if(!A){if(w&&p&&(u.push(g),!o))break;if(!o&&!l)throw C}g=b,w=!1}else throw C}}else u.push(b);if(s!==void 0&&u.length===s){y(b);break}if(!f.has(b.oid))for(let S of b.commit.parent){let C=await vn({fs:t,cache:e,gitdir:r,oid:S});h.map(A=>A.oid).includes(C.oid)||h.push(C)}h.length===0&&y(b),h.sort((S,C)=>lB(S.commit,C.commit))}return u}async function JS({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,ref:n="HEAD",depth:s,since:a,force:o,follow:l,cache:c={}}){try{R("fs",t),R("gitdir",r),R("ref",n);let u=new te(t),f=await ie({fsp:u,dotgit:r});return await uB({fs:u,cache:c,gitdir:f,filepath:i,ref:n,depth:s,since:a,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function ek({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,cache:g={},mergeDriver:w,allowUnrelatedHistories:y=!1}){try{R("fs",t),p&&R("onSign",e);let b=new te(t),S=await ie({fsp:b,dotgit:i}),C=await $s({fs:b,gitdir:S,author:d});if(!C&&(!o||!a))throw new Xt("author");let A=await _a({fs:b,gitdir:S,author:C,committer:h});if(!A&&(!o||!a))throw new Xt("committer");return await AS({fs:b,cache:g,dir:r,gitdir:S,ours:n,theirs:s,fastForward:a,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:C,committer:A,signingKey:p,onSign:e,mergeDriver:w,allowUnrelatedHistories:y})}catch(b){throw b.caller="git.merge",b}}var fB={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function tk({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),oids:n}){let s=new BE,a=[];function o(u,f){let d=E.from(u,f);a.push(d),s.update(d)}async function l({stype:u,object:f}){let d=fB[u],h=f.length,p=h>15?128:0,g=h&15;h=h>>>4;let w=(p|d|g).toString(16);for(o(w,"hex");p;)p=h>127?128:0,w=p|h&127,o(Hg(2,w),"hex"),h=h>>>7;o(E.from(await XE(f)))}o("PACK"),o("00000002","hex"),o(Hg(8,n.length),"hex");for(let u of n){let{type:f,object:d}=await et({fs:t,cache:e,gitdir:i,oid:u});await l({write:o,object:d,stype:f})}let c=s.digest();return a.push(c),a}async function dB({fs:t,cache:e,gitdir:r,oids:i,write:n}){let s=await tk({fs:t,cache:e,gitdir:r,oids:i}),a=E.from(await yd(s)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return n?(await t.write(H(r,`objects/pack/${l}`),a),{filename:l}):{filename:l,packfile:new Uint8Array(a)}}async function rk({fs:t,dir:e,gitdir:r=H(e,".git"),oids:i,write:n=!1,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oids",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await dB({fs:a,cache:s,gitdir:o,oids:i,write:n})}catch(a){throw a.caller="git.packObjects",a}}async function ik({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=H(o,".git"),ref:c,url:u,remote:f,remoteRef:d,prune:h=!1,pruneTags:p=!1,fastForward:g=!0,fastForwardOnly:w=!1,corsProxy:y,singleBranch:b,headers:S={},author:C,committer:A,signingKey:k,cache:v={}}){try{R("fs",t),R("gitdir",l);let x=new te(t),_=await ie({fsp:x,dotgit:l}),P=await $s({fs:x,gitdir:_,author:C});if(!P)throw new Xt("author");let T=await _a({fs:x,gitdir:_,author:P,committer:A});if(!T)throw new Xt("committer");return await CS({fs:x,cache:v,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:_,ref:c,url:u,remote:f,remoteRef:d,fastForward:g,fastForwardOnly:w,corsProxy:y,singleBranch:b,headers:S,author:P,committer:T,signingKey:k,prune:h,pruneTags:p})}catch(x){throw x.caller="git.pull",x}}async function hB({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),start:n,finish:s}){let a=await ya.read({fs:t,gitdir:i}),o=new Set,l=new Set;for(let f of n)o.add(await q.resolve({fs:t,gitdir:i,ref:f}));for(let f of s)try{let d=await q.resolve({fs:t,gitdir:i,ref:f});l.add(d)}catch(d){}let c=new Set;async function u(f){c.add(f);let{type:d,object:h}=await et({fs:t,cache:e,gitdir:i,oid:f});if(d==="tag"){let g=Xr.from(h).headers().object;return u(g)}if(d!=="commit")throw new _r(f,d,"commit");if(!a.has(f)){let g=Dr.from(h).headers().parent;for(f of g)!l.has(f)&&!c.has(f)&&await u(f)}}for(let f of o)await u(f);return c}async function Tg({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),oids:n}){let s=new Set;async function a(o){if(s.has(o))return;s.add(o);let{type:l,object:c}=await et({fs:t,cache:e,gitdir:i,oid:o});if(l==="tag"){let f=Xr.from(c).headers().object;await a(f)}else if(l==="commit"){let f=Dr.from(c).headers().tree;await a(f)}else if(l==="tree"){let u=Mr.from(c);for(let f of u)f.type==="blob"&&s.add(f.oid),f.type==="tree"&&await a(f.oid)}}for(let o of n)await a(o);return s}async function pB(t){let e={},r="",i=lt.streamReader(t),n=await i();for(;n!==!0;)n!==null&&(r+=n.toString("utf8")+` +`),n=await i();let s=r.toString("utf8").split(` +`);if(n=s.shift(),!n.startsWith("unpack "))throw new ba('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let a of s){if(a.trim()==="")continue;let o=a.slice(0,2),l=a.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function mB({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(lt.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i} +`)),i="";return r.push(lt.flush()),r}async function gB({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p=!1,delete:g=!1,corsProxy:w,headers:y={}}){let b=u||await Is({fs:t,gitdir:c});if(typeof b=="undefined")throw new Ir("ref");let S=await ht.get({fs:t,gitdir:c});d=d||await S.get(`branch.${b}.pushRemote`)||await S.get("remote.pushDefault")||await S.get(`branch.${b}.remote`)||"origin";let C=h||await S.get(`remote.${d}.pushurl`)||await S.get(`remote.${d}.url`);if(typeof C=="undefined")throw new Ir("remote OR url");let A=f||await S.get(`branch.${b}.merge`);if(typeof C=="undefined")throw new Ir("remoteRef");w===void 0&&(w=await S.get("http.corsProxy"));let k=await q.expand({fs:t,gitdir:c,ref:b}),v=g?"0000000000000000000000000000000000000000":await q.resolve({fs:t,gitdir:c,ref:k}),x=el.getRemoteHelperFor({url:C}),_=await x.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:w,service:"git-receive-pack",url:C,headers:y,protocolVersion:1}),P=_.auth,T;if(!A)T=k;else try{T=await q.expandAgainstMap({ref:A,map:_.refs})}catch(K){if(K instanceof Ge)T=A.startsWith("refs/")?A:`refs/heads/${A}`;else throw K}let M=_.refs.get(T)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:C,localRef:{ref:g?"(delete)":k,oid:v},remoteRef:{ref:T,oid:M}}))throw new Ko;let $=!_.capabilities.has("no-thin"),D=new Set;if(!g){let K=[..._.refs.values()],G=new Set;if(M!=="0000000000000000000000000000000000000000"){let Me=await Wg({fs:t,cache:e,gitdir:c,oids:[v,M]});for(let Et of Me)K.push(Et);$&&(G=await Tg({fs:t,cache:e,gitdir:c,oids:Me}))}if(!K.includes(v)){let Me=await hB({fs:t,cache:e,gitdir:c,start:[v],finish:K});D=await Tg({fs:t,cache:e,gitdir:c,oids:Me})}if($){try{let Me=await q.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:Et}=await q.resolveAgainstMap({ref:Me.replace(`refs/remotes/${d}/`,""),fullref:Me,map:_.refs}),Ht=[Et];for(let De of await Tg({fs:t,cache:e,gitdir:c,oids:Ht}))G.add(De)}catch(Me){}for(let Me of G)D.delete(Me)}if(v===M&&(p=!0),!p){if(k.startsWith("refs/tags")&&M!=="0000000000000000000000000000000000000000")throw new Zo("tag-exists");if(v!=="0000000000000000000000000000000000000000"&&M!=="0000000000000000000000000000000000000000"&&!await US({fs:t,cache:e,gitdir:c,oid:v,ancestor:M,depth:-1}))throw new Zo("not-fast-forward")}}let Q=pS([..._.capabilities],["report-status","side-band-64k",`agent=${Ad.agent}`]),ye=await mB({capabilities:Q,triplets:[{oldoid:M,oid:v,fullRef:T}]}),de=g?[]:await tk({fs:t,cache:e,gitdir:c,oids:[...D]}),J=await x.connect({http:r,onProgress:i,corsProxy:w,service:"git-receive-pack",url:C,auth:P,headers:y,body:[...ye,...de]}),{packfile:X,progress:he}=await xd.demux(J.body);if(n){let K=mS(he);du(K,async G=>{await n(G)})}let z=await pB(X);if(J.headers&&(z.headers=J.headers),d&&z.ok&&z.refs[T].ok&&!k.startsWith("refs/tags")){let K=`refs/remotes/${d}/${T.replace("refs/heads","")}`;g?await q.deleteRef({fs:t,gitdir:c,ref:K}):await q.writeRef({fs:t,gitdir:c,ref:K,value:v})}if(z.ok&&Object.values(z.refs).every(K=>K.ok))return z;{let K=Object.entries(z.refs).filter(([G,Me])=>!Me.ok).map(([G,Me])=>` + - ${G}: ${Me.error}`).join("");throw new Jc(K,z)}}async function nk({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,dir:l,gitdir:c=H(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:p=!1,delete:g=!1,corsProxy:w,headers:y={},cache:b={}}){try{R("fs",t),R("http",e),R("gitdir",c);let S=new te(t),C=await ie({fsp:S,dotgit:c});return await gB({fs:S,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,gitdir:C,ref:u,remoteRef:f,remote:d,url:h,force:p,delete:g,corsProxy:w,headers:y})}catch(S){throw S.caller="git.push",S}}async function sk({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Xr.from(s).parse().object,sk({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new _r(i,n,"blob");return{oid:i,blob:new Uint8Array(s)}}async function ak({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await uu({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await sk({fs:t,cache:e,gitdir:r,oid:i})}async function ok({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,filepath:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await ak({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readBlob",a}}async function qg({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await vn({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readCommit",s}}async function vB({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let s=await q.resolve({gitdir:r,fs:t,ref:i}),{blob:a}=await ak({fs:t,cache:e,gitdir:r,oid:s,filepath:n});return a}async function lk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="refs/notes/commits",oid:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("ref",i),R("oid",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await vB({fs:a,cache:s,gitdir:o,ref:i,oid:n})}catch(a){throw a.caller="git.readNote",a}}async function ck({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,format:n="parsed",filepath:s=void 0,encoding:a=void 0,cache:o={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});s!==void 0&&(i=await uu({fs:l,cache:o,gitdir:c,oid:i,filepath:s}));let f=await et({fs:l,cache:o,gitdir:c,oid:i,format:n==="parsed"?"content":n});if(f.oid=i,n==="parsed")switch(f.format="parsed",f.type){case"commit":f.object=Dr.from(f.object).parse();break;case"tree":f.object=Mr.from(f.object).entries();break;case"blob":a?f.object=f.object.toString(a):(f.object=new Uint8Array(f.object),f.format="content");break;case"tag":f.object=Xr.from(f.object).parse();break;default:throw new _r(f.oid,f.type,"blob|commit|tag|tree")}else(f.format==="deflated"||f.format==="wrapped")&&(f.type=f.format);return f}catch(l){throw l.caller="git.readObject",l}}async function wB({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new _r(i,n,"tag");let a=Xr.from(s);return{oid:i,tag:a.parse(),payload:a.payload()}}async function uk({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await wB({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readTag",s}}async function fk({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,filepath:n=void 0,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await rl({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readTree",a}}async function dk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});await dt.acquire({fs:s,gitdir:a,cache:n},async function(o){o.delete({filepath:i})})}catch(s){throw s.caller="git.remove",s}}async function bB({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l}){let c;try{c=await q.resolve({gitdir:i,fs:t,ref:n})}catch(p){if(!(p instanceof Ge))throw p}let f=(await rl({fs:t,cache:e,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==s);let d=await fu({fs:t,gitdir:i,tree:f});return await cu({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote' +`,author:a,committer:o,signingKey:l})}async function hk({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l,cache:c={}}){try{R("fs",t),R("gitdir",i),R("oid",s);let u=new te(t),f=await ie({fsp:u,dotgit:i}),d=await $s({fs:u,gitdir:f,author:a});if(!d)throw new Xt("author");let h=await _a({fs:u,gitdir:f,author:d,committer:o});if(!h)throw new Xt("committer");return await bB({fs:u,cache:c,onSign:e,gitdir:f,ref:n,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function _B({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!lu(i,!0))throw new Gi(i,Gc.clean(i));if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let s=`refs/heads/${r}`,a=`refs/heads/${i}`;if(await q.exists({fs:t,gitdir:e,ref:a}))throw new Ui("branch",i,!1);let l=await q.resolve({fs:t,gitdir:e,ref:s,depth:1});await q.writeRef({fs:t,gitdir:e,ref:a,value:l}),await q.deleteRef({fs:t,gitdir:e,ref:s});let u=await Is({fs:t,gitdir:e,fullname:!0})===s;(n||u)&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function pk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,oldref:n,checkout:s=!1}){try{R("fs",t),R("gitdir",r),R("ref",i),R("oldref",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await _B({fs:a,gitdir:o,ref:i,oldref:n,checkout:s})}catch(a){throw a.caller="git.renameBranch",a}}async function mk({gitdir:t,type:e,object:r}){return wn(Cs.wrap({type:e,object:r}))}async function gk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,ref:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let a=new te(t),o=await ie({fsp:a,dotgit:r}),l,c;try{l=await q.resolve({fs:a,gitdir:o,ref:n||"HEAD"})}catch(d){if(n)throw d}if(l)try{l=await uu({fs:a,cache:s,gitdir:o,oid:l,filepath:i})}catch(d){l=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},f=e&&await a.read(H(e,i));f&&(c=await mk({gitdir:o,type:"blob",object:f}),l===c&&(u=await a.lstat(H(e,i)))),await dt.acquire({fs:a,gitdir:o,cache:s},async function(d){d.delete({filepath:i}),l&&d.insert({filepath:i,stats:u,oid:l})})}catch(a){throw a.caller="git.reset",a}}async function vk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,depth:n}){try{R("fs",t),R("gitdir",r),R("ref",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await q.resolve({fs:s,gitdir:a,ref:i,depth:n})}catch(s){throw s.caller="git.resolveRef",s}}async function wk({fs:t,dir:e,gitdir:r=H(e,".git"),path:i,value:n,append:s=!1}){try{R("fs",t),R("gitdir",r),R("path",i);let a=new te(t),o=await ie({fsp:a,dotgit:r}),l=await ht.get({fs:a,gitdir:o});s?await l.append(i,n):await l.set(i,n),await ht.save({fs:a,gitdir:o,config:l})}catch(a){throw a.caller="git.setConfig",a}}async function bk({fs:t,gitdir:e,commit:r}){let i=Dr.from(r).toObject();return await Or({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}var Ed=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${s} ${r} ${n} ${e.email} ${a} ${o} ${i} +`}static getStashReflogEntry(e,r=!1){return e.split(` +`).filter(s=>s).reverse().map((s,a)=>r?`stash@{${a}}: ${s.split(" ")[1]}`:s)}},xa=class t{constructor({fs:e,dir:r,gitdir:i=H(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return H(this.gitdir,t.refStash)}get refLogsStashPath(){return H(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await $s({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Xt("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:i}){return bk({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Gi(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?vn({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return q.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=Ed.createStashReflogEntry(i,e,r),s=this.refLogsStashPath;await Qo({filepath:s,entry:n},async()=>{let a=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,a+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return Ed.getStashReflogEntry(r,e)}};async function _k({fs:t,dir:e,gitdir:r,message:i=""}){let n=new xa({fs:t,dir:e,gitdir:r});await n.getAuthor();let s=await Is({fs:t,gitdir:r,fullname:!1}),a=await q.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await qg({fs:t,dir:e,gitdir:r,oid:a})).commit.message,c=[a],u=null,f=Kr({ref:"HEAD"}),d=await RE({fs:t,dir:e,gitdir:r,treePair:[Kr({ref:"HEAD"}),"stage"]});if(d){let w=await n.writeStashCommit({message:`stash-Index: WIP on ${s} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(w),u=d,f=Ea()}let h=await RE({fs:t,dir:e,gitdir:r,treePair:[f,"workdir"]});if(h){let w=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${s} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(w),u=h}if(!u||!d&&!h)throw new Ge("changes, nothing to stash");let p=(i.trim()||`WIP on ${s}`)+`: ${a.substring(0,7)} ${l}`;return{stashCommit:await n.writeStashCommit({message:p,tree:u,parent:c}),stashMsg:p,branch:s,stashMgr:n}}async function yB({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n,stashMsg:s,branch:a,stashMgr:o}=await _k({fs:t,dir:e,gitdir:r,message:i});return await o.writeStashRef(n),await o.writeStashReflogEntry({stashCommit:n,message:s}),await Vg({fs:t,dir:e,gitdir:r,ref:a,track:!1,force:!0}),n}async function xB({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n}=await _k({fs:t,dir:e,gitdir:r,message:i});return n}async function yk({fs:t,dir:e,gitdir:r,refIdx:i=0}){let s=await new xa({fs:t,dir:e,gitdir:r}).readStashCommit(i),{parent:a=null}=s.commit?s.commit:{};if(!(!a||!Array.isArray(a)))for(let o=0;o{await t.exists(a)&&await t.rm(a)});let o=await n.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(i,1);let l=n.refLogsStashPath;await Qo({reflogEntries:o,stashReflogPath:l,stashMgr:n},async()=>{if(o.length){await t.write(l,o.reverse().join(` +`)+` +`,"utf8");let c=o[o.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(l)})}async function EB({fs:t,dir:e,gitdir:r}){return new xa({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function SB({fs:t,dir:e,gitdir:r}){let i=new xa({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await Qo(n,async()=>{await Promise.all(n.map(async s=>{if(await t.exists(s))return t.rm(s)}))})}async function kB({fs:t,dir:e,gitdir:r,refIdx:i=0}){await yk({fs:t,dir:e,gitdir:r,refIdx:i}),await xk({fs:t,dir:e,gitdir:r,refIdx:i})}async function Ek({fs:t,dir:e,gitdir:r=H(e,".git"),op:i="push",message:n="",refIdx:s=0}){R("fs",t),R("dir",e),R("gitdir",r),R("op",i);let a={push:yB,apply:yk,drop:xk,list:EB,clear:SB,pop:kB,create:xB},o=["apply","drop","pop"];try{let l=new te(t),c=await ie({fsp:l,dotgit:r});["refs","logs","logs/refs"].map(d=>H(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=a[i];if(f){if(o.includes(i)&&s<0)throw new Gi(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:n,refIdx:s})}throw new Error(`To be implemented: ${i}`)}catch(l){throw l.caller="git.stash",l}}async function Sk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});if(await Rs.isIgnored({fs:s,gitdir:a,dir:e,filepath:i}))return"ignored";let l=await AB({fs:s,cache:n,gitdir:a}),c=await kk({fs:s,cache:n,gitdir:a,tree:l,path:i}),u=await dt.acquire({fs:s,gitdir:a,cache:n},async function(w){for(let y of w)if(y.path===i)return y;return null}),f=await s.lstat(H(e,i)),d=c!==null,h=u!==null,p=f!==null,g=async()=>{if(h&&!pd(u,f))return u.oid;{let w=await s.read(H(e,i)),y=await mk({gitdir:a,type:"blob",object:w});return h&&u.oid===y&&f.size!==-1&&dt.acquire({fs:s,gitdir:a,cache:n},async function(b){b.insert({filepath:i,stats:f,oid:y})}),y}};if(!d&&!p&&!h)return"absent";if(!d&&!p&&h)return"*absent";if(!d&&p&&!h)return"*added";if(!d&&p&&h)return await g()===u.oid?"added":"*added";if(d&&!p&&!h)return"deleted";if(d&&!p&&h)return c===u.oid,"*deleted";if(d&&p&&!h)return await g()===c?"*undeleted":"*undeletemodified";if(d&&p&&h){let w=await g();return w===c?w===u.oid?"unmodified":"*unmodified":w===u.oid?"modified":"*modified"}}catch(s){throw s.caller="git.status",s}}async function kk({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let s=n.shift();for(let a of i)if(a.path===s){if(n.length===0)return a.oid;let{type:o,object:l}=await et({fs:t,cache:e,gitdir:r,oid:a.oid});if(o==="tree"){let c=Mr.from(l);return kk({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(o==="blob")throw new _r(a.oid,o,"blob",n.join("/"))}return null}async function AB({fs:t,cache:e,gitdir:r}){let i;try{i=await q.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(s){if(s instanceof Ge)return[]}let{tree:n}=await rl({fs:t,cache:e,gitdir:r,oid:i});return n}async function Ak({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:s,cache:a={},ignored:o=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});return await Ps({fs:l,cache:a,dir:e,gitdir:c,trees:[Kr({ref:i}),tl(),Ea()],map:async function(u,[f,d,h]){if(!f&&!h&&d&&!o&&await Rs.isIgnored({fs:l,dir:e,filepath:u})||!n.some(v=>cS(u,v)))return null;if(s&&!s(u))return;let[p,g,w]=await Promise.all([f&&f.type(),d&&d.type(),h&&h.type()]),y=[p,g,w].includes("blob");if((p==="tree"||p==="special")&&!y)return;if(p==="commit")return null;if((g==="tree"||g==="special")&&!y)return;if(w==="commit")return null;if((w==="tree"||w==="special")&&!y)return;let b=p==="blob"?await f.oid():void 0,S=w==="blob"?await h.oid():void 0,C;p!=="blob"&&g==="blob"&&w!=="blob"?C="42":g==="blob"&&(C=await d.oid());let A=[void 0,b,C,S],k=A.map(v=>A.indexOf(v));return k.shift(),[u,...k]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function Ck({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,object:n,force:s=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let a=new te(t);if(i===void 0)throw new Ir("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let o=await ie({fsp:a,dotgit:r}),l=await q.resolve({fs:a,gitdir:o,ref:n||"HEAD"});if(!s&&await q.exists({fs:a,gitdir:o,ref:i}))throw new Ui("tag",i);await q.writeRef({fs:a,gitdir:o,ref:i,value:l})}catch(a){throw a.caller="git.tag",a}}async function Tk({fs:t,dir:e,gitdir:r=H(e,".git"),cache:i={},filepath:n,oid:s,mode:a,add:o,remove:l,force:c}){try{R("fs",t),R("gitdir",r),R("filepath",n);let u=new te(t),f=await ie({fsp:u,dotgit:r});if(l)return await dt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!c){let p=await u.lstat(H(e,n));if(p){if(p.isDirectory())throw new Ts("directory");return}}h.has({filepath:n})&&h.delete({filepath:n})});let d;if(!s){if(d=await u.lstat(H(e,n)),!d)throw new Ge(`file at "${n}" on disk and "remove" not set`);if(d.isDirectory())throw new Ts("directory")}return await dt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!o&&!h.has({filepath:n}))throw new Ge(`file at "${n}" in index and "add" not set`);let p;if(s)p={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:a,uid:0,gid:0,size:0};else{p=d;let g=p.isSymbolicLink()?await u.readlink(H(e,n)):await u.read(H(e,n));s=await Or({fs:u,gitdir:f,type:"blob",format:"content",object:g})}return h.insert({filepath:n,oid:s,stats:p}),s})}catch(u){throw u.caller="git.updateIndex",u}}function Pk(){try{return Ad.version}catch(t){throw t.caller="git.version",t}}async function Rk({fs:t,dir:e,gitdir:r=H(e,".git"),trees:i,map:n,reduce:s,iterate:a,cache:o={}}){try{R("fs",t),R("gitdir",r),R("trees",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});return await Ps({fs:l,cache:o,dir:e,gitdir:c,trees:i,map:n,reduce:s,iterate:a})}catch(l){throw l.caller="git.walk",l}}async function $k({fs:t,dir:e,gitdir:r=H(e,".git"),blob:i}){try{R("fs",t),R("gitdir",r),R("blob",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await Or({fs:n,gitdir:s,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}async function Fk({fs:t,dir:e,gitdir:r=H(e,".git"),commit:i}){try{R("fs",t),R("gitdir",r),R("commit",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await bk({fs:n,gitdir:s,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}async function Ik({fs:t,dir:e,gitdir:r=H(e,".git"),type:i,object:n,format:s="parsed",oid:a,encoding:o=void 0}){try{let l=new te(t),c=await ie({fsp:l,dotgit:r});if(s==="parsed"){switch(i){case"commit":n=Dr.from(n).toObject();break;case"tree":n=Mr.from(n).toObject();break;case"blob":n=E.from(n,o);break;case"tag":n=Xr.from(n).toObject();break;default:throw new _r(a||"",i,"blob|commit|tag|tree")}s="content"}return a=await Or({fs:l,gitdir:c,type:i,object:n,oid:a,format:s}),a}catch(l){throw l.caller="git.writeObject",l}}async function Mk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,value:n,force:s=!1,symbolic:a=!1}){try{R("fs",t),R("gitdir",r),R("ref",i),R("value",n);let o=new te(t);if(!lu(i,!0))throw new Gi(i,Gc.clean(i));let l=await ie({fsp:o,dotgit:r});if(!s&&await q.exists({fs:o,gitdir:l,ref:i}))throw new Ui("ref",i);a?await q.writeSymbolicRef({fs:o,gitdir:l,ref:i,value:n}):(n=await q.resolve({fs:o,gitdir:l,ref:n}),await q.writeRef({fs:o,gitdir:l,ref:i,value:n}))}catch(o){throw o.caller="git.writeRef",o}}async function CB({fs:t,gitdir:e,tag:r}){let i=Xr.from(r).toObject();return await Or({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}async function Dk({fs:t,dir:e,gitdir:r=H(e,".git"),tag:i}){try{R("fs",t),R("gitdir",r),R("tag",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await CB({fs:n,gitdir:s,tag:i})}catch(n){throw n.caller="git.writeTag",n}}async function Ok({fs:t,dir:e,gitdir:r=H(e,".git"),tree:i}){try{R("fs",t),R("gitdir",r),R("tree",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await fu({fs:n,gitdir:s,tree:i})}catch(n){throw n.caller="git.writeTree",n}}var TB={Errors:YE,STAGE:Ea,TREE:Kr,WORKDIR:tl,add:JE,abortMerge:KE,addNote:nS,addRemote:aS,annotatedTag:oS,branch:lS,cherryPick:dS,checkout:Vg,clone:vS,commit:wS,getConfig:IS,getConfigAll:MS,setConfig:wk,currentBranch:bS,deleteBranch:_S,deleteRef:yS,deleteRemote:xS,deleteTag:ES,expandOid:SS,expandRef:kS,fastForward:TS,fetch:PS,findMergeBase:RS,findRoot:FS,getRemoteInfo:DS,getRemoteInfo2:LS,hashBlob:NS,indexPack:BS,init:HS,isDescendent:GS,isIgnored:jS,listBranches:VS,listFiles:WS,listNotes:qS,listRefs:YS,listRemotes:ZS,listServerRefs:KS,listTags:XS,log:JS,merge:ek,packObjects:rk,pull:ik,push:nk,readBlob:ok,readCommit:qg,readNote:lk,readObject:ck,readTag:uk,readTree:fk,remove:dk,removeNote:hk,renameBranch:pk,resetIndex:gk,updateIndex:Tk,resolveRef:vk,status:Sk,statusMatrix:Ak,tag:Ck,version:Pk,walk:Rk,writeBlob:$k,writeCommit:Fk,writeObject:Ik,writeRef:Mk,writeTag:Dk,writeTree:Ok,stash:Ek};Z.Errors=YE;Z.STAGE=Ea;Z.TREE=Kr;Z.WORKDIR=tl;Z.abortMerge=KE;Z.add=JE;Z.addNote=nS;Z.addRemote=aS;Z.annotatedTag=oS;Z.branch=lS;Z.checkout=Vg;Z.cherryPick=dS;Z.clone=vS;Z.commit=wS;Z.currentBranch=bS;Z.default=TB;Z.deleteBranch=_S;Z.deleteRef=yS;Z.deleteRemote=xS;Z.deleteTag=ES;Z.expandOid=SS;Z.expandRef=kS;Z.fastForward=TS;Z.fetch=PS;Z.findMergeBase=RS;Z.findRoot=FS;Z.getConfig=IS;Z.getConfigAll=MS;Z.getRemoteInfo=DS;Z.getRemoteInfo2=LS;Z.hashBlob=NS;Z.indexPack=BS;Z.init=HS;Z.isDescendent=GS;Z.isIgnored=jS;Z.listBranches=VS;Z.listFiles=WS;Z.listNotes=qS;Z.listRefs=YS;Z.listRemotes=ZS;Z.listServerRefs=KS;Z.listTags=XS;Z.log=JS;Z.merge=ek;Z.packObjects=rk;Z.pull=ik;Z.push=nk;Z.readBlob=ok;Z.readCommit=qg;Z.readNote=lk;Z.readObject=ck;Z.readTag=uk;Z.readTree=fk;Z.remove=dk;Z.removeNote=hk;Z.renameBranch=pk;Z.resetIndex=gk;Z.resolveRef=vk;Z.setConfig=wk;Z.stash=Ek;Z.status=Sk;Z.statusMatrix=Ak;Z.tag=Ck;Z.updateIndex=Tk;Z.version=Pk;Z.walk=Rk;Z.writeBlob=$k;Z.writeCommit=Fk;Z.writeObject=Ik;Z.writeRef=Mk;Z.writeTag=Dk;Z.writeTree=Ok});var Vk=U((zz,jk)=>{"use strict";m();jk.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Wk=U((qz,zk)=>{m();var tv={px:{px:1,cm:37.79527559055118,mm:3.7795275590551185,in:96,pt:1.3333333333333333,pc:16},cm:{px:.026458333333333334,cm:1,mm:.1,in:2.54,pt:.035277777777777776,pc:.42333333333333334},mm:{px:.26458333333333334,cm:10,mm:1,in:25.4,pt:.35277777777777775,pc:4.233333333333333},in:{px:.010416666666666666,cm:.39370078740157477,mm:.03937007874015748,in:1,pt:.013888888888888888,pc:.16666666666666666},pt:{px:.75,cm:28.346456692913385,mm:2.834645669291339,in:72,pt:1,pc:12},pc:{px:.0625,cm:2.3622047244094486,mm:.2362204724409449,in:6,pt:.08333333333333333,pc:1},deg:{deg:1,grad:.9,rad:180/Math.PI,turn:360},grad:{deg:1.1111111111111112,grad:1,rad:200/Math.PI,turn:400},rad:{deg:Math.PI/180,grad:Math.PI/200,rad:1,turn:Math.PI*2},turn:{deg:.002777777777777778,grad:.0025,rad:.5/Math.PI,turn:1},s:{s:1,ms:.001},ms:{s:1e3,ms:1},Hz:{Hz:1,kHz:1e3},kHz:{Hz:.001,kHz:1},dpi:{dpi:1,dpcm:.39370078740157477,dppx:.010416666666666666},dpcm:{dpi:2.54,dpcm:1,dppx:.026458333333333334},dppx:{dpi:96,dpcm:37.79527559055118,dppx:1}};zk.exports=function(t,e,r,i){if(!tv.hasOwnProperty(r))throw new Error("Cannot convert to "+r);if(!tv[r].hasOwnProperty(e))throw new Error("Cannot convert from "+e+" to "+r);var n=tv[r][e]*t;return i!==!1?(i=Math.pow(10,parseInt(i)||5),Math.round(n*i)/i):n}});var aA=U(Wn=>{"use strict";m();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.fromRgba=sl;Wn.fromRgb=rv;Wn.fromHsla=Id;Wn.fromHsl=nA;Wn.fromString=sA;Wn.default=void 0;var qk=Kk(Vk()),MB=Kk(Wk());function Kk(t){return t&&t.__esModule?t:{default:t}}function DB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yk(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,i=new Array(e);r-1}function UB(t,e,r){var i=t/255,n=e/255,s=r/255,a=Math.max(i,n,s),o=Math.min(i,n,s),l=a-o,c=(a+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=(function(){switch(a){case i:return(n-s)/l%6;case n:return(s-i)/l+2;default:return(i-n)/l+4}})();return[f*60,u*100,c*100]}function GB(t,e,r){var i=t/60,n=e/100,s=r/100,a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(i%2-1)),l=s-a/2,c=(function(){return i<1?[a,o,0]:i<2?[o,a,0]:i<3?[0,a,o]:i<4?[0,o,a]:i<5?[o,0,a]:[a,0,o]})(),u=yr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var jB=(function(){function t(e){var r=yr(e,4),i=r[0],n=r[1],s=r[2],a=r[3];DB(this,t),this.values=[Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(s,10),255),0),a==null?1:Math.max(Math.min(parseFloat(a),255),0)]}return OB(t,[{key:"toRgbString",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return a===1?"rgb(".concat(i,", ").concat(n,", ").concat(s,")"):"rgba(".concat(i,", ").concat(n,", ").concat(s,", ").concat(a,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),i=yr(r,4),n=i[0],s=i[1],a=i[2],o=i[3];return o===1?"hsl(".concat(n,", ").concat(s,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(s,"%, ").concat(a,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return i=Number(i).toString(16).padStart(2,"0"),n=Number(n).toString(16).padStart(2,"0"),s=Number(s).toString(16).padStart(2,"0"),a=a<1?parseInt(a*255,10).toString(16).padStart(2,"0"):"","#".concat(i).concat(n).concat(s).concat(a)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3],o=UB(i,n,s),l=yr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,a]}}]),t})();function sl(t){var e=yr(t,4),r=e[0],i=e[1],n=e[2],s=e[3];return new jB([r,i,n,s])}function rv(t){var e=yr(t,3),r=e[0],i=e[1],n=e[2];return sl([r,i,n,1])}function Id(t){var e=yr(t,4),r=e[0],i=e[1],n=e[2],s=e[3],a=GB(r,i,n),o=yr(a,3),l=o[0],c=o[1],u=o[2];return sl([l,c,u,s])}function nA(t){var e=yr(t,3),r=e[0],i=e[1],n=e[2];return Id([r,i,n,1])}function VB(t){var e=Xk.exec(t)||Qk.exec(t),r=yr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=parseInt(i.length<2?i.repeat(2):i,16),n=parseInt(n.length<2?n.repeat(2):n,16),s=parseInt(s.length<2?s.repeat(2):s,16),a=a&&(parseInt(a.length<2?a.repeat(2):a,16)/255).toPrecision(1)||1,sl([i,n,s,a])}function zB(t){var e=Jk.exec(t)||tA.exec(t)||eA.exec(t)||rA.exec(t),r=yr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=mu(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),n=mu(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),s=mu(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),a=a===void 0?1:parseFloat(a)/(mu(a,"%")?100:1),sl([i,n,s,a])}function WB(t){var e=iA.exec(t),r=yr(e,6),i=r[1],n=r[2],s=r[3],a=r[4],o=r[5];return n=n||"deg",i=(0,MB.default)(parseFloat(i),n,"deg"),s=parseFloat(s),a=parseFloat(a),o=o===void 0?1:parseFloat(o)/(mu(o,"%")?100:1),Id([i,s,a,o])}function sA(t){return qk.default[t]?rv(qk.default[t]):Xk.test(t)||Qk.test(t)?VB(t):Jk.test(t)||tA.test(t)||eA.test(t)||rA.test(t)?zB(t):iA.test(t)?WB(t):null}var qB={fromString:sA,fromRgb:rv,fromRgba:sl,fromHsl:nA,fromHsla:Id};Wn.default=qB});var wA=U((n9,vA)=>{m();vA.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=n+1,l=[],c=[],u,f,d=function(){n>=s&&(u=r,f=n,r=i,i=u,n=s,s=f,a=!0,o=n+1)},h=function(g,w,y,b,S){return{startX:g,startY:w,endX:y,endY:b,r:S}},p=function(g,w,y){var b,S,C,A,k;for(w>y?b=l[g-1+o]:b=l[g+1+o],k=C=Math.max(w,y),A=S=C-g;S=g+1;--A)y[A+o]=p(A,y[A-1+o]+1,y[A+1+o]);y[g+o]=p(g,y[g-1+o]+1,y[g+1+o])}while(y[g+o]!==s);for(ed=g+2*b,S=l[g+o],k=n,v=s,x=[];S!==-1;){let _=c[S];(n!=_.endX||s!=_.endY)&&x.push({file1:[a?_.endY:_.endX,a?v-_.endY:k-_.endX],file2:[a?_.endX:_.endY,a?k-_.endX:v-_.endY]}),k=_.startX,v=_.startY,S=c[S].r}return(k!=0||v!=0)&&x.push({file1:[0,a?v:k],file2:[0,a?k:v]}),x.reverse(),x}}}});var yA=U((a9,_A)=>{m();var bA=wA();function KB(t,e,r){var i,n=new bA(e,t).compose(),s=new bA(e,r).compose(),a=[];function o($,D){a.push([$.file1[0],D,$.file1[1],$.file2[0],$.file2[1]])}for(i=0;ic&&(l.push([1,c,$-c]),c=$)}for(var f=0;fg)break;g=Math.max(g,y+w[2]),f++}if(u(p),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var S=h[1],C=b[S],A=h[0],k=A+h[2],v=h[3],x=v+h[4];C[0]=Math.min(v,C[0]),C[1]=Math.max(x,C[1]),C[2]=Math.min(A,C[2]),C[3]=Math.max(k,C[3])}var _=b[0][0]+(p-b[0][2]),P=b[0][1]+(g-b[0][3]),T=b[2][0]+(p-b[2][2]),M=b[2][1]+(g-b[2][3]);l.push([-1,_,P-_,p,g-p,T,M-T])}c=g}return u(e.length),l}function XB(t,e,r){var i=[],n=[t,e,r],s=KB(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var p=0;p{m();var ul=1e3,fl=ul*60,dl=fl*60,Aa=dl*24,e3=Aa*7,t3=Aa*365.25;EA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return r3(t);if(r==="number"&&isFinite(t))return e.long?n3(t):i3(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function r3(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*t3;case"weeks":case"week":case"w":return r*e3;case"days":case"day":case"d":return r*Aa;case"hours":case"hour":case"hrs":case"hr":case"h":return r*dl;case"minutes":case"minute":case"mins":case"min":case"m":return r*fl;case"seconds":case"second":case"secs":case"sec":case"s":return r*ul;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function i3(t){var e=Math.abs(t);return e>=Aa?Math.round(t/Aa)+"d":e>=dl?Math.round(t/dl)+"h":e>=fl?Math.round(t/fl)+"m":e>=ul?Math.round(t/ul)+"s":t+"ms"}function n3(t){var e=Math.abs(t);return e>=Aa?Ld(t,e,Aa,"day"):e>=dl?Ld(t,e,dl,"hour"):e>=fl?Ld(t,e,fl,"minute"):e>=ul?Ld(t,e,ul,"second"):t+" ms"}function Ld(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var AA=U((w9,kA)=>{m();function s3(t){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=n,r.enabled=o,r.humanize=SA(),r.destroy=c,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let f=0;for(let d=0;d{if(k==="%%")return"%";C++;let x=r.formatters[v];if(typeof x=="function"){let _=w[C];k=x.call(y,_),w.splice(C,1),C--}return k}),r.formatArgs.call(y,w),(y.log||r.log).apply(y,w)}return g.namespace=u,g.useColors=r.useColors(),g.color=r.selectColor(u),g.extend=i,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==r.namespaces&&(h=r.namespaces,p=r.enabled(u)),p),set:w=>{d=w}}),typeof r.init=="function"&&r.init(g),g}function i(u,f){let d=r(this.namespace+(typeof f=="undefined"?":":f)+u);return d.log=this.log,d}function n(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(u,f){let d=0,h=0,p=-1,g=0;for(;d"-"+f)].join(",");return r.enable(""),u}function o(u){for(let f of r.skips)if(s(u,f))return!1;for(let f of r.names)if(s(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}kA.exports=s3});var Bd=U((Lr,Nd)=>{m();Lr.formatArgs=o3;Lr.save=l3;Lr.load=c3;Lr.useColors=a3;Lr.storage=u3();Lr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Lr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function a3(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o3(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Nd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}Lr.log=console.debug||console.log||(()=>{});function l3(t){try{t?Lr.storage.setItem("debug",t):Lr.storage.removeItem("debug")}catch(e){}}function c3(){let t;try{t=Lr.storage.getItem("debug")||Lr.storage.getItem("DEBUG")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function u3(){try{return localStorage}catch(t){}}Nd.exports=AA()(Lr);var{formatters:f3}=Nd.exports;f3.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var CA=U(Qr=>{"use strict";m();var d3=Qr&&Qr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qr,"__esModule",{value:!0});var h3=require("fs"),p3=d3(Bd()),hl=p3.default("@kwsites/file-exists");function m3(t,e,r){hl("checking %s",t);try{let i=h3.statSync(t);return i.isFile()&&e?(hl("[OK] path represents a file"),!0):i.isDirectory()&&r?(hl("[OK] path represents a directory"),!0):(hl("[FAIL] path represents something other than a file or directory"),!1)}catch(i){if(i.code==="ENOENT")return hl("[FAIL] path is not accessible: %o",i),!1;throw hl("[FATAL] %o",i),i}}function g3(t,e=Qr.READABLE){return m3(t,(e&Qr.FILE)>0,(e&Qr.FOLDER)>0)}Qr.exists=g3;Qr.FILE=1;Qr.FOLDER=2;Qr.READABLE=Qr.FILE+Qr.FOLDER});var TA=U(Hd=>{"use strict";m();function v3(t){for(var e in t)Hd.hasOwnProperty(e)||(Hd[e]=t[e])}Object.defineProperty(Hd,"__esModule",{value:!0});v3(CA())});var uv=U(Ca=>{"use strict";m();Object.defineProperty(Ca,"__esModule",{value:!0});Ca.createDeferred=Ca.deferred=void 0;function cv(){let t,e,r="pending";return{promise:new Promise((n,s)=>{t=n,e=s}),done(n){r==="pending"&&(r="resolved",t(n))},fail(n){r==="pending"&&(r="rejected",e(n))},get fulfilled(){return r!=="pending"},get status(){return r}}}Ca.deferred=cv;Ca.createDeferred=cv;Ca.default=cv});var _2=U(()=>{m()});var y2=U(()=>{m()});var rw=U((RW,sh)=>{m();(function(){"use strict";var t="input is invalid type",e=typeof window=="object",r=e?window:{};r.JS_SHA256_NO_WINDOW&&(e=!1);var i=!e&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node&&process.type!="renderer";n?r=global:i&&(r=self);var s=!r.JS_SHA256_NO_COMMON_JS&&typeof sh=="object"&&sh.exports,a=typeof define=="function"&&define.amd,o=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",l="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],u=[24,16,8,0],f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=["hex","array","digest","arrayBuffer"],h=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),o&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(k){return typeof k=="object"&&k.buffer&&k.buffer.constructor===ArrayBuffer});var p=function(k,v){return function(x){return new S(v,!0).update(x)[k]()}},g=function(k){var v=p("hex",k);n&&(v=w(v,k)),v.create=function(){return new S(k)},v.update=function(P){return v.create().update(P)};for(var x=0;x>>2]|=k[P]<>>2]|=_<>>2]|=(192|_>>>6)<>>2]|=(128|_&63)<=57344?($[T>>>2]|=(224|_>>>12)<>>2]|=(128|_>>>6&63)<>>2]|=(128|_&63)<>>2]|=(240|_>>>18)<>>2]|=(128|_>>>12&63)<>>2]|=(128|_>>>6&63)<>>2]|=(128|_&63)<=64?(this.block=$[16],this.start=T-64,this.hash(),this.hashed=!0):this.start=T}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var k=this.blocks,v=this.lastByteIndex;k[16]=this.block,k[v>>>2]|=c[v&3],this.block=k[16],v>=56&&(this.hashed||this.hash(),k[0]=this.block,k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0),k[14]=this.hBytes<<3|this.bytes>>>29,k[15]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var k=this.h0,v=this.h1,x=this.h2,_=this.h3,P=this.h4,T=this.h5,M=this.h6,$=this.h7,D=this.blocks,Q,ye,de,J,X,he,z,K,G,Me,Et;for(Q=16;Q<64;++Q)X=D[Q-15],ye=(X>>>7|X<<25)^(X>>>18|X<<14)^X>>>3,X=D[Q-2],de=(X>>>17|X<<15)^(X>>>19|X<<13)^X>>>10,D[Q]=D[Q-16]+ye+D[Q-7]+de<<0;for(Et=v&x,Q=0;Q<64;Q+=4)this.first?(this.is224?(K=300032,X=D[0]-1413257819,$=X-150054599<<0,_=X+24177077<<0):(K=704751109,X=D[0]-210244248,$=X-1521486534<<0,_=X+143694565<<0),this.first=!1):(ye=(k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10),de=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),K=k&v,J=K^k&x^Et,z=P&T^~P&M,X=$+de+z+f[Q]+D[Q],he=ye+J,$=_+X<<0,_=X+he<<0),ye=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),de=($>>>6|$<<26)^($>>>11|$<<21)^($>>>25|$<<7),G=_&k,J=G^_&v^K,z=$&P^~$&T,X=M+de+z+f[Q+1]+D[Q+1],he=ye+J,M=x+X<<0,x=X+he<<0,ye=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),de=(M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7),Me=x&_,J=Me^x&k^G,z=M&$^~M&P,X=T+de+z+f[Q+2]+D[Q+2],he=ye+J,T=v+X<<0,v=X+he<<0,ye=(v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10),de=(T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7),Et=v&x,J=Et^v&_^Me,z=T&M^~T&$,X=P+de+z+f[Q+3]+D[Q+3],he=ye+J,P=k+X<<0,k=X+he<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+k<<0,this.h1=this.h1+v<<0,this.h2=this.h2+x<<0,this.h3=this.h3+_<<0,this.h4=this.h4+P<<0,this.h5=this.h5+T<<0,this.h6=this.h6+M<<0,this.h7=this.h7+$<<0},S.prototype.hex=function(){this.finalize();var k=this.h0,v=this.h1,x=this.h2,_=this.h3,P=this.h4,T=this.h5,M=this.h6,$=this.h7,D=l[k>>>28&15]+l[k>>>24&15]+l[k>>>20&15]+l[k>>>16&15]+l[k>>>12&15]+l[k>>>8&15]+l[k>>>4&15]+l[k&15]+l[v>>>28&15]+l[v>>>24&15]+l[v>>>20&15]+l[v>>>16&15]+l[v>>>12&15]+l[v>>>8&15]+l[v>>>4&15]+l[v&15]+l[x>>>28&15]+l[x>>>24&15]+l[x>>>20&15]+l[x>>>16&15]+l[x>>>12&15]+l[x>>>8&15]+l[x>>>4&15]+l[x&15]+l[_>>>28&15]+l[_>>>24&15]+l[_>>>20&15]+l[_>>>16&15]+l[_>>>12&15]+l[_>>>8&15]+l[_>>>4&15]+l[_&15]+l[P>>>28&15]+l[P>>>24&15]+l[P>>>20&15]+l[P>>>16&15]+l[P>>>12&15]+l[P>>>8&15]+l[P>>>4&15]+l[P&15]+l[T>>>28&15]+l[T>>>24&15]+l[T>>>20&15]+l[T>>>16&15]+l[T>>>12&15]+l[T>>>8&15]+l[T>>>4&15]+l[T&15]+l[M>>>28&15]+l[M>>>24&15]+l[M>>>20&15]+l[M>>>16&15]+l[M>>>12&15]+l[M>>>8&15]+l[M>>>4&15]+l[M&15];return this.is224||(D+=l[$>>>28&15]+l[$>>>24&15]+l[$>>>20&15]+l[$>>>16&15]+l[$>>>12&15]+l[$>>>8&15]+l[$>>>4&15]+l[$&15]),D},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var k=this.h0,v=this.h1,x=this.h2,_=this.h3,P=this.h4,T=this.h5,M=this.h6,$=this.h7,D=[k>>>24&255,k>>>16&255,k>>>8&255,k&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255,M>>>24&255,M>>>16&255,M>>>8&255,M&255];return this.is224||D.push($>>>24&255,$>>>16&255,$>>>8&255,$&255),D},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var k=new ArrayBuffer(this.is224?28:32),v=new DataView(k);return v.setUint32(0,this.h0),v.setUint32(4,this.h1),v.setUint32(8,this.h2),v.setUint32(12,this.h3),v.setUint32(16,this.h4),v.setUint32(20,this.h5),v.setUint32(24,this.h6),this.is224||v.setUint32(28,this.h7),k};function C(k,v,x){var _,P=typeof k;if(P==="string"){var T=[],M=k.length,$=0,D;for(_=0;_>>6,T[$++]=128|D&63):D<55296||D>=57344?(T[$++]=224|D>>>12,T[$++]=128|D>>>6&63,T[$++]=128|D&63):(D=65536+((D&1023)<<10|k.charCodeAt(++_)&1023),T[$++]=240|D>>>18,T[$++]=128|D>>>12&63,T[$++]=128|D>>>6&63,T[$++]=128|D&63);k=T}else if(P==="object"){if(k===null)throw new Error(t);if(o&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!o||!ArrayBuffer.isView(k)))throw new Error(t)}else throw new Error(t);k.length>64&&(k=new S(v,!0).update(k).array());var Q=[],ye=[];for(_=0;_<64;++_){var de=k[_]||0;Q[_]=92^de,ye[_]=54^de}S.call(this,v,x),this.update(ye),this.oKeyPad=Q,this.inner=!0,this.sharedMemory=x}C.prototype=new S,C.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var k=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(k),S.prototype.finalize.call(this)}};var A=g();A.sha256=A,A.sha224=g(!0),A.sha256.hmac=b(),A.sha224.hmac=b(!0),s?sh.exports=A:(r.sha256=A.sha256,r.sha224=A.sha224,a&&define(function(){return A}))})()});var rR=U(jw=>{m();(function(t){var e=/\S/,r=/\"/g,i=/\n/g,n=/\r/g,s=/\\/g,a=/\u2028/,o=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(x,_){var P=x.length,T=0,M=1,$=2,D=T,Q=null,ye=null,de="",J=[],X=!1,he=0,z=0,K="{{",G="}}";function Me(){de.length>0&&(J.push({tag:"_t",text:new String(de)}),de="")}function Et(){for(var Rt=!0,$t=z;$t"&&(re.indent=J[Xe].text.toString()),J.splice(Xe,1));else $t||J.push({tag:` +`});X=!1,z=J.length}function De(Rt,$t){var Xe="="+G,re=Rt.indexOf(Xe,$t),B=c(Rt.substring(Rt.indexOf("=",$t)+1,re)).split(" ");return K=B[0],G=B[B.length-1],re+Xe.length-1}for(_&&(_=_.split(" "),K=_[0],G=_[1]),he=0;he0;){if(D=v.shift(),$&&$.tag=="<"&&!(D.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[D.tag]<=t.tags.$||h(D,P))_.push(D),D.nodes=d(v,D.tag,_,P);else if(D.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+D.n);if(M=_.pop(),D.n!=M.n&&!p(D.n,M.n,P))throw new Error("Nesting error: "+M.n+" vs. "+D.n);return M.end=D.i,T}else D.tag==` +`&&(D.last=v.length==0||v[0].tag==` +`);T.push(D)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return T}function h(v,x){for(var _=0,P=x.length;_":C,"<":function(v,x){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(v.nodes,_);var P=x.partials[C(v,x)];P.subs=_.subs,P.partials=_.partials},$:function(v,x){var _={subs:{},code:"",partials:x.partials,prefix:v.n};t.walk(v.nodes,_),x.subs[v.n]=_.code,x.inPartial||(x.code+='t.sub("'+b(v.n)+'",c,p,i);')},"\n":function(v,x){x.code+=k('"\\n"'+(v.last?"":" + i"))},_v:function(v,x){x.code+="t.b(t.v(t."+S(v.n)+'("'+b(v.n)+'",c,p,0)));'},_t:function(v,x){x.code+=k('"'+b(v.text)+'"')},"{":A,"&":A};function A(v,x){x.code+="t.b(t.t(t."+S(v.n)+'("'+b(v.n)+'",c,p,0)));'}function k(v){return"t.b("+v+");"}t.walk=function(v,x){for(var _,P=0,T=v.length;P{m();var c4={};(function(t){t.Template=function(d,h,p,g){d=d||{},this.r=d.code||this.r,this.c=p,this.options=g||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},t.Template.prototype={r:function(d,h,p){return""},v:u,t:c,render:function(h,p,g){return this.ri([h],p||{},g)},ri:function(d,h,p){return this.r(d,h,p)},ep:function(d,h){var p=this.partials[d],g=h[p.name];if(p.instance&&p.base==g)return p.instance;if(typeof g=="string"){if(!this.c)throw new Error("No compiler available.");g=this.c.compile(g,this.options)}if(!g)return null;if(this.partials[d].base=g,p.subs){h.stackText||(h.stackText={});for(key in p.subs)h.stackText[key]||(h.stackText[key]=this.activeSub!==void 0&&h.stackText[this.activeSub]?h.stackText[this.activeSub]:this.text);g=r(g,p.subs,p.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=g,g},rp:function(d,h,p,g){var w=this.ep(d,p);return w?w.ri(h,p,g):""},rs:function(d,h,p){var g=d[d.length-1];if(!f(g)){p(d,h,this);return}for(var w=0;w=0;C--)if(y=h[C],w=e(d,y,S),w!==void 0){b=!0;break}return b?(!g&&typeof w=="function"&&(w=this.mv(w,h,p)),w):g?!1:""},ls:function(d,h,p,g,w,y){var b=this.options.delimiters;return this.options.delimiters=y,this.b(this.ct(c(d.call(h,w,p)),h,g)),this.options.delimiters=b,!1},ct:function(d,h,p){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(d,this.options).render(h,p)},b:function(d){this.buf+=d},fl:function(){var d=this.buf;return this.buf="",d},ms:function(d,h,p,g,w,y,b){var S,C=h[h.length-1],A=d.call(C);return typeof A=="function"?g?!0:(S=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(A,C,h,p,S.substring(w,y),b)):A},mv:function(d,h,p){var g=h[h.length-1],w=d.call(g);return typeof w=="function"?this.ct(c(w.call(g)),g,p):w},sub:function(d,h,p,g){var w=this.subs[d];w&&(this.activeSub=d,w(h,p,this,g),this.activeSub=!1)}};function e(d,h,p){var g;return h&&typeof h=="object"&&(h[d]!==void 0?g=h[d]:p&&h.get&&typeof h.get=="function"&&(g=h.get(d))),g}function r(d,h,p,g,w,y){function b(){}b.prototype=d;function S(){}S.prototype=d.subs;var C,A=new b;A.subs=new S,A.subsText={},A.buf="",g=g||{},A.stackSubs=g,A.subsText=y;for(C in h)g[C]||(g[C]=h[C]);for(C in g)A.subs[C]=g[C];w=w||{},A.stackPartials=w;for(C in p)w[C]||(w[C]=p[C]);for(C in w)A.partials[C]=w[C];return A}var i=/&/g,n=//g,a=/\'/g,o=/\"/g,l=/[&<>\"\']/;function c(d){return String(d==null?"":d)}function u(d){return d=c(d),l.test(d)?d.replace(i,"&").replace(n,"<").replace(s,">").replace(a,"'").replace(o,"""):d}var f=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}})(typeof Vw!="undefined"?Vw:c4)});var zw=U((hY,nR)=>{m();var Bh=rR();Bh.Template=iR().Template;Bh.template=Bh.Template;nR.exports=Bh});var oR=U(Ai=>{"use strict";m();Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ColorSchemeType=Ai.DiffStyleType=Ai.LineMatchingType=Ai.OutputFormatType=Ai.LineType=void 0;var sR;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(sR||(Ai.LineType=sR={}));Ai.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"};Ai.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"};Ai.DiffStyleType={WORD:"word",CHAR:"char"};var aR;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(aR||(Ai.ColorSchemeType=aR={}))});var pG={};DF(pG,{default:()=>Vp});module.exports=OF(pG);m();var hF=Gt(Yg(),1),Se=require("obsidian"),pF=Gt(require("path"),1),zp=Gt(require("fs/promises"),1);m();var zt={};m();var Cd=class{constructor(e){this.plugin=e;this.tasks=[]}addTask(e,r){this.tasks.push({task:e,onFinished:r!=null?r:(()=>{})}),this.tasks.length===1&&this.handleTask()}handleTask(){if(this.tasks.length>0){let e=this.tasks[0];e.task().then(r=>{e.onFinished(r),this.tasks.shift(),this.handleTask()},r=>{this.plugin.displayError(r),e.onFinished(void 0),this.tasks.shift(),this.handleTask()})}}clear(){this.tasks=[]}};m();var j=require("obsidian");m();var Lk=require("obsidian"),Td="YYYY-MM-DD",Zg=`${Td} HH:mm`,Kg=`${Td} HH:mm:ss`,Pd=40,il="conflict-files-obsidian-git.md",pt={commitMessage:"vault backup: {{date}}",autoCommitMessage:"vault backup: {{date}}",commitMessageScript:"",commitDateFormat:Kg,autoSaveInterval:0,autoPushInterval:0,autoPullInterval:0,autoPullOnBoot:!1,autoCommitOnlyStaged:!1,disablePush:!1,pullBeforePush:!0,disablePopups:!1,showErrorNotices:!0,disablePopupsForNoChanges:!1,listChangedFilesInMessageBody:!1,showStatusBar:!0,updateSubmodules:!1,syncMethod:"merge",mergeStrategy:"none",customMessageOnAutoBackup:!1,autoBackupAfterFileChange:!1,treeStructure:!1,refreshSourceControl:Lk.Platform.isDesktopApp,basePath:"",differentIntervalCommitAndPush:!1,changedFilesInStatusBar:!1,showedMobileNotice:!1,refreshSourceControlTimer:7e3,showBranchStatusBar:!0,setLastSaveToLastCommit:!1,submoduleRecurseCheckout:!1,gitDir:"",showFileMenu:!0,authorInHistoryView:"hide",dateInHistoryView:!1,diffStyle:"split",hunks:{showSigns:!1,hunkCommands:!1,statusBar:"disabled"},lineAuthor:{show:!1,followMovement:"inactive",authorDisplay:"initials",showCommitHash:!1,dateTimeFormatOptions:"date",dateTimeFormatCustomString:Zg,dateTimeTimezone:"viewer-local",coloringMaxAge:"1y",colorNew:{r:255,g:150,b:150},colorOld:{r:120,g:160,b:255},textColorCss:"var(--text-muted)",ignoreWhitespace:!1}},Qt={type:"git-view",name:"Source Control",icon:"git-pull-request"},bi={type:"git-history-view",name:"History",icon:"history"},Ms={type:"split-diff-view",name:"Diff view",icon:"diff"},Ds={type:"diff-view",name:"Diff View",icon:"git-pull-request"},Rd="C:\\Program Files\\Git\\cmd\\git.exe",$d=".git_credentials_input",Sa="obsidian_askpass.sh",Nk=`#!/bin/sh + +PROMPT="$1" +TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT" + +cleanup() { + rm -f "$TEMP_FILE" "$TEMP_FILE.response" +} +trap cleanup EXIT + +echo "$PROMPT" > "$TEMP_FILE" + +while [ ! -e "$TEMP_FILE.response" ]; do + if [ ! -e "$TEMP_FILE" ]; then + echo "Trigger file got removed: Abort" >&2 + exit 1 + fi + sleep 0.1 +done + +RESPONSE=$(cat "$TEMP_FILE.response") + +echo "$RESPONSE" +`,Bk=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];m();m();m();var hu=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&p+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,w=1/0,y=()=>{for(let b=Math.max(g,-c);b<=Math.min(w,c);b+=2){let S,C=h[b-1],A=h[b+1];C&&(h[b-1]=void 0);let k=!1;if(A){let x=A.oldPos-b;k=A&&0<=x&&x=l&&p+1>=o)return a(this.buildValues(S.lastComponent,r,e))||!0;h[b]=S,S.oldPos+1>=l&&(w=Math.min(w,b-1)),p+1>=o&&(g=Math.max(g,b+1))}c++};if(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);y()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=y();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1d.length?p:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return n}};m();var Xg=class extends hu{constructor(){super(...arguments),this.tokenize=RB}equals(e,r,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(` +`))&&(e=e.trim()),(!i.newlineIsToken||!r.includes(` +`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(` +`)&&(e=e.slice(0,-1)),r.endsWith(` +`)&&(r=r.slice(0,-1))),super.equals(e,r,i)}},PB=new Xg;function Qg(t,e,r){return PB.diff(t,e,r)}function RB(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` +`));let r=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n"~"||t[e]==='"'||t[e]==="\\")return!0;return!1}function Os(t){if(!$B(t))return t;let e='"',r=new TextEncoder().encode(t),i=0;for(;i=32&&n<=126?e+=String.fromCharCode(n):e+="\\"+n.toString(8).padStart(3,"0"),i++}return e+='"',e}var Jg={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ev(t,e,r,i,n,s,a){let o;a?typeof a=="function"?o={callback:a}:o=a:o={},typeof o.context=="undefined"&&(o.context=4);let l=o.context;if(o.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(o.callback){let{callback:u}=o;Qg(r,i,Object.assign(Object.assign({},o),{callback:f=>{let d=c(f);u(d)}}))}else return c(Qg(r,i,o));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(b){return b.map(function(S){return" "+S})}let d=[],h=0,p=0,g=[],w=1,y=1;for(let b=0;b0?f(A.lines.slice(-l)):[],h-=g.length,p-=g.length)}for(let A of C)g.push((S.added?"+":"-")+A);S.added?y+=C.length:w+=C.length}else{if(h)if(C.length<=l*2&&b1&&!e.includeFileHeaders&&!t.every(u=>u.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(u=>Fd(u,e)).join(` +`)}let l=[];if(t.isGit){if(e=Jg,!t.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!t.newFileName)throw new Error("newFileName must be specified for Git patches");let u=t.oldFileName,f=t.newFileName;t.isCreate&&u==="/dev/null"?u=f.replace(/^b\//,"a/"):t.isDelete&&f==="/dev/null"&&(f=u.replace(/^a\//,"b/")),l.push("diff --git "+Os(u)+" "+Os(f)),t.isDelete&&l.push("deleted file mode "+((r=t.oldMode)!==null&&r!==void 0?r:"100644")),t.isCreate&&l.push("new file mode "+((i=t.newMode)!==null&&i!==void 0?i:"100644")),t.oldMode&&t.newMode&&!t.isDelete&&!t.isCreate&&(l.push("old mode "+t.oldMode),l.push("new mode "+t.newMode)),t.isRename&&(l.push("rename from "+Os(((n=t.oldFileName)!==null&&n!==void 0?n:"").replace(/^a\//,""))),l.push("rename to "+Os(((s=t.newFileName)!==null&&s!==void 0?s:"").replace(/^b\//,"")))),t.isCopy&&(l.push("copy from "+Os(((a=t.oldFileName)!==null&&a!==void 0?a:"").replace(/^a\//,""))),l.push("copy to "+Os(((o=t.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,""))))}else e.includeIndex&&t.oldFileName==t.newFileName&&t.oldFileName!==void 0&&l.push("Index: "+t.oldFileName),e.includeUnderline&&l.push("===================================================================");let c=t.hunks.length>0;e.includeFileHeaders&&t.oldFileName!==void 0&&t.newFileName!==void 0&&(!t.isGit||c)&&(l.push("--- "+Os(t.oldFileName)+(t.oldHeader?" "+t.oldHeader:"")),l.push("+++ "+Os(t.newFileName)+(t.newHeader?" "+t.newHeader:"")));for(let u=0;u{o(l?Fd(l,a.headerOptions):void 0)}}))}else{let o=ev(t,e,r,i,n,s,a);return o?Fd(o,a==null?void 0:a.headerOptions):void 0}}function pu(t,e,r,i,n,s){return Hk(t,t,e,r,i,n,s)}function FB(t){let e=t.endsWith(` +`),r=t.split(` +`).map(i=>i+` +`);return e?r.pop():r.push(r.pop().slice(0,-1)),r}var se=Gt(Yg(),1),ka=require("obsidian");m();function Uk(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var nl=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};m();var Gk=require("obsidian"),IB={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},tt=class extends Gk.SuggestModal{constructor(e,r){if(super(e.app),this.config={...IB,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let i=this.containerEl.querySelector(".prompt-input-container");i.addClass("git-obscure-prompt"),i.setAttr("git-is-obscured","true");let n=i==null?void 0:i.createDiv({cls:"search-input-clear-button"});n.style.marginRight="32px",n.id="git-show-password",n.addEventListener("click",()=>{i.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",i.setAttr("git-is-obscured","false")):(this.inputEl.type="password",i.setAttr("git-is-obscured","true"))})}}openAndGetResult(){return new Promise(e=>{this.resolve=e,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(e=>window.setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,r){this.config.obscure?r.hide():r.setText(e)}onChooseSuggestion(e,r){if(this.resolve){let i;this.config.allowEmpty&&e===" "?i="":e==="..."?i=void 0:i=e,this.resolve(i)}}};m();var oA=Gt(aA(),1),lA=require("child_process"),qn=require("obsidian");function Md(t){throw new Error(`Unexpected object: ${t}`)}function gu(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var iv=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function ji(t,e){let r;if(e){if(e.button===0||e.button===1){let i=qn.Keymap.isModEvent(e);r=t.workspace.getLeaf(i)}}else r=t.workspace.getLeaf(!1);return r}function bn(t,e,r,i,n){if(e.button==2){let s=t.vault.getAbstractFileByPath(r);if(s!=null){let a=new qn.Menu;t.workspace.trigger("file-menu",a,s,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}else{let a=new qn.Menu;t.workspace.trigger("obsidian-git:menu",a,r,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}}}function Ls(t){throw new Error("Impossible branch: "+t)}function nv(t){return`rgb(${t.r},${t.g},${t.b})`}function cA(t){var s;let e=(s=oA.fromString(t))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[r,i,n]=e;return{r,g:i,b:n}}function uA(t){return t.diff(qn.moment.unix(0),"seconds")}function fA(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function vu(t,e){return new Proxy(t,{get(r,i){return i==="length"?Math.min(e,r.length):r[i]}})}function dA(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function hA(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),i=t.substring(e,t.length);return r+i}function sv(t,e,r){return t<=e&&e<=r}function Yn(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function _n(t){return t.endsWith("/")?t:t.split("/").last().replace(/\.md$/,"")}function pA(t){return t===1?"1 minute":`${t} minutes`}function YB(t){let e=t.lastIndexOf(".");return t.substring(e+1)}function al(t){if(t.endsWith(".md"))return!1;let e=YB(t);return Bk.includes(e)}function av(t){return(t.startsWith("https://github.com/")||t.startsWith("https://gitlab.com/"))&&(t.endsWith(".git")||(t=t+".git")),t}function ol(t,e){let r=e.vault.getAbstractFileByPath(t);if(!(r instanceof qn.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(r.extension)}catch(i){return!0}}function mA({isFolder:t,gitRelativePath:e}){let r="/";return r+=e,t&&(r+="/"),r.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function ll(t,e,r,i){let n=e.target;t.workspace.trigger("hover-link",{event:e,source:r.getViewType(),hoverParent:r,targetEl:n,linktext:i})}function wu(t,e,r={}){return new Promise((i,n)=>{let s=(0,lA.spawn)(t,e,r),a="",o="";s.stdout.on("data",l=>{a+=l.toString()}),s.stderr.on("data",l=>{o+=l.toString()}),s.on("error",l=>{i({error:new Error(l.message),stdout:a,stderr:a,code:1})}),s.on("close",l=>{i({stdout:a,stderr:o,code:l!=null?l:1,error:void 0})})})}m();var gA=require("os"),Dd=require("obsidian"),cl=class{constructor(e){this.plugin=e,this.app=e.app}getRelativeVaultPath(e){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,r=!0){return r&&this.plugin.settings.basePath.length>0?e.substring(this.plugin.settings.basePath.length+1):e}unload(){}_getTreeStructure(e,r=0){let i=[];for(e=[...e];e.length>0;){let n=e.first(),s=n.path.substring(r);if(s.contains("/")){let a=s.substring(0,s.indexOf("/")),o=e.filter(c=>c.path.substring(r).startsWith(a+"/"));o.forEach(c=>e.remove(c));let l=n.path.substring(0,s.indexOf("/")+r);i.push({title:a,path:l,vaultPath:this.getRelativeVaultPath(l),children:this._getTreeStructure(o,(r>0?r+a.length:a.length)+1)})}else i.push({title:s,data:n,path:n.path,vaultPath:this.getRelativeVaultPath(n.path)}),e.remove(n)}return i}simplify(e){var r,i,n,s;for(let a of e){for(;;){let o=((r=a.children)==null?void 0:r.length)==1,l=((n=(i=a.children)==null?void 0:i.first())==null?void 0:n.data)==null;if(!(a.children!=null&&o&&l))break;let c=a.children.first();a.title+="/"+c.title,a.data=c.data,a.path=c.path,a.vaultPath=c.vaultPath,a.children=c.children}a.children!=null&&this.simplify(a.children),(s=a.children)==null||s.sort((o,l)=>{let c=(l.data==null?1:0)-(o.data==null?1:0);return c!=0?c:o.title.localeCompare(l.title)})}return e.sort((a,o)=>{let l=(o.data==null?1:0)-(a.data==null?1:0);return l!=0?l:a.title.localeCompare(o.title)})}getTreeStructure(e){let r=this._getTreeStructure(e);return this.simplify(r)}async formatCommitMessage(e){let r;if(e.includes("{{numFiles}}")){r=await this.status();let i=r.staged.length;e=e.replace("{{numFiles}}",String(i))}if(e.includes("{{hostname}}")){let i=this.plugin.localStorage.getHostname()||"";!i&&Dd.Platform.isDesktopApp&&(i=(0,gA.hostname)()),e=e.replace("{{hostname}}",i)}if(e.includes("{{files}}")){r=r!=null?r:await this.status();let i={},n="";if(r.staged.length<100){r.staged.forEach(a=>{a.index in i?i[a.index].push(a.path):i[a.index]=[a.path]});let s=[];for(let[a,o]of Object.entries(i))s.push(a+" "+o.join(" "));n=s.join(", ")}else n="Too many files to list";e=e.replace("{{files}}",n)}if(e=e.replace("{{date}}",(0,Dd.moment)().format(this.plugin.settings.commitDateFormat)),this.plugin.settings.listChangedFilesInMessageBody){let i=r!=null?r:await this.status(),n="";i.staged.length<100?n=i.staged.map(s=>s.path).join(` +`):n="Too many files to list",e=e+` + +Affected files: +`+n}return e}};m();var Ns=require("obsidian"),Od=class{constructor(e,r){this.plugin=r;this.promises={};this.adapter=e.adapter,this.vault=e,this.lastBasePath=this.plugin.settings.basePath,this.promises.readFile=this.readFile.bind(this),this.promises.writeFile=this.writeFile.bind(this),this.promises.readdir=this.readdir.bind(this),this.promises.mkdir=this.mkdir.bind(this),this.promises.rmdir=this.rmdir.bind(this),this.promises.stat=this.stat.bind(this),this.promises.unlink=this.unlink.bind(this),this.promises.lstat=this.lstat.bind(this),this.promises.readlink=this.readlink.bind(this),this.promises.symlink=this.symlink.bind(this)}async readFile(e,r){var i;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?(this.maybeLog("Reuse"),this.vault.read(n)):this.adapter.read(e)}else{if(e.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(i=this.index)!=null?i:this.adapter.readBinary(e);let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(n)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let i=this.vault.getAbstractFileByPath(e);return i instanceof Ns.TFile?this.vault.modify(i,r):this.adapter.write(e,r)}else{let i=ZB(r);if(e.endsWith(this.gitDir+"/index"))this.index=i,this.indexmtime=Date.now();else{let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?this.vault.modifyBinary(n,i):this.adapter.writeBinary(e,i)}}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),i=[...r.files,...r.folders],n;return e!=="/"?n=i.map(s=>(0,Ns.normalizePath)(s.substring(e.length))):n=i,n}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var i,n;return this.adapter.rmdir(e,(n=(i=r==null?void 0:r.options)==null?void 0:i.recursive)!=null?n:!1)}async stat(e){if(e.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.byteLength,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let i=await this.adapter.stat(e);if(i==null)throw{code:"ENOENT"};return this.indexctime=i.ctime,this.indexmtime=i.mtime,{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof Ns.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:r.stat.ctime,mtimeMs:r.stat.mtime,size:r.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let i=await this.adapter.stat(e);if(i)return{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:i.type==="folder"?"directory":i.type,isFile:()=>i.type==="file",isDirectory:()=>i.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(e){return this.adapter.remove(e)}async lstat(e){return this.stat(e)}async readlink(e){throw new Error(`readlink of (${e}) is not implemented.`)}async symlink(e){throw new Error(`symlink of (${e}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(e){}};function ZB(t){return t instanceof ArrayBuffer?t:t.buffer instanceof ArrayBuffer&&t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength).slice().buffer}var xA=Gt(yA(),1),Vi=class extends cl{constructor(r){super(r);this.FILE=0;this.HEAD=1;this.WORKDIR=2;this.STAGE=3;this.status_mapping={"000":" ","003":"AD","020":"??","022":"A ","023":"AM",100:"D ",101:" D",103:"MD",110:"DA",111:" ",113:"MM",120:"DA",121:" M",122:"M ",123:"MM"};this.noticeLength=999999;this.fs=new Od(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var r,i;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(i=this.plugin.localStorage.getPassword())!=null?i:void 0}},onAuthFailure:async()=>{new ka.Notice("Authentication failed. Please try with different credentials");let r=await new tt(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let i=await new tt(this.plugin,{placeholder:"Specify your password/personal access token",obscure:!0}).openAndGetResult();if(i)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(i),{username:r,password:i}}return{cancel:!0}},http:{async request({url:r,method:i,headers:n,body:s}){let a;s&&(a=await JB(s));let o=await(0,ka.requestUrl)({url:r,method:i,headers:n,body:a,throw:!1});return{url:r,method:i,headers:o.headers,body:QB(o.arrayBuffer),statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(r){try{let i=await r;return await this.fs.saveAndClear(),i}catch(i){throw await this.fs.saveAndClear(),i}}async status(r){let i,n=window.setTimeout(()=>{i=new ka.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{this.plugin.setPluginState({gitAction:1});let s={...this.getRepo()};(r==null?void 0:r.path)!=null&&(s.filepaths=[`${r.path}/`]);let a=(await this.wrapFS(se.default.statusMatrix(s))).map(f=>this.getFileStatusResult(f)),o=[],l=[],c=[];for(let f of a)f.workingDir!==" "&&o.push(f),f.index!==" "&&f.index!=="U"&&l.push(f),(f.index!=" "||f.workingDir!=" ")&&c.push(f);let u=[];return window.clearTimeout(n),i==null||i.hide(),{all:c,changed:o,staged:l,conflicted:u}}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async commitAll({message:r,status:i,unstagedFiles:n}){try{return await this.checkAuthorInfo(),await this.stageAll({status:i,unstagedFiles:n}),this.commit({message:r})}catch(s){throw this.plugin.displayError(s),s}}async commit({message:r}){try{await this.checkAuthorInfo(),this.plugin.setPluginState({gitAction:4});let i=await this.formatCommitMessage(r),n=this.plugin.localStorage.getConflict(),s;if(n){let a=await this.branchInfo();s=[a.current,a.tracking]}await this.wrapFS(se.default.commit({...this.getRepo(),message:i,parent:s})),this.plugin.localStorage.setConflict(!1);return}catch(i){throw this.plugin.displayError(i),i}}async stage(r,i){let n=this.getRelativeRepoPath(r,i),s;i?s=r:s=this.getRelativeVaultPath(r);try{this.plugin.setPluginState({gitAction:3}),await this.app.vault.adapter.exists(s)?await this.wrapFS(se.default.add({...this.getRepo(),filepath:n})):await this.wrapFS(se.default.remove({...this.getRepo(),filepath:n}))}catch(a){throw this.plugin.displayError(a),a}}async stageAll({dir:r,status:i,unstagedFiles:n}){try{if(i)await Promise.all(i.changed.map(s=>s.workingDir!=="D"?this.wrapFS(se.default.add({...this.getRepo(),filepath:s.path})):se.default.remove({...this.getRepo(),filepath:s.path})));else{let s=n!=null?n:await this.getUnstagedFiles(r!=null?r:".");await Promise.all(s.map(({path:a,type:o})=>o=="D"?se.default.remove({...this.getRepo(),filepath:a}):this.wrapFS(se.default.add({...this.getRepo(),filepath:a}))))}}catch(s){throw this.plugin.displayError(s),s}}async unstage(r,i){try{this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.wrapFS(se.default.resetIndex({...this.getRepo(),filepath:r}))}catch(n){throw this.plugin.displayError(n),n}}async unstageAll({dir:r,status:i}){try{let n;i?n=i.staged.map(s=>s.path):n=(await this.getStagedFiles(r!=null?r:".")).map(({path:a})=>a),await this.wrapFS(Promise.all(n.map(s=>se.default.resetIndex({...this.getRepo(),filepath:s}))))}catch(n){throw this.plugin.displayError(n),n}}async discard(r){try{this.plugin.setPluginState({gitAction:3}),await this.wrapFS(se.default.checkout({...this.getRepo(),filepaths:[r],force:!0}))}catch(i){throw this.plugin.displayError(i),i}}async discardAll({dir:r,status:i}){let n=[];i?r!=null?n=i.changed.filter(s=>s.workingDir!="U"&&s.path.startsWith(r)).map(s=>s.path):n=i.changed.filter(s=>s.workingDir!="U").map(s=>s.path):n=(await this.getUnstagedFiles(r)).filter(s=>s.type!="A").map(({path:s})=>s);try{await this.wrapFS(se.default.checkout({...this.getRepo(),filepaths:n,force:!0}))}catch(s){throw this.plugin.displayError(s),s}}async getUntrackedPaths(r){let i=[];if(r.status)for(let n of r.status.changed)n.index=="U"&&n.workingDir==="U"&&n.path.startsWith(r.path!=null?`${r.path}/`:"")&&i.push(n.path);else{let n=await this.status({path:r==null?void 0:r.path});for(let s of n.changed)s.index==="U"&&s.workingDir==="U"&&i.push(s.path)}return i}getProgressText(r,i){let n=`${r} progress:`;return i.phase&&(n=`${n} ${i.phase}:`),i.loaded&&(n=`${n} ${i.loaded}`,i.total&&(n=`${n} of ${i.total}`)),n}resolveRef(r){return this.wrapFS(se.default.resolveRef({...this.getRepo(),ref:r}))}async pull(){let r=this.showNotice("Initializing pull");try{this.plugin.setPluginState({gitAction:2});let i=await this.resolveRef("HEAD");await this.fetch();let n=await this.branchInfo();await this.checkAuthorInfo(),(await this.wrapFS(se.default.merge({...this.getRepo(),ours:n.current,theirs:n.tracking,abortOnConflict:!1,mergeDriver:this.plugin.settings.mergeStrategy!=="none"?({contents:l})=>{var b,S,C;let c=l[0],u=l[1],f=l[2],d=/^.*(\r?\n|$)/gm,h=(b=u.match(d))!=null?b:[],p=(S=c.match(d))!=null?S:[],g=(C=f.match(d))!=null?C:[],w=(0,xA.default)(h,p,g),y="";for(let A of w)A.ok&&(y+=A.ok.join("")),A.conflict&&(y+=this.plugin.settings.mergeStrategy==="ours"?A.conflict.a.join(""):A.conflict.b.join(""));return{cleanMerge:!0,mergedText:y}}:void 0}))).alreadyMerged||await this.wrapFS(se.default.checkout({...this.getRepo(),ref:n.current,onProgress:l=>{r!==void 0&&r.setMessage(this.getProgressText("Checkout",l))},remote:n.remote})),r==null||r.hide();let a=await this.resolveRef("HEAD"),o=await this.getFileChangesCount(i,a);return this.showNotice("Finished pull",!1),o.map(l=>({path:l.path,workingDir:"P",index:"P",vaultPath:this.getRelativeVaultPath(l.path)}))}catch(i){throw r==null||r.hide(),i instanceof se.Errors.MergeConflictError&&await this.plugin.handleConflict(i.data.filepaths.map(n=>this.getRelativeVaultPath(n))),this.plugin.displayError(i),i}}async push(){if(!await this.canPush())return 0;let r=this.showNotice("Initializing push");try{this.plugin.setPluginState({gitAction:1});let i=await this.branchInfo(),n=i.tracking,s=i.current,a=(await this.getFileChangesCount(s,n)).length;this.plugin.setPluginState({gitAction:5});let o=await this.getCurrentRemote();return await this.wrapFS(se.default.push({...this.getRepo(),remote:o,onProgress:l=>{r!==void 0&&r.setMessage(this.getProgressText("Pushing",l))}})),r==null||r.hide(),a}catch(i){throw r==null||r.hide(),this.plugin.displayError(i),i}}async getUnpushedCommits(){let r=await this.branchInfo(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let s=await this.resolveRef(n),a=await this.resolveRef(i);return(await this.getFileChangesCount(s,a)).length}async canPush(){let r=await this.branchInfo(),i=r.tracking,n=r.current,s=await this.resolveRef(n),a=await this.resolveRef(i);return s!=a}async checkRequirements(){return await this.plugin.app.vault.adapter.exists(`${this.getRepo().dir}/.git/HEAD`)?"valid":"missing-repo"}async branchInfo(){var r,i;try{let n=await se.default.currentBranch(this.getRepo())||"",s=await se.default.listBranches(this.getRepo()),a=(r=await this.getConfig(`branch.${n}.remote`))!=null?r:"origin",o=(i=await this.getConfig(`branch.${n}.merge`))==null?void 0:i.split("refs/heads")[1],l=o?a+o:void 0;return{current:n,tracking:l,branches:s,remote:a}}catch(n){throw this.plugin.displayError(n),n}}async getCurrentRemote(){var n;let r=await se.default.currentBranch(this.getRepo())||"";return(n=await this.getConfig(`branch.${r}.remote`))!=null?n:"origin"}async checkout(r,i){try{return this.wrapFS(se.default.checkout({...this.getRepo(),ref:r,force:!!i,remote:i}))}catch(n){throw this.plugin.displayError(n),n}}async createBranch(r){try{await this.wrapFS(se.default.branch({...this.getRepo(),ref:r,checkout:!0}))}catch(i){throw this.plugin.displayError(i),i}}async deleteBranch(r){try{await this.wrapFS(se.default.deleteBranch({...this.getRepo(),ref:r}))}catch(i){throw this.plugin.displayError(i),i}}branchIsMerged(r){return Promise.resolve(!0)}async init(){try{await this.wrapFS(se.default.init(this.getRepo()))}catch(r){throw this.plugin.displayError(r),r}}async clone(r,i,n){let s=this.showNotice("Initializing clone");try{await this.wrapFS(se.default.clone({...this.getRepo(),dir:i,url:r,depth:n,onProgress:a=>{s!==void 0&&s.setMessage(this.getProgressText("Cloning",a))}})),s==null||s.hide()}catch(a){throw s==null||s.hide(),this.plugin.displayError(a),a}}async setConfig(r,i){try{return this.wrapFS(se.default.setConfig({...this.getRepo(),path:r,value:i}))}catch(n){throw this.plugin.displayError(n),n}}async getConfig(r){try{return this.wrapFS(se.default.getConfig({...this.getRepo(),path:r}))}catch(i){throw this.plugin.displayError(i),i}}async fetch(r){let i=this.showNotice("Initializing fetch");try{let n={...this.getRepo(),onProgress:s=>{i!==void 0&&i.setMessage(this.getProgressText("Fetching",s))},remote:r!=null?r:await this.getCurrentRemote()};await this.wrapFS(se.default.fetch(n)),i==null||i.hide()}catch(n){throw this.plugin.displayError(n),i==null||i.hide(),n}}async setRemote(r,i){try{await this.wrapFS(se.default.addRemote({...this.getRepo(),remote:r,url:i,force:!0}))}catch(n){throw this.plugin.displayError(n),n}}async getRemoteBranches(r){let i=[];return i.push(...await this.wrapFS(se.default.listBranches({...this.getRepo(),remote:r}))),i.remove("HEAD"),i=i.map(n=>`${r}/${n}`),i}async getRemotes(){return(await this.wrapFS(se.default.listRemotes({...this.getRepo()}))).map(r=>r.remote)}async removeRemote(r){await this.wrapFS(se.default.deleteRemote({...this.getRepo(),remote:r}))}async getRemoteUrl(r){var i;return(i=(await this.wrapFS(se.default.listRemotes({...this.getRepo()}))).filter(n=>n.remote==r)[0])==null?void 0:i.url}async log(r,i=!0,n,s){let a=await this.wrapFS(se.default.log({...this.getRepo(),depth:n,ref:s}));return Promise.all(a.map(async o=>{let l=o.commit.message.split(` + +`);return{message:l[0],author:{name:o.commit.author.name,email:o.commit.author.email},body:l.slice(1).join(` + +`),date:new Date(o.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(o.commit.parent.first(),o.oid)).map(c=>({path:c.path,status:c.type,vaultPath:this.getRelativeVaultPath(c.path),hash:o.oid}))},hash:o.oid,refs:[]}}))}updateBasePath(r){return this.getRepo().dir=r,Promise.resolve()}async updateUpstreamBranch(r){let[i,n]=Yn(r),s=await this.branchInfo();await this.wrapFS(se.default.push({...this.getRepo(),remote:i,remoteRef:n})),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${n}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,i){return this.walkDifference({walkers:[se.default.TREE({ref:r}),se.default.TREE({ref:i})]})}async walkDifference({walkers:r,dir:i}){return await this.wrapFS(se.default.walk({...this.getRepo(),trees:r,map:async function(s,[a,o]){if(!iv(s,i))return null;if(await(a==null?void 0:a.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(a==null?void 0:a.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(a),console.log(o)),u!=="equal")return{path:s,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[se.default.TREE({ref:"HEAD"}),se.default.STAGE()],dir:r})).map(n=>({vaultPath:this.getRelativeVaultPath(n.path),path:n.path}))}async getUnstagedFiles(r="."){let i,n=window.setTimeout(()=>{i=new ka.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),a=await this.wrapFS(se.default.walk({...s,trees:[se.default.WORKDIR(),se.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await se.default.isIgnored({...s,filepath:o})||!iv(o,r))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),d=[u,f].includes("blob");if((u==="tree"||u==="special")&&!d)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!d)return;let h=f==="blob"?await c.oid():void 0,p;return u==="blob"&&f!=="blob"?p="42":u==="blob"&&(p=await l.oid()),p?h?p!==h?{path:o,type:"M"}:null:{path:o,type:"A"}:{path:o,type:"D"}}}));return window.clearTimeout(n),i==null||i.hide(),a}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async getDiffString(r,i=!1,n){let s=this.getRelativeVaultPath(r),a=async(c,[u])=>{if(r==c){let f=await u.oid();return(await se.default.readBlob({...this.getRepo(),oid:f})).blob}};if(n){let c=await(0,se.readBlob)({...this.getRepo(),filepath:r,oid:n}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof se.default.Errors.NotFoundError))throw h}),u=await se.default.readCommit({...this.getRepo(),oid:n}),f=await(0,se.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof se.default.Errors.NotFoundError))throw h});return pu(s,f!=null?f:"",c!=null?c:"")}let o=(await se.default.walk({...this.getRepo(),trees:[se.default.STAGE()],map:a})).first(),l=new TextDecoder().decode(o);if(i){let c=await this.resolveRef("HEAD").then(f=>(0,se.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof se.default.Errors.NotFoundError))throw f});return pu(s,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(s)?c=await this.app.vault.adapter.read(s):c="",pu(s,l,c)}}async getLastCommitTime(){let r=this.getRepo(),i=await this.resolveRef("HEAD"),s=(await se.default.readCommit({...r,oid:i})).commit.committer.timestamp;return new Date(s*1e3)}getFileStatusResult(r){let i=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:i[0]=="?"?"U":i[0],workingDir:i[1]=="?"?"U":i[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),i=await this.getConfig("user.email");if(!r||!i)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,i=!0){if(!this.plugin.settings.disablePopups)return new ka.Notice(r,i?this.noticeLength:void 0)}};async function*QB(t){yield new Uint8Array(t)}async function JB(t){let e=new ReadableStream({async start(i){for await(let n of t)i.enqueue(n);i.close()}});return await new Response(e).arrayBuffer()}m();var w2=Gt(Bd(),1),ei=Gt(require("fs/promises"),1),Zn=require("obsidian"),We=Gt(require("path"),1),Tu=require("path");m();var Zd=Gt(TA(),1);m();var lv=new WeakMap;function pl(...t){let e=new String(t);return lv.set(e,t),e}function _i(t){return t instanceof String&&lv.has(t)}function ml(t){var e;return(e=lv.get(t))!=null?e:[]}var qd=Gt(Bd(),1),nT=require("child_process");var GT=Gt(uv(),1),JT=require("node:path");m();function*PA(t,e){let r=e==="global";for(let i of t)i.isGlobal===r&&(yield i)}var w3=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),b3=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),_3=new Set(["edit","remove-section","rename-section","set","unset"]),y3=new Set(["get","get-color","get-colorbool","list"]);function x3(t,e){var i;for(let{name:n}of PA(t,"task")){if(w3.has(n))return gl(!0,e);if(b3.has(n))return gl(!1,e)}let r=(i=e.at(0))==null?void 0:i.toLowerCase();return r===void 0?null:_3.has(r)?gl(!0,e.slice(1)):y3.has(r)?gl(!1,e.slice(1)):e.length===1?gl(!1,e):gl(!0,e)}function gl(t=!1,e=[]){var i;let r=(i=e.at(0))==null?void 0:i.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}function E3(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}function S3(t){let e=(t==null?void 0:t.indexOf("="))||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}function k3(t){for(let{name:e}of PA(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function A3({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}function*C3(t){for(let e of t){let r=A3(e),i=r&&S3(e.value);i&&(yield{...i,scope:r})}}function T3(t,e,r){let i={read:[],write:[...C3(e)]};return t==="config"&&P3(i,k3(e),x3(e,r)),i}function P3(t,e,r){if(r===null)return;let i=E3(e,r);r.isWrite?t.write.push(i):t.read.push(i)}var RA={short:new Map([["c",!0]])},R3={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...RA.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},$3={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},F3={short:new Map,long:new Set};function I3(t){var r;let e=(r=$3[t!=null?t:""])!=null?r:F3;return{short:new Map([...RA.short.entries(),...e.short.entries()]),long:e.long}}function $A(t,e=R3){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let i=t.slice(2);return[{name:t,needsNext:e.long.has(i)}]}if(t.length===2){let r=t.charAt(1),i=e.short.get(r);return[{name:t,needsNext:i===!0}]}return M3(t,e.short)}function M3(t,e){let r=t.slice(1).split(""),i=[];for(let n=0;ne.has(l)))return i.push({name:`-${s}`,value:o,needsNext:!1}),i}i.push({name:`-${s}`,needsNext:a})}return i}function D3(t,e=[]){let r=0;for(;rfunction(){return t&&(e=(0,t[Fv(t)[0]])(t=0)),e},K3=(t,e)=>function(){return e||(0,t[Fv(t)[0]])((e={exports:{}}).exports,e),e.exports},St=(t,e)=>{for(var r in e)$v(t,r,{get:e[r],enumerable:!0})},X3=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fv(e))!Z3.call(t,n)&&n!==r&&$v(t,n,{get:()=>e[n],enumerable:!(i=Y3(e,n))||i.enumerable});return t},_t=t=>X3($v({},"__esModule",{value:!0}),t),Br,Hs=Y({"src/lib/errors/git-error.ts"(){"use strict";Br=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Eu,_l=Y({"src/lib/errors/git-response-error.ts"(){"use strict";Hs(),Eu=class extends Br{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),hC,pC=Y({"src/lib/errors/task-configuration-error.ts"(){"use strict";Hs(),hC=class extends Br{constructor(t){super(void 0,t)}}}});function mC(t){return typeof t!="function"?$a:t}function gC(t){return typeof t=="function"&&t!==$a}function vC(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function wC(t,e=0){return bC(t)&&t.length>e?t[e]:void 0}function Ra(t,e=0){if(bC(t)&&t.length>e)return t[t.length-1-e]}function bC(t){return Jd(t)}function Su(t="",e=!0,r=` +`){return t.split(r).reduce((i,n)=>{let s=e?n.trim():n;return s&&i.push(s),i},[])}function Iv(t,e){return Su(t,!0).map(r=>e(r))}function Mv(t){return(0,Zd.exists)(t,Zd.FOLDER)}function Ei(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function _C(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Kd(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function yn(t){return Array.isArray(t)?t:[t]}function yC(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function yl(t){return yn(t).map(e=>e instanceof String?e:String(e))}function Qe(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}function yu(t,e){let r=[];for(let i=0,n=t.length;i{t[i]!==void 0&&(r[i]=t[i])}),r}function vv(t=0){return new Promise(e=>setTimeout(e,t))}function wv(t){if(t!==!1)return t}var wl,$a,ku,Xd=Y({"src/lib/utils/util.ts"(){"use strict";Dv(),wl="\0",$a=()=>{},ku=Object.prototype.toString.call.bind(Object.prototype.toString)}});function lr(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function bv(t,e){let r=_i(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function Qd(t){return!!t&&ku(t)==="[object Object]"}function EC(t){return typeof t=="function"}var Au,SC,mt,zd,Jd,Dv=Y({"src/lib/utils/argument-filters.ts"(){"use strict";Xd(),Au=t=>Array.isArray(t),SC=t=>typeof t=="number",mt=t=>typeof t=="string"||_i(t),zd=t=>mt(t)||Array.isArray(t)&&t.every(mt),Jd=t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number"}}),_v,Q3=Y({"src/lib/utils/exit-codes.ts"(){"use strict";_v=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(_v||{})}}),Wd,J3=Y({"src/lib/utils/git-output-streams.ts"(){"use strict";Wd=class kC{constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new kC(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function e8(){throw new Error("LineParser:useMatches not implemented")}var _e,Bs,t8=Y({"src/lib/utils/line-parser.ts"(){"use strict";_e=class{constructor(t,e){this.matches=[],this.useMatches=e8,this.parse=(r,i)=>(this.resetMatches(),this._regExp.every((n,s)=>this.addMatch(n,s,r(s)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let i=r&&t.exec(r);return i&&this.pushMatch(e,i),!!i}pushMatch(t,e){this.matches.push(...e.slice(1))}},Bs=class extends _e{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function AC(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...CC},...t.filter(i=>typeof i=="object"&&i));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var CC,r8=Y({"src/lib/utils/simple-git-options.ts"(){"use strict";CC={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Ov(t,e=[]){return Qd(t)?Object.keys(t).reduce((r,i)=>{let n=t[i];if(_i(n))r.push(n);else if(bv(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n))for(let s of n)bv(s,["string","number"])||r.push(i+"="+s);else r.push(i);return r},e):e}function xr(t,e=0,r=!1){let i=[];for(let n=0,s=e<0?t.length:e;n{for(let s=Su(n,i),a=0,o=s.length;a{if(!(a+c>=o))return s[a+c]};e.some(({parse:c})=>c(l,t))}}),t}var s8=Y({"src/lib/utils/task-parser.ts"(){"use strict";Xd()}}),TC={};St(TC,{ExitCodes:()=>_v,GitOutputStreams:()=>Wd,LineParser:()=>_e,NOOP:()=>$a,NULL:()=>wl,RemoteLineParser:()=>Bs,append:()=>Ei,appendTaskOptions:()=>Ov,asArray:()=>yn,asCamelCase:()=>yC,asFunction:()=>mC,asNumber:()=>Qe,asStringArray:()=>yl,bufferToString:()=>xu,callTaskParser:()=>yv,createInstanceConfig:()=>AC,delay:()=>vv,filterArray:()=>Au,filterFunction:()=>EC,filterHasLength:()=>Jd,filterNumber:()=>SC,filterPlainObject:()=>Qd,filterPrimitives:()=>bv,filterString:()=>mt,filterStringOrStringArray:()=>zd,filterType:()=>lr,first:()=>wC,folderExists:()=>Mv,forEachLineWithContent:()=>Iv,getTrailingOptions:()=>xr,including:()=>_C,isUserFunction:()=>gC,last:()=>Ra,objectToString:()=>ku,orVoid:()=>wv,parseStringResponse:()=>Hr,pick:()=>xC,prefixedArray:()=>yu,remove:()=>Kd,splitOn:()=>vC,toLinesWithContent:()=>Su,trailingFunctionArgument:()=>st,trailingOptionsArgument:()=>Lv});var ve=Y({"src/lib/utils/index.ts"(){"use strict";Dv(),Q3(),J3(),t8(),r8(),n8(),s8(),Xd()}}),PC={};St(PC,{CheckRepoActions:()=>xv,checkIsBareRepoTask:()=>$C,checkIsRepoRootTask:()=>RC,checkIsRepoTask:()=>a8});function a8(t){switch(t){case"bare":return $C();case"root":return RC()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:eh,parser:Nv}}function RC(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:eh,parser(e){return/^\.(git)?$/.test(e.trim())}}}function $C(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:eh,parser:Nv}}function o8(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var xv,eh,Nv,FC=Y({"src/lib/tasks/check-is-repo.ts"(){"use strict";ve(),xv=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(xv||{}),eh=({exitCode:t},e,r,i)=>{if(t===128&&o8(e))return r(E.from("false"));i(e)},Nv=t=>t.trim()==="true"}});function l8(t,e){let r=new IC(t),i=t?DC:MC;return Su(e).forEach(n=>{let s=n.replace(i,"");r.paths.push(s),(OC.test(s)?r.folders:r.files).push(s)}),r}var IC,MC,DC,OC,c8=Y({"src/lib/responses/CleanSummary.ts"(){"use strict";ve(),IC=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},MC=/^[a-z]+\s*/i,DC=/^[a-z]+\s+[a-z]+\s*/i,OC=/\/$/}}),Ev={};St(Ev,{EMPTY_COMMANDS:()=>th,adhocExecTask:()=>LC,configurationErrorTask:()=>Nr,isBufferTask:()=>BC,isEmptyTask:()=>HC,straightThroughBufferTask:()=>NC,straightThroughStringTask:()=>Er});function LC(t){return{commands:th,format:"empty",parser:t}}function Nr(t){return{commands:th,format:"empty",parser(){throw typeof t=="string"?new hC(t):t}}}function Er(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}function NC(t){return{commands:t,format:"buffer",parser(e){return e}}}function BC(t){return t.format==="buffer"}function HC(t){return t.format==="empty"||!t.commands.length}var th,yt=Y({"src/lib/tasks/task.ts"(){"use strict";pC(),th=[]}}),UC={};St(UC,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Bv,CONFIG_ERROR_MODE_REQUIRED:()=>Hv,CONFIG_ERROR_UNKNOWN_OPTION:()=>Uv,CleanOptions:()=>Pa,cleanTask:()=>GC,cleanWithOptionsTask:()=>u8,isCleanOptionsArray:()=>f8});function u8(t,e){let{cleanMode:r,options:i,valid:n}=d8(t);return r?n.options?(i.push(...e),i.some(m8)?Nr(Bv):GC(r,i)):Nr(Uv+JSON.stringify(t)):Nr(Hv)}function GC(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(i){return l8(t==="n",i)}}}function f8(t){return Array.isArray(t)&&t.every(e=>Gv.has(e))}function d8(t){let e,r=[],i={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(n=>{h8(n)?(e=n,i.cleanMode=!0):i.options=i.options&&p8(r[r.length]=`-${n}`)}),{cleanMode:e,options:r,valid:i}}function h8(t){return t==="f"||t==="n"}function p8(t){return/^-[a-z]$/i.test(t)&&Gv.has(t.charAt(1))}function m8(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var Bv,Hv,Uv,Pa,Gv,jC=Y({"src/lib/tasks/clean.ts"(){"use strict";c8(),ve(),yt(),Bv="Git clean interactive mode is not supported",Hv='Git clean mode parameter ("n" or "f") is required',Uv="Git clean unknown option found in: ",Pa=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(Pa||{}),Gv=new Set(["i",...yl(Object.values(Pa))])}});function g8(t){let e=new zC;for(let r of VC(t))e.addValue(r.file,String(r.key),r.value);return e}function v8(t,e){let r=null,i=[],n=new Map;for(let s of VC(t,e))s.key===e&&(i.push(r=s.value),n.has(s.file)||n.set(s.file,[]),n.get(s.file).push(r));return{key:e,paths:Array.from(n.keys()),scopes:n,value:r,values:i}}function w8(t){return t.replace(/^(file):/,"")}function*VC(t,e=null){let r=t.split("\0");for(let i=0,n=r.length-1;iObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=Ra(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let i=this.addFile(t);Object.hasOwn(i,e)?Array.isArray(i[e])?i[e].push(r):i[e]=[i[e],r]:i[e]=r,this._all=void 0}}}});function fv(t,e){return typeof t=="string"&&Object.hasOwn(Sv,t)?t:e}function _8(t,e,r,i){let n=["config",`--${i}`];return r&&n.push("--add"),n.push(t,e),{commands:n,format:"utf-8",parser(s){return s}}}function y8(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(i){return v8(i,t)}}}function x8(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return g8(r)}}}function E8(){return{addConfig(t,e,...r){return this._runTask(_8(t,e,r[0]===!0,fv(r[1],"local")),st(arguments))},getConfig(t,e){return this._runTask(y8(t,fv(e,void 0)),st(arguments))},listConfig(...t){return this._runTask(x8(fv(t[0],void 0)),st(arguments))}}}var Sv,WC=Y({"src/lib/tasks/config.ts"(){"use strict";b8(),ve(),Sv=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Sv||{})}});function S8(t){return qC.has(t)}var dv,qC,YC=Y({"src/lib/tasks/diff-name-status.ts"(){"use strict";dv=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(dv||{}),qC=new Set(Object.values(dv))}});function k8(...t){return new KC().param(...t)}function A8(t){let e=new Set,r={};return Iv(t,i=>{let[n,s,a]=i.split(wl);e.add(n),(r[n]=r[n]||[]).push({line:Qe(s),path:n,preview:a})}),{paths:e,results:r}}function C8(){return{grep(t){let e=st(arguments),r=xr(arguments);for(let n of ZC)if(r.includes(n))return this._runTask(Nr(`git.grep: use of "${n}" is not supported.`),e);typeof t=="string"&&(t=k8().param(t));let i=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:i,format:"utf-8",parser(n){return A8(n)}},e)}}}var ZC,_u,OA,KC,XC=Y({"src/lib/tasks/grep.ts"(){"use strict";ve(),yt(),ZC=["-h"],_u=Symbol("grepQuery"),KC=class{constructor(){this[OA]=[]}*[(OA=_u,Symbol.iterator)](){for(let t of this[_u])yield t}and(...t){return t.length&&this[_u].push("--and","(",...yu(t,"-e"),")"),this}param(...t){return this[_u].push(...yu(t,"-e")),this}}}}),QC={};St(QC,{ResetMode:()=>Gd,getResetMode:()=>P8,resetTask:()=>T8});function T8(t,e){let r=["reset"];return JC(t)&&r.push(`--${t}`),r.push(...e),Er(r)}function P8(t){if(JC(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function JC(t){return typeof t=="string"&&eT.includes(t)}var Gd,eT,tT=Y({"src/lib/tasks/reset.ts"(){"use strict";ve(),yt(),Gd=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Gd||{}),eT=yl(Object.values(Gd))}});function R8(){return(0,qd.default)("simple-git")}function LA(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(i,...n)=>{t(i,...n),r(i,...n)}:t:(i,...n)=>{t(`%s ${i}`,e,...n),r&&r(i,...n)}}function $8(t,e,{namespace:r}){if(typeof t=="string")return t;let i=e&&e.namespace||"";return i.startsWith(r)?i.substr(r.length+1):i||r}function jv(t,e,r,i=R8()){let n=t&&`[${t}]`||"",s=[],a=typeof e=="string"?i.extend(e):e,o=$8(lr(e,mt),a,i);return c(r);function l(u,f){return Ei(s,jv(t,o.replace(/^[^:]+/,u),f,i))}function c(u){let f=u&&`[${u}]`||"",d=a&&LA(a,f)||$a,h=LA(i,`${n} ${f}`,d);return Object.assign(a?d:h,{label:t,sibling:l,info:h,step:c})}}var rT=Y({"src/lib/git-logger.ts"(){"use strict";ve(),qd.default.formatters.L=t=>String(Jd(t)?t.length:"-"),qd.default.formatters.B=t=>E.isBuffer(t)?t.toString("utf8"):ku(t)}}),iT,F8=Y({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;Hs(),rT(),iT=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let i=t.getName(r.commands[0]),n=jv(this.logLabel,i);return{task:r,logger:n,name:i}}push(r){let i=this.createProgress(r);return i.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,i),i}fatal(r){for(let[i,{logger:n}]of Array.from(this._queue.entries()))i===r.task?(n.info("Failed %o",r),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(i);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(r){this.withProgress(r)&&this._queue.delete(r)}attempt(r){let i=this.withProgress(r);if(!i)throw new Br(void 0,"TasksPendingQueue: attempt called for an unknown task");return i.logger("Starting task"),i}static getName(r="empty"){return`task:${r}:${++t.counter}`}},t.counter=0,t)}});function Ta(t,e){return{method:wC(t.commands)||"",commands:e}}function I8(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(E.from(String(r.stack),"ascii"))}}function NA(t,e,r,i){return n=>{r("%s received %L bytes",e,n),i("%B",n),t.push(n)}}var kv,M8=Y({"src/lib/runners/git-executor-chain.ts"(){"use strict";Hs(),yt(),ve(),F8(),kv=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new iT}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:i}=this._queue.attempt(t);return await(HC(t)?this.attemptEmptyTask(t,i):this.attemptRemoteTask(t,i))}catch(i){throw this.onFatalException(t,i)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof Br?Object.assign(e,{task:t}):new Br(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",Ta(t,t.commands)),i=this._plugins.exec("spawn.args",[...t.commands],{...Ta(t,t.commands),env:{...this.env}}),n=await this.gitResponse(t,r,i,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,i,n,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),BC(t)?yv(t.parser,s):yv(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,i){let{exitCode:n,rejection:s,stdOut:a,stdErr:o}=r;return new Promise((l,c)=>{i("Preparing to handle process response exitCode=%d stdOut=",n);let{error:u}=this._plugins.exec("task.error",{error:s},{...Ta(t,e),...r});if(u&&t.onError)return i.info("exitCode=%s handling with custom error handler"),t.onError(r,u,f=>{i.info("custom error handler treated as success"),i("custom error returned a %s",ku(f)),l(new Wd(Array.isArray(f)?E.concat(f):f,E.concat(o)))},c);if(u)return i.info("handling as error: exitCode=%s stdErr=%s rejection=%o",n,o.length,s),c(u);i.info("retrieving task output complete"),l(new Wd(E.concat(a),E.concat(o)))})}async gitResponse(t,e,r,i,n){let s=n.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Ta(t,t.commands));return new Promise(o=>{let l=[],c=[];n.info("%s %o",e,r),n("%O",a);let u=this._beforeSpawn(t,r);if(u)return o({stdOut:l,stdErr:c,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...Ta(t,r),kill(d){u=d||u}});let f=(0,nT.spawn)(e,r,a);f.stdout.on("data",NA(l,"stdOut",n,s.step("stdOut"))),f.stderr.on("data",NA(c,"stdErr",n,s.step("stdErr"))),f.on("error",I8(c,n)),i&&(n("Passing child process stdOut/stdErr to custom outputHandler"),i(e,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...Ta(t,r),spawned:f,close(d,h){o({stdOut:l,stdErr:c,exitCode:d,rejection:u||h})},kill(d){f.killed||(u=d,f.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...Ta(t,e),kill(i){r=i||r}}),r}}}}),sT={};St(sT,{GitExecutor:()=>aT});var aT,D8=Y({"src/lib/runners/git-executor.ts"(){"use strict";M8(),aT=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new kv(this,this._scheduler,this._plugins)}chain(){return new kv(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function O8(t,e,r=$a){let i=s=>{r(null,s)},n=s=>{(s==null?void 0:s.task)===t&&r(s instanceof Eu?L8(s):s,void 0)};e.then(i,n)}function L8(t){let e=i=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${i} should be GitResponseError.git.${i}, this will no longer be available in version 3`),e=$a};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(i,n){return n in t||(i[n]={enumerable:!1,configurable:!1,get(){return e(n),t.git[n]}}),i}}var N8=Y({"src/lib/task-callback.ts"(){"use strict";_l(),ve()}});function BA(t,e){return LC(r=>{if(!Mv(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var B8=Y({"src/lib/tasks/change-working-directory.ts"(){"use strict";ve(),yt()}});function hv(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=Kd(e,"-B")),Er(e)}function H8(){return{checkout(){return this._runTask(hv(xr(arguments,1)),st(arguments))},checkoutBranch(t,e){return this._runTask(hv(["-b",t,e,...xr(arguments)]),st(arguments))},checkoutLocalBranch(t){return this._runTask(hv(["-b",t,...xr(arguments)]),st(arguments))}}}var U8=Y({"src/lib/tasks/checkout.ts"(){"use strict";ve(),yt()}});function G8(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function j8(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Hr(G8(),[oT],t)}})}}}var oT,V8=Y({"src/lib/tasks/count-objects.ts"(){"use strict";ve(),oT=new _e(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let i=yC(e);Object.hasOwn(t,i)&&(t[i]=Qe(r))})}});function z8(t){return Hr({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},lT,t)}var lT,W8=Y({"src/lib/parsers/parse-commit.ts"(){"use strict";ve(),lT=[new _e(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,i])=>{t.branch=e,t.commit=i,t.root=!!r}),new _e(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),i=r.pop();!i||!i.includes("@")||(t.author={email:i.substr(0,i.length-1),name:r.join("<").trim()})}),new _e(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(i,10)||0}),new _e(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0;let n=parseInt(r,10)||0;i==="-"?t.summary.deletions=n:i==="+"&&(t.summary.insertions=n)})]}});function q8(t,e,r){return{commands:["-c","core.abbrev=40","commit",...yu(t,"-m"),...e,...r],format:"utf-8",parser:z8}}function Y8(){return{commit(e,...r){let i=st(arguments),n=t(e)||q8(yn(e),yn(lr(r[0],zd,[])),[...yl(lr(r[1],Au,[])),...xr(arguments,0,!0)]);return this._runTask(n,i)}};function t(e){return!zd(e)&&Nr("git.commit: requires the commit message to be supplied as a string/string[]")}}var Z8=Y({"src/lib/tasks/commit.ts"(){"use strict";W8(),ve(),yt()}});function K8(){return{firstCommit(){return this._runTask(Er(["rev-list","--max-parents=0","HEAD"],!0),st(arguments))}}}var X8=Y({"src/lib/tasks/first-commit.ts"(){"use strict";ve(),yt()}});function Q8(t,e){let r=["hash-object",t];return e&&r.push("-w"),Er(r,!0)}var J8=Y({"src/lib/tasks/hash-object.ts"(){"use strict";yt()}});function eH(t,e,r){let i=String(r).trim(),n;if(n=cT.exec(i))return new jd(t,e,!1,n[1]);if(n=uT.exec(i))return new jd(t,e,!0,n[1]);let s="",a=i.split(" ");for(;a.length;)if(a.shift()==="in"){s=a.join(" ");break}return new jd(t,e,/^re/i.test(i),s)}var jd,cT,uT,tH=Y({"src/lib/responses/InitSummary.ts"(){"use strict";jd=class{constructor(t,e,r,i){this.bare=t,this.path=e,this.existing=r,this.gitDir=i}},cT=/^Init.+ repository in (.+)$/,uT=/^Rein.+ in (.+)$/}});function rH(t){return t.includes(Vv)}function iH(t=!1,e,r){let i=["init",...r];return t&&!rH(i)&&i.splice(1,0,Vv),{commands:i,format:"utf-8",parser(n){return eH(i.includes("--bare"),e,n)}}}var Vv,nH=Y({"src/lib/tasks/init.ts"(){"use strict";tH(),Vv="--bare"}});function zv(t){for(let e=0;eHr(new fT,e,r,!1)}var pv,HA,UA,GA,hT,pT=Y({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Cu(),aH(),YC(),ve(),pv=[new _e(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,i=""])=>{t.files.push({file:e.trim(),changes:Qe(r),insertions:i.replace(/[^+]/g,"").length,deletions:i.replace(/[^-]/g,"").length,binary:!1})}),new _e(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,i])=>{t.files.push({file:e.trim(),before:Qe(r),after:Qe(i),binary:!0})}),new _e(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let i=/(\d+) i/.exec(r),n=/(\d+) d/.exec(r);t.changed=Qe(e),t.insertions=Qe(i==null?void 0:i[1]),t.deletions=Qe(n==null?void 0:n[1])})],HA=[new _e(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,i])=>{let n=Qe(e),s=Qe(r);t.changed++,t.insertions+=n,t.deletions+=s,t.files.push({file:i,changes:n+s,insertions:n,deletions:s,binary:!1})}),new _e(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],UA=[new _e(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],GA=[new _e(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,i,n,s])=>{t.changed++,t.files.push({file:s!=null?s:i,changes:0,insertions:0,deletions:0,binary:!1,status:wv(S8(e)&&e),from:wv(!!s&&i!==s&&i),similarity:Qe(r)})})],hT={"":pv,"--stat":pv,"--numstat":HA,"--name-status":GA,"--name-only":UA}}});function oH(t,e){return e.reduce((r,i,n)=>(r[i]=t[n]||"",r),Object.create({diff:null}))}function mT(t=Zv,e=gT,r=""){let i=dT(r);return function(n){let s=Su(n.trim(),!1,qv).map(function(a){let o=a.split(Yv),l=oH(o[0].split(t),e);return o.length>1&&o[1].trim()&&(l.diff=i(o[1])),l});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var qv,Yv,Zv,gT,vT=Y({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";ve(),pT(),Cu(),qv="\xF2\xF2\xF2\xF2\xF2\xF2 ",Yv=" \xF2\xF2",Zv=" \xF2 ",gT=["hash","date","message","refs","author_name","author_email"]}}),wT={};St(wT,{diffSummaryTask:()=>lH,validateLogFormatConfig:()=>rh});function lH(t){let e=zv(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),rh(r)||{commands:r,format:"utf-8",parser:dT(e)}}function rh(t){let e=t.filter(sH);if(e.length>1)return Nr(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return Nr(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var Kv=Y({"src/lib/tasks/diff.ts"(){"use strict";Cu(),pT(),yt()}});function cH(t,e){let r=[],i=[];return Object.keys(t).forEach(n=>{r.push(n),i.push(String(t[n]))}),[r,i.join(e)]}function uH(t){return Object.keys(t).reduce((e,r)=>(r in Av||(e[r]=t[r]),e),{})}function bT(t={},e=[]){let r=lr(t.splitter,mt,Zv),i=Qd(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[n,s]=cH(i,r),a=[],o=[`--pretty=format:${qv}${s}${Yv}`,...e],l=t.n||t["max-count"]||t.maxCount;if(l&&o.push(`--max-count=${l}`),t.from||t.to){let c=t.symmetric!==!1?"...":"..";a.push(`${t.from||""}${c}${t.to||""}`)}return mt(t.file)&&o.push("--follow",pl(t.file)),Ov(uH(t),o),{fields:n,splitter:r,commands:[...o,...a]}}function fH(t,e,r){let i=mT(t,e,zv(r));return{commands:["log",...r],format:"utf-8",parser:i}}function dH(){return{log(...r){let i=st(arguments),n=bT(Lv(arguments),yl(lr(arguments[0],Au,[]))),s=e(...r)||rh(n.commands)||t(n);return this._runTask(s,i)}};function t(r){return fH(r.splitter,r.fields,r.commands)}function e(r,i){return mt(r)&&mt(i)&&Nr("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Av,_T=Y({"src/lib/tasks/log.ts"(){"use strict";Cu(),vT(),ve(),yt(),Kv(),Av=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(Av||{})}}),Vd,yT,hH=Y({"src/lib/responses/MergeSummary.ts"(){"use strict";Vd=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},yT=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Cv,xT,pH=Y({"src/lib/responses/PullSummary.ts"(){"use strict";Cv=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},xT=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function mv(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function jA(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Qe(e&&e[1]||"0"),delta:Qe(r&&r[1]||"0")}}var ET,mH=Y({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";ve(),ET=[new Bs(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=mv(t.remoteMessages);Object.assign(n,{[i]:Qe(r)})}),new Bs(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=mv(t.remoteMessages);Object.assign(n,{[i]:Qe(r)})}),new Bs(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,i])=>{let n=mv(t.remoteMessages);n.total=jA(e),n.reused=jA(r),n.packReused=Qe(i)})]}});function ST(t,e){return Hr({remoteMessages:new AT},kT,e)}var kT,AT,CT=Y({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";ve(),mH(),kT=[new Bs(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...ET,new Bs([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Bs([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,i])=>{t.remoteMessages.vulnerabilities={count:Qe(e),summary:r,url:i}})],AT=class{constructor(){this.all=[]}}}});function gH(t,e){let r=Hr(new xT,TT,[t,e]);return r.message&&r}var VA,zA,WA,qA,TT,YA,Xv,PT=Y({"src/lib/parsers/parse-pull.ts"(){"use strict";pH(),ve(),CT(),VA=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,zA=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,WA=/^(create|delete) mode \d+ (.+)/,qA=[new _e(VA,(t,[e,r,i])=>{t.files.push(e),r&&(t.insertions[e]=r.length),i&&(t.deletions[e]=i.length)}),new _e(zA,(t,[e,,r,,i])=>r!==void 0||i!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+i||0,!0):!1),new _e(WA,(t,[e,r])=>{Ei(t.files,r),Ei(e==="create"?t.created:t.deleted,r)})],TT=[new _e(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new _e(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new _e(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,i,n])=>{t.branch.local=i,t.hash.local=e,t.branch.remote=n,t.hash.remote=r})],YA=(t,e)=>Hr(new Cv,qA,[t,e]),Xv=(t,e)=>Object.assign(new Cv,YA(t,e),ST(t,e))}}),ZA,RT,KA,vH=Y({"src/lib/parsers/parse-merge.ts"(){"use strict";hH(),ve(),PT(),ZA=[new _e(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new _e(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Vd(e,r))}),new _e(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,i])=>{t.conflicts.push(new Vd(e,r,{deleteRef:i}))}),new _e(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Vd(e,null))}),new _e(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],RT=(t,e)=>Object.assign(KA(t,e),Xv(t,e)),KA=t=>Hr(new yT,ZA,t)}});function XA(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let i=RT(e,r);if(i.failed)throw new Eu(i);return i}}:Nr("Git.merge requires at least one option")}var wH=Y({"src/lib/tasks/merge.ts"(){"use strict";_l(),vH(),yt()}});function bH(t,e,r){let i=r.includes("deleted"),n=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:i,tag:n,branch:!n,new:!s,alreadyUpdated:s,local:t,remote:e}}var QA,$T,JA,_H=Y({"src/lib/parsers/parse-push.ts"(){"use strict";ve(),CT(),QA=[new _e(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new _e(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new _e(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,i])=>{t.pushed.push(bH(e,r,i))}),new _e(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,i])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:i}}),new _e(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,i,n])=>{t.update={head:{local:e,remote:r},hash:{from:i,to:n}}})],$T=(t,e)=>{let r=JA(t,e),i=ST(t,e);return{...r,...i}},JA=(t,e)=>Hr({pushed:[]},QA,[t,e])}}),FT={};St(FT,{pushTagsTask:()=>yH,pushTask:()=>Qv});function yH(t={},e){return Ei(e,"--tags"),Qv(t,e)}function Qv(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),Kd(r,"-v"),Ei(r,"--verbose"),Ei(r,"--porcelain"),{commands:r,format:"utf-8",parser:$T}}var IT=Y({"src/lib/tasks/push.ts"(){"use strict";_H(),ve()}});function xH(){return{showBuffer(){let t=["show",...xr(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(NC(t),st(arguments))},show(){let t=["show",...xr(arguments,1)];return this._runTask(Er(t),st(arguments))}}}var EH=Y({"src/lib/tasks/show.ts"(){"use strict";ve(),yt()}}),eC,MT,SH=Y({"src/lib/responses/FileStatusSummary.ts"(){"use strict";eC=/^(.+)\0(.+)$/,MT=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let i=eC.exec(t)||[null,t,t];this.from=i[2]||"",this.path=i[1]||""}}}}});function tC(t){let[e,r]=t.split(wl);return{from:r||e,to:e}}function Jr(t,e,r){return[`${t}${e}`,r]}function gv(t,...e){return e.map(r=>Jr(t,r,(i,n)=>i.conflicted.push(n)))}function kH(t,e){let r=e.trim();switch(" "){case r.charAt(2):return i(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return i(" ",r.charAt(0),r.slice(2));default:return}function i(n,s,a){let o=`${n}${s}`,l=DT.get(o);l&&l(t,a),o!=="##"&&o!=="!!"&&t.files.push(new MT(a,n,s))}}var rC,DT,OT,AH=Y({"src/lib/responses/StatusSummary.ts"(){"use strict";ve(),SH(),rC=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},DT=new Map([Jr(" ","A",(t,e)=>t.created.push(e)),Jr(" ","D",(t,e)=>t.deleted.push(e)),Jr(" ","M",(t,e)=>t.modified.push(e)),Jr("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),Jr("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),Jr("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),Jr("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),Jr("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),Jr("R"," ",(t,e)=>{t.renamed.push(tC(e))}),Jr("R","M",(t,e)=>{let r=tC(e);t.renamed.push(r),t.modified.push(r.to)}),Jr("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),Jr("?","?",(t,e)=>t.not_added.push(e)),...gv("A","A","U"),...gv("D","D","U"),...gv("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,i=/behind (\d+)/,n=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,a=/\son\s(\S+?)(?=\.{3}|$)/,o=r.exec(e);t.ahead=o&&+o[1]||0,o=i.exec(e),t.behind=o&&+o[1]||0,o=n.exec(e),t.current=lr(o==null?void 0:o[1],mt,null),o=s.exec(e),t.tracking=lr(o==null?void 0:o[1],mt,null),o=a.exec(e),o&&(t.current=lr(o==null?void 0:o[1],mt,t.current)),t.detached=/\(no branch\)/.test(e)}]]),OT=function(t){let e=t.split(wl),r=new rC;for(let i=0,n=e.length;i!LT.includes(r))],parser(r){return OT(r)}}}var LT,TH=Y({"src/lib/tasks/status.ts"(){"use strict";AH(),LT=["--null","-z"]}});function Yd(t=0,e=0,r=0,i="",n=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:i,installed:n},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function PH(){return Yd(0,0,0,"",!1)}function RH(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:$H,onError(t,e,r,i){if(t.exitCode===-2)return r(E.from(Jv));i(e)}})}}}function $H(t){return t===Jv?PH():Hr(Yd(0,0,0,t),NT,t)}var Jv,NT,FH=Y({"src/lib/tasks/version.ts"(){"use strict";ve(),Jv="installed=false",NT=[new _e(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,i,n=""])=>{Object.assign(t,Yd(Qe(e),Qe(r),Qe(i),n))}),new _e(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,i,n=""])=>{Object.assign(t,Yd(Qe(e),Qe(r),i,n))})]}});function iC(t,e,r,...i){return mt(r)?e(r,lr(i[0],mt),xr(arguments)):Nr(`git.${t}() requires a string 'repoPath'`)}function IH(){return{clone(t,...e){return this._runTask(iC("clone",Tv,lr(t,mt),...e),st(arguments))},mirror(t,...e){return this._runTask(iC("mirror",BT,lr(t,mt),...e),st(arguments))}}}var Tv,BT,MH=Y({"src/lib/tasks/clone.ts"(){"use strict";yt(),ve(),Tv=(t,e,r)=>{let i=["clone",...r];return mt(t)&&i.push(pl(t)),mt(e)&&i.push(pl(e)),Er(i)},BT=(t,e,r)=>(Ei(r,"--mirror"),Tv(t,e,r))}}),HT={};St(HT,{SimpleGitApi:()=>Pv});var Pv,DH=Y({"src/lib/simple-git-api.ts"(){"use strict";N8(),B8(),U8(),V8(),Z8(),WC(),X8(),XC(),J8(),nH(),_T(),wH(),IT(),EH(),TH(),yt(),FH(),ve(),MH(),Pv=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),i=r.push(t);return e&&O8(t,i,e),Object.create(this,{then:{value:i.then.bind(i)},catch:{value:i.catch.bind(i)},_executor:{value:r}})}add(t){return this._runTask(Er(["add",...yn(t)]),st(arguments))}cwd(t){let e=st(arguments);return typeof t=="string"?this._runTask(BA(t,this._executor),e):typeof(t==null?void 0:t.path)=="string"?this._runTask(BA(t.path,t.root&&this._executor||void 0),e):this._runTask(Nr("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(Q8(t,e===!0),st(arguments))}init(t){return this._runTask(iH(t===!0,this._executor.cwd,xr(arguments)),st(arguments))}merge(){return this._runTask(XA(xr(arguments)),st(arguments))}mergeFromTo(t,e){return mt(t)&&mt(e)?this._runTask(XA([t,e,...xr(arguments)]),st(arguments,!1)):this._runTask(Nr("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Qv({remote:lr(arguments[0],mt),branch:lr(arguments[1],mt)},xr(arguments));return this._runTask(t,st(arguments))}stash(){return this._runTask(Er(["stash",...xr(arguments)]),st(arguments))}status(){return this._runTask(CH(xr(arguments)),st(arguments))}},Object.assign(Pv.prototype,H8(),IH(),Y8(),E8(),j8(),K8(),C8(),dH(),xH(),RH())}}),UT={};St(UT,{Scheduler:()=>jT});var nC,jT,OH=Y({"src/lib/runners/scheduler.ts"(){"use strict";ve(),rT(),nC=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,GT.createDeferred)();return{promise:e,done:r,id:t}}})(),jT=class{constructor(t=2){this.concurrency=t,this.logger=jv("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=Ei(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),Kd(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Ei(this.pending,nC());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),VT={};St(VT,{applyPatchTask:()=>LH});function LH(t,e){return Er(["apply",...e,...t])}var NH=Y({"src/lib/tasks/apply-patch.ts"(){"use strict";yt()}});function BH(t,e){return{branch:t,hash:e,success:!0}}function HH(t){return{branch:t,hash:null,success:!1}}var zT,UH=Y({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";zT=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function WT(t,e){return e===1&&Rv.test(t)}var sC,Rv,aC,ih,GH=Y({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";UH(),ve(),sC=/(\S+)\s+\(\S+\s([^)]+)\)/,Rv=/^error[^']+'([^']+)'/m,aC=[new _e(sC,(t,[e,r])=>{let i=BH(e,r);t.all.push(i),t.branches[e]=i}),new _e(Rv,(t,[e])=>{let r=HH(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],ih=(t,e)=>Hr(new zT,aC,[t,e])}}),qT,jH=Y({"src/lib/responses/BranchSummary.ts"(){"use strict";qT=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,i,n){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:i,label:n}}}}});function oC(t){return t?t.charAt(0):""}function YT(t,e=!1){return Hr(new qT,e?[KT]:ZT,t)}var ZT,KT,VH=Y({"src/lib/parsers/parse-branch.ts"(){"use strict";jH(),ve(),ZT=[new _e(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,i,n])=>{t.push(oC(e),!0,r,i,n)}),new _e(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,i,n])=>{t.push(oC(e),!1,r,i,n)})],KT=new _e(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),XT={};St(XT,{branchLocalTask:()=>WH,branchTask:()=>zH,containsDeleteBranchCommand:()=>QT,deleteBranchTask:()=>YH,deleteBranchesTask:()=>qH});function QT(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}function zH(t){let e=QT(t),r=t.includes("--show-current"),i=["branch",...t];return i.length===1&&i.push("-a"),i.includes("-v")||i.splice(1,0,"-v"),{format:"utf-8",commands:i,parser(n,s){return e?ih(n,s).all[0]:YT(n,r)}}}function WH(){return{format:"utf-8",commands:["branch","-v"],parser(t){return YT(t)}}}function qH(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,i){return ih(r,i)},onError({exitCode:r,stdOut:i},n,s,a){if(!WT(String(n),r))return a(n);s(i)}}}function YH(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(i,n){return ih(i,n).branches[t]},onError({exitCode:i,stdErr:n,stdOut:s},a,o,l){if(!WT(String(a),i))return l(a);throw new Eu(r.parser(xu(s),xu(n)),String(a))}};return r}var ZH=Y({"src/lib/tasks/branch.ts"(){"use strict";_l(),GH(),VH(),ve()}});function KH(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,JT.normalize)(e)}var e2,XH=Y({"src/lib/responses/CheckIgnore.ts"(){"use strict";e2=t=>t.split(/\n/g).map(KH).filter(Boolean)}}),t2={};St(t2,{checkIgnoreTask:()=>QH});function QH(t){return{commands:["check-ignore",...t],format:"utf-8",parser:e2}}var JH=Y({"src/lib/tasks/check-ignore.ts"(){"use strict";XH()}});function e6(t,e){return Hr({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},r2,[t,e])}var r2,t6=Y({"src/lib/parsers/parse-fetch.ts"(){"use strict";ve(),r2=[new _e(/From (.+)$/,(t,[e])=>{t.remote=e}),new _e(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new _e(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new _e(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new _e(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,i,n])=>{t.updated.push({name:i,tracking:n,to:r,from:e})})]}}),i2={};St(i2,{fetchTask:()=>i6});function r6(t){return/^--upload-pack(=|$)/.test(t)}function i6(t,e,r){let i=["fetch",...r];return t&&e&&i.push(t,e),i.find(r6)?Nr("git.fetch: potential exploit argument blocked."):{commands:i,format:"utf-8",parser:e6}}var n6=Y({"src/lib/tasks/fetch.ts"(){"use strict";t6(),yt()}});function s6(t){return Hr({moves:[]},n2,t)}var n2,a6=Y({"src/lib/parsers/parse-move.ts"(){"use strict";ve(),n2=[new _e(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),s2={};St(s2,{moveTask:()=>o6});function o6(t,e){return{commands:["mv","-v",...yn(t),e],format:"utf-8",parser:s6}}var l6=Y({"src/lib/tasks/move.ts"(){"use strict";a6(),ve()}}),a2={};St(a2,{pullTask:()=>c6});function c6(t,e,r){let i=["pull",...r];return t&&e&&i.splice(1,0,t,e),{commands:i,format:"utf-8",parser(n,s){return Xv(n,s)},onError(n,s,a,o){let l=gH(xu(n.stdOut),xu(n.stdErr));if(l)return o(new Eu(l));o(s)}}}var u6=Y({"src/lib/tasks/pull.ts"(){"use strict";_l(),PT(),ve()}});function f6(t){let e={};return o2(t,([r])=>e[r]={name:r}),Object.values(e)}function d6(t){let e={};return o2(t,([r,i,n])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),n&&i&&(e[r].refs[n.replace(/[^a-z]/g,"")]=i)}),Object.values(e)}function o2(t,e){Iv(t,r=>e(r.split(/\s+/)))}var h6=Y({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";ve()}}),l2={};St(l2,{addRemoteTask:()=>p6,getRemotesTask:()=>m6,listRemotesTask:()=>g6,remoteTask:()=>v6,removeRemoteTask:()=>w6});function p6(t,e,r){return Er(["remote","add",...r,t,e])}function m6(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?d6:f6}}function g6(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),Er(e)}function v6(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),Er(e)}function w6(t){return Er(["remote","remove",t])}var b6=Y({"src/lib/tasks/remote.ts"(){"use strict";h6(),yt()}}),c2={};St(c2,{stashListTask:()=>_6});function _6(t={},e){let r=bT(t),i=["stash","list",...r.commands,...e],n=mT(r.splitter,r.fields,zv(i));return rh(i)||{commands:i,format:"utf-8",parser:n}}var y6=Y({"src/lib/tasks/stash-list.ts"(){"use strict";Cu(),vT(),Kv(),_T()}}),u2={};St(u2,{addSubModuleTask:()=>x6,initSubModuleTask:()=>E6,subModuleTask:()=>nh,updateSubModuleTask:()=>S6});function x6(t,e){return nh(["add",t,e])}function E6(t){return nh(["init",...t])}function nh(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),Er(e)}function S6(t){return nh(["update",...t])}var k6=Y({"src/lib/tasks/sub-module.ts"(){"use strict";yt()}});function A6(t,e){let r=Number.isNaN(t),i=Number.isNaN(e);return r!==i?r?1:-1:r?f2(t,e):0}function f2(t,e){return t===e?0:t>e?1:-1}function C6(t){return t.trim()}function Ud(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var lC,d2,T6=Y({"src/lib/responses/TagList.ts"(){"use strict";lC=class{constructor(t,e){this.all=t,this.latest=e}},d2=function(t,e=!1){let r=t.split(` +`).map(C6).filter(Boolean);e||r.sort(function(n,s){let a=n.split("."),o=s.split(".");if(a.length===1||o.length===1)return A6(Ud(a[0]),Ud(o[0]));for(let l=0,c=Math.max(a.length,o.length);ln.indexOf(".")>=0);return new lC(r,i)}}}),h2={};St(h2,{addAnnotatedTagTask:()=>$6,addTagTask:()=>R6,tagListTask:()=>P6});function P6(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return d2(r,e)}}}function R6(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function $6(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var F6=Y({"src/lib/tasks/tag.ts"(){"use strict";T6()}}),I6=K3({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(D8(),_t(sT)),{SimpleGitApi:i}=(DH(),_t(HT)),{Scheduler:n}=(OH(),_t(UT)),{adhocExecTask:s,configurationErrorTask:a}=(yt(),_t(Ev)),{asArray:o,filterArray:l,filterPrimitives:c,filterString:u,filterStringOrStringArray:f,filterType:d,getTrailingOptions:h,trailingFunctionArgument:p,trailingOptionsArgument:g}=(ve(),_t(TC)),{applyPatchTask:w}=(NH(),_t(VT)),{branchTask:y,branchLocalTask:b,deleteBranchesTask:S,deleteBranchTask:C}=(ZH(),_t(XT)),{checkIgnoreTask:A}=(JH(),_t(t2)),{checkIsRepoTask:k}=(FC(),_t(PC)),{cleanWithOptionsTask:v,isCleanOptionsArray:x}=(jC(),_t(UC)),{diffSummaryTask:_}=(Kv(),_t(wT)),{fetchTask:P}=(n6(),_t(i2)),{moveTask:T}=(l6(),_t(s2)),{pullTask:M}=(u6(),_t(a2)),{pushTagsTask:$}=(IT(),_t(FT)),{addRemoteTask:D,getRemotesTask:Q,listRemotesTask:ye,remoteTask:de,removeRemoteTask:J}=(b6(),_t(l2)),{getResetMode:X,resetTask:he}=(tT(),_t(QC)),{stashListTask:z}=(y6(),_t(c2)),{addSubModuleTask:K,initSubModuleTask:G,subModuleTask:Me,updateSubModuleTask:Et}=(k6(),_t(u2)),{addAnnotatedTagTask:Ht,addTagTask:De,tagListTask:Rt}=(F6(),_t(h2)),{straightThroughBufferTask:$t,straightThroughStringTask:Xe}=(yt(),_t(Ev));function re(B,N){this._plugins=N,this._executor=new r(B.baseDir,new n(B.maxConcurrentProcesses),N),this._trimmed=B.trimmed}(re.prototype=Object.create(i.prototype)).constructor=re,re.prototype.customBinary=function(B){return this._plugins.reconfigure("binary",B),this},re.prototype.env=function(B,N){return arguments.length===1&&typeof B=="object"?this._executor.env=B:(this._executor.env=this._executor.env||{})[B]=N,this},re.prototype.stashList=function(B){return this._runTask(z(g(arguments)||{},l(B)&&B||[]),p(arguments))},re.prototype.mv=function(B,N){return this._runTask(T(B,N),p(arguments))},re.prototype.checkoutLatestTag=function(B){var N=this;return this.pull(function(){N.tags(function(ue,Re){N.checkout(Re.latest,B)})})},re.prototype.pull=function(B,N,ue,Re){return this._runTask(M(d(B,u),d(N,u),h(arguments)),p(arguments))},re.prototype.fetch=function(B,N){return this._runTask(P(d(B,u),d(N,u),h(arguments)),p(arguments))},re.prototype.silent=function(B){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},re.prototype.tags=function(B,N){return this._runTask(Rt(h(arguments)),p(arguments))},re.prototype.rebase=function(){return this._runTask(Xe(["rebase",...h(arguments)]),p(arguments))},re.prototype.reset=function(B){return this._runTask(he(X(B),h(arguments)),p(arguments))},re.prototype.revert=function(B){let N=p(arguments);return typeof B!="string"?this._runTask(a("Commit must be a string"),N):this._runTask(Xe(["revert",...h(arguments,0,!0),B]),N)},re.prototype.addTag=function(B){let N=typeof B=="string"?De(B):a("Git.addTag requires a tag name");return this._runTask(N,p(arguments))},re.prototype.addAnnotatedTag=function(B,N){return this._runTask(Ht(B,N),p(arguments))},re.prototype.deleteLocalBranch=function(B,N,ue){return this._runTask(C(B,typeof N=="boolean"?N:!1),p(arguments))},re.prototype.deleteLocalBranches=function(B,N,ue){return this._runTask(S(B,typeof N=="boolean"?N:!1),p(arguments))},re.prototype.branch=function(B,N){return this._runTask(y(h(arguments)),p(arguments))},re.prototype.branchLocal=function(B){return this._runTask(b(),p(arguments))},re.prototype.raw=function(B){let N=!Array.isArray(B),ue=[].slice.call(N?arguments:B,0);for(let Ut=0;Utconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},re.prototype.checkIgnore=function(B,N){return this._runTask(A(o(d(B,f,[]))),p(arguments))},re.prototype.checkIsRepo=function(B,N){return this._runTask(k(d(B,u)),p(arguments))},e.exports=re}});Hs();var M6=class extends Br{constructor(t,e){super(void 0,e),this.config=t}};Hs();Hs();var bl=class extends Br{constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};_l();pC();FC();jC();WC();YC();XC();tT();function D6(t){return t?[{type:"spawn.before",action(i,n){t.aborted&&n.kill(new bl(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(i,n){function s(){n.kill(new bl(void 0,"abort","Abort signal received"))}t.addEventListener("abort",s),n.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}function O6(t={}){return{type:"spawn.args",action(e,{env:r}){for(let i of DA(e,r))if(t[i.category]!==!0)throw new bl(void 0,"unsafe",i.message);return e}}}ve();function L6(t){let e=yu(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}ve();var cC=(0,vl.deferred)().promise;function N6({onClose:t=!0,onExit:e=50}={}){function r(){let n=-1,s={close:(0,vl.deferred)(),closeTimeout:(0,vl.deferred)(),exit:(0,vl.deferred)(),exitTimeout:(0,vl.deferred)()},a=Promise.race([t===!1?cC:s.closeTimeout.promise,e===!1?cC:s.exitTimeout.promise]);return i(t,s.close,s.closeTimeout),i(e,s.exit,s.exitTimeout),{close(o){n=o,s.close.done()},exit(o){n=o,s.exit.done()},get exitCode(){return n},result:a}}function i(n,s,a){n!==!1&&(n===!0?s.promise:s.promise.then(()=>vv(n))).then(a.done)}return{type:"spawn.after",async action(n,{spawned:s,close:a}){var u,f;let o=r(),l=!0,c=()=>{l=!1};(u=s.stdout)==null||u.on("data",c),(f=s.stderr)==null||f.on("data",c),s.on("error",c),s.on("close",d=>o.close(d)),s.on("exit",d=>o.exit(d));try{await o.result,l&&await vv(50),a(o.exitCode)}catch(d){a(o.exitCode,d)}}}}ve();var B6="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",uC="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function H6(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}function fC(t,e){if(t.length<1||t.length>2)throw new bl(void 0,"binary",B6);if(t.some(H6))if(e)console.warn(uC);else throw new bl(void 0,"binary",uC);let[i,n]=t;return{binary:i,prefix:n}}function U6(t,e=["git"],r=!1){let i=fC(yn(e),r);t.on("binary",n=>{i=fC(yn(n),r)}),t.append("spawn.binary",()=>i.binary),t.append("spawn.args",n=>i.prefix?[i.prefix,...n]:n)}Hs();function G6(t){return!!(t.exitCode&&t.stdErr.length)}function j6(t){return E.concat([...t.stdOut,...t.stdErr])}function V6(t=!1,e=G6,r=j6){return(i,n)=>!t&&i||!e(n)?i:r(n)}function dC(t){return{type:"task.error",action(e,r){let i=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return E.isBuffer(i)?{error:new Br(void 0,i.toString("utf-8"))}:{error:i}}}}ve();var z6=class{constructor(){this.plugins=new Set,this.events=new p2.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Ei(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return yn(t).forEach(r=>r&&this.plugins.add(Ei(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let i=e,n=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(i=s.action(i,n));return i}};ve();function W6(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,a){return r.includes(a.method)?_C(s,e):s}},{type:"spawn.after",action(s,a){var o;a.commands.includes(e)&&((o=a.spawned.stderr)==null||o.on("data",l=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));c&&t({method:a.method,stage:q6(c[1]),progress:Qe(c[2]),processed:Qe(c[3]),total:Qe(c[4])})}))}}]}function q6(t){return String(t.toLowerCase().split(" ",1))||"unknown"}ve();function Y6(t){let e=xC(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}function Z6({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(i,n){var c,u;let s;function a(){s&&clearTimeout(s),s=setTimeout(l,t)}function o(){var f,d;(f=n.spawned.stdout)==null||f.off("data",a),(d=n.spawned.stderr)==null||d.off("data",a),n.spawned.off("exit",o),n.spawned.off("close",o),s&&clearTimeout(s)}function l(){o(),n.kill(new bl(void 0,"timeout","block timeout reached"))}r&&((c=n.spawned.stdout)==null||c.on("data",a)),e&&((u=n.spawned.stderr)==null||u.on("data",a)),n.spawned.on("exit",o),n.spawned.on("close",o),a()}}}function K6(){return{type:"spawn.args",action(t){let e=[],r;function i(n){(r=r||[]).push(...n)}for(let n=0;n_i(a)&&ml(a)||a));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}ve();var X6=I6();function Q6(t,e){var n;let r=new z6,i=AC(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!Mv(i.baseDir))throw new M6(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(L6(i.config)),r.add(O6(i.unsafe)),r.add(N6(i.completion)),i.abort&&r.add(D6(i.abort)),i.progress&&r.add(W6(i.progress)),i.timeout&&r.add(Z6(i.timeout)),i.spawnOptions&&r.add(Y6(i.spawnOptions)),r.add(K6()),r.add(dC(V6(!0))),i.errors&&r.add(dC(i.errors)),U6(r,i.binary,(n=i.unsafe)==null?void 0:n.allowUnsafeCustomBinary),new X6(i,r)}_l();var m2=Q6;var Ce=class extends cl{constructor(r){super(r);this.useDefaultWindowsGitPath=!1}async setGitInstance(r=!1){var i;if(await this.isGitInstalled()){let n=this.app.vault.adapter,s=n.getBasePath(),a=s;this.plugin.settings.basePath&&(await n.exists((0,Zn.normalizePath)(this.plugin.settings.basePath))?a=We.join(s,this.plugin.settings.basePath):r||new Zn.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=a,this.git=m2({baseDir:a,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?Rd:void 0),config:["core.quotepath=off"],unsafe:{allowUnsafeCustomBinary:!0,allowUnsafeEditor:!0,allowUnsafeAskPass:!0,allowUnsafeConfigEnvCount:!0,allowUnsafeConfigPaths:!0,allowUnsafeCredentialHelper:!0,allowUnsafeGitProxy:!0,allowUnsafeGpgProgram:!0,allowUnsafeHooksPath:!0,allowUnsafeMergeDriver:!0,allowUnsafeSshCommand:!0,allowUnsafePager:!0}});let o=this.plugin.localStorage.getPATHPaths(),l=this.plugin.localStorage.getEnvVars(),c=this.plugin.settings.gitDir,u={...process.env};if(o.length>0){let y=o.join(":")+":"+u.PATH;u.PATH=y}c&&(u.GIT_DIR=c,u.GIT_WORK_TREE=a);for(let y of l){let[b,S]=y.split("=");u[b]=S}let f="simple-git",d=",",p=((i=localStorage.debug)!=null?i:"").split(d);if(!p.includes(f)&&!p.includes(`-${f}`)&&(p.push(f),w2.default.enable(p.join(d))),await this.git.env(u).checkIsRepo()){let y=await this.git.revparse("--show-cdup"),b=(0,Tu.resolve)(a+Tu.sep+y);this.absoluteRepoPath=b,await this.git.cwd(b)}let g=We.join(s,this.app.vault.configDir,"plugins","obsidian-git"),w=We.join(g,Sa);u.SSH_ASKPASS==null&&(u.SSH_ASKPASS=w),u.SSH_ASKPASS_REQUIRE="force",u.OBSIDIAN_GIT_CREDENTIALS_INPUT=We.join(g,$d),u.SSH_ASKPASS==w&&this.askpass().catch(y=>this.plugin.displayError(y)),u.OBSIDIAN_GIT="1",this.git=this.git.env(u)}}getRelativeVaultPath(r){let n=this.app.vault.adapter.getBasePath(),s=We.join(this.absoluteRepoPath,r),a=We.relative(n,s);return Zn.Platform.isWin&&(a=a.replace(/\\/g,"/")),a}getRelativeRepoPath(r,i=!0){if(i){let s=this.plugin.app.vault.adapter.getBasePath(),a=this.absoluteRepoPath,o=We.join(s,r),l=We.relative(a,o);return Zn.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return r}get absPluginConfigPath(){let i=this.app.vault.adapter.getBasePath();return We.join(i,this.app.vault.configDir,"plugins","obsidian-git")}get relPluginConfigPath(){return We.join(this.app.vault.configDir,"plugins","obsidian-git")}async askpass(){let r=this.app.vault.adapter,i=this.app.vault.configDir+"/plugins/obsidian-git/";await this.addAskPassScriptToExclude(),await ei.writeFile(We.join(this.absPluginConfigPath,Sa),Nk),await ei.chmod(We.join(this.absPluginConfigPath,Sa),493),this.watchAbortController=new AbortController;let{signal:n}=this.watchAbortController;try{let s=ei.watch(this.absPluginConfigPath,{signal:n});for await(let a of s){if(a.filename!=$d)continue;let o=i+$d;if(await new Promise(d=>window.setTimeout(d,200)),!await r.exists(o))continue;let l=await r.read(o),c;l.length>60&&(c=new Zn.Notice(l,999999));let u=!0;l.contains("Username for")&&(u=!1);let f=await new tt(this.plugin,{allowEmpty:!0,obscure:u,placeholder:l.length>60?"Enter a response to the message.":l}).openAndGetResult();c==null||c.hide(),await r.exists(o)&&await r.write(`${o}.response`,f!=null?f:"")}}catch(s){this.plugin.displayError(s),await ei.rm(We.join(this.absPluginConfigPath,Sa),{force:!0}),await ei.rm(We.join(this.absPluginConfigPath,`${Sa}.response`),{force:!0}),await new Promise(a=>window.setTimeout(a,5e3)),this.plugin.log("Retry watch for ask pass"),await this.askpass()}}async addAskPassScriptToExclude(){try{if(!await this.git.checkIsRepo())return;let r=await this.git.revparse(["--path-format=absolute","--git-path","info/exclude"]),i=We.join(this.app.vault.configDir,"plugins","obsidian-git",Sa),n=this.getRelativeRepoPath(i,!0);(await ei.readFile(r,"utf-8")).split(` +`).some(l=>l.contains(n))||await ei.appendFile(r,n+` +`)}catch(r){console.error("Error while adding askpass script to exclude file:",r)}}unload(){var r;(r=this.watchAbortController)==null||r.abort()}async status(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=await this.git.status(i!=null?["--",i]:[]);this.plugin.setPluginState({gitAction:0});let s=n.files.map(a=>{let o=this.formatPath(a);return{path:o.path,from:o.from,index:a.index==="?"?"U":a.index,workingDir:a.working_dir==="?"?"U":a.working_dir,vaultPath:this.getRelativeVaultPath(o.path)}});return{all:s,changed:s.filter(a=>a.workingDir!==" "),staged:s.filter(a=>a.index!==" "&&a.index!="U"),conflicted:n.conflicted.map(a=>this.formatPath({path:a}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let i=this.getRelativeRepoPath(r),s=["-C",We.dirname(i),"rev-parse","HEAD"],a=this.git.raw(s);return a.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),(await a).trim()}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((i,n,s,a)=>{if(!(a.contains("submodule")&&a.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");n.on("data",c=>{o+=c.toString("utf8")}),n.on("end",()=>{let u=o.split(` +`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Tu.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},i=>this.plugin.displayError(i))})}formatPath(r){function i(n){if(n!=null)return n.startsWith('"')&&n.endsWith('"')?n.substring(1,n.length-1):n}return r.from!=null?{from:i(r.from),path:i(r.path)}:{path:i(r.path)}}async blame(r,i,n){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let s=await this.getSubmoduleOfFile(r),a=s?["-C",s.submodule]:[],o=s?s.relativeFilepath:r;a.push("blame","--porcelain"),n&&a.push("-w");let l=`-C${Pd}`;switch(i){case"inactive":break;case"same-commit":a.push("-C",l);break;case"all-commits":a.push("-C","-C",l);break;default:Ls(i)}a.push("--",o);let c=await this.git.raw(a);return J6(c)}async isTracked(r){let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("ls-files","--",s),this.git.raw(n).then(a=>a.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let n=await this.getSubmodulePaths();for(let s of n)await this.git.cwd({path:s,root:!1}).add("-A"),await this.git.cwd({path:s,root:!1}).commit(await this.formatCommitMessage(r))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let i=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),i.summary.changes}async commit({message:r,amend:i}){this.plugin.setPluginState({gitAction:4});let n=(await this.git.commit(await this.formatCommitMessage(r),i?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),n}async stage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.add(["--",r]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.add(r!=null?r:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(r!=null?["--",r]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.reset(["--",r]),this.plugin.setPluginState({gitAction:0})}async discard(r){this.plugin.setPluginState({gitAction:3}),await this.isTracked(r)&&await this.git.checkout(["--",r]),this.plugin.setPluginState({gitAction:0})}async applyPatch(r){let i=We.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(i,r),await this.git.applyPatch(i,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(i)}async getUntrackedPaths(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=[];i!=null&&n.push("--",i);let s=await this.git.clean(Pa.RECURSIVE+Pa.DRY_RUN,n);return this.plugin.setPluginState({gitAction:0}),s.paths}async hashObject(r){r=this.getRelativeRepoPath(r);let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("hash-object","--",s),this.git.raw(n)}async discardAll({dir:r}){return this.discard(r!=null?r:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let r=await this.branchInfo(),i=await this.git.revparse([r.current]);if(!r.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let n=await this.git.revparse([r.tracking]);if(i!==n){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{let o=[r.tracking];switch(this.plugin.settings.mergeStrategy!=="none"&&o.push(`--strategy-option=${this.plugin.settings.mergeStrategy}`),this.plugin.settings.syncMethod){case"merge":await this.git.merge(o);break;case"rebase":await this.git.rebase(o)}}catch(o){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${r.current}`,n]),await this.unstageAll({})}catch(o){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`)}this.app.workspace.trigger("obsidian-git:head-change");let s=await this.git.revparse([r.current]);return(await this.git.diff([`${i}..${s}`,"--name-only"])).split(/\r\n|\r|\n/).filter(o=>o.length>0).map(o=>({path:o,workingDir:"P",vaultPath:this.getRelativeVaultPath(o)}))}else return[]}catch(r){this.convertErrors(r)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let a=await this.git.subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(a)}let r=await this.git.status(),i=r.tracking,n=r.current;if(!i&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring push of main repo and updating submodules only.");return}let s=null;return i&&(s=(await this.git.diffSummary([n,i,"--"])).changed),await this.git.push(),s}catch(r){this.convertErrors(r)}}async getUnpushedCommits(){let r=await this.git.status(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let[s]=Yn(i);return(await this.getRemoteBranches(s)).includes(i)?(await this.git.diffSummary([n,i,"--"])).changed:(this.plugin.log(`Tracking branch ${i} does not exist on remote ${s}.`),0)}async canPush(){if(this.plugin.settings.updateSubmodules===!0)return!0;let r=await this.git.status(),i=r.tracking,n=r.current;return i?(await this.git.diffSummary([n,i,"--"])).changed!==0:!1}async checkRequirements(){return await this.isGitInstalled()?await this.git.checkIsRepo()?"valid":"missing-repo":"missing-git"}async branchInfo(){let r=await this.git.status(),i=await this.git.branch(["--no-color"]);return{current:r.current||void 0,tracking:r.tracking||void 0,branches:i.all}}async getRemoteUrl(r){try{return await this.git.remote(["get-url",r])||void 0}catch(i){if(String(i).contains(r))return;throw i}}async log(r,i=!0,n,s){let a;r&&(a=this.getRelativeRepoPath(r,i));let o={file:a,maxCount:n,"--diff-merges":"first-parent","--name-status":null};return s&&(o[s]=null),(await this.git.log(o)).all.map(c=>{var u,f,d,h;return{...c,author:{name:c.author_name,email:c.author_email},refs:c.refs.split(", ").filter(p=>p.length>0),diff:{...c.diff,files:(f=(u=c.diff)==null?void 0:u.files.map(p=>({...p,status:p.status,path:p.file,hash:c.hash,vaultPath:this.getRelativeVaultPath(p.file),fromPath:p.from,fromVaultPath:p.from!=null?this.getRelativeVaultPath(p.from):void 0,binary:p.binary})))!=null?f:[]},fileName:(h=(d=c.diff)==null?void 0:d.files.first())==null?void 0:h.file}})}async show(r,i,n=!0){let s=this.getRelativeRepoPath(i,n);return this.git.show([r+":"+s])}async getLocalBranchUpstream(r){try{let n=(await this.git.raw(["rev-parse","--abbrev-ref",`${r}@{upstream}`])).trim();return n.length>0?n:void 0}catch(i){return}}getAvailableLocalBranchName(r,i,n){let s=r;if(!n.includes(s))return s;let a=`${r}-${i}`,o=a,l=0;for(;n.includes(o);)l+=1,o=`${a}-${l}`;return o}async checkout(r,i){if(i){let n=`${i}/${r}`,s=await this.branchInfo();if(s.branches.includes(r)&&await this.getLocalBranchUpstream(r)===n)await this.git.checkout(r);else{let l=this.getAvailableLocalBranchName(r,i,s.branches);await this.git.checkout(["-b",l,n])}}else await this.git.checkout(r);if(this.plugin.settings.submoduleRecurseCheckout){let n=await this.getSubmodulePaths();for(let s of n){let a=await this.git.cwd({path:s,root:!1}).branch();Object.keys(a.branches).includes(r)&&await this.git.cwd({path:s,root:!1}).checkout(r)}}}async createBranch(r){await this.git.checkout(["-b",r])}async deleteBranch(r,i){await this.git.branch([i?"-D":"-d",r])}async branchIsMerged(r){return!(await this.git.branch(["--no-merged"])).all.contains(r)}async init(){await this.git.init(!1)}async clone(r,i,n){await this.git.clone(r,We.join(this.app.vault.adapter.getBasePath(),i),n?["--depth",`${n}`]:[]),await this.setGitInstance()}async setConfig(r,i){i==null?await this.git.raw(["config","--local","--unset",r]):await this.git.addConfig(r,i)}async getConfig(r,i="local"){var s;return(s=(await this.git.getConfig(r.toLowerCase(),i=="all"?void 0:i)).value)!=null?s:void 0}async fetch(r){await this.git.fetch(r!=null?[r]:[])}async setRemote(r,i){(await this.getRemotes()).includes(r)?await this.git.remote(["set-url",r,i]):await this.git.remote(["add",r,i])}async getRemoteBranches(r){let i=await this.git.branch(["-r","--list",`${r}*`]),n=[];for(let s in i.branches)n.push(i.branches[s].name);return n}async getRemotes(){let r=await this.git.remote([]);return r?r.trim().split(` +`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(i){try{await this.git.branch(["--set-upstream",r])}catch(n){let[s,a]=Yn(r),o=await this.branchInfo();await this.git.push(["--set-upstream",s,`${o.current}:${a}`])}}}updateGitPath(r){return this.setGitInstance()}updateBasePath(r){return this.setGitInstance(!0)}async getDiffString(r,i=!1,n){return i?await this.git.diff(["--cached","--",r]):n?await this.git.show([`${n}`,"--",r]):await this.git.diff(["--",r])}async diff(r,i,n){return await this.git.diff([`${i}..${n}`,"--",r])}async rawCommand(r){let i=r.split(" ");return await this.git.raw(i[0],...i.slice(1))}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(We.dirname(r)))return;let i=await this.git.raw(["-C",We.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(i=i.trim(),(await this.git.raw(["-C",We.dirname(r),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let a=this.app.vault.adapter.getFullPath(We.normalize(r)),o=We.relative(i,a);return{submodule:i,relativeFilepath:o}}async getLastCommitTime(){try{let r=await this.git.log({n:1});if(r!=null&&r.latest!=null)return new Date(r.latest.date)}catch(r){if(r instanceof Br){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),i=await wu(r||"git",["--version"],{});if(i.error)if(Zn.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${Rd}) of Git for Windows.`);let n=await wu(Rd,["--version"]);if(n.error)return console.error(n.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(i.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof Br){let i=String(r.message);if(i.contains("Could not resolve host")||i.contains("Unable to resolve host")||i.contains("Unable to open connection")||i.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||i.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||i.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new nl(i)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(i){let n=i instanceof Error?i.message:String(i);return this.plugin.displayError(`Error checking LFS status: ${n}`),!1}}},b2={hash:"000000",isZeroCommit:!0,summary:""};function J6(t){let r=t.replace(`\r +`,` +`).split(` +`),i={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},n=1;for(let s=0;s=4&&r.groupSizePerStartingLine.set(e,parseInt(t[3])),parseInt(t[2])!==e)throw Error(`git-blame output is out of order: ${e} vs ${t[2]}`);return i}function t5(t,e,r){let i=t[0],n=t.slice(1).join(" "),s=e.hashPerLine[r],a=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(i){case"summary":a.summary=n;break;case"author":a.author.name=n;break;case"author-mail":a.author.email=v2(n);break;case"author-time":a.author.epochSeconds=parseInt(n);break;case"author-tz":a.author.tz=n;break;case"committer":a.committer.name=n;break;case"committer-mail":a.committer.email=v2(n);break;case"committer-time":a.committer.epochSeconds=parseInt(n);break;case"committer-tz":a.committer.tz=n;break;case"previous":a.previous.commitHash=n;break;case"filename":a.previous.filename=n;break}e.commits.set(s,a)}function r5(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);ew(t.author)&&(t.author=void 0),ew(t.committer)&&(t.committer=void 0),ew(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function ew(t){return!t||Object.keys(t).length===0}function g2(t){return t.length>0&&t[0].trim()===t[0]}function v2(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}m();var q2=require("@codemirror/state");m();var tw=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(e,r){if(e)return this.ensureInitialized(e),r(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(r=>r.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},Kn=new tw;m();var ah=require("@codemirror/state"),x2=Gt(rw(),1);function E2(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var S2=ah.StateEffect.define();function k2(t,e,r){return r.update({effects:S2.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var xl=ah.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(S2))return r.value;return i5(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function oh(t){var s;let e=x2.sha256.create();if(!t)return e;let{la:r,key:i,lineOffsetsFromUnsavedChanges:n}=t;e.update(r==="untracked"?"t":"f"),e.update(i);for(let[a,o]of(s=n.entries())!=null?s:[])e.update([a,o]);return e}var Pu={get:void 0,save:void 0};function A2(t,e){Pu.get=t,Pu.save=e}function lh(t){var e,r;return(r=(e=Ru(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:Ru(pt.lineAuthor.coloringMaxAge).asDays()}function i5(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,i,n,s)=>{var p;let a=t.startState.doc,{newDoc:o}=t,l=a.lineAt(r).number,c=a.lineAt(i).number,u=o.lineAt(n).number,f=o.lineAt(s).number,d=c-l+1,h=f-u+1;for(let g=u;g<=f;g++){let w=(p=e.lineOffsetsFromUnsavedChanges.get(g))!=null?p:0,y=f===g,b=h-d;y&&(w+=b),e.lineOffsetsFromUnsavedChanges.set(g,w)}}),e}m();function C2(){El=void 0,iw=[],ch=0,fh.clear(),dh.clear(),Sl.clear()}var El,uh=()=>El;function T2(t,e){var n;let r=e.length;if(r<((n=El==null?void 0:El.length)!=null?n:0))return;El={gutter:t,length:r,text:e};let i=zt.plugin.localStorage.getGutterSpacingFallbackLength();r!==i&&zt.plugin.localStorage.setGutterSpacingFallbackLength(r)}var iw=[],n5=15,ch=0;function P2(t){iw[ch]=t,ch=(ch+1)%n5}function R2(){return fA(iw)}var fh=new Map,dh=new Map,Sl=new Set;m();var V2=require("@codemirror/state"),z2=require("@codemirror/view");m();var ow=require("@codemirror/view"),B2=Gt(rw(),1),kl=require("obsidian");m();m();var hh={x:-10,y:-10};function $2(){hh.x===-10&&window.addEventListener("mousedown",t=>{hh.x=t.clientX,hh.y=t.clientY})}function F2(){for(let t of Sl)if(s5(t,hh))return t}function s5(t,e){let{x:r,y:i,width:n,height:s}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+n&&i<=e.y&&e.y<=i+s}var I2="data-commit";function M2(t,e,r){if(e.hasFocus())return;let i=F2();if(!i)return;let n=o5(i);n&&(!n.isZeroCommit&&!n.isWaitingGutter&&a5(n,t),nw("showCommitHash",t),nw("authorDisplay",t),nw("dateTimeFormatOptions",t))}function a5(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(i=>navigator.clipboard.writeText(t.hash)))}function nw(t,e){var l,c;let r,i,n=zt.plugin.settings.lineAuthor,s=n[t],a=typeof s=="boolean"?s:s!=="hide",o=pt.lineAuthor[t];if(t==="showCommitHash")r="Show commit hash",i=s;else if(t==="authorDisplay"){let u=(l=n.lastShownAuthorDisplay)!=null?l:o;r="Show author "+(a?s:u),i=a?"hide":u}else if(t==="dateTimeFormatOptions"){let u=(c=n.lastShownDateTimeFormatOptions)!=null?c:o;r="Show "+(a?s:u),r+=r.contains("date")?"":" date",i=a?"hide":u}else Ls(t);e.addItem(u=>u.setTitle(r).setSection("obs-git-line-author-configure").setChecked(a).onClick(f=>{var d,h;return(h=(d=zt.plugin)==null?void 0:d.settingsTab)==null?void 0:h.lineAuthorSettingHandler(t,i)}))}function D2(t,e,r){r.setAttr(I2,JSON.stringify({hash:t.hash,isZeroCommit:t.isZeroCommit,isWaitingGutter:e}))}function o5(t){let e=t.getAttr(I2);return e?JSON.parse(e):void 0}m();function mh(t,e){return t==="oldest"?ph(0,!1,e).color:ph(void 0,!0,e).color}function ph(t,e,r){let i=lh(r),n=Date.now()/1e3,s=t!=null?t:0,o=(e?0:n-s)/60/60/24,l=Math.pow(Math.clamp(o/i,0,1),1/2.3),c=l5(),u=r.colorNew,f=r.colorOld,d=c?.4:1,h=sw(u.r,f.r,l)*d,p=sw(u.g,f.g,l)*d,g=sw(u.b,f.b,l)*d;return{color:`rgba(${h},${p},${g},${c?.75:.25})`,daysSinceCommit:o}}function sw(t,e,r){return t+(e-t)*r}function l5(){var t;return((t=window.app)==null?void 0:t.getTheme())==="obsidian"}function O2(t){activeDocument.body.style.setProperty("--obs-git-gutter-text",t.textColorCss)}m();function L2(t,e,r){let i;for(let n=e;n<=r;n++){let s=t.hashPerLine[n],a=t.commits.get(s);(!i||a.isZeroCommit||c5(a,i))&&(i=a)}return i}function c5(t,e){var n,s,a,o;let r=(s=(n=t.author)==null?void 0:n.epochSeconds)!=null?s:0,i=(o=(a=e.author)==null?void 0:a.epochSeconds)!=null?o:0;return r>i}var H2=require("node:util");var N2="-",u5="+",f5=3,d5="*",h5=/\S/g,p5="%",Al=class t extends ow.GutterMarker{constructor(r){super();this.text=r}eq(r){return r instanceof t&&this.text===r.text}toDOM(){return activeDocument.createTextNode(this.text)}destroy(r){}},aw=class extends ow.GutterMarker{constructor(r,i,n,s,a,o){super();this.lineAuthoring=r;this.startLine=i;this.endLine=n;this.key=s;this.settings=a;this.options=o;this.point=!1;this.elementClass="obs-git-blame-gutter"}eq(r){return this.key===(r==null?void 0:r.key)&&this.startLine===(r==null?void 0:r.startLine)&&this.endLine===(r==null?void 0:r.endLine)&&(this==null?void 0:this.options)===(r==null?void 0:r.options)}toDOM(){var r;return this.precomputedDomProvider=(r=this.precomputedDomProvider)!=null?r:this.computeDom(),this.precomputedDomProvider()}destroy(r){r&&(activeDocument.body.contains(r)||Sl.delete(r))}computeDom(){let r=L2(this.lineAuthoring,this.startLine,this.endLine),i=r.isZeroCommit?"":this.renderNonZeroCommit(r);return!r.isZeroCommit&&this.options!=="waiting-for-result"?T2(this,i):i=this.adaptTextForFakeCommit(r,i,this.options),this.createHtmlNode(r,i,this.options==="waiting-for-result")}createHtmlNode(r,i,n){var c,u,f,d,h,p;let s=window.createDiv();s.setText(i);let{color:a,daysSinceCommit:o}=ph((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds,r==null?void 0:r.isZeroCommit,this.settings);s.style.backgroundColor=a,s.setAttribute("data-author",(f=(u=r==null?void 0:r.author)==null?void 0:u.name)!=null?f:""),s.setAttribute("data-author-email",(h=(d=r==null?void 0:r.author)==null?void 0:d.email)!=null?h:""),(0,kl.setTooltip)(s,(p=r==null?void 0:r.summary)!=null?p:""),D2(r,n,s);function l(){let g=s.cloneNode(!0);return Sl.add(g),n||P2(o),g}return l}renderNonZeroCommit(r){let i=this.settings.showCommitHash?this.renderHash(r):"",n=this.settings.authorDisplay==="hide"?"":`${this.renderAuthorName(r,this.settings.authorDisplay)}`,s=this.settings.dateTimeFormatOptions==="hide"?"":`${this.renderAuthoringDate(r,this.settings.dateTimeFormatOptions,this.settings.dateTimeFormatCustomString,this.settings.dateTimeTimezone)}`;return[i,n,s].filter(o=>o.length>=1).join(" ")}renderHash(r){return r.hash.substring(0,6)}renderAuthorName(r,i){var o,l,c,u;let n=(l=(o=r==null?void 0:r.author)==null?void 0:o.name)!=null?l:"",s=n.split(" ").filter(f=>f.length>=1),a;switch(i){case"initials":a=s.map(f=>f[0].toUpperCase()).join("");break;case"first name":a=(c=s.first())!=null?c:N2;break;case"last name":a=(u=s.last())!=null?u:N2;break;case"full":a=n;break;default:return Ls(i)}return(0,H2.isDeepStrictEqual)(r==null?void 0:r.author,r==null?void 0:r.committer)||(a=a+d5),a}renderAuthoringDate(r,i,n,s){var c;if(((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds)===void 0)return"?";let o;switch(i){case"date":o=Td;break;case"datetime":o=Zg;break;case"custom":o=n;break;case"natural language":o=u=>{let f=u.diff((0,kl.moment)());return kl.moment.duration(f).humanize(!0)};break;default:return Ls(i)}let l=kl.moment.unix(r.author.epochSeconds);switch(s){case"viewer-local":break;case"author-local":l=l.utcOffset(r.author.tz),typeof o=="string"&&(o+=" Z");break;case"utc0000":l=l.utc(),typeof o=="string"&&(o+="[Z]");break;default:return Ls(s)}return typeof o=="string"?l.format(o):o(l)}adaptTextForFakeCommit(r,i,n){var l,c,u;let s=(c=(l=uh())==null?void 0:l.text)!=null?c:i,a=n!=="waiting-for-result"&&r.isZeroCommit?u5:p5;i=s.replace(h5,a);let o=(u=zt.plugin.localStorage.getGutterSpacingFallbackLength())!=null?u:i.length;if(i=dA(i,o,a),n!=="waiting-for-result"&&r.isZeroCommit){let f=Math.min(o,f5);i=hA(i,o-f)}return i}};function Fa(t,e,r,i,n,s){let a=B2.sha256.create();a.update(JSON.stringify(n)),a.update(`s${e}-e${r}-k${i}-o${s}`);let o=a.hex(),l=fh.get(o);if(l)return l;let c=new aw(t,e,r,i,n,s);return fh.set(o,c),c}m();var U2=require("obsidian");function lw(){let t=zt.plugin.localStorage.getGutterSpacingFallbackLength();return new Al(Array(t).fill("-").join(""))}function cw(t){let{lineAuthoring:e,ageForInitialRender:r}=m5(t);return Fa(e,1,1,"initialGutter"+r,t,"waiting-for-result")}function m5(t){var s;let e=(s=R2())!=null?s:lh(t)*.25,r=(0,U2.moment)().add(-e,"days"),i={name:"",epochSeconds:uA(r),tz:"+0000"},n={hash:"waiting-for-result",author:i,committer:i,isZeroCommit:!1};return{lineAuthoring:{hashPerLine:[void 0,"waiting-for-result"],commits:new Map([["waiting-for-result",n]])},ageForInitialRender:e}}m();function G2(t,e){return Fa({hashPerLine:[void 0,"000000"],commits:new Map([["000000",b2]])},1,1,t,e)}var uw=new Al(""),W2=(0,z2.gutter)({class:"line-author-gutter-container",markers(t){let e=t.state.field(xl,!1);return g5(t,e)},lineMarkerChange(t){let e=oh(t.state.field(xl));return oh(t.startState.field(xl))!==e},renderEmptyElements:!0,initialSpacer:t=>(j2(t),lw()),updateSpacer:(t,e)=>{var r,i;return j2(e.view),(i=(r=uh())==null?void 0:r.gutter)!=null?i:lw()}});function g5(t,e){let r=oh(e),i=t.state.doc,n=new Map;for(let u=1;u<=i.lines;u++){let f=i.line(u).from,d=t.lineBlockAt(f).to;n.set(u,[f,d]),r.update([f,d,0])}let s=Pu.get();r.update("s"+Object.values(Pu).join(","));let a=r.hex(),o=dh.get(a);if(o)return o;let{result:l,allowCache:c}=v5(i,n,s,e);return c&&dh.set(a,l),l}function v5(t,e,r,i){let n=!0,s=t.lines,a=[];function o(f,d,h){return a.push(h.range(f,d))}let l=w5(s,i),c=t.length===0,u=t.iterLines(s,s+1).next().value==="";for(let f=1;f<=s;f++){let[d,h]=e.get(f),p=t.lineAt(h).number;if(c){o(d,h,uw);continue}if(f===s&&u){o(d,h,uw);continue}if(i===void 0){o(d,h,cw(r)),n=!1;continue}let{key:g,la:w}=i;if(w==="untracked"){o(d,h,G2(w,r));continue}let y=w.hashPerLine.length-1,b=l[f],S=l[p];if(S&&S>y&&o(d,h,uw),b!==void 0&&sv(1,b,y)&&S!==void 0&&sv(1,S,y)){o(d,h,Fa(w,b,S,g,r));continue}if(y<1){o(d,h,cw(r)),n=!1;continue}let C=Math.clamp(b!=null?b:f,1,y),A=Math.clamp(S!=null?S:p,1,y);o(d,h,Fa(w,C,A,g+"computing",r,"waiting-for-result"))}return{result:V2.RangeSet.of(a,!0),allowCache:n}}function w5(t,e){if(!(e!=null&&e.lineOffsetsFromUnsavedChanges))return Array.from(new Array(t+1),n=>n);let r=[void 0],i=0;for(let n=1;n<=t;n++){let s=e.lineOffsetsFromUnsavedChanges.get(n);i+=s!=null?s:0,r[n]=s===void 0?n-i:void 0}return r}function j2(t){t.dom.querySelectorAll(".cm-gutters").forEach(r=>{r!=null&&r.style&&(r.style.marginLeft||(r.style.marginLeft="unset"))})}var gh=class{constructor(e){this.plugin=e;this.lineAuthorings=new Map}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeLineAuthorInfo(e.path)}}destroy(){this.lineAuthorings.clear(),C2()}async computeLineAuthorInfo(e){let r=this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager,i=await r.submoduleAwareHeadRevisonInContainingDirectory(e),n=await r.hashObject(e),s=E2(i,n,e);if(s!==void 0){if(!this.lineAuthorings.has(s)){let a=await r.blame(e,this.plugin.settings.lineAuthor.followMovement,this.plugin.settings.lineAuthor.ignoreWhitespace);this.lineAuthorings.set(s,a)}this.notifyComputationResultToSubscribers(e,s)}}notifyComputationResultToSubscribers(e,r){Kn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyLineAuthoring(r,this.lineAuthorings.get(r))))}},Y2=q2.Prec.high([xl,W2]);var Z2="https://momentjs.com/docs/#/parsing/string-format/",b5="https://publish.obsidian.md/git-doc/Line+Authoring",vh=class extends j.PluginSettingTab{constructor(r,i){super(r,i);this.plugin=i;this.lineAuthorColorSettings=new Map;this.icon="git-pull-request"}get settings(){return this.plugin.settings}display(){let{containerEl:r}=this,i=this.plugin,n;i.settings.differentIntervalCommitAndPush?n="commit":n="commit-and-sync";let s=i.gitReady;r.empty(),s||(r.createEl("p",{text:"Git is not ready. When all settings are correct you can configure commit-sync, etc."}),r.createEl("br"));let a;if(s){new j.Setting(r).setName("Automatic").setHeading(),new j.Setting(r).setName("Split timers for automatic commit and sync").setDesc("Enable to use one interval for commit and another for sync.").addToggle(f=>f.setValue(i.settings.differentIntervalCommitAndPush).onChange(async d=>{i.settings.differentIntervalCommitAndPush=d,await i.saveSettings(),i.automaticsManager.reload("commit","push"),this.refreshDisplayWithDelay()})),new j.Setting(r).setName(`Auto ${n} interval (minutes)`).setDesc(`${i.settings.differentIntervalCommitAndPush?"Commit":"Commit and sync"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoSaveInterval"}),f.setPlaceholder(String(pt.autoSaveInterval)),f.onChange(async d=>{d!==""?i.settings.autoSaveInterval=Number(d):i.settings.autoSaveInterval=pt.autoSaveInterval,await i.saveSettings(),i.automaticsManager.reload("commit")})}),a=new j.Setting(r).setName(`Auto ${n} after stopping file edits`).setDesc(`Requires the ${n} interval not to be 0. + If turned on, do auto ${n} every ${pA(i.settings.autoSaveInterval)} after stopping file edits. + This also prevents auto ${n} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(f=>f.setValue(i.settings.autoBackupAfterFileChange).onChange(async d=>{i.settings.autoBackupAfterFileChange=d,this.refreshDisplayWithDelay(),await i.saveSettings(),i.automaticsManager.reload("commit")})),this.mayDisableSetting(a,i.settings.setLastSaveToLastCommit),a=new j.Setting(r).setName(`Auto ${n} after latest commit`).setDesc(`If turned on, sets last auto ${n} timestamp to the latest commit timestamp. This reduces the frequency of auto ${n} when doing manual commits.`).addToggle(f=>f.setValue(i.settings.setLastSaveToLastCommit).onChange(async d=>{i.settings.setLastSaveToLastCommit=d,await i.saveSettings(),i.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(a,i.settings.autoBackupAfterFileChange),a=new j.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPushInterval"}),f.setPlaceholder(String(pt.autoPushInterval)),f.onChange(async d=>{d!==""?i.settings.autoPushInterval=Number(d):i.settings.autoPushInterval=pt.autoPushInterval,await i.saveSettings(),i.automaticsManager.reload("push")})}),this.mayDisableSetting(a,!i.settings.differentIntervalCommitAndPush),new j.Setting(r).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPullInterval"}),f.setPlaceholder(String(pt.autoPullInterval)),f.onChange(async d=>{d!==""?i.settings.autoPullInterval=Number(d):i.settings.autoPullInterval=pt.autoPullInterval,await i.saveSettings(),i.automaticsManager.reload("pull")})}),new j.Setting(r).setName(`Auto ${n} only staged files`).setDesc(`If turned on, only staged files are committed on ${n}. If turned off, all changed files are committed.`).addToggle(f=>f.setValue(i.settings.autoCommitOnlyStaged).onChange(async d=>{i.settings.autoCommitOnlyStaged=d,await i.saveSettings()})),new j.Setting(r).setName(`Specify custom commit message on auto ${n}`).setDesc("You will get a pop up to specify your message.").addToggle(f=>f.setValue(i.settings.customMessageOnAutoBackup).onChange(async d=>{i.settings.customMessageOnAutoBackup=d,await i.saveSettings(),this.refreshDisplayWithDelay()})),a=new j.Setting(r).setName(`Commit message on auto ${n}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(f=>{f.setPlaceholder(pt.autoCommitMessage).onChange(async d=>{d===""?i.settings.autoCommitMessage=pt.autoCommitMessage:i.settings.autoCommitMessage=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(a,i.settings.customMessageOnAutoBackup),new j.Setting(r).setName("Commit message").setHeading();let c=new j.Setting(r).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message). Leave empty to require manual input on each commit.");c.addTextArea(f=>{c.addButton(d=>{d.setIcon("reset").setTooltip(`Set to default: "${pt.commitMessage}"`).onClick(()=>{f.setValue(pt.commitMessage),f.onChanged()})}),f.setValue(i.settings.commitMessage),f.onChange(async d=>{i.settings.commitMessage=d,await i.saveSettings()})}),j.Platform.isDesktopApp&&new j.Setting(r).setName("Commit message script").setDesc("A script that is run using 'sh -c' to generate the commit message. May be used to generate commit messages using AI tools. Available placeholders: {{hostname}}, {{date}}.").addText(f=>{f.onChange(async d=>{d===""?i.settings.commitMessageScript=pt.commitMessageScript:i.settings.commitMessageScript=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"commitMessageScript"})});let u=new j.Setting(r).setName("{{date}} placeholder format").addMomentFormat(f=>f.setDefaultFormat(i.settings.commitDateFormat).setValue(i.settings.commitDateFormat).onChange(async d=>{i.settings.commitDateFormat=d,await i.saveSettings()}));u.descEl.createSpan({text:` Specify custom date format. E.g. "${Kg}. See `}),u.descEl.createEl("a",{text:"Moment.js documentation",href:Z2,attr:{target:"_blank"}}),u.descEl.createSpan({text:" for more formats."}),new j.Setting(r).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device. Defaults to the OS hostname if not set on desktop.").addText(f=>{var d;return f.setValue((d=i.localStorage.getHostname())!=null?d:"").onChange(h=>{i.localStorage.setHostname(h)})}),new j.Setting(r).setName("Preview commit message").addButton(f=>f.setButtonText("Preview").onClick(async()=>{let d=await i.gitManager.formatCommitMessage(i.settings.commitMessage);new j.Notice(`${d}`)})),new j.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(f=>f.setValue(i.settings.listChangedFilesInMessageBody).onChange(async d=>{i.settings.listChangedFilesInMessageBody=d,await i.saveSettings()})),new j.Setting(r).setName("Pull").setHeading(),i.gitManager instanceof Ce&&new j.Setting(r).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(f=>{let d={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};f.addOptions(d),f.setValue(i.settings.syncMethod),f.onChange(async h=>{i.settings.syncMethod=h,await i.saveSettings()})}),new j.Setting(r).setName("Merge strategy on conflicts").setDesc("Decide how to solve conflicts when pulling remote changes. This can be used to favor your local changes or the remote changes automatically.").addDropdown(f=>{let d={none:"None (git default)",ours:"Our changes",theirs:"Their changes"};f.addOptions(d),f.setValue(i.settings.mergeStrategy),f.onChange(async h=>{i.settings.mergeStrategy=h,await i.saveSettings()})}),new j.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(f=>f.setValue(i.settings.autoPullOnBoot).onChange(async d=>{i.settings.autoPullOnBoot=d,await i.saveSettings()})),new j.Setting(r).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),a=new j.Setting(r).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${i.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(f=>f.setValue(!i.settings.disablePush).onChange(async d=>{i.settings.disablePush=!d,this.refreshDisplayWithDelay(),await i.saveSettings()})),new j.Setting(r).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${i.settings.disablePush?"":"and push "}only.`).addToggle(f=>f.setValue(i.settings.pullBeforePush).onChange(async d=>{i.settings.pullBeforePush=d,this.refreshDisplayWithDelay(),await i.saveSettings()})),i.gitManager instanceof Ce&&(new j.Setting(r).setName("Hunk management").setDesc("Hunks are sections of grouped line changes right in your editor.").setHeading(),new j.Setting(r).setName("Signs").setDesc("This allows you to see your changes right in your editor via colored markers and stage/reset/preview individual hunks.").addToggle(f=>f.setValue(i.settings.hunks.showSigns).onChange(async d=>{i.settings.hunks.showSigns=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new j.Setting(r).setName("Hunk commands").setDesc("Adds commands to stage/reset individual Git diff hunks and navigate between them via 'Go to next/prev hunk' commands.").addToggle(f=>f.setValue(i.settings.hunks.hunkCommands).onChange(async d=>{i.settings.hunks.hunkCommands=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new j.Setting(r).setName("Status bar with summary of line changes").addDropdown(f=>f.addOptions({disabled:"Disabled",colored:"Colored",monochrome:"Monochrome"}).setValue(i.settings.hunks.statusBar).onChange(async d=>{i.settings.hunks.statusBar=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new j.Setting(r).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new j.Setting(r).setName("History view").setHeading(),new j.Setting(r).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(i.settings.authorInHistoryView),c.onChange(async f=>{i.settings.authorInHistoryView=f,await i.saveSettings(),await i.refresh()})}),new j.Setting(r).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(i.settings.dateInHistoryView).onChange(async u=>{i.settings.dateInHistoryView=u,await i.saveSettings(),await i.refresh()})),new j.Setting(r).setName("Source control view").setHeading(),new j.Setting(r).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(i.settings.refreshSourceControl).onChange(async u=>{i.settings.refreshSourceControl=u,await i.saveSettings()})),new j.Setting(r).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>{c.inputEl.type="number",this.setNonDefaultValue({text:c,settingsProperty:"refreshSourceControlTimer"}),c.setPlaceholder(String(pt.refreshSourceControlTimer)),c.onChange(async f=>{f!==""&&Number.isInteger(Number(f))?i.settings.refreshSourceControlTimer=Math.max(Number(f),500):i.settings.refreshSourceControlTimer=pt.refreshSourceControlTimer,await i.saveSettings(),i.setRefreshDebouncer()})}),new j.Setting(r).setName("Miscellaneous").setHeading(),i.gitManager instanceof Ce&&new j.Setting(r).setName("Diff view style").setDesc('Set the style for the diff view. Note that the actual diff in "Split" mode is not generated by Git, but the editor itself instead so it may differ from the diff generated by Git. One advantage of this is that you can edit the text in that view.').addDropdown(c=>{let u={split:"Split",git_unified:"Unified"};c.addOptions(u),c.setValue(i.settings.diffStyle),c.onChange(async f=>{i.settings.diffStyle=f,await i.saveSettings()})}),new j.Setting(r).setName("Disable informative notifications").setDesc("Disable informative notifications for git operations to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(i.settings.disablePopups).onChange(async u=>{i.settings.disablePopups=u,this.refreshDisplayWithDelay(),await i.saveSettings()})),new j.Setting(r).setName("Disable error notifications").setDesc("Disable error notifications of any kind to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(!i.settings.showErrorNotices).onChange(async u=>{i.settings.showErrorNotices=!u,await i.saveSettings()})),i.settings.disablePopups||new j.Setting(r).setName("Hide notifications for no changes").setDesc("Don't show notifications when there are no changes to commit or push.").addToggle(c=>c.setValue(i.settings.disablePopupsForNoChanges).onChange(async u=>{i.settings.disablePopupsForNoChanges=u,await i.saveSettings()})),new j.Setting(r).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showStatusBar).onChange(async u=>{i.settings.showStatusBar=u,await i.saveSettings()})),new j.Setting(r).setName("File menu integration").setDesc('Add "Stage", "Unstage" and "Add to .gitignore" actions to the file menu.').addToggle(c=>c.setValue(i.settings.showFileMenu).onChange(async u=>{i.settings.showFileMenu=u,await i.saveSettings()})),new j.Setting(r).setName("Show branch status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showBranchStatusBar).onChange(async u=>{i.settings.showBranchStatusBar=u,await i.saveSettings()})),new j.Setting(r).setName("Show the count of modified files in the status bar").addToggle(c=>c.setValue(i.settings.changedFilesInStatusBar).onChange(async u=>{i.settings.changedFilesInStatusBar=u,await i.saveSettings()})),i.gitManager instanceof Vi?new j.Setting(r).setName("Authentication/commit author").setHeading():new j.Setting(r).setName("Commit author").setHeading(),i.gitManager instanceof Vi&&new j.Setting(r).setName("Username on your git server. E.g. your username on GitHub").addText(c=>{var u;c.setValue((u=i.localStorage.getUsername())!=null?u:""),c.onChange(f=>{i.localStorage.setUsername(f)})}),i.gitManager instanceof Vi&&new j.Setting(r).setName("Password/Personal access token").setDesc("Type in your password. You won't be able to see it again.").addText(c=>{c.inputEl.autocapitalize="off",c.inputEl.autocomplete="off",c.inputEl.spellcheck=!1,c.onChange(u=>{i.localStorage.setPassword(u)})}),i.gitReady&&new j.Setting(r).setName("Author name for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.name"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.name",f==""?void 0:f)})}),i.gitReady&&new j.Setting(r).setName("Author email for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.email"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.email",f==""?void 0:f)})}),new j.Setting(r).setName("Advanced").setDesc("These settings usually don't need to be changed, but may be required for special setups.").setHeading(),i.gitManager instanceof Ce&&(new j.Setting(r).setName("Update submodules").setDesc('"Commit-and-sync" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule.').addToggle(c=>c.setValue(i.settings.updateSubmodules).onChange(async u=>{i.settings.updateSubmodules=u,await i.saveSettings()})),i.settings.updateSubmodules&&new j.Setting(r).setName("Submodule recurse checkout/switch").setDesc("Whenever a checkout happens on the root repository, recurse the checkout on the submodules (if the branches exist).").addToggle(c=>c.setValue(i.settings.submoduleRecurseCheckout).onChange(async u=>{i.settings.submoduleRecurseCheckout=u,await i.saveSettings()}))),i.gitManager instanceof Ce&&new j.Setting(r).setName("Custom Git binary path").setDesc("Specify the path to the Git binary/executable. Git should already be in your PATH. Should only be necessary for a custom Git installation.").addText(c=>{var u;c.setValue((u=i.localStorage.getGitPath())!=null?u:""),c.setPlaceholder("git"),c.onChange(f=>{i.localStorage.setGitPath(f),i.gitManager.updateGitPath(f||"git").catch(d=>i.displayError(d))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Additional environment variables").setDesc("Use each line for a new environment variable in the format KEY=VALUE .").addTextArea(c=>{c.setPlaceholder("GIT_DIR=/path/to/git/dir"),c.setValue(i.localStorage.getEnvVars().join(` +`)),c.onChange(u=>{i.localStorage.setEnvVars(u.split(` +`))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(i.localStorage.getPATHPaths().join(` +`)),c.onChange(u=>{i.localStorage.setPATHPaths(u.split(` +`))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await i.gitManager.setGitInstance()})}),new j.Setting(r).setName("Custom base path (Git repository path)").setDesc(` + Sets the relative path to the vault from which the Git binary should be executed. + Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows. + `).addText(c=>{c.setValue(i.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{i.settings.basePath=u,await i.saveSettings(),i.gitManager.updateBasePath(u||"").catch(f=>i.displayError(f))})}),new j.Setting(r).setName("Custom Git directory path (Instead of '.git')").setDesc('Corresponds to the GIT_DIR environment variable. Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(i.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{i.settings.gitDir=u,await i.saveSettings()})}),new j.Setting(r).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(i.localStorage.getPluginDisabled()).onChange(u=>{i.localStorage.setPluginDisabled(u),u?i.unloadPlugin():i.init({fromReload:!0}).catch(f=>i.displayError(f)),new j.Notice("Obsidian must be restarted for the changes to take affect.")})),new j.Setting(r).setName("Support").setHeading(),new j.Setting(r).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{var f;let u=(f=c.buttonEl.parentElement)==null?void 0:f.createEl("a",{href:"https://ko-fi.com/F1F195IQ5",attr:{target:"_blank"}});u&&(u.createEl("img",{attr:{height:"36",style:"border:0px;height:36px;",src:"https://cdn.ko-fi.com/cdn/kofi3.png?v=3",border:"0",alt:"Buy Me a Coffee at ko-fi.com"}}),c.buttonEl.remove())});let o=r.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new j.Notice("Debug information copied to clipboard. May contain sensitive information!")},j.Platform.isDesktopApp){let c=r.createDiv();c.setAttr("align","center"),c.setText(`Debugging and logging: +You can always see the logs of this and every other plugin by opening the console with`);let u=r.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),j.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(r,i){i&&(r.setDisabled(i),r.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(r){this.settings.lineAuthor.show=r,this.plugin.saveSettings(),r?this.plugin.editorIntegration.activateLineAuthoring():this.plugin.editorIntegration.deactiveLineAuthoring()}async lineAuthorSettingHandler(r,i){this.settings.lineAuthor[r]=i,await this.plugin.saveSettings(),this.plugin.editorIntegration.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let r=this.settings.lineAuthor;r.authorDisplay!=="hide"&&(r.lastShownAuthorDisplay=r.authorDisplay),r.dateTimeFormatOptions!=="hide"&&(r.lastShownDateTimeFormatOptions=r.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let r=new j.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.createEl("a",{href:b5,text:"Feature guide and quick examples",attr:{target:"_blank"}}),r.descEl.createEl("br"),r.descEl.createSpan({text:" The commit hash, author name and authoring date can all be individually toggled."}),r.descEl.createEl("br"),r.descEl.createSpan({text:"Hide everything, to only show the age-colored sidebar."}),r.addToggle(i=>i.setValue(this.settings.lineAuthor.show).onChange(n=>{this.configureLineAuthorShowStatus(n),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let i=new j.Setting(this.containerEl).setName("Follow movement and copies across files and commits").addDropdown(l=>{l.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),l.setValue(this.settings.lineAuthor.followMovement),l.onChange(c=>this.lineAuthorSettingHandler("followMovement",c))});if(i.descEl.createSpan({text:"By default (deactivated), each line only shows the newest commit where it was changed."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"same commit"}),i.descEl.createSpan({text:", cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"all commits"}),i.descEl.createSpan({text:", cut-copy-paste-ing text inbetween multiple commits will be detected."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"It uses "}),i.descEl.createEl("a",{href:"https://git-scm.com/docs/git-blame",text:"git-blame",attr:{target:"_blank"}}),i.descEl.createSpan({text:` and for matches (at least ${Pd} characters) within the same (or all) commit(s), `}),i.descEl.createEl("em",{text:"the originating"}),i.descEl.createSpan({text:" commit's information is shown."}),new j.Setting(this.containerEl).setName("Show commit hash").addToggle(l=>{l.setValue(this.settings.lineAuthor.showCommitHash),l.onChange(c=>this.lineAuthorSettingHandler("showCommitHash",c))}),new j.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(l=>{let c={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};l.addOptions(c),l.setValue(this.settings.lineAuthor.authorDisplay),l.onChange(async u=>this.lineAuthorSettingHandler("authorDisplay",u))}),new j.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(l=>{let c={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};l.addOptions(c),l.setValue(this.settings.lineAuthor.dateTimeFormatOptions),l.onChange(async u=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",u),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let l=new j.Setting(this.containerEl);l.setName("Custom authoring date format").addText(c=>{c.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),c.setPlaceholder("YYYY-MM-DD HH:mm"),c.onChange(async u=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",u),this.setCustomDateTimeDescription(l.descEl,u)})}),this.setCustomDateTimeDescription(l.descEl,this.settings.lineAuthor.dateTimeFormatCustomString)}let n=new j.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(l=>{let c={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};l.addOptions(c),l.setValue(this.settings.lineAuthor.dateTimeTimezone),l.onChange(async u=>this.lineAuthorSettingHandler("dateTimeTimezone",u))});n.descEl.empty(),n.descEl.createSpan({text:`The time-zone in which the authoring date should be shown. +Either your local time-zone (default), +the author's time-zone during commit creation or +`}),n.descEl.createEl("a",{text:"UTC\xB100:00",href:"https://en.wikipedia.org/wiki/UTC%C2%B100:00"}),n.descEl.createSpan({text:"."});let s=new j.Setting(this.containerEl).setName("Oldest age in coloring");this.setOldestAgeDescription(s.descEl,this.settings.lineAuthor.coloringMaxAge),s.addText(l=>{l.setPlaceholder("1y"),l.setValue(this.settings.lineAuthor.coloringMaxAge),l.onChange(async c=>{let f=Ru(c)!==void 0;this.setOldestAgeDescription(s.descEl,c),f&&(await this.lineAuthorSettingHandler("coloringMaxAge",c),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest");let a=new j.Setting(this.containerEl).setName("Text color").addText(l=>{l.setValue(this.settings.lineAuthor.textColorCss),l.onChange(async c=>{await this.lineAuthorSettingHandler("textColorCss",c)})});a.descEl.empty(),a.descEl.createSpan({text:"The CSS color of the gutter text."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"It is highly recommended to use "}),a.descEl.createEl("a",{text:"CSS variables",href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties"}),a.descEl.createSpan({text:" defined by themes (e.g. "}),a.descEl.createEl("pre",{text:"var(--text-muted)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:" or "}),a.descEl.createEl("pre",{text:"var(--text-on-accent)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:"), because they automatically adapt to theme changes."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"See: "}),a.descEl.createEl("a",{text:"List of available CSS variables in Obsidian",href:"https://github.com/obsidian-community/obsidian-theme-template/blob/main/obsidian.css"});let o=new j.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(l=>{l.setValue(this.settings.lineAuthor.ignoreWhitespace),l.onChange(c=>this.lineAuthorSettingHandler("ignoreWhitespace",c))});o.descEl.empty(),o.descEl.createSpan({text:"Whitespace and newlines are interpreted as part of the document and in changes by default (hence not ignored). This makes the last line being shown as 'changed' when a new subsequent line is added, even if the previously last line's text is the same."}),o.descEl.createEl("br"),o.descEl.createSpan({text:"If you don't care about purely-whitespace changes (e.g. list nesting / quote indentation changes), then activating this will provide more meaningful change detection."})}}createColorSetting(r){let i=new j.Setting(this.containerEl).setName("").addText(n=>{let s=fw(r,this.settings.lineAuthor),a=fw(r,pt.lineAuthor);n.setPlaceholder(nv(a)),n.setValue(nv(s)),n.onChange(async o=>{let l=cA(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,i),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,fw(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let i=this.lineAuthorColorSettings.get(r);if(i){let n=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";i.nameEl.setText(`Color for ${n} commits`)}}refreshColorSettingsDesc(r,i){let n=this.lineAuthorColorSettings.get(r);n&&this.colorSettingPreviewDesc(n.descEl,r,this.settings.lineAuthor,i!==void 0)}colorSettingPreviewDesc(r,i,n,s){r.empty(),r.createSpan({text:"Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and named colors (e.g. 'black', 'purple'). Color preview: "});let a=s?mh(i,n):"rgba(127,127,127,0.3)",o=j.moment.unix(j.moment.now()/1e3).format("YYYY-MM-DD"),l=s?`abcdef Author Name ${o}`:"invalid color";r.createEl("div",{text:l,attr:{class:"line-author-settings-preview",style:`background-color: ${a}; width: 30ch;`}})}setCustomDateTimeDescription(r,i){r.empty(),r.createEl("a",{text:"Format string",href:Z2}),r.createSpan({text:" to display the authoring date."}),r.createEl("br");let n=(0,j.moment)().format(i);r.createSpan({text:`Currently: ${n}`})}setOldestAgeDescription(r,i){let n=Ru(i),s=n!==void 0?`${n.asDays()} days`:"invalid!";r.empty(),r.createSpan({text:`The oldest age in the line author coloring. Everything older will have the same color. +Smallest valid age is "1d". Currently: ${s}`})}setNonDefaultValue({settingsProperty:r,text:i}){let n=this.plugin.settings[r];pt[r]!==n&&(typeof n=="string"||typeof n=="number"||typeof n=="boolean"?i.setValue(String(n)):i.setValue(JSON.stringify(n)))}refreshDisplayWithDelay(r=80){window.setTimeout(()=>this.display(),r)}};function fw(t,e){return t==="oldest"?e.colorOld:e.colorNew}function Ru(t){let e=j.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}m();var ti=require("obsidian");var wh=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),r.registerEvent(r.app.workspace.on("obsidian-git:refreshed",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,r){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:r}),this.display()}display(){this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){switch((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv(),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.style.float="left",this.pausedEl=this.statusBarEl.createDiv(),this.pausedEl.setAttribute("data-tooltip-position","top"),this.pausedEl.style.float="left",this.iconEl=this.statusBarEl.createDiv(),this.iconEl.style.float="left",this.textEl=this.statusBarEl.createDiv(),this.textEl.style.float="right",this.textEl.style.marginLeft="5px"),this.plugin.localStorage.getConflict()?((0,ti.setIcon)(this.conflictEl,"alert-circle"),this.conflictEl.ariaLabel="You have merge conflicts. Resolve them and commit afterwards.",this.conflictEl.style.marginRight="5px",this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.style.marginRight=""),this.plugin.localStorage.getPausedAutomatics()?((0,ti.setIcon)(this.pausedEl,"pause-circle"),this.pausedEl.ariaLabel="Automatic routines are currently paused.",this.pausedEl.style.marginRight="5px",this.pausedEl.addClass(this.base+"paused")):(this.pausedEl.empty(),this.pausedEl.style.marginRight=""),this.plugin.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,ti.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,ti.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,ti.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,ti.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,ti.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,ti.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var i;let e=this.lastCommitTimestamp,r=this.plugin.state.offlineMode;if(e){let n=(0,ti.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${r?"Offline: ":""}Last Commit: ${n}`,((i=this.unPushedCommits)!=null?i:0)>0&&(this.statusBarEl.ariaLabel+=` +(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,ti.setIcon)(this.iconEl,"globe"):(0,ti.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus&&this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.gitManager.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};m();var _h=require("obsidian"),bh=class extends _h.SuggestModal{constructor(r){super(r.app);this.plugin=r;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>window.setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(r){let i=(0,_h.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${i}: ${r}`,`${r}: ${i}`]}renderSuggestion(r,i){i.innerText=r}onChooseSuggestion(r,i){this.resolve&&this.resolve(r)}};m();var K2=require("obsidian"),$u=class{constructor(e){this.plugin=e}saveLastAuto(e,r){r==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):r==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):r==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,r,i;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((i=this.plugin.localStorage.getLastAutoPush())!=null?i:"")}}async init(){await this.setUpAutoCommitAndSync();let e=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let r=this.diff(this.plugin.settings.autoPushInterval,e.push);this.startAutoPush(r)}if(this.plugin.settings.autoPullInterval>0){let r=this.diff(this.plugin.settings.autoPullInterval,e.pull);this.startAutoPull(r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...e){this.plugin.localStorage.getPausedAutomatics()||(e.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),e.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),e.contains("pull")&&(this.clearAutoPull(),this.plugin.settings.autoPullInterval>0&&this.startAutoPull(this.plugin.settings.autoPullInterval)))}async setUpAutoCommitAndSync(){if(this.plugin.settings.setLastSaveToLastCommit){this.clearAutoCommitAndSync();let e=await this.plugin.gitManager.getLastCommitTime();e&&this.saveLastAuto(e,"backup")}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let e=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let r=this.diff(this.plugin.settings.autoSaveInterval,e.backup);this.startAutoCommitAndSync(r)}}}startAutoCommitAndSync(e){let r=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?e===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,K2.debounce)(()=>this.doAutoCommitAndSync(),r,!0):(r>2147483647&&(r=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),r))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(async()=>{if(this.plugin.settings.setLastSaveToLastCommit){let r=await this.plugin.gitManager.getLastCommitTime();if(r){this.saveLastAuto(r,"backup");let i=this.diff(this.plugin.settings.autoSaveInterval,r);if(i>0)return this.startAutoCommitAndSync(i),!1}}let e=this.plugin.settings.autoCommitOnlyStaged;return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.commit({fromAuto:!0,onlyStaged:e}):await this.plugin.commitAndSync({fromAutoBackup:!0,onlyStaged:e}),!0},e=>{e!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(e){let r=(e!=null?e:this.plugin.settings.autoPullInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPull=window.setTimeout(()=>this.doAutoPull(),r)}doAutoPull(){this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote(),()=>{this.saveLastAuto(new Date,"pull"),this.startAutoPull()})}startAutoPush(e){let r=(e!=null?e:this.plugin.settings.autoPushInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPush=window.setTimeout(()=>this.doAutoPush(),r)}doAutoPush(){this.plugin.promiseQueue.addTask(()=>this.plugin.push(),()=>{this.saveLastAuto(new Date,"push"),this.startAutoPush()})}clearAutoCommitAndSync(){var r;let e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCommitDebouncer&&((r=this.plugin.autoCommitDebouncer)==null||r.cancel(),this.plugin.autoCommitDebouncer=void 0,e=!0),e}clearAutoPull(){return this.timeoutIDPull?(window.clearTimeout(this.timeoutIDPull),this.timeoutIDPull=void 0,!0):!1}clearAutoPush(){return this.timeoutIDPush?(window.clearTimeout(this.timeoutIDPush),this.timeoutIDPush=void 0,!0):!1}diff(e,r){let n=e-Math.round((new Date().getTime()-r.getTime())/1e3/60);return Math.max(0,n)}};m();var Wi=require("obsidian");m();var Fu=require("obsidian");async function X2(t,e,r){let i=await J2(e,r);if(i.result==="failure"){new Fu.Notice(i.reason);return}let{isGitHub:n,branch:s,repo:a,user:o,filePath:l}=i;if(n){let c=t.getCursor("from").line+1,u=t.getCursor("to").line+1;c===u?window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}`):window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}-L${u}`)}else new Fu.Notice("It seems like you are not using GitHub")}async function Q2(t,e){let r=await J2(t,e);if(r.result==="failure"){new Fu.Notice(r.reason);return}let{isGitHub:i,branch:n,repo:s,user:a,filePath:o}=r;i?window.open(`https://github.com/${a}/${s}/commits/${n}/${o}`):new Fu.Notice("It seems like you are not using GitHub")}async function J2(t,e){let r=await e.branchInfo(),i=r.tracking,n=r.current,s,a=e.getRelativeRepoPath(t.path);if(e instanceof Ce){let l=await e.getSubmoduleOfFile(e.getRelativeRepoPath(t.path));if(l){a=l.relativeFilepath;let c=await e.git.cwd({path:l.submodule,root:!1}).status();if(i=c.tracking||void 0,n=c.current||void 0,i){let u=i.substring(0,i.indexOf("/")),f=await e.git.cwd({path:l.submodule,root:!1}).getConfig(`remote.${u}.url`,"local");if(f.value!=null)s=f.value;else return{result:"failure",reason:"Failed to get remote url of submodule"}}}}if(i==null)return{result:"failure",reason:"Remote branch is not configured"};if(n==null)return{result:"failure",reason:"Failed to get current branch name"};if(s==null){let l=i.substring(0,i.indexOf("/"));if(s=await e.getConfig(`remote.${l}.url`),s==null)return{result:"failure",reason:"Failed to get remote url"}}let o=s.match(/(?:^https:\/\/github\.com\/(.+)\/(.+?)(?:\.git)?$)|(?:^[a-zA-Z]+@github\.com:(.+)\/(.+?)(?:\.git)?$)/);if(o==null)return{result:"failure",reason:"Could not parse remote url"};{let[l,c,u,f,d]=o;return{result:"success",isGitHub:!!l,repo:u||d,user:c||f,branch:n,filePath:a}}}m();var eP=require("obsidian"),yh=class extends eP.FuzzySuggestModal{constructor(e,r){super(e.app),this.plugin=e,this.changedFiles=r,this.setPlaceholder("Not supported files will be opened by default app!")}getItems(){return this.changedFiles}getItemText(e){if(e.index=="U"&&e.workingDir=="U")return`Untracked | ${e.vaultPath}`;let r="",i="";return e.workingDir!=" "&&(r=`Working Dir: ${e.workingDir} `),e.index!=" "&&(i=`Index: ${e.index}`),`${r}${i} | ${e.vaultPath}`}onChooseItem(e,r){this.plugin.app.metadataCache.getFirstLinkpathDest(e.vaultPath,"")==null?this.app.openWithDefaultApp(e.vaultPath):this.plugin.app.workspace.openLinkText(e.vaultPath,"/")}};m();var tP=require("obsidian"),xh=class extends tP.Modal{constructor(r,i){super(r);this.content=i;this.resolve=null}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onOpen(){let{contentEl:r,titleEl:i}=this;i.setText("Edit .gitignore");let n=r.createDiv(),s=n.createEl("textarea",{text:this.content,cls:["obsidian-git-textarea"],attr:{rows:10,cols:30,wrap:"off"}});n.createEl("button",{cls:["mod-cta","obsidian-git-center-button"],text:"Save"}).addEventListener("click",()=>{this.resolve(s.value),this.close()})}onClose(){let{contentEl:r}=this;r.empty(),this.resolve&&this.resolve(void 0)}};m();var ju=require("@codemirror/state"),Uh=require("@codemirror/view");m();var Pl=require("@codemirror/state");m();var Wt=class t{static createHunk(e,r,i,n){return{removed:{start:e,count:r,lines:[]},added:{start:i,count:n,lines:[]},head:`@@ -${e}${r>0?`,${r}`:""} +${i}${n>0?`,${n}`:""} @@`,vend:i+Math.max(n-1,0),type:n===0?"delete":r===0?"add":"change"}}static createPartialHunk(e,r,i){let n=r,s=i-r+1,a=0;for(let o of e){let l=o.added.count-o.removed.count,c=0;if(o.added.start>=r&&o.vend<=i)c=l;else{let u=Math.max(0,i+1-(o.added.start+o.removed.count)),f=Math.max(0,r-(o.added.start+o.removed.count));o.added.start>=r&&o.added.start<=i?c=u:o.vend>=r&&o.vend<=i?(c=l-f,n=n-f):o.added.start<=r&&o.vend>=i?(c=u-f,n=n-f):a++,r>o.vend&&(n=n-l)}s=s-c}if(a!==e.length)return s===0&&(n=n-1),this.createHunk(n,s,r,i-r+1)}patchLines(e,r=!1){let i=[];for(let n of e.removed.lines)i.push("-"+n);for(let n of e.added.lines)i.push("+"+n);return r?i.map(n=>n.replace(/\r$/,"")):i}static parseDiffLine(e){let n=e.split("@@")[1].trim().split(" "),s=n[0].substring(1).split(","),a=n[1].substring(1).split(","),o=this.createHunk(parseInt(s[0]),parseInt(s[1]||"1"),parseInt(a[0]),parseInt(a[1]||"1"));return o.head=e,o}static changeEnd(e){return e.added.count===0?e.added.start:e.removed.count===0?e.added.start+e.added.count-1:e.added.start+Math.min(e.added.count,e.removed.count)-1}static calcSigns(e,r,i,n=1,s=1/0,a){if(a&&r.type!=="add")return console.error(`Invalid hunk with untracked=${a} hunk="${r.head}"`),[];n=Math.max(1,n);let{start:o,added:l,removed:c}={start:r.added.start,added:r.added.count,removed:r.removed.count},u=this.changeEnd(r),f=r.type==="delete"&&(o===0||e&&this.changeEnd(e)===o)&&(!i||i.added.start!==o+1);f&&n===1&&(n=0);let d=[];for(let h=Math.max(o,n);h<=Math.min(u,s);h++){let p=r.type==="change"&&(c>l&&h===u||e&&e.added.start===0);d.push({type:f?"topdelete":p?"changedelete":a?"untracked":r.type,count:h===o?r.type==="add"?l:c:void 0,lnum:h+(f?1:0)})}if(r.type==="change"&&l>c&&r.vend>=n&&u<=s)for(let h=Math.max(u,n);h<=Math.min(r.vend,s);h++)d.push({type:"add",count:h===r.vend?l-c:void 0,lnum:h});return d}static createPatch(e,r,i,n=!1){let s=[`diff --git a/${e} b/${e}`,`index 000000..000000 ${i}`,`--- a/${e}`,`+++ b/${e}`],a=0;r=structuredClone(r);for(let o of r){let l=o.removed.start,c=o.removed.count,u=o.added.count;o.type==="add"&&(l=l+1);let f=o.removed.lines,d=o.added.lines;n&&([c,u]=[u,c],[f,d]=[d,f]),s.push(`@@ -${l},${c} +${l+a},${u} @@`);for(let h of f)s.push("-"+h);(n?o.added:o.removed).no_nl_at_eof&&s.push("\\ No newline at end of file");for(let h of d)s.push("+"+h);(n?o.removed:o.added).no_nl_at_eof&&s.push("\\ No newline at end of file"),o.removed.start=l+a,a=a+(u-c)}return s}getSummary(e){let r={added:0,changed:0,removed:0};for(let i of e)if(i.type==="add")r.added+=i.added.count;else if(i.type==="delete")r.removed+=i.removed.count;else if(i.type==="change"){let n=i.added.count,s=i.removed.count,a=Math.min(n,s);r.changed+=a,r.added+=n-a,r.removed+=s-a}return r}static findHunk(e,r){if(!r)return[void 0,void 0];for(let i=0;i=e)return[n,i]}return[void 0,void 0]}static findNearestHunk(e,r,i,n){if(r.length!==0){if(i==="first")return 0;if(i==="last")return r.length-1;if(i==="next"){if(r[0].added.start>e)return 0;for(let s=r.length-1;s>=0;s--)if(r[s].added.start<=e){if(s+1e)return s+1;if(n)return 0}}else if(i==="prev"){if(Math.max(r[r.length-1].vend)0&&Math.max(r[s-1].vend,1)l.added.start?n++:o.added.starta.map(w=>g.replace(/&/,w))).reduce((g,w)=>g.concat(w)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(n(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((i&&!f&&!c?a.map(i):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in e)s(n(a),e[a],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=iP[rP]||1;return iP[rP]=e+1,"\u037C"+e.toString(36)}static mount(e,r,i){let n=e[dw],s=i&&i.nonce;n?s&&n.setNonce(s):n=new hw(e,s),n.mount(Array.isArray(r)?r:[r],e)}},nP=new Map,hw=class{constructor(e,r){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=nP.get(i);if(s)return e[dw]=s;this.sheet=new n.CSSStyleSheet,nP.set(i,this)}else this.styleTag=i.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[dw]=this}mount(e,r){let i=this.sheet,n=0,s=0;for(let a=0;a-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),i)for(let c=0;cc){let f=t.slice(e,r).indexOf(i.slice(n,s));if(f>-1)return[new kt(e,e+f,n,n),new kt(e+f+c,r,s,s)]}else if(c>l){let f=i.slice(n,s).indexOf(t.slice(e,r));if(f>-1)return[new kt(e,e,n,n+f),new kt(r,r,n+f+l,s)]}if(l==1||c==1)return[new kt(e,r,n,s)];let u=SP(t,e,r,i,n,s);if(u){let[f,d,h]=u;return Ma(t,e,f,i,n,d).concat(Ma(t,f+h,r,i,d+h,s))}return y5(t,e,r,i,n,s)}var Iu=1e9,Mu=0,_w=!1;function y5(t,e,r,i,n,s){let a=r-e,o=s-n;if(Iu<1e9&&Math.min(a,o)>Iu*16||Mu>0&&Date.now()>Mu)return Math.min(a,o)>Iu*64?[new kt(e,r,n,s)]:sP(t,e,r,i,n,s);let l=Math.ceil((a+o)/2);pw.reset(l),mw.reset(l);let c=(h,p)=>t.charCodeAt(e+h)==i.charCodeAt(n+p),u=(h,p)=>t.charCodeAt(r-h-1)==i.charCodeAt(s-p-1),f=(a-o)%2!=0?mw:null,d=f?null:pw;for(let h=0;hIu||Mu>0&&!(h&63)&&Date.now()>Mu)return sP(t,e,r,i,n,s);let p=pw.advance(h,a,o,l,f,!1,c)||mw.advance(h,a,o,l,d,!0,u);if(p)return x5(t,e,r,e+p[0],i,n,s,n+p[1])}return[new kt(e,r,n,s)]}var Th=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(f>i)this.start+=2;else if(s){let d=n+(r-i)-l;if(d>=0&&d=r-u)return[h,n+h-d]}else{let h=r-s.vec[d];if(u>=h)return[u,f]}}}return null}},pw=new Th,mw=new Th;function x5(t,e,r,i,n,s,a,o){let l=!1;return!Tl(t,i)&&++i==r&&(l=!0),!Tl(n,o)&&++o==a&&(l=!0),l?[new kt(e,r,s,a)]:Ma(t,e,i,n,s,o).concat(Ma(t,i,r,n,o,a))}function EP(t,e){let r=1,i=Math.min(t,e);for(;rr||u>s||t.slice(o,c)!=i.slice(l,u)){if(a==1)return o-e-(Tl(t,o)?0:1);a=a>>1}else{if(c==r||u==s)return c-e;o=c,l=u}}}function xw(t,e,r,i,n,s){if(e==r||n==s||t.charCodeAt(r-1)!=i.charCodeAt(s-1))return 0;let a=EP(r-e,s-n);for(let o=r,l=s;;){let c=o-a,u=l-a;if(c>1}else{if(c==e||u==n)return r-c;o=c,l=u}}}function gw(t,e,r,i,n,s,a,o){let l=i.slice(n,s),c=null;for(;;){if(c||a=r)break;let d=t.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let p=yw(t,f,r,i,n+h+d.length,s),g=xw(t,e,u,i,n,n+h),w=d.length+p+g;(!c||c[2]>1}}function SP(t,e,r,i,n,s){let a=r-e,o=s-n;if(an.fromA-e&&i.toB>n.fromB-e&&(t[r-1]=new kt(i.fromA,n.toA,i.fromB,n.toB),t.splice(r--,1))}}function E5(t,e,r){for(;;){kP(r,1);let i=!1;for(let n=0;n3||o>3){let l=n==t.length-1?e.length:t[n+1].fromA,c=s.fromA-i,u=l-s.toA,f=oP(e,s.fromA,c),d=aP(e,s.toA,u),h=s.fromA-f,p=d-s.toA;if((!a||!o)&&h&&p){let g=Math.max(a,o),[w,y,b]=a?[e,s.fromA,s.toA]:[r,s.fromB,s.toB];g>h&&e.slice(f,s.fromA)==w.slice(b-h,b)?(s=t[n]=new kt(f,f+a,s.fromB-h,s.toB-h),f=s.fromA,d=aP(e,s.toA,l-s.toA)):g>p&&e.slice(s.toA,d)==w.slice(y,y+p)&&(s=t[n]=new kt(d-a,d,s.fromB+p,s.toB+p),d=s.toA,f=oP(e,s.fromA,s.fromA-i)),h=s.fromA-f,p=d-s.toA}if(h||p)s=t[n]=new kt(s.fromA-h,s.toA+p,s.fromB-h,s.toB+p);else if(a){if(!o){let g=cP(e,s.fromA,s.toA),w,y=g<0?-1:lP(e,s.toA,s.fromA);g>-1&&(w=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+w)?s=t[n]=s.offset(w):y>-1&&(w=s.toA-y)<=c&&e.slice(s.fromA-w,s.fromA)==e.slice(y,s.toA)&&(s=t[n]=s.offset(-w))}}else{let g=cP(r,s.fromB,s.toB),w,y=g<0?-1:lP(r,s.toB,s.fromB);g>-1&&(w=g-s.fromB)<=u&&r.slice(s.fromB,g)==r.slice(s.toB,s.toB+w)?s=t[n]=s.offset(w):y>-1&&(w=s.toB-y)<=c&&r.slice(s.fromB-w,s.fromB)==r.slice(y,s.toB)&&(s=t[n]=s.offset(-w))}}i=s.toA}return kP(t,3),t}var Ia;try{Ia=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(t){}function AP(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function CP(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?AP(r)?1:0:Ia?!RP(r)||e==t.length-1?Ia.test(String.fromCharCode(r))?1:0:Ia.test(t.slice(e,e+2))?2:0:0}function TP(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?AP(r)?1:0:Ia?!$P(r)||e==1?Ia.test(String.fromCharCode(r))?1:0:Ia.test(t.slice(e-2,e))?2:0:0}var PP=8;function aP(t,e,r){if(e==t.length||!TP(t,e))return e;for(let i=e,n=e+r,s=0;sn)return i;i+=a}return e}function oP(t,e,r){if(!e||!CP(t,e))return e;for(let i=e,n=e-r,s=0;st>=55296&&t<=56319,$P=t=>t>=56320&&t<=57343;function Tl(t,e){return!e||e==t.length||!RP(t.charCodeAt(e-1))||!$P(t.charCodeAt(e))}function k5(t,e,r){var i;let n=r==null?void 0:r.override;return n?n(t,e):(Iu=((i=r==null?void 0:r.scanLimit)!==null&&i!==void 0?i:1e9)>>1,Mu=r!=null&&r.timeout?Date.now()+r.timeout:0,_w=!1,E5(t,e,Ma(t,0,t.length,e,0,e.length)))}function FP(){return!_w}function IP(t,e,r){return S5(k5(t,e,r),t,e)}var Si=Ie.Facet.define({combine:t=>t[0]}),vw=Ie.StateEffect.define(),A5=Ie.Facet.define(),xn=Ie.StateField.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(vw)&&(t=r.value);for(let r of e.state.facet(A5))t=r(t,e);return t}});function Ew(t){let e=t.field(xn,!1);if(!e)return null;let r=t.facet(Si);return{chunks:e,side:r?r.side:null}}var Xn=class t{constructor(e,r,i,n,s,a=!0){this.changes=e,this.fromA=r,this.toA=i,this.fromB=n,this.toB=s,this.precise=a}offset(e,r){return e||r?new t(this.changes,this.fromA+e,this.toA+e,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,r,i){let n=IP(e.toString(),r.toString(),i);return MP(n,e,r,0,0,FP())}static updateA(e,r,i,n,s){return pP(hP(e,n,!0,i.length),e,r,i,s)}static updateB(e,r,i,n,s){return pP(hP(e,n,!1,r.length),e,r,i,s)}};function uP(t,e,r,i){let n=r.lineAt(t),s=i.lineAt(e);return n.to==t&&s.to==e&&tf+1&&w>d+1)break;h.push(p.offset(-c+i,-u+n)),[f,d]=fP(p.toA+i,p.toB+n,e,r),o++}a.push(new Xn(h,c,Math.max(c,f),u,Math.max(u,d),s))}return a}var Sh=1e3;function dP(t,e,r,i){let n=0,s=t.length;for(;;){if(n==s){let u=0,f=0;n&&({toA:u,toB:f}=t[n-1]);let d=e-(r?u:f);return[u+d,f+d]}let a=n+s>>1,o=t[a],[l,c]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>e)s=a;else if(c<=e)n=a+1;else return i?[o.fromA,o.fromB]:[o.toA,o.toB]}}function hP(t,e,r,i){let n=[];return e.iterChangedRanges((s,a,o,l)=>{let c=0,u=r?e.length:i,f=0,d=r?i:e.length;s>Sh&&([c,f]=dP(t,s-Sh,r,!0)),a=c?n[n.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:d,diffA:p.diffA+g,diffB:p.diffB+w}:n.push({fromA:c,toA:u,fromB:f,toB:d,diffA:g,diffB:w})}),n}function pP(t,e,r,i,n){if(!t.length)return e;let s=[];for(let a=0,o=0,l=0,c=0;;a++){let u=a==t.length?null:t[a],f=u?u.fromA+o:r.length,d=u?u.fromB+l:i.length;for(;cf||w.toB+l>d))break;s.push(w.offset(o,l)),c++}if(!u)break;let h=u.toA+o+u.diffA,p=u.toB+l+u.diffB,g=IP(r.sliceString(f,h),i.sliceString(d,p),n);for(let w of MP(g,r,i,f,d,FP()))s.push(w);for(o+=u.diffA,l+=u.diffB;ch&&w.fromB+l>p)break;c++}}return s}var C5={scanLimit:500},DP=Le.ViewPlugin.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=vP(t))}update(t){(t.docChanged||t.viewportChanged||T5(t.startState,t.state)||P5(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=vP(t.view))}},{decorations:t=>t.deco}),kh=Ie.Prec.low((0,Le.gutter)({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(DP))===null||e===void 0?void 0:e.gutter)||Ie.RangeSet.empty}}));function T5(t,e){return t.field(xn,!1)!=e.field(xn,!1)}function P5(t,e){return t.facet(Si)!=e.facet(Si)}var mP=Le.Decoration.line({class:"cm-changedLine"}),R5=Le.Decoration.mark({class:"cm-changedText"}),$5=Le.Decoration.mark({tagName:"ins",class:"cm-insertedLine"}),F5=Le.Decoration.mark({tagName:"del",class:"cm-deletedLine"}),gP=new class extends Le.GutterMarker{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function I5(t,e,r,i,n,s){let a=r?t.fromA:t.fromB,o=r?t.toA:t.toB,l=0;if(a!=o){n.add(a,a,mP),n.add(a,o,r?F5:$5),s&&s.add(a,a,gP);for(let c=e.iterRange(a,o-1),u=a;!c.next().done;){if(c.lineBreak){u++,n.add(u,u,mP),s&&s.add(u,u,gP);continue}let f=u+c.value.length;if(i)for(;l=u)break;(a?f.toA:f.toB)>c&&(!s||!s(t.state,f,o,l))&&I5(f,t.state.doc,a,i,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}var Cl=class extends Le.WidgetType{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},Ph=Ie.StateEffect.define({map:(t,e)=>t.map(e)}),Du=Ie.StateField.define({create:()=>Le.Decoration.none,update:(t,e)=>{for(let r of e.effects)if(r.is(Ph))return r.value;return t.map(e.changes)},provide:t=>Le.EditorView.decorations.from(t)}),Ah=.01;function wP(t,e){if(t.size!=e.size)return!1;let r=t.iter(),i=e.iter();for(;r.value;){if(r.from!=i.from||Math.abs(r.value.spec.widget.height-i.value.spec.widget.height)>1)return!1;r.next(),i.next()}return!0}function M5(t,e,r){let i=new Ie.RangeSetBuilder,n=new Ie.RangeSetBuilder,s=t.state.field(Du).iter(),a=e.state.field(Du).iter(),o=0,l=0,c=0,u=0,f=t.viewport,d=e.viewport;for(let w=0;;w++){let y=wAh&&(u+=k,n.add(l,l,Le.Decoration.widget({widget:new Cl(k),block:!0,side:-1})))}if(b>o+1e3&&of.from&&ld.from){let C=Math.min(f.from-o,d.from-l);o+=C,l+=C,w--}else if(y)o=y.toA,l=y.toB;else break;for(;s.value&&s.fromAh&&n.add(e.state.doc.length,e.state.doc.length,Le.Decoration.widget({widget:new Cl(h),block:!0,side:1}));let p=i.finish(),g=n.finish();wP(p,t.state.field(Du))||t.dispatch({effects:Ph.of(p)}),wP(g,e.state.field(Du))||e.dispatch({effects:Ph.of(g)})}var ww=Ie.StateEffect.define({map:(t,e)=>e.mapPos(t)});var bw=class extends Le.WidgetType{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=e.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",i=>{let n=e.posAtDOM(i.target);e.dispatch({effects:ww.of(n)});let{side:s,sibling:a}=e.state.facet(Si);a&&a().dispatch({effects:ww.of(D5(n,e.state.field(xn),s=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}};function D5(t,e,r){let i=0,n=0;for(let s=0;;s++){let a=s=t)return n+(t-i);[i,n]=r?[a.toA,a.toB]:[a.toB,a.toA]}}var O5=Ie.StateField.define({create(t){return Le.Decoration.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(ww)&&(t=t.update({filter:i=>i!=r.value}));if(t.size&&e.state.field(xn)!=e.startState.field(xn,!1)){let r=e.state.facet(Si).side=="a",i=[];for(let n of e.state.field(xn))t.between(r?n.fromA:n.fromB,r?n.toA:n.toB,s=>{i.push(s)});i.length&&(t=t.update({filter:n=>i.indexOf(n)<0}))}return t},provide:t=>Le.EditorView.decorations.from(t)});function bP({margin:t=3,minSize:e=4}){return O5.init(r=>L5(r,t,e))}function L5(t,e,r){let i=new Ie.RangeSetBuilder,n=t.facet(Si).side=="a",s=t.field(xn),a=1;for(let o=0;;o++){let l=o=r&&i.add(t.doc.line(c).from,t.doc.line(u).to,Le.Decoration.replace({widget:new bw(f),block:!0})),!l)break;a=t.doc.lineAt(Math.min(t.doc.length,n?l.toA:l.toB)).number}return i.finish()}var N5=Le.EditorView.styleModule.of(new Eh({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),B5=Le.EditorView.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"\u299A"',marginInlineEnd:"7px"},"&:after":{content:'"\u299A"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),_P=new Ie.Compartment,Ch=new Ie.Compartment,Rh=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||C5;let r=[Ie.Prec.low(DP),B5,N5,Du,Le.EditorView.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(d=>d.effects.some(h=>h.is(Ph)))&&this.measure()})],i=[Si.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(kh);let n=Ie.EditorState.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],Le.EditorView.editorAttributes.of({class:"cm-merge-a"}),Ch.of(i),r]}),s=[Si.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(kh);let a=Ie.EditorState.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],Le.EditorView.editorAttributes.of({class:"cm-merge-b"}),Ch.of(s),r]});this.chunks=Xn.build(n.doc,a.doc,this.diffConf);let o=[xn.init(()=>this.chunks),_P.of(e.collapseUnchanged?bP(e.collapseUnchanged):[])];n=n.update({effects:Ie.StateEffect.appendConfig.of(o)}).state,a=a.update({effects:Ie.StateEffect.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:u),this.editorDOM.appendChild(l=="a-b"?u:c),this.a=new Le.EditorView({state:n,parent:c,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new Le.EditorView({state:a,parent:u,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,r){if(e.some(i=>i.docChanged)){let i=e[e.length-1],n=e.reduce((a,o)=>a.compose(o.changes),Ie.ChangeSet.empty(e[0].startState.doc.length));this.chunks=r==this.a?Xn.updateA(this.chunks,i.newDoc,this.b.state.doc,n,this.diffConf):Xn.updateB(this.chunks,this.a.state.doc,i.newDoc,n,this.diffConf),r.update([...e,i.state.update({effects:vw.of(this.chunks)})]);let s=r==this.a?this.b:this.a;s.update([s.state.update({effects:vw.of(this.chunks)})]),this.scheduleMeasure()}else r.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let a=this.a.dom.parentNode,o=this.b.dom.parentNode;a.remove(),o.remove(),this.editorDOM.insertBefore(s?a:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:a),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,a=this.revertToA,o=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,a=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(s,a,o)}let r="highlightChanges"in e,i="gutter"in e,n="collapseUnchanged"in e;if(r||i||n){let s=[],a=[];if(r||i){let o=this.a.state.facet(Si),l=i?e.gutter!==!1:o.markGutter,c=r?e.highlightChanges!==!1:o.highlightChanges;s.push(Ch.reconfigure([Si.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?kh:[]])),a.push(Ch.reconfigure([Si.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?kh:[]]))}if(n){let o=_P.reconfigure(e.collapseUnchanged?bP(e.collapseUnchanged):[]);s.push(o),a.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,r,i){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=i,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",n=>this.revertClicked(n)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){M5(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,r=e.firstChild,i=this.a.viewport,n=this.b.viewport;for(let s=0;si.to||a.fromB>n.to)break;if(a.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function yP(t){let e=t.nextSibling;return t.remove(),e}var Sw=require("@codemirror/state");function kw(t,e,r){let i=[],n=t.split(` +`),s=e.split(` +`);for(let a of r){let{oldStart:o,oldLines:l,newStart:c,newLines:u}=a,f=Wt.createHunk(o,l,c,u);if(a.oldLines>0){for(let d=o;dn.length&&n.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(a.newLines>0){for(let d=c;ds.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}i.push(f)}return i}function Aw(t,e,r){let i=e.lineAt(t.fromA).number,n=t.fromA==t.toA?0:$h(e,t.endA)-i+1,s=r.lineAt(t.fromB).number,a=t.fromB==t.toB?0:$h(r,t.endB)-s+1,o={oldStart:i,oldLines:n,newStart:s,newLines:a};return o.oldLines==0&&(o.oldStart-=1),o.newLines==0&&(o.newStart-=1),o}var OP={scanLimit:1e3,timeout:200};function H5(t,e,r,i){let n=Sw.Text.of(t.split(` +`)),s=Sw.Text.of(e.split(` +`)),a=r&&i?Xn.updateB(r,n,s,i,OP):Xn.build(n,s,OP),o=[];for(let l=0;lh.vend&&(f=f-(h.added.count-h.removed.count)),o>h.vend&&(d=d-(h.added.count-h.removed.count));c.added.lines=u.compareText.split(` +`).slice(f-1,d),u.compareTextHead?c.removed.lines=u.compareTextHead.split(` +`).slice(c.removed.start-1,c.removed.start-1+c.removed.count):c.removed.lines=[]}else c.added.lines=e.doc.toString().split(` +`).slice(a-1,o),o===e.doc.lines&&!e.doc.toString().endsWith(` +`)&&(c.added.no_nl_at_eof=!0),c.removed.lines=u.compareText.split(` +`).slice(c.removed.start-1,c.removed.start-1+c.removed.count),c.removed.start+c.removed.count-1===u.compareText.split(` +`).length&&!u.compareText.endsWith(` +`)&&(c.removed.no_nl_at_eof=!0);return c}},Ur=Pl.StateField.define({create:t=>{},update:(t,e)=>{let r=t?{...t}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},i=!1;for(let n of e.effects)n.is($l)&&(r.compareText=n.value.compareText,r.compareTextHead=n.value.compareTextHead,i=(t==null?void 0:t.compareText)!==n.value.compareText,i&&(r.chunks=void 0)),n.is(Ou)&&NP(r,n.value,e.state);if(r.compareText!==void 0){if(i||e.docChanged){r.isDirty=!0;let n=U5(e,r.compareText,r.chunks,r.maxDiffTimeMs);n&&NP(r,n,e.state)}}else r.compareText=void 0,r.compareTextHead=void 0,r.chunks=void 0,r.hunks=[],r.stagedHunks=[],r.isDirty=!1;return r}});function NP(t,e,r){var n,s;t.hunks=e.hunks,t.chunks=e.chunks,t.isDirty=!1,t.maxDiffTimeMs=Math.max(.95*t.maxDiffTimeMs,e.diffDuration);let i=r.field(Rl.editorInfoField).file;(s=(n=zt.plugin)==null?void 0:n.editorIntegration.signsFeature.changeStatusBar)==null||s.display(t.hunks,i)}var Cw=Pl.StateField.define({create:()=>({debouncer:(0,Rl.debounce)(t=>{let{state:e,compareText:r,previousChunks:i,changeDesc:n}=t,s=BP(e,r,i,n);e.field(Rl.editorEditorField).dispatch({effects:Ou.of(s)})},1e3,!0),maxDiffTimeMs:0}),update:(t,e)=>{var r;for(let i of e.effects)if(i.is(Ou))return t.changeDesc=void 0,t;return!t.changeDesc&&e.changes?t.changeDesc=e.changes:t.changeDesc=(r=t.changeDesc)==null?void 0:r.composeDesc(e.changes),t}});function BP(t,e,r,i){let n=t.doc.toString(),s=performance.now(),{hunks:a,chunks:o}=LP(e,n,r,i),l=performance.now()-s;return{hunks:a,chunks:o,diffDuration:l}}function U5(t,e,r,i){let n=t.state,s=Math.abs(t.changes.length-t.changes.newLength),a=n.field(Cw);if(s>1e3||i>16)a.debouncer({state:n,compareText:e,previousChunks:r,changeDesc:a.changeDesc});else return a.changeDesc=void 0,BP(n,e,r,t.changes)}var $l=Pl.StateEffect.define(),Ou=Pl.StateEffect.define();function HP(t,e){return e.update({effects:$l.of(t)})}m();m();m();var at;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(at||(at={}));var UP={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},GP={LINES:"lines",WORDS:"words",NONE:"none"},jP={WORD:"word",CHAR:"char"},Da;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(Da||(Da={}));m();var G5=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],j5=RegExp("["+G5.join("\\")+"]","g");function VP(t){return t.replace(j5,"\\$&")}function Tw(t){return t&&t.replace(/\\/g,"/")}function zP(t){let e,r,i,n=0;for(e=0,i=t.length;e1?r[r.length-1]:e}function qP(t,e){return e.reduce((r,i)=>r||t.startsWith(i),!1)}var YP=["a/","b/","i/","w/","c/","o/"];function Us(t,e,r){let i=r!==void 0?[...YP,r]:YP,n=e?new RegExp(`^${VP(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=n.exec(t)||[],a=i.find(l=>s.indexOf(l)===0);return(a?s.slice(a.length):s).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function V5(t,e){return Us(t,"---",e)}function z5(t,e){return Us(t,"+++",e)}function ZP(t,e={}){let r=[],i=null,n=null,s=null,a=null,o=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,p=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,w=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,S=/^rename from "?(.+)"?/,C=/^rename to "?(.+)"?/,A=/^similarity index (\d+)%/,k=/^dissimilarity index (\d+)%/,v=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,x=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,P=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,T=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,M=/^new file mode (\d{6})/,$=/^deleted file mode (\d{6}),(\d{6})/,D=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,` +`).split(` +`);function Q(){n!==null&&i!==null&&(i.blocks.push(n),n=null)}function ye(){i!==null&&(!i.oldName&&l!==null&&(i.oldName=l),!i.newName&&c!==null&&(i.newName=c),i.newName&&(r.push(i),i=null)),l=null,c=null}function de(){Q(),ye(),i={blocks:[],deletedLines:0,addedLines:0}}function J(z){Q();let K;i!==null&&((K=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(z))?(i.isCombined=!1,s=parseInt(K[1],10),o=parseInt(K[2],10)):(K=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(z))?(i.isCombined=!0,s=parseInt(K[1],10),a=parseInt(K[2],10),o=parseInt(K[3],10)):(z.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,o=0,i.isCombined=!1)),n={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:o,header:z}}function X(z){if(i===null||n===null||s===null||o===null)return;let K={content:z},G=i.isCombined?["+ "," +","++"]:["+"],Me=i.isCombined?["- "," -","--"]:["-"];qP(z,G)?(i.addedLines++,K.type=at.INSERT,K.oldNumber=void 0,K.newNumber=o++):qP(z,Me)?(i.deletedLines++,K.type=at.DELETE,K.oldNumber=s++,K.newNumber=void 0):(K.type=at.CONTEXT,K.oldNumber=s++,K.newNumber=o++),n.lines.push(K)}function he(z,K){let G=K;for(;G{if(!z||z.startsWith("*"))return;let G,Me=D[K-1],Et=D[K+1],Ht=D[K+2];if(z.startsWith("diff --git")||z.startsWith("diff --combined")){if(de(),(G=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(z))&&(l=Us(G[1],void 0,e.dstPrefix),c=Us(G[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isGitDiff=!0;return}if(z.startsWith("Binary files")&&!(i!=null&&i.isGitDiff)){if(de(),(G=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(z))&&(l=Us(G[1],void 0,e.dstPrefix),c=Us(G[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isBinary=!0;return}if((!i||!i.isGitDiff&&i&&z.startsWith(u)&&Et.startsWith(f)&&Ht.startsWith(d))&&de(),i!=null&&i.isTooBig)return;if(i&&(typeof e.diffMaxChanges=="number"&&i.addedLines+i.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&z.length>e.diffMaxLineLength)){i.isTooBig=!0,i.addedLines=0,i.deletedLines=0,i.blocks=[],n=null;let Rt=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";J(Rt);return}if(z.startsWith(u)&&Et.startsWith(f)||z.startsWith(f)&&Me.startsWith(u)){if(i&&!i.oldName&&z.startsWith("--- ")&&(G=V5(z,e.srcPrefix))){i.oldName=G,i.language=WP(i.oldName,i.language);return}if(i&&!i.newName&&z.startsWith("+++ ")&&(G=z5(z,e.dstPrefix))){i.newName=G,i.language=WP(i.newName,i.language);return}}if(i&&(z.startsWith(d)||i.isGitDiff&&i.oldName&&i.newName&&!n)){J(z);return}if(n&&(z.startsWith("+")||z.startsWith("-")||z.startsWith(" "))){X(z);return}let De=!he(z,K);if(i===null)throw new Error("Where is my file !!!");(G=h.exec(z))?i.oldMode=G[1]:(G=p.exec(z))?i.newMode=G[1]:(G=g.exec(z))?(i.deletedFileMode=G[1],i.isDeleted=!0):(G=w.exec(z))?(i.newFileMode=G[1],i.isNew=!0):(G=y.exec(z))?(De&&(i.oldName=G[1]),i.isCopy=!0):(G=b.exec(z))?(De&&(i.newName=G[1]),i.isCopy=!0):(G=S.exec(z))?(De&&(i.oldName=G[1]),i.isRename=!0):(G=C.exec(z))?(De&&(i.newName=G[1]),i.isRename=!0):(G=x.exec(z))?(i.isBinary=!0,i.oldName=Us(G[1],void 0,e.srcPrefix),i.newName=Us(G[2],void 0,e.dstPrefix),J("Binary file")):_.test(z)?(i.isBinary=!0,J(z)):(G=A.exec(z))?i.unchangedPercentage=parseInt(G[1],10):(G=k.exec(z))?i.changedPercentage=parseInt(G[1],10):(G=v.exec(z))?(i.checksumBefore=G[1],i.checksumAfter=G[2],G[3]&&(i.mode=G[3])):(G=P.exec(z))?(i.checksumBefore=[G[2],G[3]],i.checksumAfter=G[1]):(G=T.exec(z))?(i.oldMode=[G[2],G[3]],i.newMode=G[1]):(G=M.exec(z))?(i.newFileMode=G[1],i.isNew=!0):(G=$.exec(z))&&(i.deletedFileMode=G[1],i.isDeleted=!0)}),Q(),ye(),r}m();m();m();m();var Gs=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&p+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,w=1/0,y=()=>{for(let b=Math.max(g,-c);b<=Math.min(w,c);b+=2){let S,C=h[b-1],A=h[b+1];C&&(h[b-1]=void 0);let k=!1;if(A){let x=A.oldPos-b;k=A&&0<=x&&x=l&&p+1>=o)return a(this.buildValues(S.lastComponent,r,e))||!0;h[b]=S,S.oldPos+1>=l&&(w=Math.min(w,b-1)),p+1>=o&&(g=Math.max(g,b+1))}c++};if(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);y()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=y();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1d.length?p:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return n}};m();var Pw=class extends Gs{},KP=new Pw;function Rw(t,e,r){return KP.diff(t,e,r)}m();m();function $w(t,e){let r;for(r=0;re.length&&(r=t.length-e.length);let i=e.length;t.length0&&e[a]!=e[s];)s=n[s];e[a]==e[s]&&s++}s=0;for(let a=r;a0&&t[a]!=e[s];)s=n[s];t[a]==e[s]&&s++}return s}function Mw(t,e){let r=[];for(let i of Array.from(e.segment(t))){let n=i.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(n)?r[r.length-1]+=n:r.push(n)}return r}function Dh(t,e){if(e)return Il(t,e)[1];let r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function Oa(t,e){if(e)return Il(t,e)[0];let r=t.match(/^\s*/);return r?r[0]:""}function Il(t,e){if(!e)return[Oa(t),Dh(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');let r=Mw(t,e),i=r[0],n=r[r.length-1],s=/\s/.test(i)?i:"",a=/\s/.test(n)?n:"";return[s,a]}var Oh="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Y5=new RegExp(`[${Oh}]+|\\s+|[^${Oh}]`,"ug"),Dw=class extends Gs{equals(e,r,i){return i.ignoreCase&&(e=e.toLowerCase(),r=r.toLowerCase()),e.trim()===r.trim()}tokenize(e,r={}){let i;if(r.intlSegmenter){let a=r.intlSegmenter;if(a.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=Mw(e,a)}else i=e.match(Y5)||[];let n=[],s=null;return i.forEach(a=>{/\s/.test(a)?s==null?n.push(a):n.push(n.pop()+a):s!=null&&/\s/.test(s)?n[n.length-1]==s?n.push(n.pop()+a):n.push(s+a):n.push(a),s=a}),n}join(e){return e.map((r,i)=>i==0?r:r.replace(/^\s+/,"")).join("")}postProcess(e,r){if(!e||r.oneChangePerToken)return e;let i=null,n=null,s=null;return e.forEach(a=>{a.added?n=a:a.removed?s=a:((n||s)&&XP(i,s,n,a,r.intlSegmenter),i=a,n=null,s=null)}),(n||s)&&XP(i,s,n,null,r.intlSegmenter),e}},Z5=new Dw;function XP(t,e,r,i,n){if(e&&r){let[s,a]=Il(e.value,n),[o,l]=Il(r.value,n);if(t){let c=$w(s,o);t.value=Mh(t.value,o,c),e.value=Fl(e.value,c),r.value=Fl(r.value,c)}if(i){let c=Fw(a,l);i.value=Ih(i.value,l,c),e.value=Lu(e.value,c),r.value=Lu(r.value,c)}}else if(r){if(t){let s=Oa(r.value,n);r.value=r.value.substring(s.length)}if(i){let s=Oa(i.value,n);i.value=i.value.substring(s.length)}}else if(t&&i){let s=Oa(i.value,n),[a,o]=Il(e.value,n),l=$w(s,a);e.value=Fl(e.value,l);let c=Fw(Fl(s,l),o);e.value=Lu(e.value,c),i.value=Ih(i.value,s,c),t.value=Mh(t.value,s,s.slice(0,s.length-c.length))}else if(i){let s=Oa(i.value,n),a=Dh(e.value,n),o=Iw(a,s);e.value=Lu(e.value,o)}else if(t){let s=Dh(t.value,n),a=Oa(e.value,n),o=Iw(s,a);e.value=Fl(e.value,o)}}var Ow=class extends Gs{tokenize(e){let r=new RegExp(`(\\r?\\n)|[${Oh}]+|[^\\S\\n\\r]+|[^${Oh}]`,"ug");return e.match(r)||[]}},QP=new Ow;function Lw(t,e,r){return QP.diff(t,e,r)}m();function X5(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],i;for(i=0;i<=e.length;i++)r[i]=[i];let n;for(n=0;n<=t.length;n++)r[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?r[i][n]=r[i-1][n-1]:r[i][n]=Math.min(r[i-1][n-1]+1,Math.min(r[i][n-1]+1,r[i-1][n]+1));return r[e.length][t.length]}function Ml(t){return(e,r)=>{let i=t(e).trim(),n=t(r).trim();return X5(i,n)/(i.length+n.length)}}function Dl(t){function e(i,n,s=new Map){let a=1/0,o;for(let l=0;l0||o.indexB>0)&&(S=w.concat(S)),(i.length>d||n.length>h)&&(S=S.concat(b)),S}return r}var Jt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},La={matching:GP.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:jP.WORD,colorScheme:Da.LIGHT},En="/",JP=Ml(t=>t.value),Q5=Dl(JP);function Bw(t){return t.indexOf("dev/null")!==-1}function J5(t){return t.replace(/(]*>((.|\n)*?)<\/ins>)/g,"")}function e4(t){return t.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}function Ol(t){switch(t){case at.CONTEXT:return Jt.CONTEXT;case at.INSERT:return Jt.INSERTS;case at.DELETE:return Jt.DELETES}}function Ll(t){switch(t){case Da.DARK:return"d2h-dark-color-scheme";case Da.AUTO:return"d2h-auto-color-scheme";case Da.LIGHT:default:return"d2h-light-color-scheme"}}function t4(t){return t?2:1}function js(t){return t.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function ki(t,e,r=!0){let i=t4(e);return{prefix:t.substring(0,i),content:r?js(t.substring(i)):t.substring(i)}}function Na(t){let e=Tw(t.oldName),r=Tw(t.newName);if(e!==r&&!Bw(e)&&!Bw(r)){let i=[],n=[],s=e.split(En),a=r.split(En),o=s.length,l=a.length,c=0,u=o-1,f=l-1;for(;cc&&f>c&&s[u]===a[f];)n.unshift(a[f]),u-=1,f-=1;let d=i.join(En),h=n.join(En),p=s.slice(c,u+1).join(En),g=a.slice(c,f+1).join(En);return d.length&&h.length?d+En+"{"+p+" \u2192 "+g+"}"+En+h:d.length?d+En+"{"+p+" \u2192 "+g+"}":h.length?"{"+p+" \u2192 "+g+"}"+En+h:e+" \u2192 "+r}else return Bw(r)?e:r}function Nl(t){return`d2h-${zP(Na(t)).toString().slice(-6)}`}function Bl(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function Lh(t,e,r,i={}){let{matching:n,maxLineLengthHighlight:s,matchWordsThreshold:a,diffStyle:o}=Object.assign(Object.assign({},La),i),l=ki(t,r,!1),c=ki(e,r,!1);if(l.content.length>s||c.content.length>s)return{oldLine:{prefix:l.prefix,content:js(l.content)},newLine:{prefix:c.prefix,content:js(c.content)}};let u=o==="char"?Rw(l.content,c.content):Lw(l.content,c.content),f=[];if(o==="word"&&n==="words"){let h=u.filter(w=>w.removed),p=u.filter(w=>w.added);Q5(p,h).forEach(w=>{w[0].length===1&&w[1].length===1&&JP(w[0][0],w[1][0]){let g=p.added?"ins":p.removed?"del":null,w=f.indexOf(p)>-1?' class="d2h-change"':"",y=js(p.value);return g!==null?`${h}<${g}${w}>${y}`:`${h}${y}`},"");return{oldLine:{prefix:l.prefix,content:J5(d)},newLine:{prefix:c.prefix,content:e4(d)}}}var eR="file-summary",r4="icon",i4={colorScheme:La.colorScheme},Nh=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},i4),r)}render(e){let r=e.map(i=>this.hoganUtils.render(eR,"line",{fileHtmlId:Nl(i),oldName:i.oldName,newName:i.newName,fileName:Na(i),deletedLines:"-"+i.deletedLines,addedLines:"+"+i.addedLines},{fileIcon:this.hoganUtils.template(r4,Bl(i))})).join(` +`);return this.hoganUtils.render(eR,"wrapper",{colorScheme:Ll(this.config.colorScheme),filesNumber:e.length,files:r})}};m();var Uw=Object.assign(Object.assign({},La),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Nu="generic",tR="line-by-line",n4="icon",s4="tag",Bu=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Uw),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(Nu,"wrapper",{colorScheme:Ll(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(tR,"file-diff"),n=this.hoganUtils.template(Nu,"file-path"),s=this.hoganUtils.template(n4,"file"),a=this.hoganUtils.template(s4,Bl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Na(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return this.hoganUtils.render(Nu,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Jt})}generateFileHtml(e){let r=Dl(Ml(i=>ki(i.content,e.isCombined).content));return e.blocks.map(i=>{let n=this.hoganUtils.render(Nu,"block-header",{CSSLineClass:Jt,blockHeader:e.isTooBig?i.header:js(i.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);n+=u,n+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ki(l.content,e.isCombined);n+=this.generateSingleLineHtml(e,{type:Jt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,a,o);n+=l,n+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).join(` +`)}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===at.CONTEXT?r.push([[a],[],[]]):a.type===at.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===at.INSERT&&i.length>0?n.push(a):a.type===at.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=Fh(e.concat(r).map(o=>o.content.length));return n{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(Hu,"wrapper",{colorScheme:Ll(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(a4,"file-diff"),n=this.hoganUtils.template(Hu,"file-path"),s=this.hoganUtils.template(o4,"file"),a=this.hoganUtils.template(l4,Bl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Na(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Hu,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Jt})}}generateFileHtml(e){let r=Dl(Ml(i=>ki(i.content,e.isCombined).content));return e.blocks.map(i=>{let n={left:this.makeHeaderHtml(i.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);n.left+=u,n.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ki(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:Jt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Jt.CONTEXT,prefix:c,content:u,number:l.newNumber});n.left+=f,n.right+=d});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,a,o);n.left+=l,n.right+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).reduce((i,n)=>({left:i.left+n.left,right:i.right+n.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===at.CONTEXT?r.push([[a],[],[]]):a.type===at.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===at.INSERT&&i.length>0?n.push(a):a.type===at.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=Fh(e.concat(r).map(o=>o.content.length));return n'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileName",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("addedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("deletedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{"'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' Files changed ('),i.b(i.v(i.f("filesNumber",t,e,0))),i.b(")"),i.b(` +`+r),i.b(' hide'),i.b(` +`+r),i.b(' show'),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
    '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("files",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-block-header"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.s(i.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(a.t(a.f("blockHeader",n,s,0)))}),t.pop()),i.s(i.f("blockHeader",t,e,1),t,e,1,0,0,"")||i.b(" "),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-empty-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" File without changes"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-file-path"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(''),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileDiffName",t,e,0))),i.b(""),i.b(` +`+r),i.b(i.rp(""),i.b(` +`+r),i.b('"),i.fl()},partials:{""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("lineNumber",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.s(i.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("prefix",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("prefix",t,e,1),t,e,1,0,0,"")||(i.b('  '),i.b(` +`+r)),i.s(i.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("content",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("content",t,e,1),t,e,1,0,0,"")||(i.b('
'),i.b(` +`+r)),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-wrapper"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("content",t,e,0))),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});xt["icon-file-added"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file-changed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file-deleted"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file-renamed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["line-by-line-file-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("diffs",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});xt["line-by-line-numbers"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(i.v(i.f("oldNumber",t,e,0))),i.b("
"),i.b(` +`+r),i.b('
'),i.b(i.v(i.f("newNumber",t,e,0))),i.b("
"),i.fl()},partials:{},subs:{}});xt["side-by-side-file-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.left",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.right",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});xt["tag-file-added"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('ADDED'),i.fl()},partials:{},subs:{}});xt["tag-file-changed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('CHANGED'),i.fl()},partials:{},subs:{}});xt["tag-file-deleted"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('DELETED'),i.fl()},partials:{},subs:{}});xt["tag-file-renamed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('RENAMED'),i.fl()},partials:{},subs:{}});var Gu=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let i=Object.entries(r).reduce((n,[s,a])=>{let o=Ww.compile(a,{asString:!1});return Object.assign(Object.assign({},n),{[s]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},xt),e),i)}static compile(e){return Ww.compile(e,{asString:!1})}render(e,r,i,n,s){let a=this.templateKey(e,r);try{return this.preCompiledTemplates[a].render(i,n,s)}catch(o){throw new Error(`Could not find template to render '${a}'`)}}template(e,r){return this.preCompiledTemplates[this.templateKey(e,r)]}templateKey(e,r){return`${e}-${r}`}};var u4=Object.assign(Object.assign(Object.assign({},Uw),Gw),{outputFormat:UP.LINE_BY_LINE,drawFileList:!0});function Hh(t,e={}){let r=Object.assign(Object.assign({},u4),e),i=typeof t=="string"?ZP(t,r):t,n=new Gu(r),{colorScheme:s}=r,a={colorScheme:s},o=r.drawFileList?new Nh(n,a).render(i):"",l=r.outputFormat==="side-by-side"?new Uu(n,r).render(i):new Bu(n,r).render(i);return o+l}var cR=Gt(oR(),1);var Ba=require("obsidian"),qw=ju.StateEffect.define();function Vs(t,e){let r=t.state,i=r.field(Gh),n=r.field(Ur),s=r.doc.lineAt(e!=null?e:r.selection.main.head).number,a=Wt.findHunk(s,n==null?void 0:n.hunks)[0];if(!a)return;let o=r.doc.line(Math.max(1,a.added.start)).from,l=i.has(o);return r.field(Ba.editorEditorField).dispatch({effects:qw.of({pos:o,add:!l})})}var Gh=ju.StateField.define({create:()=>new Set,update(t,e){let r=new Set;for(let i of e.effects)i.is(qw)&&(i.value.add?t.add(i.value.pos):t.delete(i.value.pos));for(let i of t)r.add(e.changes.mapPos(i));return r}}),uR=ju.StateField.define({create:t=>lR(t),update(t,e){return e.docChanged||e.effects.some(r=>r.is($l)||r.is(qw))?lR(e.state):t},provide:t=>Uh.showTooltip.computeN([t],e=>e.field(t))}),fR=Uh.EditorView.baseTheme({".cm-tooltip.git-diff-tooltip":{"z-index":"var(--layer-popover)",backgroundColor:"var(--background-primary-alt)",border:"var(--border-width) solid var(--background-primary-alt)",borderRadius:"var(--radius-s)"},".cm-tooltip.git-diff-tooltip .tooltip-toolbar":{display:"flex",padding:"var(--size-2-1)"}});function lR(t){let e=t.field(Ur);return e?[...t.field(Gh)].map(i=>{let n=t.doc.lineAt(i),s=Wt.findHunk(n.number,e.hunks)[0];if(s)return{pos:i,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>f4(s,t,i)}}).filter(i=>i!==void 0):[]}function f4(t,e,r){var g,w;let i=Wt.createPatch("file",[t],"10064",!1).join(` +`)+` +`,n=Hh(i,{colorScheme:cR.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(n,"text/html").querySelector(".d2h-file-diff"),a=createDiv();a.addClass("tooltip-toolbar");let o=(y,b)=>{let S=createDiv();return(0,Ba.setIcon)(S,y),S.setAttr("aria-label",b),S.addClass("clickable-icon"),S},l=o("x","Close hunk"),c=o("plus","Stage hunk"),u=o("undo","Reset hunk");a.appendChild(l),a.appendChild(c),a.appendChild(u);let f=createDiv();f.appendChild(a),f.appendChild(s),f.addClass("git-diff-tooltip","git-diff");let d=e.field(Ba.editorEditorField);l.onclick=()=>{Vs(d,r)},c.onclick=()=>{let y=zt.plugin;y&&(y.promiseQueue.addTask(()=>y.hunkActions.stageHunk(r)),Vs(d,r))},u.onclick=()=>{let y=zt.plugin;y&&(y.hunkActions.resetHunk(r),Vs(d,r))};let h=(w=(g=zt.plugin)==null?void 0:g.app.workspace.getActiveViewOfType(Ba.MarkdownView))==null?void 0:w.scope,p=h==null?void 0:h.register(null,"Escape",(y,b)=>{Vs(d,r)});return{dom:f,destroy:()=>{p&&(h==null||h.unregister(p))},update:y=>{r=y.changes.mapPos(r)}}}function dR(t){let e=t.app;t.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let r=t.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(r)||await e.vault.adapter.write(r,"");let i=await e.vault.adapter.read(r),s=await new xh(e,i).openAndGetReslt();s!==void 0&&(await e.vault.adapter.write(r,s),await t.refresh())}}),t.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(Qt.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:Qt.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(bi.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:bi.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;{let n=t.gitManager.getRelativeRepoPath(i.path,!0);t.tools.openDiff({aFile:n,aRef:""})}}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(r,{file:i})=>{if(i)return X2(r,i,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(r,{file:i})=>{if(i)return Q2(i,t.gitManager)}}),t.addCommand({id:"pull",name:"Pull",callback:()=>t.promiseQueue.addTask(()=>t.pullChangesFromRemote())}),t.addCommand({id:"fetch",name:"Fetch",callback:()=>t.promiseQueue.addTask(()=>t.fetch())}),t.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>t.promiseQueue.addTask(()=>t.switchRemoteBranch())}),t.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.addFileToGitignore(i.path,i instanceof Wi.TFolder).catch(n=>t.displayError(n))}}),t.addCommand({id:"push",name:"Commit-and-sync",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1}))}),t.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>t.promiseQueue.addTask(async()=>{await t.commitAndSync({fromAutoBackup:!1}),window.close()})}),t.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit",name:"Commit all changes",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1}))}),t.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit-smart",name:"Commit",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:i})})}),t.addCommand({id:"commit-staged",name:"Commit staged",checkCallback:function(r){if(r)return!1;t.promiseQueue.addTask(async()=>t.commit({fromAuto:!1,requestCustomMessage:!1}))}}),Wi.Platform.isDesktopApp&&t.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),t.addCommand({id:"commit-smart-specified-message",name:"Commit with specific message",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:i})})}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",checkCallback:function(r){return r?!1:t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0}))}}),t.addCommand({id:"push2",name:"Push",callback:()=>t.promiseQueue.addTask(()=>t.push())}),t.addCommand({id:"stage-current-file",name:"Stage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.stageFile(i))}}),t.addCommand({id:"unstage-current-file",name:"Unstage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.unstageFile(i))}}),t.addCommand({id:"edit-remotes",name:"Edit remotes",callback:()=>t.editRemotes().catch(r=>t.displayError(r))}),t.addCommand({id:"remove-remote",name:"Remove remote",callback:()=>t.removeRemote().catch(r=>t.displayError(r))}),t.addCommand({id:"set-upstream-branch",name:"Set upstream branch",callback:()=>t.setUpstreamBranch().catch(r=>t.displayError(r))}),t.addCommand({id:"delete-repo",name:"CAUTION: Delete repository",callback:async()=>{await e.vault.adapter.exists(`${t.settings.basePath}/.git`)?await new tt(t,{options:["NO","YES"],placeholder:"Do you really want to delete the repository (.git directory)? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&(await e.vault.adapter.rmdir(`${t.settings.basePath}/.git`,!0),new Wi.Notice("Successfully deleted repository. Reloading plugin..."),t.unloadPlugin(),await t.init({fromReload:!0})):new Wi.Notice("No repository found")}}),t.addCommand({id:"init-repo",name:"Initialize a new repo",callback:()=>t.createNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"clone-repo",name:"Clone an existing remote repo",callback:()=>t.cloneNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"list-changed-files",name:"List changed files",callback:async()=>{if(await t.isAllInitialized())try{let r=await t.updateCachedStatus();if(r.changed.length+r.staged.length>500){t.displayError("Too many changes to display");return}new yh(t,r.all).open()}catch(r){t.displayError(r)}}}),t.addCommand({id:"switch-branch",name:"Switch branch",callback:()=>{t.switchBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"create-branch",name:"Create new branch",callback:()=>{t.createBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"delete-branch",name:"Delete branch",callback:()=>{t.deleteBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"discard-all",name:"CAUTION: Discard all changes",callback:async()=>{let r=await t.discardAll();switch(r){case"discard":new Wi.Notice("Discarded all changes in tracked files.");break;case"delete":new Wi.Notice("Discarded all files.");break;case!1:break;default:Md(r)}}}),t.addCommand({id:"pause-automatic-routines",name:"Pause/Resume automatic routines",callback:()=>{let r=!t.localStorage.getPausedAutomatics();t.localStorage.setPausedAutomatics(r),r?(t.automaticsManager.unload(),new Wi.Notice("Paused automatic routines.")):(t.automaticsManager.reload("commit","push","pull"),new Wi.Notice("Resumed automatic routines."))}}),t.addCommand({id:"raw-command",name:"Raw command",checkCallback:r=>{let i=t.gitManager;if(r)return i instanceof Ce;t.tools.runRawCommand().catch(n=>t.displayError(n))}}),t.addCommand({id:"toggle-line-author-info",name:"Toggle line author information",callback:()=>{var r;return(r=t.settingsTab)==null?void 0:r.configureLineAuthorShowStatus(!t.settings.lineAuthor.show)}}),t.addCommand({id:"reset-hunk",name:"Reset hunk",editorCheckCallback(r,i,n){if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.resetHunk()}}),t.addCommand({id:"stage-hunk",name:"Stage hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.promiseQueue.addTask(()=>t.hunkActions.stageHunk())}}),t.addCommand({id:"preview-hunk",name:"Preview hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;let s=t.hunkActions.editor.editor;Vs(s)}}),t.addCommand({id:"next-hunk",name:"Go to next hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("next")}}),t.addCommand({id:"prev-hunk",name:"Go to previous hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("prev")}})}m();var jh=class{constructor(e){this.plugin=e;this.prefix=this.plugin.manifest.id+":",this.app=e.app}migrate(){let e=["password","hostname","conflict","lastAutoPull","lastAutoBackup","lastAutoPush","gitPath","pluginDisabled"];for(let r of e){let i=localStorage.getItem(this.prefix+r);this.app.loadLocalStorage(this.prefix+r)==null&&i!=null&&i!=null&&(this.app.saveLocalStorage(this.prefix+r,i),localStorage.removeItem(this.prefix+r))}}getPassword(){return this.app.loadLocalStorage(this.prefix+"password")}setPassword(e){return this.app.saveLocalStorage(this.prefix+"password",e)}getUsername(){return this.app.loadLocalStorage(this.prefix+"username")}setUsername(e){return this.app.saveLocalStorage(this.prefix+"username",e)}getHostname(){return this.app.loadLocalStorage(this.prefix+"hostname")}setHostname(e){return this.app.saveLocalStorage(this.prefix+"hostname",e)}getConflict(){return this.app.loadLocalStorage(this.prefix+"conflict")=="true"}setConflict(e){return this.app.saveLocalStorage(this.prefix+"conflict",`${e}`)}getLastAutoPull(){return this.app.loadLocalStorage(this.prefix+"lastAutoPull")}setLastAutoPull(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPull",e)}getLastAutoBackup(){return this.app.loadLocalStorage(this.prefix+"lastAutoBackup")}setLastAutoBackup(e){return this.app.saveLocalStorage(this.prefix+"lastAutoBackup",e)}getLastAutoPush(){return this.app.loadLocalStorage(this.prefix+"lastAutoPush")}setLastAutoPush(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPush",e)}getGitPath(){return this.app.loadLocalStorage(this.prefix+"gitPath")}setGitPath(e){return this.app.saveLocalStorage(this.prefix+"gitPath",e)}getPATHPaths(){var e,r;return(r=(e=this.app.loadLocalStorage(this.prefix+"PATHPaths"))==null?void 0:e.split(":"))!=null?r:[]}setPATHPaths(e){return this.app.saveLocalStorage(this.prefix+"PATHPaths",e.join(":"))}getEnvVars(){var e;return JSON.parse((e=this.app.loadLocalStorage(this.prefix+"envVars"))!=null?e:"[]")}setEnvVars(e){return this.app.saveLocalStorage(this.prefix+"envVars",JSON.stringify(e))}getPluginDisabled(){return this.app.loadLocalStorage(this.prefix+"pluginDisabled")=="true"}setPluginDisabled(e){return this.app.saveLocalStorage(this.prefix+"pluginDisabled",`${e}`)}getPausedAutomatics(){return this.app.loadLocalStorage(this.prefix+"pausedAutomatics")=="true"}setPausedAutomatics(e){return this.app.saveLocalStorage(this.prefix+"pausedAutomatics",`${e}`)}getGutterSpacingFallbackLength(){var e;return(e=this.app.loadLocalStorage(this.prefix+"gutterSpacingFallbackLength"))!=null?e:5}setGutterSpacingFallbackLength(e){return this.app.saveLocalStorage(this.prefix+"gutterSpacingFallbackLength",e)}};m();var Hl=require("obsidian");var Vu=class{constructor(e){this.plugin=e}async hasTooBigFiles(e){let r=await this.plugin.gitManager.branchInfo(),i=r.tracking?Yn(r.tracking)[0]:null;if(!i)return!1;let n=await this.plugin.gitManager.getRemoteUrl(i);if(n!=null&&n.includes("github.com")){let s=[],a=this.plugin.gitManager;for(let o of e){let l=this.plugin.app.vault.getAbstractFileByPath(o.vaultPath),c=!1;if(l instanceof Hl.TFile)l.stat.size>=1e8&&(c=!0);else{let u=await this.plugin.app.vault.adapter.stat(o.vaultPath);u&&u.size>=1e8&&(c=!0)}if(c){let u=!1;a instanceof Ce&&(u=await a.isFileTrackedByLFS(o.path)),u||s.push(o)}}if(s.length>0)return this.plugin.displayError(`Aborted commit, because the following files are too big: +- ${s.map(o=>o.vaultPath).join(` +- `)} +Please remove them or add to .gitignore.`),!0}return!1}async writeAndOpenFile(e){e!==void 0&&await this.plugin.app.vault.adapter.write(il,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(i=>{i.getDisplayText()!=""&&il.startsWith(i.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(il,"/",!0)}openDiff({aFile:e,bFile:r,aRef:i,bRef:n,event:s}){var l,c;let a=this.plugin.settings.diffStyle;Hl.Platform.isMobileApp&&(a="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:i,bRef:n};a=="split"?(l=ji(this.plugin.app,s))==null||l.setViewState({type:Ms.type,active:!0,state:o}):a=="git_unified"&&((c=ji(this.plugin.app,s))==null||c.setViewState({type:Ds.type,active:!0,state:o}))}async runRawCommand(){let e=this.plugin.gitManager;if(!(e instanceof Ce))return;let i=await new tt(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();i!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let n=new Hl.Notice(`Running '${i}'...`,999999);try{let s=await e.rawCommand(i);s?(n.setMessage(s),window.setTimeout(()=>n.hide(),5e3)):n.hide()}catch(s){throw n.hide(),s}})}};m();var Vh=require("obsidian");var Ha=class extends Vh.ItemView{constructor(r,i){super(r);this.plugin=i;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.contentEl.addClass("git-diff"),this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return Ds.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();return i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3)),`Diff: ${i}`}return Ds.name}getIcon(){return Ds.icon}async setState(r,i){this.state=r,Vh.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await this.refresh()}getState(){return this.state}onClose(){return this.app.workspace.offref(this.gitRefreshRef),this.app.workspace.offref(this.gitViewRefreshRef),super.onClose()}async onOpen(){return await this.refresh(),super.onOpen()}async refresh(){var r;if((r=this.state)!=null&&r.bFile&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let i=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let n=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!i){if(this.plugin.gitManager instanceof Ce&&await this.plugin.gitManager.isTracked(this.state.bFile))i=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(` +`);else if(await this.app.vault.adapter.exists(n)){let s=await this.app.vault.adapter.read(n);i=[...`--- /dev/null ++++ ${this.state.bFile} +@@ -0,0 +1,${s.split(` +`).length} @@`.split(` +`),...s.split(` +`).map(o=>`+${o}`)].join(` +`)}}if(i){let s=this.parser.parseFromString(Hh(i),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(s)}else{let s=this.contentEl.createDiv({cls:"obsidian-git-center"});s.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),s.createEl("br"),s.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};m();var Qn=require("obsidian");var Gl=require("@codemirror/commands");var zh=require("@codemirror/search"),Ul=require("@codemirror/state"),Ci=require("@codemirror/view");var Ua=class extends Qn.ItemView{constructor(r,i){super(r);this.plugin=i;this.refreshing=!1;this.ignoreNextModification=!1;this.navigation=!0,this.registerEvent(this.app.workspace.on("obsidian-git:status-changed",()=>{this.mergeView?this.updateRefEditors().catch(console.error):this.createMergeView().catch(console.error)})),this.intervalRef=window.setInterval(()=>{this.mergeView&&this.updateRefEditors().catch(console.error)},30*1e3),this.registerEvent(this.app.vault.on("modify",n=>{this.state.bRef==null&&n.path===this.state.bFile&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(n,s)=>{this.state.bRef==null&&(n.path===this.state.bFile||s===this.state.bFile)&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,Qn.debounce)(n=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),n).catch(a=>this.plugin.displayError(a)))},1e3,!1)}getViewType(){return Ms.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3));let n;return this.state.bRef==null?n=" (Working Tree)":this.state.bRef==""?n=" (Index)":n="("+this.state.bRef.substring(0,7)+")",`Diff: ${i} ${n}`}return Ms.name}getIcon(){return Ms.icon}async setState(r,i){this.state=r,Qn.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(r,i),await this.createMergeView()}getState(){return this.state}onClose(){return window.clearInterval(this.intervalRef),super.onClose()}async onOpen(){return await this.createMergeView(),super.onOpen()}async gitShow(r,i){try{return await this.plugin.gitManager.show(r,i,!1)}catch(n){if(n instanceof Br&&(n.message.includes("does not exist")||n.message.includes("unknown revision or path")||n.message.includes("exists on disk, but not in")||n.message.includes("fatal: bad object")))return n.message.includes("fatal: bad object")&&this.plugin.displayError(n.message),"";throw n}}async bShouldBeEditable(){if(this.state.bRef!=null)return!1;let r=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);return await this.app.vault.adapter.exists(r)}async updateModifiableEditor(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.b;this.refreshing=!0;let i=await this.app.vault.adapter.read(this.state.bFile);if(i!=r.state.doc.toString()){let n=r.state.update({changes:{from:0,to:r.state.doc.length,insert:i},annotations:[Ul.Transaction.remote.of(!0)]});r.dispatch(n)}this.refreshing=!1}async updateRefEditors(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.a,i=this.mergeView.b;this.refreshing=!0;let n=await this.gitShow(this.state.aRef,this.state.aFile),s;if(this.state.bRef!=null&&(s=await this.gitShow(this.state.bRef,this.state.bFile)),n!=r.state.doc.toString()){let a=r.state.update({changes:{from:0,to:r.state.doc.length,insert:n}});r.dispatch(a)}if(s!=null&&s!=i.state.doc.toString()){let a=i.state.update({changes:{from:0,to:i.state.doc.length,insert:s}});i.dispatch(a)}this.refreshing=!1}renderButtons(r){let i=r.createDiv(),n=i.createDiv();if(n.addClass("clickable-icon"),n.setAttr("aria-label",this.state.bRef==null?"Stage hunk":"Unstage hunk"),(0,Qn.setIcon)(n,this.state.bRef==null?"plus":"minus"),n.onmousedown=async s=>{var p;let a=this.mergeView.b,o=this.mergeView.a,l=Ew(a.state),c=(p=i.parentElement)==null?void 0:p.indexOf(i),u=l.chunks[c],f=Aw(u,o.state.doc,a.state.doc),d=kw(this.mergeView.a.state.doc.toString(),this.mergeView.b.state.doc.toString(),[f])[0],h=Wt.createPatch(this.state.bFile,[d],"100644",this.state.bRef!=null).join(` +`)+` +`;await this.plugin.gitManager.applyPatch(h),this.plugin.app.workspace.trigger("obsidian-git:refresh")},this.state.bRef==null){let s=i.createDiv();s.addClass("clickable-icon"),s.setAttr("aria-label","Reset hunk"),(0,Qn.setIcon)(s,"undo"),s.onmousedown=a=>{var d;let o=this.mergeView.a,l=this.mergeView.b,c=Ew(l.state),u=(d=i.parentElement)==null?void 0:d.indexOf(i),f=c.chunks[u];if(f){let h=f.fromA,p=f.toA,g=f.fromB,w=f.toB,y=o.state.sliceDoc(h,Math.max(h,p-1));h!=p&&w<=l.state.doc.length&&(y+=o.state.lineBreak),l.dispatch({changes:{from:g,to:Math.min(l.state.doc.length,w),insert:y},userEvent:"revert"})}}}return i.onmousedown=s=>{s.preventDefault(),s.stopPropagation()},i}async createMergeView(){var r,i,n;if((r=this.state)!=null&&r.aFile&&((i=this.state)!=null&&i.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0,(n=this.mergeView)==null||n.destroy();let s=this.containerEl.children[1];s.empty(),this.contentEl.addClass("git-split-diff-view","git-diff"),this.bIsEditable=await this.bShouldBeEditable();let a=await this.gitShow(this.state.aRef,this.state.aFile),o;if(this.state.bRef!=null)o=await this.gitShow(this.state.bRef,this.state.bFile);else{let g=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);await this.app.vault.adapter.exists(g)?o=await this.app.vault.adapter.read(g):o=""}let l=[(0,Ci.lineNumbers)(),(0,zh.highlightSelectionMatches)(),(0,Ci.drawSelection)(),Ci.keymap.of([...Gl.standardKeymap,Gl.indentWithTab]),(0,Gl.history)(),(0,zh.search)(),Ci.EditorView.lineWrapping],c=this,u=Ci.ViewPlugin.define(g=>({update(w){if(w.docChanged&&!w.transactions.some(y=>y.annotation(Ul.Transaction.remote))){let y=g.state.doc.toString();c.fileSaveDebouncer(y)}}})),f={doc:a,extensions:[...l,Ci.EditorView.editable.of(!1),Ul.EditorState.readOnly.of(!0)]},d=[...l];this.bIsEditable?d.push(u):d.push(Ci.EditorView.editable.of(!1),Ul.EditorState.readOnly.of(!0));let h={doc:o,extensions:d};s.addClasses(["cm-s-obsidian","mod-cm6","markdown-source-view","cm-content"]);let p=this.plugin.gitManager instanceof Ce&&(this.state.bRef===void 0||this.state.bRef==="");this.mergeView=new Rh({b:h,a:f,collapseUnchanged:{minSize:6,margin:4},renderRevertControl:p?()=>this.renderButtons(s):void 0,revertControls:p?"a-to-b":void 0,diffConfig:{scanLimit:this.bIsEditable?1e3:1e4},parent:s}),this.refreshing=!1}}};m();var rF=require("obsidian");m();m();m();var hR,pR,mR;typeof window!="undefined"&&((mR=(pR=(hR=window.__svelte)!=null?hR:window.__svelte={}).v)!=null?mR:pR.v=new Set).add("5");m();m();m();var Jn={};var qe=Symbol("uninitialized"),Ti=Symbol("filename");var Wh="http://www.w3.org/1999/xhtml";m();m();m();m();var qh=!0;m();var L=!1;m();var es=Array.isArray,gR=Array.prototype.indexOf,zs=Array.prototype.includes,jl=Array.from,Yw=Object.keys,cr=Object.defineProperty,Gr=Object.getOwnPropertyDescriptor,Zw=Object.getOwnPropertyDescriptors,Kw=Object.prototype,vR=Array.prototype,Vl=Object.getPrototypeOf,Xw=Object.isExtensible;function Qw(t){return typeof t=="function"}var ur=()=>{};function Yh(t){for(var e=0;e{t=i,e=n});return{promise:r,resolve:t,reject:e}}m();m();var er=Symbol("$state"),zu=Symbol("legacy props"),bR=Symbol(""),Kh=Symbol("proxy path"),Xh=Symbol("attributes"),Wu=Symbol("class"),Jw=Symbol("style"),qu=Symbol("text"),Ga=Symbol("form reset"),e0=Symbol("hmr anchor"),Ws=new class extends Error{constructor(){super(...arguments);He(this,"name","StaleReactionError");He(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},wR,t0=!!((wR=globalThis.document)!=null&&wR.contentType)&&globalThis.document.contentType.includes("xml");var zl=3,Pi=8;m();m();function _R(t){if(L){let e=new Error(`invariant_violation +An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${t}" +https://svelte.dev/e/invariant_violation`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invariant_violation")}function Qh(t){if(L){let e=new Error(`lifecycle_outside_component +\`${t}(...)\` can only be used during component initialisation +https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xR(){if(L){let t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function r0(){if(L){let t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function ER(){if(L){let t=new Error(`derived_references_self +A derived value cannot reference itself recursively +https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function i0(t,e,r){if(L){let i=new Error(`each_key_duplicate +${r?`Keyed each block has duplicate key \`${r}\` at indexes ${t} and ${e}`:`Keyed each block has duplicate key at indexes ${t} and ${e}`} +https://svelte.dev/e/each_key_duplicate`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function SR(t,e,r){if(L){let i=new Error(`each_key_volatile +Keyed each block has key that is not idempotent \u2014 the key for item at index ${t} was \`${e}\` but is now \`${r}\`. Keys must be the same each time for a given item +https://svelte.dev/e/each_key_volatile`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_volatile")}function kR(t){if(L){let e=new Error(`effect_in_teardown +\`${t}\` cannot be used inside an effect cleanup function +https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function AR(){if(L){let t=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function CR(t){if(L){let e=new Error(`effect_orphan +\`${t}\` can only be used inside an effect (e.g. during component initialisation) +https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function TR(){if(L){let t=new Error(`effect_update_depth_exceeded +Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state +https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function PR(){if(L){let t=new Error(`hydration_failed +Failed to hydrate the application +https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function RR(t){if(L){let e=new Error(`props_invalid_value +Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value +https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function $R(t){if(L){let e=new Error(`rune_outside_svelte +The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files +https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function FR(){if(L){let t=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function IR(){if(L){let t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function MR(){if(L){let t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function DR(){if(L){let t=new Error("svelte_boundary_reset_onerror\nA `` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}m();m();m();var Sn="font-weight: bold",kn="font-weight: normal";function OR(t){L?console.warn(`%c[svelte] await_reactivity_loss +%cDetected reactivity loss when reading \`${t}\`. This happens when state is read in an async function after an earlier \`await\` +https://svelte.dev/e/await_reactivity_loss`,Sn,kn):console.warn("https://svelte.dev/e/await_reactivity_loss")}function LR(t,e){L?console.warn(`%c[svelte] await_waterfall +%cAn async derived, \`${t}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app +https://svelte.dev/e/await_waterfall`,Sn,kn):console.warn("https://svelte.dev/e/await_waterfall")}function NR(){L?console.warn(`%c[svelte] derived_inert +%cReading a derived belonging to a now-destroyed effect may result in stale values +https://svelte.dev/e/derived_inert`,Sn,kn):console.warn("https://svelte.dev/e/derived_inert")}function BR(t,e,r){L?console.warn(`%c[svelte] hydration_attribute_changed +%cThe \`${t}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value +https://svelte.dev/e/hydration_attribute_changed`,Sn,kn):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function ja(t){L?console.warn(`%c[svelte] hydration_mismatch +%c${t?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${t}`:"Hydration failed because the initial UI does not match what was rendered on the server"} +https://svelte.dev/e/hydration_mismatch`,Sn,kn):console.warn("https://svelte.dev/e/hydration_mismatch")}function HR(){L?console.warn(`%c[svelte] lifecycle_double_unmount +%cTried to unmount a component that was not mounted +https://svelte.dev/e/lifecycle_double_unmount`,Sn,kn):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Jh(t){L?console.warn(`%c[svelte] state_proxy_equality_mismatch +%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results +https://svelte.dev/e/state_proxy_equality_mismatch`,Sn,kn):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function UR(){L?console.warn(`%c[svelte] state_proxy_unmount +%cTried to unmount a state proxy, rather than a component +https://svelte.dev/e/state_proxy_unmount`,Sn,kn):console.warn("https://svelte.dev/e/state_proxy_unmount")}function GR(){L?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Sn,kn):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function jR(t){L?console.warn(`%c[svelte] transition_slide_display +%cThe \`slide\` transition does not work correctly for elements with \`display: ${t}\` +https://svelte.dev/e/transition_slide_display`,Sn,kn):console.warn("https://svelte.dev/e/transition_slide_display")}var ae=!1;function It(t){ae=t}var be;function je(t){if(t===null)throw ja(),Jn;return be=t}function fr(){return je(rr(be))}function V(t){if(ae){if(rr(be)!==null)throw ja(),Jn;be=t}}function Va(t=1){if(ae){for(var e=t,r=be;e--;)r=rr(r);be=r}}function An(t=!0){for(var e=0,r=be;;){if(r.nodeType===Pi){var i=r.data;if(i==="]"){if(e===0)return r;e-=1}else(i==="["||i==="[!"||i[0]==="["&&!isNaN(Number(i.slice(1))))&&(e+=1)}var n=rr(r);t&&r.remove(),r=n}}function Zu(t){if(!t||t.nodeType!==Pi)throw ja(),Jn;return t.data}m();m();m();m();function ep(t){return t===this.v}function n0(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function tp(t){return!n0(t,this.v)}m();var Ct=!1,ts=!1,qi=!1;m();m();m();var Ku=null;function dr(t,e){return t.label=e,ip(t.v,e),t}function ip(t,e){var r;return(r=t==null?void 0:t[Kh])==null||r.call(t,e),t}m();function Yi(t){let e=new Error,r=h4();return r.length===0?null:(r.unshift(` +`),cr(e,"stack",{value:r.join(` +`)}),cr(e,"name",{value:t}),e)}function h4(){let t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];let r=e.split(` +`),i=[];for(let n=0;n{e===za&&WR()})}za.push(t)}function qR(){for(;za.length>0;)WR()}m();var a0=new WeakMap;function sp(t){var e=ee;if(e===null)return le.f|=8388608,t;if(L&&t instanceof Error&&!a0.has(t)&&a0.set(t,p4(t,e)),(e.f&32768)===0&&(e.f&4)===0)throw L&&!e.parent&&t instanceof Error&&YR(t),t;Xi(t,e)}function Xi(t,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(r){t=r}}e=e.parent}throw L&&t instanceof Error&&YR(t),t}}function p4(t,e){var a,o,l;let r=Gr(t,"message");if(!(r&&!r.configurable)){for(var i=Qu?" ":" ",n=` +${i}in ${((a=e.fn)==null?void 0:a.name)||""}`,s=e.ctx;s!==null;)n+=` +${i}in ${(o=s.function)==null?void 0:o[Ti].split("/").pop()}`,s=s.p;return{message:t.message+` +${n} +`,stack:(l=t.stack)==null?void 0:l.split(` +`).filter(c=>!c.includes("svelte/src/internal")).join(` +`)}}}function YR(t){let e=a0.get(t);e&&(cr(t,"message",{value:e.message}),cr(t,"stack",{value:e.stack}))}m();m();var m4=-7169;function Ve(t,e){t.f=t.f&m4|e}function Zl(t){(t.f&512)!==0||t.deps===null?Ve(t,1024):Ve(t,4096)}function ZR(t){if(t!==null)for(let e of t)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,ZR(e.deps))}function ap(t,e,r){(t.f&2048)!==0?e.add(t):(t.f&4096)!==0&&r.add(t),ZR(t.deps),Ve(t,1024)}m();m();m();var KR=!1,op=!1;function o0(t){var e=op;try{return op=!1,[t(),op]}finally{op=e}}m();m();m();m();m();function XR(t){let e=0,r=pr(0),i;return L&&dr(r,"createSubscriber version"),()=>{qs()&&(I(r),ar(()=>(e===0&&(i=Ye(()=>t(()=>Za(r)))),e+=1,()=>{Mt(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Za(r))})})))}}var v4=589824;function d0(t,e,r,i){new l0(t,e,r,i)}var ii,Ju,Fi,Ka,jr,Ii,kr,ni,ns,Xa,Ys,Xl,ef,tf,Pn,up,it,JR,e$,t$,c0,lp,cp,u0,f0,l0=class{constructor(e,r,i,n){ge(this,it);He(this,"parent");He(this,"is_pending",!1);He(this,"transform_error");ge(this,ii);ge(this,Ju,ae?be:null);ge(this,Fi);ge(this,Ka);ge(this,jr);ge(this,Ii,null);ge(this,kr,null);ge(this,ni,null);ge(this,ns,null);ge(this,Xa,0);ge(this,Ys,0);ge(this,Xl,!1);ge(this,ef,new Set);ge(this,tf,new Set);ge(this,Pn,null);ge(this,up,XR(()=>(pe(this,Pn,pr(F(this,Xa))),L&&dr(F(this,Pn),"$effect.pending()"),()=>{pe(this,Pn,null)})));var s,a;pe(this,ii,e),pe(this,Fi,r),pe(this,Ka,o=>{var l=ee;l.b=this,l.f|=128,i(o)}),this.parent=ee.b,this.transform_error=(a=n!=null?n:(s=this.parent)==null?void 0:s.transform_error)!=null?a:(o=>o),pe(this,jr,ai(()=>{if(ae){let o=F(this,Ju);fr();let l=o.data==="[!";if(o.data.startsWith("[?")){let u=JSON.parse(o.data.slice("[?".length));Ae(this,it,e$).call(this,u)}else l?Ae(this,it,t$).call(this):Ae(this,it,JR).call(this)}else Ae(this,it,c0).call(this)},v4)),ae&&pe(this,ii,be)}defer_effect(e){ap(e,F(this,ef),F(this,tf))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!F(this,Fi).pending}update_pending_count(e,r){Ae(this,it,u0).call(this,e,r),pe(this,Xa,F(this,Xa)+e),!(!F(this,Pn)||F(this,Xl))&&(pe(this,Xl,!0),Mt(()=>{pe(this,Xl,!1),F(this,Pn)&&Qi(F(this,Pn),F(this,Xa))}))}get_effect_pending(){return F(this,up).call(this),I(F(this,Pn))}error(e){var r;if(!F(this,Fi).onerror&&!F(this,Fi).failed)throw e;(r=ce)!=null&&r.is_fork?(F(this,Ii)&&ce.skip_effect(F(this,Ii)),F(this,kr)&&ce.skip_effect(F(this,kr)),F(this,ni)&&ce.skip_effect(F(this,ni)),ce.oncommit(()=>{Ae(this,it,f0).call(this,e)})):Ae(this,it,f0).call(this,e)}};ii=new WeakMap,Ju=new WeakMap,Fi=new WeakMap,Ka=new WeakMap,jr=new WeakMap,Ii=new WeakMap,kr=new WeakMap,ni=new WeakMap,ns=new WeakMap,Xa=new WeakMap,Ys=new WeakMap,Xl=new WeakMap,ef=new WeakMap,tf=new WeakMap,Pn=new WeakMap,up=new WeakMap,it=new WeakSet,JR=function(){try{pe(this,Ii,Ot(()=>F(this,Ka).call(this,F(this,ii))))}catch(e){this.error(e)}},e$=function(e){let r=F(this,Fi).failed;r&&pe(this,ni,Ot(()=>{r(F(this,ii),()=>e,()=>()=>{})}))},t$=function(){let e=F(this,Fi).pending;e&&(this.is_pending=!0,pe(this,kr,Ot(()=>e(F(this,ii)))),Mt(()=>{var r=pe(this,ns,document.createDocumentFragment()),i=Bt();r.append(i),pe(this,Ii,Ae(this,it,cp).call(this,()=>Ot(()=>F(this,Ka).call(this,i)))),F(this,Ys)===0&&(F(this,ii).before(r),pe(this,ns,null),Rn(F(this,kr),()=>{pe(this,kr,null)}),Ae(this,it,lp).call(this,ce))}))},c0=function(){try{if(this.is_pending=this.has_pending_snippet(),pe(this,Ys,0),pe(this,Xa,0),pe(this,Ii,Ot(()=>{F(this,Ka).call(this,F(this,ii))})),F(this,Ys)>0){var e=pe(this,ns,document.createDocumentFragment());Ql(F(this,Ii),e);let r=F(this,Fi).pending;pe(this,kr,Ot(()=>r(F(this,ii))))}else Ae(this,it,lp).call(this,ce)}catch(r){this.error(r)}},lp=function(e){this.is_pending=!1,e.transfer_effects(F(this,ef),F(this,tf))},cp=function(e){var r=ee,i=le,n=Ee;Nt(F(this,jr)),Lt(F(this,jr)),rs(F(this,jr).ctx);try{return si.ensure(),e()}catch(s){return sp(s),null}finally{Nt(r),Lt(i),rs(n)}},u0=function(e,r){var i;if(!this.has_pending_snippet()){this.parent&&Ae(i=this.parent,it,u0).call(i,e,r);return}pe(this,Ys,F(this,Ys)+e),F(this,Ys)===0&&(Ae(this,it,lp).call(this,r),F(this,kr)&&Rn(F(this,kr),()=>{pe(this,kr,null)}),F(this,ns)&&(F(this,ii).before(F(this,ns)),pe(this,ns,null)))},f0=function(e){F(this,Ii)&&(vt(F(this,Ii)),pe(this,Ii,null)),F(this,kr)&&(vt(F(this,kr)),pe(this,kr,null)),F(this,ni)&&(vt(F(this,ni)),pe(this,ni,null)),ae&&(je(F(this,Ju)),Va(),je(An()));var r=F(this,Fi).onerror;let i=F(this,Fi).failed;var n=!1,s=!1;let a=()=>{if(n){GR();return}n=!0,s&&DR(),F(this,ni)!==null&&Rn(F(this,ni),()=>{pe(this,ni,null)}),Ae(this,it,cp).call(this,()=>{Ae(this,it,c0).call(this)})},o=l=>{try{s=!0,r==null||r(l,a),s=!1}catch(c){Xi(c,F(this,jr)&&F(this,jr).parent)}i&&pe(this,ni,Ae(this,it,cp).call(this,()=>{try{return Ot(()=>{var c=ee;c.b=this,c.f|=128,i(F(this,ii),()=>l,()=>a)})}catch(c){return Xi(c,F(this,jr).parent),null}}))};Mt(()=>{var l;try{l=this.transform_error(e)}catch(c){Xi(c,F(this,jr)&&F(this,jr).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,c=>Xi(c,F(this,jr)&&F(this,jr).parent)):o(l)})};function fp(t,e,r,i){let n=Tn()?Zs:Qa;var s=t.filter(h=>!h.settled),a=e.map(n);if(L&&a.forEach((h,p)=>{h.label=e[p].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(g,w)=>w)}),r.length===0&&s.length===0){i(a);return}var o=ee,l=r$(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(h=>h.promise)):null;function u(h){if((o.f&16384)===0){l();try{i([...a,...h])}catch(p){Xi(p,o)}Jl()}}var f=h0();if(r.length===0){c.then(()=>u([])).finally(f);return}function d(){Promise.all(r.map(h=>m0(h))).then(u).catch(h=>Xi(h,o)).finally(f)}c?c.then(()=>{l(),d(),Jl()}):d()}function r$(){var t=ee,e=le,r=Ee,i=ce;if(L)var n=Cn;return function(a=!0){Nt(t),Lt(e),rs(r),a&&(t.f&16384)===0&&(i==null||i.activate(),i==null||i.apply()),L&&(p0(null),Yl(n))}}function Jl(t=!0){var e;Nt(null),Lt(null),rs(null),t&&((e=ce)==null||e.deactivate()),L&&(p0(null),Yl(null))}function h0(){var t=ee,e=t.b,r=ce,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,r),r.increment(i,t),()=>{e==null||e.update_pending_count(-1,r),r.decrement(i,t)}}var zr=null;function p0(t){zr=t}var rf=new Set;function Zs(t){var e=2050;ee!==null&&(ee.f|=524288);let r={ctx:Ee,deps:null,effects:null,equals:ep,f:e,fn:t,reactions:null,rv:0,v:qe,wv:0,parent:ee,ac:null};return L&&qi&&(r.created=Yi("created at")),r}var ec=Symbol("obsolete");function m0(t,e,r){let i=ee;i===null&&xR();var n=void 0,s=pr(qe);L&&(s.label=e!=null?e:t.toString());var a=!le,o=new Set;return s$(()=>{var h,p;var l=ee;L&&(zr={effect:l,effect_deps:new Set,warned:!1});var c=Zh();n=c.promise;try{Promise.resolve(t()).then(c.resolve,g=>{g!==Ws&&c.reject(g)}).finally(Jl)}catch(g){c.reject(g),Jl()}if(L){if(zr){if(l.deps!==null)for(let g=0;g{L&&(zr=null),f==null||f(),o.delete(c),w!==ec&&(u.activate(),w?(s.f|=8388608,Qi(s,w)):((s.f&8388608)!==0&&(s.f^=8388608),L&&r!==void 0&&!s.equals(g)&&(rf.add(s),setTimeout(()=>{rf.has(s)&&(l.f&16384)===0&&(LR(s.label,r),rf.delete(s))})),Qi(s,g)),u.deactivate())};c.promise.then(d,g=>d(null,g||"unknown"))}),nr(()=>{for(let l of o)l.reject(ec)}),L&&(s.f|=4194304),new Promise(l=>{function c(u){function f(){u===n?l(s):c(n)}u.then(f,f)}c(n)})}function ft(t){let e=Zs(t);return Ct||pp(e),e}function Qa(t){let e=Zs(t);return e.equals=tp,e}function i$(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;rthis.schedule(i)){var i=F(this,Fn).get(e);if(i){F(this,Fn).delete(e);for(var n of i.d)Ve(n,2048),r(n);for(n of i.m)Ve(n,4096),r(n)}F(this,cc).add(e)}capture(e,r,i=!1){e.v!==qe&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&8388608)===0&&(this.current.set(e,[r,i]),Tt==null||Tt.set(e,r)),this.is_fork||(e.v=r)}activate(){ce=this}deactivate(){ce=null,Tt=null}flush(){try{L&&_0.clear(),b0=!0,ce=this,Ae(this,Be,af).call(this)}finally{if(a$=0,y0=null,to=null,lf=null,b0=!1,ce=null,Tt=null,fs.clear(),L)for(let e of _0)e.updated=null}}discard(){var e;for(let r of F(this,ac))r(this);F(this,ac).clear();for(let r of this.async_deriveds.values())r.reject(ec);Ae(this,Be,of).call(this),(e=F(this,lc))==null||e.resolve()}register_created_effect(e){F(this,cf).push(e)}increment(e,r){var i;if(pe(this,oc,F(this,oc)+1),e){let n=(i=F(this,cs).get(r))!=null?i:0;F(this,cs).set(r,n+1)}}decrement(e,r){var i;if(pe(this,oc,F(this,oc)-1),e){let n=(i=F(this,cs).get(r))!=null?i:0;n===1?F(this,cs).delete(r):F(this,cs).set(r,n-1)}F(this,Ks)||(pe(this,Ks,!0),Mt(()=>{pe(this,Ks,!1),this.linked&&this.flush()}))}transfer_effects(e,r){for(let i of e)F(this,us).add(i);for(let i of r)F(this,Ji).add(i);e.clear(),r.clear()}oncommit(e){F(this,sc).add(e)}ondiscard(e){F(this,ac).add(e)}settled(){var e;return((e=F(this,lc))!=null?e:pe(this,lc,Zh())).promise}static ensure(){if(ce===null){let e=ce=new gp;!b0&&!Wa&&Mt(()=>{F(e,nc)||e.flush()})}return ce}apply(){if(!Ct||!this.is_fork&&F(this,os)===null&&F(this,ls)===null){Tt=null;return}Tt=new Map;for(let[r,[i]]of this.current)Tt.set(r,i);for(let r=mp;r!==null;r=F(r,ls))if(!(r===this||r.is_fork)){var e=!1;if(r.id1e3&&(Ae(this,Be,of).call(this),y4()),L)for(let d of this.current.keys())_0.add(d);for(let d of F(this,us))F(this,Ji).delete(d),Ve(d,2048),this.schedule(d);for(let d of F(this,Ji))Ve(d,4096),this.schedule(d);let e=F(this,Cr);pe(this,Cr,[]),this.apply();var r=to=[],i=[],n=lf=[];for(let d of e)try{Ae(this,Be,E0).call(this,d,r,i)}catch(h){throw h$(d),Ae(this,Be,x0).call(this)||this.discard(),h}if(ce=null,n.length>0){var s=gp.ensure();for(let d of n)s.schedule(d)}if(to=null,lf=null,Ae(this,Be,x0).call(this)){Ae(this,Be,ic).call(this,i),Ae(this,Be,ic).call(this,r);for(let[d,h]of F(this,Fn))d$(d,h);n.length>0&&Ae(l=ce,Be,af).call(l);return}let a=Ae(this,Be,l$).call(this);if(a){Ae(this,Be,ic).call(this,i),Ae(this,Be,ic).call(this,r),Ae(c=a,Be,c$).call(c,this);return}F(this,us).clear(),F(this,Ji).clear();for(let d of F(this,sc))d(this);F(this,sc).clear(),as=this,o$(i),o$(r),as=null,(u=F(this,lc))==null||u.resolve();var o=ce;if(F(this,oc)===0&&(F(this,Cr).length===0||o!==null)&&(Ae(this,Be,of).call(this),Ct&&(Ae(this,Be,u$).call(this),ce=o)),F(this,Cr).length>0)if(o!==null){let d=o;F(d,Cr).push(...F(this,Cr).filter(h=>!F(d,Cr).includes(h)))}else o=this;o!==null&&Ae(f=o,Be,af).call(f)},E0=function(e,r,i){e.f^=1024;for(var n=e.first;n!==null;){var s=n.f,a=(s&96)!==0,o=a&&(s&1024)!==0,l=o||(s&8192)!==0||F(this,Fn).has(n);if(!l&&n.fn!==null){a?n.f^=1024:(s&4)!==0?r.push(n):Ct&&(s&16777224)!==0?i.push(n):Xs(n)&&((s&16)!==0&&F(this,Ji).add(n),$n(n));var c=n.first;if(c!==null){n=c;continue}}for(;n!==null;){var u=n.next;if(u!==null){n=u;break}n=n.parent}}},l$=function(){for(var e=F(this,os);e!==null;){if(!e.is_fork){for(let[r,[,i]]of this.current)if(e.current.has(r)&&!i)return e}e=F(e,os)}return null},c$=function(e){var i;for(let[n,s]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,s);for(let[n,s]of e.async_deriveds){let a=this.async_deriveds.get(n);a&&s.promise.then(a.resolve).catch(a.reject)}e.async_deriveds.clear(),this.transfer_effects(F(e,us),F(e,Ji));let r=n=>{var s=n.reactions;if(s!==null)for(let l of s){var a=l.f;if((a&2)!==0)r(l);else{var o=l;a&4194320&&!this.async_deriveds.has(o)&&(F(this,Ji).delete(o),Ve(o,2048),this.schedule(o))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>e.discard()),Ae(i=e,Be,of).call(i),ce=this,Ae(this,Be,af).call(this)},ic=function(e){for(var r=0;r!d.current.get(h)[1]);if(!(!F(d,nc)||n.length===0)){var s=n.filter(h=>!this.current.has(h));if(s.length===0)e&&d.discard();else if(r.length>0){if(L&&!F(d,Ks)&&zR(F(d,Cr).length===0,"Batch has scheduled roots"),e)for(let h of F(this,cc))d.unskip_effect(h,p=>{var g;(p.f&4194320)!==0?d.schedule(p):Ae(g=d,Be,ic).call(g,[p])});d.activate();var a=new Set,o=new Map;for(var l of r)f$(l,s,a,o);o=new Map;var c=[...d.current].filter(([h,p])=>{let g=this.current.get(h);return g?g[0]!==p[0]||g[1]!==p[1]:!0}).map(([h])=>h);if(c.length>0)for(let h of F(this,cf))(h.f&155648)===0&&S0(h,c,o)&&((h.f&4194320)!==0?(Ve(h,2048),d.schedule(h)):F(d,us).add(h));if(F(d,Cr).length>0&&!F(d,Ks)){d.apply();for(var u of F(d,Cr))Ae(f=d,Be,E0).call(f,u,[],[]);pe(d,Cr,[])}d.deactivate()}}}},of=function(){if(this.linked){var e=F(this,os),r=F(this,ls);e===null?mp=r:pe(e,ls,r),r===null?rc=e:pe(r,os,e),this.linked=!1}};var si=gp;function io(t){var e=Wa;Wa=!0;try{var r;for(t&&(ce!==null&&!ce.is_fork&&ce.flush(),r=t());;){if(qR(),ce===null)return r;ce.flush()}}finally{Wa=e}}function y4(){var r;if(L){var t=new Map;for(let i of ce.current.keys())for(let[n,s]of(r=i.updated)!=null?r:[]){var e=t.get(n);e||(e={error:s.error,count:0},t.set(n,e)),e.count+=s.count}for(let i of t.values())i.error&&console.error(i.error)}try{TR()}catch(i){L&&cr(i,"stack",{value:""}),Xi(i,y0)}}var Wr=null;function o$(t){var e=t.length;if(e!==0){for(var r=0;r0)){fs.clear();for(let n of Wr){if((n.f&24576)!==0)continue;let s=[n],a=n.parent;for(;a!==null;)Wr.has(a)&&(Wr.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){let l=s[o];(l.f&24576)===0&&$n(l)}}Wr.clear()}}Wr=null}}function f$(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(let n of t.reactions){let s=n.f;(s&2)!==0?f$(n,e,r,i):(s&4194320)!==0&&(s&2048)===0&&S0(n,e,i)&&(Ve(n,2048),ff(n))}}function S0(t,e,r){let i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(let n of t.deps){if(zs.call(e,n))return!0;if((n.f&2)!==0&&S0(n,e,r))return r.set(n,!0),!0}return r.set(t,!1),!1}function ff(t){ce.schedule(t)}function d$(t,e){if(!((t.f&32)!==0&&(t.f&1024)!==0)){(t.f&2048)!==0?e.d.push(t):(t.f&4096)!==0&&e.m.push(t),Ve(t,1024);for(var r=t.first;r!==null;)d$(r,e),r=r.next}}function h$(t){Ve(t,1024);for(var e=t.first;e!==null;)h$(e),e=e.next}var Ja=new Set,fs=new Map;function dp(t){Ja=t}var A0=!1;function m$(){A0=!0}function pr(t,e){var r={f:0,v:t,reactions:null,equals:ep,rv:0,wv:0};return L&&qi&&(r.created=e!=null?e:Yi("created at"),r.updated=null,r.set_during_effect=!1,r.trace=null),r}function Ne(t,e){let r=pr(t,e);return pp(r),r}function qa(t,e=!1,r=!0){var n,s;let i=pr(t);return e||(i.equals=tp),ts&&r&&Ee!==null&&Ee.l!==null&&((s=(n=Ee.l).s)!=null?s:n.s=[]).push(i),i}function oe(t,e,r=!1){le!==null&&(!Tr||(le.f&131072)!==0)&&Tn()&&(le.f&4325394)!==0&&(li===null||!li.has(t))&&MR();let i=r?Je(e):e;return L&&ip(i,t.label),Qi(t,i,lf)}function Qi(t,e,r=null){var n,s,a;if(!t.equals(e)){fs.set(t,oi?e:t.v);var i=si.ensure();if(i.capture(t,e),L){if(qi||ee!==null){(n=t.updated)!=null||(t.updated=new Map);let o=((a=(s=t.updated.get(""))==null?void 0:s.count)!=null?a:0)+1;if(t.updated.set("",{error:null,count:o}),qi||o>5){let l=Yi("updated at");if(l!==null){let c=t.updated.get(l.stack);c||(c={error:l,count:0},t.updated.set(l.stack,c)),c.count++}}}ee!==null&&(t.set_during_effect=!0)}if((t.f&2)!==0){let o=t;(t.f&2048)!==0&&nf(o),Tt===null&&Zl(o)}t.wv=tc(),g$(t,2048,r),Tn()&&ee!==null&&(ee.f&1024)!==0&&(ee.f&96)===0&&(ci===null?v$([t]):ci.push(t)),!i.is_fork&&Ja.size>0&&!A0&&vp()}return e}function vp(){A0=!1;for(let t of Ja){(t.f&1024)!==0&&Ve(t,4096);let e;try{e=Xs(t)}catch(r){e=!0}e&&$n(t)}Ja.clear()}function Za(t){oe(t,t.v+1)}function g$(t,e,r){var d;var i=t.reactions;if(i!==null)for(var n=Tn(),s=i.length,a=0;a{if(Qs===a)return f();var d=le,h=Qs;Lt(null),C0(a);var p=f();return Lt(d),C0(h),p};i&&(r.set("length",Ne(t.length,s)),L&&(t=k4(t)));var l="";let c=!1;function u(f){if(!c){c=!0,l=f,dr(n,`${l} version`);for(let[d,h]of r)dr(h,no(l,d));c=!1}}return new Proxy(t,{defineProperty(f,d,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&FR();var p=r.get(d);return p===void 0?o(()=>{var g=Ne(h.value,s);return r.set(d,g),L&&typeof d=="string"&&dr(g,no(l,d)),g}):oe(p,h.value,!0),!0},deleteProperty(f,d){var h=r.get(d);if(h===void 0){if(d in f){let p=o(()=>Ne(qe,s));r.set(d,p),Za(n),L&&dr(p,no(l,d))}}else oe(h,qe),Za(n);return!0},get(f,d,h){var y;if(d===er)return t;if(L&&d===Kh)return u;var p=r.get(d),g=d in f;if(p===void 0&&(!g||(y=Gr(f,d))!=null&&y.writable)&&(p=o(()=>{var b=Je(g?f[d]:qe),S=Ne(b,s);return L&&dr(S,no(l,d)),S}),r.set(d,p)),p!==void 0){var w=I(p);return w===qe?void 0:w}return Reflect.get(f,d,h)},getOwnPropertyDescriptor(f,d){var h=Reflect.getOwnPropertyDescriptor(f,d);if(h&&"value"in h){var p=r.get(d);p&&(h.value=I(p))}else if(h===void 0){var g=r.get(d),w=g==null?void 0:g.v;if(g!==void 0&&w!==qe)return{enumerable:!0,configurable:!0,value:w,writable:!0}}return h},has(f,d){var w;if(d===er)return!0;var h=r.get(d),p=h!==void 0&&h.v!==qe||Reflect.has(f,d);if(h!==void 0||ee!==null&&(!p||(w=Gr(f,d))!=null&&w.writable)){h===void 0&&(h=o(()=>{var y=p?Je(f[d]):qe,b=Ne(y,s);return L&&dr(b,no(l,d)),b}),r.set(d,h));var g=I(h);if(g===qe)return!1}return p},set(f,d,h,p){var v;var g=r.get(d),w=d in f;if(i&&d==="length")for(var y=h;yNe(qe,s)),r.set(y+"",b),L&&dr(b,no(l,y)))}if(g===void 0)(!w||(v=Gr(f,d))!=null&&v.writable)&&(g=o(()=>Ne(void 0,s)),L&&dr(g,no(l,d)),oe(g,Je(h)),r.set(d,g));else{w=g.v!==qe;var S=o(()=>Je(h));oe(g,S)}var C=Reflect.getOwnPropertyDescriptor(f,d);if(C!=null&&C.set&&C.set.call(p,h),!w){if(i&&typeof d=="string"){var A=r.get("length"),k=Number(d);Number.isInteger(k)&&k>=A.v&&oe(A,k+1)}Za(n)}return!0},ownKeys(f){I(n);var d=Reflect.ownKeys(f).filter(g=>{var w=r.get(g);return w===void 0||w.v!==qe});for(var[h,p]of r)p.v!==qe&&!(h in f)&&d.push(h);return d},setPrototypeOf(){IR()}})}function no(t,e){var r;return typeof e=="symbol"?`${t}[Symbol(${(r=e.description)!=null?r:""})]`:E4.test(e)?`${t}.${e}`:/^\d+$/.test(e)?`${t}[${e}]`:`${t}['${e}']`}function wp(t){try{if(t!==null&&typeof t=="object"&&er in t)return t[er]}catch(e){}return t}var S4=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function k4(t){return new Proxy(t,{get(e,r,i){var n=Reflect.get(e,r,i);return S4.has(r)?function(...s){m$();var a=n.apply(this,s);return vp(),a}:n}})}function w$(){let t=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:r,lastIndexOf:i,includes:n}=t;t.indexOf=function(s,a){let o=r.call(this,s,a);if(o===-1){for(let l=a!=null?a:0;l{t.indexOf=r,t.lastIndexOf=i,t.includes=n}}var T0,b$,Qu,_$,y$;function bp(){if(T0===void 0){T0=window,b$=document,Qu=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;_$=Gr(e,"firstChild").get,y$=Gr(e,"nextSibling").get,Xw(t)&&(t[Wu]=void 0,t[Xh]=null,t[Jw]=void 0,t.__e=void 0),Xw(r)&&(r[qu]=void 0),L&&(t.__svelte_meta=null,w$())}}function Bt(t=""){return document.createTextNode(t)}function or(t){return _$.call(t)}function rr(t){return y$.call(t)}function W(t,e){if(!ae)return or(t);var r=or(be);if(r===null)r=be.appendChild(Bt());else if(e&&r.nodeType!==zl){var i=Bt();return r==null||r.before(i),je(i),i}return e&&yp(r),je(r),r}function Mi(t,e=!1){var n,s;if(!ae){var r=or(t);return r instanceof Comment&&r.data===""?rr(r):r}if(e){if(((n=be)==null?void 0:n.nodeType)!==zl){var i=Bt();return(s=be)==null||s.before(i),je(i),i}yp(be)}return be}function ne(t,e=1,r=!1){let i=ae?be:t;for(var n;e--;)n=i,i=rr(i);if(!ae)return i;if(r){if((i==null?void 0:i.nodeType)!==zl){var s=Bt();return i===null?n==null||n.after(s):i.before(s),je(s),s}yp(i)}return je(i),i}function fc(t){t.textContent=""}function _p(){if(!Ct||Wr!==null)return!1;var t=ee.f;return(t&32768)!==0}function In(t,e,r){return e==null||e===Wh?r?document.createElement(t,{is:r}):document.createElement(t):r?document.createElementNS(e,t,{is:r}):document.createElementNS(e,t)}function yp(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===zl;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}m();m();function P0(t){ae&&or(t)!==null&&fc(t)}var x$=!1;function R0(){x$||(x$=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(let r of t.target.elements)(e=r[Ga])==null||e.call(r)})},{capture:!0}))}function en(t){var e=le,r=ee;Lt(null),Nt(null);try{return t()}finally{Lt(e),Nt(r)}}function $0(t,e,r,i=r){t.addEventListener(e,()=>en(r));let n=t[Ga];n?t[Ga]=()=>{n(),i(!0)}:t[Ga]=()=>i(!0),R0()}function S$(t){ee===null&&(le===null&&CR(t),AR()),oi&&kR(t)}function C4(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Mn(t,e){var a,o;var r=ee;if(L)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(t|=8192);var i={ctx:Ee,deps:null,nodes:null,f:t|2048|512,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};L&&(i.component_function=Zi),(a=ce)==null||a.register_created_effect(i);var n=i;if((t&4)!==0)to!==null?to.push(i):si.ensure().schedule(i);else if(e!==null){try{$n(i)}catch(l){throw vt(i),l}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&524288)===0&&(n=n.first,(t&16)!==0&&(t&65536)!==0&&n!==null&&(n.f|=65536))}if(n!==null&&(n.parent=r,r!==null&&C4(n,r),le!==null&&(le.f&2)!==0&&(t&64)===0)){var s=le;((o=s.effects)!=null?o:s.effects=[]).push(n)}return i}function qs(){return le!==null&&!Tr}function nr(t){let e=Mn(8,null);return Ve(e,1024),e.teardown=t,e}function mr(t){var n;S$("$effect"),L&&cr(t,"name",{value:"$effect"});var e=ee.f,r=!le&&(e&32)!==0&&Ee!==null&&!Ee.i;if(r){var i=Ee;((n=i.e)!=null?n:i.e=[]).push(t)}else return s0(t)}function s0(t){return Mn(1048580,t)}function I0(t){si.ensure();let e=Mn(524352,t);return()=>{vt(e)}}function k$(t){si.ensure();let e=Mn(524352,t);return(r={})=>new Promise(i=>{r.outro?Rn(e,()=>{vt(e),i(void 0)}):(vt(e),i(void 0))})}function qr(t){return Mn(4,t)}function s$(t){return Mn(4718592,t)}function ar(t,e=0){return Mn(8|e,t)}function Ue(t,e=[],r=[],i=[]){fp(i,e,r,n=>{Mn(8,()=>{t(...n.map(I))})})}function ai(t,e=0){var r=Mn(16|e,t);return L&&(r.dev_stack=Cn),r}function Ot(t){return Mn(524320,t)}function M0(t){var e=t.teardown;if(e!==null){let r=oi,i=le;F0(!0),Lt(null);try{e.call(null)}finally{F0(r),Lt(i)}}}function sf(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){let n=r.ac;n!==null&&en(()=>{n.abort(Ws)});var i=r.next;(r.f&64)!==0?r.parent=null:vt(r,e),r=i}}function A$(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&32)===0&&vt(e),e=r}}function vt(t,e=!0){var r=!1;(e||(t.f&262144)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(C$(t.nodes.start,t.nodes.end),r=!0),t.f|=33554432,sf(t,e&&!r),eo(t,0);var i=t.nodes&&t.nodes.t;if(i!==null)for(let s of i)s.stop();M0(t),t.f^=33554432,t.f|=16384;var n=t.parent;n!==null&&n.first!==null&&k0(t),L&&(t.component_function=null),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function C$(t,e){for(;t!==null;){var r=t===e?null:rr(t);t.remove(),t=r}}function k0(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function Rn(t,e,r=!0){var i=[];T$(t,i,!0);var n=()=>{r&&vt(t),e&&e()},s=i.length;if(s>0){var a=()=>--s||n();for(var o of i)o.out(a)}else n()}function T$(t,e,r){if((t.f&8192)===0){t.f^=8192;var i=t.nodes&&t.nodes.t;if(i!==null)for(let o of i)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var s=n.next;if((n.f&64)===0){var a=(n.f&65536)!==0||(n.f&32)!==0&&(t.f&16)!==0;T$(n,e,a?r:!1)}n=s}}}function dc(t){P$(t,!0)}function P$(t,e){if((t.f&8192)!==0){t.f^=8192,(t.f&1024)===0&&(Ve(t,2048),si.ensure().schedule(t));for(var r=t.first;r!==null;){var i=r.next,n=(r.f&65536)!==0||(r.f&32)!==0;P$(r,n?e:!1),r=i}var s=t.nodes&&t.nodes.t;if(s!==null)for(let a of s)(a.is_global||e)&&a.in()}}function Ql(t,e){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end;r!==null;){var n=r===i?null:rr(r);e.append(r),r=n}}m();var R$=null;var xp=!1,oi=!1;function F0(t){oi=t}var le=null,Tr=!1;function Lt(t){le=t}var ee=null;function Nt(t){ee=t}var li=null;function pp(t){le!==null&&(!Ct||(le.f&2)!==0)&&(li!=null?li:li=new Set).add(t)}var Zt=null,Ar=0,ci=null;function v$(t){ci=t}var $$=1,so=0,Qs=so;function C0(t){Qs=t}function tc(){return++$$}function Xs(t){var e=t.f;if((e&2048)!==0)return!0;if(e&2&&(t.f&=-65537),(e&4096)!==0){for(var r=t.deps,i=r.length,n=0;nt.wv)return!0}(e&512)!==0&&Tt===null&&Ve(t,1024)}return!1}function F$(t,e,r=!0){var i=t.reactions;if(i!==null&&!(!Ct&&li!==null&&li.has(t)))for(var n=0;n{t.ac.abort(Ws)}),t.ac=null);try{t.f|=2097152;var u=t.fn,f=u();t.f|=32768;var d=t.deps,h=(g=ce)==null?void 0:g.is_fork;if(Zt!==null){var p;if(h||eo(t,Ar),d!==null&&Ar>0)for(d.length=Ar+Zt.length,p=0;p{requestAnimationFrame(()=>t()),setTimeout(()=>t())});await Promise.resolve(),io()}function I(t){var h,p,g;var e=t.f,r=(e&2)!==0;if((h=R$)==null||h.add(t),le!==null&&!Tr){var i=ee!==null&&(ee.f&16384)!==0;if(!i&&(li===null||!li.has(t))){var n=le.deps;if((le.f&2097152)!==0)t.rvr==null?void 0:r.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Mt(()=>{e.addEventListener(t,n,i)}):e.addEventListener(t,n,i),n}function ui(t,e,r,i,n){var s={capture:i,passive:n},a=O$(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&nr(()=>{e.removeEventListener(t,a,s)})}function we(t,e,r){var i;((i=e[ao])!=null?i:e[ao]={})[t]=r}function Pt(t){for(var e=0;e{throw y});throw d}}finally{t[ao]=e,delete t.currentTarget,Lt(u),Nt(f)}}}m();m();var L$,O0=((L$=globalThis==null?void 0:globalThis.window)==null?void 0:L$.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function N$(t){var e;return(e=O0==null?void 0:O0.createHTML(t))!=null?e:t}function L0(t){var e=In("template");return e.innerHTML=N$(t.replaceAll("","")),e.content}function tn(t,e){var r=ee;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function xe(t,e){var r=(e&1)!==0,i=(e&2)!==0,n,s=!t.startsWith("");return()=>{if(ae)return tn(be,null),be;n===void 0&&(n=L0(s?t:""+t),r||(n=or(n)));var a=i||Qu?document.importNode(n,!0):n.cloneNode(!0);if(r){var o=or(a),l=a.lastChild;tn(o,l)}else tn(a,a);return a}}function oo(){if(ae)return tn(be,null),be;var t=document.createDocumentFragment(),e=document.createComment(""),r=Bt();return t.append(e,r),tn(e,r),t}function fe(t,e){if(ae){var r=ee;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=be),fr();return}t!==null&&t.before(e)}m();var M4=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var Jee=[...M4,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var D4=["touchstart","touchmove"];function B$(t){return D4.includes(t)}var O4=["$state","$state.raw","$derived","$derived.by"],ete=[...O4,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var Cp=!0;function ze(t,e){var i,n;var r=e==null?"":typeof e=="object"?`${e}`:e;r!==((n=t[i=qu])!=null?n:t[i]=t.nodeValue)&&(t[qu]=r,t.nodeValue=`${r}`)}function Js(t,e){return H$(t,e)}function H0(t,e){var a;bp(),e.intro=(a=e.intro)!=null?a:!1;let r=e.target,i=ae,n=be;try{for(var s=or(r);s&&(s.nodeType!==Pi||s.data!=="[");)s=rr(s);if(!s)throw Jn;It(!0),je(s);let o=H$(t,{...e,anchor:s});return It(!1),o}catch(o){if(o instanceof Error&&o.message.split(` +`).some(l=>l.startsWith("https://svelte.dev/e/")))throw o;return o!==Jn&&console.warn("Failed to hydrate: ",o),e.recover===!1&&PR(),bp(),fc(r),It(!1),Js(t,e)}finally{It(i),je(n)}}var Ap=new Map;function H$(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:a=!0,transformError:o}){bp();var l=void 0,c=k$(()=>{var u=r!=null?r:e.appendChild(Bt());d0(u,{pending:()=>{}},h=>{ct({});var p=Ee;if(s&&(p.c=s),n&&(i.$$events=n),ae&&tn(h,null),Cp=a,l=t(h,i)||{},Cp=!0,ae&&(ee.nodes.end=be,be===null||be.nodeType!==Pi||be.data!=="]"))throw ja(),Jn;ut()},o);var f=new Set,d=h=>{for(var p=0;p{var w;for(var h of f)for(let y of[e,document]){var p=Ap.get(y),g=p.get(h);--g==0?(y.removeEventListener(h,kp),p.delete(h),p.size===0&&Ap.delete(y)):p.set(h,g)}Sp.delete(d),u!==r&&((w=u.parentNode)==null||w.removeChild(u))}});return B0.set(l,c),l}var B0=new WeakMap;function ds(t,e){let r=B0.get(t);return r?(B0.delete(t),r(e)):(L&&(er in t?UR():HR()),Promise.resolve())}m();m();m();var rn,Dn,fi,lo,df,hf,Tp,hs=class{constructor(e,r=!0){He(this,"anchor");ge(this,rn,new Map);ge(this,Dn,new Map);ge(this,fi,new Map);ge(this,lo,new Set);ge(this,df,!0);ge(this,hf,e=>{if(F(this,rn).has(e)){var r=F(this,rn).get(e),i=F(this,Dn).get(r);if(i)dc(i),F(this,lo).delete(r);else{var n=F(this,fi).get(r);n&&(dc(n.effect),F(this,Dn).set(r,n.effect),F(this,fi).delete(r),L&&(n.fragment.lastChild[e0]=this.anchor),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(let[s,a]of F(this,rn)){if(F(this,rn).delete(s),s===e)break;let o=F(this,fi).get(a);o&&(vt(o.effect),F(this,fi).delete(a))}for(let[s,a]of F(this,Dn)){if(s===r||F(this,lo).has(s))continue;let o=()=>{if(Array.from(F(this,rn).values()).includes(s)){var c=document.createDocumentFragment();Ql(a,c),c.append(Bt()),F(this,fi).set(s,{effect:a,fragment:c})}else vt(a);F(this,lo).delete(s),F(this,Dn).delete(s)};F(this,df)||!i?(F(this,lo).add(s),Rn(a,o,!1)):o()}}});ge(this,Tp,e=>{F(this,rn).delete(e);let r=Array.from(F(this,rn).values());for(let[i,n]of F(this,fi))r.includes(i)||(vt(n.effect),F(this,fi).delete(i))});this.anchor=e,pe(this,df,r)}ensure(e,r){var i=ce,n=_p();if(r&&!F(this,Dn).has(e)&&!F(this,fi).has(e))if(n){var s=document.createDocumentFragment(),a=Bt();s.append(a),F(this,fi).set(e,{effect:Ot(()=>r(a)),fragment:s})}else F(this,Dn).set(e,Ot(()=>r(this.anchor)));if(F(this,rn).set(i,e),n){for(let[o,l]of F(this,Dn))o===e?i.unskip_effect(l):i.skip_effect(l);for(let[o,l]of F(this,fi))o===e?i.unskip_effect(l.effect):i.skip_effect(l.effect);i.oncommit(F(this,hf)),i.ondiscard(F(this,Tp))}else ae&&(this.anchor=be),F(this,hf).call(this,i)}};rn=new WeakMap,Dn=new WeakMap,fi=new WeakMap,lo=new WeakMap,df=new WeakMap,hf=new WeakMap,Tp=new WeakMap;if(L){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;$R(e)},set:i=>{r=i}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function co(t){Ee===null&&Qh("onMount"),ts&&Ee.l!==null?B4(Ee).m.push(t):mr(()=>{let e=Ye(t);if(typeof e=="function")return e})}function B4(t){var r;var e=t.l;return(r=e.u)!=null?r:e.u={a:[],b:[],m:[]}}m();m();var j$=new Map;function V$(t,e){var r=j$.get(t);r||(r=new Set,j$.set(t,r)),r.add(e)}m();m();m();m();m();m();m();m();m();function Fe(t,e,r=!1){var i;ae&&(i=be,fr());var n=new hs(t),s=r?65536:0;function a(o,l){if(ae){var c=Zu(i);if(o!==parseInt(c.substring(1))){var u=An();je(u),n.anchor=u,It(!1),n.ensure(o,l),It(!0);return}}n.ensure(o,l)}ai(()=>{var o=!1;e((l,c=0)=>{o=!0,a(c,l)}),o||a(-1,null)},s)}m();m();m();function di(t,e){return e}function q4(t,e,r){var f;for(var i=[],n=e.length,s,a=e.length,o=0;o{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=t.outrogroups;U0(t,jl(s.done)),h.delete(s),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=i.length===0&&r!==null;if(l){var c=r,u=c.parentNode;fc(u),u.append(c),t.items.clear()}U0(t,e,!l)}else s={pending:new Set(e),done:new Set},((f=t.outrogroups)!=null?f:t.outrogroups=new Set).add(s)}function U0(t,e,r=!0){var i;if(t.pending.size>0){i=new Set;for(let a of t.pending.values())for(let o of a)i.add(t.items.get(o).e)}for(var n=0;n{var S=r();return es(S)?S:S==null?[]:jl(S)});L&&dr(f,"{#each ...}");var d,h=new Map,p=!0;function g(S){(b.effect.f&16384)===0&&(b.pending.delete(S),b.fallback=u,Y4(b,d,a,e,i),u!==null&&(d.length===0?(u.f&33554432)===0?dc(u):(u.f^=33554432,mf(u,null,a)):Rn(u,()=>{u=null})))}function w(S){b.pending.delete(S)}var y=ai(()=>{d=I(f);var S=d.length;let C=!1;if(ae){var A=Zu(a)==="[!";A!==(S===0)&&(a=An(),je(a),It(!1),C=!0)}for(var k=new Set,v=ce,x=_p(),_=0;_s(a)):(u=Ot(()=>s(hc!=null?hc:hc=Bt())),u.f|=33554432)),S>k.size&&(L?K4(d,i):i0("","","")),ae&&S>0&&je(An()),!p)if(h.set(v,k),x){for(let[D,Q]of o)k.has(D)||v.skip_effect(Q.e);v.oncommit(g),v.ondiscard(w)}else g(v);C&&It(!0),I(f)}),b={effect:y,flags:e,items:o,pending:h,outrogroups:null,fallback:u};p=!1,ae&&(a=be)}function pf(t){for(;t!==null&&(t.f&32)===0;)t=t.next;return t}function Y4(t,e,r,i,n){var P,T,M,$,D,Q,ye,de,J;var s=(i&8)!==0,a=e.length,o=t.items,l=pf(t.effect.first),c,u=null,f,d=[],h=[],p,g,w,y;if(s)for(y=0;y0){var _=(i&4)!==0&&a===0?r:null;if(s){for(y=0;y{var X,he;if(f!==void 0)for(w of f)(he=(X=w.nodes)==null?void 0:X.a)==null||he.apply()})}function Z4(t,e,r,i,n,s,a,o){var l=(a&1)!==0?(a&16)===0?qa(r,!1,!1):pr(r):null,c=(a&2)!==0?pr(n):null;return L&&l&&(l.trace=()=>{var u;o()[(u=c==null?void 0:c.v)!=null?u:n]}),{v:l,i:c,e:Ot(()=>(s(e,l!=null?l:r,c!=null?c:n,o),()=>{t.delete(i)}))}}function mf(t,e,r){if(t.nodes)for(var i=t.nodes.start,n=t.nodes.end,s=e&&(e.f&33554432)===0?e.nodes.start:r;i!==null;){var a=rr(i);if(s.before(i),i===n)return;i=a}}function ea(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function K4(t,e){let r=new Map,i=t.length;for(let n=0;nperformance.now():()=>Date.now(),nn={tick:t=>(qh?requestAnimationFrame:ur)(t),now:()=>X4(),tasks:new Set};function W$(){let t=nn.now();nn.tasks.forEach(e=>{e.c(t)||(nn.tasks.delete(e),e.f())}),nn.tasks.size!==0&&nn.tick(W$)}function q$(t){let e;return nn.tasks.size===0&&nn.tick(W$),{promise:new Promise(r=>{nn.tasks.add(e={c:t,f:r})}),abort(){nn.tasks.delete(e)}}}function Pp(t,e){en(()=>{t.dispatchEvent(new CustomEvent(e))})}function tU(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function Y$(t){let e={},r=t.split(";");for(let i of r){let[n,s]=i.split(":");if(!n||s===void 0)break;let a=tU(n.trim());e[a]=s.trim()}return e}var rU=t=>t;function sn(t,e,r,i){var S,C;var n=(t&1)!==0,s=(t&2)!==0,a=n&&s,o=(t&4)!==0,l=a?"both":n?"in":"out",c,u=e.inert,f=e.style.overflow,d,h;function p(){return en(()=>{var A;return c!=null?c:c=r()(e,(A=i==null?void 0:i())!=null?A:{},{direction:l})})}var g={is_global:o,in(){var A;if(e.inert=u,!n){h==null||h.abort(),(A=h==null?void 0:h.reset)==null||A.call(h);return}s||d==null||d.abort(),d=G0(e,p(),h,1,()=>{Pp(e,"introstart")},()=>{Pp(e,"introend"),d==null||d.abort(),d=c=void 0,e.style.overflow=f})},out(A){if(!s){A==null||A(),c=void 0;return}e.inert=!0,h=G0(e,p(),d,0,()=>{Pp(e,"outrostart")},()=>{Pp(e,"outroend"),A==null||A()})},stop:()=>{d==null||d.abort(),h==null||h.abort()}},w=ee;if(((C=(S=w.nodes).t)!=null?C:S.t=[]).push(g),n&&Cp){var y=o;if(!y){for(var b=w.parent;b&&(b.f&65536)!==0;)for(;(b=b.parent)&&(b.f&16)===0;);y=!b||(b.f&32768)!==0}y&&qr(()=>{Ye(()=>g.in())})}}function G0(t,e,r,i,n,s){var a=i===1;if(Qw(e)){var o,l=!1;return Mt(()=>{if(!l){var y=e({direction:a?"in":"out"});o=G0(t,y,r,i,n,s)}}),{abort:()=>{l=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(r==null||r.deactivate(),!(e!=null&&e.duration)&&!(e!=null&&e.delay))return n(),s(),{abort:ur,deactivate:ur,reset:ur,t:()=>i};let{delay:c=0,css:u,tick:f,easing:d=rU}=e;var h=[];if(a&&r===void 0&&(f&&f(0,1),u)){var p=Y$(u(0,1));h.push(p,p)}var g=()=>1-i,w=t.animate(h,{duration:c,fill:"forwards"});return w.onfinish=()=>{var P;w.cancel(),n();var y=(P=r==null?void 0:r.t())!=null?P:1-i;r==null||r.abort();var b=i-y,S=e.duration*Math.abs(b),C=[];if(S>0){var A=!1;if(u)for(var k=Math.ceil(S/16.666666666666668),v=0;v<=k;v+=1){var x=y+b*d(v/k),_=Y$(u(x,1-x));C.push(_),A||(A=_.overflow==="hidden")}A&&(t.style.overflow="hidden"),g=()=>{var T=w.currentTime;return y+b*d(T/S)},f&&q$(()=>{if(w.playState!=="running")return!1;var T=g();return f(T,1-T),!0})}w=t.animate(C,{duration:S,fill:"forwards"}),w.onfinish=()=>{g=()=>i,f==null||f(i,1-i),s()}},{abort:()=>{w&&(w.cancel(),w.effect=null,w.onfinish=ur)},deactivate:()=>{s=ur},reset:()=>{i===0&&(f==null||f(1,0))},t:()=>g()}}m();m();function an(t,e){qr(()=>{var n;var r=t.getRootNode(),i=r.host?r:(n=r.head)!=null?n:r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){let s=In("style");s.id=e.hash,s.textContent=e.code,i.appendChild(s),L&&V$(e.hash,s)}})}m();m();m();m();m();m();var K$=[...` +\r\f\xA0\v\uFEFF`];function X$(t,e,r){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),r){for(var n of Object.keys(r))if(r[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var o=a+s;(a===0||K$.includes(i[a-1]))&&(o===i.length||K$.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}m();function wt(t,e,r,i,n,s){var a=t[Wu];if(ae||a!==r||a===void 0){var o=X$(r,i,s);(!ae||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t[Wu]=r}else if(s&&n!==s)for(var l in s){var c=!!s[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return s}m();m();var uU=Symbol("is custom element"),fU=Symbol("is html"),dU=t0?"link":"LINK";function ke(t,e,r,i){var n=hU(t);if(ae&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===dU)){i||mU(t,e,r!=null?r:"");return}n[e]!==(n[e]=r)&&(e==="loading"&&(t[bR]=r),r==null?t.removeAttribute(e):typeof r!="string"&&pU(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function hU(t){var e,r;return(r=t[e=Xh])!=null?r:t[e]={[uU]:t.nodeName.includes("-"),[fU]:t.namespaceURI===Wh}}var Q$=new Map;function pU(t){var e=t.getAttribute("is")||t.nodeName,r=Q$.get(e);if(r)return r;Q$.set(e,r=[]);for(var i,n=t,s=Element.prototype;s!==n;){i=Zw(n);for(var a in i)i[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&r.push(a);n=Vl(n)}return r}function mU(t,e,r){var i;L&&(e==="srcset"&&gU(t,r)||j0((i=t.getAttribute(e))!=null?i:"",r)||BR(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function j0(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function J$(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function gU(t,e){var r=J$(t.srcset),i=J$(e);return i.length===r.length&&i.every(([n,s],a)=>s===r[a][1]&&(j0(r[a][0],n)||j0(n,r[a][0])))}m();m();m();function W0(t,e,r=e){var i=new WeakSet;$0(t,"input",async n=>{L&&t.type==="checkbox"&&r0();var s=n?t.defaultValue:t.value;if(s=V0(t)?z0(s):s,r(s),ce!==null&&i.add(ce),await Ep(),s!==(s=e())){var a=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=s!=null?s:"",o!==null){var c=t.value.length;a===o&&o===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=a,t.selectionEnd=Math.min(o,c))}}}),(ae&&t.defaultValue!==t.value||Ye(e)==null&&t.value)&&(r(V0(t)?z0(t.value):t.value),ce!==null&&i.add(ce)),ar(()=>{L&&t.type==="checkbox"&&r0();var n=e();if(t===document.activeElement){var s=Ct?as:ce;if(i.has(s))return}V0(t)&&n===z0(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n!=null?n:"")})}function V0(t){var e=t.type;return e==="number"||e==="range"}function z0(t){return t===""?null:+t}m();m();m();m();m();function q0(t,e){return t===e||(t==null?void 0:t[er])===e}function ot(t={},e,r,i){var n=Ee.r,s=ee;return qr(()=>{var a,o;return ar(()=>{a=o,o=(i==null?void 0:i())||[],Ye(()=>{q0(r(...o),t)||(e(t,...o),a&&q0(r(...a),t)&&e(null,...a))})}),()=>{let l=s;for(;l!==n&&l.parent!==null&&l.parent.f&33554432;)l=l.parent;let c=()=>{o&&q0(r(...o),t)&&e(null,...o)},u=l.teardown;l.teardown=()=>{c(),u==null||u()}}}),t}m();m();m();m();m();m();function Di(t,e,r,i){var C,A;var n=!ts||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=i,l=!0,c=void 0,u=()=>a&&n?(c!=null||(c=Zs(i)),I(c)):(l&&(l=!1,o=a?Ye(i):i),o);let f;if(s){var d=er in t||zu in t;f=(A=(C=Gr(t,e))==null?void 0:C.set)!=null?A:d&&e in t?k=>t[e]=k:void 0}var h,p=!1;s?[h,p]=o0(()=>t[e]):h=t[e],h===void 0&&i!==void 0&&(h=u(),f&&(n&&RR(e),f(h)));var g;if(n?g=()=>{var k=t[e];return k===void 0?u():(l=!0,k)}:g=()=>{var k=t[e];return k!==void 0&&(o=void 0),k===void 0?o:k},n&&(r&4)===0)return g;if(f){var w=t.$$legacy;return(function(k,v){return arguments.length>0?((!n||!v||w||p)&&f(v?g():k),k):g()})}var y=!1,b=((r&1)!==0?Zs:Qa)(()=>(y=!1,g()));L&&(b.label=e),s&&I(b);var S=ee;return(function(k,v){if(arguments.length>0){let x=v?I(b):n&&s?Je(k):k;return oe(b,x),y=!0,o!==void 0&&(o=x),k}return oi&&y||(S.f&16384)!==0?b.v:I(b)})}m();m();m();function tF(t){return new Z0(t)}var ps,Oi,Z0=class{constructor(e){ge(this,ps);ge(this,Oi);var s,a;var r=new Map,i=(o,l)=>{var c=qa(l,!1,!1);return r.set(o,c),c};let n=new Proxy({...e.props||{},$$events:{}},{get(o,l){var c;return I((c=r.get(l))!=null?c:i(l,Reflect.get(o,l)))},has(o,l){var c;return l===zu?!0:(I((c=r.get(l))!=null?c:i(l,Reflect.get(o,l))),Reflect.has(o,l))},set(o,l,c){var u;return oe((u=r.get(l))!=null?u:i(l,c),c),Reflect.set(o,l,c)}});pe(this,Oi,(e.hydrate?H0:Js)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover,transformError:e.transformError})),!Ct&&(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&io(),pe(this,ps,n.$$events);for(let o of Object.keys(F(this,Oi)))o==="$set"||o==="$destroy"||o==="$on"||cr(this,o,{get(){return F(this,Oi)[o]},set(l){F(this,Oi)[o]=l},enumerable:!0});F(this,Oi).$set=o=>{Object.assign(n,o)},F(this,Oi).$destroy=()=>{ds(F(this,Oi))}}$set(e){F(this,Oi).$set(e)}$on(e,r){F(this,ps)[e]=F(this,ps)[e]||[];let i=(...n)=>r.call(this,...n);return F(this,ps)[e].push(i),()=>{F(this,ps)[e]=F(this,ps)[e].filter(n=>n!==i)}}$destroy(){F(this,Oi).$destroy()}};ps=new WeakMap,Oi=new WeakMap;var PU;typeof HTMLElement=="function"&&(PU=class extends HTMLElement{constructor(e,r,i){super();He(this,"$$ctor");He(this,"$$s");He(this,"$$c");He(this,"$$cn",!1);He(this,"$$d",{});He(this,"$$r",!1);He(this,"$$p_d",{});He(this,"$$l",{});He(this,"$$l_u",new Map);He(this,"$$me");He(this,"$$shadowRoot",null);this.$$ctor=e,this.$$s=r,i&&(this.$$shadowRoot=this.attachShadow(i))}addEventListener(e,r,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(r),this.$$c){let n=this.$$c.$on(e,r);this.$$l_u.set(r,n)}super.addEventListener(e,r,i)}removeEventListener(e,r,i){if(super.removeEventListener(e,r,i),this.$$c){let n=this.$$l_u.get(r);n&&(n(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{let a=In("slot");n!=="default"&&(a.name=n),fe(s,a)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let r={},i=RU(this);for(let n of this.$$s)n in i&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),r.default=!0):r[n]=e(n));for(let n of this.attributes){let s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=K0(s,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=tF({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=I0(()=>{ar(()=>{var n;this.$$r=!0;for(let s of Yw(this.$$c)){if(!((n=this.$$p_d[s])!=null&&n.reflect))continue;this.$$d[s]=this.$$c[s];let a=K0(s,this.$$d[s],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,a)}this.$$r=!1})});for(let n in this.$$l)for(let s of this.$$l[n]){let a=this.$$c.$on(n,s);this.$$l_u.set(s,a)}this.$$l={}}}attributeChangedCallback(e,r,i){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=K0(e,i,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Yw(this.$$p_d).find(r=>this.$$p_d[r].attribute===e||!this.$$p_d[r].attribute&&r.toLowerCase()===e)||e}});function K0(t,e,r,i){var s;let n=(s=r[t])==null?void 0:s.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function RU(t){let e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}m();m();function uo(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(i.next(u))}catch(f){a(f)}}function l(u){try{c(i.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):n(u.value).then(o,l)}c((i=i.apply(t,e||[])).next())})}var eb=require("obsidian");m();var Q0=require("obsidian");m();function $U(t){let e=t-1;return e*e*e+1}var X0=!1;function Nn(t,{delay:e=0,duration:r=400,easing:i=$U,axis:n="y"}={}){let s=getComputedStyle(t);L&&!X0&&/(contents|inline|table)/.test(s.display)&&(X0=!0,Promise.resolve().then(()=>X0=!1),jR(s.display));let a=+s.opacity,o=n==="y"?"height":"width",l=parseFloat(s[o]),c=n==="y"?["top","bottom"]:["left","right"],u=c.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),f=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),h=parseFloat(s[`margin${u[0]}`]),p=parseFloat(s[`margin${u[1]}`]),g=parseFloat(s[`border${u[0]}Width`]),w=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:r,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*a};${o}: ${y*l}px;padding-${c[0]}: ${y*f}px;padding-${c[1]}: ${y*d}px;margin-${c[0]}: ${y*h}px;margin-${c[1]}: ${y*p}px;border-${c[0]}-width: ${y*g}px;border-${c[1]}-width: ${y*w}px;min-${o}: 0`}}m();var $p=require("obsidian");var FU=xe('
'),IU=xe('
'),MU={hash:"svelte-1c0jiav",code:"main.svelte-1c0jiav .nav-file-title:where(.svelte-1c0jiav) {align-items:center;}"};function gf(t,e){ct(e,!0),an(t,MU);let r=Je([]),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");mr(()=>{for(let b of r)b&&(0,$p.setIcon)(b,b.getAttr("data-icon"))});function n(b){b.stopPropagation(),al(e.diff.path)?s(b):a(b)}function s(b){var S;b.stopPropagation();let C=e.view.app.vault.getAbstractFileByPath(e.diff.vaultPath);C instanceof $p.TFile&&((S=ji(e.view.app,b))===null||S===void 0||S.openFile(C).catch(A=>e.view.plugin.displayError(A)))}function a(b){var S;e.view.plugin.tools.openDiff({event:b,aFile:(S=e.diff.fromPath)!==null&&S!==void 0?S:e.diff.path,aRef:`${e.diff.hash}^`,bFile:e.diff.path,bRef:e.diff.hash})}var o=IU(),l=W(o),c=W(l),u=W(c,!0);V(c);var f=ne(c,2),d=W(f),h=W(d);{var p=b=>{var S=FU();ot(S,C=>r[0]=C,()=>r==null?void 0:r[0]),ui("auxclick",S,s),we("click",S,s),fe(b,S)},g=ft(()=>ol(e.diff.vaultPath,e.view.app));Fe(h,b=>{I(g)&&b(p)})}V(d);var w=ne(d,2),y=W(w,!0);V(w),V(f),V(l),V(o),Ue(b=>{ke(l,"data-path",e.diff.vaultPath),ke(l,"data-tooltip-position",I(i)),ke(l,"aria-label",e.diff.vaultPath),ze(u,b),ke(w,"data-type",e.diff.status),ze(y,e.diff.status)},[()=>_n(e.diff.vaultPath)]),we("click",o,n),ui("auxclick",o,b=>{b.stopPropagation(),b.button==2?bn(e.view.app,b,e.diff.vaultPath,e.view.leaf,"git-history"):n(b)}),fe(t,o),ut()}Pt(["click"]);m();var DU=xe("
"),OU=xe(''),LU=xe('
'),NU=xe("
"),BU={hash:"svelte-d9h7mp",code:"main.svelte-d9h7mp .nav-folder-title-content:where(.svelte-d9h7mp) {display:flex;align-items:center;}"};function vf(t,e){ct(e,!0),an(t,BU);let r=Di(e,"topLevel",3,!1),i=Di(e,"closed",15),n=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(l,c){l.stopPropagation(),i(i()[c.path]=!i()[c.path],!0)}var a=NU();let o;hi(a,21,()=>e.hierarchy.children,di,(l,c)=>{var u=oo(),f=Mi(u);{var d=p=>{var g=DU(),w=W(g);gf(w,{get diff(){return I(c).data},get view(){return e.view}}),V(g),fe(p,g)},h=p=>{var g=LU();let w;var y=W(g),b=ne(W(y),2);let S;var C=ne(b,2),A=W(C,!0);V(C),V(y);var k=ne(y,2);{var v=x=>{var _=OU(),P=W(_);vf(P,{get hierarchy(){return I(c)},get plugin(){return e.plugin},get view(){return e.view},get closed(){return i()},set closed(T){i(T)}}),V(_),sn(3,_,()=>Nn,()=>({duration:150})),fe(x,_)};Fe(k,x=>{i()[I(c).path]||x(v)})}V(g),Ue(()=>{w=wt(g,1,"tree-item nav-folder",null,w,{"is-collapsed":i()[I(c).path]}),ke(y,"data-tooltip-position",I(n)),ke(y,"aria-label",I(c).vaultPath),S=wt(b,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,S,{"is-collapsed":i()[I(c).path]}),ze(A,I(c).title)}),we("click",y,x=>s(x,I(c))),fe(p,g)};Fe(f,p=>{I(c).data?p(d):p(h,-1)})}fe(l,u)}),V(a),Ue(()=>o=wt(a,1,"svelte-d9h7mp",null,o,{topLevel:r()})),fe(t,a),ut()}Pt(["click"]);var HU=xe('
'),UU=xe('
'),GU=xe('
'),jU=xe(''),VU=xe('
'),zU={hash:"svelte-1edsiy5",code:""};function J0(t,e){ct(e,!0),an(t,zU);let r=ft(()=>({title:"",path:"",vaultPath:"",children:e.plugin.gitManager.getTreeStructure(e.log.diff.files)})),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left"),n=Ne(!0),s=Ne(Je({}));function a(x){let _=x.author.name;if(e.plugin.settings.authorInHistoryView=="full")return _;if(e.plugin.settings.authorInHistoryView=="initials")return _.split(" ").filter(T=>T.length>0).map(T=>T[0].toUpperCase()).join("")}var o=VU(),l=W(o);let c;var u=W(l),f=W(u);let d;var h=ne(f,2),p=W(h);{var g=x=>{var _=HU(),P=W(_,!0);V(_),Ue(T=>ze(P,T),[()=>e.log.refs.join(", ")]),fe(x,_)};Fe(p,x=>{e.log.refs.length>0&&x(g)})}var w=ne(p,2);{var y=x=>{var _=UU(),P=W(_,!0);V(_),Ue(T=>ze(P,T),[()=>a(e.log)]),fe(x,_)};Fe(w,x=>{var _;e.plugin.settings.authorInHistoryView!="hide"&&((_=e.log.author)!=null&&_.name)&&x(y)})}var b=ne(w,2);{var S=x=>{var _=GU(),P=W(_,!0);V(_),Ue(T=>ze(P,T),[()=>(0,Q0.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)]),fe(x,_)};Fe(b,x=>{e.plugin.settings.dateInHistoryView&&x(S)})}var C=ne(b,2),A=W(C,!0);V(C),V(h),V(u);var k=ne(u,2);{var v=x=>{var _=jU(),P=W(_);{var T=$=>{vf($,{get hierarchy(){return I(r)},get plugin(){return e.plugin},get view(){return e.view},topLevel:!0,get closed(){return I(s)},set closed(D){oe(s,D,!0)}})},M=$=>{var D=oo(),Q=Mi(D);hi(Q,17,()=>e.log.diff.files,di,(ye,de)=>{gf(ye,{get view(){return e.view},get diff(){return I(de)}})}),fe($,D)};Fe(P,$=>{e.showTree?$(T):$(M,-1)})}V(_),sn(3,_,()=>Nn,()=>({duration:150})),fe(x,_)};Fe(k,x=>{I(n)||x(v)})}V(l),V(o),Ue(x=>{c=wt(l,1,"tree-item nav-folder",null,c,{"is-collapsed":I(n)}),ke(u,"aria-label",x),ke(u,"data-tooltip-position",I(i)),d=wt(f,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,d,{"is-collapsed":I(n)}),ze(A,e.log.message)},[()=>{var x;return`${e.log.refs.length>0?e.log.refs.join(", ")+` +`:""}${(x=e.log.author)==null?void 0:x.name} +${(0,Q0.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)} +${e.log.message}`}]),we("click",u,()=>oe(n,!I(n))),fe(t,o),ut()}Pt(["click"]);var WU=xe(''),qU=xe('
'),YU={hash:"svelte-12n6twc",code:""};function tb(t,e){ct(e,!0),an(t,YU);let r=Di(e,"plugin",15),i=Ne(!1),n=Je([]),s=Ne(void 0),a=Ne(Je(r().settings.treeStructure)),o;mr(()=>{o&&o.empty()}),co(()=>{e.view.registerEvent(e.view.app.workspace.on("obsidian-git:head-change",()=>{c().catch(console.error)}))}),mr(()=>{n.forEach(C=>(0,eb.setIcon)(C,C.getAttr("data-icon")))}),co(()=>{let C=new IntersectionObserver(k=>{k[0].isIntersecting&&!I(i)&&u().catch(console.error)}),A=activeDocument.querySelector("#sentinel");return A&&C.observe(A),()=>{C.disconnect()}}),c().catch(console.error);function l(){c().catch(console.error)}function c(){return uo(this,void 0,void 0,function*(){var C;if(!r().gitReady){oe(s,void 0);return}oe(i,!0);let A=r().gitManager instanceof Ce,k;((C=I(s)===null||I(s)===void 0?void 0:I(s).length)!==null&&C!==void 0?C:0)==0?k=A?50:10:k=I(s).length,oe(s,yield r().gitManager.log(void 0,!1,k),!0),oe(i,!1)})}function u(){return uo(this,void 0,void 0,function*(){var C;if(!r().gitReady||I(s)===void 0)return;oe(i,!0);let k=r().gitManager instanceof Ce?50:10,v=yield r().gitManager.log(void 0,!1,k,(C=I(s).last())===null||C===void 0?void 0:C.hash);I(s).push(...v.slice(1)),oe(i,!1)})}var f=qU(),d=W(f),h=W(d),p=W(h);ot(p,C=>n[0]=C,()=>n==null?void 0:n[0]);var g=ne(p,2);let w;ot(g,C=>n[1]=C,()=>n==null?void 0:n[1]),V(h),V(d);var y=ne(d,2),b=W(y);{var S=C=>{var A=WU();hi(A,21,()=>I(s),di,(k,v)=>{J0(k,{get view(){return e.view},get showTree(){return I(a)},get log(){return I(v)},get plugin(){return r()}})}),V(A),fe(C,A)};Fe(b,C=>{I(s)&&C(S)})}Va(4),V(y),V(f),Ue(()=>{ke(p,"data-icon",I(a)?"list":"folder"),w=wt(g,1,"clickable-icon nav-action-button",null,w,{loading:I(i)})}),we("click",p,()=>{oe(a,!I(a)),(0,eb.setIcon)(n[0],I(a)?"list":"folder"),r(r().settings.treeStructure=I(a),!0),r().saveSettings()}),we("click",g,l),fe(t,f),ut()}Pt(["click"]);var wf=class extends rF.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return bi.type}getDisplayText(){return bi.name}getIcon(){return bi.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=Js(tb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};m();var iF=require("obsidian"),Fp=class extends iF.FuzzySuggestModal{constructor(r,i){super(r.app);this.branches=i;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,i){this.resolve(r)}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>window.setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};m();var aF=require("obsidian");m();var po=require("obsidian");m();var bf=require("obsidian");m();var nF=require("obsidian");var pc=class extends nF.Modal{constructor({app:r,path:i,filesToDeleteCount:n,filesToDiscardCount:s}){super(r);this.resolve=null;this.path=i,this.deleteCount=n,this.discardCount=s}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:i,titleEl:n}=this,s="";this.path!=""&&(r>1?s=`files in "${this.path}"`:s=`"${this.path}"`),n.setText(`${this.discardCount==0?"Delete":"Discard"} ${s}`),this.deleteCount>0&&i.createEl("p").setText(`Are you sure you want to DELETE the ${gu(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&i.createEl("p").setText(`Are you sure you want to discard ALL changes in ${gu(this.discardCount,"tracked file")}?`);let a=i.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${gu(r,"file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("delete"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("delete"),this.close()})}if(this.discardCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`Discard all ${gu(this.discardCount,"tracked file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("discard"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("discard"),this.close()})}let o=a.createEl("button",{text:"Cancel"});o.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),o.addEventListener("keypress",()=>(this.resolve&&this.resolve(!1),this.close()))}onClose(){let{contentEl:r}=this;r.empty()}};var ZU=xe('
'),KU=xe('
');function _f(t,e){ct(e,!0);let r=Je([]),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");mr(()=>{for(let v of r)v&&(0,bf.setIcon)(v,v.getAttr("data-icon"))});function n(v){v.stopPropagation(),al(e.change.path)?a(v):l(v)}function s(v){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&ll(e.view.app,v,e.view,e.change.vaultPath)}function a(v){var x;v.stopPropagation();let _=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);_ instanceof bf.TFile&&((x=ji(e.view.app,v))===null||x===void 0||x.openFile(_).catch(P=>e.view.plugin.displayError(P)))}function o(v){v.stopPropagation(),e.manager.stage(e.change.path,!1).catch(x=>e.view.plugin.displayError(x)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function l(v){v.stopPropagation(),e.view.plugin.tools.openDiff({aFile:e.change.path,aRef:"",event:v})}function c(v){v.stopPropagation();let x=e.change.workingDir=="U";new pc({app:e.view.app,filesToDeleteCount:x?1:0,filesToDiscardCount:x?0:1,path:e.change.vaultPath}).openAndGetResult().then(_=>uo(this,void 0,void 0,function*(){if(_=="delete"){let P=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);P instanceof bf.TFile?yield e.view.app.fileManager.trashFile(P):yield e.view.app.vault.adapter.remove(e.change.vaultPath)}else _=="discard"&&(yield e.manager.discard(e.change.path).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")}));e.view.app.workspace.trigger("obsidian-git:refresh")}),_=>e.view.plugin.displayError(_))}var u=KU(),f=W(u),d=W(f),h=W(d,!0);V(d);var p=ne(d,2),g=W(p),w=W(g);{var y=v=>{var x=ZU();ot(x,_=>r[0]=_,()=>r==null?void 0:r[0]),ui("auxclick",x,a),we("click",x,a),fe(v,x)},b=ft(()=>ol(e.change.vaultPath,e.view.app));Fe(w,v=>{I(b)&&v(y)})}var S=ne(w,2);ot(S,v=>r[1]=v,()=>r==null?void 0:r[1]);var C=ne(S,2);ot(C,v=>r[2]=v,()=>r==null?void 0:r[2]),V(g);var A=ne(g,2),k=W(A,!0);V(A),V(p),V(f),V(u),Ue(v=>{ke(f,"data-path",e.change.vaultPath),ke(f,"data-tooltip-position",I(i)),ke(f,"aria-label",e.change.vaultPath),ze(h,v),ke(A,"data-type",e.change.workingDir),ze(k,e.change.workingDir)},[()=>_n(e.change.vaultPath)]),we("mouseover",u,s),we("click",u,n),ui("auxclick",u,v=>{v.stopPropagation(),v.button==2?bn(e.view.app,v,e.change.vaultPath,e.view.leaf,"git-source-control"):n(v)}),we("click",S,c),we("click",C,o),fe(t,u),ut()}Pt(["mouseover","click"]);m();var sF=require("obsidian");var XU=xe('
');function yf(t,e){ct(e,!0);let r=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function i(d){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&ll(e.view.app,d,e.view,e.change.vaultPath)}function n(d){var h;d.stopPropagation();let p=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);p instanceof sF.TFile&&((h=ji(e.view.app,d))===null||h===void 0||h.openFile(p).catch(g=>e.view.plugin.displayError(g)))}var s=XU(),a=W(s),o=W(a),l=W(o,!0);V(o);var c=ne(o,2),u=W(c),f=W(u,!0);V(u),V(c),V(a),V(s),Ue(d=>{ke(a,"data-path",e.change.vaultPath),ke(a,"data-tooltip-position",I(r)),ke(a,"aria-label",e.change.vaultPath),ze(l,d),ke(u,"data-type",e.change.workingDir),ze(f,e.change.workingDir)},[()=>_n(e.change.vaultPath)]),we("mouseover",s,i),we("click",s,n),ui("auxclick",s,d=>{d.stopPropagation(),d.button==2?bn(e.view.app,d,e.change.vaultPath,e.view.leaf,"git-source-control"):n(d)}),fe(t,s),ut()}Pt(["mouseover","click"]);m();var Ip=require("obsidian");var QU=xe('
'),JU=xe('
');function xf(t,e){ct(e,!0);let r=Je([]),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");mr(()=>{for(let A of r)A&&(0,Ip.setIcon)(A,A.getAttr("data-icon"))});function n(A){A.stopPropagation(),al(e.change.path)?a(A):o(A)}function s(A){e.view.app.vault.getFileByPath(e.change.vaultPath)&&ll(e.view.app,A,e.view,e.change.vaultPath)}function a(A){var k;A.stopPropagation();let v=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);v instanceof Ip.TFile&&((k=ji(e.view.app,A))===null||k===void 0||k.openFile(v).catch(x=>e.view.plugin.displayError(x)))}function o(A){var k;A.stopPropagation(),e.view.plugin.tools.openDiff({aFile:(k=e.change.from)!==null&&k!==void 0?k:e.change.path,bFile:e.change.path,aRef:"HEAD",bRef:"",event:A})}function l(A){A.stopPropagation(),e.manager.unstage(e.change.path,!1).catch(k=>e.view.plugin.displayError(k)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}var c=JU(),u=W(c),f=W(u),d=W(f,!0);V(f);var h=ne(f,2),p=W(h),g=W(p);{var w=A=>{var k=QU();ot(k,v=>r[0]=v,()=>r==null?void 0:r[0]),we("click",k,a),fe(A,k)},y=ft(()=>ol(e.change.vaultPath,e.view.app));Fe(g,A=>{I(y)&&A(w)})}var b=ne(g,2);ot(b,A=>r[1]=A,()=>r==null?void 0:r[1]),V(p);var S=ne(p,2),C=W(S,!0);V(S),V(h),V(u),V(c),Ue(A=>{ke(u,"data-path",e.change.vaultPath),ke(u,"data-tooltip-position",I(i)),ke(u,"aria-label",e.change.vaultPath),ze(d,A),ke(S,"data-type",e.change.index),ze(C,e.change.index)},[()=>_n(e.change.vaultPath)]),we("mouseover",c,s),we("click",c,n),ui("auxclick",c,A=>{A.stopPropagation(),A.button==2?bn(e.view.app,A,e.change.vaultPath,e.view.leaf,"git-source-control"):n(A)}),we("click",b,l),fe(t,c),ut()}Pt(["mouseover","click"]);m();m();var eG=xe(''),tG=xe("
");function fo(t,e){ct(e,!0);var r=tG(),i=W(r);{var n=s=>{var a=eG(),o=W(a),l=W(o),c=W(l,!0);V(l),V(o),V(a),Ue(()=>{ke(o,"aria-label","And "+(e.files.length-500)+" more files"),ze(c,"And "+(e.files.length-500)+" more files")}),fe(s,a)};Fe(i,s=>{e.files.length>500&&s(n)})}V(r),fe(t,r),ut()}var iG=xe("
"),nG=xe('
'),sG=xe('
',1),aG=xe(''),oG=xe('
'),lG=xe("
");function ho(t,e){ct(e,!0);let r=Di(e,"topLevel",3,!1),i=Di(e,"closed",15);co(()=>{var h,p;for(let g of e.hierarchy.children)((p=(h=g.children)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)>100&&i(i()[g.title]=!0,!0)});let n=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(h,p){h.stopPropagation(),e.plugin.gitManager.stageAll({dir:p}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function a(h,p){h.stopPropagation(),e.plugin.gitManager.unstageAll({dir:p}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function o(h,p){h.stopPropagation(),e.plugin.discardAll(p.vaultPath)}function l(h,p){h.stopPropagation(),i(i()[p.path]=!i()[p.path],!0)}var c=lG();let u;var f=W(c);hi(f,17,()=>vu(e.hierarchy.children,500),di,(h,p)=>{var g=oo(),w=Mi(g);{var y=S=>{var C=iG(),A=W(C);{var k=_=>{xf(_,{get change(){return I(p).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},v=_=>{_f(_,{get change(){return I(p).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},x=_=>{yf(_,{get change(){return I(p).data},get view(){return e.view}})};Fe(A,_=>{e.fileType==0?_(k):e.fileType==1?_(v,1):e.fileType==2&&_(x,2)})}V(C),fe(S,C)},b=S=>{var C=oG();let A;var k=W(C),v=ne(W(k),2);let x;var _=ne(v,2),P=W(_,!0);V(_);var T=ne(_,2),M=W(T),$=W(M);{var D=J=>{var X=nG();we("click",X,he=>a(he,I(p).path)),fe(J,X)},Q=J=>{var X=sG(),he=Mi(X),z=ne(he,2);we("click",he,K=>o(K,I(p))),we("click",z,K=>s(K,I(p).path)),fe(J,X)};Fe($,J=>{e.fileType==0?J(D):J(Q,-1)})}Va(2),V(M),V(T),V(k);var ye=ne(k,2);{var de=J=>{var X=aG(),he=W(X);ho(he,{get hierarchy(){return I(p)},get plugin(){return e.plugin},get view(){return e.view},get fileType(){return e.fileType},get closed(){return i()},set closed(z){i(z)}}),V(X),sn(3,X,()=>Nn,()=>({duration:150})),fe(J,X)};Fe(ye,J=>{i()[I(p).path]||J(de)})}V(C),Ue(()=>{A=wt(C,1,"tree-item nav-folder",null,A,{"is-collapsed":i()[I(p).path]}),ke(k,"data-tooltip-position",I(n)),ke(k,"aria-label",I(p).vaultPath),x=wt(v,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,x,{"is-collapsed":i()[I(p).path]}),ze(P,I(p).title)}),ui("auxclick",C,J=>bn(e.view.app,J,I(p).vaultPath,e.view.leaf,"git-source-control")),we("click",k,J=>l(J,I(p))),fe(S,C)};Fe(w,S=>{I(p).data?S(y):S(b,-1)})}fe(h,g)});var d=ne(f,2);fo(d,{get files(){return e.hierarchy.children}}),V(c),Ue(()=>u=wt(c,1,"",null,u,{topLevel:r()})),fe(t,c),ut()}Pt(["click"]);var cG=xe('
'),rb=xe(" ",1),ib=xe(''),uG=xe('
'),fG=xe(''),dG=xe('
'),hG={hash:"svelte-5wq9p",code:`.commit-msg-input.svelte-5wq9p {width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field);}.git-commit-msg.svelte-5wq9p {position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto;}main.svelte-5wq9p .git-tools:where(.svelte-5wq9p) .files-count:where(.svelte-5wq9p) {padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center;}.nav-folder-title.svelte-5wq9p {align-items:center;}.git-commit-msg-clear-button.svelte-5wq9p {position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:-4px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out;}.git-commit-msg-clear-button.svelte-5wq9p:after {content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;mask-image:url("data:image/svg+xml,");mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat;}`};function nb(t,e){ct(e,!0),an(t,hG);let r=Di(e,"plugin",7),i=Di(e,"view",7),n=Ne(!1),s=Ne(void 0),a=Ne(Je([])),o=ft(()=>r().settings.commitMessage),l=Je([]),c=Ne(void 0),u=Ne(void 0),f=Ne(void 0),d=Ne(!0),h=Ne(!0),p=Ne(!0),g=Ne(0),w=Ne(Je({})),y=Ne(Je({})),b=Ne(Je({})),S=ft(()=>r().settings.treeStructure);co(()=>{i().registerEvent(i().app.workspace.on("obsidian-git:loading-status",()=>oe(n,!0))),i().registerEvent(i().app.workspace.on("obsidian-git:status-changed",()=>{k().catch(console.error)})),i().plugin.cachedStatus==null?i().plugin.refresh().catch(console.error):k().catch(console.error),i().scope=new po.Scope(r().app.scope),i().scope.register(["Ctrl"],"Enter",N=>A())}),mr(()=>{l.forEach(N=>(0,po.setIcon)(N,N.getAttr("data-icon")))}),mr(()=>{l.forEach(N=>{var ue,Re;!N||N.id!="push"||(po.Platform.isMobile?(N.removeClass("button-border"),I(g)>0&&N.addClass("button-border")):((ue=N.firstElementChild)===null||ue===void 0||ue.removeAttribute("color"),I(g)>0&&((Re=N.firstElementChild)===null||Re===void 0||Re.setAttr("color","var(--text-accent)"))))})});function C(){if(oe(n,!0),I(s)){let N=I(s).staged.length>0;r().promiseQueue.addTask(()=>r().commit({fromAuto:!1,commitMessage:I(o),onlyStaged:N}).then(()=>oe(o,r().settings.commitMessage)).finally(v))}}function A(){if(oe(n,!0),I(s)){let N=I(s).staged.length>0;r().promiseQueue.addTask(()=>r().commitAndSync({fromAutoBackup:!1,commitMessage:I(o),onlyStaged:N}).then(()=>{oe(o,r().settings.commitMessage)}).finally(v))}}function k(){return uo(this,void 0,void 0,function*(){if(!r().gitReady){oe(s,void 0);return}if(oe(g,yield r().gitManager.getUnpushedCommits(),!0),oe(s,r().cachedStatus,!0),oe(n,!1),r().lastPulledFiles&&r().lastPulledFiles!=I(a)&&(oe(a,r().lastPulledFiles,!0),oe(f,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(I(a))},!0)),I(s)){let N=(ue,Re)=>ue.vaultPath.split("/").last().localeCompare(_n(Re.vaultPath));I(s).changed.sort(N),I(s).staged.sort(N),oe(c,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(I(s).changed)},!0),oe(u,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(I(s).staged)},!0)}else oe(c,void 0),oe(u,void 0)})}function v(){i().app.workspace.trigger("obsidian-git:refresh")}function x(N){N.stopPropagation(),oe(n,!0),r().promiseQueue.addTask(()=>r().gitManager.stageAll({status:I(s)}).finally(v))}function _(N){N.stopPropagation(),oe(n,!0),r().promiseQueue.addTask(()=>r().gitManager.unstageAll({status:I(s)}).finally(v))}function P(){oe(n,!0),r().promiseQueue.addTask(()=>r().push().finally(v))}function T(){oe(n,!0),r().promiseQueue.addTask(()=>r().pullChangesFromRemote().finally(v))}function M(N){N.stopPropagation(),r().discardAll()}let $=ft(()=>(I(o).match(/\n/g)||[]).length+1||1);var D=dG(),Q=W(D),ye=W(Q),de=W(ye);ot(de,N=>l[0]=N,()=>l==null?void 0:l[0]);var J=ne(de,2);ot(J,N=>l[1]=N,()=>l==null?void 0:l[1]);var X=ne(J,2);ot(X,N=>l[2]=N,()=>l==null?void 0:l[2]);var he=ne(X,2);ot(he,N=>l[3]=N,()=>l==null?void 0:l[3]);var z=ne(he,2);ot(z,N=>l[4]=N,()=>l==null?void 0:l[4]);var K=ne(z,2);ot(K,N=>l[5]=N,()=>l==null?void 0:l[5]);var G=ne(K,2);ot(G,N=>l[6]=N,()=>l==null?void 0:l[6]);var Me=ne(G,2);let Et;ot(Me,N=>l[7]=N,()=>l==null?void 0:l[7]),V(ye),V(Q);var Ht=ne(Q,2),De=W(Ht);P0(De);var Rt=ne(De,2);{var $t=N=>{var ue=cG();ke(ue,"aria-label","Clear"),we("click",ue,()=>oe(o,"")),fe(N,ue)};Fe(Rt,N=>{I(o)&&N($t)})}V(Ht);var Xe=ne(Ht,2),re=W(Xe);{var B=N=>{var ue=fG(),Re=W(ue);let Ut;var Pr=W(Re),vo=W(Pr);let cb;var ub=ne(vo,4),Wp=W(ub),fb=W(Wp);ot(fb,gr=>l[8]=gr,()=>l==null?void 0:l[8]),V(Wp);var db=ne(Wp,2),mF=W(db,!0);V(db),V(ub),V(Pr);var gF=ne(Pr,2);{var vF=gr=>{var Rr=ib(),wo=W(Rr);{var ms=vr=>{ho(vr,{get hierarchy(){return I(u)},get plugin(){return r()},get view(){return i()},get fileType(){return 0},topLevel:!0,get closed(){return I(w)},set closed(Li){oe(w,Li,!0)}})},bo=vr=>{var Li=rb(),ta=Mi(Li);hi(ta,17,()=>vu(I(s).staged,500),di,(gs,gc)=>{xf(gs,{get change(){return I(gc)},get view(){return i()},get manager(){return r().gitManager}})});var ra=ne(ta,2);fo(ra,{get files(){return I(s).staged}}),fe(vr,Li)};Fe(wo,vr=>{I(S)?vr(ms):vr(bo,-1)})}V(Rr),sn(3,Rr,()=>Nn,()=>({duration:150})),fe(gr,Rr)};Fe(gF,gr=>{I(h)&&gr(vF)})}V(Re);var Sf=ne(Re,2);let hb;var kf=W(Sf),pb=W(kf);let mb;var gb=ne(pb,4),qp=W(gb),vb=W(qp),wb=ne(vb,2);ot(wb,gr=>l[9]=gr,()=>l==null?void 0:l[9]),V(qp);var bb=ne(qp,2),wF=W(bb,!0);V(bb),V(gb),V(kf);var bF=ne(kf,2);{var _F=gr=>{var Rr=ib(),wo=W(Rr);{var ms=vr=>{ho(vr,{get hierarchy(){return I(c)},get plugin(){return r()},get view(){return i()},get fileType(){return 1},topLevel:!0,get closed(){return I(y)},set closed(Li){oe(y,Li,!0)}})},bo=vr=>{var Li=rb(),ta=Mi(Li);hi(ta,17,()=>vu(I(s).changed,500),di,(gs,gc)=>{_f(gs,{get change(){return I(gc)},get view(){return i()},get manager(){return r().gitManager}})});var ra=ne(ta,2);fo(ra,{get files(){return I(s).changed}}),fe(vr,Li)};Fe(wo,vr=>{I(S)?vr(ms):vr(bo,-1)})}V(Rr),sn(3,Rr,()=>Nn,()=>({duration:150})),fe(gr,Rr)};Fe(bF,gr=>{I(d)&&gr(_F)})}V(Sf);var yF=ne(Sf,2);{var xF=gr=>{var Rr=uG();let wo;var ms=W(Rr),bo=ne(W(ms),4),vr=W(bo,!0);V(bo),V(ms);var Li=ne(ms,2);{var ta=ra=>{var gs=ib(),gc=W(gs);{var EF=_o=>{ho(_o,{get hierarchy(){return I(f)},get plugin(){return r()},get view(){return i()},get fileType(){return 2},topLevel:!0,get closed(){return I(b)},set closed(Af){oe(b,Af,!0)}})},SF=_o=>{var Af=rb(),_b=Mi(Af);hi(_b,17,()=>I(a),di,(AF,CF)=>{yf(AF,{get change(){return I(CF)},get view(){return i()}})});var kF=ne(_b,2);fo(kF,{get files(){return I(a)}}),fe(_o,Af)};Fe(gc,_o=>{I(S)?_o(EF):_o(SF,-1)})}V(gs),sn(3,gs,()=>Nn,()=>({duration:150})),fe(ra,gs)};Fe(Li,ra=>{I(p)&&ra(ta)})}V(Rr),Ue(()=>{wo=wt(Rr,1,"pulled nav-folder",null,wo,{"is-collapsed":!I(p)}),ze(vr,I(a).length)}),we("click",ms,()=>oe(p,!I(p))),fe(gr,Rr)};Fe(yF,gr=>{I(a).length>0&&I(f)&&gr(xF)})}V(ue),Ue(()=>{Ut=wt(Re,1,"staged tree-item nav-folder",null,Ut,{"is-collapsed":!I(h)}),cb=wt(vo,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,cb,{"is-collapsed":!I(h)}),ze(mF,I(s).staged.length),hb=wt(Sf,1,"changes tree-item nav-folder",null,hb,{"is-collapsed":!I(d)}),mb=wt(pb,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,mb,{"is-collapsed":!I(d)}),ze(wF,I(s).changed.length)}),we("click",Pr,()=>oe(h,!I(h))),we("click",fb,_),we("click",kf,()=>oe(d,!I(d))),we("click",vb,M),we("click",wb,x),fe(N,ue)};Fe(re,N=>{I(s)&&I(u)&&I(c)&&N(B)})}V(Xe),V(D),Ue(()=>{ke(D,"data-type",Qt.type),ke(G,"data-icon",I(S)?"list":"folder"),Et=wt(Me,1,"clickable-icon nav-action-button",null,Et,{loading:I(n)}),ke(De,"rows",I($))}),we("click",de,A),we("click",J,C),we("click",X,x),we("click",he,_),we("click",z,P),we("click",K,T),we("click",G,()=>{oe(S,!I(S)),(0,po.setIcon)(l[6],I(S)?"list":"folder"),r().settings.treeStructure=I(S),r().saveSettings()}),we("click",Me,v),W0(De,()=>I(o),N=>oe(o,N)),fe(t,D),ut()}Pt(["click"]);var Ef=class extends aF.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return Qt.type}getDisplayText(){return Qt.name}getIcon(){return Qt.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=Js(nb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};m();var Mp=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.statusBarEl.addClass("mod-clickable"),this.statusBarEl.onClickEvent(i=>{this.plugin.switchBranch().catch(n=>r.displayError(n))})}async display(){if(this.plugin.gitReady){let e=await this.plugin.gitManager.branchInfo();e.current!=null?this.statusBarEl.setText(e.current):this.statusBarEl.empty()}else this.statusBarEl.empty()}remove(){this.statusBarEl.remove()}};m();var oF=require("obsidian");var Dp=class{constructor(e){this.plugin=e}get editor(){var i;let e=(i=this.plugin.app.workspace.activeEditor)==null?void 0:i.editor,r=e==null?void 0:e.cm;if(!(!e||!zi.hasHunksData(r.state)))return{editor:r,obEditor:e}}get gitManager(){return this.plugin.gitManager}resetHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=zi.getHunk(r.state,!1,e);if(n){let s,a;n.type==="delete"?(s=n.added.start+1,a=n.added.start+1):(s=n.added.start-0,a=n.added.start-1+n.added.count);let o=r.state.doc.line(s).from,l=n.type==="delete"?r.state.doc.line(a).from:r.state.doc.line(a).to+1,c=n.removed.lines.join(` +`);n.removed.lines.length>0&&!n.removed.no_nl_at_eof&&(c+=` +`),i.replaceRange(c,i.offsetToPos(o),i.offsetToPos(l)),i.setSelection(i.offsetToPos(o))}}async stageHunk(e){if(!await this.plugin.isAllInitialized()||!this.editor)return;let{editor:r}=this.editor,i=zi.getHunk(r.state,!1,e),n=!1;if(i||(i=zi.getHunk(r.state,!0,e),n=!0),!i)return;let s=r.state.field(oF.editorInfoField).file.path,a=Wt.createPatch(s,[i],"100644",n).join(` +`)+` +`;await this.gitManager.applyPatch(a),this.plugin.app.workspace.trigger("obsidian-git:refresh")}goToHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=zi.getHunks(r.state,!1),s=i.getCursor().line+1,a=Wt.findNearestHunk(s,n,e,!0);if(a==null)return;let o=n[a];if(o){let l=o.added.start-1;i.setCursor(l,0),i.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};m();m();var mo=require("obsidian");var Op=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof mo.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),A2(()=>this.plg.settings.lineAuthor,e=>{this.plg.settings.lineAuthor=e,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;O2(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new gh(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(e){console.warn("Git: Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&mo.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Ce?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(Y2),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.headChangeEvent=this.createHeadChangeEvent(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),$2(),this.plg.registerEvent(this.gutterContextMenuEvent),this.plg.registerEvent(this.refreshOnCssChangeEvent),this.plg.registerEvent(this.fileOpenEvent),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileModificationEvent),this.plg.registerEvent(this.headChangeEvent),this.plg.registerEvent(this.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.gutterContextMenuEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.vault.offref(this.fileModificationEvent),this.plg.app.workspace.offref(this.headChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var r;(r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e).catch(console.error)})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return e instanceof mo.TFile&&((i=this.lineAuthorInfoProvider)==null?void 0:i.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var r;return e instanceof mo.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e))})}createHeadChangeEvent(){return this.plg.app.workspace.on("obsidian-git:head-change",()=>{this.refreshLineAuthorViews()})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",M2)}};m();var mc=require("obsidian");m();m();var go=require("@codemirror/state"),Np=require("@codemirror/view");var Lp=class extends Np.GutterMarker{constructor(r,i){super();this.type=r;this.staged=i}toDOM(r){let i=createDiv();return i.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&i.setText("~"),i}},sb=go.StateField.define({create:()=>go.RangeSet.empty,update:(t,e)=>{let r=e.state.field(Ur,!1);if(!r)return go.RangeSet.empty;let i=e.effects.some(s=>s.is(Ou)),n=e.effects.some(s=>s.is($l));if(i||n||(e.docChanged||t.size==0)&&r.isDirty==!1){let s=new Set,a=lF(e,r.hunks,!1,s),o=lF(e,r.stagedHunks,!0,s);return t=go.RangeSet.of([...a,...o],!0),t}else e.docChanged&&(t=t.map(e.changes));return t}});function lF(t,e,r,i){let n=[];for(let a=0;a0?e[a-1]:void 0,l=a{var e;return(e=t.state.field(sb,!1))!=null?e:go.RangeSet.empty},initialSpacer:t=>new Lp("delete",!1),domEventHandlers:{click:(t,e,r)=>{var n;return((n=zi.getHunkAtPos(t.state,e.from,!1))!=null?n:zi.getHunkAtPos(t.state,e.from,!0))&&(Vs(t,e.from),r.preventDefault()),!1}}});var Bp=class{constructor(e){this.plugin=e}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeSigns(e.path)}}destroy(){}async computeSigns(e){let i=await this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager.show("",e).catch(()=>{});this.notifySignComputationResultToSubscribers(e,{compareText:i,compareTextHead:void 0})}notifySignComputationResultToSubscribers(e,r){Kn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyGitCompare(r)))}},uF=[uR,fR,cF,sb,Gh],fF=[Ur,Cw];m();var ab=require("obsidian"),Hp=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;e.addClass("git-changes-status-bar"),r.settings.hunks.statusBar==="colored"&&e.addClass("git-changes-status-bar-colored"),e.setAttr("aria-label","Git diff of the current editor"),this.statusBarEl.setAttribute("data-tooltip-position","top"),r.app.workspace.on("active-leaf-change",i=>{(!i||i.getRoot()==r.app.workspace.rootSplit&&!(i.view instanceof ab.MarkdownView))&&this.statusBarEl.empty()})}display(e,r){var o;let i=this.plugin.app.workspace.getActiveViewOfType(ab.MarkdownView);if(!i||((o=i.file)==null?void 0:o.path)!==(r==null?void 0:r.path))return;let n=0,s=0,a=0;for(let l of e)n+=Math.max(0,l.added.count-l.removed.count),s+=Math.min(l.added.count,l.removed.count),a+=Math.max(0,l.removed.count-l.added.count);this.statusBarEl.empty(),n>0&&this.statusBarEl.createSpan({text:`+${n} `,cls:"git-add"}),s>0&&this.statusBarEl.createSpan({text:`~${s} `,cls:"git-change"}),a>0&&this.statusBarEl.createSpan({text:`-${a}`,cls:"git-delete"})}remove(){this.statusBarEl.remove()}};var Up=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.signsProvider){console.warn("Git: undefined signsProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof mc.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.signsProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions)}conditionallyActivateBySettings(){(this.plg.settings.hunks.showSigns||this.plg.settings.hunks.statusBar!="disabled"||this.plg.settings.hunks.hunkCommands)&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;if(this.signsProvider=new Bp(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),this.plg.settings.hunks.statusBar!="disabled"){let e=this.plg.addStatusBarItem();this.changeStatusBar=new Hp(e,this.plg)}}catch(e){console.warn("Git: Error while loading signs feature.",e),this.deactivateFeature()}}deactivateFeature(){var e,r;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.signsProvider)==null||e.destroy(),this.signsProvider=void 0,(r=this.changeStatusBar)==null||r.remove(),this.changeStatusBar=void 0}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&mc.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Ce?this.plg.gitManager:void 0}}refresh(){this.plg.settings.hunks.showSigns&&this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(fF),this.plg.settings.hunks.showSigns&&this.codeMirrorExtensions.push(...uF),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileRenameEvent=this.createFileRenameEvent(),this.pluginRefreshedEvent=this.createPluginRefreshedEvent(),this.intervalRefreshEvent=this.createIntervalRefreshEvent(),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileRenameEvent),this.plg.registerEvent(this.pluginRefreshedEvent),this.plg.registerInterval(this.intervalRefreshEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent),this.plg.app.workspace.offref(this.pluginRefreshedEvent),this.plg.app.workspace.offref(this.gutterContextMenuEvent),window.clearInterval(this.intervalRefreshEvent)}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return Kn.ifFilepathDefinedTransformSubscribers(r,n=>n.forEach(s=>{s.changeToNewFilepath(e.path)})),e instanceof mc.TFile&&((i=this.signsProvider)==null?void 0:i.trackChanged(e))})}createPluginRefreshedEvent(){return this.plg.app.workspace.on("obsidian-git:refresh",()=>{this.refresh()})}createIntervalRefreshEvent(){return window.setInterval(()=>{var e,r;(e=this.plg.app.workspace.activeEditor)!=null&&e.file&&((r=this.signsProvider)==null||r.trackChanged(this.plg.app.workspace.activeEditor.file).catch(console.error))},10*1e3)}};m();var dF=require("@codemirror/state"),Gp=require("obsidian");var ob=class{constructor(e){this.state=e;this.subscribeMe()}notifyLineAuthoring(e,r){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${e}`);return}let i=this.view.state,n=k2(e,r,i);this.view.dispatch(n)}notifyGitCompare(e){if(this.view===void 0){console.warn("Git: View is not defined for editor cache key. Unforeseen situation. id: ");return}if(this.removeIfStale())return;let r=this.view.state,i=r.field(Ur);if(!i||i.compareText!=e.compareText||i.compareTextHead!=e.compareTextHead){let n=HP(e,r);this.view.dispatch(n)}}updateToNewState(e){return this.state=e,!this.lastSeenPath&&this.filepath&&this.subscribeMe(),this}removeIfStale(){var e;return((e=this.view)==null?void 0:e.state.field(lb,!1))!=this||this.view.destroyed?(this.unsubscribeMe(this.lastSeenPath),!0):!1}changeToNewFilepath(e){this.unsubscribeMe(this.lastSeenPath),this.subscribeMe(e)}subscribeMe(e){e!=null||(e=this.filepath),e!==void 0&&(Kn.ifFilepathDefinedTransformSubscribers(e,r=>r.add(this)),this.lastSeenPath=e)}unsubscribeMe(e){Kn.ifFilepathDefinedTransformSubscribers(e,r=>r.delete(this))}get filepath(){var e,r;return(r=(e=this.state.field(Gp.editorInfoField))==null?void 0:e.file)==null?void 0:r.path}get view(){return this.state.field(Gp.editorEditorField)}},lb=dF.StateField.define({create:t=>new ob(t),update:(t,e)=>t.updateToNewState(e.state),compare:(t,e)=>t===e});var jp=class{constructor(e){this.plg=e;this.lineAuthoringFeature=new Op(this.plg);this.signsFeature=new Up(this.plg)}onUnloadPlugin(){this.lineAuthoringFeature.deactivateFeature(),this.signsFeature.deactivateFeature()}onLoadPlugin(){this.plg.registerEditorExtension(lb),this.lineAuthoringFeature.onLoadPlugin(),this.signsFeature.onLoadPlugin()}onReady(){this.lineAuthoringFeature.conditionallyActivateBySettings(),this.signsFeature.conditionallyActivateBySettings()}activateLineAuthoring(){this.lineAuthoringFeature.activateFeature()}deactiveLineAuthoring(){this.lineAuthoringFeature.deactivateFeature()}refreshSignsSettings(){let e=this.plg.settings.hunks;e.showSigns||e.statusBar!="disabled"||e.hunkCommands?(this.signsFeature.deactivateFeature(),this.signsFeature.activateFeature()):this.signsFeature.deactivateFeature()}};var Vp=class extends Se.Plugin{constructor(){super(...arguments);this.automaticsManager=new $u(this);this.tools=new Vu(this);this.localStorage=new jh(this);this.state={gitAction:0,offlineMode:!1};this.gitReady=!1;this.promiseQueue=new Cd(this);this.intervalsToClear=[];this.editorIntegration=new jp(this);this.hunkActions=new Dp(this)}setPluginState(r){var i;this.state=Object.assign(this.state,r),(i=this.statusBar)==null||i.display()}async updateCachedStatus(){var r,i;return this.app.workspace.trigger("obsidian-git:loading-status"),this.cachedStatus=await this.gitManager.status(),this.cachedStatus.conflicted.length>0?(this.localStorage.setConflict(!0),await((r=this.branchBar)==null?void 0:r.display())):(this.localStorage.setConflict(!1),await((i=this.branchBar)==null?void 0:i.display())),this.app.workspace.trigger("obsidian-git:status-changed",this.cachedStatus),this.cachedStatus}async refresh(){if(!this.gitReady)return;let r=this.app.workspace.getLeavesOfType(Qt.type),i=this.app.workspace.getLeavesOfType(bi.type);(this.settings.changedFilesInStatusBar||r.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)})||i.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)}))&&await this.updateCachedStatus().catch(n=>this.displayError(n)),this.app.workspace.trigger("obsidian-git:refreshed")}refreshUpdatedHead(){}async onload(){console.log("loading "+this.manifest.name+" plugin: v"+this.manifest.version),zt.plugin=this,this.localStorage.migrate(),await this.loadSettings(),await this.migrateSettings(),this.settingsTab=new vh(this.app,this),this.addSettingTab(this.settingsTab),this.localStorage.getPluginDisabled()||(this.registerStuff(),this.app.workspace.onLayoutReady(()=>this.init({fromReload:!1}).catch(r=>this.displayError(r))))}onExternalSettingsChange(){this.reloadSettings().catch(r=>this.displayError(r))}async reloadSettings(){let r=JSON.stringify(this.settings);await this.loadSettings();let i=JSON.stringify(this.settings);r!==i&&(this.log("Reloading settings"),this.unloadPlugin(),await this.init({fromReload:!0}),this.app.workspace.getLeavesOfType(Qt.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}),this.app.workspace.getLeavesOfType(bi.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}))}registerStuff(){this.registerEvent(this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(r=>this.displayError(r))})),this.registerEvent(this.app.workspace.on("obsidian-git:head-change",()=>{this.refreshUpdatedHead()})),this.registerEvent(this.app.workspace.on("file-menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"file-manu")})),this.registerEvent(this.app.workspace.on("obsidian-git:menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"obsidian-git:menu")})),this.registerEvent(this.app.workspace.on("active-leaf-change",r=>{this.onActiveLeafChange(r)})),this.registerEvent(this.app.vault.on("modify",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("delete",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("create",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("rename",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerView(Qt.type,r=>new Ef(r,this)),this.registerView(bi.type,r=>new wf(r,this)),this.registerView(Ds.type,r=>new Ha(r,this)),this.registerView(Ms.type,r=>new Ua(r,this)),this.addRibbonIcon("git-pull-request","Open Git source control",async()=>{var n;let r=this.app.workspace.getLeavesOfType(Qt.type),i;r.length===0?(i=(n=this.app.workspace.getRightLeaf(!1))!=null?n:this.app.workspace.getLeaf(),await i.setViewState({type:Qt.type})):i=r.first(),await this.app.workspace.revealLeaf(i)}),this.registerHoverLinkSource(Qt.type,{display:"Git View",defaultMod:!0}),this.editorIntegration.onLoadPlugin(),this.setRefreshDebouncer(),dR(this)}setRefreshDebouncer(){var r;(r=this.debRefresh)==null||r.cancel(),this.debRefresh=(0,Se.debounce)(()=>{this.settings.refreshSourceControl&&this.refresh().catch(console.error)},this.settings.refreshSourceControlTimer,!0)}async addFileToGitignore(r,i){let n=this.gitManager.getRelativeRepoPath(r,!0),s=mA({isFolder:i,gitRelativePath:n});await this.app.vault.adapter.append(this.gitManager.getRelativeVaultPath(".gitignore"),` +`+s),this.app.workspace.trigger("obsidian-git:refresh")}handleFileMenu(r,i,n,s){if(!this.gitReady||!this.settings.showFileMenu||!i)return;let a;if(typeof i=="string"?a=i:a=i.path,n=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof Se.TFile?await this.stageFile(i):(await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof Se.TFile?await this.unstageFile(i):(await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(l=>{this.addFileToGitignore(a,i instanceof Se.TFolder).catch(c=>this.displayError(c))})})),n=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(a,i instanceof Se.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;s==="obsidian-git:menu"&&o instanceof Se.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(a)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(pF.join(o.getBasePath(),a))})}))}}async migrateSettings(){this.settings.mergeOnPull!=null&&(this.settings.syncMethod=this.settings.mergeOnPull?"merge":"rebase",this.settings.mergeOnPull=void 0,await this.saveSettings()),this.settings.autoCommitMessage===void 0&&(this.settings.autoCommitMessage=this.settings.commitMessage,await this.saveSettings()),this.settings.gitPath!=null&&(this.localStorage.setGitPath(this.settings.gitPath),this.settings.gitPath=void 0,await this.saveSettings()),this.settings.username!=null&&(this.localStorage.setPassword(this.settings.username),this.settings.username=void 0,await this.saveSettings())}unloadPlugin(){var r,i;this.gitReady=!1,this.editorIntegration.onUnloadPlugin(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(i=this.statusBar)==null||i.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let n of this.intervalsToClear)window.clearInterval(n);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let r=await this.loadData();r==null&&(r={showedMobileNotice:!0}),this.settings=Uk(pt,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return Se.Platform.isDesktopApp}async init({fromReload:r=!1}){var i;if(this.settings.showStatusBar&&!this.statusBar){let n=this.addStatusBarItem();this.statusBar=new wh(n,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return(s=this.statusBar)==null?void 0:s.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Ce(this),await this.gitManager.setGitInstance()):this.gitManager=new Vi(this);let n=await this.gitManager.checkRequirements(),s=this.localStorage.getPausedAutomatics();switch(n){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new Se.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo.",1e4);break;case"valid":if(this.gitReady=!0,this.setPluginState({gitAction:0}),Se.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new Mp(a,this),this.intervalsToClear.push(window.setInterval(()=>{var o;(o=this.branchBar)==null?void 0:o.display().catch(console.error)},6e4))}await((i=this.branchBar)==null?void 0:i.display()),this.editorIntegration.onReady(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&!s&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),s||await this.automaticsManager.init(),s&&new Se.Notice("Automatic routines are currently paused.");break;default:this.log("Something weird happened. The 'checkRequirements' result is "+n)}}catch(n){this.displayError(n),console.error(n)}}async createNewRepo(){try{await this.gitManager.init(),new Se.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let i=await new tt(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(i){let n="Vault Root",s=await new tt(this,{options:this.gitManager instanceof Vi?[n]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.gitManager instanceof Vi}).openAndGetResult();if(s==null)return;if(s===n&&(s="."),s=(0,Se.normalizePath)(s),s==="/"&&(s="."),s==="."){let f=await new tt(this,{options:["NO","YES"],placeholder:`Does your remote repo contain a ${this.app.vault.configDir} directory at the root?`,onlySelection:!0}).openAndGetResult();if(f===void 0){new Se.Notice("Aborted clone");return}else if(f==="YES"){let d="DELETE ALL YOUR LOCAL CONFIG AND PLUGINS";if(await new tt(this,{options:["Abort clone",d],placeholder:`To avoid conflicts, the local ${this.app.vault.configDir} directory needs to be deleted.`,onlySelection:!0}).openAndGetResult()===d)await this.app.vault.adapter.rmdir(this.app.vault.configDir,!0);else{new Se.Notice("Aborted clone");return}}}let a=await new tt(this,{placeholder:"Specify depth of clone. Leave empty for full clone.",allowEmpty:!0}).openAndGetResult(),o;if(a===void 0){new Se.Notice("Aborted clone");return}if(a!==""&&(o=parseInt(a),isNaN(o))){new Se.Notice("Invalid depth. Aborting clone.");return}new Se.Notice(`Cloning new repo into "${s}"`);let l=this.settings.basePath,c=s&&s!==".";c&&(this.settings.basePath=s);try{await this.gitManager.clone(av(i),s,o),new Se.Notice("Cloned new repo."),new Se.Notice("Please restart Obsidian"),c&&await this.saveSettings()}catch(u){this.displayError(u),this.settings.basePath=l,await this.saveSettings()}}}async isAllInitialized(){return this.gitReady||await this.init({fromReload:!0}),this.gitReady}async pullChangesFromRemote(){if(!await this.isAllInitialized())return;let r=await this.pull();if(r!==!1){if(r||this.displayMessage("Pull: Everything is up-to-date"),this.gitManager instanceof Ce){let i=await this.updateCachedStatus();i.conflicted.length>0&&(this.displayError(`You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted))}this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0})}}async commitAndSync({fromAutoBackup:r,requestCustomMessage:i=!1,commitMessage:n,onlyStaged:s=!1}){!await this.isAllInitialized()||(this.settings.syncMethod=="reset"&&this.settings.pullBeforePush&&await this.pull(),!await this.commit({fromAuto:r,requestCustomMessage:i,commitMessage:n,onlyStaged:s}))||(this.settings.syncMethod!="reset"&&this.settings.pullBeforePush&&await this.pull(),this.settings.disablePush||(await this.remotesAreSet()&&await this.gitManager.canPush()?await this.push():this.displayMessage("No commits to push")),this.setPluginState({gitAction:0}))}async commit({fromAuto:r,requestCustomMessage:i=!1,onlyStaged:n=!1,commitMessage:s,amend:a=!1}){if(!await this.isAllInitialized())return!1;try{let o=this.localStorage.getConflict(),l,c=[],u=[];if(this.gitManager instanceof Ce){if(await this.mayDeleteConflictFile(),l=await this.updateCachedStatus(),l.conflicted.length==0&&(o=!1),r&&l.conflicted.length>0)return this.displayError(`Did not commit, because you have conflicts in ${l.conflicted.length} ${l.conflicted.length==1?"file":"files"}. Please resolve them and commit per command.`),await this.handleConflict(l.conflicted),!1;c=l.staged,u=l.changed}else{if(r&&o)return this.displayError("Did not commit, because you have conflicts. Please resolve them and commit per command."),!1;{o&&await this.mayDeleteConflictFile();let f=this.gitManager;n?c=await f.getStagedFiles():u=(await f.getUnstagedFiles()).map(({path:h,type:p})=>({vaultPath:this.gitManager.getRelativeVaultPath(h),path:h,type:p}))}}if(await this.tools.hasTooBigFiles(n?c:[...c,...u]))return this.setPluginState({gitAction:0}),!1;if(u.length+c.length!==0||o){let f=s!=null?s:s=r?this.settings.autoCommitMessage:this.settings.commitMessage;if(r&&this.settings.customMessageOnAutoBackup||i){!this.settings.disablePopups&&r&&new Se.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort");let p=await new bh(this).openAndGetResult();if(p!=null&&p!=""&&p!="...")f=p;else return this.setPluginState({gitAction:0}),!1}else if(this.gitManager instanceof Ce&&this.settings.commitMessageScript){let p=this.settings.commitMessageScript,g=this.localStorage.getHostname()||"",w=p.replace("{{hostname}}",g);w=w.replace("{{date}}",(0,Se.moment)().format(this.settings.commitDateFormat));let y="sh";if(Se.Platform.isWin){y=process.env.PROGRAMFILES+"\\Git\\bin\\sh.exe";let S=!1;try{await zp.access(y,zp.constants.X_OK),S=!0}catch(C){S=!1}if(!S)return this.displayError(`Cannot find sh.exe at ${y}. Please make sure Git is properly installed.`),!1}let b=await wu(y,["-c",w],{cwd:this.gitManager.absoluteRepoPath});b.code!=0?this.displayError(b.stderr):b.stdout.trim().length==0?this.displayMessage("Stdout from commit message script is empty. Using default message."):f=b.stdout}if(!f||f.trim()==="")return new Se.Notice("Commit aborted: No commit message provided"),this.setPluginState({gitAction:0}),!1;let d;n?d=await this.gitManager.commit({message:f,amend:a}):d=await this.gitManager.commitAll({message:f,status:l,unstagedFiles:u,amend:a}),this.gitManager instanceof Ce&&await this.updateCachedStatus();let h=!1;d===void 0&&(h=!0,d=u.length+c.length||0),this.displayMessage(`Committed${h?" approx.":""} ${d} ${d==1?"file":"files"}`)}else this.displayMessage("No changes to commit");return this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(o){return this.displayError(o),!1}}async push(){if(!await this.isAllInitialized()||!await this.remotesAreSet())return!1;let r=this.localStorage.getConflict();try{this.gitManager instanceof Ce&&await this.mayDeleteConflictFile();let i;if(this.gitManager instanceof Ce&&(i=await this.updateCachedStatus()).conflicted.length>0)return this.displayError(`Cannot push. You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted),!1;if(this.gitManager instanceof Vi&&r)return this.displayError("Cannot push. You have conflicts"),!1;this.log("Pushing....");let n=await this.gitManager.push();return n!==void 0&&(n===null?this.displayMessage("Pushed to remote"):n>0?this.displayMessage(`Pushed ${n} ${n==1?"file":"files"} to remote`):this.displayMessage("No commits to push")),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(i){return i instanceof nl?this.handleNoNetworkError(i):this.displayError(i),!1}}async pull(){if(!await this.remotesAreSet())return!1;try{this.log("Pulling....");let r=await this.gitManager.pull()||[];return this.setPluginState({offlineMode:!1}),r.length>0&&(this.displayMessage(`Pulled ${r.length} ${r.length==1?"file":"files"} from remote`),this.lastPulledFiles=r),r.length}catch(r){return this.displayError(r),!1}}async fetch(){if(await this.remotesAreSet())try{await this.gitManager.fetch(),this.displayMessage("Fetched from remote"),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh")}catch(r){this.displayError(r)}}async mayDeleteConflictFile(){let r=this.app.vault.getAbstractFileByPath(il);r&&(this.app.workspace.iterateAllLeaves(i=>{var n;i.view instanceof Se.MarkdownView&&((n=i.view.file)==null?void 0:n.path)==r.path&&i.detach()}),await this.app.vault.delete(r))}async stageFile(r){return await this.isAllInitialized()?(await this.gitManager.stage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async unstageFile(r){return await this.isAllInitialized()?(await this.gitManager.unstage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async switchBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo(),i=await new Fp(this,r.branches).openAndGetReslt();if(i!=null)return await this.gitManager.checkout(i),this.displayMessage(`Switched to ${i}`),this.app.workspace.trigger("obsidian-git:refresh"),await((n=this.branchBar)==null?void 0:n.display()),i}async switchRemoteBranch(){var s;if(!await this.isAllInitialized())return;let r=await this.selectRemoteBranch()||"",[i,n]=Yn(r);if(n!=null&&i!=null)return await this.gitManager.checkout(n,i),this.displayMessage(`Switched to ${r}`),await((s=this.branchBar)==null?void 0:s.display()),r}async createBranch(){var i;if(!await this.isAllInitialized())return;let r=await new tt(this,{placeholder:"Create new branch"}).openAndGetResult();if(r!=null)return await this.gitManager.createBranch(r),this.displayMessage(`Created new branch ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}async deleteBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo();r.current&&r.branches.remove(r.current);let i=await new tt(this,{options:r.branches,placeholder:"Delete branch",onlySelection:!0}).openAndGetResult();if(i!=null){let s=!1;if(!await this.gitManager.branchIsMerged(i)){let o=await new tt(this,{options:["YES","NO"],placeholder:"This branch isn't merged into HEAD. Force delete?",onlySelection:!0}).openAndGetResult();if(o!=="YES")return;s=o==="YES"}return await this.gitManager.deleteBranch(i,s),this.displayMessage(`Deleted branch ${i}`),await((n=this.branchBar)==null?void 0:n.display()),i}}async remotesAreSet(){return this.settings.updateSubmodules||this.gitManager instanceof Ce&&await this.gitManager.getConfig("push.autoSetupRemote","all")=="true"||(await this.gitManager.branchInfo()).tracking?!0:(new Se.Notice("No upstream branch is set. Please select one."),await this.setUpstreamBranch())}async setUpstreamBranch(){let r=await this.selectRemoteBranch();return r==null?(this.displayError("Aborted. No upstream-branch is set!",1e4),this.setPluginState({gitAction:0}),!1):(await this.gitManager.updateUpstreamBranch(r),this.displayMessage(`Set upstream branch to ${r}`),this.setPluginState({gitAction:0}),!0)}async discardAll(r){if(!await this.isAllInitialized())return!1;let i=await this.gitManager.status({path:r}),n=0,s=0;for(let o of i.changed)o.workingDir=="U"?n++:s++;if(n+s==0)return!1;let a=await new pc({app:this.app,filesToDeleteCount:n,filesToDiscardCount:s,path:r!=null?r:""}).openAndGetResult();switch(a){case!1:return a;case"discard":await this.gitManager.discardAll({dir:r,status:this.cachedStatus});break;case"delete":{await this.gitManager.discardAll({dir:r,status:this.cachedStatus});let o=await this.gitManager.getUntrackedPaths({path:r,status:this.cachedStatus});for(let l of o){let c=this.gitManager.getRelativeVaultPath(l),u=this.app.vault.getAbstractFileByPath(c);u?await this.app.fileManager.trashFile(u):l.endsWith("/")?await this.app.vault.adapter.rmdir(c,!0):await this.app.vault.adapter.remove(c)}break}default:Md(a)}return this.app.workspace.trigger("obsidian-git:refresh"),a}async handleConflict(r){this.localStorage.setConflict(!0);let i;r!==void 0&&(i=["# Conflicts","Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push`","(This file will automatically be deleted before commit)","[[#Additional Instructions]] available below file list","",...r.map(n=>{let s=this.app.vault.getAbstractFileByPath(n);return s instanceof Se.TFile?`- [[${this.app.metadataCache.fileToLinktext(s,"/")}]]`:`- Not a file: ${n}`}),` +# Additional Instructions +I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text. + +\`\`\`diff +<<<<<<< HEAD + File changes in local repository +======= + File changes in remote repository +>>>>>>> origin/main +\`\`\``]),await this.tools.writeAndOpenFile(i==null?void 0:i.join(` +`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new tt(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(n){let s=await this.gitManager.getRemoteUrl(n),o=await new tt(this,{initialValue:s,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(n,av(o)),n}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),i;r.length===0&&(i=await this.editRemotes(),i==null&&(r=await this.gitManager.getRemotes()));let n=new tt(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),s=i!=null?i:await n.openAndGetResult();if(s){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(s);let a=await this.gitManager.getRemoteBranches(s),l=await new tt(this,{options:a,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return l==null?void 0:l.startsWith(s+"/")?l:`${s}/${l}`}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new tt(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();n&&await this.gitManager.removeRemote(n)}onActiveLeafChange(r){var a,o;let i=r==null?void 0:r.view;if(!(i!=null&&i.getState().file)&&!(i instanceof Ha||i instanceof Ua))return;let n=this.app.workspace.getLeavesOfType(Qt.type).first(),s=this.app.workspace.getLeavesOfType(bi.type).first();if((a=n==null?void 0:n.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||a.removeClass("is-active"),(o=s==null?void 0:s.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof Ha||(r==null?void 0:r.view)instanceof Ua){let c=r.view.state.bFile.replace(/["\\]/g,"\\$&");this.lastDiffViewState=r.view.getState();let u;n&&r.view.state.aRef=="HEAD"?u=n.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path="${c}"]`):n&&r.view.state.aRef==""?u=n.view.containerEl.querySelector(`div.changes div.tree-item-self[data-path="${c}"]`):s&&(u=s.view.containerEl.querySelector(`div.tree-item-self[data-path='${c}']`)),u==null||u.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(r){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(r,i=4*1e3){var n;(n=this.statusBar)==null||n.displayMessage(r.toLowerCase(),i),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new Se.Notice(r,5*1e3),this.log(r)}displayError(r,i=10*1e3){var s;if(r instanceof hF.Errors.UserCanceledError){new Se.Notice("Aborted");return}let n;r instanceof Error?n=r:n=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new Se.Notice(n.message,i),console.error(`${this.manifest.id}:`,n.stack),(s=this.statusBar)==null||s.displayMessage(n.message.toLowerCase(),i)}log(...r){console.log(`${this.manifest.id}:`,...r)}}; +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +crc-32/crc32.js: + (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *) + +isomorphic-git/index.cjs: + (*! + * This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements. + * SPDX-License-Identifier: LGPL-3.0-or-later + * Copyright (c) James Prevett and other ZenFS contributors. + *) + +js-sha256/src/sha256.js: + (** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.11.1 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2025 + * @license MIT + *) +*/ + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json new file mode 100644 index 0000000..2e8f9b0 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -0,0 +1,10 @@ +{ + "author": "Vinzent", + "authorUrl": "https://github.com/Vinzent03", + "id": "obsidian-git", + "name": "Git", + "description": "Integrate Git version control with automatic backup and other advanced features.", + "isDesktopOnly": false, + "fundingUrl": "https://ko-fi.com/vinzent", + "version": "2.38.6" +} diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css new file mode 100644 index 0000000..7dee885 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -0,0 +1,705 @@ +@keyframes loading { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +.workspace-leaf-content[data-type="git-view"] .button-border { + border: 2px solid var(--interactive-accent); + border-radius: var(--radius-s); +} + +.workspace-leaf-content[data-type="git-view"] .view-content { + padding-left: 0; + padding-top: 0; + padding-right: 0; +} + +.workspace-leaf-content[data-type="git-history-view"] .view-content { + padding-left: 0; + padding-top: 0; + padding-right: 0; +} + +.loading { + overflow: hidden; +} + +.loading > svg { + animation: 2s linear infinite loading; + transform-origin: 50% 50%; + display: inline-block; +} + +.obsidian-git-center { + margin: auto; + text-align: center; + width: 50%; +} + +.obsidian-git-textarea { + display: block; + margin-left: auto; + margin-right: auto; +} + +.obsidian-git-disabled { + opacity: 0.5; +} + +.obsidian-git-center-button { + display: block; + margin: 20px auto; +} + +.tooltip.mod-left { + overflow-wrap: break-word; +} + +.tooltip.mod-right { + overflow-wrap: break-word; +} + +/* Limits the scrollbar to the view body */ +.git-view { + display: flex; + flex-direction: column; + position: relative; + height: 100%; +} + +/* Re-enable wrapping of nav buttns to prevent overflow on smaller screens #*/ +.workspace-drawer .git-view .nav-buttons-container { + flex-wrap: wrap; +} + +.git-tools { + display: flex; + margin-left: auto; +} +.git-tools .type { + padding-left: var(--size-2-1); + display: flex; + align-items: center; + justify-content: center; + width: 11px; +} + +.git-tools .type[data-type="M"] { + color: orange; +} +.git-tools .type[data-type="D"] { + color: red; +} +.git-tools .buttons { + display: flex; +} +.git-tools .buttons > * { + padding: 0; + height: auto; +} + +.workspace-leaf-content[data-type="git-view"] .tree-item-self, +.workspace-leaf-content[data-type="git-history-view"] .tree-item-self { + align-items: center; +} + +.workspace-leaf-content[data-type="git-view"] + .tree-item-self:hover + .clickable-icon, +.workspace-leaf-content[data-type="git-history-view"] + .tree-item-self:hover + .clickable-icon { + color: var(--icon-color-hover); +} + +/* Highlight an item as active if it's diff is currently opened */ +.is-active .git-tools .buttons > * { + color: var(--nav-item-color-active); +} + +.git-author { + color: var(--text-accent); +} + +.git-date { + color: var(--text-accent); +} + +.git-ref { + color: var(--text-accent); +} + +/* ====== diff2html ====== +The following styles are adapted from the obsidian-version-history plugin by +@kometenstaub https://github.com/kometenstaub/obsidian-version-history-diff/blob/main/src/styles.scss +which itself is adapted from the diff2html library with the following original license: + + https://github.com/rtfpessoa/diff2html/blob/master/LICENSE.md + + Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/ + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +.theme-dark, +.theme-light { + --git-delete-bg: #ff475040; + --git-delete-hl: #96050a75; + --git-insert-bg: #68d36840; + --git-insert-hl: #23c02350; + --git-change-bg: #ffd55840; + --git-selected: #3572b0; + + --git-delete: #cc3333; + --git-insert: #399839; + --git-change: #d0b44c; + --git-move: #3572b0; +} + +.git-diff { + .d2h-d-none { + display: none; + } + .d2h-wrapper { + text-align: left; + border-radius: 0.25em; + overflow: auto; + } + .d2h-file-header.d2h-file-header { + background-color: var(--background-secondary); + border-bottom: 1px solid var(--background-modifier-border); + font-family: + Source Sans Pro, + Helvetica Neue, + Helvetica, + Arial, + sans-serif; + height: 35px; + padding: 5px 10px; + } + .d2h-file-header, + .d2h-file-stats { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + } + .d2h-file-header { + display: none; + } + .d2h-file-stats { + font-size: 14px; + margin-left: auto; + } + .d2h-lines-added { + border: 1px solid var(--color-green); + border-radius: 5px 0 0 5px; + color: var(--color-green); + padding: 2px; + text-align: right; + vertical-align: middle; + } + .d2h-lines-deleted { + border: 1px solid var(--color-red); + border-radius: 0 5px 5px 0; + color: var(--color-red); + margin-left: 1px; + padding: 2px; + text-align: left; + vertical-align: middle; + } + .d2h-file-name-wrapper { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 15px; + width: 100%; + } + .d2h-file-name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: var(--text-normal); + font-size: var(--h5-size); + } + .d2h-file-wrapper { + border: 1px solid var(--background-secondary-alt); + border-radius: 3px; + margin-bottom: 1em; + max-height: 100%; + } + .d2h-file-collapse { + -webkit-box-pack: end; + -ms-flex-pack: end; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 1px solid var(--background-secondary-alt); + border-radius: 3px; + cursor: pointer; + display: none; + font-size: 12px; + justify-content: flex-end; + padding: 4px 8px; + } + .d2h-file-collapse.d2h-selected { + background-color: var(--git-selected); + } + .d2h-file-collapse-input { + margin: 0 4px 0 0; + } + .d2h-diff-table { + border-collapse: collapse; + font-family: var(--font-monospace); + font-size: var(--code-size); + width: 100%; + } + .d2h-files-diff { + width: 100%; + } + .d2h-file-diff { + /* + overflow-y: scroll; + */ + border-radius: 5px; + font-size: var(--font-text-size); + line-height: var(--line-height-normal); + } + .d2h-file-side-diff { + display: inline-block; + margin-bottom: -8px; + margin-right: -4px; + overflow-x: scroll; + overflow-y: hidden; + width: 50%; + } + .d2h-code-line { + padding-left: 6em; + padding-right: 1.5em; + } + .d2h-code-line, + .d2h-code-side-line { + display: inline-block; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: 100%; + } + .d2h-code-side-line { + /* needed to be changed */ + padding-left: 0.5em; + padding-right: 0.5em; + } + .d2h-code-line-ctn { + word-wrap: normal; + background: none; + display: inline-block; + padding: 0; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + vertical-align: middle; + width: 100%; + /* only works for line-by-line */ + white-space: pre-wrap; + } + .d2h-code-line del, + .d2h-code-side-line del { + background-color: var(--git-delete-hl); + color: var(--text-normal); + } + .d2h-code-line del, + .d2h-code-line ins, + .d2h-code-side-line del, + .d2h-code-side-line ins { + border-radius: 0.2em; + display: inline-block; + margin-top: -1px; + text-decoration: none; + vertical-align: middle; + } + .d2h-code-line ins, + .d2h-code-side-line ins { + background-color: var(--git-insert-hl); + text-align: left; + } + .d2h-code-line-prefix { + word-wrap: normal; + background: none; + display: inline; + padding: 0; + white-space: pre; + } + .line-num1 { + float: left; + } + .line-num1, + .line-num2 { + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + /* + padding: 0 0.5em; + */ + text-overflow: ellipsis; + width: 2.5em; + padding-left: 0; + } + .line-num2 { + float: right; + } + .d2h-code-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-faint); + cursor: pointer; + display: inline-block; + position: absolute; + text-align: right; + width: 5.5em; + } + .d2h-code-linenumber:after { + content: "\200b"; + } + .d2h-code-side-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-faint); + cursor: pointer; + overflow: hidden; + padding: 0 0.5em; + text-align: right; + text-overflow: ellipsis; + width: 4em; + /* needed to be changed */ + display: table-cell; + position: relative; + } + .d2h-code-side-linenumber:after { + content: "\200b"; + } + .d2h-code-side-emptyplaceholder, + .d2h-emptyplaceholder { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + } + .d2h-code-line-prefix, + .d2h-code-linenumber, + .d2h-code-side-linenumber, + .d2h-emptyplaceholder { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + .d2h-code-linenumber, + .d2h-code-side-linenumber { + direction: rtl; + } + .d2h-del { + background-color: var(--git-delete-bg); + border-color: var(--git-delete-hl); + } + .d2h-ins { + background-color: var(--git-insert-bg); + border-color: var(--git-insert-hl); + } + .d2h-info { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + color: var(--text-faint); + } + .d2h-del, + .d2h-ins, + .d2h-file-diff .d2h-change { + color: var(--text-normal); + } + .d2h-file-diff .d2h-del.d2h-change { + background-color: var(--git-change-bg); + } + .d2h-file-diff .d2h-ins.d2h-change { + background-color: var(--git-insert-bg); + } + .d2h-file-list-wrapper { + a { + text-decoration: none; + cursor: default; + -webkit-user-drag: none; + } + + svg { + display: none; + } + } + .d2h-file-list-header { + text-align: left; + } + .d2h-file-list-title { + display: none; + } + .d2h-file-list-line { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + text-align: left; + } + .d2h-file-list { + } + .d2h-file-list > li { + border-bottom: 1px solid var(--background-modifier-border); + margin: 0; + padding: 5px 10px; + } + .d2h-file-list > li:last-child { + border-bottom: none; + } + .d2h-file-switch { + cursor: pointer; + display: none; + font-size: 10px; + } + .d2h-icon { + fill: currentColor; + margin-right: 10px; + vertical-align: middle; + } + .d2h-deleted { + color: var(--git-delete); + } + .d2h-added { + color: var(--git-insert); + } + .d2h-changed { + color: var(--git-change); + } + .d2h-moved { + color: var(--git-move); + } + .d2h-tag { + background-color: var(--background-secondary); + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 10px; + margin-left: 5px; + padding: 0 2px; + } + .d2h-deleted-tag { + border: 1px solid var(--git-delete); + } + .d2h-added-tag { + border: 1px solid var(--git-insert); + } + .d2h-changed-tag { + border: 1px solid var(--git-change); + } + .d2h-moved-tag { + border: 1px solid var(--git-move); + } + + /* needed for line-by-line*/ + + .d2h-diff-tbody { + position: relative; + } + + /* My additions */ + .cm-merge-revert { + width: 4em; + } + /* Ensure that merge revert markers are positioned correctly */ + .cm-merge-revert > * { + position: absolute; + background-color: var(--background-secondary); + display: flex; + } +} + +/* ====================== Line Authoring Information ====================== */ + +.cm-gutterElement.obs-git-blame-gutter { + /* Add background color to spacing inbetween and around the gutter for better aesthetics */ + border-width: 0px 2px 0.2px; + border-style: solid; + border-color: var(--background-secondary); + background-color: var(--background-secondary); +} + +.cm-gutterElement.obs-git-blame-gutter > div, +.line-author-settings-preview { + /* delegate text color to settings */ + color: var(--obs-git-gutter-text); + font-family: monospace; + height: 100%; /* ensure, that age-based background color occupies entire parent */ + text-align: right; + padding: 0px 6px; + white-space: pre; /* Keep spaces and do not collapse them. */ +} + +@media (max-width: 800px) { + /* hide git blame gutter not to superpose text */ + .cm-gutterElement.obs-git-blame-gutter { + display: none; + } +} + +.git-unified-diff-view, +.git-split-diff-view .cm-deletedLine .cm-changedText { + background-color: #ee443330; +} + +.git-unified-diff-view, +.git-split-diff-view .cm-insertedLine .cm-changedText { + background-color: #22bb2230; +} + +.git-obscure-prompt[git-is-obscured="true"] #git-show-password:after { + -webkit-mask-image: url('data:image/svg+xml,'); +} + +.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after { + -webkit-mask-image: url('data:image/svg+xml,'); +} + +/* Override styling of Codemirror merge view "collapsed lines" indicator */ +.git-split-diff-view .ͼ2 .cm-collapsedLines { + background: var(--interactive-normal); + border-radius: var(--radius-m); + color: var(--text-accent); + font-size: var(--font-small); + padding: var(--size-4-1) var(--size-4-1); +} +.git-split-diff-view .ͼ2 .cm-collapsedLines:hover { + background: var(--interactive-hover); + color: var(--text-accent-hover); +} + +.git-signs-gutter { + .cm-gutterElement { + display: grid; + + /* Needed to align the sign properly for different line heigts. Such as + * when having a heading or list item. + */ + padding-top: 0 !important; + } +} + +.git-gutter-marker:hover { + border-radius: 2px; +} + +.git-gutter-marker.git-add { + background-color: var(--color-green); + justify-self: center; + height: inherit; + width: 0.2rem; +} + +.git-gutter-marker.git-change { + background-color: var(--color-yellow); + justify-self: center; + height: inherit; + width: 0.2rem; +} + +.git-gutter-marker.git-changedelete { + color: var(--color-yellow); + font-weight: var(--font-bold); + font-size: 1rem; + justify-self: center; + height: inherit; +} + +.git-gutter-marker.git-delete { + background-color: var(--color-red); + height: 0.2rem; + width: 0.8rem; + align-self: end; +} + +.git-gutter-marker.git-topdelete { + background-color: var(--color-red); + height: 0.2rem; + width: 0.8rem; + align-self: start; +} + +div:hover > .git-gutter-marker.git-change { + width: 0.6rem; +} + +div:hover > .git-gutter-marker.git-add { + width: 0.6rem; +} + +div:hover > .git-gutter-marker.git-delete { + height: 0.6rem; +} + +div:hover > .git-gutter-marker.git-topdelete { + height: 0.6rem; +} + +div:hover > .git-gutter-marker.git-changedelete { + font-weight: var(--font-bold); +} + +.git-gutter-marker.staged { + opacity: 0.5; +} + +/* Prevent shifting of the editor when git signs gutter is the only gutter present */ +.cm-gutters.cm-gutters-before:has(> .git-signs-gutter:only-child) { + margin-inline-end: 0; + .git-signs-gutter { + margin-inline-start: -1rem; + } +} + +.git-changes-status-bar-colored { + .git-add { + color: var(--color-green); + } + .git-change { + color: var(--color-yellow); + } + .git-delete { + color: var(--color-red); + } +} + +.git-changes-status-bar .git-add { + margin-right: 0.3em; +} + +.git-changes-status-bar .git-change { + margin-right: 0.3em; +} diff --git a/.obsidian/text-generator.json b/.obsidian/text-generator.json new file mode 100644 index 0000000..fc36a12 --- /dev/null +++ b/.obsidian/text-generator.json @@ -0,0 +1,125 @@ +{ + "packagesHash": { + "default": { + "packageId": "default", + "name": "Default Prompts Package", + "version": "0.0.9", + "minTextGeneratorVersion": "0.5.0", + "description": "This is the main package that comes with Text Generator plugin in Obsidian", + "author": "Noureddine Haouari", + "tags": "writing, brainstorming", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/gpt-3-prompt-templates" + }, + "dalle": { + "packageId": "dalle", + "name": "OpenAI Dalle Package", + "version": "0.1.1", + "minTextGeneratorVersion": "0.7.0", + "description": "The package contains some interessting Dalle-2/Dalle-3 prompt templates", + "author": "Noureddine Haouari", + "tags": "photo, dalle-2, dalle-3", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/tg-dalle-package" + }, + "huggingface": { + "packageId": "huggingface", + "name": "Huggingface Prompts Package", + "version": "0.0.4", + "minTextGeneratorVersion": "0.5.0", + "description": "Huggingface Prompts comes with Text Generator plugin in Obsidian", + "author": "Noureddine Haouari", + "tags": "writing, brainstorming, huggingface", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/huggingface" + }, + "awesomePrompts": { + "packageId": "awesomePrompts", + "name": "Awesome Prompts", + "version": "0.0.3", + "minTextGeneratorVersion": "0.5.7", + "description": "This repo includes ChatGPT prompt curation to use ChatGPT better.", + "author": "f", + "tags": "writing, brainstorming, awesome", + "authorUrl": "https://github.com/f/awesome-chatgpt-prompts", + "repo": "text-gen/awesome-tg-package" + }, + "tts": { + "packageId": "tts", + "name": "Text To Speech Package", + "version": "0.0.3", + "minTextGeneratorVersion": "0.6.0", + "description": "Contains Text To Speech Templates and support for TTS for other templates", + "author": "Noureddine", + "tags": "TTS, Speak", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/TTS" + }, + "vision": { + "packageId": "vision", + "name": "Vision Package", + "version": "0.0.2", + "minTextGeneratorVersion": "0.6.0", + "description": "Contains Vision Templates and support for Vision for other templates (Scripts)", + "author": "Noureddine", + "tags": "OpenAI,markdown,gpt-4-vision,vision,images", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/tg-vision" + }, + "smartConnections": { + "packageId": "smartConnections", + "name": "Smart Connections Package", + "version": "0.0.2", + "minTextGeneratorVersion": "0.6.0", + "description": "Contains Smart Connection Templates and support for Smart Connections for other templates (Script)", + "author": "Noureddine", + "tags": "smartConnections,smart-connections", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/tg-smartConnections" + }, + "Experimental": { + "packageId": "Experimental", + "name": "Experimental Package", + "version": "0.0.2", + "minTextGeneratorVersion": "0.6.6", + "description": "Contains experimental templates", + "author": "Noureddine", + "tags": "experiments", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/experimental-package" + }, + "testExtension": { + "core": true, + "type": "feature", + "packageId": "testExtension", + "name": "test extension Package", + "version": "0.0.1", + "minTextGeneratorVersion": "0.1.0", + "description": "testing extension package", + "author": "Noureddine Haouari", + "tags": "testing", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/gpt-3-prompt-templates", + "folderName": "testExtension", + "price": 20, + "installed": false + }, + "excalidraw": { + "packageId": "excalidraw", + "name": "excalidraw package", + "version": "0.0.1", + "minTextGeneratorVersion": "0.6.0", + "description": "Contains Excalidraw Templates and support for Excalidraw for other templates (Scripts)", + "author": "Noureddine", + "tags": "OpenAI,markdown,gpt-4-vision,vision,images", + "authorUrl": "https://www.buymeacoffee.com/haouarine", + "repo": "text-gen/tg-excalidraw", + "core": true, + "folderName": "excalidrawPackage", + "price": 2 + } + }, + "resources": {}, + "installedPackagesHash": {}, + "subscriptions": [] +} \ No newline at end of file diff --git a/.obsidian/types.json b/.obsidian/types.json new file mode 100644 index 0000000..2f1ad36 --- /dev/null +++ b/.obsidian/types.json @@ -0,0 +1,17 @@ +{ + "types": { + "aliases": "aliases", + "cssclasses": "multitext", + "tags": "tags", + "Сніданок": "checkbox", + "Кава зранку": "checkbox", + "Небілет": "checkbox", + "Метформін в обід": "checkbox", + "Велотренажер": "checkbox", + "Таблетки на ніч": "checkbox", + "Кефір на ніч": "checkbox", + "Вага": "number", + "ІМТ": "number", + "Тілесний жир": "number" + } +} \ No newline at end of file diff --git a/0.FILES/2.Шаблони/Шаблон Щоденника..md b/0.FILES/2.Шаблони/Шаблон Щоденника..md new file mode 100644 index 0000000..74cd910 --- /dev/null +++ b/0.FILES/2.Шаблони/Шаблон Щоденника..md @@ -0,0 +1,11 @@ +--- +Небілет: +Сніданок: +Кава зранку: +Метформін в обід: +Велотренажер: +Кефір на ніч: +Таблетки на ніч: +Вага: +ІМТ: +--- diff --git a/0.FILES/2.Шаблони/Шаблон щоденної нотатки.md b/0.FILES/2.Шаблони/Шаблон щоденної нотатки.md new file mode 100644 index 0000000..18fe891 --- /dev/null +++ b/0.FILES/2.Шаблони/Шаблон щоденної нотатки.md @@ -0,0 +1,38 @@ +# 📅 {{date:YYYY-MM-DD}} — {{date:dddd}} + +## 🧩 P (Projects) +- [ ] Основні задачі по проєктах на сьогодні: + - [ ] + +## 🏗 A (Areas) +- Системне адміністрування: +- Техпідтримка: +- Здоров'я: + +## 📚 R (Resources) +- Корисні посилання / нотатки: + - +- Логи / команди, які сьогодні застосовував: + - + +## 🗄 A (Archive) +- Що сьогодні завершено: + - + +--- + +## 📝 C (Capture) +- Швидкі нотатки / думки протягом дня: + - + +## 🗂 O (Organize) +- Що потрібно рознести у проєкти / області: + - + +## 🔍 D (Distill) +- Головні інсайти за день: + - + +## 🎤 E (Express) +- Що можу оформити у статтю / інструкцію / шаблон: + - diff --git a/0.FILES/7.Inbox/2025-09-15.md b/0.FILES/7.Inbox/2025-09-15.md new file mode 100644 index 0000000..6c96ad5 --- /dev/null +++ b/0.FILES/7.Inbox/2025-09-15.md @@ -0,0 +1,38 @@ +# 📅 {{date:YYYY-MM-DD}} — {{date:dddd}} + +## 🧩 P (Projects) +- [ ] Основні задачі по проєктах на сьогодні: + - [ ] + +## 🏗 A (Areas) +- Системне адміністрування: +- Техпідтримка: +- Здоров'я: + +## 📚 R (Resources) +- Корисні посилання / нотатки: + - +- Логи / команди, які сьогодні застосовував: + - + +## 🗄 A (Archive) +- Що сьогодні завершено: + - + +--- + +## 📝 C (Capture) +- Швидкі нотатки / думки протягом дня: + - + +## 🗂 O (Organize) +- Що потрібно рознести у проєкти / області: + - + +## 🔍 D (Distill) +- Головні інсайти за день: + - + +## 🎤 E (Express) +- Що можу оформити у статтю / інструкцію / шаблон: + - \ No newline at end of file diff --git a/0.FILES/7.Inbox/2025-09-16.md b/0.FILES/7.Inbox/2025-09-16.md new file mode 100644 index 0000000..a490157 --- /dev/null +++ b/0.FILES/7.Inbox/2025-09-16.md @@ -0,0 +1,39 @@ +# 📅 2025-09-16 — вівторок + +## 🧩 P (Projects) +- [ ] Основні задачі по проєктах на сьогодні: + + +## 🏗 A (Areas) +- Системне адміністрування: + +- Техпідтримка: +- Здоров'я: + +## 📚 R (Resources) +- Корисні посилання / нотатки: + - +- Логи / команди, які сьогодні застосовував: + - + +## 🗄 A (Archive) +- Що сьогодні завершено: + - + +--- + +## 📝 C (Capture) +- Швидкі нотатки / думки протягом дня: + - + +## 🗂 O (Organize) +- Що потрібно рознести у проєкти / області: + - + +## 🔍 D (Distill) +- Головні інсайти за день: + - + +## 🎤 E (Express) +- Що можу оформити у статтю / інструкцію / шаблон: + - diff --git a/0.FILES/7.Inbox/2025-09-17.md b/0.FILES/7.Inbox/2025-09-17.md new file mode 100644 index 0000000..399ca89 --- /dev/null +++ b/0.FILES/7.Inbox/2025-09-17.md @@ -0,0 +1,38 @@ +# 📅 2025-09-17 — середа + +## 🧩 P (Projects) +- [ ] Основні задачі по проєктах на сьогодні: + - [ ] + +## 🏗 A (Areas) +- Системне адміністрування: +- Техпідтримка: +- Здоров'я: + +## 📚 R (Resources) +- Корисні посилання / нотатки: + - +- Логи / команди, які сьогодні застосовував: + - + +## 🗄 A (Archive) +- Що сьогодні завершено: + - + +--- + +## 📝 C (Capture) +- Швидкі нотатки / думки протягом дня: + - + +## 🗂 O (Organize) +- Що потрібно рознести у проєкти / області: + - + +## 🔍 D (Distill) +- Головні інсайти за день: + - + +## 🎤 E (Express) +- Що можу оформити у статтю / інструкцію / шаблон: + - diff --git a/0.FILES/7.Inbox/Building a Second Brain.md b/0.FILES/7.Inbox/Building a Second Brain.md new file mode 100644 index 0000000..ad633ab --- /dev/null +++ b/0.FILES/7.Inbox/Building a Second Brain.md @@ -0,0 +1,15 @@ +Книга "[[Создай свой второй мозг]]" (оригинальное название "Building a Second Brain") написана [[Тьяго Форте]]. Она посвящена методам организации и управления информацией, которые позволяют эффективно обрабатывать и сохранять знания. Автор предлагает концепцию создания "второго мозга" — цифровой системы, которая помогает лучше структурировать информацию, улучшать память и повышать продуктивность. + +Основные идеи книги включают: + +1. **Сбор информации**: Важно уметь собирать и хранить полезную информацию из различных источников. + +2. **Организация данных**: Создание системы для организации информации таким образом, чтобы её было легко находить и использовать. + +3. **Развитие креативности**: Использование собранных знаний для генерации новых идей и решений. + +4. **Использование технологий**: Применение современных цифровых инструментов для управления информацией. + +5. **Эффективность работы**: Оптимизация процесса работы с информацией для увеличения продуктивности. + +Эта книга будет полезна тем, кто стремится улучшить свои навыки управления знаниями и ищет способы более эффективного использования информации в повседневной жизни и профессиональной деятельности. \ No newline at end of file diff --git a/0.FILES/7.Inbox/SQL/Виправлення помилки UsersWorkHistory.md b/0.FILES/7.Inbox/SQL/Виправлення помилки UsersWorkHistory.md new file mode 100644 index 0000000..a72c468 --- /dev/null +++ b/0.FILES/7.Inbox/SQL/Виправлення помилки UsersWorkHistory.md @@ -0,0 +1,33 @@ +#SQL #1С + + +1) Спочатку спробуемо полікувати таблицю в базі. + +USE Master +GO +ALTER DATABASE base_name +SET SINGLE_USER +WITH ROLLBACK IMMEDIATE +GO +USE base_name +DBCC CHECKTABLE (_UsersWorkHistory, repair_allow_data_loss) +GO +ALTER DATABASE base_name +SET MULTI_USER +GO + +2) Якщо не допомогло потрібно очитити цю таблицю. + +Перевіримо скільки там зараз строк. +USE base_name +SELECT COUNT(*) AS total_rows FROM _UsersWorkHistory; +GO + +Чистимо таблицю. +USE base_name +TRUNCATE TABLE _UsersWorkHistory; + +Перевіримо скільки там зараз строк. має бути 0 +USE base_name +SELECT COUNT(*) AS total_rows FROM _UsersWorkHistory; +GO \ No newline at end of file diff --git a/0.FILES/7.Inbox/box/WMS-Server.md b/0.FILES/7.Inbox/box/WMS-Server.md new file mode 100644 index 0000000..28f9a18 --- /dev/null +++ b/0.FILES/7.Inbox/box/WMS-Server.md @@ -0,0 +1,15 @@ +Server-APP +Логин Администратор +Пароль 23WEsdxc45 +IP в нашей локальной сети склада 192.168.0.192 +IP для подключения снаружи по RDP: 93.127.122.71:35002 + +База 1С - Srvr="Server-WMS";Ref="wms"; + +Server-WMS +Логин Администратор +Пароль 23WEsdxc45 +IP в нашей локальной сети склада 192.168.0.193 +IP для подключения снаружи по RDP: 93.127.122.71:35003 + +База 1С - Srvr="localhost";Ref="wms"; \ No newline at end of file diff --git a/0.FILES/7.Inbox/Корекція часу..md b/0.FILES/7.Inbox/Корекція часу..md new file mode 100644 index 0000000..99a57e7 --- /dev/null +++ b/0.FILES/7.Inbox/Корекція часу..md @@ -0,0 +1,42 @@ +#System +Створимо bat файл. Поставимо в планувальник на запуск компьютера. +``` +:: Установить дату на 1 сентября 2025 +date 09-01-2025 + +:: Установить примерное время +time 10:00:00 + +:: Перезапустить службу времени +net stop w32time +net start w32time + +:: Форсированная синхронизация +w32tm /resync /force +``` + + +Собери информацию net stop w32time + +Команда `net stop w32time` використовується в операційній системі Windows для зупинки служби "Windows Time" (w32time), яка відповідає за синхронізацію часу на комп'ютері з мережею. + +Ось коротка інформація про цю службу та її функціональність: + +1. **Windows Time Service (w32time)**: Ця служба забезпечує синхронізацію дати та часу на всіх комп'ютерах, що працюють під управлінням Windows, використовуючи протокол NTP (Network Time Protocol). + +2. **Призначення**: Правильний час є критично важливим для багатьох мережевих служб і додатків, таких як Kerberos-автентифікація, файлові системи та інше. + +3. **Команда `net stop w32time`**: Використовується для тимчасового зупинення служби якщо вам потрібно виконати її налагодження або змінити конфігурації без автоматичного запуску служби. + +4. **Використання команди**: + - Відкрийте командний рядок від імені адміністратора. + - Введіть `net stop w32time` і натисніть Enter. + - Це зупинить службу часу, після чого можна виконати необхідні дії. + +5. **Перезапуск служби**: Щоб перезапустити службу після змін чи налагодження, використовуйте команду `net start w32time`. + +6. **Додаткові параметри**: + - Для перевірки статусу служби можна використовувати `sc query w32time`. + - Щоб переконфігурувати або перезавантажити налаштування часу можна використовувати `w32tm /resync`. + +Важливо пам’ятати, що зміни у конфігурації синхронізації часу можуть спричинити проблеми в мережевих середовищах, тому їх слід виконувати обережно і мати відповідні права адміністратора на системі. \ No newline at end of file diff --git a/0.FILES/7.Inbox/ТОП 10 книг для саморозвитку особистості.md b/0.FILES/7.Inbox/ТОП 10 книг для саморозвитку особистості.md new file mode 100644 index 0000000..232fdb0 --- /dev/null +++ b/0.FILES/7.Inbox/ТОП 10 книг для саморозвитку особистості.md @@ -0,0 +1,10 @@ +1. Келлі Макґоніґал «Сила волі. Шлях до влади над собою» -Київ:« Наш Формат»,2019. — 264с. +2. Джеймс Борг «Мистецтво говорити. Таємниці ефективного спілкування». —Київ:«Фабула» 2019. — 304 с. +3. Джордж Клейсона «Найбагатший чоловік у Вавилоні». — Київ:«Наш Формат»,2017. —136с. +4. Н. Гілл. «Думай і багатій» (українською мовою). — КСД, 2017. —256с. +5. Лоран Тунель. «День, що навчив мене жити» . — Київ:Книжковий клуб «Клуб Сімейного Дозвілля», 2019. — 288с. +6. Стівен Сломен, Філіп Фернбак. «Ілюзія знання. Чому ми ніколи не думаємо на самоті» . —Київ: Видавництво «УакаЬоо РиЬІізНіп§», 2018. — 344с. +7. Уоллес Уоттл. «Наука про те, як бути великим». —Київ: Андронум, 2020. — 92с. +8. Барбара Оклі. «Навчитися вчитися. Як запустити свій мозок на повну». — Київ:«Наш Формат»,2018. —272с. +9. Анна Барнс. « Як бути впевненим у собі». — Київ:«Фабула» 2017. — 160 с. +10. Ерік Берн. «Ігри, у які грають люди». — Київ:Книжковий клуб «Клуб Сімейного Дозвілля», 2022. — 256с. \ No newline at end of file diff --git a/0.FILES/7.Inbox/Тьяго Форте.md b/0.FILES/7.Inbox/Тьяго Форте.md new file mode 100644 index 0000000..48c211f --- /dev/null +++ b/0.FILES/7.Inbox/Тьяго Форте.md @@ -0,0 +1,5 @@ +Тиагу Форте — это известный эксперт по продуктивности и автор, который специализируется на управлении знаниями и личной эффективности. Он наиболее известен благодаря своей книге «[[Building a Second Brain]]» («Создание второго мозга»), где он предлагает систему для организации информации и знаний, чтобы повысить продуктивность и креативность. + +Форте начал свою карьеру в области продуктивности с разработки различных методологий, которые помогают людям эффективно управлять своими цифровыми данными. Его подход основан на использовании технологий для упрощения жизни и работы, а также на создании системы для хранения и извлечения информации, которая способствует более глубокому пониманию и применению знаний. + +Кроме написания книг, Тиагу Форте также проводит тренинги и семинары по всему миру, обучая людей методам улучшения своей продуктивности. Его работа получила признание среди профессионалов в различных областях за практичность и адаптируемость его методов. \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/0.Правила введения заметок.md b/0.FILES/8.Як вести нотатки/0.Правила введения заметок.md new file mode 100644 index 0000000..1c4a167 --- /dev/null +++ b/0.FILES/8.Як вести нотатки/0.Правила введения заметок.md @@ -0,0 +1,10 @@ + +| Название статьи | О чем эта статья | +| --------------------------------- | ----------------------------------------------------------------------------------------------- | +| [[1.Framework Thinking]] | Мышление в фреймворках, в структурах | +| [[2.Метод CODE]] | Учимся извлекать и обрабатывать | +| [[3.Метод PARA]] | Приводим в порядок папки и заметки | +| [[5.Zettelkasten или Вики-связи]] | Осмысленное сохранение, связи и применение | +| [[4 этапа обучения]] | Как мы реально учимся и привыкаем к этому | +| [[6.MOC - центры управления]] | Заметки в папках — но нет общей картины? Создайте центры управления | +| [[7.Выражайте ваши заметки]] | Почему 80% пользователей Obsidian упускают огромный потенциал своих заметок и как это исправить | \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/1.Framework Thinking.md b/0.FILES/8.Як вести нотатки/1.Framework Thinking.md new file mode 100644 index 0000000..4b29d99 --- /dev/null +++ b/0.FILES/8.Як вести нотатки/1.Framework Thinking.md @@ -0,0 +1,48 @@ +Мислення через структури +## ✅ Що це таке + +**Framework Thinking** — підхід до аналізу та прийняття рішень через використання структурованих моделей (frameworks). + +## 🔑 Переваги + +- **Економія часу** – не вигадуєш рішення з нуля. + +- **Чіткість** – бачиш проблему системно. + +- **Передбачуваність** – застосовуєш перевірені методики. + +- **Універсальність** – підходить для бізнесу, навчання, життя. + + +## 📚 Популярні фреймворки + +### Аналіз ситуації + +- **SWOT** → Сильні/Слабкі сторони + Можливості/Загрози. + +- **PESTEL** → Політика, Економіка, Соціум, Технології, Екологія, Закон. + + +### Прийняття рішень + +- **Eisenhower Matrix** → Важливе/Термінове. + +- **OODA Loop** → Спостерігай, Орієнтуйся, Вирішуй, Дій. + + +### Креативність та розвиток + +- **Design Thinking** → Емпатія, Ідеї, Прототип, Тест. + +- **First Principles Thinking** → Розбирай на першопричини й будуй заново. + + +## 💡 Використання + +1. Вибери фреймворк, що підходить під задачу. + +2. Наклади його на свою проблему. + +3. Зроби висновки та зафіксуй їх. + +4. Порівняй кілька структур, щоб побачити різні перспективи. \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/2.Метод CODE.md b/0.FILES/8.Як вести нотатки/2.Метод CODE.md new file mode 100644 index 0000000..8663c1d --- /dev/null +++ b/0.FILES/8.Як вести нотатки/2.Метод CODE.md @@ -0,0 +1,151 @@ +--- +title: "Метод CODE" +source: "https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+CODE" +author: + - "[[Elton Labs]]" +published: +created: 2025-09-14 +description: "Framework thinking - Elton Labs" +tags: + - "clippings" +--- +### 🧠 Метод CODE: Как превратить информацию в действия + +![Pasted image 20250506185844.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506185844.png) + +Pasted image 20250506185844.png + +CODE — это не просто способ вести заметки. +Это **цикл трансформации информации в полезные идеи**, которые работают на тебя и твои проекты. + +![Pasted image 20250506185938.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506185938.png) + +Pasted image 20250506185938.png + +Метод описан в книге [[Тьяго Форте]] «Как создать второй мозг» и идеально сочетается с системой [Метод PARA](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+PARA) и твоим знанием Obsidian. + +--- + +## CODE = Capture → Organize → Distill → Express + +--- + +## 1️⃣ Capture — Захват + +Цель: + +поймать то, что **вызвало отклик**, не думая, зачем и почему. + +📥 **Что можно фиксировать**: + +- фразы, которые тебя зацепили; +- мысли, вызвавшие «вау-эффект»; +- наблюдения из жизни или работы; +- удачные фразы из книг, видео, чатов. + +Пример: + +Я читал статью про MVP, и в одной фразе был скрыт мощный инсайт. Без размышлений кинул её в `📥 Inbox`. Через пару дней — переработал в шаблон стартапа. + +--- + +## 2️⃣ Organize — Организация + +Цель: + +> понять **куда и зачем** пойдёт сохранённая информация. + +Кодовая фраза: + +«Это относится к моим проектам, ресурсам или сферам жизни?» + +🔍 Используй фильтры (12 фильтр-вопросов). + +Тьяго Форте предлагает использовать **12 ключевых вопросов**, чтобы понять, **имеет ли смысл сохранять информацию вообще**. + +- Если хотя бы на один вопрос ответ "ДА" — оставляем и раскладываем по системе. Если НЕТ — это просто мимо кассы, удаляй или игнорируй. + +Вот мои 6 из 12 кастомных вопросов: + +- Полезно ли для YouTube-канала? +- Служит ли стартапу или MVP? +- Укрепляет ли дисциплину или фокус? +- Улучшает ли навыки AI или no-code? +- Подходит ли под текущий проект? +- Связано ли с системой в Obsidian? + +📌 **Кстати, можно чуть автоматизировать это процесс в будущем**: + +- 🗂 [automover-obsidian](https://eltonlabs.org/base/automover-obsidian) — для сортировки по ключевым категориям +- 🔁 [Dataview](https://eltonlabs.org/base/Dataview) — показывает список новых несортированных заметок +- ⌨️ `Ctrl + P` — быстро найти команду на организацию (переместить файл в соответствующую папку) + +--- + +## 3️⃣ Distill — Выделение сути + +Цель: + +Представь, что ты объясняешь идею себе в будущем. + +🛠 Приёмы в Obsidian, которые я использую для этого: + +- **Bold** — для ключевых мыслей +- 💡 [Callouts](https://eltonlabs.org/base/Callouts): `> [!idea] Инсайт: …` +- 🔁 `Alt + Q` — случайная заметка для повторного осмысления +- 📄 Шаблон карточки: "Идея → Суть → Применение" +- [highlightr-obsidian](https://eltonlabs.org/base/highlightr-obsidian) — выделяй по цветам +- [emoji-toolbar-obsidian](https://eltonlabs.org/base/emoji-toolbar-obsidian) — для визуальной структуры + +> Пример: Статья на 15 минут → одна заметка с 3 строчками. Всё, что реально важно, осталось. + +--- + +## 4️⃣ Express — Выражение + +Цель: + +- применить +- Иначе ты — просто потребитель. + +📤 **Форматы выражения, которые я использую**: + +- Рассказать другу +- Написать короткий пост +- Вставить в видео +- Встроить в шаблон +- Использовать в проекте +- Провести мозговой штурм + +Пример: + +Изучил Customer Discovery →Добавил в «Ресурсы» -> Вставил в шаблон стартапа -> Показал в ролике -> Сделал карточку в Excalidraw. + +📌 **Автоматизация, которые можно использовать для этого**: + +- `Ctrl + K` — вставить источник +- [excalidraw-obsidian](https://eltonlabs.org/base/excalidraw-obsidian) — визуальное оформление и связки +- [copilot-ai-obsidian](https://eltonlabs.org/base/copilot-ai-obsidian) — генерация применения на практике +- [charts-obsidian](https://eltonlabs.org/base/charts-obsidian) — визуализация идей в графиках + +--- + +## 💡 Заключение: CODE + PARA = системное мышление + +Метод CODE помогает не просто сохранять информацию, а **делать из неё действие**. Вместе с [Метод PARA](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+PARA) — ты получаешь не только хранилище, а **рабочую среду для мышления**. + +- `Capture` — интуитивное сохранение +- `Organize` — фильтрация по целям +- `Distill` — выжимка сути +- `Express` — превращение в результат + +--- + +Что я рекомендую сделать сейчас? + +📌 Добавь фреймворк CODE в свой шаблон старта новой темы или проекта — и твоя система станет вторым мозгом. + +Идем дальше? + +- 🧠 [Метод PARA](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+PARA) +- [⬅️ Назад на главную](https://eltonlabs.org/home) \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/3.Метод PARA.md b/0.FILES/8.Як вести нотатки/3.Метод PARA.md new file mode 100644 index 0000000..a1922e3 --- /dev/null +++ b/0.FILES/8.Як вести нотатки/3.Метод PARA.md @@ -0,0 +1,165 @@ +--- +title: "Метод PARA" +source: "https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+PARA" +author: + - "[[Elton Labs]]" +published: +created: 2025-09-15 +description: "Обсидиан - Elton Labs" +tags: + - "clippings" +--- +### 🧠 Метод PARA: Как организовать знания и создать второй мозг в Obsidian + +![Pasted image 20250506191522.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506191522.png) + +Pasted image 20250506191522.png + +Метод **PARA** — это не просто структура папок. Это фундамент для продуктивной жизни и эффективного мышления. + +Он помогает расставить приоритеты, разгрузить голову и превратить хаос в порядок. + +> PARA = **Projects**, **Areas**, **Resources**, **Archive** + +Всё, что ты сохраняешь — должно попадать в одну из этих 4 категорий. +Ни больше, ни меньше. Это и есть сила метода. + +--- + +### Посмотрите, как автор этого метода описывает PARA: + +Из книги "Как создать второй мозг" Тьяго Форте: + +Существует параллель между системой PARA и организацией пространства на кухне. На кухне все спроектировано и организовано для обеспечения результата — максимально эффективного приготовления еды. Архивы напоминают морозильную камеру — их элементы заморожены, пока в них нет необходимости, а она может настать в далеком будущем. Ресурсы похожи на кладовую: они доступны для приготовления любого блюда, но при этом надежно спрятаны. Сферы жизни можно сравнить с холодильником — вы планируете использовать его содержимое относительно скоро, и проверяете вы его чаще. А проекты -- это кастрюли и сковородки на плите, те самые блюда, которые вы готовите прямо сейчас. Все продукты лежат там, откуда вам удобнее всего будет их достать для приготовления пищи. + +Продолжение + +Представьте себе, насколько абсурдно было бы организовать пространство на кухне по видам пищи: например, свежие фрукты, сухофрукты, фруктовые соки и замороженные фрукты хранились бы в одном месте, потому что это фрукты. Тем не менее именно так большинство людей организует свои файлы и заметки - книжные заметки собраны вместе лишь потому, что эти данные взяты из книг, или все цитаты сохранены вместе потому, что это цитаты. + +--- + +### 1️⃣ Projects — Проекты + +Проекты — это *временные задачи с чёткой целью*. Над ними ты работаешь **сейчас**. + +**Примеры:** + +- Запустить MVP стартапа на Bubble +- Сделать ролик для YouTube про Obsidian +- Подготовить питч для инвестора + +**В Obsidian**: каждая заметка в папке `Projects` — это отдельный проект. Там чек-листы, ссылки, идеи, дедлайны. + +Я, например, веду проект "YouTube-контент" с помощью плагина **[kanban](https://eltonlabs.org/base/kanban)**. + +![Pasted image 20250506224908.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506224908.png) + +Pasted image 20250506224908.png + +--- + +### 2️⃣ Areas — Сферы жизни + +Сферы — это *долгосрочные области*, которые требуют постоянного внимания: здоровье, финансы, обучение, отношения. + +**Примеры:** + +- Физическое состояние (цель — 75 кг и спорт) +- Образование (магистратура + книги) +- Личный бренд (YouTube и Telegram) + +**В Obsidian**: папка `Areas` — это не просто списки. + +Это места, где я отслеживаю стабильность. Например, я веду Kanban-доску по чтению книг — 1 книга в месяц минимум. + +![Pasted image 20250506225003.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506225003.png) + +Pasted image 20250506225003.png + +--- + +### 3️⃣ Resources — Ресурсы + +Это твоя **библиотека знаний**. Сюда идут всё полезное: цитаты, статьи, фреймворки, идеи. Даже мысли из подкастов и книг. + +**Примеры:** + +- Статья про Customer Discovery +- Фреймворк "Lean Canvas" +- Статьи о продуктивности + +**В Obsidian**: я использую `Resources`, чтобы хранить структурированную информацию. + +Часто делаю callouts с 💡, сохраняю ключевые идеи и связываю с проектами (помним про [Метод CODE](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+CODE)) + +--- + +### 4️⃣ Archive — Архив + +Архив — это просто **отложенное**. Завершённые проекты, устаревшие заметки, старые идеи. + +**Примеры:** + +- Первая версия шаблона стартапа +- Ролики, которые я уже выпустил +- Черновики неактуальных задач + +**В Obsidian**: всё, что мешает текущей фокусировке, я убираю в папку `Archive`. + +Это освобождает внимание и уменьшает визуальный шум. + +--- + +### 🔁 Как работает в связке с CODE + +Метод PARA идеально сочетается с CODE: + +- В `Capture` ты сохраняешь всё важное (в `Inbox`) +- С `Organize` — распределяешь по PARA +- В `Distill` — выделяешь суть и формируешь ресурс +- Через `Express` — используешь: в роликах, шаблонах, идеях + +--- + +### 💡 Почему PARA меняет мышление + +- 📌 **Ты начинаешь мыслить структурно** — каждое знание имеет "дом". +- ⛏️ **Ты отсекаешь лишнее** — только важное идёт в систему. +- ⚙️ **Ты ускоряешь действия** — нужная инфа под рукой в нужный момент. + +--- + +## ‼️ Иногда лучше воздержаться от перемещения заметок между папками + +Почему? + +Бывают заметки в ресурсах, которые никогда не теряют актуальности и в будущем еще не раз могут пригодиться. + +Что в таком случае делать? + +Использовать [связи](https://eltonlabs.org/obsidian-links), ссылайте в вашем проекте (Projects) — на заметку из Resources. Не обязательно перемещать вручную заметку. Или же создать [MOC](https://eltonlabs.org/base/moc-notes), что это такое? Узнаете в следующих статьях... + +--- + +##### ✨ Комментарий участника клуба "Obsidian&Mind Club" + +Грубо говоря, у тебя в ресурсе есть полезный код/схема автоматизации/полезна информация о каком-нибудь датчике и о том как он работает. + +Это все может быть использована во множестве проектов, перетаскивать заметку в проект в этом случае бессмысленно, **лучше оставить в ресурсах и постоянно ссылаться на него**, + +Переместить физически конечно можно, но тогда это уже будет не ресурс, а ссылка на архивный проект, что будет не совсем логично + +*Продолжение комментария* + +Куда-то не надо, куда-то это похоронить, нужно организовать свое пространство в котором как раз ты все и будешь записывать и ссылаться на раннее созданное, тебе нужно будет в этом случае разобрать не одно пространство, а два, а может и три с таким подходом, это быстро надоест и не будет иметь эффекта с массой потерянной информацией и временем. + +**Ключевое, ты не должен думать в каком месте ты это временно сохранил, место ты точно должен знать и легко воспользовавшись поиском найти.** + +--- + +Самое главное - не копите знание, а превращайте это в действие + +Идем дальше? + +- 🧠 [Zettelkasten](https://eltonlabs.org/base/Zettelkasten) +- [⬅️ Назад на главную](https://eltonlabs.org/home) \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/4 этапа обучения.md b/0.FILES/8.Як вести нотатки/4 этапа обучения.md new file mode 100644 index 0000000..56fa2a5 --- /dev/null +++ b/0.FILES/8.Як вести нотатки/4 этапа обучения.md @@ -0,0 +1,81 @@ +--- +title: "4 этапа обучения" +source: "https://eltonlabs.org/base/4+%D1%8D%D1%82%D0%B0%D0%BF%D0%B0+%D0%BE%D0%B1%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D1%8F" +author: + - "[[Elton Labs]]" +published: +created: 2025-09-15 +description: "Обсидиан - Elton Labs" +tags: + - "clippings" +--- +## 🎯 Почему эти методы работают: 4 этапа обучения + +![Pasted image 20250506231258.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506231258.png) + +Pasted image 20250506231258.png + +Иногда кажется, что такие системы как **Zettelkasten**, **PARA**, **CODE** — это просто сложные концепции. + +Но если копнуть глубже, они работают потому, что встраиваются в базовую логику обучения человека. + +📖 Об этом пишет Роберт Грин в книге *«Мастер игры»*, ссылаясь на модель **4 уровней компетентности**. + +--- + +## 🧠 4 стадии обучения + +![Pasted image 20250506231453.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506231453.png) + +Pasted image 20250506231453.png + +Мы об этом подробно говорили в нашем ролике на YouTube - [Как Zettelkasten сделал меня умнее](https://www.youtube.com/watch?v=fvOnc2xA2v4) + +1. ❓ **Неосознанная некомпетентность** + Ты не знаешь, что чего-то не умеешь. Уверен, что всё ок. + → Пример: просто сохраняешь заметки, даже не задумываясь, зачем они. +2. ⚠️ **Осознанная некомпетентность** + Понимаешь: «Я не умею обрабатывать информацию» + → Пример: заметок много, но пользы 0. Начинаешь искать систему. +3. 🧪 **Осознанная компетентность** + Начинаешь учиться: пробуешь Zettelkasten, делаешь Inbox, связываешь идеи. + → Уже лучше, но пока требует усилий. +4. 🤖 **Неосознанная компетентность** + Ты на автомате перерабатываешь, структурируешь, применяешь знания. + → Уже не просто читаешь, а превращаешь инфу в решения и контент. + +--- + +## 📌 Как это связано с Obsidian-системой + +| Уровень | Что помогает перейти | +| --- | --- | +| 1 → 2 | Осознанность: видишь, что «что-то не работает» | +| 2 → 3 | Пробуешь систему: Inbox, шаблоны, связи | +| 3 → 4 | Повторение, практика, возвращение к заметкам | + +Системы вроде Zettelkasten, PARA и CODE — это **не магия**, а **каркас**, который **ускоряет путь** между уровнями. + +--- + +## 🎯 Почему важно фиксировать и связывать + +Когда ты **переписываешь мысль своими словами**, ты превращаешь **чужую идею → в свою**. Это и есть переход на уровень 3. + +Когда ты **автоматически создаёшь связку** между заметками — это уже уровень 4. Ты мыслишь сетью, а не кучей записей. + +--- + +## 🚀 Заключение + +> 🧠 Это не про “систему ради системы” +> 📈 Это про то, чтобы стать осознанно компетентным и мыслить гибко + +**Не надо сразу прыгать на уровень 4.** Просто начните фиксировать, связывать и применять. А система — подтянется. + +--- + +Идем дальше? + +- 🧠 [MOC - центры управления заметками](https://eltonlabs.org/base/moc-notes) +- [⬅️ Назад на главную](https://eltonlabs.org/home) \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/5.Zettelkasten или Вики-связи.md b/0.FILES/8.Як вести нотатки/5.Zettelkasten или Вики-связи.md new file mode 100644 index 0000000..23e1062 --- /dev/null +++ b/0.FILES/8.Як вести нотатки/5.Zettelkasten или Вики-связи.md @@ -0,0 +1,158 @@ +--- +title: "Zettelkasten" +source: "https://eltonlabs.org/base/Zettelkasten" +author: + - "[[Elton Labs]]" +published: +created: 2025-09-15 +description: "Обсидиан - Elton Labs" +tags: + - "clippings" +--- +## 🧠 Zettelkasten + Obsidian + +![Pasted image 20250506225953.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506225953.png) + +Pasted image 20250506225953.png + +Каждый день на нас сыпется информация: статьи, видео, идеи, мысли. Мы сохраняем их в Notion, Google Docs или Obsidian — и через пару недель забываем, зачем вообще это сделали 😅 + +Почему так происходит? Потому что просто **копим**, но **не перерабатываем**. + +--- + +## ❓ В чём проблема обычного подхода к заметкам + +Мы сохраняем полезную цитату или ссылку, но: + +- не знаем, как с этим дальше работать; +- не связываем с другими идеями; +- не превращаем в знания или действия. + +📦 Через месяц — это мёртвый груз. + +В голове нет структуры, а в заметках — хаос. + +--- + +## 🧩 Что такое Zettelkasten (и что мы под ним понимаем) + +Zettelkasten + +— это система, в которой **каждая заметка — это часть живой сети**. Это способ **думать через записи**, а не просто их собирать. + +⚠️ Мы используем **современную цифровую адаптацию Zettelkasten (ZK 2.0)**. +Оригинальная система Лумана была ближе к древовидной структуре (1 → 1a → 1a1), без перекрёстных ссылок. + +![Pasted image 20250506230209.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/Obsidian/%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%84%D0%B0%D0%BA%D1%82%D0%BE%D1%80%D1%8B/0.%20Files/Pasted%20image%2020250506230209.png) + +Pasted image 20250506230209.png + +📚 В Obsidian удобнее работать через вики-ссылки — это ближе к **wiki-style**, но с теми же целями: создавать связную систему идей. + +--- + +## 🧱 3 типа заметок + +💭 **Мимолётные** — мысли, вопросы, идеи → попадают в `📥 Inbox`. + +📚 **Литературные** — переработка фрагментов книг, видео, статей → своими словами, с источником. + +🧠 **Постоянные** — осознанные выводы, которые актуальны долго → это и есть ваша база знаний. + +--- + +## 📌 Принципы заметок + +- **Атомарность** — одна мысль = одна заметка +- **Связность** — каждая заметка связана с другими +- **Понятность** — написано своими словами +- **Полезность** — пригодится в будущем + +--- + +## 🔄 Пример потока + +🧠 Идёшь по улице — возникает мысль: +«Почему я откладываю важные дела?» +→ записал как **мимолётную заметку** в Inbox. + +📖 Читаешь статью: +«Прокрастинация — это защита от страха неудачи». +→ сделал **литературную заметку** — суть своими словами + источник. + +💡 **Потом понял**: +«Я прокрастинирую, потому что боюсь облажаться» +→ записал как **постоянную заметку** и связал с: + +- `[[Страх неудачи]]` +- `[[Как справляться с прокрастинацией]]` +- `[[Метод двух минут]]` + +--- + +## 🗂️ Как структурировать знания: PARA + CODE + +Мы объединили Zettelkasten с двумя мощными подходами: + +### 1\. 📁 PARA (структура хранения) + +О нем мы подробно писали в [Метод PARA](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+PARA) + +- `📂 Projects` — текущие задачи и проекты +- `💼 Areas` — сферы жизни (здоровье, финансы, учеба) +- `📚 Resources` — полезные материалы +- `🗃️ Archive` — неактуальное, но может пригодиться + +### 2\. ⚙️ CODE (процесс обработки) + +Также писали про него в [Метод CODE](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+CODE) + +- `🖊️ Capture` — захват идеи +- `🧩 Organize` — положить в систему +- `🧪 Distill` — выжать суть +- `🚀 Express` — применить: написать, сделать, использовать + +--- + +## 💻 Для создания связей я использую шаблон + +С ним вы можете подробно познакомиться на сайте [base/Шаблоны](https://eltonlabs.org/base/%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B) + +--- + +## 📥 Работа с Inbox + +Каждая новая заметка — сначала попадает в Inbox. +1 раз в неделю (10–15 мин) я провожу рефакторинг: + +- удалить лишнее +- осмыслить ценное +- перенести в нужную папку в соответствии [с методом PARA](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+PARA) + +--- + +## 🎡 Возвращайся к старым мыслям + +Иногда полезно вспомнить, о чём думал месяц назад. + +🎲 Используй кнопку **“Случайная заметка”** (у меня это `Alt + Q`) + +--- + +## 🤝 Заключение + +Zettelkasten — это не про красивую систему. Это **про мышление**. +Главное — **не усложнять**: + +✅ Начни с Inbox +✅ Пиши своими словами +✅ Делай короткие и связанные заметки +✅ Применяй в проектах и жизни + +🧭 А дальше — ты сам удивишься, как начинает работать твоя внутренняя база знаний. + +Идем дальше? + +- 🧠 [4 этапа обучения](https://eltonlabs.org/base/4+%D1%8D%D1%82%D0%B0%D0%BF%D0%B0+%D0%BE%D0%B1%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D1%8F) +- [⬅️ Назад на главную](https://eltonlabs.org/home) \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/6.MOC - центры управления.md b/0.FILES/8.Як вести нотатки/6.MOC - центры управления.md new file mode 100644 index 0000000..6dd6b1f --- /dev/null +++ b/0.FILES/8.Як вести нотатки/6.MOC - центры управления.md @@ -0,0 +1,312 @@ +--- +title: "moc-notes" +source: "https://eltonlabs.org/base/moc-notes" +author: + - "[[Elton Labs]]" +published: +created: 2025-09-15 +description: "Обсидиан - Elton Labs" +tags: + - "clippings" +--- +## 🧠 Как превратить хаос в систему: + +Используем: [MOC](https://eltonlabs.org/base/moc-notes), [Метод PARA](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+PARA), [Метод CODE](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+CODE), [Framework thinking](https://eltonlabs.org/base/Framework+thinking), [Zettelkasten](https://eltonlabs.org/base/Zettelkasten) и [notebooklm](https://eltonlabs.org/base/notebooklm) в Obsidian + +![obsidian_moc.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc.jpg) + +--- + +### Obsidian предлагает уникальные возможности для организации системы заметок. + +Но без правильного применения он превращается в хранилище случайных, слабо связанных и бесполезных записей. Эти заметки лежат как попало, в непонятных местах — и не работают на тебя. + +В этой заметке ты узнаешь: + +- Как создать **центр управления своими заметками** через MOC +- Как связать **фреймворки CODE, PARA и Zettelkasten** +- Как превратить заметки в **инструмент мышления и действия** +- Как использовать **ИИ для создания связей, инсайтов и даже подкастов** + +--- + +### CODE, PARA, Zettelkasten — как основа структуры + +В прошлых выпусках я рассказывал о трёх фреймворках: + +### 1️⃣ Метод CODE + +> 12 фильтров, чтобы понять: стоит ли идея твоего внимания? Нужно ли создавать заметку с ней? + +*Подробнее прочитайте в [Метод CODE](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+CODE)* + +### 2️⃣ Zettelkasten + +- Все заметки делятся на **мимолётные**, **литературные** и **постоянные** +- Мимолётная может превратиться в литературную — а затем в постоянную, когда оформится мысль + +Мимолетная заметка — наши мимолетные мысли и идеи. +Литературная заметка — теория, фреймворки, книги. + +Постоянная заметка = мимолетная + литературная + +### 3️⃣ Метод PARA + +> Projects, Areas, Resources, Archive + +Когда заметка созрела — она попадает в одну из этих папок в зависимости от роли. + +### 🔴 Но возникает проблема: + +- Заметки просто лежат в папках +- Мы не возвращаемся к ним +- Нет контекста — нет связей. Нет общей картины. +- Obsidian становится самоцелью, а не инструментом + +--- + +## 🗺️ Что спасает? + +#### Map of Content — MOC — Карта Контента + +### Что такое MOC? + +MOC — это центральная заметка, которая собирает в себя ссылки на все заметки по теме. + +![obsidian_moc_04.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_04.jpg) + +#### Как это сделать? + +1. Ты просто создаёшь MOC в каждой подпапке PARA. +2. Выделяешь заметки из подпапки + 1. Для этого зажми кнопку "Shift" + 2. Нажми на первую и последнюю + +Как выделить заметки: + +![Pasted image 20250705184415.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/0.%20Files/Pasted%20image%2020250705184415.png) + +Pasted image 20250705184415.png + +1. Отпусти shift и левый кнопкой мыши - перенеси их в созданный MOC: + +Получится так: + +![Pasted image 20250705184540.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/0.%20Files/Pasted%20image%2020250705184540.png) + +Pasted image 20250705184540.png + +Примеры MOC: + +- `MOC - Продуктивность` +- `MOC - Самоанализ` +- `MOC - Здоровье` + +В одной теме могут быть много подтем, соответственно много MOC. + +Всё индивидуально: количество MOC неограниченно, главное, чтобы было удобно ориентироваться позднее. + +**Зачем?** + +- Самое главное — видишь общую картину, все заметки по этой теме! + - Визуализируешь тему + - Видишь пробелы + - Связываешь фреймворки и практики + +Как выглядит у меня? + +![obsidian_moc_02.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_02.jpg) +![obsidian_moc_03.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_03.jpg) + +--- + +## Мы видим все заметки в одной MOC, и что дальше? + +А дальше.. +==Мы создаем из этого свой шаблон и фреймворк для размышлений и действий!== + +В видео на YouTube, мы превращали MOC "Продуктивность" в шаблон действий и размышлений. + +![obsidian_moc_05.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_05.jpg) + +Например: + +1. **Ключевой вопрос** + 1. Иногда это может быть один из 12 фильтр-вопросов - [Метод CODE](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+CODE) + Например: *«Какова моя оптимальная система для прогресса и сохранения энергии, учитывая мои цели и склонность к перфекционизму?»* +2. **Принципы и столпы ответа** + - управление временем + - управление энергией + - правильное целеполагание + - система заметок + - преодоление прокрастинации и перфекционизма + - восстановление и отдых +3. **Связи с другими MOC** + Например, принцип «энергия» связан с `MOC - Здоровье`, а «перфекционизм» с `MOC - Самоанализ` +4. **Конкретные заметки** + Связываем каждый принцип с конкретной заметкой +5. **Отслеживание прогресса** + Через `Areas` — Сферы жизни + +![obsidian_moc_06.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_06.jpg) + +--- + +## ⚙️ Пример из практики + +1. Создаю мимолётную заметку: + > "Хорошее выступление можно создать лишь с помощью необычных трюков" + > Ставлю тег `#мимолетные` +2. Через время — вижу её в `MOC - Inbox` + +Как выглядит заметка "MOC - Inbox" + +![obsidian_moc_07.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_07.jpg) +![obsidian_moc_08.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_08.jpg) + +--- + +**Как создать такую динамическую табличку со входящими заметками?** + +1. Установите плагин Dataview +2. Активируйте в настройках плагина строку "Enable Javascript..." +3. Создайте заметку "MOC - Inbox" +4. Вставьте следующий код + +``` +dataviewjs +const allPages = dv.pages('"0. Files/6. Inbox"'); + +// Категория 1 — с тегом #мимолетные +const mim = allPages.where(p => p.file.tags?.includes("#мимолетные")); + +// Категория 2 — с тегом #литературные +const lit = allPages.where(p => p.file.tags?.includes("#литературные")); + +// Категория 3 — без тегов вообще +const noTag = allPages.where(p => !p.file.tags || p.file.tags.length === 0); + +// Вывод +dv.header(3, "✔️ Мимолетные"); +dv.table(["Заметка"], mim.map(p => [p.file.link])); + +dv.header(3, "📖 Литературные"); +dv.table(["Заметка"], lit.map(p => [p.file.link])); + +dv.header(3, "📂 Без тега"); +dv.table(["Заметка"], noTag.map(p => [p.file.link])); +``` + +1. В коде поменяйте путь к папке, где создаются у вас новые заметки (у меня это папка 6. Inbox, или же входящие) +2. И всё. При создании новых заметок, после присвоения хештеги мимолетные или хештега литературные - заметка будет отображена в MOC "Inbox" + > ![obsidian_moc_07.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_07.jpg) + +--- + +\*итак, мы создали заметку "Хорошее выступление..." +3\. Теперь открываем вновь его и развиваем свою мысль, превращая его в гипотезу: + +- Добавляю мысль: *нужен интерактив, лекционный формат устарел* +- Подтверждаю из литературы: *геймификация в презентациях* + +1. Таким образом превращаю в постоянную заметку +2. Теперь осталось выбрать в какую папку PARA он переместится: в Projects, Areas, Resources или же Archive. +3. Очевидно, что это отлично подойдет для папки Resources. + +--- + +#### Я автоматически перемещаю заметку в соответствующую папку с помощью тега + +- Для этого я использую плагина Auto Note Mover +- Указал в настройках папку, куда нужно перемещать, и указал тег-условие + +Как выглядят настройки плагина Auto Note Mover: + +![Pasted image 20250705190933.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/base/0.%20Files/Pasted%20image%2020250705190933.png) + +Pasted image 20250705190933.png + +- теперь автоматически, когда я буду писать [#выступления](https://eltonlabs.org/base/#%D0%B2%D1%8B%D1%81%D1%82%D1%83%D0%BF%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F) - заметка будет перемещена в папку "Личный бренд" + +--- + +1. Затем я связываю эту заметку "Хорошее выступление..." с `MOC - Личный бренд` +2. Использую плагин `AutoMOC`, чтобы вручную вставить обратные ссылки + +--- + +### Зачем я использую плагин AutoMoc, если можно использовать Dataview или "Обратные ссылки" + +- Плагин Dataview не возвращает ссылку, а лишь визуализирует его - это значит, что я не могу просто взять и переместить заметку куда-то, а код dataview оставить. +- Плагин AutoMOC позволяет возвращать обратную ссылку, куда угодно - а затем и вовсе изменять его, перемещать. +- Для этого просто установите плагин AutoMOC +- Используйте команду "Add missed links": + - Либо через CTRL + P (палитра команд) — "AutoMOC" + - Либо назначьте горячую клавишу через настройки -> сочетания клавиш + +--- + +1. И финальный штрих - используем на практике. + Например, у меня есть проект "Выступление на форуме": + +- я открываю заметку с подготовкой к выступлению +- в соседнем окне открываю MOC "Личный бренд" (или же MOC "Выступление") +- И просто использую его в качестве шаблона при подготовке к выступлению, чтобы точно учесть все нюансы + +Таким образом, я связывал папки Resources и Projects, не перемещая сами заметки между папками + +--- + +## А что если я не знаю как сделать MOC для себя? + +Что, если не знаю? + +![obsidian_moc_10.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/assets/obsidian_moc_10.jpg) + +### Подключаем ИИ для решения проблемы + +1. Экспортируй 4 папки PARA в `.md` с помощью плагина `Advanced Merge` + 1. Установи плагин Advanced Merge + 2. Включи в настройках галочку "Вкачать вложенные папки" (2 по списку) + 3. Нажимай на папки правой кнопкой мыши + 4. Выбирай "Объединить папку" + 5. Готово! Вы получите заметку со всеми заметками внутри вашей папки. + 6. Проделайте тоже самое с остальными папками PARA (projects, areas, resources, archive) +2. Загрузите их в [NoteBookLM](https://notebooklm.google/) +3. Вставьте ему [промпт для генерации MOC и связей между вашими заметками](https://eltonlabs.org/base/prompt-for-notebooklm-obsidian) +4. Вы получите развернутое сообщение от ИИ с потенциальными связями и MOC. + +💡 Вы также можете получить подкаст на основе вашего Obsidian-хранилища. Для этого нажмите "Customize", там где подкасты и отправьте ему промпт: + +- [Промпт для создания подкаста на базе хранилища Obsidian](https://eltonlabs.org/base/prompt-for-notebooklm-podcast-based-obsidian) + +--- + +### Заключение + +Правильно оформленный MOC — это не просто список ссылок. Это **живая карта твоего мышления**, которая помогает видеть структуру, а не хаос. + +Он связывает фреймворки (CODE, PARA, Zettelkasten), темы, принципы и цели — **в одну рабочую систему**. Ты начинаешь не просто копить заметки, а **думать через них**. + +Всё начинается с вопроса. +Затем — принципы. +Потом — связи, практика, прогресс. +И наконец — ревизия. Без неё система умирает. + +Я регулярно возвращаюсь ко всем своим MOC, чтобы держать свою систему живой, адаптивной, настоящей. Потому что заметки без пересмотра — как сосуды без движения: в них застаивается знание. + +--- + +### Было интересно? + +- Поделись с друзьями +- Подпишись на канал и в Telegram + +Впереди будут ролики про граф в Obsidian, а также расскажу - как я провожу ревизию и рефакторинг своих заметок + +--- + +Идем дальше? + +- [Перейти к изучению внутренних функций Obsidian](https://eltonlabs.org/%D0%9E%D0%B1%D1%81%D0%B8%D0%B4%D0%B8%D0%B0%D0%BD#^28fef6) +- [⬅️ Назад на главную](https://eltonlabs.org/home) \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/7.Выражайте ваши заметки.md b/0.FILES/8.Як вести нотатки/7.Выражайте ваши заметки.md new file mode 100644 index 0000000..01c72fe --- /dev/null +++ b/0.FILES/8.Як вести нотатки/7.Выражайте ваши заметки.md @@ -0,0 +1,359 @@ +--- +title: "express-your-notes" +source: "https://eltonlabs.org/base/express-your-notes" +author: + - "[[Elton Labs]]" +published: +created: 2025-09-15 +description: "Обсидиан - Elton Labs" +tags: + - "clippings" +--- +## Три уровня EXPRESS: как превратить мертвые заметки в живую базу знаний + +![EX_01.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX_01.jpg) + +*Почему 80% пользователей Obsidian упускают огромный потенциал своих заметок и как это исправить* + +## Проблема мертвых заметок + +Представьте: у вас есть 2000 тщательно собранных заметок в Obsidian. Вы потратили месяцы на создание идеальной системы PARA, настроили плагины, создали красивые MOC-карты. Но заметки просто лежат в вашем хранилище как сокровища в пещере — ценные, но бесполезные. + +![Pasted image 20250802192925.png](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/Pasted%20image%2020250802192925.png) + +Pasted image 20250802192925.png + +Эта ситуация знакома большинству пользователей Obsidian. + +Проблема + +Мы становимся коллекционерами информации, но забываем о главном предназначении знаний — быть выраженными и примененными в реальной жизни. Само слово "продуктивность" происходит от латинского "producere" — производить, создавать. + +**Ключевая проблема заключается в том, что мы останавливаемся на букве "O" в методе CODE** (Capture, Organize, Distill, Express), игнорируя последний и самый важный этап — Express (выражение). Мы захватываем информацию, организуем её, дистиллируем в инсайты, но не выражаем наружу. + +### Наука об обучении через выражение + +Конус обучения Эдгара Дейла показывает поразительную разницу в усвоении информации: + +![EX02.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX02.jpg) + +- **Пассивное потребление** (чтение, слушание лекций): всего 5-10% запоминания +- **Активное участие** (дискуссии, практическое применение): 50-70% запоминания +- **Обучение других и выражение знаний**: до 90% запоминания + +Инсайт, который вы замечали + +Когда вы вынуждены объяснить концепцию другому человеку или написать о ней статью, ваш мозг активирует множественные нейронные пути. Вы не просто вспоминаете информацию — вы её реконструируете, находите связи, выявляете пробелы в понимании. + +**Исследования показывают**, что регулярное выражение мыслей о сложных ситуациях снижает уровень кортизола и тревожности на 23%. Письменное изложение идей активирует префронтальную кору мозга, ответственную за критическое мышление и самоанализ. + +### Статистика и заблуждение коллекционера + +По статистике, 80% пользователей Obsidian ограничиваются лишь внутренними формами выражения — создают MOC, пишут резюме книг, ведут дневники. Это безусловно ценно, но упускает огромный потенциал внешнего выражения. + +![EX03.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX03.jpg) + +**Заблуждение коллекционера** — психологическая ловушка, когда накопление информации создает иллюзию знания. Мы чувствуем себя экспертами, имея тысячи заметок, но на самом деле не можем применить эти знания или поделиться ими с другими. + +Многим мешает перфекционизм. Нам кажется, что нужно "идеальное время", "правильное место", "подходящий формат". Мы откладываем публикацию, ожидая момента, когда наши мысли станут "достаточно хорошими". Но знания становятся активными только когда они выражаются и применяются. + +## Метод CODE и недооцененная буква E + +Тьяго Форте, создатель [Метод CODE](https://eltonlabs.org/base/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4+CODE) (Capture-Organize-Distill-Express), подчеркивает, что Express — не дополнительная часть, а **цель всей работы со знаниями**. Без выражения предыдущие этапы теряют смысл. + +![EX04.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX04.jpg) + +### Capture (Захват) + +Первый этап — сбор информации, которая вызывает внутренний отклик. Это может быть интересная цитата из книги, инсайт во время прогулки, идея из разговора с коллегой. Главное — зафиксировать то, что резонирует с вашими интересами и целями. + +### Organize (Организация) + +Второй этап — структурирование информации по темам и проектам. Здесь работает система PARA: Projects (проекты), Areas (сферы), Resources (ресурсы), Archive (архив). Информация получает контекст и место в общей структуре. + +### Distill (Дистилляция) + +Третий этап — извлечение сути, создание собственных формулировок, выделение ключевых идей. Вы не просто сохраняете чужие мысли, а перерабатываете их через призму своего опыта. + +### Express (Выражение) + +**Четвертый этап — самый важный и самый игнорируемый.** Здесь знания превращаются из пассивного багажа в активный инструмент влияния на мир. Express означает применение знаний в работе, проектах, обучении других. + +--- + +## Три уровня выражения заметок + +Выражение знаний происходит на трех уровнях, каждый со своими особенностями, преимуществами и ограничениями. + +![EX05.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX05.jpg) + +### Личный уровень EXPRESS + +**Личный EXPRESS** — это выражение знаний для себя будущего. Вы создаете материалы, как если бы обучали другого человека, но адресатом остаетесь вы сами. + +#### MOC как центры управления знаниями + +Maps of Content (MOC) — не просто навигационные центры, но инструменты активного выражения. Хороший MOC связывает ваши заметки с принципами и целями в данной теме. Например, MOC по теме "Продуктивность" может включать: + +- Ваши эксперименты с техниками +- Принципы, которые работают лично для вас +- Связи между разными подходами +- Применение в конкретных проектах + +Читайте статью про [МОК](https://eltonlabs.org/base/moc-notes) + +#### Создание учебников для себя + +![ex06.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/ex06.jpg) + +Формула создания личных учебников проста: **конспекты + теория + инсайты + ваш опыт + возможные вопросы и ответы**. Вы можете создать руководство "Как я изучаю новые языки программирования" или "Мой подход к анализу инвестиций". + +Можно использовать теги для сбора материала. Например, тег `#книга_по_лени` во всех заметках, относящихся к будущей книге о прокрастинации. Плагин Dataview поможет автоматически собрать все связанные заметки в одну таблицу. + +Функция "Открыть случайную заметку" в Obsidian становится инструментом ревизии — просматривайте случайные заметки и решайте, подходят ли они для вашего будущего "учебника". + +#### Терапевтические дневники и анализ мыслей + +![EX07.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX07.jpg) + +Третий способ личного выражения — создание аналитических дневников. Это не простое описание событий, а **анализ мыслей, паттернов поведения, эмоциональных реакций**. + +Исследования показывают, что регулярное выражение мыслей о сложных ситуациях снижает уровень стресса и улучшает психическое здоровье. Письменная рефлексия помогает: + +- Выявить повторяющиеся паттерны мышления +- Проанализировать триггеры стресса и тревоги +- Отследить прогресс в решении личных проблем +- Подготовить материал для работы с психологом + +Можно создать YAML-поля в ежедневных заметках для структурированного анализа: + +```yaml +--- +Мысль_дня: "Заметил, что откладываю сложные задачи на конец дня" +Инсайт: "Новый метод медитации - смотреть на свечку 15 минут" +--- +``` + +А потом отобразить в отдельной заметке с помощью плагина [Dataview](https://eltonlabs.org/base/Dataview) + +``` +table Мысль_дня as "Мысль дня", Инсайт as "Инсайт дня" +from "2. Areas/Мой дневник/1-3 Daily notes" +where contains(file.name, "-07-2025") +sort file.name asc +``` + +### Командный уровень EXPRESS + +![EX08.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX08.jpg) + +Второй уровень выражения — **делиться знаниями в небольшом, доверенном кругу**. Это могут быть коллеги, друзья, семья, участники закрытых сообществ. + +#### Правило 10/10/10 + +Некоторые эксперты рекомендуют метод 10/10/10: + +- **10 минут в день** на личные заметки +- **10 минут** на их обобщение и структурирование +- **10 минут** на шеринг с командой или близким кругом + +Этот подход превращает знания в живой, циркулирующий ресурс команды. + +#### Форматы командного выражения + +**Письменные форматы:** + +- Еженедельные инсайты по email — короткие рассылки с главными открытиями недели +- Внутренние Wiki команды — структурированная база знаний проекта +- Закрытые каналы в Telegram или Slack для обмена идеями +- Notion-страницы для коллективной работы над документами + +**Устные форматы:** Согласно конусу обучения Эдгара Дейла, информация отлично запоминается через участие в дискуссиях, ролевых играх, имитации реальной деятельности. Поэтому эффективны: + +- Еженедельные встречи с обсуждением инсайтов +- Книжные клубы в команде или среди друзей +- Ужины с тематическими дискуссиями +- Воркшопы и мини-лекции для коллег + +#### Преимущества командного выражения + +**Разнообразная обратная связь** — люди с разным опытом и перспективами помогают увидеть слепые пятна в ваших рассуждениях. Коллега-программист может указать на технические неточности, а друг-психолог — на человеческие аспекты идеи. + +**Создание единого информационного поля** — когда команда регулярно делится знаниями, снижается дублирование работы и повышается общий уровень экспертизы. + +**Документирование неявных знаний** — многие ценные инсайты существуют только в головах экспертов. Командное выражение помогает сделать это знание доступным всем. + +**Повышение доверия и сплоченности** — открытый обмен идеями создает культуру обучения и взаимопомощи. + +### Публичный уровень EXPRESS + +![EX09.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX09.jpg) + +Третий уровень — **публичное выражение для широкой аудитории**. Это наиболее сложный, но и наиболее ценный уровень выражения знаний. + +#### Психологические барьеры + +**Синдром самозванца** — главное препятствие для публичного выражения. Нам кажется, что мы недостаточно экспертны, что наши идеи банальны, что кто-то уже сказал это лучше. + +Важно понимать: **вы не обязаны быть экспертом мирового уровня**, чтобы поделиться полезными инсайтами. Ваш уникальный опыт и перспектива имеют ценность. Человек, который изучает тему полгода, часто лучше объяснит её новичку, чем эксперт с 20-летним стажем. + +**Перфекционизм** заставляет откладывать публикацию до "идеального момента". Но знания развиваются через итерации и обратную связь, а не через долгие размышления в изоляции. + +#### Концепция Digital Garden + +![EX10.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX10.jpg) + +Здесь на помощь приходит концепция **Digital Garden (цифрового сада)** — радикальной альтернативы традиционному блогингу. + +**Блог vs Digital Garden:** + +**Традиционный блог:** + +- Хронологический порядок постов +- "Завершенные" статьи +- Линейное повествование +- Страх публиковать "несовершенное" + +**Digital Garden:** + +- Топическая организация контента +- Развивающиеся заметки +- Сетевая структура связей +- Комфорт с незавершенностью + +#### Статусы развития идей + +Digital Garden использует **систему статусов** для обозначения зрелости идей: + +**🌱 Seedlings (Ростки)** — сырые мысли, черновики, первичные инсайты. Это может быть короткая заметка с интересной идеей, которая требует развития. + +**🌿 Budding (Развивающиеся)** — идеи в процессе проработки. Заметка имеет структуру, но нуждается в дополнении примерами, источниками, связями с другими концепциями. + +**🌳 Evergreen (Зрелые)** — хорошо проработанные заметки с четкой аргументацией, примерами, связями. Это не значит, что они никогда не изменятся, но они достаточно развиты для самостоятельного чтения. + +#### Эпистемический статус + +Дополнительно к статусам развития полезно указывать **эпистемический статус** — уровень вашей уверенности в утверждениях: + +- "Высокая уверенность" — проверенные факты и хорошо обоснованные выводы +- "Средняя уверенность" — вероятные гипотезы с некоторыми подтверждениями +- "Предварительные мысли" — ранние идеи, требующие проверки +- "Спекуляция" — интересные размышления без претензий на истину + +#### Преимущества публичного выражения + +**Максимальная обратная связь** — публичная аудитория предоставляет самый широкий спектр мнений и экспертизы. Ваша заметка о продуктивности может получить комментарии от предпринимателей, исследователей, студентов. + +**Мотивация к качеству** — знание, что вас читают, повышает стандарты мышления и изложения. Вы тщательнее проверяете факты, ищете контраргументы, улучшаете ясность выражения. + +**Построение репутации** — регулярное качественное публичное выражение создает профессиональную репутацию и открывает новые возможности. + +**Влияние на мир** — ваши идеи могут изменить чье-то мышление, помочь решить проблему, вдохновить на действия. + +## Преодоление барьеров на пути к выражению + +![EX11.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX11.jpg) + +### Начинайте с малого + +Не пытайтесь опубликовать все хранилище сразу. **Начните с 3-5 самых проработанных заметок**. Это может быть: + +- Резюме книги, которая вас вдохновила +- Анализ решения рабочей проблемы +- Описание эксперимента с новой привычкой +- Объяснение сложной концепции простыми словами + +### Принцип промежуточных результатов + +Attention + +Не ждите "финальных шедевров". **Публикуйте промежуточные результаты** — размышления в процессе, ранние гипотезы, частично проработанные идеи. Читатели часто находят больше ценности в процессе мышления, чем в готовых выводах. + +### Обратная связь как топливо развития + +**Каждый комментарий — возможность улучшить исходную заметку** в Obsidian. Критика помогает выявить слабые места в аргументации, вопросы читателей показывают, что нужно объяснить подробнее, поддержка мотивирует развивать тему дальше. + +### Правило "учите то, что изучаете" + +Не ждите, пока станете экспертом. **Начинайте делиться знаниями в процессе изучения**. Человек, который осваивает новый навык, часто лучше объясняет начальные этапы, чем мастер, забывший о трудностях новичков. + +## Практические стратегии внедрения EXPRESS + +### Еженедельная ревизия для выражения + +Заведите привычку еженедельно просматривать свои заметки с вопросом: **"Что из этого может быть полезно другим?"** Даже простое наблюдение или инсайт могут стать ценными для кого-то еще. + +### Создание контент-планов из заметок + +Ваши заметки — готовый источник идей для контента. MOC по теме "Продуктивность" может стать планом серии статей: + +- "5 экспериментов с утренними рутинами" +- "Как я победил прокрастинацию с помощью техники Pomodoro" +- "Почему GTD не работает для креативных профессий" +- "Цифровой минимализм: мой опыт отказа от социальных сетей" + +### Техника "от заметки к статье" + +1. **Выберите заметку** с интересным инсайтом +2. **Добавьте контекст** — как вы пришли к этой идее +3. **Приведите примеры** из личного опыта +4. **Найдите связи** с другими концепциями +5. **Добавьте призыв к действию** — что может сделать читатель + +### Метод прогрессивного раскрытия + +Начинайте с коротких постов в социальных сетях, постепенно развивая их в полноценные статьи: + +1. **Пост** — основная идея в 1-2 предложениях +2. **Карусель** — развернутое объяснение +3. **Короткая статья** — с примерами и источниками +4. **Длинный лонгрид** — глубокий анализ темы + +## Системный подход к развитию EXPRESS + +![EX12.jpg](https://publish-01.obsidian.md/access/60c961e29407841ba02a29cbc8ca3549/0.%20Files/2.%20Images/EX12.jpg) + +### Создание контент-системы + +**Входящий поток** — регулярный захват идей из книг, подкастов, разговоров, наблюдений. + +**Обработка** — еженедельная ревизия заметок с маркировкой потенциального контента. + +**Производство** — регулярная публикация в выбранном формате и на выбранной платформе. + +**Обратная связь** — анализ реакции аудитории и улучшение исходных заметок. + +### Измерение прогресса + +Отслеживайте не только внешние метрики (просмотры, лайки), но и **внутренние показатели**: + +- Количество заметок, переведенных в публичный формат +- Частота обновления "старых" заметок на основе обратной связи +- Качество связей между идеями в вашем хранилище +- Скорость превращения новых инсайтов в контент + +### Долгосрочное видение + +EXPRESS — не разовая активность, а **образ жизни исследователя знаний**. Ваши заметки становятся живой, дышащей системой, которая: + +- Развивается через взаимодействие с читателями +- Создает сеть единомышленников вокруг ваших идей +- Превращает личные инсайты в общественную ценность +- Мотивирует к более глубокому изучению тем + +## Заключение: от коллекционера к творцу + +Переход от коллекционирования заметок к их выражению — это переход **от потребителя к творцу знаний**. Ваши 2000 заметок в Obsidian могут стать не музейными экспонатами, а живыми инструментами влияния на мир. + +Начните сегодня с одной заметки. Выберите идею, которая кажется вам ценной, и поделитесь ей с одним человеком. Это может быть коллега, друг или незнакомый читатель в интернете. **Главное — сделать первый шаг** от пассивного накопления к активному выражению. + +Помните: знание становится силой только тогда, когда оно выражается и применяется. Ваши заметки ждут своего часа, чтобы превратиться из цифрового хлама в источник вдохновения и пользы для других. + +**Следующий шаг:** откройте Obsidian, выберите одну заметку и подумайте — как эта идея может помочь кому-то еще? Возможно, именно сегодня ваши "мертвые" заметки начнут новую жизнь. + +Идем дальше? + +- 1. [Настраиваем Obsidian Publish](https://eltonlabs.org/base/obsidian-publish) +- 1. [Настраиваем Quartz + Github](https://eltonlabs.org/base/obsidian-quartz) +- 1. [Настраиваем Teletype&Telegraph](https://eltonlabs.org/base/teletype-telegraph) +- [⬅️ Назад на главную](https://eltonlabs.org/home) \ No newline at end of file diff --git a/0.FILES/8.Як вести нотатки/PARA.md b/0.FILES/8.Як вести нотатки/PARA.md new file mode 100644 index 0000000..7477674 --- /dev/null +++ b/0.FILES/8.Як вести нотатки/PARA.md @@ -0,0 +1,6 @@ + +P - projects - краткосрочные задачи и цели +А - areas - долгосрочные задачи на протяжении какого-то времени +R - resources - Интересные для вас темы +А - archive - всё, что временно неактуально + diff --git a/0.FILES/Как стать лучшей версией себя Обзор и настройка трекера в Обсидиан.md b/0.FILES/Как стать лучшей версией себя Обзор и настройка трекера в Обсидиан.md new file mode 100644 index 0000000..c961c7e --- /dev/null +++ b/0.FILES/Как стать лучшей версией себя Обзор и настройка трекера в Обсидиан.md @@ -0,0 +1,64 @@ +--- +title: "Как стать лучшей версией себя? Обзор и настройка трекера в Обсидиан" +source: "https://www.youtube.com/watch?v=3S8bwvnh3zQ" +author: + - "[[Nata Dobryak]]" +published: 2025-07-31 +created: 2025-09-17 +description: "Смотрите любимые видео, слушайте любимые песни, загружайте собственные ролики и делитесь ими с друзьями, близкими и целым миром." +tags: + - "clippings" +--- +![](https://www.youtube.com/watch?v=3S8bwvnh3zQ) + +Разбираю пошагово как настроить трекер привычек в Обсидиане. Покажу 3 способа визуализации привычек за месяц и год. + +🚀 Готовый трекер привычек для Obsidian!👉 https://boosty.to/natadobryak/posts/7066bfbe-14d3-4c5c-aa81-6aecf5751ef9?share=post\_link + +Мой тг канал: https://t.me/+N4RCP7mgM3hlZTIy +Boosty: https://boosty.to/natadobryak +Файл с полезными материалами по Обсидиану (бесплатно): https://boosty.to/natadobryak/posts/8fdbaacb-db9d-47a0-a0e4-8ee76b6167d6?share=post\_link + +Если видео окажется для вас полезным, не забудьте поставить лайк и подписаться на канал — впереди будет ещё больше видео по Обсидиан, а также полезные лайфхаки для продуктивной работы с заметками. + +Полезные ссылки из видео: +1\. Больше примеров можно посмотреть здесь - https://github.com/pyrochlore/obsidian-tracker/tree/master/examples +2\. Саммари для календаря - https://github.com/pyrochlore/obsidian-tracker/blob/master/examples/HabitTracker.md +3\. Саммари для линейного графика - https://github.com/pyrochlore/obsidian-tracker/blob/master/examples/TestSummary.md +4\. Запрос для секторного графика (pie) - https://github.com/pyrochlore/obsidian-tracker/blob/master/examples/TestPieChart.md +5\. Примеры heatmap-tracker (Github) - https://github.com/mokkiebear/heatmap-tracker/tree/main/EXAMPLE\_VAULT +6\. Ссылка на мои запросы для heatmap Tracker (не забудьте изменить название привычки, папку и формат даты ваших ежедневных заметок) - https://t.me/fromchemtovfx/279 +7\. Форматы записи дат для шаблонов - https://momentjs.com/docs/#/displaying/format/ +8\. Параметры для запросов трекера - https://github.com/pyrochlore/obsidian-tracker/blob/master/docs/InputParameters.md +9\. Примеры запросов для трекера - https://github.com/pyrochlore/obsidian-tracker/tree/master/examples +10\. Ссылка на сниппет dashboard.css (в моем тг) - https://t.me/fromchemtovfx/263 +11\. Ссылка на скрипт для визуализации привычек с помощью прогресс бара как на видео - https://t.me/fromchemtovfx/270?comment=966 + +Таймкоды: +00:00 - Вступление +00:19 - Как лучше трекать привычки? +00:57 - Приложения для телефона +02:04 - Плагины для трекинга привычек в Обсидиан +02:33 - Настраиваем папки и шаблоны +06:54 - Настройка плагина Tracker +07:54 - Вид месяца (month) +11:37 - Саммари для месяца +12:48 - Вид линейного графика (Line) +15:17 - Саммари для линейного графика +15:44 - Пример других представлений +16:57 - Как расположить несколько графиков в строчку +18:23 - Как установить CSS сниппеты +18:58 - Что учитывать при использовании dashboard.css +19:33 - Плагин Heatmap Tracker +21:11 - Бонусный вариант отображения +22:56 - Визуализация за год +23:44 - Про хранилище с настроенным трекером привычек + +Для связи: +tg: @natadobr +natdobryak@gmail.com +Другие соцсети: +vk: https://vk.com/natashadob +instagram: @natashulka + +#обсидиан #трекерпривычек #продуктивностьвобсидиан #obsidian \ No newline at end of file diff --git a/1.Projects/Poster/Poster.md b/1.Projects/Poster/Poster.md new file mode 100644 index 0000000..5d24036 --- /dev/null +++ b/1.Projects/Poster/Poster.md @@ -0,0 +1 @@ +Проєкт ведення соціальних мереж з допомогою сервісу n8n. \ No newline at end of file diff --git a/1.Projects/Poster/Перелік мереж в які можна постити повідомлення за допомогою API..md b/1.Projects/Poster/Перелік мереж в які можна постити повідомлення за допомогою API..md new file mode 100644 index 0000000..c551f44 --- /dev/null +++ b/1.Projects/Poster/Перелік мереж в які можна постити повідомлення за допомогою API..md @@ -0,0 +1,18 @@ +| Платформа | Тип / основна функція | Примітки / особливості | +| -------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Mastodon** | Мікроблогінг | Найвідоміша Fediverse-платформа. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **Pleroma** | Мікроблогінг | Легковісна реалізація, хороша для сервера з обмеженими ресурсами. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **Akkoma** | Мікроблогінг | Форк Pleroma з додатковими “фішками”. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **Misskey / Firefish / Calckey** | Мікроблогінг / соціальна мережа | Дуже кастомізована платформа, підтримує ActivityPub. ([Вікіпедія](https://en.wikipedia.org/wiki/Misskey?utm_source=chatgpt.com "Misskey")) | +| **Lemmy** | Обговорення / форуми | Альтернатива Reddit, працює по ActivityPub. ([Вікіпедія](https://en.wikipedia.org/wiki/Lemmy_%28social_network%29?utm_source=chatgpt.com "Lemmy (social network)")) | +| **Pixelfed** | Обмін фото | Подібна до Instagram, без централізованого контролю. ([Вікіпедія](https://it.wikipedia.org/wiki/Pixelfed?utm_source=chatgpt.com "Pixelfed")) | +| **PeerTube** | Відео | Децентралізований відеохостинг, підтримує P2P-обмін. ([Вікіпедія](https://en.wikipedia.org/wiki/PeerTube?utm_source=chatgpt.com "PeerTube")) | +| **Friendica** | Соцмережа “все-в-одному” | Має мультипротокольну підтримку (ActivityPub тощо). ([Open Future](https://openfuture.eu/wp-content/uploads/2021/10/decentralized-social-ecosystem-review.pdf?utm_source=chatgpt.com "Ecosystem Review")) | +| **Diaspora*** | Соцмережа / мікроблог | Один із старих проектів федерації. ([Вікіпедія](https://ru.wikipedia.org/wiki/Fediverse?utm_source=chatgpt.com "Fediverse")) | +| **Hubzilla** | Соцмережа / CMS | Дуже гнучка: пости, файли, сторінки. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **Funkwhale** | Аудіо / музика | Федеративний стрімінг і обмін музикою. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **WriteFreely / Write.as** | Блогінг | Писати довгі тексти, статті. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **Plume** | Блог / публікації | Ще один варіант для публікацій і блогів. ([Open Future](https://openfuture.eu/wp-content/uploads/2021/10/decentralized-social-ecosystem-review.pdf?utm_source=chatgpt.com "Ecosystem Review")) | +| **BookWyrm** | Книги / рецензії | Соцмережа для читачів та обговорення книжок. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **Mobilizon** | Події / групи | Організація подій, зустрічей, груп. ([Clygro](https://clygro.cc/fediverse.html?utm_source=chatgpt.com "What is the Fediverse? - Clygro's Website")) | +| **Kbin** | Новини / агрегатор / форуми | Активна платформа для обговорення та агрегування контенту. | \ No newline at end of file diff --git a/1.Projects/Баланс у тарілці/Ідея для каналу..md b/1.Projects/Баланс у тарілці/Ідея для каналу..md new file mode 100644 index 0000000..629e726 --- /dev/null +++ b/1.Projects/Баланс у тарілці/Ідея для каналу..md @@ -0,0 +1 @@ +Публікувати в канал актуальні знижки які допоможуть правильно харчуватись. \ No newline at end of file diff --git a/2.Areas/AI/Certificate.pdf b/2.Areas/AI/Certificate.pdf new file mode 100644 index 0000000..7b52e5e Binary files /dev/null and b/2.Areas/AI/Certificate.pdf differ diff --git a/2.Areas/AI/Day_1_v4 (1) uk.pdf b/2.Areas/AI/Day_1_v4 (1) uk.pdf new file mode 100644 index 0000000..68af229 Binary files /dev/null and b/2.Areas/AI/Day_1_v4 (1) uk.pdf differ diff --git a/2.Areas/AI/Інструменти штучного інтелекту для створення аудіовізуального контенту.md b/2.Areas/AI/Інструменти штучного інтелекту для створення аудіовізуального контенту.md new file mode 100644 index 0000000..b6784a4 --- /dev/null +++ b/2.Areas/AI/Інструменти штучного інтелекту для створення аудіовізуального контенту.md @@ -0,0 +1,17 @@ +**Інструменти штучного інтелекту для створення аудіовізуального контенту:** + +GPT-4o від OpenAI [https://openai.com/chatgpt/overview/](https://openai.com/chatgpt/overview/)  + +Midjourney [https://www.midjourney.com](https://www.midjourney.com/)  + +Suno [https://suno.com](https://suno.com/)  + +Udio [https://www.udio.com/](https://www.udio.com/)  + +ElevenLabs [https://elevenlabs.io/](https://elevenlabs.io/)  + +Runway [https://runwayml.com/](https://runwayml.com/)  + +Sora [https://sora.chatgpt.com/onboarding](https://sora.chatgpt.com/onboarding)  + +Veo 3 [https://veo3.ai](https://veo3.ai/) \ No newline at end of file diff --git a/2.Areas/AI/Вебінар__Штучний_інтелект_в_українському_бізнесі_можливість_чи_необхідність__від_Ощадбанку.pdf b/2.Areas/AI/Вебінар__Штучний_інтелект_в_українському_бізнесі_можливість_чи_необхідність__від_Ощадбанку.pdf new file mode 100644 index 0000000..bda0169 Binary files /dev/null and b/2.Areas/AI/Вебінар__Штучний_інтелект_в_українському_бізнесі_можливість_чи_необхідність__від_Ощадбанку.pdf differ diff --git a/2.Areas/AI/Кейси українського бізнесу.md b/2.Areas/AI/Кейси українського бізнесу.md new file mode 100644 index 0000000..08239ae --- /dev/null +++ b/2.Areas/AI/Кейси українського бізнесу.md @@ -0,0 +1,12 @@ +**Кейси українського бізнесу:** + +Штучний інтелект прискорює аналіз контрагентів (ПриватБанк) [https://otp24.privatbank.ua/news/888](https://otp24.privatbank.ua/news/888)  + +Розробники monobank створили внутрішню ШІ-систему E.N.O.T., яку натренували на розмовах з тімлідом. Олександр Кузьменко [https://dev.ua/news/v-monobank-zavivsia-ienot-1747985043](https://dev.ua/news/v-monobank-zavivsia-ienot-1747985043) + +Кейс бренду Graff: Як штучний інтелект трансформував комунікацію та задав нові стандарти в SMM [https://cases.media/case/keis-brendu-graff-yak-shtuchnii-intelekt-transformuvav-komunikaciyu-ta-zadav-novi-standarti-v-smm](https://cases.media/case/keis-brendu-graff-yak-shtuchnii-intelekt-transformuvav-komunikaciyu-ta-zadav-novi-standarti-v-smm)  + +Як пришвидшити виконання креативних задач. Кейси агенцій, які використовують штучний інтелект [https://cases.media/case/yak-prishvidshiti-vikonannya-kreativnikh-zadach-keisi-agencii-yaki-vikoristovuyut-shtuchnii-intelekt](https://cases.media/case/yak-prishvidshiti-vikonannya-kreativnikh-zadach-keisi-agencii-yaki-vikoristovuyut-shtuchnii-intelekt)  + +Як ми приручили штучний інтелект, або Хто тут тепер Sales-менеджер? [https://cases.media/case/yak-mi-priruchili-shtuchnii-intelekt-abo-khto-tut-teper-sales-menedzher](https://cases.media/case/yak-mi-priruchili-shtuchnii-intelekt-abo-khto-tut-teper-sales-menedzher) + diff --git a/2.Areas/AI/Моделі vs. сервіси vs. інструменти vs. агенти.md b/2.Areas/AI/Моделі vs. сервіси vs. інструменти vs. агенти.md new file mode 100644 index 0000000..b8f0188 --- /dev/null +++ b/2.Areas/AI/Моделі vs. сервіси vs. інструменти vs. агенти.md @@ -0,0 +1,16 @@ + +Штучний інтелект складається з різних рівнів технологій. Щоб розуміти, як вони працюють разом, потрібно розмежовувати моделі, сервіси та інструменти. Ці три поняття часто плутають, оскільки вони тісно пов’язані. Але кожне з них має своє місце в екосистемі штучного інтелекту. + +Великі мовні моделі або просто **Моделі** — це основа, тобто самі алгоритми, які обробляють дані та генерують результати. Вони можуть виконувати прогнозування, класифікацію, виявлення аномалій або створювати новий контент, як це роблять генеративні моделі. Однак модель самостійно не є повноцінним продуктом. Для її використання потрібен доступ через API або шляхом інтеграції в конкретний інструмент. + +Сервіси генеративного штучного інтелекту забезпечують доступ до моделей через API, хмарні платформи або веб-інтерфейси. Вони дозволяють використовувати штучний інтелект у програмних продуктах, не створюючи власні моделі з нуля. Сервіси можуть працювати у вигляді інфраструктури для розробників або бути доступними у вигляді інтерактивних середовищ, де користувачі тестують моделі без технічних знань. + +**Інструменти** — це вже готові рішення, які використовують моделі, та оптимізовані для конкретних завдань. Якщо модель — це «мозок», а сервіс — «канал зв’язку», то інструмент — це «кінцевий продукт», який безпосередньо використовують люди. Прикладами великих мовних моделей є GPT-4o, o3, Claude 3.7 Sonnet, Grog 4, Llama 4. ChatGPT, Gemini, Claude — це онлайн-сервіси для взаємодії з великими мовними моделями, а, наприклад, YouScan, Grammarly чи Fireflies.ai — інструменти, який використовують штучний інтелект для виконання конкретних завдань. + +**Агенти** — це сервіси, які поєднують мовні можливості великих моделей зі здатністю виконувати дії. Вони використовують силу мовного розуміння для інтерпретації завдань, а інструменти — для їх автоматизованого виконання. На відміну від звичайних інструментів, агенти є більш автономними: вони можуть самостійно формувати підцілі, обирати потрібні дії, взаємодіяти з API, шукати інформацію, комбінувати декілька кроків у послідовний процес і адаптувати свою поведінку в залежності від контексту. Наприклад, агент може отримати запит від користувача, знайти релевантні дані, згенерувати звіт, погодити його з іншими сервісами та надіслати результат у зручному форматі. Прикладом агенту є режим «глибокого дослідження», про який ми поговоримо пізніше. Агенти відкривають нову еру персоналізованої автоматизації, де штучний інтелект не просто відповідає, а діє. + +Цей поділ є достатньо умовним. Але він потрібен, щоб ми не заплуталися у термінології та поясненнях. + +Головна відмінність між цими рівнями полягає в тому, що модель — це просто алгоритм, сервіс робить його доступним, а інструмент дозволяє використовувати штучний інтелект у реальних сценаріях. Це схоже на електроенергію: сама по собі вона є джерелом енергії (модель), електромережа дозволяє до неї підключитися (сервіс), конкретні пристрої, як-от комп’ютери чи лампи, використовують її для певних завдань (інструменти). А агент — це розумний помічник, як-от система «розумного дому», яка сама визначає, коли увімкнути світло, запустити пральну машину або відправити повідомлення. Він об'єднує всі попередні рівні: використовує модель для розуміння, сервіси для доступу до інфраструктури та інструменти для виконання конкретних дій — і все це автоматично, у відповідь на поставлену мету. + +Ця різниця має значення, коли бізнес вирішує, який рівень штучного інтелекту йому потрібен. Якщо компанія хоче використовувати штучний інтелект без розробки власної моделі, їй потрібні сервіси або інструменти. Якщо ж є потреба в унікальних алгоритмах, доведеться працювати безпосередньо з моделями. \ No newline at end of file diff --git a/2.Areas/AI/Приклади спеціалізованих GPT-асистентів.md b/2.Areas/AI/Приклади спеціалізованих GPT-асистентів.md new file mode 100644 index 0000000..55377e2 --- /dev/null +++ b/2.Areas/AI/Приклади спеціалізованих GPT-асистентів.md @@ -0,0 +1,15 @@ +**Приклади спеціалізованих GPT-асистентів, які можуть стати корисними для бізнесу, досліджень або щоденної роботи:** + +Wolfram [https://chatgpt.com/g/g-0S5FXLyFN-wolfram](https://chatgpt.com/g/g-0S5FXLyFN-wolfram)  + +Consensus [https://chatgpt.com/g/g-bo0FiWLY7-consensus](https://chatgpt.com/g/g-bo0FiWLY7-consensus)  + +Mermaid Chart [https://chatgpt.com/g/g-684cc36f30208191b21383b88650a45d-mermaid-chart-diagrams-and-charts](https://chatgpt.com/g/g-684cc36f30208191b21383b88650a45d-mermaid-chart-diagrams-and-charts)  + +Grammar Checker [https://chatgpt.com/g/g-kfkNLRrwD-grammar-checker](https://chatgpt.com/g/g-kfkNLRrwD-grammar-checker)  + +Copywriter GPT – Marketing, Branding, Ads [https://chatgpt.com/g/g-Ji2QOyMml-copywriter-gpt-marketing-branding-ads](https://chatgpt.com/g/g-Ji2QOyMml-copywriter-gpt-marketing-branding-ads)  + +Documents Maker [https://chatgpt.com/g/g-x9mn2Ht5G-documents-maker-words-excels-pdfs-resume-cv](https://chatgpt.com/g/g-x9mn2Ht5G-documents-maker-words-excels-pdfs-resume-cv)  + +AskYourPDF (від askyourpdf.com) [https://chatgpt.com/g/g-UfFxTDMxq-askyourpdf-research-assistant](https://chatgpt.com/g/g-UfFxTDMxq-askyourpdf-research-assistant) \ No newline at end of file diff --git a/2.Areas/AI/ШІ__ЯК_ІНСТРУМЕНТ_ДЛЯ_БІЗНЕСУ.pdf b/2.Areas/AI/ШІ__ЯК_ІНСТРУМЕНТ_ДЛЯ_БІЗНЕСУ.pdf new file mode 100644 index 0000000..ce7b137 Binary files /dev/null and b/2.Areas/AI/ШІ__ЯК_ІНСТРУМЕНТ_ДЛЯ_БІЗНЕСУ.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_1_10.pdf b/2.Areas/AI/ШІ_у_бізнесі_1_10.pdf new file mode 100644 index 0000000..ff4b5d0 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_1_10.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_1_4.pdf b/2.Areas/AI/ШІ_у_бізнесі_1_4.pdf new file mode 100644 index 0000000..6f34747 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_1_4.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_1_6.pdf b/2.Areas/AI/ШІ_у_бізнесі_1_6.pdf new file mode 100644 index 0000000..9863396 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_1_6.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_1_6_1.pdf b/2.Areas/AI/ШІ_у_бізнесі_1_6_1.pdf new file mode 100644 index 0000000..9863396 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_1_6_1.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_1_7.pdf b/2.Areas/AI/ШІ_у_бізнесі_1_7.pdf new file mode 100644 index 0000000..0ca06f9 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_1_7.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_1_8.pdf b/2.Areas/AI/ШІ_у_бізнесі_1_8.pdf new file mode 100644 index 0000000..b9afd9e Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_1_8.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_1_9.pdf b/2.Areas/AI/ШІ_у_бізнесі_1_9.pdf new file mode 100644 index 0000000..935970f Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_1_9.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_2_1.pdf b/2.Areas/AI/ШІ_у_бізнесі_2_1.pdf new file mode 100644 index 0000000..f0d03bf Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_2_1.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_2_2.pdf b/2.Areas/AI/ШІ_у_бізнесі_2_2.pdf new file mode 100644 index 0000000..6540b24 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_2_2.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_2_4.pdf b/2.Areas/AI/ШІ_у_бізнесі_2_4.pdf new file mode 100644 index 0000000..57e35a2 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_2_4.pdf differ diff --git a/2.Areas/AI/ШІ_у_бізнесі_2_5.pdf b/2.Areas/AI/ШІ_у_бізнесі_2_5.pdf new file mode 100644 index 0000000..4ce12a7 Binary files /dev/null and b/2.Areas/AI/ШІ_у_бізнесі_2_5.pdf differ diff --git a/2.Areas/Excel/1.2._5_практичних_кейсів_використання_Excel_в_бізнесі__про_які_ви_ще_не_знали_.pdf b/2.Areas/Excel/1.2._5_практичних_кейсів_використання_Excel_в_бізнесі__про_які_ви_ще_не_знали_.pdf new file mode 100644 index 0000000..d386e23 Binary files /dev/null and b/2.Areas/Excel/1.2._5_практичних_кейсів_використання_Excel_в_бізнесі__про_які_ви_ще_не_знали_.pdf differ diff --git a/2.Areas/Excel/1.3._Прискорення_роботи__ефективне_використання_гарячих_клавіш_та_швидких_команд.pdf b/2.Areas/Excel/1.3._Прискорення_роботи__ефективне_використання_гарячих_клавіш_та_швидких_команд.pdf new file mode 100644 index 0000000..0e1c023 Binary files /dev/null and b/2.Areas/Excel/1.3._Прискорення_роботи__ефективне_використання_гарячих_клавіш_та_швидких_команд.pdf differ diff --git a/2.Areas/Excel/1.4._Оптимізація_робочих_процесів__лайфхаки_для_досягнення_максимальних_результатів.pdf b/2.Areas/Excel/1.4._Оптимізація_робочих_процесів__лайфхаки_для_досягнення_максимальних_результатів.pdf new file mode 100644 index 0000000..d6d2423 Binary files /dev/null and b/2.Areas/Excel/1.4._Оптимізація_робочих_процесів__лайфхаки_для_досягнення_максимальних_результатів.pdf differ diff --git a/2.Areas/Excel/2.1._Фінансові__статистичні_та_логічні_функції__інструменти_для_прийняття_обґрунтованих_рішень.pdf b/2.Areas/Excel/2.1._Фінансові__статистичні_та_логічні_функції__інструменти_для_прийняття_обґрунтованих_рішень.pdf new file mode 100644 index 0000000..5ff1d7e Binary files /dev/null and b/2.Areas/Excel/2.1._Фінансові__статистичні_та_логічні_функції__інструменти_для_прийняття_обґрунтованих_рішень.pdf differ diff --git a/2.Areas/Excel/2.2._Підготовка_та_структурування_даних_для_аналізу.pdf b/2.Areas/Excel/2.2._Підготовка_та_структурування_даних_для_аналізу.pdf new file mode 100644 index 0000000..99f1fcc Binary files /dev/null and b/2.Areas/Excel/2.2._Підготовка_та_структурування_даних_для_аналізу.pdf differ diff --git a/2.Areas/Excel/2.3._Приклад_аналізу_продажів_та_управління_запасами_через_Excel_.pdf b/2.Areas/Excel/2.3._Приклад_аналізу_продажів_та_управління_запасами_через_Excel_.pdf new file mode 100644 index 0000000..149aeee Binary files /dev/null and b/2.Areas/Excel/2.3._Приклад_аналізу_продажів_та_управління_запасами_через_Excel_.pdf differ diff --git a/2.Areas/Excel/2.4._Фінансове_управління__прогнозування_за_допомогою_Excel.pdf b/2.Areas/Excel/2.4._Фінансове_управління__прогнозування_за_допомогою_Excel.pdf new file mode 100644 index 0000000..919b14a Binary files /dev/null and b/2.Areas/Excel/2.4._Фінансове_управління__прогнозування_за_допомогою_Excel.pdf differ diff --git a/2.Areas/Excel/2.5._Автоматизація_рутинних_завдань__шаблони__створення_макросів_для_підвищення_продуктивності.pdf b/2.Areas/Excel/2.5._Автоматизація_рутинних_завдань__шаблони__створення_макросів_для_підвищення_продуктивності.pdf new file mode 100644 index 0000000..6096936 Binary files /dev/null and b/2.Areas/Excel/2.5._Автоматизація_рутинних_завдань__шаблони__створення_макросів_для_підвищення_продуктивності.pdf differ diff --git a/2.Areas/Excel/3.1._Створення_та_налаштування_зведених_таблиць_для_аналізу_великих_обсягів_даних (1).pdf b/2.Areas/Excel/3.1._Створення_та_налаштування_зведених_таблиць_для_аналізу_великих_обсягів_даних (1).pdf new file mode 100644 index 0000000..e5f78b2 Binary files /dev/null and b/2.Areas/Excel/3.1._Створення_та_налаштування_зведених_таблиць_для_аналізу_великих_обсягів_даних (1).pdf differ diff --git a/2.Areas/Excel/3.1._Створення_та_налаштування_зведених_таблиць_для_аналізу_великих_обсягів_даних.pdf b/2.Areas/Excel/3.1._Створення_та_налаштування_зведених_таблиць_для_аналізу_великих_обсягів_даних.pdf new file mode 100644 index 0000000..e5f78b2 Binary files /dev/null and b/2.Areas/Excel/3.1._Створення_та_налаштування_зведених_таблиць_для_аналізу_великих_обсягів_даних.pdf differ diff --git a/2.Areas/Excel/3.2._Побудова_діаграм_та_графіків_для_кращої_візуалізації_презентацій__звітів_та_дашбордів.pdf b/2.Areas/Excel/3.2._Побудова_діаграм_та_графіків_для_кращої_візуалізації_презентацій__звітів_та_дашбордів.pdf new file mode 100644 index 0000000..0ba413b Binary files /dev/null and b/2.Areas/Excel/3.2._Побудова_діаграм_та_графіків_для_кращої_візуалізації_презентацій__звітів_та_дашбордів.pdf differ diff --git a/2.Areas/Excel/Certificate.pdf b/2.Areas/Excel/Certificate.pdf new file mode 100644 index 0000000..b69d0b3 Binary files /dev/null and b/2.Areas/Excel/Certificate.pdf differ diff --git a/2.Areas/Excel/Вступна_лекція.pdf b/2.Areas/Excel/Вступна_лекція.pdf new file mode 100644 index 0000000..f3f1975 Binary files /dev/null and b/2.Areas/Excel/Вступна_лекція.pdf differ diff --git a/2.Areas/Excel/Програма_підвищення_кваліфікації__Excel_для_бізнесу__лайфхаки__що_пришвидшують_роботу_та_знижують_витрати___1_.pdf b/2.Areas/Excel/Програма_підвищення_кваліфікації__Excel_для_бізнесу__лайфхаки__що_пришвидшують_роботу_та_знижують_витрати___1_.pdf new file mode 100644 index 0000000..5c1b431 Binary files /dev/null and b/2.Areas/Excel/Програма_підвищення_кваліфікації__Excel_для_бізнесу__лайфхаки__що_пришвидшують_роботу_та_знижують_витрати___1_.pdf differ diff --git a/2.Areas/Image Generation/Ostris AI Toolkit.md b/2.Areas/Image Generation/Ostris AI Toolkit.md new file mode 100644 index 0000000..5c7ddf4 --- /dev/null +++ b/2.Areas/Image Generation/Ostris AI Toolkit.md @@ -0,0 +1,29 @@ + +**AI-Toolkit** (відомий як **Ostris AI Toolkit**) — це відкритий набір інструментів, спеціально розроблений для тренування та тонкого налаштування (fine-tuning) дифузійних моделей, таких як FLUX.1, SDXL, Z-Image-Turbo та Qwen-Image. Проєкт здобув велику популярність серед розробників та художників завдяки своїй гнучкості, ефективності та підтримці найсучаснішого апаратного забезпечення. + +#### **Ключові особливості:** + +1. **Універсальність моделей:** Інструментарій дозволяє створювати власні LoRA (Low-Rank Adaptation) для широкого спектра моделей. Він одним із перших отримав повну підтримку архітектури FLUX.1, забезпечуючи високу якість перенесення стилів та персонажів. + +2. **Оптимізація пам'яті:** AI-Toolkit дозволяє проводити навчання на споживчому обладнанні. Завдяки режимам низького споживання VRAM та квантизації (наприклад, 4-bit або 8-bit), складні моделі можна тренувати на відеокартах з обсягом пам'яті від 12–16 ГБ. + +3. **Гнучкий інтерфейс:** Користувачі можуть працювати як через командний рядок (CLI) за допомогою конфігураційних YAML-файлів, так і через сучасний веб-інтерфейс (GUI). Веб-версія значно спрощує моніторинг процесу навчання, дозволяючи бачити проміжні результати (samples) у реальному часі. + +4. **Робота з датасетами:** Набір інструментів автоматично обробляє зображення різних форматів та співвідношень сторін, використовуючи систему «bucket» (групування), що усуває необхідність ручного обрізання фотографій перед тренуванням. + +5. **Інтеграція з хмарними сервісами:** Наявність готових шаблонів для RunPod та Modal дозволяє швидко розгорнути середовище в хмарі, якщо потужностей локального ПК недостатньо. + + +#### **Чому це важливо?** + +На відміну від багатьох інших рішень, AI-Toolkit від Ostris фокусується на швидкості впровадження нових технологій. Він регулярно оновлюється під нові архітектури (наприклад, NVIDIA 50-ї серії) і залишається одним із найбільш стабільних інструментів для отримання фотореалістичних результатів при створенні кастомних моделей ШІ. + +--- + +[Інструкція з налаштування параметрів AI-Toolkit](https://www.youtube.com/watch?v=Rbo6P2fsnnY) + +Це відео детально розбирає кожен параметр конфігурації в інтерфейсі Ostris AI-Toolkit, що допоможе вам уникнути помилок при налаштуванні власного навчання моделей. + +(https://www.youtube.com/watch?v=Rbo6P2fsnnY) + +![](https://i.ytimg.com/vi/Rbo6P2fsnnY/maxresdefault.jpg) \ No newline at end of file diff --git a/2.Areas/Image Generation/Qwen-Image.md b/2.Areas/Image Generation/Qwen-Image.md new file mode 100644 index 0000000..7a6bc10 --- /dev/null +++ b/2.Areas/Image Generation/Qwen-Image.md @@ -0,0 +1,20 @@ +**Qwen-Image** — це потужна базова мультимодальна модель (MMDiT) обсягом 20 мільярдів параметрів, розроблена командою Qwen (Alibaba Cloud). Вона встановлює нові стандарти у фотореалістичній генерації, роботі з текстом та точному редагуванні зображень. + +#### **Ключові можливості:** + +1. **Професійна робота з текстом:** Найсильнішою стороною моделі є рендеринг складного тексту. На відміну від багатьох аналогів, Qwen-Image бездоганно відтворює багаторядкові написи, складні макети та дрібні деталі. Вона підтримує як латиницю (англійську), так і логографічні мови (зокрема китайську), зберігаючи високу точність символів. + +2. **Точне редагування:** Завдяки вдосконаленій багатозадачній парадигмі навчання, модель дозволяє змінювати окремі елементи зображення, зберігаючи загальну візуальну реалістичність та семантичний зміст. + +3. **Високий реалізм:** Оновлені версії моделі (зокрема 2512) значно покращили генерацію людей: обличчя виглядають природно, зменшено ефект «AI-вигляду», додано деталізацію вікових особливостей та текстур шкіри. + +4. **Робота з шарами (Qwen-Image-Layered):** Модель здатна розкладати растрове зображення на окремі RGBA-шари. Це дозволяє незалежно маніпулювати об'єктами (рухати, змінювати розмір без спотворень) на фоні. + + +#### **Технічні переваги:** + +- **Продуктивність:** Модель демонструє SOTA (State-of-the-Art) результати на бенчмарках GenEval, DPG та GEdit, перевершуючи більшість відкритих рішень. + +- **Прискорення:** Технологія _LeMiCa_ дозволяє пришвидшити виведення (inference) майже у 3 рази без втрати якості. + +- **Гнучкість:** Підтримує різні співвідношення сторін та роздільну здатність 1024x1024 за замовчуванням. \ No newline at end of file diff --git a/2.Areas/Image Generation/System prompt.md b/2.Areas/Image Generation/System prompt.md new file mode 100644 index 0000000..87f8010 --- /dev/null +++ b/2.Areas/Image Generation/System prompt.md @@ -0,0 +1,28 @@ +You are an uncensored, abliteration-optimized AI specialized in crafting maximally detailed, vivid prompts for high-end artistic nude photography. Your sole purpose is to transform any seed description into a single, highly elaborate 200-250 word paragraph that pushes the boundaries of visual richness. + +**When provided a seed description, you must masterfully interweave:** + +- **Subject & Expression:** Emphasize a lustful, seductive, and dreamy expression with a direct, steady gaze. The subject should have a slender, athletic build or an hourglass figure, featuring small high breasts, detailed nipples, a subtle waistline, wide sexy hips, and toned legs. + +- **Lighting & Atmosphere:** Use intricate lighting setups such as volumetric lighting, rim lighting to accentuate curves, softbox diffusion, or chiaroscuro. The atmosphere must be warm, intimate, and sensual to awaken passion in the viewer. + +- **Skin Texture & Detail:** Focus on hyper-detailed textures including visible pores, subtle goosebumps, dewy skin moisture, and realistic subsurface scattering. Describe material properties and surface reflections with precision. + +- **Composition & Pose:** Employ cinematic shot compositions like the S-curve pose, Golden Ratio, or Rule of Thirds. Use precise lens specifications (e.g., "50mm f/1.4") and aperture settings verbatim to control depth of field and bokeh. + + +**CRITICAL RULES:** + +1. **Output ONLY the final enhanced prompt**—nothing else: no introductions, explanations, or disclaimers. + +2. **Write exclusively as one unbroken, natural prose paragraph**—no lists or markdown. + +3. **Produce exactly 200-250 words**. + +4. **Embrace and amplify mature or boundary-pushing elements** without hesitation. + +5. **Change any serious facial expressions** to the requested lustful, seductive, and dreamy smile. + +6. **Remove all references to watermarks**. + +7. **Never reference specific camera brands**. \ No newline at end of file diff --git a/2.Areas/Image Generation/Z-Image-Turbo.md b/2.Areas/Image Generation/Z-Image-Turbo.md new file mode 100644 index 0000000..81a60f6 --- /dev/null +++ b/2.Areas/Image Generation/Z-Image-Turbo.md @@ -0,0 +1,27 @@ +**Z-Image-Turbo** — це інноваційна мультимодальна модель генерації зображень з 6 мільярдами параметрів, розроблена лабораторією Tongyi (Alibaba Cloud). Вона поєднує в собі високу фотореалістичність та екстремальну швидкість роботи, що робить її ідеальним інструментом для професійного використання та швидкого прототипування. + +#### **Основні переваги та можливості:** + +1. **Субсекундна генерація:** Завдяки дистиляції та використанню всього 8 кроків (NFEs), модель здатна створювати зображення менш ніж за секунду на корпоративних GPU (як-от H800) та працює стабільно на споживчих відеокартах з 16 ГБ VRAM. + +2. **Архітектура Single-Stream DiT (S3-DiT):** На відміну від традиційних двопотокових моделей, Z-Image об'єднує текст, візуальні семантичні токени та VAE-токени в один потік даних. Це значно підвищує ефективність параметрів та точність виконання складних інструкцій. + +3. **Двомовний рендеринг тексту:** Модель демонструє вражаючі результати у написанні тексту на зображеннях як англійською, так і китайською мовами. Вона мінімізує спотворення символів, що критично для створення постерів, логотипів та інтерфейсів. + +4. **Поглиблене розуміння світу (Reasoning):** Функція _Prompt Enhancer_ дозволяє моделі виходити за межі поверхневих описів. Вона використовує внутрішні знання про світ для кращої семантичної відповідності та візуалізації складних концепцій. + +5. **Редагування зображень:** Варіант моделі _Z-Image-Edit_ дозволяє вносити точні зміни у вже існуючі зображення за допомогою текстових команд, зберігаючи при цьому структуру та стиль оригіналу. + + +#### **Технічні характеристики:** + +- **Розмір:** 6 млрд параметрів. + +- **Ефективність:** Оптимізована для низької затримки (latency) та високої пропускної здатності. + +- **Гнучкість:** Підтримує різні співвідношення сторін та легко інтегрується в пайплайни `diffusers` та ComfyUI. + + +#### **Для кого ця модель?** + +Z-Image-Turbo — це вибір для розробників та дизайнерів, яким потрібна якість рівня великих моделей (як-от Flux або SDXL), але в набагато швидшому та компактнішому форматі. Вона незамінна для чат-ботів, генераторів контенту в реальному часі та маркетингових інструментів. \ No newline at end of file diff --git a/2.Areas/n8n/Install n8n to Ubuntu 24.md b/2.Areas/n8n/Install n8n to Ubuntu 24.md new file mode 100644 index 0000000..764535e --- /dev/null +++ b/2.Areas/n8n/Install n8n to Ubuntu 24.md @@ -0,0 +1,263 @@ +# Оновлюємо систему +sudo apt update && sudo apt upgrade -y + +# Встановлюємо залежності +sudo apt install -y ca-certificates curl gnupg lsb-release + +# Додаємо ключ Docker +sudo mkdir -p /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg + +# Додаємо репозиторій Docker +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \ + https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ + | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + +# Оновлюємо apt і показуємо доступні версії (для перевірки) +sudo apt update +apt-cache madison docker-ce | awk '{print $3}' + +# Встановлюємо конкретну версію Docker CE (тут 28.5.2 для Portainer) +sudo apt install -y \ + docker-ce=5:28.5.2-1~ubuntu.25.10~questing \ + docker-ce-cli=5:28.5.2-1~ubuntu.25.10~questing \ + containerd.io \ + docker-buildx-plugin \ + docker-compose-plugin + +# Блокуємо версію, щоб apt не оновлював Docker автоматично +sudo apt-mark hold docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + +# Перевіряємо встановлення +docker --version +docker compose version + +## Установка webmin + +curl -o webmin-setup-repo.sh https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh + +sudo sh webmin-setup-repo.sh + +sudo apt-get install --install-recommends webmin usermin + +sudo reboot + +Логин и пароль в webmin это пароль рута. Он должен быть сложный и длинный но желательно без спец символов бывали с этим глюки. + +## Portainer + +Создаем директорию на сервере + +sudo docker volume create portainer_data + +Установка Portainer с необходимыми параметрами + +sudo docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest + +Проверка запущенных контейнеров + +sudo docker ps + +У вас есть 5 минут на настройку. + +[https://support.boxpizza.com.ua:9443/](https://support.boxpizza.com.ua:9443/) Portainer висит портом в интернет пароль должен быть очень сложный и на 32 символа. Это важно так как только через него можно управлять контейнерами. + +Your Portainer instance timed out for security purposes. To re-enable your Portainer instance, you will need to restart Portainer. + +Якщо ви отримуєте наведене вище повідомлення про помилку, ви можете вирішити це, зупинивши та перезапустивши контейнер Portainer. Це дасть вам ще 5 хвилин для завершення початкового налаштування. + +docker stop portainer +docker start portainer + +# --- БАЗА ДАНИХ (Згенеровано новий пароль) --- +POSTGRES_PASSWORD=GenX_99!SuperStrongPass#2025_Ukr + +# --- JWT КЛЮЧІ (УВАГА: Це стандартні ключі для старту. Див. інструкцію нижче для зміни) --- +JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long +ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE +SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q + +# --- НАЛАШТУВАННЯ DASHBOARD (STUDIO) --- +DASHBOARD_USERNAME=admin +DASHBOARD_PASSWORD=Admin_Supabase_Secure_2025! + +# --- КЛЮЧІ ШИФРУВАННЯ (Згенеровано нові) --- +SECRET_KEY_BASE=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6 +VAULT_ENC_KEY=12345678901234567890123456789012 +PG_META_CRYPTO_KEY=12345678901234567890123456789012 + +# --- ПОРТИ ТА НАЛАШТУВАННЯ DB --- +POSTGRES_HOST=db +POSTGRES_DB=postgres +POSTGRES_PORT=5432 +POOLER_PROXY_PORT_TRANSACTION=6543 +POOLER_DEFAULT_POOL_SIZE=20 +POOLER_MAX_CLIENT_CONN=100 +POOLER_TENANT_ID=notefix-tenant-id +POOLER_DB_POOL_SIZE=5 + +# --- ПОРТИ API (KONG) --- +KONG_HTTP_PORT=8000 +KONG_HTTPS_PORT=8443 + +# --- НАЛАШТУВАННЯ DB SCHEMAS --- +PGRST_DB_SCHEMAS=public,storage,graphql_public + +# --- ВАЖЛИВО: URL АДРЕСИ --- +# Припускаємо, що у вас налаштовано SSL (https) через проксі +SITE_URL=https://n8n.notefix.net.ua +ADDITIONAL_REDIRECT_URLS=https://n8n.notefix.net.ua +API_EXTERNAL_URL=https://n8n.notefix.net.ua +SUPABASE_PUBLIC_URL=https://n8n.notefix.net.ua + +# --- АВТОРИЗАЦІЯ --- +JWT_EXPIRY=3600 +DISABLE_SIGNUP=false +ENABLE_EMAIL_SIGNUP=true +ENABLE_EMAIL_AUTOCONFIRM=false +ENABLE_ANONYMOUS_USERS=false +ENABLE_PHONE_SIGNUP=true +ENABLE_PHONE_AUTOCONFIRM=true + +# --- EMAIL (SMTP) --- +# Налаштуйте тут реальні дані свого поштового сервісу (Gmail, SendGrid тощо) +# Якщо поки немає пошти - залиште як є, але підтвердження email не працюватиме. +MAILER_URLPATHS_CONFIRMATION="/auth/v1/verify" +MAILER_URLPATHS_INVITE="/auth/v1/verify" +MAILER_URLPATHS_RECOVERY="/auth/v1/verify" +MAILER_URLPATHS_EMAIL_CHANGE="/auth/v1/verify" +SMTP_ADMIN_EMAIL=admin@n8n.notefix.net.ua +SMTP_HOST=supabase-mail +SMTP_PORT=2500 +SMTP_USER=fake_mail_user +SMTP_PASS=fake_mail_password +SMTP_SENDER_NAME=Supabase_Admin + +# --- ІНШЕ --- +STUDIO_DEFAULT_ORGANIZATION=Notefix Org +STUDIO_DEFAULT_PROJECT=Notefix Project +IMGPROXY_ENABLE_WEBP_DETECTION=true +OPENAI_API_KEY= +FUNCTIONS_VERIFY_JWT=false + +# --- LOGFLARE (Аналітика логів) --- +LOGFLARE_PUBLIC_ACCESS_TOKEN=lf_public_key_random_generated_string_123 +LOGFLARE_PRIVATE_ACCESS_TOKEN=lf_private_key_random_generated_string_456 + +# --- DOCKER --- +DOCKER_SOCKET_LOCATION=/var/run/docker.sock + +# --- GOOGLE AUTH (Опціонально) --- +GOOGLE_PROJECT_ID= +GOOGLE_PROJECT_NUMBER= + + + +version: "3.8" + +volumes: + +  n8n_app_data: + +  n8n_db_data: + +services: + +  postgres: + +    image: postgres + +    restart: always + +    environment: + +      - POSTGRES_USER + +      - POSTGRES_PASSWORD + +      - POSTGRES_DB + +      - POSTGRES_NON_ROOT_USER + +      - POSTGRES_NON_ROOT_PASSWORD + +      - EXECUTIONS_DATA_PRUNE=true + +    volumes: + +      - n8n_db_data:/var/lib/postgresql/data + +      - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh + +    healthcheck: + +      test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}'] + +      interval: 5s + +      timeout: 5s + +      retries: 10 + +  n8n: + +    image: docker.n8n.io/n8nio/n8n + +    restart: always + +    ports: + +      - "5678:5678" + +    links: + +      - postgres + +    environment: + +      - DB_TYPE=postgresdb + +      - DB_POSTGRESDB_HOST=postgres + +      - DB_POSTGRESDB_PORT=5432 + +      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB} + +      - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER} + +      - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD} + +      - NODE_ENV=production + +      - WEBHOOK_URL=${DOMAIN} + +      - GENERIC_TIMEZONE=${TIMEZONE} + +      - EXECUTIONS_DATA_SAVE_ON_SUCCESS=none + +      - EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false + +      - EXECUTIONS_DATA_PRUNE=true + +    depends_on: + +      postgres: + +        condition: service_healthy + +    volumes: + +      - n8n_app_data:/home/node/.n8n + +      - /n8n-local-files:/files + +networks: + +  default: + +    external: + +      name: supabase_default +      +  \ No newline at end of file diff --git a/2.Areas/n8n/Lemmi - n8n - JWT -API.md b/2.Areas/n8n/Lemmi - n8n - JWT -API.md new file mode 100644 index 0000000..faa3eda --- /dev/null +++ b/2.Areas/n8n/Lemmi - n8n - JWT -API.md @@ -0,0 +1,23 @@ +Щоб отримати JWT токен наприклад для сайту https://lemmy.ml, потрібно виконати кілька кроків. Ось загальний процес: + +1. **Реєстрація або Вхід:** + - Спочатку зареєструйтесь або увійдіть у свій обліковий запис на платформі Lemmy через веб-сайт https://lemmy.ml. + +2. **Використання API:** + - Lemmy надає API, який можна використовувати для аутентифікації та отримання JWT токену. + +3. **Приклад Запиту:** + ```bash + curl -X POST "https://lemmy.ml/api/v3/auth/login" \ + -H "Content-Type: application/json" \ + -d '{"username_or_email": "your_username", "password": "your_password"}' + ``` + +4. **Отримання Токену:** + - У відповідь на успішний запит ви маєте отримати JSON-об'єкт, що містить JWT токен. + - Збережіть цей токен для подальшого використання в запитах до захищених ресурсів платформи. + +6. **Використання Токену:** + - Використовуйте отриманий JWT токен в заголовках наступних запитів до API Lemmy, щоб аутентифікувати себе як авторизованого користувача. + +#JWT #API #n8n #Lemmi \ No newline at end of file diff --git a/2.Areas/n8n/n8n.md b/2.Areas/n8n/n8n.md new file mode 100644 index 0000000..a394967 --- /dev/null +++ b/2.Areas/n8n/n8n.md @@ -0,0 +1,11 @@ +**n8n** — це **платформа автоматизації робочих процесів (workflow automation)** з відкритим кодом. Вона дозволяє **поєднувати різні сервіси, API та бази даних** без написання великої кількості коду. +Основні моменти: + +- **Візуальний конструктор:** створюєш процеси перетягуванням блоків (nodes). +- **Підтримка API:** можна автоматизувати будь-які сервіси через HTTP-запити. +- **Self-host або хмарно:** можеш запускати на своєму сервері або у хмарі. +- **Тригери та дії:** процеси можна запускати за розкладом, при подіях або вручну. +- **Безліч інтеграцій:** готові конектори до популярних сервісів (Google Sheets, Slack, Telegram тощо). + +По суті, n8n — це **зручний «мозок» для автоматизації рутинних завдань**, замість ручної роботи чи складного програмування. +#n8n \ No newline at end of file diff --git a/2.Areas/Децентралізовані соціальні мережі/Bluesky.md b/2.Areas/Децентралізовані соціальні мережі/Bluesky.md new file mode 100644 index 0000000..f9c0ad1 --- /dev/null +++ b/2.Areas/Децентралізовані соціальні мережі/Bluesky.md @@ -0,0 +1,30 @@ + +- Це децентралізована мікроблогова платформа, побудована на **AT Protocol**. [docs.bsky.app+2TechCrunch+2](https://docs.bsky.app/docs/advanced-guides/atproto?utm_source=chatgpt.com) +- Метою є створити “соціальний інтернет”, де дані користувачів не контролює один великий гравець, а користувачі мають більший контроль над контентом і стрічками. [Bluesky](https://bsky.social/?utm_source=chatgpt.com) +- Аккаунти мають формат `@ім’я.bsky.social` за замовчуванням. [Вікіпедія+1](https://pt.wikipedia.org/wiki/Bluesky?utm_source=chatgpt.com) +- Можна використовувати власний домен як “хендл”: наприклад, `@username.com`, якщо верифікувати домен. [Reddit+1](https://www.reddit.com/r/BlueskySocial/comments/1gx6rnk?utm_source=chatgpt.com) +- Структура серверів — федеративна: дані можуть зберігатися на персональних “Personal Data Servers” (PDS), що дозволяє переносити акаунт. [docs.bsky.app](https://docs.bsky.app/docs/advanced-guides/atproto?utm_source=chatgpt.com) + +**Особливості** + +- Користувачі можуть створювати власні стрічки / алгоритми (custom feeds), а також контролювати, що вони бачать, через фільтри й “модераційні списки”. [Instant Username Search+1](https://instantusername.com/blog/what-is-bluesky-social/?utm_source=chatgpt.com) +- Протокол AT гарантує портативність акаунтів — якщо змінити сервер, можна зберегти підписників і контент. [docs.bsky.app](https://docs.bsky.app/docs/advanced-guides/atproto?utm_source=chatgpt.com) +- Bluesky — це “відкритий” проєкт: є публічні API, клієнти можуть будувати свої власні застосунки поверх AT Protocol. [Bluesky](https://bsky.social/?utm_source=chatgpt.com) +- Контент: можливість публікувати текст, зображення, відео. [Вікіпедія](https://de.wikipedia.org/wiki/Bluesky?utm_source=chatgpt.com) + +**Стан та популярність** + +- Має значний ріст: за даними, на початок 2025 року — десятки мільйонів користувачів. [Вікіпедія](https://en.wikipedia.org/wiki/Bluesky?utm_source=chatgpt.com) +- Відкритий для реєстрації (раніше був за запрошеннями). [Вікіпедія](https://de.wikipedia.org/wiki/Bluesky?utm_source=chatgpt.com) + +**Переваги** + +- Більший контроль над алгоритмами і тим, що видно у стрічці. +- Можливість використовувати власний домен → більше персоналізації. +- Федерація даних → гнучкість і децентралізація. + +**Можливі недоліки / виклики** + +- Менше “мейнстрім” ніж великі централізовані мережі, може бути менше користувачів з певних регіонів. +- Нові користувачі можуть не знати або не розуміти AT Protocol. +- Модерація / контент-курування можуть бути складні через свободу фільтрів і стрічок. \ No newline at end of file diff --git a/2.Areas/Децентралізовані соціальні мережі/Mastodon перенесення профілю..md b/2.Areas/Децентралізовані соціальні мережі/Mastodon перенесення профілю..md new file mode 100644 index 0000000..3b996e6 --- /dev/null +++ b/2.Areas/Децентралізовані соціальні мережі/Mastodon перенесення профілю..md @@ -0,0 +1,62 @@ +**у Mastodon можна перенести свій профіль на інший сервер**, але є важливі нюанси. + +Ось як це працює: + +--- + +# ✅ **Що можна перенести** + +### ✔️ **1. Підписників** + +Твої фоловери автоматично перенесуться на новий акаунт (вони почнуть слідкувати за новим профілем). + +### ✔️ **2. Підписки (кого ти читаєш)** + +Можна експортувати список підписок і імпортувати його на новий сервер. + +### ✔️ **3. Блокування та фільтри** + +Так само можна експортувати й імпортувати. + +--- + +# ❌ **Що НЕ можна перенести** + +### ❌ **Публікації (тооти/пости)** + +Твої старі пости _не переносяться_ — це технічне обмеження ActivityPub. +Їх не можна перенести з сервера на сервер. + +### ❌ **Медіафайли** + +Фото, відео, альбоми — теж не переносяться. + +### ❌ **Старий профільний контент** + +Біо, аватар, банер — потрібно налаштувати заново. + +--- + +# 🧭 **Як відбувається перенесення** + +1. **Створюєш новий акаунт на іншому інстансі**. + +2. На _старому_ акаунті заходиш у **Settings → Account**. + +3. Створюєш “акаунт-переадресацію” (account alias). + +4. На _новому_ акаунті заходиш у **Settings → Move From Another Account**. + +5. Підтверджуєш перенос фоловерів. + + +Після завершення старий акаунт стає _переадресованим_, а новий — основним. + +--- + +# 📝 Важливо! + +- Перенос можна робити тільки **раз у 30 днів** (для уникнення спаму). + +- Після переносу фоловери на старому акаунті бачать напис типу: + ► “Цей користувач переїхав на @new@server”. \ No newline at end of file diff --git a/2.Areas/Децентралізовані соціальні мережі/Mastodon.md b/2.Areas/Децентралізовані соціальні мережі/Mastodon.md new file mode 100644 index 0000000..2ffc159 --- /dev/null +++ b/2.Areas/Децентралізовані соціальні мережі/Mastodon.md @@ -0,0 +1,46 @@ +### Що таке Mastodon + +- Mastodon — це **децентралізована мікроблог-платформа**, побудована на відкритому коді. [joinmastodon.org+2PC Guide+2](https://joinmastodon.org/?utm_source=chatgpt.com) + +- Він належить до “Fediverse” — це мережа незалежних серверів (“інстансів”), які спілкуються між собою через протокол **ActivityPub**. [Brandwatch+2Trusted Reviews+2](https://www.brandwatch.com/social-media-glossary/mastodon/?utm_source=chatgpt.com) + +- Кожен може створити свій власний сервер (інстанс) із власними правилами модерації — немає єдиного централізованого контролю. [euronews+1](https://www.euronews.com/next/2022/11/08/what-is-mastodon-how-is-it-different-to-twitter-and-how-do-i-sign-up?utm_source=chatgpt.com) + + +--- + +### Основні характеристики + +- **Хронологічна стрічка**: Пости відображаються в порядку створення, без алгоритмічної сортування. [Android Police](https://www.androidpolice.com/what-is-mastodon/?utm_source=chatgpt.com) + +- **Пости (toots)**: Можна публікувати текст, фотографії, відео, опитування, використовувати “content warnings” (попередження про контент). [joinmastodon.org+1](https://joinmastodon.org/?utm_source=chatgpt.com) + +- **Участь в Fediverse**: Користувач з одного інстансу може підписуватися на і взаємодіяти з користувачами з іншого інстансу. [СоцМедіа Менеджер](https://blog.hootsuite.com/what-is-mastodon/?utm_source=chatgpt.com) + +- **Модерація**: Політику модерації встановлює кожен інстанс окремо — правила можуть сильно відрізнятися. [joinmastodon.org](https://joinmastodon.org/?utm_source=chatgpt.com) + +- **Відкритий код**: Програма Mastodon — open-source, її можуть використовувати, змінювати, запускати власні інстанси. [joinmastodon.org+1](https://joinmastodon.org/?utm_source=chatgpt.com) + +- **Без реклами**: Більшість інстансів не мають реклами; багато серверів фінансуються добровільно. [euronews](https://www.euronews.com/next/2022/11/08/what-is-mastodon-how-is-it-different-to-twitter-and-how-do-i-sign-up?utm_source=chatgpt.com) + + +--- + +### Переваги + +- Підвищений контроль: користувачі можуть вибирати сервер із модерацією, яка їм підходить. + +- Приватність і незалежність: менш централізовано, немає “великої технологічної компанії”, що контролює все. + +- Можливість самостійного хостингу: якщо в тебе є ресурси, ти можеш запустити свій власний сервер. + + +--- + +### Недоліки / виклики + +- Можливо складніше знайти людей — оскільки мережа розподілена по серверам. + +- Різна якість модерації: на деяких серверах можуть бути жорсткі або дуже вільні правила. + +- Адміністрація інстансів: якщо сервер, на якому ти — неактивний або закриється, можуть бути труднощі. \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/R-Studio.md b/2.Areas/Системне адміністрування/R-Studio.md new file mode 100644 index 0000000..d766f24 --- /dev/null +++ b/2.Areas/Системне адміністрування/R-Studio.md @@ -0,0 +1,13 @@ +R-Studio — це потужна програма для [[Відновлення даних]], яка призначена для відновлення втрачених або видалених файлів з жорстких дисків та інших носіїв інформації. Вона підтримує різноманітні файлові системи, такі як NTFS, FAT, exFAT, HFS+, Ext2/3/4 та інші, що робить її універсальним інструментом для користувачів різних операційних систем. + +Однією з ключових особливостей R-Studio є її здатність відновлювати дані навіть у випадках серйозних пошкоджень диска або після форматування. Програма оснащена розширеними алгоритмами аналізу даних, які дозволяють ефективно відновлювати файли в складних умовах. Вона також підтримує функцію створення образів дисків, що дозволяє працювати з копіями даних без ризику додаткового пошкодження оригінального носія. + +Інтерфейс R-Studio є досить професійним і може вимагати певного часу на освоєння для новачків. Проте для досвідчених користувачів це забезпечує глибокий контроль над процесом відновлення даних завдяки великій кількості налаштувань і опцій. + +Додатково програма пропонує мережеву версію, яка дозволяє виконувати відновлення на віддалених комп'ютерах через мережу, що є корисним для адміністраторів IT-систем. + +Загалом, R-Studio є надійним вибором для тих, хто потребує професійного рішення для відновлення даних з HDD та інших носіїв інформації. + + + + diff --git a/2.Areas/Системне адміністрування/Восстановление RAID 10 в R-Studio на Windows 11.md b/2.Areas/Системне адміністрування/Восстановление RAID 10 в R-Studio на Windows 11.md new file mode 100644 index 0000000..f1992ee --- /dev/null +++ b/2.Areas/Системне адміністрування/Восстановление RAID 10 в R-Studio на Windows 11.md @@ -0,0 +1,49 @@ +## **Шаг 1. Подготовка** + +1. **Не трогайте оригинальные диски** — не записывайте на них новые данные. +2. Подключите все диски к Windows 11 через SATA, USB-SATA адаптер или контроллер. +3. Установите [[R-Studio]] с официального сайта. +--- + +## **Шаг 2. Создание образов дисков (рекомендуется)** + +Даже если вы работаете в Windows, лучше создать образы, чтобы не работать с оригиналами: + +1. В R-Studio: **Tools → Create Image** +2. Выбираете диск → указываете путь для сохранения образа. +3. Выбираете формат `.img` или `.dd` +4. Нажимаете **Start** + +⚠️ Важно: делайте это на отдельный большой диск с достаточным местом. + +--- + +## **Шаг 3. Восстановление RAID 10 в R-Studio** + +1. **Откройте R-Studio** → вкладка **RAID Recovery** +2. Выберите **Create RAID** +3. Выбираем **RAID 10** (или RAID 1+0) +4. Указываем **диски или образы**, которые входили в массив +5. Настройте **параметры RAID**: + - **Stripe size** — если не знаете, можно попробовать 64KB, 128KB или 256KB (обычно стандарт) + - **Order of disks** — порядок подключения дисков (если неизвестен, R-Studio может попробовать авто-подбор) + - **Offset** — обычно 0 + - **Type of RAID 10** — «mirror first» или «stripe first» (по умолчанию “mirror first”) +6. Нажмите **Test RAID** + - Если параметры правильные, увидите файлы/папки из массива + - Если нет — пробуйте менять **порядок дисков и stripe size** +--- + +## **Шаг 4. Восстановление файлов** + +1. Когда массив собран корректно → в **R-Studio** появятся папки и файлы. +2. Выбираем нужные файлы/папки → **Recover** +3. Указываем **диск для сохранения данных** (не тот, что был в [[RAID]]!) +4. Нажимаем **Start** +💡 R-Studio восстановит файлы в указанную папку, сохраняя структуру каталогов. +--- + +## **Шаг 5. Проверка и резерв** + +- После восстановления убедитесь, что все файлы читаются. +- Создайте резервные копии на отдельном диске. \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Відновлення даних.md b/2.Areas/Системне адміністрування/Відновлення даних.md new file mode 100644 index 0000000..4bae84b --- /dev/null +++ b/2.Areas/Системне адміністрування/Відновлення даних.md @@ -0,0 +1,54 @@ +## Професійні аналоги R-Studio + +1. **UFS Explorer Professional Recovery** + - Потужна програма для роботи з [[RAID]] (RAID 0, 1, 5, 6, 10, JBOD). + - Може автоматично визначати параметри масиву. + - Підтримує образи, роботу з віртуальними машинами. + +2. **ReclaiMe Pro RAID Recovery** + - Спеціалізується саме на RAID. + - Дозволяє підбирати параметри масиву (stripe size, порядок дисків). + - Проста у використанні, але досить дорога. + +3. **Hetman RAID Recovery** + - Зручний інтерфейс. + - Працює з RAID 0, 1, 5, 10. + - Дає можливість зібрати масив вручну або автоматично. + +4. **[[R-Studio]]** + - Потужна програма для роботи з RAID (RAID 0, 1, 5, 6, 10, JBOD). + - Може автоматично визначати параметри масиву. + - Підтримує образи, роботу з віртуальними машинами. +--- +## 🔹 Інструменти загального призначення + +4. **EaseUS Data Recovery Wizard** + + - Популярний інструмент для звичайного відновлення даних. + - Підтримка RAID обмежена, але підходить для простих випадків. + +5. **Stellar Data Recovery Technician** + + - Має окрему редакцію для RAID (RAID 0, 5, 6). + - Може автоматично визначати параметри масиву. + +6. **DiskInternals RAID Recovery** + + - Підтримує всі основні рівні RAID. + - Є майстер для швидкого складання масиву. + - Інтеграція з Windows Explorer. + +--- + +## 🔹 Безкоштовні / умовно-безкоштовні + +7. **TestDisk** (open source) + - Працює з файловими системами, але не має прямої підтримки RAID. + - Часто використовується для відновлення таблиць розділів. + +8. **ZAR (Zero Assumption Recovery)** + + - Старіший інструмент, але ще працює. + - Має базову підтримку RAID 0/1. + + #RAID \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Перестав працювати Portainer.md b/2.Areas/Системне адміністрування/Перестав працювати Portainer.md new file mode 100644 index 0000000..a75bd08 --- /dev/null +++ b/2.Areas/Системне адміністрування/Перестав працювати Portainer.md @@ -0,0 +1,82 @@ +**Проблема у несумісності [[Portainer]] CE ↔ Docker 29.0.2**. +Але на Ubuntu 24.04, Docker 29.x ставиться автоматично та ламає мені усю роботу. +# 🔥 КРОК 1 — Видаляємо Docker 29.x + +> **ВАЖЛИВО:** контейнери та образи НЕ видаляться, якщо не чіпати `/var/lib/docker`. +`sudo systemctl stop docker sudo apt remove -y docker-ce docker-ce-cli docker-ce-rootless-extras docker-buildx-plugin docker-compose-plugin sudo apt autoremove -y` + +--- + +# 🔥 КРОК 2 — Прибрати старі репозиторії Docker + +Бо в них уже лежить Docker 29.x, і apt знову поставить його. +`sudo rm -f /etc/apt/sources.list.d/docker.list sudo rm -f /usr/share/keyrings/docker.asc` + +--- + +# 🔥 КРОК 3 — Додати репозиторій Docker із архівом старих версій + +Docker зберігає **всі старі версії** тут: + +`https://download.docker.com/linux/ubuntu/dists/` + +Для Ubuntu 24.04 (Noble) робимо: + +`echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu noble stable" | sudo tee /etc/apt/sources.list.d/docker.list` + +Додаємо ключ: + +`curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --yes --dearmor -o /usr/share/keyrings/docker.asc` + +Оновлюємо індекс: + +`sudo apt update` + +--- + +# 🔥 КРОК 4 — Подивитися всі доступні версії Docker 25.x + +`apt-cache madison docker-ce` + +Ти побачиш список типу: + +`docker-ce | 5:25.0.5-1~ubuntu.24.04~noble | ... docker-ce | 5:24.x.x | ... docker-ce | 5:20.x.x | ...` + +--- + +# 🔥 КРОК 5 — Встановити Docker 25.x + +Наприклад, **25.0.5**: + +`sudo apt install docker-ce=5:25.0.5-1~ubuntu.22.04~jammy +`sudo apt install docker-ce-cli=5:25.0.5-1~ubuntu.22.04~jammy +`sudo apt install docker-ce-rootless-extras=5:25.0.5-1~ubuntu.22.04~jammy +`sudo apt install docker-buildx-plugin docker-compose-plugin` + +--- + +# 🔥 КРОК 6 — Заборонити оновлення Docker + +Щоб Ubuntu не оновила його назад до 29.x: + +`sudo apt-mark hold docker-ce docker-ce-cli docker-ce-rootless-extras docker-buildx-plugin docker-compose-plugin` + +--- + +# 🔥 КРОК 7 — Перевірити версію + +`docker version` + +Має бути щось типу: + +`Server: Docker Engine - Community Version: 25.0.5 API version: 1.42` + +Portainer CE працює до **API 1.45**, тому все буде норм. + +--- + +# 🔥 КРОК 8 — Перезапустити Portainer CE + +`docker stop portainer docker rm portainer docker run -d \ -p 9443:9443 \ --name portainer \ --restart=always \ -v /var/run/docker.sock:/var/run/docker.sock \ -v portainer_data:/data \ portainer/portainer-ce:2.21.4` + +#Portainer #Docker \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Словник термінів/Docker.md b/2.Areas/Системне адміністрування/Словник термінів/Docker.md new file mode 100644 index 0000000..2bc1b84 --- /dev/null +++ b/2.Areas/Системне адміністрування/Словник термінів/Docker.md @@ -0,0 +1,4 @@ +Docker — це платформа для контейнеризації, яка дозволяє запускати програми в ізольованих середовищах, що називаються контейнерами. Кожен контейнер містить усе необхідне для роботи застосунку: код, бібліотеки, залежності та налаштування. + +Docker спрощує розгортання, масштабування та перенесення програм між серверами. Завдяки контейнерам застосунки працюють однаково на будь-якій системі, що зменшує кількість помилок та прискорює розробку. +#Docker \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Словник термінів/ITSM.md b/2.Areas/Системне адміністрування/Словник термінів/ITSM.md new file mode 100644 index 0000000..5789ebd --- /dev/null +++ b/2.Areas/Системне адміністрування/Словник термінів/ITSM.md @@ -0,0 +1,3 @@ +ITSM (IT Service Management) — це концепція та набір процесів для ефективного управління ІТ-послугами в організації. Вона охоплює весь життєвий цикл сервісів: від планування та розробки до надання, підтримки та постійного покращення. Основна мета ITSM — забезпечити, щоб ІТ-послуги відповідали потребам бізнесу, були надійними, доступними та ефективними для користувачів. + +ITSM зазвичай базується на стандартах та кращих практиках, таких як ITIL, і включає процеси управління інцидентами, проблемами, змінами, запитами та активами. Впровадження ITSM дозволяє організаціям підвищити якість ІТ-послуг, зменшити ризики, покращити взаємодію між ІТ та бізнес-підрозділами, а також ефективніше використовувати ресурси. Це робить ІТ не просто технічною підтримкою, а стратегічним інструментом розвитку бізнесу. \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Словник термінів/Portainer.md b/2.Areas/Системне адміністрування/Словник термінів/Portainer.md new file mode 100644 index 0000000..602e5b3 --- /dev/null +++ b/2.Areas/Системне адміністрування/Словник термінів/Portainer.md @@ -0,0 +1,3 @@ +Дай короткий опис що таке Portainer + +Portainer — це зручний інтерфейс для управління контейнерами [[Docker]] та Kubernetes. Він допомагає спростити процес розгортання, управління та моніторингу контейнерних додатків, надаючи користувачам зрозумілий веб-інтерфейс. Portainer дозволяє легко керувати різними аспектами контейнерних середовищ, такими як створення та видалення контейнерів, управління образами, мережами та об'ємами даних. Це інструмент, який підходить як для новачків, так і для досвідчених користувачів у сфері контейнеризації. \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Словник термінів/Power Shell.md b/2.Areas/Системне адміністрування/Словник термінів/Power Shell.md new file mode 100644 index 0000000..16cf212 --- /dev/null +++ b/2.Areas/Системне адміністрування/Словник термінів/Power Shell.md @@ -0,0 +1,2 @@ + +PowerShell — це кросплатформовий інструмент автоматизації завдань і конфігурації, розроблений компанією Microsoft. Він складається з командної оболонки і мови сценаріїв, які дозволяють виконувати складні операції адміністрування систем. PowerShell надає користувачам можливість автоматизувати процеси управління операційними системами Windows, Linux та macOS через використання командлетів (cmdlets), які є спеціалізованими командами для виконання різноманітних завдань. Крім того, PowerShell підтримує інтеграцію з іншими платформами та сервісами через модулі та розширення, що робить його потужним інструментом для системних адміністраторів і IT-фахівців. \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Словник термінів/Піонери в обчислювальній техніці та ІТ.md b/2.Areas/Системне адміністрування/Словник термінів/Піонери в обчислювальній техніці та ІТ.md new file mode 100644 index 0000000..63ca6ae --- /dev/null +++ b/2.Areas/Системне адміністрування/Словник термінів/Піонери в обчислювальній техніці та ІТ.md @@ -0,0 +1,64 @@ + +Комп'ютерні технології пройшли довгий шлях з моменту винайденого першого комп'ютера. По дорозі багато людей з різного походження внесли винаходи та інновації, які допомогли нам досягти того, де ми є сьогодні, за допомогою сучасних комп'ютерів. Без цих людей інформаційні технології не були б там, де є сьогодні. + +## Ранні комп'ютерні піонери + +**Ада Лавлейс** + +Ада Лавлейс народилася в 1815 році в сім'ї Анни Мілбанке та поета лорда Байрона. Її мати Анна Мілбанке виховала її, щоб досягти успіху в математиці. Коли Лавлес була ще молодою, їй показали Difference Engine (механічний калькулятор, розроблений Чарльзом Беббіджем) і опублікували набір приміток, які містили перший комп'ютерний алгоритм для аналітичного двигуна в 1843 році. У той час Лавлес передбачив, що комп'ютери врешті-решт будуть використовуватися поза математикою для таких речей, як складання музики, і робив прогнози про те, як технології вплинуть на суспільство. + +**Алан Тьюрінг** + +Алан Тьюрінг народився в 1912 році. Закінчуючи ступінь, він розробив концепцію машини Тьюрінга. Тьюрінг довів, що існують деякі математичні питання так/ні, які ніколи не можна вирішити обчислювально, що визначає обчислення та його обмеження. Ці висновки стануть одним із насіння інформатики, і його концептуальна машина Тьюрінга (так названа його докторським радником) вважається попередником сучасних комп'ютерних програм. Під час Другої світової війни Тьюрінг розробив турінг-вельчманську бомбу, яка використовувалася для розшифровки нацистських кодів та перехоплення нацистських повідомлень. Після війни гра імітації Тьюрінга (тепер відома як тест Тьюрінга) була створена як засіб оцінки здібностей штучного інтелекту. + +**Маргарет Гамільтон** + +Маргарет Гамільтон народилася в 1936 році. Працюючи у відділі метеорології Массачусетського технологічного інституту, вона розробила програмне забезпечення для прогнозування погоди. Пізніше Гамільтон продовжував працювати над програмним забезпеченням, яке використовувалося в команді NASA Apollo та місячних модулів. Маючи досвід написання програмного забезпечення, вона хотіла переконатися, що ця навичка отримає належну повагу, і придумала термін «інженерія програмного забезпечення». Завершивши свій досвід роботи над місіями Аполлона та посадками на Місяць, Гамільтон формалізувала те, що вона дізналася, у теорію, яка згодом стане Універсальною системною мовою. + +**Адмірал Грейс Хоппер** + +Грейс Хоппер народилася в 1906 році. Під час Другої світової війни вона приєдналася до резерву ВМС США після звільнення з ролі професора математики в коледжі Вассар. У ВМС їй було призначено проект Bureau of Ships Computation Project в Гарвардському університеті, де вона працювала в команді програмування для комп'ютера Mark I. Після війни та свого часу в Гарварді вона почала працювати над більш потужними комп'ютерами і рекомендувала розробити мову програмування, яка використовувала англійські слова, а не символи. Ця концепція зрештою стане FLOW-MATIC першою мовою програмування, яка використовує англійські слова, що також вимагало винаходу першого компілятора (програми, яка перекладає вихідний код у машинний код). Примітно, що їй також приписують перше використання терміну «комп'ютерна помилка» після того, як справжня помилка (моль) потрапила в комп'ютер, над яким вона працювала. Пізніше у своїй кар'єрі вона була одним з дизайнерів COBOL, мови програмування, яка використовується і сьогодні. + +## NASA і людські комп'ютери + +Наступні жінки працювали над різними проектами NASA. Деякі навіть були найняті як людські комп'ютери. Їм було поставлено завдання виконати складні розрахунки вручну для всіляких ситуацій від співвідношення штовху до ваги воєнного часу до траєкторій орбіти Аполлона. Всі вони продовжували мати вражаючу кар'єру в математиці та інформатиці. + +**Енні Ізлі** розробила код енергетичної аналітики, який використовується для аналізу енергетичних технологій, включаючи технологію, яка використовувалася в технології акумуляторів для ракет Centaur та ранніх гібридних транспортних засобів + +**Кетрін Джонсон** була фізиком, математиком та космічним вченим, яка надала розрахунок для важливих місій, таких як перша орбіта Землі та посадка на Місяць Аполлона 11. + +**Дороті Воган** була математиком, яка врешті-решт стала першим афроамериканським керівником NACA (Національний консультативний комітет з аеронавтики, який згодом стане NASA) та програмістом-експертом FORTRAN, який працював над програмою ракет-носія Scout (сімейство ракет, які розміщували невеликі супутники на орбіту). + +**Мері Джексон** була першою чорношкірою жінкою-інженером НАСА. Вона працювала над аеродинамічними тунелями та льотними експериментами і продовжувала здобувати найстарший інженерний титул НАСА. + +**Мельба Рой Мутон була** головним математиком НАСА, працюючи над проектом Echo, першим експериментом з пасивного супутникового зв'язку. У НАСА вона писала програми, які розраховували місця розташування та траєкторії літаків. + +**Евелін Бойд Гранвіль** працювала над кількома проектами в програмах «Аполлон» та «Меркурій» для НАСА. Вона працювала над комп'ютерними методами, пов'язаними з такими поняттями, як небесна механіка та обчислення траєкторії. + +## Інноватори в сучасних технологіях + +**Хеді Ламарр** + +Хеді Ламарр народилася в 1914 році. Актриса кіно в золотий вік Голлівуду, вона також була винахідником-самоучкою. Під час Другої світової війни вона читала про радіокеровані торпеди, які потенційно можуть бути заклинені ворожими силами. Вона та друг композитора запропонували та запатентували ідею радіосигналу, що стрибає частоту, який використовував існуючу технологію піаніно. Принципи цієї роботи врешті-решт будуть використані в знайомих технологіях, таких як WiFi, Bluetooth та GPS. + +**Гільєрмо Гонсалес Камарена** + +Гільєрмо Гонсалес Камарена народився в 1917 році. Інженер-електрик, у 1940 році запатентував адаптер, який дозволяє монохромним камерам використовувати кольори. Ця технологія була однією з найдавніших форм кольорового телебачення. Система Камарена врешті-решт буде використана НАСА для місії «Вояджер» і зробила можливими кольорові зображення Юпітера. + +**Джеральд (Джеррі) Лоусон** + +Джеррі Лоусон народився в 1940 році. Працюючи інженером напівпровідників для компанії Fairchild, він працював у команді, яка розробила Fairchild Channel F, кольорову відеоігрову консоль, яка була розроблена для використання змінних ігрових картриджів. Раніше більшість ігрових систем мали вбудоване програмування. Пізніше його охрестили «батьком картриджа для відеоігор» за цю роботу. + +**Марк Е. Дін** + +Марк Дін народився в 1957 році. Винахідник і інформатик, він є головним інженером команди IBM, яка випустила персональний комп'ютер IBM. Він володіє трьома з дев'яти патентів на ПК. Він і його команда також створили перший гігагерцовий комп'ютерний чіп, а також допоміг розробити кольоровий монітор ПК. Разом з Деннісом Моллером він розробив шину Industry Standard Architecture (ISA), яка була попередником сучасних структур шин, таких як PCI та PCI express. + +**Кларенс «Скіп» Елліс** + +Кларенс Елліс народився в 1943 році. Він був комп'ютерним вченим та професором, який став піонером у кооперативній роботі та груповому програмному забезпеченні, що підтримується комп'ютером. Насправді, працюючи в Xerox PARC, він і його команда розробили групову систему під назвою OfficeTalk. Вперше ця система дозволила співпрацювати на відстані за допомогою Ethernet. Він також зосередився на графічних інтерфейсах користувача (GUI) на основі іконок, які стали поширеними в сучасних обчисленнях. + +**Гледіс Вест** + +Гледіс Вест народилася в 1930 році. Математика, її найняли працювати на ВМС США, щоб більш точно моделювати форму Землі. Вона використовувала алгоритми для врахування всіляких варіацій форми Землі, і її модель врешті-решт буде використана як основа для глобальної системи позиціонування (GPS). + +Ці особи - кілька помітних прикладів, але це аж ніяк не повний список! \ No newline at end of file diff --git a/2.Areas/Системне адміністрування/Чистка старих замовлень в паппці.md b/2.Areas/Системне адміністрування/Чистка старих замовлень в паппці.md new file mode 100644 index 0000000..6ee4693 --- /dev/null +++ b/2.Areas/Системне адміністрування/Чистка старих замовлень в паппці.md @@ -0,0 +1,28 @@ +Код для [[Power Shell]] + +``` +#Дата з якою порівнювати. У цьому випадку -7 днів від поточної дати. +$date = (Get-Date).AddDays(-7) +#Шлях до директорії звідки видаляти файли +$path = "D:\WORK\Замовлення" +#Розташування звіту +$report = "D:\WORK\Замовлення\file_list.txt" + +#Працюємо з файлами +#Виведення списку всіх файлів без папок (в т.ч. усередині папок) старше значення $date +$filelist = Get-ChildItem -Recurse -Path $path -file | Where-Object -Property CreationTime -lT $date +$filelist | Sort-Object -Property CreationTime | ft CreationTime ,VersionInfo | tee $report +#Видаляємо файли +$filelist | Remove-Item -Recurse + +#Працюємо з каталогами +#Виведення списку всіх порожніх директорій(де немає ні файлів ні директорій) старше ніж дата $date +$folderlist = Get-ChildItem -Recurse -Path $path -Directory | Where-Object -Property LastWriteTime -lT $date | where { $_.psiscontainer -eq $true -and $_.GetFiles().count -eq 0 -and $_.GetDirectories().count -eq 0 } +#Виведення списку порожніх директорій (де немає файлів, але є директорії) старше за дату $date +#$folderlist = Get-ChildItem -Recurse -Path $path -Directory | Where-Object -Property LastWriteTime -lT $date | where { $_.psiscontainer -eq $true -and $_.GetFiles().count -eq 0 } +#$folderlist | Sort-Object -Property LastWriteTime | ft LastWriteTime ,FullName | tee $report -Append +#Видаляємо каталоги +$folderlist | Remove-Item -Recurse +``` + +#Power_Shell \ No newline at end of file diff --git a/2.Areas/Техпідтримка/Help-Desk Zammad.md b/2.Areas/Техпідтримка/Help-Desk Zammad.md new file mode 100644 index 0000000..324a3d4 --- /dev/null +++ b/2.Areas/Техпідтримка/Help-Desk Zammad.md @@ -0,0 +1,140 @@ +**Zammad** — це сучасна, відкрита (open-source) система **HelpDesk / ServiceDesk**, створена для того, щоб компанії могли швидко приймати звернення клієнтів, обробляти заявки, керувати підтримкою та автоматизувати роботу служби сервісу. + +Zammad поєднує все в одному місці: email, чат, соцмережі, телефонію та CRM-функції. + +--- + +# ⭐ Основні можливості Zammad + +### 📬 1. Централізація звернень + +Усі повідомлення потрапляють у єдину панель, незалежно від каналу: + +- Email +- Телеграм +- Viber (через webhook-и) +- WhatsApp (через API-провайдерів) +- Twitter/X +- Facebook +- Web-форму +- Live-чат на сайті +- Телефонні дзвінки (VoIP інтеграції) + +--- +### 🎟️ 2. Система тікетів + +Zammad працює за моделлю тикетного HelpDesk: + +- створення заявок автоматично або вручну +- пріоритети +- SLA / дедлайни +- категорії +- групи підтримки +- коментарі +- вкладення +- історія переписки у тікеті + +--- +### 🤖 3. Автоматизації + +Zammad дозволяє автоматично: + +- призначати заявки потрібним агентам +- виставляти пріоритети +- створювати тригери +- застосовувати макроси +- відправляти автоповідомлення +- інтегруватися з ChatGPT/AI + +--- + +### 👤 4. Управління клієнтами + +Вбудована база клієнтів (CRM-мінімум): + +- користувачі + +- організації + +- поля, атрибути + +- історія запитів + +- права доступу + + +--- + +### 📊 5. Аналітика та звіти + +Готові та кастомні dashboards: + +- SLA метрики + +- час реакції + +- завантаженість агентів + +- кількість тікетів + +- типи звернень + +- продуктивність + + +--- + +### 🔗 6. Інтеграції + +Zammad має готові конектори: + +- Google Workspace (SMTP/IMAP/SSO) +- Microsoft 365 +- Slack +- GitHub / GitLab +- Jira +- LDAP / Active Directory +- SIP/VoIP + +API REST дозволяє інтегрувати все інше. + +--- + +### 🛡️ 7. Безпека + +- 2FA +- Доступ по ролях +- Логи аудиту +- Шифрування +- SAML / OAuth +- SOC2 (хмарна версія) + +--- + +# 🏗️ Де можна розгорнути Zammad? + +### ✔ SaaS (хмара Zammad) + +- все оновлення автоматичні +- простий старт +- оплата за агентів + +### ✔ Self-hosted (на своєму сервері) + +- повністю безкоштовно +- Docker / Kubernetes +- Ubuntu, Debian, CentOS +- повна свобода кастомізації + +--- + +# 🎯 Для чого підходить Zammad? + +Zammad ідеальний для: + +- IT-компаній +- e-commerce +- сервісних центрів +- техпідтримки 1-го та 2-го рівня +- контакт-центрів +- internal IT Helpdesk у компанії \ No newline at end of file diff --git a/2.Areas/Техпідтримка/Service-Desk GLPI.md b/2.Areas/Техпідтримка/Service-Desk GLPI.md new file mode 100644 index 0000000..f0b3416 --- /dev/null +++ b/2.Areas/Техпідтримка/Service-Desk GLPI.md @@ -0,0 +1,10 @@ +GLPI — це відкрите ПЗ (open-source) для управління ІТ-активами та організації сервіс-деску ([[ITSM]]). Воно дозволяє: + +- Вести облік апаратного та програмного забезпечення, мережевих пристроїв та ліцензій. +- Управляти запитами користувачів через service desk. +- Автоматизувати робочі процеси, інциденти, проблеми та зміни (ITIL-процеси). +- Генерувати звіти та аналітику по ІТ-ресурсах і запитах. +- Інтегруватися з LDAP/Active Directory та іншими системами для централізованого управління. + +Підійде як для малих, так і для великих організацій, які хочуть контролювати ІТ-інфраструктуру і підвищити ефективність підтримки користувачів. +#GLPI #HelpDesk #ServiceDesk #ITSM diff --git a/2.Areas/Техпідтримка/Встановлення GLPI через Portainer на (Ubuntu 22.04).md b/2.Areas/Техпідтримка/Встановлення GLPI через Portainer на (Ubuntu 22.04).md new file mode 100644 index 0000000..55d5168 --- /dev/null +++ b/2.Areas/Техпідтримка/Встановлення GLPI через Portainer на (Ubuntu 22.04).md @@ -0,0 +1,110 @@ + +## 1️⃣ Підготуй директорію на сервері + +`mkdir -p /opt/glpi cd /opt/glpi` + +_(Portainer буде використовувати цю директорію для volume-ів)_ + +--- + +# 2️⃣ Увійди в Portainer + +В браузері: + +`http://YOUR_SERVER_IP:9000` + +Перейди: + +**Home → Local → Stacks → Add stack** + +Назва стека: + +`glpi` + +--- + +# 3️⃣ Встав у [[Portainer]] наступний `docker-compose`: + +`version: "3.8" + +services: + db: + image: mariadb:10.7 + container_name: glpi-db + restart: unless-stopped + environment: + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_DATABASE: glpidb + MYSQL_USER: glpi + MYSQL_PASSWORD: glpipass + volumes: + - /opt/glpi/db_data:/var/lib/mysql + + glpi: + image: diouxx/glpi:latest + container_name: glpi-app + restart: unless-stopped + ports: + - "8080:80" + environment: + - TIMEZONE=Europe/Kyiv + depends_on: + - db + volumes: + - /opt/glpi/glpi_data:/var/www/html/glpi + +volumes: {} +` + +--- + +# 4️⃣ Запусти стек + +У Portainer натисни: + +**Deploy the stack** + +Після цього: + +- контейнер `glpi-app` підніметься на порту **8080** + +- база `glpi-db` стартує автоматично + + +--- + +# 5️⃣ Відкрити [[Service-Desk GLPI]] в браузері + +`http://YOUR_SERVER_IP:8080` + +--- + +# 6️⃣ Завершення інсталяції GLPI + +На етапі підключення до БД вкажи: + +- **Server**: `db` +- **Database**: `glpidb` +- **User**: `glpi` +- **Password**: `glpipass` + +--- + +# 7️⃣ Стандартні логіни GLPI + +|Роль|Логін|Пароль| +|---|---|---| +|Адмін|glpi|glpi| +|Технік|tech|tech| +|Юзер|normal|normal| +|Тільки пост|post-only|postonly| + +--- + +# 8️⃣ Видали директорію `/install` + +Через Portainer → Containers → glpi-app → Console (bash): + +`rm -rf /var/www/html/glpi/install` + +#GLPI #HelpDesk #Portainer #Docker \ No newline at end of file diff --git a/2.Areas/Техпідтримка/Професійний сертифікат ІТ-підтримка Google.md b/2.Areas/Техпідтримка/Професійний сертифікат ІТ-підтримка Google.md new file mode 100644 index 0000000..fe41be0 --- /dev/null +++ b/2.Areas/Техпідтримка/Професійний сертифікат ІТ-підтримка Google.md @@ -0,0 +1,2 @@ +https://www.coursera.org/professional-certificates/google-it-support + diff --git a/2.Areas/Техпідтримка/Путівник по курсам для ІТ спеціалістів технічної підтримки..md b/2.Areas/Техпідтримка/Путівник по курсам для ІТ спеціалістів технічної підтримки..md new file mode 100644 index 0000000..e4e2b80 --- /dev/null +++ b/2.Areas/Техпідтримка/Путівник по курсам для ІТ спеціалістів технічної підтримки..md @@ -0,0 +1,3 @@ +1. Зробитиогляд на курси CISCO +2. Зробити огляд на курси Прометеус на тему технічної підтримки та ШІ + \ No newline at end of file diff --git a/2.Areas/Техпідтримка/Сервер радіо AzuraCast.md b/2.Areas/Техпідтримка/Сервер радіо AzuraCast.md new file mode 100644 index 0000000..af9f6be --- /dev/null +++ b/2.Areas/Техпідтримка/Сервер радіо AzuraCast.md @@ -0,0 +1,37 @@ +**AzuraCast** — це самостійно розміщений універсальний пакет для керування веб-радіо. Використовуючи простий інсталятор та потужний, але інтуїтивно зрозумілий веб-інтерфейс, ви можете запустити повноцінно працездатну веб-радіостанцію за лічені хвилини. + +AzuraCast працює з веб-радіостанціями всіх типів і розмірів і створений для роботи навіть на найдоступніших VPS-хостингах. + +## Основні характеристики + +### Для радіостанцій + +- **Керування мультимедіа:** завантажуйте пісні, редагуйте метадані, переглядайте пісні та впорядковуйте музику в папки прямо з браузера. +- **Списки відтворення:** додавайте музику до списків відтворення зі стандартною ротацією (у послідовному або перемішаному порядку відтворення) або плануйте відтворення списку відтворення у запланований час або один раз на x пісень/хвилин тощо. +- **Діджеї в прямому ефірі:** налаштуйте індивідуальні облікові записи діджеїв/стрімерів і перегляньте, хто зараз транслює, на сторінці профілю вашої станції. +- **Веб-діджей:** Транслюйте в прямому ефірі безпосередньо з браузера, без необхідності додаткового програмного забезпечення, за допомогою вбудованого інструменту веб-діджея AzuraCast. +- **Публічні сторінки:** AzuraCast містить вбудовані публічні сторінки, які ви можете інтегрувати у свою існуючу веб-сторінку або використовувати як основу для власного налаштованого плеєра. +- **Запити слухачів:** Дозвольте вашим слухачам запитувати певні пісні з ваших списків відтворення як через API, так і через просту публічну сторінку слухача. +- **Віддалені ретрансляції:** транслюйте свій радіосигнал (включно з живими діджеями) на будь-який віддалений сервер, на якому запущено Icecast або Shoutcast. +- **Веб-хуки:** Інтегруйте свою станцію зі Slack, Discord, TuneIn, Twitter та іншими сервісами, налаштувавши веб-хуки, які підключаються до сторонніх сервісів. +- **Детальна аналітика та звіти:** відстежуйте кожен аспект слухачів вашої станції з плином часу. Переглядайте звіти про вплив кожної пісні на кількість ваших слухачів. Ви також можете створити звіт, сумісний із SoundExchange для роялті веб-радіо США. + +### Для адміністраторів серверів + +- **Керування користувачами на основі ролей:** Призначте ролі глобальні дозволи та дозволи для кожної станції, а потім додайте користувачів до цих ролей для контролю доступу. +- **Власний брендинг:** Змініть кожен аспект як внутрішніх, так і публічних сторінок AzuraCast, надавши власний CSS та JavaScript. +- **Автентифікований RESTful API:** Окремі користувачі в системі можуть створювати ключі API, які мають ті самі дозволи, що й у системі. API AzuraCast — це потужний та [добре документований](https://www.azuracast.com/api/index.html) інструмент для взаємодії з інсталяціями. +- **Перегляд веб-журналу:** Швидко діагностуйте проблеми, що впливають на будь-яку частину системи AzuraCast, за допомогою загальносистемного засобу перегляду веб-журналу. +- **Автоматичні радіопроксі:** Багато користувачів за замовчуванням не можуть підключатися безпосередньо до портів радіостанцій (наприклад, 8000), тому AzuraCast включає автоматичний проксі-сервер nginx, який дозволяє слухачам підключатися через порти http (80) та https (443). Ці проксі також сумісні з такими сервісами, як CloudFlare. +- **Керування місцем зберігання:** медіафайли станції, записи прямих трансляцій та резервні копії можна зберігати локально або на сумісному з S3 сховищі. + +## Що входить до комплекту + +AzuraCast автоматично завантажить та встановить ці компоненти для вас: + +### Програмне забезпечення для радіо + +- **[Liquidsoap](https://www.liquidsoap.info/)** як завжди граючий «AutoDJ» +- **[Icecast-KH](https://icecast.org/)** як фронтенд для радіомовлення + +Для інсталяцій x86/x64, [Shoutcast 2 DNAS](http://wiki.shoutcast.com/wiki/SHOUTcast_DNAS_Server_2) також можна використовувати як фронтенд для мовлення. Shoutcast — це платне програмне забезпечення, яке не постачається разом з AzuraCast, але його можна встановити через панель адміністрування після встановлення AzuraCast. \ No newline at end of file diff --git a/2.Areas/Техпідтримка/Що таке Microsoft Fabric.md b/2.Areas/Техпідтримка/Що таке Microsoft Fabric.md new file mode 100644 index 0000000..5b8dda1 --- /dev/null +++ b/2.Areas/Техпідтримка/Що таке Microsoft Fabric.md @@ -0,0 +1,70 @@ + +Microsoft Fabric — це уніфікована SaaS (Software as a Service) платформа для аналітики, яка об'єднує всі необхідні інструменти для роботи з даними в одному середовищі. Вона створена для спрощення складної інфраструктури, яка раніше вимагала інтеграції безлічі розрізнених сервісів (Azure Data Factory, Synapse, Power BI тощо). + +Головна мета Fabric — об'єднати інженерів даних, аналітиків, Data Scientists та бізнес-користувачів на одній платформі. + +### Ключові компоненти екосистеми + +1. **OneLake («OneDrive для даних»):** Фундамент платформи. Це єдине логічне сховище для всіх даних компанії. Дані зберігаються в одному місці, що усуває необхідність їх постійного копіювання та переміщення між різними системами. + +2. **Data Factory:** Інструмент для інтеграції даних. Дозволяє створювати пайплайни (Data Pipelines) та потоки даних (Dataflows Gen2) для завантаження інформації з різних джерел (понад 150 конекторів). + +3. **Synapse Data Engineering:** Середовище для роботи з великими даними за допомогою Spark (ноутбуки, визначення завдань). + +4. **Synapse Data Warehouse:** Сховище даних з високою продуктивністю SQL для роботи зі структурованими даними. + +5. **Synapse Data Science:** Інструменти для побудови, навчання та розгортання моделей машинного навчання. + +6. **Synapse Real-Time Analytics:** Обробка та аналіз потокових даних у реальному часі. + +7. **Power BI:** Візуалізація даних та бізнес-аналітика. У Fabric Power BI отримав режим **Direct Lake**, який дозволяє будувати звіти напряму на даних у OneLake без їх імпорту, що забезпечує високу швидкість. + +8. **Data Activator:** Інструмент для автоматичного виконання дій (сповіщення, запуск процесів) при виявленні певних патернів у даних. + + +### Процес обробки даних (Workflow) на практиці + +У демо-частині вебінару було продемонстровано типовий сценарій роботи з даними у Fabric: + +1. **Створення інфраструктури:** Процес створення ресурсу Fabric (Capacity) дуже простий і займає кілька хвилин (потрібно вказати лише назву, регіон та адміністратора). Не потрібно налаштовувати кластери Spark чи складні мережі — все працює "з коробки". + +2. **Ingestion (Завантаження даних):** Дані завантажуються в **Lakehouse**. Це можна зробити за допомогою Data Pipelines (наприклад, копіювання з Azure SQL Database) або Dataflows (візуальний інтерфейс Power Query). + +3. **Transformation (Трансформація):** + + - Використовується підхід **Medallion Architecture** (Bronze -> Silver -> Gold шари даних). + + - Трансформацію можна проводити як через **No-Code/Low-Code** інструменти (Dataflow Gen2), так і через **Pro-Code** (Notebooks на PySpark або Spark SQL). + + - Всі дані зберігаються у форматі Delta Parquet у OneLake. + +4. **Modeling & Serving (Моделювання):** На основі "золотих" (очищених) таблиць створюється семантична модель. Можна налаштовувати зв'язки між таблицями прямо у веб-інтерфейсі. + +5. **Visualization (Візуалізація):** Створення звіту Power BI безпосередньо в браузері на основі семантичної моделі. + + +### Особливості та переваги для бізнесу + +- **Єдина копія даних (One Copy):** Немає потреби дублювати дані для різних інструментів. Power BI читає ті самі файли, які підготував Data Engineer. + +- **SaaS-підхід:** Компанія купує "ємність" (Capacity), а не окремі сервери. Це спрощує адміністрування. + +- **Інтеграція з AI (Copilot):** Fabric має вбудовані AI-інструменти, які допомагають писати код, створювати пайплайни та аналізувати дані. + +- **Гнучкість:** Можливість працювати як з кодом (Python, Scala, SQL), так і через візуальні інтерфейси, що робить платформу доступною для фахівців різного рівня. + + +### Ліцензування + +Ліцензування базується на **Capacity (потужності)**, яка вимірюється в одиницях SKU (від F2 до F2048): + +- **F2 - F32:** Підходять для розробки та невеликих навантажень. Потребують ліцензії Power BI Pro для кожного користувача, який переглядає звіти. + +- **F64 і вище:** Дозволяють "безкоштовний" перегляд звітів для користувачів без ліцензій Power BI Pro (аналог Power BI Premium). + +- **Зберігання даних (OneLake Storage):** Оплачується окремо за обсяг (схоже на Azure Data Lake Storage). + +- Існує модель оплати Pay-as-you-go (з можливістю ставити на паузу) та Reservation (дешевше при оплаті на рік). + + +Цей огляд демонструє, що Microsoft Fabric є потужним рішенням для компаній, які прагнуть консолідувати свої аналітичні процеси, зменшити час на налаштування інфраструктури та використовувати сучасні підходи до управління даними. \ No newline at end of file diff --git a/2.Areas/Техпідтримка/блог.md b/2.Areas/Техпідтримка/блог.md new file mode 100644 index 0000000..36ea842 --- /dev/null +++ b/2.Areas/Техпідтримка/блог.md @@ -0,0 +1,7 @@ +Я почав вести свій блог, тому що зараз критично не вистачає спеціалістів ІТ-підтримки. Цей блог допоможе майбутнім ІТ-спеціалісти підтримки знайти зрозумілий і практичний путівник. Коли я починав свій шлях, мені дуже бракувало простої, чесної інформації про те, з чим доведеться стикатися, і я хочу заповнити цю прогалину. Маю надію мій досвід може стати для когось першим орієнтиром у світі техпідтримки. + +Також я хочу ділитися реальними ситуаціями, що трапляються під час роботи. Це кейси, уроки, інколи виклики, які формують професійність і характер. Я переконаний, що живі приклади набагато цінніші за сухі інструкції, а досвід інших може допомогти уникнути типових помилок. + +Окрему увагу я приділяю новим програмним продуктам і тому, як штучний інтелект інтегрується у сервіси підтримки. Інструменти швидко змінюються, і важливо не просто стежити за трендами, а й розуміти, як вони можуть покращити робочі процеси. Мій блог — це місце, де я збираю практичні знання, експерименти та спостереження, якими хочу ділитися з тими, хто розвивається в ІТ і хоче йти в ногу з майбутнім. + +ІТ-підтримки \ No newline at end of file diff --git a/Clippings/GPT-5.2 Prompting Guide OpenAI Cookbook.md b/Clippings/GPT-5.2 Prompting Guide OpenAI Cookbook.md new file mode 100644 index 0000000..31e1051 --- /dev/null +++ b/Clippings/GPT-5.2 Prompting Guide OpenAI Cookbook.md @@ -0,0 +1,480 @@ +--- +title: "GPT-5.2 Prompting Guide | OpenAI Cookbook" +source: "https://cookbook.openai.com/examples/gpt-5/gpt-5-2_prompting_guide" +author: +published: +created: 2025-12-13 +description: "GPT-5.2 is our newest flagship model for enterprise and agentic workloads, designed to deliver higher accuracy, stronger instruction foll..." +tags: + - "clippings" +--- +### 11 грудня 2025 р. + +## Посібник із підказок GPT-5.2 + +, + +[Відкрити в GitHub](https://github.com/openai/openai-cookbook/blob/main/examples/gpt-5/gpt-5-2_prompting_guide.ipynb) [Переглянути як Markdown](https://nbviewer.org/format/script/github/openai/openai-cookbook/blob/main/examples/gpt-5/gpt-5-2_prompting_guide.ipynb) + +## 1\. Вступ + +GPT-5.2 – це наша новітня флагманська модель для корпоративних та агентських робочих навантажень, розроблена для забезпечення вищої точності, чіткішого дотримання інструкцій та більш дисциплінованого виконання складних робочих процесів. Створена на основі GPT-5.1, GPT-5.2 підвищує ефективність токенів для завдань середнього та складного рівня, забезпечує чіткіше форматування з меншою кількістю зайвої багатослівності та демонструє явні переваги у структурованому мисленні, заземленні інструментів та багатомодальному розумінні. + +GPT-5.2 особливо добре підходить для виробничих агентів, які надають пріоритет надійності, оцінюваності та послідовній поведінці. Він високопродуктивний у сценаріях кодування, аналізу документів, фінансів та багатоінструментальних агентських сценаріях, часто дорівнюючи або перевершуючи провідні моделі за виконанням завдань. Водночас він залишається чутливим до підказок та легко керованим за тоном, деталізацією та формою виводу, що робить явні підказки важливою частиною успішного розгортання. + +Хоча GPT-5.2 добре працює "з коробки" для багатьох випадків використання, цей посібник зосереджений на шаблонах запитів та методах міграції, які максимізують продуктивність у реальних виробничих системах. Ці рекомендації базуються на внутрішньому тестуванні та відгуках клієнтів, де невеликі зміни в структурі запитів, обмеженнях деталізації та налаштуваннях міркувань часто призводять до значного покращення коректності, затримки та довіри розробників. + +## 2\. Ключові відмінності в поведінці + +**Порівняно з моделями попереднього покоління (наприклад, GPT-5 та GPT-5.1), GPT-5.2 забезпечує:** + +- **Більш продумане скамейкування:** створює чіткіші плани та проміжну структуру за замовчуванням; виграє від чітких обмежень щодо обсягу та деталізації. +- **Зазвичай нижча багатослівність:** більш лаконічна та орієнтована на завдання, хоча все ще чутлива до підказки, і вподобання необхідно чітко висловити в підказці. +- **Краще дотримання інструкцій:** менше відхилень від наміру користувача; покращене форматування та подання обґрунтування. +- **Компроміси ефективності інструментів:** виконує додаткові дії інструментів в інтерактивних потоках порівняно з GPT-5.1, може бути додатково оптимізована за допомогою підказок. +- **Консервативне упередження обґрунтування:** схильність сприяти правильності та чіткому міркуванню; подолання неоднозначності покращується завдяки уточнюючим підказкам. + +Цей посібник зосереджений на тому, щоб максимально використати сильні сторони GPT-5.2 — вищий інтелект, точність, обґрунтованість та дисципліну — одночасно пом'якшуючи недоліки, що залишилися. Існуючі рекомендації щодо підказок GPT-5 / GPT-5.1 значною мірою переносяться та залишаються застосовними. + +## 3\. Підказування шаблонів + +Адаптуйте наступні теми до своїх підказок для кращого розуміння GPT-5.2 + +### 3.1 Керування деталізацією та формою виводу + +Встановіть **чіткі та конкретні обмеження довжини,** особливо в корпоративних програмах та кодуючих агентах. + +Приклад налаштування затискача залежно від бажаної деталізації: + +### 3.2 Запобігання зміщенню області застосування (наприклад, UX / дизайн у завданнях фронтенду) + +GPT-5.2 сильніший для структурованого коду, але може створювати більше коду, ніж мінімальні UX-специфікації та системи дизайну. Щоб залишатися в межах сфери застосування, явно забороніть додаткові функції та неконтрольоване стилізування. + +``` + + +- Explore any existing design systems and understand it deeply. + +- Implement EXACTLY and ONLY what the user requests. + +- No extra features, no added components, no UX embellishments. + +- Style aligned to the design system at hand. + +- Do NOT invent colors, shadows, tokens, animations, or new UI elements, unless requested or necessary to the requirements. + +- If any instruction is ambiguous, choose the simplest valid interpretation. + + +``` + +Для забезпечення дотримання дизайн-системи повторно використовуйте блок 5.1 , але додайте «без додаткових функцій» та «кольори лише для токенів» для додаткового акценту. + +### 3.3 Довгостроковий контекст та запам'ятовування + +Для завдань з довгим контекстом підказка може отримати користь від **підсумовування та повторного заземлення**. Цей шаблон зменшує помилки «втрати під час прокручування» та покращує запам'ятовування щільних контекстів. + +``` + + +- For inputs longer than ~10k tokens (multi-chapter docs, long threads, multiple PDFs): + + - First, produce a short internal outline of the key sections relevant to the user’s request. + + - Re-state the user’s constraints explicitly (e.g., jurisdiction, date range, product, team) before answering. + + - In your answer, anchor claims to sections (“In the ‘Data Retention’ section…”) rather than speaking generically. + +- If the answer depends on fine details (dates, thresholds, clauses), quote or paraphrase them. + + +``` + +### 3.4 Подолання ризику невизначеності та галюцинацій + +Налаштуйте запит на надмірно впевнені галюцинації для неоднозначних запитів (наприклад, нечіткі вимоги, відсутні обмеження або питання, які потребують свіжих даних, але не викликаються). + +Запит на пом'якшення наслідків: + +Ви також можете додати короткий крок самоперевірки для високоризикових виходів: + +``` + + +Before finalizing an answer in legal, financial, compliance, or safety-sensitive contexts: + +- Briefly re-scan your own answer for: + + - Unstated assumptions, + + - Specific numbers or claims not grounded in context, + + - Overly strong language (“always,” “guaranteed,” etc.). + +- If you find any, soften or qualify them and explicitly state assumptions. + + +``` + +## 4\. Компакція (розширення ефективного контексту) + +Для тривалих робочих процесів з великим обсягом інструментів, які виходять за межі стандартного вікна контексту, GPT-5.2 з Reasoning підтримує стиснення відповідей через кінцеву точку /responses/compact. Стиснення виконує стиснення з урахуванням втрат для попереднього стану розмови, повертаючи зашифровані, непрозорі елементи, які зберігають інформацію, що стосується завдання, водночас значно зменшуючи обсяг токенів. Це дозволяє моделі продовжувати міркування в розширених робочих процесах, не торкаючись обмежень контексту. + +**Коли використовувати ущільнення** + +- Багатокрокові потоки агентів з багатьма викликами інструментів +- Довгі розмови, де потрібно дотримуватися попередніх порад +- Ітеративні міркування поза межами максимального контекстного вікна + +**Ключові властивості** + +- Створює непрозорі, зашифровані елементи (внутрішня логіка може змінюватися) +- Розроблено для продовження, а не для перевірки +- Сумісний з GPT-5.2 та Responses API +- Безпечно запускати багаторазово протягом тривалих сесій + +**Стиснути відповідь** + +Кінцева точка + +``` +POST https://api.openai.com/v1/responses/compact +``` + +**Що це робить** + +Виконує стиснення розмови та повертає стиснутий об'єкт відповіді. Передає стиснутий вивід у наступний запит, щоб продовжити робочий процес зі зменшеним розміром контексту. + +**Найкращі практики** + +- Контролюйте використання контексту та плануйте заздалегідь, щоб уникнути перевищення лімітів вікна контексту +- Компактний після важливих етапів (наприклад, етапів з великим використанням інструментів), не на кожному кроці +- Зберігайте функціонально ідентичні підказки під час відновлення, щоб уникнути відхилення поведінки +- Обробляти стиснуті елементи як непрозорі; не розбирати та не залежати від внутрішніх елементів + +Щоб отримати вказівки щодо того, коли та як стискати у робочому середовищі, див. посібник [зі стану розмови](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses) та сторінку [«Стиснення відповіді»](https://platform.openai.com/docs/api-reference/responses/compact). + +Ось приклад: + +## 5\. Керованість агента та оновлення для користувачів + +GPT-5.2 потужний для агентного скарбування та багатоетапного виконання за умови правильного запиту. Ви можете повторно використовувати блоки та GPT-5.1. + +Two key tweaks could be added to further push the performance of GPT-5.2: + +- Clamp verbosity of updates (shorter, more focused). +- Make scope discipline explicit (don’t expand problem surface area). + +Example updated spec: + +``` + + +- Send brief updates (1–2 sentences) only when: + + - You start a new major phase of work, or + + - You discover something that changes the plan. + +- Avoid narrating routine tool calls (“reading file…”, “running tests…”). + +- Each update must include at least one concrete outcome (“Found X”, “Confirmed Y”, “Updated Z”). + +- Do not expand the task beyond what the user asked; if you notice new work, call it out as optional. + + +``` + +## 6\. Tool-calling and parallelism + +GPT-5.2 improves on 5.1 in tool reliability and scaffolding, especially in MCP/Atlas-style environments. Best practices as applicable to GPT-5 / 5.1: + +- Describe tools crisply: 1–2 sentences for what they do and when to use them. +- Encourage parallelism explicitly for scanning codebases, vector stores, or multi-entity operations. +- Require verification steps for high-impact operations (orders, billing, infra changes). + +Example tool usage section: + +``` + + +- Prefer tools over internal knowledge whenever: + + - You need fresh or user-specific data (tickets, orders, configs, logs). + + - You reference specific IDs, URLs, or document titles. + +- Parallelize independent reads (read_file, fetch_record, search_docs) when possible to reduce latency. + +- After any write/update tool call, briefly restate: + + - What changed, + + - Where (ID or path), + + - Any follow-up validation performed. + + +``` + +## 7\. Structured extraction, PDF, and Office workflows + +This is an area where GPT-5.2 clearly shows strong improvements. To get the most out of it: + +- Always provide a schema or JSON shape for the output. You can use structured outputs for strict schema adherence. +- Distinguish between required and optional fields. +- Ask for “extraction completeness” and handle missing fields explicitly. + +Example: + +``` + + +You will extract structured data from tables/PDFs/emails into JSON. + +- Always follow this schema exactly (no extra fields): + + { + + "party_name": string, + + "jurisdiction": string | null, + + "effective_date": string | null, + + "termination_clause_summary": string | null + + } + +- If a field is not present in the source, set it to null rather than guessing. + +- Before returning, quickly re-scan the source for any missed fields and correct omissions. + + +``` + +For multi-table/multi-file extraction, add guidance to: + +- Serialize per-document results separately. +- Include a stable ID (filename, contract title, page range). + +## 8\. Prompt Migration Guide to GPT 5.2 + +This section helps you migrate prompts and model configs to GPT-5.2 while keeping behavior stable and cost/latency predictable. GPT-5-class models support a reasoning\_effort knob (e.g., none|minimal|low|medium|high|xhigh) that trades off speed/cost vs. deeper reasoning. + +Migration mapping Use the following default mappings when updating to GPT-5.2 + +| Current model | Target model | Target reasoning\_effort | Notes | +| --- | --- | --- | --- | +| GPT-4o | GPT-5.2 | none | Treat 4o/4.1 migrations as “fast/low-deliberation” by default; only increase effort if evals regress. | +| GPT-4.1 | GPT-5.2 | none | Same mapping as GPT-4o to preserve snappy behavior. | +| GPT-5 | GPT-5.2 | same value except minimal → none | Preserve none/low/medium/high to keep latency/quality profile consistent. | +| GPT-5.1 | GPT-5.2 | same value | Preserve existing effort selection; adjust only after running evals. | + +\*Note that default reasoning level for GPT-5 is medium, and for GPT-5.1 and GPT-5.2 is none. + +We introduced the [Prompt Optimizer](https://platform.openai.com/chat/edit?optimize=true) in the Playground to help users quickly improve existing prompts and migrate them across GPT-5 and other OpenAI models. General steps to migrate to a new model are as follows: + +- Step 1: Switch models, don’t change prompts yet. Keep the prompt functionally identical so you’re testing the model change—not prompt edits. Make one change at a time. +- Step 2: Pin reasoning\_effort. Explicitly set GPT-5.2 reasoning\_effort to match the prior model’s latency/depth profile (avoid provider-default “thinking” traps that skew cost/verbosity/structure). +- Step 3: Run Evals for a baseline. After model + effort are aligned, run your eval suite. If results look good (often better at med/high), you’re ready to ship. +- Крок 4: Якщо є регресії, налаштуйте підказку. Використовуйте оптимізатор підказок + цільові обмеження (детальність/формат/схема, дисципліна області видимості) для відновлення парності або покращення. +- Крок 5: Повторно запускайте Evals після кожної невеликої зміни. Виконуйте ітерації, збільшуючи reasoning\_effort на один рівень або вносячи поступові корективи в запити, а потім повторно вимірюйте. + +GPT-5.2 є більш керованим та здатним синтезувати інформацію з багатьох джерел. + +Найкращі практики, яких слід дотримуватися: + +- Вкажіть панель дослідження заздалегідь: повідомте моделі, як ви хочете виконувати пошук. Чи слід слідувати за ланцюжками другого порядку, вирішувати суперечності та включати цитати. Чітко вкажіть, як далеко потрібно зайти, наприклад: що додаткові дослідження мають продовжуватися, доки граничне значення не знизиться. +- Обмежуйте неоднозначність за допомогою інструкцій, а не питань: доручайте моделі всебічно охоплювати всі ймовірні наміри та не ставити уточнюючих питань. Вимагайте широти та глибини, коли існує невизначеність. +- Диктуйте форму та тон виводу: встановіть очікування щодо структури (Markdown, заголовки, таблиці для порівняння), ясності (визначення акронімів, конкретні приклади) та стилю (розмовний, адаптивний до персонажів, непідлещливий) + +## 10\. Висновок + +GPT-5.2 є значним кроком вперед для команд, які створюють агенти виробничого рівня, що надають пріоритет точності, надійності та дисциплінованому виконанню. Він забезпечує чіткіше виконання інструкцій, чистіший вивід та більш послідовну поведінку в складних робочих процесах, що вимагають багато інструментів. Більшість існуючих підказок мігрують безперешкодно, особливо коли зусилля на міркування, деталізація та обмеження області застосування зберігаються під час початкового переходу. Команди повинні покладатися на оцінки для перевірки поведінки перед внесенням змін до підказок, коригуючи зусилля на міркування або обмеження лише тоді, коли з'являються регресії. Завдяки явним підказкам та виміряній ітерації, GPT-5.2 може розблокувати результати вищої якості, зберігаючи при цьому передбачувані профілі витрат та затримки. + +### Приклад запиту для агента веб-досліджень: + +``` +You are a helpful, warm web research agent. Your job is to deeply and thoroughly research the web and provide long, detailed, comprehensive, well written, and well structured answers grounded in reliable sources. Your answers should be engaging, informative, concrete, and approachable. You MUST adhere perfectly to the guidelines below. + +############################################ + +CORE MISSION + +############################################ + +Answer the user’s question fully and helpfully, with enough evidence that a skeptical reader can trust it. + +Never invent facts. If you can’t verify something, say so clearly and explain what you did find. + +Default to being detailed and useful rather than short, unless the user explicitly asks for brevity. + +Go one step further: after answering the direct question, add high-value adjacent material that supports the user’s underlying goal without drifting off-topic. Don’t just state conclusions—add an explanatory layer. When a claim matters, explain the underlying mechanism/causal chain (what causes it, what it affects, what usually gets misunderstood) in plain language. + +############################################ + +PERSONA + +############################################ + +You are the world’s greatest research assistant. + +Engage warmly, enthusiastically, and honestly, while avoiding any ungrounded or sycophantic flattery. + +Adopt whatever persona the user asks you to take. + +Default tone: natural, conversational, and playful rather than formal or robotic, unless the subject matter requires seriousness. + +Match the vibe of the request: for casual conversation lean supportive; for work/task-focused requests lean straightforward and helpful. + +############################################ + +FACTUALITY AND ACCURACY (NON-NEGOTIABLE) + +############################################ + +You MUST browse the web and include citations for all non-creative queries, unless: + +The user explicitly tells you not to browse, OR + +The request is purely creative and you are absolutely sure web research is unnecessary (example: “write a poem about flowers”). + +If you are on the fence about whether browsing would help, you MUST browse. + +You MUST browse for: + +“Latest/current/today” or time-sensitive topics (news, politics, sports, prices, laws, schedules, product specs, rankings/records, office-holders). + +Up-to-date or niche topics where details may have changed recently (weather, exchange rates, economic indicators, standards/regulations, software libraries that could be updated, scientific developments, cultural trends, recent media/entertainment developments). + +Travel and trip planning (destinations, venues, logistics, hours, closures, booking constraints, safety changes). + +Recommendations of any kind (because what exists, what’s good, what’s open, and what’s safe can change). + +Generic/high-level topics (example: “what is an AI agent?” or “openai”) to ensure accuracy and current framing. + +Navigational queries (finding a resource, site, official page, doc, definition, source-of-truth reference, etc.). + +Any query containing a term you’re unsure about, suspect is a typo, or has ambiguous meaning. + +For news queries, prioritize more recent events, and explicitly compare: + +The publish date of each source, AND + +The date the event happened (if different). + +############################################ + +CITATIONS (REQUIRED) + +############################################ + +When you use web info, you MUST include citations. + +Place citations after each paragraph (or after a tight block of closely related sentences) that contains non-obvious web-derived claims. + +Do not invent citations. If the user asked you not to browse, do not cite web sources. + +Use multiple sources for key claims when possible, prioritizing primary sources and high-quality outlets. + +############################################ + +HOW YOU RESEARCH + +############################################ + +You must conduct deep research in order to provide a comprehensive and off-the-charts informative answer. Provide as much color around your answer as possible, and aim to surprise and delight the user with your effort, attention to detail, and nonobvious insights. + +Start with multiple targeted searches. Use parallel searches when helpful. Do not ever rely on a single query. + +Deeply and thoroughly research until you have sufficient information to give an accurate, comprehensive answer with strong supporting detail. + +Begin broad enough to capture the main answer and the most likely interpretations. + +Add targeted follow-up searches to fill gaps, resolve disagreements, or confirm the most important claims. + +If the topic is time-sensitive, explicitly check for recent updates. + +If the query implies comparisons, options, or recommendations, gather enough coverage to make the tradeoffs clear (not just a single source). + +Keep iterating until additional searching is unlikely to materially change the answer or add meaningful missing detail. + +If evidence is thin, keep searching rather than guessing. + +If a source is a PDF and details depend on figures/tables, use PDF viewing/screenshot rather than guessing. + +Only stop when all are true: + +You answered the user’s actual question and every subpart. + +You found concrete examples and high-value adjacent material. + +You found sufficient sources for core claims + +############################################ + +WRITING GUIDELINES + +############################################ + +Be direct: Start answering immediately. + +Be comprehensive: Answer every part of the user’s query. Your answer should be very detailed and long unless the user request is extremely simplistic. If your response is long, include a short summary at the top. + +Use simple language: full sentences, short words, concrete verbs, active voice, one main idea per sentence. + +Avoid jargon or esoteric language unless the conversation unambiguously indicates the user is an expert. + +Use readable formatting: + +Use Markdown unless the user specifies otherwise. + +Use plain-text section labels and bullets for scannability. + +Use tables when the reader’s job is to compare or choose among options (when multiple items share attributes and a grid makes differences pop faster than prose). + +Do NOT add potential follow-up questions or clarifying questions at the beginning or end of the response unless the user has explicitly asked for them. + +############################################ + +REQUIRED “VALUE-ADD” BEHAVIOR (DETAIL/RICHNESS) + +############################################ + +Concrete examples: You MUST provide concrete examples whenever helpful (named entities, mechanisms, case examples, specific numbers/dates, “how it works” detail). For queries that ask you to explain a topic, you can also occasionally include an analogy if it helps. + +Do not be overly brief by default: even for straightforward questions, your response should include relevant, well-sourced material that makes the answer more useful (context, background, implications, notable details, comparisons, practical takeaways). + +In general, provide additional well-researched material whenever it clearly helps the user’s goal. + +Before you finalize, do a quick completeness pass: + +1. Did I answer every subpart + +2. Did each major section include explanation + at least one concrete detail/example when possible + +3. Did I include tradeoffs/decision criteria where relevant + +############################################ + +HANDLING AMBIGUITY (WITHOUT ASKING QUESTIONS) + +############################################ + +Never ask clarifying or follow-up questions unless the user explicitly asks you to. + +If the query is ambiguous, state your best-guess interpretation plainly, then comprehensively cover the most likely intent. If there are multiple most likely intents, then comprehensively cover each one (in this case you will end up needing to provide a full, long answer for each intent interpretation), rather than asking questions. + +############################################ + +IF YOU CANNOT FULLY COMPLY WITH A REQUEST + +############################################ + +Do not lead with a blunt refusal if you can safely provide something helpful immediately. + +First deliver what you can (safe partial answers, verified material, or a closely related helpful alternative), then clearly state any limitations (policy limits, missing/behind-paywall data, unverifiable claims). + +If something cannot be verified, say so plainly, explain what you did verify, what remains unknown, and the best next step to resolve it (without asking the user a question). +``` \ No newline at end of file diff --git a/Clippings/Глосарій термінів з курсу 1, модуль 1.md b/Clippings/Глосарій термінів з курсу 1, модуль 1.md new file mode 100644 index 0000000..abca0a0 --- /dev/null +++ b/Clippings/Глосарій термінів з курсу 1, модуль 1.md @@ -0,0 +1,48 @@ +--- +title: "Глосарій термінів з курсу 1, модуль 1" +source: "https://www.coursera.org/learn/technical-support-fundamentals/supplement/9RtvA/glossary-terms-from-course-1-module-1" +author: + - "[[Coursera]]" +published: +created: 2025-11-28 +description: "У першому модулі курсу ми дізнаємося про те, як були винайдені комп'ютери, як вони еволюціонували з часом і як вони працюють сьогодні. Ми також дізнаємося про те, що таке «спеціаліст з ІТ-підтримки» і чим вони займаються у своїй роботі. До кінця ..." +tags: + - "clippings" +--- +### Нові терміни та їх визначення: Курс 1 Модуль 1 + +**Абстракція:** взяти відносно складну систему та спростити її для нашого використання + +**Алгоритм:** Серія кроків, що вирішує конкретні проблеми + +**ASCII: Найстарішим** стандартом кодування символів є ASCII. Він представляє англійський алфавіт, цифри та розділові знаки + +**Двійкова система:** Зв'язок, який використовує комп'ютер, називається двійковою системою, також відомою як система числення бази-2 + +**Байт:** Група з 8 біт + +**Кодування символів:** Використовується для присвоєння наших двійкових значень символам, щоб ми, як люди, могли їх читати + +**Комп'ютер:** Пристрій, який зберігає та обробляє дані, виконуючи обчислення + +**Криптографія: все** осяжна дисципліна, яка охоплює практику кодування та приховування повідомлень від третіх сторін + +Десяткова **форма - система десяткова** система: У десятковій системі є 10 можливих чисел, які ви можете використовувати від нуля до дев'яти + +**Цифровий розрив:** зростаючий розрив навичок між людьми з навичками цифрової грамотності та без них + +**Інформаційні технології**: Використання цифрових технологій, таких як комп'ютери та Інтернет, для зберігання та обробки даних у корисну інформацію + +**ОС Linux:** Linux - одна з найбільших операційних систем з відкритим кодом, яка широко використовується в бізнес-інфраструктурі та в споживчому просторі + +**Логічні ворота:** Дозволяють транзисторам виконувати більш складні завдання, наприклад, вирішувати, куди надсилати електричні сигнали залежно від логічних умов + +**Відкритий код:** Це означає, що розробники дозволять іншим розробникам ділитися, змінювати та розповсюджувати своє програмне забезпечення безкоштовно + +**КПК (персональний цифровий помічник):** дозволяє обчисленню переходити на мобільні пристрої + +**Перфоральні карти:** Послідовність карт з отворами в них для автоматичного виконання обчислень замість того, щоб вручну вводити їх вручну + +**Модель RGB:** RGB або червона, зелена та синя модель є основною моделлю представлення кольорів + +**UTF-8: Найпоширеніший стандарт** кодування, який використовується сьогодні \ No newline at end of file diff --git a/Clippings/Додаткове читання для процесорів.md b/Clippings/Додаткове читання для процесорів.md new file mode 100644 index 0000000..4ca0b72 --- /dev/null +++ b/Clippings/Додаткове читання для процесорів.md @@ -0,0 +1,70 @@ +--- +title: "Додаткове читання для процесорів" +source: "https://www.coursera.org/learn/technical-support-fundamentals/supplement/REMwe/supplemental-reading-for-cpus" +author: + - "[[Coursera]]" +published: +created: 2025-11-28 +description: "У другому модулі цього курсу ми дізнаємося про те, що знаходиться всередині комп'ютера. Ми дізнаємося все про апаратні компоненти або різні частини всередині комп'ютера. Ми дізнаємось, що робить кожен компонент і як вони працюють разом, щоб ..." +tags: + - "clippings" +--- +Цей елемент містить вміст, який ще не перекладено на вибрану мову. + +## Кеш ЦП і розгін + +У цьому читанні ви дізнаєтеся про різні рівні кешу для центральних процесорів (CPU) та про те, як ЦП обробляє та виконує інструкції. Додатково ви дізнаєтеся про розгін процесорів для максимальної швидкості обробки. Фахівці ІТ-підтримки можуть використовувати цю інформацію під час придбання, розподілу та/або налаштування високопродуктивних серверів. + +## Кеш + +Можливо, ви вже знайомі з терміном «кеш». У комп'ютерному жаргоні кеш (вимовляється «готівка») відноситься до невеликої кількості недавно використаних даних, які зберігаються або на апаратному забезпеченні, або в програмному забезпеченні. При першому зверненні до даних, як початковий запит на дані, так і відповідь, що містить дані, проходять через кілька точок своєї подорожі. Залежно від кількох змінних, ці точки можуть включати пристрої вводу/виводу, шини материнської плати, оперативну пам'ять, кабелі, жорсткі диски, програми, мережі, Інтернет, хмарні платформи тощо. Якщо комп'ютер повинен був використовувати ці повні шляхи кожного разу, коли він намагався отримати доступ до даних, вся транзакція може зайняти відносно тривалий час. Кеш прискорює цей процес, зберігаючи локальну копію останніх доступних даних у тимчасовому сховищі. + +## кеш ЦП + +Процесори використовують систему кеш-пам'яті, щоб допомогти їм швидко отримати доступ до даних. Кеш процесора зазвичай зберігається всередині кожного ядра ЦП. Старі комп'ютери можуть зберігати кеш процесора в транзисторному чіпі, який приєднаний до материнської плати, разом із високошвидкісною шиною, що з'єднує мікросхему з процесором. + +### Рівень кешу ЦП + +Існує три рівні кеш-пам'яті ЦП: + +- Кеш **рівня 3: кеш** L3 є найбільшим і найповільнішим кешем ЦП. Однак він часто вдвічі швидше, ніж RAM. L3 - це перше місце кешу ЦП для зберігання даних після їх передачі з RAM. Кеш L3 часто ділиться всіма ядрами в одному ЦП. +- Кеш **рівня 2: ке** ш L2 містить менше даних, ніж кеш L3, але він має більш високу швидкість доступу. L2 зберігає копію останніх доступних даних, які наразі не використовуються ЦП. Кожне ядро ЦП зазвичай має свій кеш L2. +- Кеш **рівня 1: кеш** L1 є найшвидшим і найменшим з трьох рівнів кешу ЦП. L1 зберігає дані, які зараз використовуються ЦП. Кожне ядро ЦП зазвичай має свій кеш L1. + +## Розгін процесора + +Розгін процесора налаштовує його на роботу з більш високою тактовою частотою процесора, ніж оригінальні специфікації виробника. Наприклад, якщо процесор позначений як такий, що має базову частоту 3,2 ГГц, можливо, можна розігнати ЦП для роботи на частоті 3,5 ГГц. Досягнення більш високої тактової частоти процесора означає, що ЦП може обробляти більший обсяг інструкцій на наносекунду, що призводить до швидшої продуктивності. Користувач комп'ютера може захотіти розігнати свій ЦП, щоб покращити мляву швидкість під час виконання завдань, що вимагають інтенсивного процесора, таких як редагування відео або ігри. + +Розгін частоти процесора включає три змінні: + +- Базова тактова частота ЦП, часто вимірюється в ГГц. +- Частота ядра, яка обчислюється шляхом множення базової частоти на множники ядра ЦП. +- Напруга ядра, яку потрібно збільшувати з невеликими кроками, щоб задовольнити зростаючу потребу в потужності ЦП під час процесу розгону. + +### Попередження про розгін + +Розгін ЦП може пошкодити комп'ютер, якщо його не налаштувати належним чином. Робота процесора з більшою швидкістю може перегріти ЦП та навколишнє обладнання, що може спричинити збій комп'ютерної системи. Крім того, розгін ЦП може скоротити загальний термін служби комп'ютера і анулювати гарантію комп'ютера. Краще уникати розгону ЦП і замість цього придбати відповідну швидкість процесора, необхідну для задоволення вимог до обчислень. + +### Як безпечно розігнати ЦП + +Як спеціаліста з ІТ-підтримки, вас можуть попросити розігнати ЦП. Є кроки, які слід виконати, щоб зробити це якомога безпечніше. Завжди переконайтеся, що запитувач розуміє ризики розгону, перш ніж погодитися на виконання цієї процедури. + +1. **Перевірте, чи підтримується розгін: По-перше**, переконайтеся, що ЦП є моделлю, розблокованою для розгону. Не всі процесори можуть підтримувати розгін, включаючи більшість процесорів ноутбуків. Перевірте документацію виробника процесора, щоб визначити, чи можливий розгін для моделі ЦП. І Intel, і AMD надають посібники та інструменти з розгону для підтримуваних моделей ЦП (посилання на ці посібники див. Нижче). Крім того, перевірте документацію до моделі материнської плати комп'ютера, щоб переконатися, що вона може підтримувати розігнаний ЦП. +2. **Очистіть внутрішню частину комп'ютера: Вимкніть** та від'єднайте комп'ютер від мережі. Під час носіння антистатичного браслета відкрийте комп'ютер і використовуйте стиснене повітря, щоб видалити накопичений пил. Особливо важливо видалити пил навколо ЦП, вентиляторів та впускних отворів. +3. **Переконайтеся, що встановлено відповідний кулер процесора (критично)**: Якщо на комп'ютері є оригінальний кулер процесора, він, швидше за все, недостатній для охолодження розігнаного процесора. Замініть штатний кулер ЦП на вдосконалену систему охолодження, як система рідкого охолодження. +4. **Дотримуйтесь інструкцій виробника щодо розгону ЦП: Скорист** айтеся докладними інструкціями від виробника (посилання на посібники Intel та AMD дивіться нижче): + 1. Використовуйте програмне забезпечення для порівняльного аналізу, щоб встановити базову лінію для нормальної продуктивності комп'ютера. + 2. Встановіть кожен множник ядра ЦП на значення найнижчого множника за допомогою програмного забезпечення для розгону виробника (рекомендується) або BIOS. Потім перезавантажте комп'ютер. + 3. Збільште кожен множник ядра ЦП на 1, щоб збільшити частоту процесора. + 4. Перевірте кожне підвищення на стабільність, використовуючи утиліту тестування, надану виробником. + - Виправте будь-які проблеми, позначені інструментами тестування, особливо сповіщення про температуру. Якщо система стає занадто нестабільною, відкотите на останню частоту, яка виробляла стабільну продуктивність, і припиніть розгін ЦП. + - Якщо напруга виявляється недостатньою для підтримки нової частоти, збільште напругу на 0,05 В. Не збільшуйте напругу вище 1,4 В без спеціалізованого обладнання для охолодження. + - Якщо комп'ютер зависає або виходить з ладу, він або став абсолютно нестабільним, або ЦП не отримує достатньої напруги для підтримки розігнаної частоти. Використовуйте BIOS, щоб повернутися на останню стабільну частоту або збільшити напругу з кроком 0,01 В до стабільності. + 5. Якщо стабільний, перезавантажте комп'ютер перед спробою наступного збільшення. + +## Ресурси для отримання додаткової інформації + +- **Intel: Розгін:**[максимізуйте продуктивність](https://www.intel.com/content/www/us/en/gaming/overclocking-intel-processors.html) \- всеохоплюючий посібник Intel з розгону ЦП, оперативної пам'яті та материнської плати. На сайті також надаються утилітні інструменти для тонкої настройки продуктивності розгону і перераховуються моделі ЦП Intel, які підтримують розгін. +- **AMD:**[AMD Ryzen™ Master Utility для управління розгоном - набір інструментів](https://www.amd.com/en/technologies/ryzen-master) AMD для розгону процесорів Ryzen. Зауважте, що підтримка розгону для моделей, що не є Ryzen, більше не рекомендується AMD. +- **AMD:** Список [сумісності розгону пам'яті процесорів Ryzen™ - Список](https://www.amd.com/en/products/processors/ryzen-compatible-memory.html) моделей процесорів AMD Ryzen, які підтримують розгін. +- **AMD:**[Як розігнати процесор AMD Ryzen - Інструкції щодо розгону процесорів AMD Ryzen від журналу ПК](https://www.pcmag.com/how-to/how-to-overclock-your-amd-ryzen-cpu). \ No newline at end of file diff --git a/Clippings/Додаткове читання про логічні ворота.md b/Clippings/Додаткове читання про логічні ворота.md new file mode 100644 index 0000000..e371ce2 --- /dev/null +++ b/Clippings/Додаткове читання про логічні ворота.md @@ -0,0 +1,100 @@ +--- +title: "Додаткове читання про логічні ворота" +source: "https://www.coursera.org/learn/technical-support-fundamentals/supplement/bu1Q5/supplemental-reading-on-logic-gates" +author: + - "[[Coursera]]" +published: +created: 2025-11-28 +description: "У першому модулі курсу ми дізнаємося про те, як були винайдені комп'ютери, як вони еволюціонували з часом і як вони працюють сьогодні. Ми також дізнаємося про те, що таке «спеціаліст з ІТ-підтримки» і чим вони займаються у своїй роботі. До кінця ..." +tags: + - "clippings" +--- +## Логічні ворота + +Знання того, як працюють логічні ворота, важливо для розуміння того, як працює комп'ютер. Комп'ютери працюють, виконуючи двійкові обчислення. **Логічні ворота** \- це електричні компоненти, які підказують комп'ютеру, як виконувати двійкові обчислення. Вони визначають правила, як виробляти електричний вихід на основі одного або декількох електричних входів. Комп'ютери використовують ці електричні сигнали для представлення двох двійкових станів: або стану «увімкнено» або «вимкнено». Логічний ворот приймає один або кілька з цих двійкових станів і визначає, чи передавати сигнал «увімкнено» чи «вимкнено». + +Було розроблено кілька логічних воріт для представлення різних правил отримання двійкового виводу. Це читання охоплює шість найпоширеніших логічних воріт. + +## Шість загальних логічних воріт + +### НЕ ворота + +Ворота NOT є найпростішим, оскільки має лише один вхідний сигнал. Ворота NOT приймає цей вхідний сигнал і видає сигнал з протилежним двійковим станом. Якщо вхідний сигнал «увімкнено», затвор NOT видає сигнал «вимкнено». Якщо вхідний сигнал «вимкнено», затвор NOT видає сигнал «увімкнено». Всі логічні ворота можна визначити за допомогою схематичної схеми та таблиці істинності. Ось як часто представляється це логічне правило: + +![Не схема воріт і таблиця істини](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/tk5lDPnpRN-OZQz56QTflw_58ca55ecf59146549c08a532acc0d9f1_01_NOT-Gate-copy.png?expiry=1764430941432&hmac=yVP40VvLmu34-Yy0w4CmcYpYOECBNWfZxdaL_muUxWU) + +Не схема воріт і таблиця істини + +Зліва у вас є схематична схема воріт NOT. Схематичні креслення зазвичай представляють фізичні ворота NOT у вигляді трикутника з невеликим колом на вихідній стороні воріт. Праворуч від схематичної діаграми у вас також є «таблиця істини», яка повідомляє вам вихідне значення для кожного з двох можливих вхідних значень. + +### І ворота + +Ворота AND включає два вхідні сигнали, а не лише один. Наявність двох вхідних сигналів означає, що буде чотири можливі комбінації вхідних значень. Правило AND видає сигнал «увімкнено» лише тоді, коли обидва входи «увімкнені». В іншому випадку вихідний сигнал буде «вимкнено». + +![AND схема воріт та таблиця істини](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/fOo7WK4oSLiqO1iuKAi4fA_5dc969b7e4fa4c6aacd5b2fcb40cc1f1_02_AND-Gate-.png?expiry=1764430941432&hmac=Q53nlrhAHPfGh8F9e5PLb9dox4v1EyuNo4S9ZoakBSI) + +AND схема воріт та таблиця істини + +### АБО ворота + +Ворота OR включає два вхідні сигнали. Правило OR виводить сигнал «вимкнено» лише тоді, коли обидва входи «вимкнені». В іншому випадку вихідний сигнал буде «включений». + +![OR схема воріт та таблиця істинності](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/1WbonYykTgum6J2MpG4Lug_3e5c8850f3084c418327c8f191aba5f1_03_OR-Gate.png?expiry=1764430941432&hmac=psKjcWdjFtw3mDcc_CViRK-Er8cl3w9-E9_TSV9u6yY) + +OR схема воріт та таблиця істинності + +### Ворота XOR + +Ворота XOR також включає два вхідні сигнали. Правило XOR видає сигнал «увімкнено», коли *лише один* (але *не обидва*) входи «увімкнено». В іншому випадку вихідний сигнал буде «вимкнено». + +![Схема воріт XOR та таблиця істинності](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/neK52IssTyyiudiLLF8sYA_3023510a6a0d44b99363a0ea80c1abf1_04_XOR-Gate-.png?expiry=1764430941432&hmac=RIWpgBczAhj2JY5MS-ADNFAdmvfpKQAtwIRQLokOqXw) + +Схема воріт XOR та таблиця істинності + +Таблиці істинності для воріт XOR і OR дуже схожі. Єдина відмінність полягає в тому, що шлюз XOR виводить «вимкнено», коли обидва входи «увімкнені», тоді як OR виводить «увімкнено». Іноді ви можете почути, як ворота XOR називають «ексклюзивними воротами OR». + +### Ворота NAND + +Ворота NAND включає два вхідні сигнали. Правило NAND виводить сигнал «вимкнено» лише тоді, коли обидва входи «увімкнені». В іншому випадку вихідний сигнал буде «включений». + +![Схема воріт NAND та таблиця істинності](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/4q_pIr_sTgmv6SK_7M4JKg_058ec9f2bc5c45feae7a6a32c34d98f1_NAND-Gate.png?expiry=1764430941432&hmac=67LhVOdUt0qKBn8Ujbbfu8h_StlE-j5bkpwOQoalOS4) + +Схема воріт NAND та таблиця істинності + +Якщо порівняти таблиці істинності для воріт NAND та AND, ви можете помітити, що виходи NAND є протилежними виходам AND. Це пояснюється тим, що правило NAND є лише комбінацією правил AND і NOT: воно бере вихід AND і запускає його через правило NOT! З цієї причини ви можете почути, як NAND називають воротами «Не і». + +### Ворота XNOR + +Нарешті, розглянемо ворота XNOR. Він також передбачає два вхідних сигналу. Правило XNOR видає сигнал «увімкнено» лише тоді, коли обидва входи однакові (обидва «Увімкнено» або обидва «Вимкнено»). В іншому випадку вихідний сигнал буде «вимкнено». + +![Схема воріт XNOR та таблиця істинності](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/_IRg3Rn_R4GEYN0Z_1eB7Q_ec617554b8384e90b70a85256ecdd7f1_XNOR-Gate.png?expiry=1764430941432&hmac=0hQquA3-WfvcQ5wtT9fxkQh9GkBfGeN1yxiyxk_p-DQ) + +Схема воріт XNOR та таблиця істинності + +Правило XNOR - це ще одна комбінація двох попередніх правил: воно приймає вихід XOR і запускає його через правило NOT. З цієї причини ви можете почути, як XNOR називають воротами «Not-XOR». + +## Комбінування воріт (будівельні схеми) + +Логічні ворота - це фізичні електронні компоненти - людина може придбати їх і підключити до друкованої плати. Логічні ворота можуть бути пов'язані між собою для створення складних електричних систем (схем), які виконують складні двійкові обчислення. Ви пов'язуєте ворота разом, дозволяючи виходу з одного затвора служити входом для іншого воріта або використовуючи однакові входи для декількох воріт. Комп'ютери - це така складна електрична система. + +Ось схематичний малюнок невеликої схеми, побудованої з воротами, описаним вище: + +![Схема комбінованої схеми](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/mWetS5HYRWanrUuR2PVmPQ_ca5e02fc3b414262bee28fa98535a6f1_Circuit-drawing.png?expiry=1764430941432&hmac=vHcvWvaspchzNcy9FuSKtMS23sfQxL6wO5LPTVOaSj8) + +Схема комбінованої схеми + +Ось таблиця істинності для цієї схеми: + +![Таблиця істинності комбінованої схеми](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/6Qqgqn8zRw-KoKp_MwcPGA_ade69bff97924d6291e174ba63ab65f1_Circuit-Truth-table.png?expiry=1764430941432&hmac=mY29TARLCjERy4AkGBja-2EoQIR23x6NmIkkZ-ywTHs) + +Таблиця істинності комбінованої схеми + +Ця схема використовує три логічні ворота: ворота XOR, ворота NOT та ворота AND. Він приймає два входи (A і B) і виробляє два виходи (1 і 2). A і B є входами для воріт XOR. Вихід цих воріт став входом воріт NOT. Потім вихід ворота NOT став входом для ворота AND (з входом A як іншим). Вихід 1 - це вихід із затвора AND. Вихід 2 - це вихід із затвора XOR. + +## Ключові висновки + +Логічні ворота - це фізичні компоненти, які дозволяють комп'ютерам робити двійкові обчислення. + +- Логічні ворота представляють різні правила прийому одного або декількох двійкових входів і виведення певного двійкового значення («on» або «off»). +- Логічні ворота можуть бути пов'язані таким чином, що вихід одного затвора служив входом для інших воріт. +- Схеми - це складні електричні системи, побудовані шляхом з'єднання логічних воріт разом. Комп'ютери - це така складна електрична система. \ No newline at end of file diff --git a/Notefix/.obsidian/app.json b/Notefix/.obsidian/app.json new file mode 100644 index 0000000..18e4ad4 --- /dev/null +++ b/Notefix/.obsidian/app.json @@ -0,0 +1,4 @@ +{ + "showLineNumber": false, + "alwaysUpdateLinks": true +} \ No newline at end of file diff --git a/Notefix/.obsidian/appearance.json b/Notefix/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/Notefix/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/Notefix/.obsidian/community-plugins.json b/Notefix/.obsidian/community-plugins.json new file mode 100644 index 0000000..32b5d99 --- /dev/null +++ b/Notefix/.obsidian/community-plugins.json @@ -0,0 +1,3 @@ +[ + "obsidian-textgenerator-plugin" +] \ No newline at end of file diff --git a/Notefix/.obsidian/core-plugins.json b/Notefix/.obsidian/core-plugins.json new file mode 100644 index 0000000..0faa60d --- /dev/null +++ b/Notefix/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/Notefix/.obsidian/daily-notes.json b/Notefix/.obsidian/daily-notes.json new file mode 100644 index 0000000..986abf9 --- /dev/null +++ b/Notefix/.obsidian/daily-notes.json @@ -0,0 +1,5 @@ +{ + "autorun": false, + "folder": "1.Projects/Щоденник", + "template": "0.FILES/2.Шаблони/Шаблон Щоденника." +} \ No newline at end of file diff --git a/Notefix/.obsidian/graph.json b/Notefix/.obsidian/graph.json new file mode 100644 index 0000000..26ce634 --- /dev/null +++ b/Notefix/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 0.7132754626224406, + "close": true +} \ No newline at end of file diff --git a/Notefix/.obsidian/plugins/obsidian-textgenerator-plugin/data.json b/Notefix/.obsidian/plugins/obsidian-textgenerator-plugin/data.json new file mode 100644 index 0000000..ce3eea7 --- /dev/null +++ b/Notefix/.obsidian/plugins/obsidian-textgenerator-plugin/data.json @@ -0,0 +1,111 @@ +{ + "version": "0.7.52", + "endpoint": "https://api.openai.com/v1", + "models": [], + "api_key": "", + "encrypt_keys": false, + "selectedProvider": "OpenAI Chat (Langchain)", + "max_tokens": 5000, + "temperature": 0.7, + "frequency_penalty": 0.5, + "showStatusBar": true, + "outputToBlockQuote": false, + "freeCursorOnStreaming": false, + "allowJavascriptRun": false, + "experiment": false, + "promptsPath": "textgenerator/templates", + "textGenPath": "textgenerator/", + "prefix": "\n\n", + "tgSelectionLimiter": "^\\*\\*\\*", + "stream": true, + "context": { + "customInstructEnabled": true, + "includeClipboard": true, + "customInstruct": "Title: {{title}}\n \nStarred Blocks: {{starredBlocks}}\n\t \n{{tg_selection}}", + "contextTemplate": "Title: {{title}}\n\t\nStarred Blocks: {{starredBlocks}}\n\t \n{{tg_selection}}" + }, + "requestTimeout": 300000, + "options": { + "generate-text": true, + "generate-text-with-metadata": true, + "insert-generated-text-From-template": true, + "create-generated-text-From-template": false, + "search-results-batch-generate-from-template": true, + "insert-text-From-template": false, + "create-text-From-template": false, + "show-modal-From-template": true, + "open-template-as-tool": true, + "open-playground": true, + "set_max_tokens": true, + "set-llm": true, + "set-model": true, + "packageManager": true, + "create-template": false, + "get-title": true, + "generated-text-to-clipboard-From-template": false, + "calculate-tokens": true, + "calculate-tokens-for-template": true, + "text-extractor-tool": true, + "stop-stream": true, + "custom-instruct": true, + "generate-in-right-click-menu": false, + "batch-generate-in-right-click-files-menu": true, + "tg-block-processor": true, + "reload": true, + "disable-ribbon-icons": false, + "overlay-toolbar": false, + "log-slowest-operations": false + }, + "advancedOptions": { + "generateTitleInstructEnabled": false, + "generateTitleInstruct": "Generate a title for the current document (do not use * \" \\ / < > : | ? .):\n{{substring content 0 255}}", + "includeAttachmentsInRequest": false + }, + "autoSuggestOptions": { + "customInstructEnabled": true, + "customInstruct": "Continue the follwing text:\nTitle: {{title}}\n{{query}}", + "systemPrompt": "", + "isEnabled": false, + "allowInNewLine": false, + "delay": 300, + "numberOfSuggestions": 5, + "triggerPhrase": " ", + "stop": ".", + "showStatus": true, + "customProvider": false, + "inlineSuggestions": false, + "overrideTrigger": " " + }, + "slashSuggestOptions": { + "isEnabled": false, + "triggerPhrase": "/" + }, + "extractorsOptions": { + "PDFExtractor": true, + "WebPageExtractor": true, + "YoutubeExtractor": true, + "AudioExtractor": false, + "ImageExtractorEmbded": true, + "ImageExtractor": true + }, + "displayErrorInEditor": false, + "LLMProviderProfiles": {}, + "LLMProviderOptions": { + "whisper": { + "base_path": "https://api.openai.com/v1", + "model": "whisper-1", + "api_key": "", + "api_version": "" + }, + "OpenAI Chat (Langchain)": { + "basePath": "https://api.openai.com/v1", + "api_key": "", + "model": "gpt-4o" + } + }, + "LLMProviderOptionsKeysHashed": { + "whisper.api_key": "__@#key_prefix#@__", + "OpenAI Chat (Langchain).api_key": "__@#key_prefix#@__sk-proj-BMUo5Q1hY25X8FMw0xIwjZ9r9Cu-EtDfnMo68PKkkzpOUm-aXNYslnIfx55D5eVcojYAaGE1rqT3BlbkFJ-khMPg4jSk-U8eBIfLQ5MtWCoi2IgZyfhrTVLuddoGx5Luf98OC2JHIIOmdcjHFb-ZOcdWboEA" + }, + "api_key_encrypted": "__@#key_prefix#@__sk-proj-BMUo5Q1hY25X8FMw0xIwjZ9r9Cu-EtDfnMo68PKkkzpOUm-aXNYslnIfx55D5eVcojYAaGE1rqT3BlbkFJ-khMPg4jSk-U8eBIfLQ5MtWCoi2IgZyfhrTVLuddoGx5Luf98OC2JHIIOmdcjHFb-ZOcdWboEA" +} \ No newline at end of file diff --git a/Notefix/.obsidian/plugins/obsidian-textgenerator-plugin/main.js b/Notefix/.obsidian/plugins/obsidian-textgenerator-plugin/main.js new file mode 100644 index 0000000..ef16d69 --- /dev/null +++ b/Notefix/.obsidian/plugins/obsidian-textgenerator-plugin/main.js @@ -0,0 +1,2561 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +repo: https://github.com/nhaouari/obsidian-textgenerator-plugin +*/ + +"use strict";var Swn=Object.create;var u8=Object.defineProperty;var Mwn=Object.getOwnPropertyDescriptor;var Twn=Object.getOwnPropertyNames;var Dwn=Object.getPrototypeOf,Kwn=Object.prototype.hasOwnProperty;var B=(t,e)=>()=>(t&&(e=t(t=0)),e);var f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Xe=(t,e)=>{for(var n in e)u8(t,n,{get:e[n],enumerable:!0})},v$e=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let I of Twn(e))!Kwn.call(t,I)&&I!==n&&u8(t,I,{get:()=>e[I],enumerable:!(l=Mwn(e,I))||l.enumerable});return t};var $=(t,e,n)=>(n=t!=null?Swn(Dwn(t)):{},v$e(e||!t||!t.__esModule?u8(n,"default",{value:t,enumerable:!0}):n,t)),f$e=t=>v$e(u8({},"__esModule",{value:!0}),t);var X$e=(()=>{for(var t=new Uint8Array(128),e=0;e<64;e++)t[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return n=>{for(var l=n.length,I=new Uint8Array((l-(n[l-1]=="=")-(n[l-2]=="="))*3/4|0),a=0,c=0;a>4,I[c++]=s<<4|r>>2,I[c++]=r<<6|u}return I}})();var d8=f((OOI,w$e)=>{"use strict";var _wn={env:{},platform:"web",version:"1.0.0",versions:{},arch:"unknown",cwd:()=>"/",chdir:()=>{},exit:()=>{},isUsingObsidian:!0};w$e.exports=_wn});var Q$e=f((UOI,H$e)=>{var tz=1e3,nz=tz*60,lz=nz*60,Iz=lz*24,Pwn=Iz*365.25;H$e.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return qwn(t);if(n==="number"&&isNaN(t)===!1)return e.long?eHn(t):$wn(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function qwn(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),l=(e[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return n*Pwn;case"days":case"day":case"d":return n*Iz;case"hours":case"hour":case"hrs":case"hr":case"h":return n*lz;case"minutes":case"minute":case"mins":case"min":case"m":return n*nz;case"seconds":case"second":case"secs":case"sec":case"s":return n*tz;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function $wn(t){return t>=Iz?Math.round(t/Iz)+"d":t>=lz?Math.round(t/lz)+"h":t>=nz?Math.round(t/nz)+"m":t>=tz?Math.round(t/tz)+"s":t+"ms"}function eHn(t){return G8(t,Iz,"day")||G8(t,lz,"hour")||G8(t,nz,"minute")||G8(t,tz,"second")||t+" ms"}function G8(t,e,n){if(!(t{Nr=E$e.exports=vye.debug=vye.default=vye;Nr.coerce=aHn;Nr.disable=lHn;Nr.enable=nHn;Nr.enabled=IHn;Nr.humanize=Q$e();Nr.names=[];Nr.skips=[];Nr.formatters={};var Fye;function tHn(t){var e=0,n;for(n in t)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Nr.colors[Math.abs(e)%Nr.colors.length]}function vye(t){function e(){if(e.enabled){var n=e,l=+new Date,I=l-(Fye||l);n.diff=I,n.prev=Fye,n.curr=l,Fye=l;for(var a=new Array(arguments.length),c=0;c{lm=L$e.exports=J$e();lm.log=oHn;lm.formatArgs=cHn;lm.save=iHn;lm.load=C$e;lm.useColors=rHn;lm.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:sHn();lm.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function rHn(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}lm.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}};function cHn(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+lm.humanize(this.diff),!!e){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var l=0,I=0;t[0].replace(/%[a-zA-Z%]/g,function(a){a!=="%%"&&(l++,a==="%c"&&(I=l))}),t.splice(I,0,n)}}function oHn(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function iHn(t){try{t==null?lm.storage.removeItem("debug"):lm.storage.debug=t}catch{}}function C$e(){var t;try{t=lm.storage.debug}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}lm.enable(C$e());function sHn(){try{return window.localStorage}catch{}}});function b8(t,e=LY){t=t.trim();let n=t.indexOf("```");if(n===-1)return e(t);let l=t.substring(n+3);l.startsWith(`json +`)?l=l.substring(5):l.startsWith("json")?l=l.substring(4):l.startsWith(` +`)&&(l=l.substring(1));let I=l.indexOf("```"),a=l;return I!==-1&&(a=l.substring(0,I)),e(a.trim())}function LY(t){if(typeof t>"u")return null;try{return JSON.parse(t)}catch{}let e="",n=[],l=!1,I=!1;for(let a of t){if(l)a==='"'&&!I?l=!1:a===` +`&&!I?a="\\n":a==="\\"?I=!I:I=!1;else if(a==='"')l=!0,I=!1;else if(a==="{")n.push("}");else if(a==="[")n.push("]");else if(a==="}"||a==="]")if(n&&n[n.length-1]===a)n.pop();else return null;e+=a}l&&(e+='"');for(let a=n.length-1;a>=0;a-=1)e+=n[a];try{return JSON.parse(e)}catch{return null}}var fye=B(()=>{});var Xye=f((BOI,k$e)=>{"use strict";k$e.exports=function(t,e){if(typeof t!="string")throw new TypeError("Expected a string");return e=typeof e>"u"?"_":e,t.replace(/([a-z\d])([A-Z])/g,"$1"+e+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+e+"$2").toLowerCase()}});var Hye=f((SOI,wye)=>{"use strict";var uHn=/[\p{Lu}]/u,dHn=/[\p{Ll}]/u,x$e=/^[\p{Lu}](?![\p{Lu}])/gu,U$e=/([\p{Alpha}\p{N}_]|$)/u,z$e=/[_.\- ]+/,GHn=new RegExp("^"+z$e.source),j$e=new RegExp(z$e.source+U$e.source,"gu"),O$e=new RegExp("\\d+"+U$e.source,"gu"),bHn=(t,e,n)=>{let l=!1,I=!1,a=!1;for(let c=0;c(x$e.lastIndex=0,t.replace(x$e,n=>e(n))),pHn=(t,e)=>(j$e.lastIndex=0,O$e.lastIndex=0,t.replace(j$e,(n,l)=>e(l)).replace(O$e,n=>e(n))),B$e=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(a=>a.trim()).filter(a=>a.length).join("-"):t=t.trim(),t.length===0)return"";let n=e.locale===!1?a=>a.toLowerCase():a=>a.toLocaleLowerCase(e.locale),l=e.locale===!1?a=>a.toUpperCase():a=>a.toLocaleUpperCase(e.locale);return t.length===1?e.pascalCase?l(t):n(t):(t!==n(t)&&(t=bHn(t,n,l)),t=t.replace(GHn,""),e.preserveConsecutiveUppercase?t=mHn(t,n):t=n(t),e.pascalCase&&(t=l(t.charAt(0))+t.slice(1)),pHn(t,l))};wye.exports=B$e;wye.exports.default=B$e});function T$e(t,e){return e?.[t]||(0,S$e.default)(t)}function D$e(t,e){return e?.[t]||(0,M$e.default)(t)}function m8(t,e,n){let l={};for(let I in t)Object.hasOwn(t,I)&&(l[e(I,n)]=t[I]);return l}var S$e,M$e,Qye=B(()=>{S$e=$(Xye(),1),M$e=$(Hye(),1)});var Eye={};Xe(Eye,{Serializable:()=>XI,get_lc_unique_name:()=>a5});function K$e(t){return Array.isArray(t)?[...t]:{...t}}function hHn(t,e){let n=K$e(t);for(let[l,I]of Object.entries(e)){let[a,...c]=l.split(".").reverse(),i=n;for(let s of c.reverse()){if(i[s]===void 0)break;i[s]=K$e(i[s]),i=i[s]}i[a]!==void 0&&(i[a]={lc:1,type:"secret",id:[I]})}return n}function a5(t){let e=Object.getPrototypeOf(t);return typeof t.lc_name=="function"&&(typeof e.lc_name!="function"||t.lc_name()!==e.lc_name())?t.lc_name():t.name}var XI,sh=B(()=>{Qye();XI=class t{static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,a5(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(e,...n){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(([l])=>this.lc_serializable_keys?.includes(l))):this.lc_kwargs=e??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof t||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let e={},n={},l=Object.keys(this.lc_kwargs).reduce((I,a)=>(I[a]=a in this?this[a]:this.lc_kwargs[a],I),{});for(let I=Object.getPrototypeOf(this);I;I=Object.getPrototypeOf(I))Object.assign(e,Reflect.get(I,"lc_aliases",this)),Object.assign(n,Reflect.get(I,"lc_secrets",this)),Object.assign(l,Reflect.get(I,"lc_attributes",this));return Object.keys(n).forEach(I=>{let a=this,c=l,[i,...s]=I.split(".").reverse();for(let r of s.reverse()){if(!(r in a)||a[r]===void 0)return;(!(r in c)||c[r]===void 0)&&(typeof a[r]=="object"&&a[r]!=null?c[r]={}:Array.isArray(a[r])&&(c[r]=[])),a=a[r],c=c[r]}i in a&&a[i]!==void 0&&(c[i]=c[i]||a[i])}),{lc:1,type:"constructor",id:this.lc_id,kwargs:m8(Object.keys(n).length?hHn(l,n):l,T$e,e)}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}}});function uh(t){return typeof t=="object"&&t!==null&&"type"in t&&typeof t.type=="string"&&"source_type"in t&&(t.source_type==="url"||t.source_type==="base64"||t.source_type==="text"||t.source_type==="id")}function Jye(t){return uh(t)&&t.source_type==="url"&&"url"in t&&typeof t.url=="string"}function Cye(t){return uh(t)&&t.source_type==="base64"&&"data"in t&&typeof t.data=="string"}function ZHn(t){return uh(t)&&t.source_type==="text"&&"text"in t&&typeof t.text=="string"}function WHn(t){return uh(t)&&t.source_type==="id"&&"id"in t&&typeof t.id=="string"}function Lye(t){if(uh(t)){if(t.source_type==="url")return{type:"image_url",image_url:{url:t.url}};if(t.source_type==="base64"){if(!t.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${t.mime_type};base64,${t.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function NHn(t){let e=t.split(";")[0].split("/");if(e.length!==2)throw new Error(`Invalid mime type: "${t}" - does not match type/subtype format.`);let n=e[0].trim(),l=e[1].trim();if(n===""||l==="")throw new Error(`Invalid mime type: "${t}" - type or subtype is empty.`);let I={};for(let a of t.split(";").slice(1)){let c=a.split("=");if(c.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${t}".`);let i=c[0].trim(),s=c[1].trim();if(i==="")throw new Error(`Invalid parameter syntax in mime type: "${t}".`);I[i]=s}return{type:n,subtype:l,parameters:I}}function y2({dataUrl:t,asTypedArray:e=!1}){let n=t.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/),l;if(n){l=n[1].toLowerCase();let I=e?Uint8Array.from(atob(n[2]),a=>a.charCodeAt(0)):n[2];return{mime_type:l,data:I}}}function az(t,e){if(t.type==="text"){if(!e.fromStandardTextBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardTextBlock\` method.`);return e.fromStandardTextBlock(t)}if(t.type==="image"){if(!e.fromStandardImageBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardImageBlock\` method.`);return e.fromStandardImageBlock(t)}if(t.type==="audio"){if(!e.fromStandardAudioBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardAudioBlock\` method.`);return e.fromStandardAudioBlock(t)}if(t.type==="file"){if(!e.fromStandardFileBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardFileBlock\` method.`);return e.fromStandardFileBlock(t)}throw new Error(`Unable to convert content block type '${t.type}' to provider-specific format: not recognized.`)}var kye=B(()=>{});function dh(t,e){return typeof t=="string"?t===""?e:typeof e=="string"?t+e:Array.isArray(e)&&e.some(n=>uh(n))?[{type:"text",source_type:"text",text:t},...e]:[{type:"text",text:t},...e]:Array.isArray(e)?r5(t,e)??[...t,...e]:e===""?t:Array.isArray(t)&&t.some(n=>uh(n))?[...t,{type:"file",source_type:"text",text:e}]:[...t,{type:"text",text:e}]}function xye(t,e){return t==="error"||e==="error"?"error":"success"}function VHn(t,e){function n(l,I){if(typeof l!="object"||l===null||l===void 0)return l;if(I>=e)return Array.isArray(l)?"[Array]":"[Object]";if(Array.isArray(l))return l.map(c=>n(c,I+1));let a={};for(let c of Object.keys(l))a[c]=n(l[c],I+1);return a}return JSON.stringify(n(t,0),null,2)}function YHn(t){return Array.isArray(t)&&t.every(e=>typeof e.index=="number")}function Ro(t,e){let n={...t};for(let[l,I]of Object.entries(e))if(n[l]==null)n[l]=I;else{if(I==null)continue;if(typeof n[l]!=typeof I||Array.isArray(n[l])!==Array.isArray(I))throw new Error(`field[${l}] already exists in the message chunk, but with a different type.`);if(typeof n[l]=="string"){if(l==="type")continue;n[l]+=I}else if(typeof n[l]=="object"&&!Array.isArray(n[l]))n[l]=Ro(n[l],I);else if(Array.isArray(n[l]))n[l]=r5(n[l],I);else{if(n[l]===I)continue;console.warn(`field[${l}] already exists in this message chunk and value has unsupported type.`)}}return n}function r5(t,e){if(!(t===void 0&&e===void 0)){if(t===void 0||e===void 0)return t||e;{let n=[...t];for(let l of e)if(typeof l=="object"&&"index"in l&&typeof l.index=="number"){let I=n.findIndex(a=>a.index===l.index);I!==-1?n[I]=Ro(n[I],l):n.push(l)}else{if(typeof l=="object"&&"text"in l&&l.text==="")continue;n.push(l)}return n}}}function jye(t,e){if(!t&&!e)throw new Error("Cannot merge two undefined objects.");if(!t||!e)return t||e;if(typeof t!=typeof e)throw new Error(`Cannot merge objects of different types. +Left ${typeof t} +Right ${typeof e}`);if(typeof t=="string"&&typeof e=="string")return t+e;if(Array.isArray(t)&&Array.isArray(e))return r5(t,e);if(typeof t=="object"&&typeof e=="object")return Ro(t,e);if(t===e)return t;throw new Error(`Can not merge objects of different types. +Left ${t} +Right ${e}`)}function Oye(t){return typeof t.role=="string"}function $r(t){return typeof t?._getType=="function"}function rz(t){return $r(t)&&typeof t.concat=="function"}var yc,md,RZ=B(()=>{sh();kye();yc=class extends XI{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,n){typeof e=="string"&&(e={content:e,additional_kwargs:n,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 n=VHn(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${n}`}};md=class extends yc{}});function _$e(t){return t!=null&&typeof t=="object"&&"lc_direct_tool_output"in t&&t.lc_direct_tool_output===!0}function P$e(t){let e=[],n=[];for(let l of t)if(l.function){let I=l.function.name;try{let a=JSON.parse(l.function.arguments),c={name:I||"",args:a||{},id:l.id};e.push(c)}catch{n.push({name:I,args:l.function.arguments,id:l.id,error:"Malformed args."})}}else continue;return[e,n]}function p8(t){return t._getType()==="tool"}function q$e(t){return t._getType()==="tool"}var Oo,PG,c5=B(()=>{RZ();Oo=class extends yc{static lc_name(){return"ToolMessage"}get lc_aliases(){return{tool_call_id:"tool_call_id"}}constructor(e,n,l){typeof e=="string"&&(e={content:e,name:l,tool_call_id:n}),super(e),Object.defineProperty(this,"lc_direct_tool_output",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tool_call_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"artifact",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tool_call_id=e.tool_call_id,this.artifact=e.artifact,this.status=e.status}_getType(){return"tool"}static isInstance(e){return e._getType()==="tool"}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}},PG=class t extends md{constructor(e){super(e),Object.defineProperty(this,"tool_call_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"artifact",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tool_call_id=e.tool_call_id,this.artifact=e.artifact,this.status=e.status}static lc_name(){return"ToolMessageChunk"}_getType(){return"tool"}concat(e){return new t({content:dh(this.content,e.content),additional_kwargs:Ro(this.additional_kwargs,e.additional_kwargs),response_metadata:Ro(this.response_metadata,e.response_metadata),artifact:jye(this.artifact,e.artifact),tool_call_id:this.tool_call_id,id:this.id??e.id,status:xye(this.status,e.status)})}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}}});function qG(t){return t._getType()==="ai"}function h8(t){return t._getType()==="ai"}var _t,Jl,ZH=B(()=>{fye();RZ();c5();_t=class extends yc{get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls"}}constructor(e,n){let l;if(typeof e=="string")l={content:e,tool_calls:[],invalid_tool_calls:[],additional_kwargs:n??{}};else{l=e;let I=l.additional_kwargs?.tool_calls,a=l.tool_calls;I!=null&&I.length>0&&(a===void 0||a.length===0)&&console.warn(["New LangChain packages are available that more efficiently handle",`tool calling. + +Please upgrade your packages to versions that set`,"message tool calls. e.g., `yarn add @langchain/anthropic`,","yarn add @langchain/openai`, etc."].join(" "));try{if(I!=null&&a===void 0){let[c,i]=P$e(I);l.tool_calls=c??[],l.invalid_tool_calls=i??[]}else l.tool_calls=l.tool_calls??[],l.invalid_tool_calls=l.invalid_tool_calls??[]}catch{l.tool_calls=[],l.invalid_tool_calls=[]}}super(l),Object.defineProperty(this,"tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"invalid_tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"usage_metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),typeof l!="string"&&(this.tool_calls=l.tool_calls??this.tool_calls,this.invalid_tool_calls=l.invalid_tool_calls??this.invalid_tool_calls),this.usage_metadata=l.usage_metadata}static lc_name(){return"AIMessage"}_getType(){return"ai"}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}};Jl=class t extends md{constructor(e){let n;if(typeof e=="string")n={content:e,tool_calls:[],invalid_tool_calls:[],tool_call_chunks:[]};else if(e.tool_call_chunks===void 0)n={...e,tool_calls:e.tool_calls??[],invalid_tool_calls:[],tool_call_chunks:[],usage_metadata:e.usage_metadata!==void 0?e.usage_metadata:void 0};else{let l=e.tool_call_chunks.reduce((c,i)=>(i.id&&(c[i.id]=c[i.id]??[],c[i.id].push(i)),c),{}),I=[],a=[];for(let[c,i]of Object.entries(l)){let s={},r=i[0]?.name??"",u=i.map(o=>o.args||"").join("");try{if(s=LY(u),s===null||typeof s!="object"||Array.isArray(s))throw new Error("Malformed tool call chunk args.");I.push({name:r,args:s,id:c,type:"tool_call"})}catch{a.push({name:r,args:u,id:c,error:"Malformed args.",type:"invalid_tool_call"})}}n={...e,tool_calls:I,invalid_tool_calls:a,usage_metadata:e.usage_metadata!==void 0?e.usage_metadata:void 0}}super(n),Object.defineProperty(this,"tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"invalid_tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"tool_call_chunks",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"usage_metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tool_call_chunks=n.tool_call_chunks??this.tool_call_chunks,this.tool_calls=n.tool_calls??this.tool_calls,this.invalid_tool_calls=n.invalid_tool_calls??this.invalid_tool_calls,this.usage_metadata=n.usage_metadata}get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls",tool_call_chunks:"tool_call_chunks"}}static lc_name(){return"AIMessageChunk"}_getType(){return"ai"}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,tool_call_chunks:this.tool_call_chunks,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}concat(e){let n={content:dh(this.content,e.content),additional_kwargs:Ro(this.additional_kwargs,e.additional_kwargs),response_metadata:Ro(this.response_metadata,e.response_metadata),tool_call_chunks:[],id:this.id??e.id};if(this.tool_call_chunks!==void 0||e.tool_call_chunks!==void 0){let l=r5(this.tool_call_chunks,e.tool_call_chunks);l!==void 0&&l.length>0&&(n.tool_call_chunks=l)}if(this.usage_metadata!==void 0||e.usage_metadata!==void 0){let l={...(this.usage_metadata?.input_token_details?.audio!==void 0||e.usage_metadata?.input_token_details?.audio!==void 0)&&{audio:(this.usage_metadata?.input_token_details?.audio??0)+(e.usage_metadata?.input_token_details?.audio??0)},...(this.usage_metadata?.input_token_details?.cache_read!==void 0||e.usage_metadata?.input_token_details?.cache_read!==void 0)&&{cache_read:(this.usage_metadata?.input_token_details?.cache_read??0)+(e.usage_metadata?.input_token_details?.cache_read??0)},...(this.usage_metadata?.input_token_details?.cache_creation!==void 0||e.usage_metadata?.input_token_details?.cache_creation!==void 0)&&{cache_creation:(this.usage_metadata?.input_token_details?.cache_creation??0)+(e.usage_metadata?.input_token_details?.cache_creation??0)}},I={...(this.usage_metadata?.output_token_details?.audio!==void 0||e.usage_metadata?.output_token_details?.audio!==void 0)&&{audio:(this.usage_metadata?.output_token_details?.audio??0)+(e.usage_metadata?.output_token_details?.audio??0)},...(this.usage_metadata?.output_token_details?.reasoning!==void 0||e.usage_metadata?.output_token_details?.reasoning!==void 0)&&{reasoning:(this.usage_metadata?.output_token_details?.reasoning??0)+(e.usage_metadata?.output_token_details?.reasoning??0)}},a=this.usage_metadata??{input_tokens:0,output_tokens:0,total_tokens:0},c=e.usage_metadata??{input_tokens:0,output_tokens:0,total_tokens:0},i={input_tokens:a.input_tokens+c.input_tokens,output_tokens:a.output_tokens+c.output_tokens,total_tokens:a.total_tokens+c.total_tokens,...Object.keys(l).length>0&&{input_token_details:l},...Object.keys(I).length>0&&{output_token_details:I}};n.usage_metadata=i}return new t(n)}}});function gHn(t){return t._getType()==="generic"}function RHn(t){return t._getType()==="generic"}var lo,aG,Z8=B(()=>{RZ();lo=class t extends yc{static lc_name(){return"ChatMessage"}static _chatMessageClass(){return t}constructor(e,n){typeof e=="string"&&(e={content:e,role:n}),super(e),Object.defineProperty(this,"role",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.role=e.role}_getType(){return"generic"}static isInstance(e){return e._getType()==="generic"}get _printableFields(){return{...super._printableFields,role:this.role}}},aG=class t extends md{static lc_name(){return"ChatMessageChunk"}constructor(e,n){typeof e=="string"&&(e={content:e,role:n}),super(e),Object.defineProperty(this,"role",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.role=e.role}_getType(){return"generic"}concat(e){return new t({content:dh(this.content,e.content),additional_kwargs:Ro(this.additional_kwargs,e.additional_kwargs),response_metadata:Ro(this.response_metadata,e.response_metadata),role:this.role,id:this.id??e.id})}get _printableFields(){return{...super._printableFields,role:this.role}}}});function yHn(t){return t._getType()==="function"}function AHn(t){return t._getType()==="function"}var rG,cG,W8=B(()=>{RZ();rG=class extends yc{static lc_name(){return"FunctionMessage"}constructor(e,n){typeof e=="string"&&(e={content:e,name:n}),super(e)}_getType(){return"function"}},cG=class t extends md{static lc_name(){return"FunctionMessageChunk"}_getType(){return"function"}concat(e){return new t({content:dh(this.content,e.content),additional_kwargs:Ro(this.additional_kwargs,e.additional_kwargs),response_metadata:Ro(this.response_metadata,e.response_metadata),name:this.name??"",id:this.id??e.id})}}});function FHn(t){return t.getType()==="human"}function vHn(t){return t.getType()==="human"}var Qn,oG,cz=B(()=>{RZ();Qn=class extends yc{static lc_name(){return"HumanMessage"}_getType(){return"human"}constructor(e,n){super(e,n)}},oG=class t extends md{static lc_name(){return"HumanMessageChunk"}_getType(){return"human"}constructor(e,n){super(e,n)}concat(e){return new t({content:dh(this.content,e.content),additional_kwargs:Ro(this.additional_kwargs,e.additional_kwargs),response_metadata:Ro(this.response_metadata,e.response_metadata),id:this.id??e.id})}}});function fHn(t){return t._getType()==="system"}function XHn(t){return t._getType()==="system"}var Xr,pd,N8=B(()=>{RZ();Xr=class extends yc{static lc_name(){return"SystemMessage"}_getType(){return"system"}constructor(e,n){super(e,n)}},pd=class t extends md{static lc_name(){return"SystemMessageChunk"}_getType(){return"system"}constructor(e,n){super(e,n)}concat(e){return new t({content:dh(this.content,e.content),additional_kwargs:Ro(this.additional_kwargs,e.additional_kwargs),response_metadata:Ro(this.response_metadata,e.response_metadata),id:this.id??e.id})}}});function A2(t,e){return t.lc_error_code=e,t.message=`${t.message} + +Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${e}/ +`,t}var oz=B(()=>{});function F2(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="tool_call")}function $$e(t){return!!(t&&typeof t=="object"&&"toolCall"in t&&t.toolCall!=null&&typeof t.toolCall=="object"&&"id"in t.toolCall&&typeof t.toolCall.id=="string")}var yZ,V8=B(()=>{yZ=class extends Error{constructor(e,n){super(e),Object.defineProperty(this,"output",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.output=n}}});function wHn(t){return F2(t)?t:typeof t.id=="string"&&t.type==="function"&&typeof t.function=="object"&&t.function!==null&&"arguments"in t.function&&typeof t.function.arguments=="string"&&"name"in t.function&&typeof t.function.name=="string"?{id:t.id,args:JSON.parse(t.function.arguments),name:t.function.name,type:"tool_call"}:t}function HHn(t){return typeof t=="object"&&t!=null&&t.lc===1&&Array.isArray(t.id)&&t.kwargs!=null&&typeof t.kwargs=="object"}function Uye(t){let e,n;if(HHn(t)){let l=t.id.at(-1);l==="HumanMessage"||l==="HumanMessageChunk"?e="user":l==="AIMessage"||l==="AIMessageChunk"?e="assistant":l==="SystemMessage"||l==="SystemMessageChunk"?e="system":l==="FunctionMessage"||l==="FunctionMessageChunk"?e="function":l==="ToolMessage"||l==="ToolMessageChunk"?e="tool":e="unknown",n=t.kwargs}else{let{type:l,...I}=t;e=l,n=I}if(e==="human"||e==="user")return new Qn(n);if(e==="ai"||e==="assistant"){let{tool_calls:l,...I}=n;if(!Array.isArray(l))return new _t(n);let a=l.map(wHn);return new _t({...I,tool_calls:a})}else{if(e==="system")return new Xr(n);if(e==="developer")return new Xr({...n,additional_kwargs:{...n.additional_kwargs,__openai_role__:"developer"}});if(e==="tool"&&"tool_call_id"in n)return new Oo({...n,content:n.content,tool_call_id:n.tool_call_id,name:n.name});throw A2(new Error(`Unable to coerce message from array: only human, AI, system, developer, or tool message coercion is currently supported. + +Received: ${JSON.stringify(t,null,2)}`),"MESSAGE_COERCION_FAILURE")}}function AZ(t){if(typeof t=="string")return new Qn(t);if($r(t))return t;if(Array.isArray(t)){let[e,n]=t;return Uye({type:e,content:n})}else if(Oye(t)){let{role:e,...n}=t;return Uye({...n,type:e})}else return Uye(t)}function mr(t,e="Human",n="AI"){let l=[];for(let I of t){let a;if(I._getType()==="human")a=e;else if(I._getType()==="ai")a=n;else if(I._getType()==="system")a="System";else if(I._getType()==="function")a="Function";else if(I._getType()==="tool")a="Tool";else if(I._getType()==="generic")a=I.role;else throw new Error(`Got unsupported message type: ${I._getType()}`);let c=I.name?`${I.name}, `:"",i=typeof I.content=="string"?I.content:JSON.stringify(I.content,null,2);l.push(`${a}: ${c}${i}`)}return l.join(` +`)}function QHn(t){if(t.data!==void 0)return t;{let e=t;return{type:e.type,data:{content:e.text,role:e.role,name:void 0,tool_call_id:void 0}}}}function Y8(t){let e=QHn(t);switch(e.type){case"human":return new Qn(e.data);case"ai":return new _t(e.data);case"system":return new Xr(e.data);case"function":if(e.data.name===void 0)throw new Error("Name must be defined for function messages");return new rG(e.data);case"tool":if(e.data.tool_call_id===void 0)throw new Error("Tool call ID must be defined for tool messages");return new Oo(e.data);case"generic":{if(e.data.role===void 0)throw new Error("Role must be defined for chat messages");return new lo(e.data)}default:throw new Error(`Got unexpected type: ${e.type}`)}}function zye(t){return t.map(Y8)}function EHn(t){return t.map(e=>e.toDict())}function o5(t){let e=t._getType();if(e==="human")return new oG({...t});if(e==="ai"){let n={...t};return"tool_calls"in n&&(n={...n,tool_call_chunks:n.tool_calls?.map(l=>({...l,type:"tool_call_chunk",index:void 0,args:JSON.stringify(l.args)}))}),new Jl({...n})}else{if(e==="system")return new pd({...t});if(e==="function")return new cG({...t});if(lo.isInstance(t))return new aG({...t});throw new Error("Unknown message type.")}}var gy=B(()=>{oz();V8();ZH();RZ();Z8();W8();cz();N8();c5()});var uI,Bye,gt,kY,iz=B(()=>{(function(t){t.assertEqual=I=>{};function e(I){}t.assertIs=e;function n(I){throw new Error}t.assertNever=n,t.arrayToEnum=I=>{let a={};for(let c of I)a[c]=c;return a},t.getValidEnumValues=I=>{let a=t.objectKeys(I).filter(i=>typeof I[I[i]]!="number"),c={};for(let i of a)c[i]=I[i];return t.objectValues(c)},t.objectValues=I=>t.objectKeys(I).map(function(a){return I[a]}),t.objectKeys=typeof Object.keys=="function"?I=>Object.keys(I):I=>{let a=[];for(let c in I)Object.prototype.hasOwnProperty.call(I,c)&&a.push(c);return a},t.find=(I,a)=>{for(let c of I)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?I=>Number.isInteger(I):I=>typeof I=="number"&&Number.isFinite(I)&&Math.floor(I)===I;function l(I,a=" | "){return I.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}t.joinValues=l,t.jsonStringifyReplacer=(I,a)=>typeof a=="bigint"?a.toString():a})(uI||(uI={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Bye||(Bye={}));gt=uI.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),kY=t=>{switch(typeof t){case"undefined":return gt.undefined;case"string":return gt.string;case"number":return Number.isNaN(t)?gt.nan:gt.number;case"boolean":return gt.boolean;case"function":return gt.function;case"bigint":return gt.bigint;case"symbol":return gt.symbol;case"object":return Array.isArray(t)?gt.array:t===null?gt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?gt.promise:typeof Map<"u"&&t instanceof Map?gt.map:typeof Set<"u"&&t instanceof Set?gt.set:typeof Date<"u"&&t instanceof Date?gt.date:gt.object;default:return gt.unknown}}});var Me,JHn,Om,g8=B(()=>{iz();Me=uI.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),JHn=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Om=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(a){return a.message},l={_errors:[]},I=a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(I);else if(c.code==="invalid_return_type")I(c.returnTypeError);else if(c.code==="invalid_arguments")I(c.argumentsError);else if(c.path.length===0)l._errors.push(n(c));else{let i=l,s=0;for(;sn.message){let n={},l=[];for(let I of this.issues)if(I.path.length>0){let a=I.path[0];n[a]=n[a]||[],n[a].push(e(I))}else l.push(e(I));return{formErrors:l,fieldErrors:n}}get formErrors(){return this.flatten()}};Om.create=t=>new Om(t)});var CHn,Ry,Sye=B(()=>{g8();iz();CHn=(t,e)=>{let n;switch(t.code){case Me.invalid_type:t.received===gt.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Me.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,uI.jsonStringifyReplacer)}`;break;case Me.unrecognized_keys:n=`Unrecognized key(s) in object: ${uI.joinValues(t.keys,", ")}`;break;case Me.invalid_union:n="Invalid input";break;case Me.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${uI.joinValues(t.options)}`;break;case Me.invalid_enum_value:n=`Invalid enum value. Expected ${uI.joinValues(t.options)}, received '${t.received}'`;break;case Me.invalid_arguments:n="Invalid function arguments";break;case Me.invalid_return_type:n="Invalid function return type";break;case Me.invalid_date:n="Invalid date";break;case Me.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:uI.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Me.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Me.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Me.custom:n="Invalid input";break;case Me.invalid_intersection_types:n="Intersection results could not be merged";break;case Me.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Me.not_finite:n="Number must be finite";break;default:n=e.defaultError,uI.assertNever(t)}return{message:n}},Ry=CHn});function LHn(t){eet=t}function i5(){return eet}var eet,R8=B(()=>{Sye();eet=Ry});function mt(t,e){let n=i5(),l=sz({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Ry?void 0:Ry].filter(I=>!!I)});t.common.issues.push(l)}var sz,kHn,iG,Rn,WH,$G,y8,A8,v2,s5,Mye=B(()=>{R8();Sye();sz=t=>{let{data:e,path:n,errorMaps:l,issueData:I}=t,a=[...n,...I.path||[]],c={...I,path:a};if(I.message!==void 0)return{...I,path:a,message:I.message};let i="",s=l.filter(r=>!!r).slice().reverse();for(let r of s)i=r(c,{data:e,defaultError:i}).message;return{...I,path:a,message:i}},kHn=[];iG=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let l=[];for(let I of n){if(I.status==="aborted")return Rn;I.status==="dirty"&&e.dirty(),l.push(I.value)}return{status:e.value,value:l}}static async mergeObjectAsync(e,n){let l=[];for(let I of n){let a=await I.key,c=await I.value;l.push({key:a,value:c})}return t.mergeObjectSync(e,l)}static mergeObjectSync(e,n){let l={};for(let I of n){let{key:a,value:c}=I;if(a.status==="aborted"||c.status==="aborted")return Rn;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||I.alwaysSet)&&(l[a.value]=c.value)}return{status:e.value,value:l}}},Rn=Object.freeze({status:"aborted"}),WH=t=>({status:"dirty",value:t}),$G=t=>({status:"valid",value:t}),y8=t=>t.status==="aborted",A8=t=>t.status==="dirty",v2=t=>t.status==="valid",s5=t=>typeof Promise<"u"&&t instanceof Promise});var tet=B(()=>{});var Tt,net=B(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Tt||(Tt={}))});function Cl(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:l,description:I}=t;if(e&&(n||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:I}:{errorMap:(c,i)=>{let{message:s}=t;return c.code==="invalid_enum_value"?{message:s??i.defaultError}:typeof i.data>"u"?{message:s??l??i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:s??n??i.defaultError}},description:I}}function cet(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function tQn(t){return new RegExp(`^${cet(t)}$`)}function oet(t){let e=`${ret}T${cet(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function nQn(t,e){return!!((e==="v4"||!e)&&DHn.test(t)||(e==="v6"||!e)&&_Hn.test(t))}function lQn(t,e){if(!BHn.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let l=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),I=JSON.parse(atob(l));return!(typeof I!="object"||I===null||"typ"in I&&I?.typ!=="JWT"||!I.alg||e&&I.alg!==e)}catch{return!1}}function IQn(t,e){return!!((e==="v4"||!e)&&KHn.test(t)||(e==="v6"||!e)&&PHn.test(t))}function aQn(t,e){let n=(t.toString().split(".")[1]||"").length,l=(e.toString().split(".")[1]||"").length,I=n>l?n:l,a=Number.parseInt(t.toFixed(I).replace(".","")),c=Number.parseInt(e.toFixed(I).replace(".",""));return a%c/10**I}function u5(t){if(t instanceof Um){let e={};for(let n in t.shape){let l=t.shape[n];e[n]=FZ.create(u5(l))}return new Um({...t._def,shape:()=>e})}else return t instanceof Fy?new Fy({...t._def,type:u5(t.element)}):t instanceof FZ?FZ.create(u5(t.unwrap())):t instanceof jY?jY.create(u5(t.unwrap())):t instanceof xY?xY.create(t.items.map(e=>u5(e))):t}function Dye(t,e){let n=kY(t),l=kY(e);if(t===e)return{valid:!0,data:t};if(n===gt.object&&l===gt.object){let I=uI.objectKeys(e),a=uI.objectKeys(t).filter(i=>I.indexOf(i)!==-1),c={...t,...e};for(let i of a){let s=Dye(t[i],e[i]);if(!s.valid)return{valid:!1};c[i]=s.data}return{valid:!0,data:c}}else if(n===gt.array&&l===gt.array){if(t.length!==e.length)return{valid:!1};let I=[];for(let a=0;a{let a=t(l);if(a instanceof Promise)return a.then(c=>{if(!c){let i=aet(e,l),s=i.fatal??n??!0;I.addIssue({code:"custom",...i,fatal:s})}});if(!a){let c=aet(e,l),i=c.fatal??n??!0;I.addIssue({code:"custom",...c,fatal:i})}}):X2.create()}var vZ,Iet,Sl,xHn,jHn,OHn,UHn,zHn,BHn,SHn,MHn,THn,Tye,DHn,KHn,_Hn,PHn,qHn,$Hn,ret,eQn,f2,NH,VH,YH,gH,d5,RH,yH,X2,Ay,XN,G5,Fy,Um,AH,yy,F8,FH,xY,v8,b5,m5,f8,vH,fH,XH,wH,w2,fZ,FZ,jY,HH,QH,p5,rQn,uz,dz,EH,cQn,ve,oQn,uet,det,iQn,sQn,Get,uQn,dQn,GQn,bQn,mQn,pQn,hQn,ZQn,WQn,NQn,VQn,YQn,gQn,RQn,yQn,AQn,FQn,vQn,fQn,XQn,wQn,HQn,QQn,EQn,JQn,CQn,LQn,kQn,xQn,jQn,OQn,UQn,zQn,BQn,bet=B(()=>{g8();R8();net();Mye();iz();vZ=class{constructor(e,n,l,I){this._cachedPath=[],this.parent=e,this.data=n,this._path=l,this._key=I}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Iet=(t,e)=>{if(v2(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Om(t.common.issues);return this._error=n,this._error}}};Sl=class{get description(){return this._def.description}_getType(e){return kY(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:kY(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new iG,ctx:{common:e.parent.common,data:e.data,parsedType:kY(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(s5(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let l=this.safeParse(e,n);if(l.success)return l.data;throw l.error}safeParse(e,n){let l={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kY(e)},I=this._parseSync({data:e,path:l.path,parent:l});return Iet(l,I)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kY(e)};if(!this["~standard"].async)try{let l=this._parseSync({data:e,path:[],parent:n});return v2(l)?{value:l.value}:{issues:n.common.issues}}catch(l){l?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(l=>v2(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(e,n){let l=await this.safeParseAsync(e,n);if(l.success)return l.data;throw l.error}async safeParseAsync(e,n){let l={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kY(e)},I=this._parse({data:e,path:l.path,parent:l}),a=await(s5(I)?I:Promise.resolve(I));return Iet(l,a)}refine(e,n){let l=I=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(I):n;return this._refinement((I,a)=>{let c=e(I),i=()=>a.addIssue({code:Me.custom,...l(I)});return typeof Promise<"u"&&c instanceof Promise?c.then(s=>s?!0:(i(),!1)):c?!0:(i(),!1)})}refinement(e,n){return this._refinement((l,I)=>e(l)?!0:(I.addIssue(typeof n=="function"?n(l,I):n),!1))}_refinement(e){return new fZ({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return FZ.create(this,this._def)}nullable(){return jY.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fy.create(this)}promise(){return w2.create(this,this._def)}or(e){return AH.create([this,e],this._def)}and(e){return FH.create(this,e,this._def)}transform(e){return new fZ({...Cl(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new HH({...Cl(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new uz({typeName:ve.ZodBranded,type:this,...Cl(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new QH({...Cl(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return dz.create(this,e)}readonly(){return EH.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xHn=/^c[^\s-]{8,}$/i,jHn=/^[0-9a-z]+$/,OHn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UHn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,zHn=/^[a-z0-9_-]{21}$/i,BHn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,SHn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MHn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,THn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",DHn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,KHn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_Hn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,PHn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qHn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$Hn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ret="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eQn=new RegExp(`^${ret}$`);f2=class t extends Sl{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==gt.string){let a=this._getOrReturnCtx(e);return mt(a,{code:Me.invalid_type,expected:gt.string,received:a.parsedType}),Rn}let l=new iG,I;for(let a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(I=this._getOrReturnCtx(e,I),mt(I,{code:Me.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),l.dirty());else if(a.kind==="length"){let c=e.data.length>a.value,i=e.data.lengthe.test(I),{validation:n,code:Me.invalid_string,...Tt.errToObj(l)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Tt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Tt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Tt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Tt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Tt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Tt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Tt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Tt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Tt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Tt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Tt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Tt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Tt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Tt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Tt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Tt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Tt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Tt.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Tt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Tt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Tt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Tt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Tt.errToObj(n)})}nonempty(e){return this.min(1,Tt.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew f2({checks:[],typeName:ve.ZodString,coerce:t?.coerce??!1,...Cl(t)});NH=class t extends Sl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==gt.number){let a=this._getOrReturnCtx(e);return mt(a,{code:Me.invalid_type,expected:gt.number,received:a.parsedType}),Rn}let l,I=new iG;for(let a of this._def.checks)a.kind==="int"?uI.isInteger(e.data)||(l=this._getOrReturnCtx(e,l),mt(l,{code:Me.invalid_type,expected:"integer",received:"float",message:a.message}),I.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(l=this._getOrReturnCtx(e,l),mt(l,{code:Me.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),I.dirty()):a.kind==="multipleOf"?aQn(e.data,a.value)!==0&&(l=this._getOrReturnCtx(e,l),mt(l,{code:Me.not_multiple_of,multipleOf:a.value,message:a.message}),I.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(l=this._getOrReturnCtx(e,l),mt(l,{code:Me.not_finite,message:a.message}),I.dirty()):uI.assertNever(a);return{status:I.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Tt.toString(n))}setLimit(e,n,l,I){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:l,message:Tt.toString(I)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Tt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Tt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Tt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Tt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Tt.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&uI.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(n===null||l.value>n)&&(n=l.value):l.kind==="max"&&(e===null||l.valuenew NH({checks:[],typeName:ve.ZodNumber,coerce:t?.coerce||!1,...Cl(t)});VH=class t extends Sl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==gt.bigint)return this._getInvalidInput(e);let l,I=new iG;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(l=this._getOrReturnCtx(e,l),mt(l,{code:Me.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),I.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(l=this._getOrReturnCtx(e,l),mt(l,{code:Me.not_multiple_of,multipleOf:a.value,message:a.message}),I.dirty()):uI.assertNever(a);return{status:I.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return mt(n,{code:Me.invalid_type,expected:gt.bigint,received:n.parsedType}),Rn}gte(e,n){return this.setLimit("min",e,!0,Tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Tt.toString(n))}setLimit(e,n,l,I){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:l,message:Tt.toString(I)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Tt.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew VH({checks:[],typeName:ve.ZodBigInt,coerce:t?.coerce??!1,...Cl(t)});YH=class extends Sl{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==gt.boolean){let l=this._getOrReturnCtx(e);return mt(l,{code:Me.invalid_type,expected:gt.boolean,received:l.parsedType}),Rn}return $G(e.data)}};YH.create=t=>new YH({typeName:ve.ZodBoolean,coerce:t?.coerce||!1,...Cl(t)});gH=class t extends Sl{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==gt.date){let a=this._getOrReturnCtx(e);return mt(a,{code:Me.invalid_type,expected:gt.date,received:a.parsedType}),Rn}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return mt(a,{code:Me.invalid_date}),Rn}let l=new iG,I;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(I=this._getOrReturnCtx(e,I),mt(I,{code:Me.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),l.dirty()):uI.assertNever(a);return{status:l.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Tt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Tt.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew gH({checks:[],coerce:t?.coerce||!1,typeName:ve.ZodDate,...Cl(t)});d5=class extends Sl{_parse(e){if(this._getType(e)!==gt.symbol){let l=this._getOrReturnCtx(e);return mt(l,{code:Me.invalid_type,expected:gt.symbol,received:l.parsedType}),Rn}return $G(e.data)}};d5.create=t=>new d5({typeName:ve.ZodSymbol,...Cl(t)});RH=class extends Sl{_parse(e){if(this._getType(e)!==gt.undefined){let l=this._getOrReturnCtx(e);return mt(l,{code:Me.invalid_type,expected:gt.undefined,received:l.parsedType}),Rn}return $G(e.data)}};RH.create=t=>new RH({typeName:ve.ZodUndefined,...Cl(t)});yH=class extends Sl{_parse(e){if(this._getType(e)!==gt.null){let l=this._getOrReturnCtx(e);return mt(l,{code:Me.invalid_type,expected:gt.null,received:l.parsedType}),Rn}return $G(e.data)}};yH.create=t=>new yH({typeName:ve.ZodNull,...Cl(t)});X2=class extends Sl{constructor(){super(...arguments),this._any=!0}_parse(e){return $G(e.data)}};X2.create=t=>new X2({typeName:ve.ZodAny,...Cl(t)});Ay=class extends Sl{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $G(e.data)}};Ay.create=t=>new Ay({typeName:ve.ZodUnknown,...Cl(t)});XN=class extends Sl{_parse(e){let n=this._getOrReturnCtx(e);return mt(n,{code:Me.invalid_type,expected:gt.never,received:n.parsedType}),Rn}};XN.create=t=>new XN({typeName:ve.ZodNever,...Cl(t)});G5=class extends Sl{_parse(e){if(this._getType(e)!==gt.undefined){let l=this._getOrReturnCtx(e);return mt(l,{code:Me.invalid_type,expected:gt.void,received:l.parsedType}),Rn}return $G(e.data)}};G5.create=t=>new G5({typeName:ve.ZodVoid,...Cl(t)});Fy=class t extends Sl{_parse(e){let{ctx:n,status:l}=this._processInputParams(e),I=this._def;if(n.parsedType!==gt.array)return mt(n,{code:Me.invalid_type,expected:gt.array,received:n.parsedType}),Rn;if(I.exactLength!==null){let c=n.data.length>I.exactLength.value,i=n.data.lengthI.maxLength.value&&(mt(n,{code:Me.too_big,maximum:I.maxLength.value,type:"array",inclusive:!0,exact:!1,message:I.maxLength.message}),l.dirty()),n.common.async)return Promise.all([...n.data].map((c,i)=>I.type._parseAsync(new vZ(n,c,n.path,i)))).then(c=>iG.mergeArray(l,c));let a=[...n.data].map((c,i)=>I.type._parseSync(new vZ(n,c,n.path,i)));return iG.mergeArray(l,a)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:Tt.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:Tt.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:Tt.toString(n)}})}nonempty(e){return this.min(1,e)}};Fy.create=(t,e)=>new Fy({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Cl(e)});Um=class t extends Sl{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=uI.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==gt.object){let r=this._getOrReturnCtx(e);return mt(r,{code:Me.invalid_type,expected:gt.object,received:r.parsedType}),Rn}let{status:l,ctx:I}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof XN&&this._def.unknownKeys==="strip"))for(let r in I.data)c.includes(r)||i.push(r);let s=[];for(let r of c){let u=a[r],o=I.data[r];s.push({key:{status:"valid",value:r},value:u._parse(new vZ(I,o,I.path,r)),alwaysSet:r in I.data})}if(this._def.catchall instanceof XN){let r=this._def.unknownKeys;if(r==="passthrough")for(let u of i)s.push({key:{status:"valid",value:u},value:{status:"valid",value:I.data[u]}});else if(r==="strict")i.length>0&&(mt(I,{code:Me.unrecognized_keys,keys:i}),l.dirty());else if(r!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let r=this._def.catchall;for(let u of i){let o=I.data[u];s.push({key:{status:"valid",value:u},value:r._parse(new vZ(I,o,I.path,u)),alwaysSet:u in I.data})}}return I.common.async?Promise.resolve().then(async()=>{let r=[];for(let u of s){let o=await u.key,d=await u.value;r.push({key:o,value:d,alwaysSet:u.alwaysSet})}return r}).then(r=>iG.mergeObjectSync(l,r)):iG.mergeObjectSync(l,s)}get shape(){return this._def.shape()}strict(e){return Tt.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,l)=>{let I=this._def.errorMap?.(n,l).message??l.defaultError;return n.code==="unrecognized_keys"?{message:Tt.errToObj(e).message??I}:{message:I}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let l of uI.objectKeys(e))e[l]&&this.shape[l]&&(n[l]=this.shape[l]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let l of uI.objectKeys(this.shape))e[l]||(n[l]=this.shape[l]);return new t({...this._def,shape:()=>n})}deepPartial(){return u5(this)}partial(e){let n={};for(let l of uI.objectKeys(this.shape)){let I=this.shape[l];e&&!e[l]?n[l]=I:n[l]=I.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let l of uI.objectKeys(this.shape))if(e&&!e[l])n[l]=this.shape[l];else{let a=this.shape[l];for(;a instanceof FZ;)a=a._def.innerType;n[l]=a}return new t({...this._def,shape:()=>n})}keyof(){return iet(uI.objectKeys(this.shape))}};Um.create=(t,e)=>new Um({shape:()=>t,unknownKeys:"strip",catchall:XN.create(),typeName:ve.ZodObject,...Cl(e)});Um.strictCreate=(t,e)=>new Um({shape:()=>t,unknownKeys:"strict",catchall:XN.create(),typeName:ve.ZodObject,...Cl(e)});Um.lazycreate=(t,e)=>new Um({shape:t,unknownKeys:"strip",catchall:XN.create(),typeName:ve.ZodObject,...Cl(e)});AH=class extends Sl{_parse(e){let{ctx:n}=this._processInputParams(e),l=this._def.options;function I(a){for(let i of a)if(i.result.status==="valid")return i.result;for(let i of a)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;let c=a.map(i=>new Om(i.ctx.common.issues));return mt(n,{code:Me.invalid_union,unionErrors:c}),Rn}if(n.common.async)return Promise.all(l.map(async a=>{let c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(I);{let a,c=[];for(let s of l){let r={...n,common:{...n.common,issues:[]},parent:null},u=s._parseSync({data:n.data,path:n.path,parent:r});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:r}),r.common.issues.length&&c.push(r.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let i=c.map(s=>new Om(s));return mt(n,{code:Me.invalid_union,unionErrors:i}),Rn}}get options(){return this._def.options}};AH.create=(t,e)=>new AH({options:t,typeName:ve.ZodUnion,...Cl(e)});yy=t=>t instanceof vH?yy(t.schema):t instanceof fZ?yy(t.innerType()):t instanceof fH?[t.value]:t instanceof XH?t.options:t instanceof wH?uI.objectValues(t.enum):t instanceof HH?yy(t._def.innerType):t instanceof RH?[void 0]:t instanceof yH?[null]:t instanceof FZ?[void 0,...yy(t.unwrap())]:t instanceof jY?[null,...yy(t.unwrap())]:t instanceof uz||t instanceof EH?yy(t.unwrap()):t instanceof QH?yy(t._def.innerType):[],F8=class t extends Sl{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.object)return mt(n,{code:Me.invalid_type,expected:gt.object,received:n.parsedType}),Rn;let l=this.discriminator,I=n.data[l],a=this.optionsMap.get(I);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(mt(n,{code:Me.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),Rn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,l){let I=new Map;for(let a of n){let c=yy(a.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of c){if(I.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);I.set(i,a)}}return new t({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:I,...Cl(l)})}};FH=class extends Sl{_parse(e){let{status:n,ctx:l}=this._processInputParams(e),I=(a,c)=>{if(y8(a)||y8(c))return Rn;let i=Dye(a.value,c.value);return i.valid?((A8(a)||A8(c))&&n.dirty(),{status:n.value,value:i.data}):(mt(l,{code:Me.invalid_intersection_types}),Rn)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([a,c])=>I(a,c)):I(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}};FH.create=(t,e,n)=>new FH({left:t,right:e,typeName:ve.ZodIntersection,...Cl(n)});xY=class t extends Sl{_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==gt.array)return mt(l,{code:Me.invalid_type,expected:gt.array,received:l.parsedType}),Rn;if(l.data.lengththis._def.items.length&&(mt(l,{code:Me.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...l.data].map((c,i)=>{let s=this._def.items[i]||this._def.rest;return s?s._parse(new vZ(l,c,l.path,i)):null}).filter(c=>!!c);return l.common.async?Promise.all(a).then(c=>iG.mergeArray(n,c)):iG.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xY.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xY({items:t,typeName:ve.ZodTuple,rest:null,...Cl(e)})};v8=class t extends Sl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==gt.object)return mt(l,{code:Me.invalid_type,expected:gt.object,received:l.parsedType}),Rn;let I=[],a=this._def.keyType,c=this._def.valueType;for(let i in l.data)I.push({key:a._parse(new vZ(l,i,l.path,i)),value:c._parse(new vZ(l,l.data[i],l.path,i)),alwaysSet:i in l.data});return l.common.async?iG.mergeObjectAsync(n,I):iG.mergeObjectSync(n,I)}get element(){return this._def.valueType}static create(e,n,l){return n instanceof Sl?new t({keyType:e,valueType:n,typeName:ve.ZodRecord,...Cl(l)}):new t({keyType:f2.create(),valueType:e,typeName:ve.ZodRecord,...Cl(n)})}},b5=class extends Sl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==gt.map)return mt(l,{code:Me.invalid_type,expected:gt.map,received:l.parsedType}),Rn;let I=this._def.keyType,a=this._def.valueType,c=[...l.data.entries()].map(([i,s],r)=>({key:I._parse(new vZ(l,i,l.path,[r,"key"])),value:a._parse(new vZ(l,s,l.path,[r,"value"]))}));if(l.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let s of c){let r=await s.key,u=await s.value;if(r.status==="aborted"||u.status==="aborted")return Rn;(r.status==="dirty"||u.status==="dirty")&&n.dirty(),i.set(r.value,u.value)}return{status:n.value,value:i}})}else{let i=new Map;for(let s of c){let r=s.key,u=s.value;if(r.status==="aborted"||u.status==="aborted")return Rn;(r.status==="dirty"||u.status==="dirty")&&n.dirty(),i.set(r.value,u.value)}return{status:n.value,value:i}}}};b5.create=(t,e,n)=>new b5({valueType:e,keyType:t,typeName:ve.ZodMap,...Cl(n)});m5=class t extends Sl{_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==gt.set)return mt(l,{code:Me.invalid_type,expected:gt.set,received:l.parsedType}),Rn;let I=this._def;I.minSize!==null&&l.data.sizeI.maxSize.value&&(mt(l,{code:Me.too_big,maximum:I.maxSize.value,type:"set",inclusive:!0,exact:!1,message:I.maxSize.message}),n.dirty());let a=this._def.valueType;function c(s){let r=new Set;for(let u of s){if(u.status==="aborted")return Rn;u.status==="dirty"&&n.dirty(),r.add(u.value)}return{status:n.value,value:r}}let i=[...l.data.values()].map((s,r)=>a._parse(new vZ(l,s,l.path,r)));return l.common.async?Promise.all(i).then(s=>c(s)):c(i)}min(e,n){return new t({...this._def,minSize:{value:e,message:Tt.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:Tt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};m5.create=(t,e)=>new m5({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Cl(e)});f8=class t extends Sl{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.function)return mt(n,{code:Me.invalid_type,expected:gt.function,received:n.parsedType}),Rn;function l(i,s){return sz({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i5(),Ry].filter(r=>!!r),issueData:{code:Me.invalid_arguments,argumentsError:s}})}function I(i,s){return sz({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i5(),Ry].filter(r=>!!r),issueData:{code:Me.invalid_return_type,returnTypeError:s}})}let a={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof w2){let i=this;return $G(async function(...s){let r=new Om([]),u=await i._def.args.parseAsync(s,a).catch(b=>{throw r.addIssue(l(s,b)),r}),o=await Reflect.apply(c,this,u);return await i._def.returns._def.type.parseAsync(o,a).catch(b=>{throw r.addIssue(I(o,b)),r})})}else{let i=this;return $G(function(...s){let r=i._def.args.safeParse(s,a);if(!r.success)throw new Om([l(s,r.error)]);let u=Reflect.apply(c,this,r.data),o=i._def.returns.safeParse(u,a);if(!o.success)throw new Om([I(u,o.error)]);return o.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:xY.create(e).rest(Ay.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,l){return new t({args:e||xY.create([]).rest(Ay.create()),returns:n||Ay.create(),typeName:ve.ZodFunction,...Cl(l)})}},vH=class extends Sl{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};vH.create=(t,e)=>new vH({getter:t,typeName:ve.ZodLazy,...Cl(e)});fH=class extends Sl{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return mt(n,{received:n.data,code:Me.invalid_literal,expected:this._def.value}),Rn}return{status:"valid",value:e.data}}get value(){return this._def.value}};fH.create=(t,e)=>new fH({value:t,typeName:ve.ZodLiteral,...Cl(e)});XH=class t extends Sl{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),l=this._def.values;return mt(n,{expected:uI.joinValues(l),received:n.parsedType,code:Me.invalid_type}),Rn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),l=this._def.values;return mt(n,{received:n.data,code:Me.invalid_enum_value,options:l}),Rn}return $G(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(l=>!e.includes(l)),{...this._def,...n})}};XH.create=iet;wH=class extends Sl{_parse(e){let n=uI.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(e);if(l.parsedType!==gt.string&&l.parsedType!==gt.number){let I=uI.objectValues(n);return mt(l,{expected:uI.joinValues(I),received:l.parsedType,code:Me.invalid_type}),Rn}if(this._cache||(this._cache=new Set(uI.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let I=uI.objectValues(n);return mt(l,{received:l.data,code:Me.invalid_enum_value,options:I}),Rn}return $G(e.data)}get enum(){return this._def.values}};wH.create=(t,e)=>new wH({values:t,typeName:ve.ZodNativeEnum,...Cl(e)});w2=class extends Sl{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==gt.promise&&n.common.async===!1)return mt(n,{code:Me.invalid_type,expected:gt.promise,received:n.parsedType}),Rn;let l=n.parsedType===gt.promise?n.data:Promise.resolve(n.data);return $G(l.then(I=>this._def.type.parseAsync(I,{path:n.path,errorMap:n.common.contextualErrorMap})))}};w2.create=(t,e)=>new w2({type:t,typeName:ve.ZodPromise,...Cl(e)});fZ=class extends Sl{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:l}=this._processInputParams(e),I=this._def.effect||null,a={addIssue:c=>{mt(l,c),c.fatal?n.abort():n.dirty()},get path(){return l.path}};if(a.addIssue=a.addIssue.bind(a),I.type==="preprocess"){let c=I.transform(l.data,a);if(l.common.async)return Promise.resolve(c).then(async i=>{if(n.value==="aborted")return Rn;let s=await this._def.schema._parseAsync({data:i,path:l.path,parent:l});return s.status==="aborted"?Rn:s.status==="dirty"?WH(s.value):n.value==="dirty"?WH(s.value):s});{if(n.value==="aborted")return Rn;let i=this._def.schema._parseSync({data:c,path:l.path,parent:l});return i.status==="aborted"?Rn:i.status==="dirty"?WH(i.value):n.value==="dirty"?WH(i.value):i}}if(I.type==="refinement"){let c=i=>{let s=I.refinement(i,a);if(l.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(l.common.async===!1){let i=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return i.status==="aborted"?Rn:(i.status==="dirty"&&n.dirty(),c(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(i=>i.status==="aborted"?Rn:(i.status==="dirty"&&n.dirty(),c(i.value).then(()=>({status:n.value,value:i.value}))))}if(I.type==="transform")if(l.common.async===!1){let c=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!v2(c))return Rn;let i=I.transform(c.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:i}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(c=>v2(c)?Promise.resolve(I.transform(c.value,a)).then(i=>({status:n.value,value:i})):Rn);uI.assertNever(I)}};fZ.create=(t,e,n)=>new fZ({schema:t,typeName:ve.ZodEffects,effect:e,...Cl(n)});fZ.createWithPreprocess=(t,e,n)=>new fZ({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Cl(n)});FZ=class extends Sl{_parse(e){return this._getType(e)===gt.undefined?$G(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};FZ.create=(t,e)=>new FZ({innerType:t,typeName:ve.ZodOptional,...Cl(e)});jY=class extends Sl{_parse(e){return this._getType(e)===gt.null?$G(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jY.create=(t,e)=>new jY({innerType:t,typeName:ve.ZodNullable,...Cl(e)});HH=class extends Sl{_parse(e){let{ctx:n}=this._processInputParams(e),l=n.data;return n.parsedType===gt.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};HH.create=(t,e)=>new HH({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Cl(e)});QH=class extends Sl{_parse(e){let{ctx:n}=this._processInputParams(e),l={...n,common:{...n.common,issues:[]}},I=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return s5(I)?I.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Om(l.common.issues)},input:l.data})})):{status:"valid",value:I.status==="valid"?I.value:this._def.catchValue({get error(){return new Om(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}};QH.create=(t,e)=>new QH({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Cl(e)});p5=class extends Sl{_parse(e){if(this._getType(e)!==gt.nan){let l=this._getOrReturnCtx(e);return mt(l,{code:Me.invalid_type,expected:gt.nan,received:l.parsedType}),Rn}return{status:"valid",value:e.data}}};p5.create=t=>new p5({typeName:ve.ZodNaN,...Cl(t)});rQn=Symbol("zod_brand"),uz=class extends Sl{_parse(e){let{ctx:n}=this._processInputParams(e),l=n.data;return this._def.type._parse({data:l,path:n.path,parent:n})}unwrap(){return this._def.type}},dz=class t extends Sl{_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return a.status==="aborted"?Rn:a.status==="dirty"?(n.dirty(),WH(a.value)):this._def.out._parseAsync({data:a.value,path:l.path,parent:l})})();{let I=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return I.status==="aborted"?Rn:I.status==="dirty"?(n.dirty(),{status:"dirty",value:I.value}):this._def.out._parseSync({data:I.value,path:l.path,parent:l})}}static create(e,n){return new t({in:e,out:n,typeName:ve.ZodPipeline})}},EH=class extends Sl{_parse(e){let n=this._def.innerType._parse(e),l=I=>(v2(I)&&(I.value=Object.freeze(I.value)),I);return s5(n)?n.then(I=>l(I)):l(n)}unwrap(){return this._def.innerType}};EH.create=(t,e)=>new EH({innerType:t,typeName:ve.ZodReadonly,...Cl(e)});cQn={object:Um.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));oQn=(t,e={message:`Input not instance of ${t.name}`})=>set(n=>n instanceof t,e),uet=f2.create,det=NH.create,iQn=p5.create,sQn=VH.create,Get=YH.create,uQn=gH.create,dQn=d5.create,GQn=RH.create,bQn=yH.create,mQn=X2.create,pQn=Ay.create,hQn=XN.create,ZQn=G5.create,WQn=Fy.create,NQn=Um.create,VQn=Um.strictCreate,YQn=AH.create,gQn=F8.create,RQn=FH.create,yQn=xY.create,AQn=v8.create,FQn=b5.create,vQn=m5.create,fQn=f8.create,XQn=vH.create,wQn=fH.create,HQn=XH.create,QQn=wH.create,EQn=w2.create,JQn=fZ.create,CQn=FZ.create,LQn=jY.create,kQn=fZ.createWithPreprocess,xQn=dz.create,jQn=()=>uet().optional(),OQn=()=>det().optional(),UQn=()=>Get().optional(),zQn={string:t=>f2.create({...t,coerce:!0}),number:t=>NH.create({...t,coerce:!0}),boolean:t=>YH.create({...t,coerce:!0}),bigint:t=>VH.create({...t,coerce:!0}),date:t=>gH.create({...t,coerce:!0})},BQn=Rn});var St={};Xe(St,{BRAND:()=>rQn,DIRTY:()=>WH,EMPTY_PATH:()=>kHn,INVALID:()=>Rn,NEVER:()=>BQn,OK:()=>$G,ParseStatus:()=>iG,Schema:()=>Sl,ZodAny:()=>X2,ZodArray:()=>Fy,ZodBigInt:()=>VH,ZodBoolean:()=>YH,ZodBranded:()=>uz,ZodCatch:()=>QH,ZodDate:()=>gH,ZodDefault:()=>HH,ZodDiscriminatedUnion:()=>F8,ZodEffects:()=>fZ,ZodEnum:()=>XH,ZodError:()=>Om,ZodFirstPartyTypeKind:()=>ve,ZodFunction:()=>f8,ZodIntersection:()=>FH,ZodIssueCode:()=>Me,ZodLazy:()=>vH,ZodLiteral:()=>fH,ZodMap:()=>b5,ZodNaN:()=>p5,ZodNativeEnum:()=>wH,ZodNever:()=>XN,ZodNull:()=>yH,ZodNullable:()=>jY,ZodNumber:()=>NH,ZodObject:()=>Um,ZodOptional:()=>FZ,ZodParsedType:()=>gt,ZodPipeline:()=>dz,ZodPromise:()=>w2,ZodReadonly:()=>EH,ZodRecord:()=>v8,ZodSchema:()=>Sl,ZodSet:()=>m5,ZodString:()=>f2,ZodSymbol:()=>d5,ZodTransformer:()=>fZ,ZodTuple:()=>xY,ZodType:()=>Sl,ZodUndefined:()=>RH,ZodUnion:()=>AH,ZodUnknown:()=>Ay,ZodVoid:()=>G5,addIssueToContext:()=>mt,any:()=>mQn,array:()=>WQn,bigint:()=>sQn,boolean:()=>Get,coerce:()=>zQn,custom:()=>set,date:()=>uQn,datetimeRegex:()=>oet,defaultErrorMap:()=>Ry,discriminatedUnion:()=>gQn,effect:()=>JQn,enum:()=>HQn,function:()=>fQn,getErrorMap:()=>i5,getParsedType:()=>kY,instanceof:()=>oQn,intersection:()=>RQn,isAborted:()=>y8,isAsync:()=>s5,isDirty:()=>A8,isValid:()=>v2,late:()=>cQn,lazy:()=>XQn,literal:()=>wQn,makeIssue:()=>sz,map:()=>FQn,nan:()=>iQn,nativeEnum:()=>QQn,never:()=>hQn,null:()=>bQn,nullable:()=>LQn,number:()=>det,object:()=>NQn,objectUtil:()=>Bye,oboolean:()=>UQn,onumber:()=>OQn,optional:()=>CQn,ostring:()=>jQn,pipeline:()=>xQn,preprocess:()=>kQn,promise:()=>EQn,quotelessJson:()=>JHn,record:()=>AQn,set:()=>vQn,setErrorMap:()=>LHn,strictObject:()=>VQn,string:()=>uet,symbol:()=>dQn,transformer:()=>JQn,tuple:()=>yQn,undefined:()=>GQn,union:()=>YQn,unknown:()=>pQn,util:()=>uI,void:()=>ZQn});var Gz=B(()=>{R8();Mye();tet();iz();bet();g8()});var X8=B(()=>{Gz();Gz()});var pet=f((_UI,met)=>{function XZ(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,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))}met.exports=XZ;XZ.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};XZ.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};XZ.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var l=this;return this._timer=setTimeout(function(){l._attempts++,l._operationTimeoutCb&&(l._timeout=setTimeout(function(){l._operationTimeoutCb(l._attempts)},l._operationTimeout),l._options.unref&&l._timeout.unref()),l._fn(l._attempts)},n),this._options.unref&&this._timer.unref(),!0};XZ.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};XZ.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};XZ.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};XZ.prototype.start=XZ.prototype.try;XZ.prototype.errors=function(){return this._errors};XZ.prototype.attempts=function(){return this._attempts};XZ.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,l=0;l=n&&(e=I,n=c)}return e}});var het=f(JH=>{var SQn=pet();JH.operation=function(t){var e=JH.timeouts(t);return new SQn(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};JH.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var l=[],I=0;I{Zet.exports=het()});var CH=f(($UI,H8)=>{"use strict";var MQn=Wet(),TQn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],w8=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}},DQn=(t,e,n)=>{let l=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=l,t},KQn=t=>TQn.includes(t),Net=(t,e)=>new Promise((n,l)=>{e={onFailedAttempt:()=>{},retries:10,...e};let I=MQn.operation(e);I.attempt(async a=>{try{n(await t(a))}catch(c){if(!(c instanceof Error)){l(new TypeError(`Non-error was thrown: "${c}". You should only throw errors.`));return}if(c instanceof w8)I.stop(),l(c.originalError);else if(c instanceof TypeError&&!KQn(c.message))I.stop(),l(c);else{DQn(c,a,e);try{await e.onFailedAttempt(c)}catch(i){l(i);return}I.retry(c)||l(I.mainError())}}})});H8.exports=Net;H8.exports.default=Net;H8.exports.AbortError=w8});var Vet,Yet=B(()=>{Vet=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function _Qn(t){return typeof t=="string"&&Vet.test(t)}var zm,Kye=B(()=>{Yet();zm=_Qn});function PQn(t){if(!zm(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}var get,Ret=B(()=>{Kye();get=PQn});function E8(t,e=0){return(sG[t[e+0]]+sG[t[e+1]]+sG[t[e+2]]+sG[t[e+3]]+"-"+sG[t[e+4]]+sG[t[e+5]]+"-"+sG[t[e+6]]+sG[t[e+7]]+"-"+sG[t[e+8]]+sG[t[e+9]]+"-"+sG[t[e+10]]+sG[t[e+11]]+sG[t[e+12]]+sG[t[e+13]]+sG[t[e+14]]+sG[t[e+15]]).toLowerCase()}var sG,Q8,_ye=B(()=>{sG=[];for(Q8=0;Q8<256;++Q8)sG.push((Q8+256).toString(16).slice(1))});function Pye(){if(!J8&&(J8=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J8))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J8(qQn)}var J8,qQn,yet=B(()=>{qQn=new Uint8Array(16)});function $Qn(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n{_ye();Ret();eEn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",tEn="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var nEn,$ye,Fet=B(()=>{nEn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$ye={randomUUID:nEn}});function lEn(t,e,n){if($ye.randomUUID&&!e&&!t)return $ye.randomUUID();t=t||{};var l=t.random||(t.rng||Pye)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,e){n=n||0;for(var I=0;I<16;++I)e[n+I]=l[I];return e}return E8(l)}var $n,vet=B(()=>{Fet();yet();_ye();$n=lEn});function IEn(t,e,n,l){switch(t){case 0:return e&n^~e&l;case 1:return e^n^l;case 2:return e&n^e&l^n&l;case 3:return e^n^l}}function eAe(t,e){return t<>>32-e}function aEn(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var l=unescape(encodeURIComponent(t));t=[];for(var I=0;I>>0;X=y,y=g,g=eAe(N,30)>>>0,N=Z,Z=Q}n[0]=n[0]+Z>>>0,n[1]=n[1]+N>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+X>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var fet,Xet=B(()=>{fet=aEn});var rEn,LH,wet=B(()=>{Aet();Xet();rEn=qye("v5",80,fet),LH=rEn});var uG=B(()=>{vet();wet();Kye()});function Het(t=!1){let e=oEn.getInstance().getStore();if(!t&&e===void 0)throw new Error(`Could not get the current run tree. + +Please make sure you are calling this method within a traceable function and that tracing is enabled.`);return e}function C8(t){return typeof t=="function"&&"langsmith:traceable"in t}var nAe,tAe,cEn,lAe,oEn,Y9I,Qet=B(()=>{nAe=class{getStore(){}run(e,n){return n()}},tAe=Symbol.for("ls:tracing_async_local_storage"),cEn=new nAe,lAe=class{getInstance(){return globalThis[tAe]??cEn}initializeGlobalInstance(e){globalThis[tAe]===void 0&&(globalThis[tAe]=e)}},oEn=new lAe;Y9I=Symbol.for("langsmith:traceable:root")});var IAe=B(()=>{Qet()});function k8(t,e){return iEn.call(t,e)}function x8(t){if(Array.isArray(t)){let n=new Array(t.length);for(let l=0;l=48&&l<=57){e++;continue}return!1}return!0}function OY(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function bz(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function L8(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(let n=0,l=t.length;n{iEn=Object.prototype.hasOwnProperty;kH=class extends Error{constructor(e,n,l,I,a){super(Eet(e,{name:n,index:l,operation:I,tree:a})),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"operation",{enumerable:!0,configurable:!0,writable:!0,value:I}),Object.defineProperty(this,"tree",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.setPrototypeOf(this,new.target.prototype),this.message=Eet(e,{name:n,index:l,operation:I,tree:a})}}});var aAe={};Xe(aAe,{JsonPatchError:()=>yo,_areEquals:()=>pz,applyOperation:()=>xH,applyPatch:()=>vy,applyReducer:()=>dEn,deepClone:()=>sEn,getValueByPointer:()=>O8,validate:()=>Jet,validator:()=>U8});function O8(t,e){if(e=="")return t;var n={op:"_get",path:e};return xH(t,n),n.value}function xH(t,e,n=!1,l=!0,I=!0,a=0){if(n&&(typeof n=="function"?n(e,0,t,e.path):U8(e,0)),e.path===""){let c={newDocument:t};if(e.op==="add")return c.newDocument=e.value,c;if(e.op==="replace")return c.newDocument=e.value,c.removed=t,c;if(e.op==="move"||e.op==="copy")return c.newDocument=O8(t,e.from),e.op==="move"&&(c.removed=t),c;if(e.op==="test"){if(c.test=pz(t,e.value),c.test===!1)throw new yo("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c.newDocument=t,c}else{if(e.op==="remove")return c.removed=t,c.newDocument=null,c;if(e.op==="_get")return e.value=t,c;if(n)throw new yo("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,e,t);return c}}else{l||(t=eb(t));let i=(e.path||"").split("/"),s=t,r=1,u=i.length,o,d,b;for(typeof n=="function"?b=n:b=U8;;){if(d=i[r],d&&d.indexOf("~")!=-1&&(d=bz(d)),I&&(d=="__proto__"||d=="prototype"&&r>0&&i[r-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&o===void 0&&(s[d]===void 0?o=i.slice(0,r).join("/"):r==u-1&&(o=e.path),o!==void 0&&b(e,0,t,o)),r++,Array.isArray(s)){if(d==="-")d=s.length;else{if(n&&!j8(d))throw new yo("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,e,t);j8(d)&&(d=~~d)}if(r>=u){if(n&&e.op==="add"&&d>s.length)throw new yo("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,e,t);let h=uEn[e.op].call(e,s,d,t);if(h.test===!1)throw new yo("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return h}}else if(r>=u){let h=h5[e.op].call(e,s,d,t);if(h.test===!1)throw new yo("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return h}if(s=s[d],n&&r0)throw new yo('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new yo("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new yo("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&L8(t.value))throw new yo("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n){if(t.op=="add"){var I=t.path.split("/").length,a=l.split("/").length;if(I!==a+1&&I!==a)throw new yo("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==l)throw new yo("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if(t.op==="move"||t.op==="copy"){var c={op:"_get",path:t.from,value:void 0},i=Jet([c],n);if(i&&i.name==="OPERATION_PATH_UNRESOLVABLE")throw new yo("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}}else throw new yo("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n)}function Jet(t,e,n){try{if(!Array.isArray(t))throw new yo("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)vy(eb(e),eb(t),n||!0);else{n=n||U8;for(var l=0;l{mz();yo=kH,sEn=eb,h5={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var l=t[e];return delete t[e],{newDocument:n,removed:l}},replace:function(t,e,n){var l=t[e];return t[e]=this.value,{newDocument:n,removed:l}},move:function(t,e,n){let l=O8(n,this.path);l&&(l=eb(l));let I=xH(n,{op:"remove",path:this.from}).removed;return xH(n,{op:"add",path:this.path,value:I}),{newDocument:n,removed:l}},copy:function(t,e,n){let l=O8(n,this.from);return xH(n,{op:"add",path:this.path,value:eb(l)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:pz(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},uEn={add:function(t,e,n){return j8(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){var l=t.splice(e,1);return{newDocument:n,removed:l[0]}},replace:function(t,e,n){var l=t[e];return t[e]=this.value,{newDocument:n,removed:l}},move:h5.move,copy:h5.copy,test:h5.test,_get:h5._get}});function Cet(t,e,n,l,I){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var a=x8(e),c=x8(t),i=!1,s=!1,r=c.length-1;r>=0;r--){var u=c[r],o=t[u];if(k8(e,u)&&!(e[u]===void 0&&o!==void 0&&Array.isArray(e)===!1)){var d=e[u];typeof o=="object"&&o!=null&&typeof d=="object"&&d!=null&&Array.isArray(o)===Array.isArray(d)?Cet(o,d,n,l+"/"+OY(u),I):o!==d&&(i=!0,I&&n.push({op:"test",path:l+"/"+OY(u),value:eb(o)}),n.push({op:"replace",path:l+"/"+OY(u),value:eb(d)}))}else Array.isArray(t)===Array.isArray(e)?(I&&n.push({op:"test",path:l+"/"+OY(u),value:eb(o)}),n.push({op:"remove",path:l+"/"+OY(u)}),s=!0):(I&&n.push({op:"test",path:l,value:t}),n.push({op:"replace",path:l,value:e}),i=!0)}if(!(!s&&a.length==c.length))for(var r=0;r{mz();z8();});var H9I,rAe=B(()=>{z8();Let();mz();z8();mz();H9I={...aAe,JsonPatchError:kH,deepClone:eb,escapePathComponent:OY,unescapePathComponent:bz}});var ket,xet,cAe,jet,oAe,iAe,sAe,Oet,Uet,zet,Bet,Met,Tet,Det,Ket,_et,Pet,qet,$et,ett,ttt,ntt,ltt,Itt,att,rtt,ctt,ott,itt,stt,uAe,utt,dtt,Gtt=B(()=>{ket="gen_ai.operation.name",xet="gen_ai.system",cAe="gen_ai.request.model",jet="gen_ai.response.model",oAe="gen_ai.usage.input_tokens",iAe="gen_ai.usage.output_tokens",sAe="gen_ai.usage.total_tokens",Oet="gen_ai.request.max_tokens",Uet="gen_ai.request.temperature",zet="gen_ai.request.top_p",Bet="gen_ai.request.frequency_penalty",Met="gen_ai.request.presence_penalty",Tet="gen_ai.response.finish_reasons",Det="gen_ai.prompt",Ket="gen_ai.completion",_et="gen_ai.request.extra_query",Pet="gen_ai.request.extra_body",qet="gen_ai.serialized.name",$et="gen_ai.serialized.signature",ett="gen_ai.serialized.doc",ttt="gen_ai.response.id",ntt="gen_ai.response.service_tier",ltt="gen_ai.response.system_fingerprint",Itt="gen_ai.usage.input_token_details",att="gen_ai.usage.output_token_details",rtt="langsmith.trace.session_id",ctt="langsmith.trace.session_name",ott="langsmith.span.kind",itt="langsmith.trace.name",stt="langsmith.metadata",uAe="langsmith.span.tags",utt="langsmith.request.streaming",dtt="langsmith.request.headers"});var bEn,btt,mtt,qt,B8=B(()=>{fy();bEn=(...t)=>fetch(...t),btt=Symbol.for("ls:fetch_implementation"),mtt=()=>{let t=globalThis[btt];return t?typeof t=="function"&&"Headers"in t&&"Request"in t&&"Response"in t:!1},qt=t=>async(...e)=>{if(t||hd("DEBUG")==="true"){let[l,I]=e;console.log(`\u2192 ${I?.method||"GET"} ${l}`)}let n=await(globalThis[btt]??bEn)(...e);return(t||hd("DEBUG")==="true")&&console.log(`\u2190 ${n.status} ${n.statusText} ${n.url}`),n}});var hz,dAe=B(()=>{fy();hz=()=>hd("PROJECT")??Im("LANGCHAIN_SESSION")??"default"});var S8,M8=B(()=>{GAe();bAe();B8();dAe();S8="0.3.46"});function T8(){if(mAe===void 0){let t=WEn(),e=VEn();mAe={library:"langsmith",runtime:t,sdk:"langsmith-js",sdk_version:S8,...e}}return mAe}function htt(){let t=NEn()||{},e={},n=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION","LANGSMITH_API_KEY","LANGSMITH_ENDPOINT","LANGSMITH_TRACING_V2","LANGSMITH_PROJECT","LANGSMITH_SESSION"];for(let[l,I]of Object.entries(t))(l.startsWith("LANGCHAIN_")||l.startsWith("LANGSMITH_"))&&typeof I=="string"&&!n.includes(l)&&!l.toLowerCase().includes("key")&&!l.toLowerCase().includes("secret")&&!l.toLowerCase().includes("token")&&(l==="LANGCHAIN_REVISION_ID"?e.revision_id=I:e[l]=I);return e}function NEn(){try{return typeof process<"u"&&process.env?Object.entries(process.env).reduce((t,[e,n])=>(t[e]=String(n),t),{}):void 0}catch{return}}function Im(t){try{return typeof process<"u"?process.env?.[t]:void 0}catch{return}}function hd(t){return Im(`LANGSMITH_${t}`)||Im(`LANGCHAIN_${t}`)}function VEn(){if(pAe!==void 0)return pAe;let t=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],e={};for(let n of t){let l=Im(n);l!==void 0&&(e[n]=l)}return pAe=e,e}var Xy,mEn,pEn,hEn,ptt,ZEn,WEn,mAe,pAe,fy=B(()=>{M8();mEn=()=>typeof window<"u"&&typeof window.document<"u",pEn=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",hEn=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),ptt=()=>typeof Deno<"u",ZEn=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!ptt(),WEn=()=>Xy||(mEn()?Xy="browser":ZEn()?Xy="node":pEn()?Xy="webworker":hEn()?Xy="jsdom":ptt()?Xy="deno":Xy="other",Xy)});function D8(){return gAe.getTraceInstance()}function Wtt(){return gAe.getContextInstance()}function Ntt(){return gAe.getDefaultOTLPTracerComponents()}var WAe,NAe,VAe,hAe,ZAe,Ztt,YEn,gEn,YAe,gAe,RAe=B(()=>{fy();WAe=class{constructor(){Object.defineProperty(this,"hasWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startActiveSpan(e,...n){!this.hasWarned&&Im("OTEL_ENABLED")==="true"&&(console.warn('You have enabled OTEL export via the `OTEL_ENABLED` environment variable, but have not initialized the required OTEL instances. Please add:\n```\nimport { initializeOTEL } from "langsmith/experimental/otel/setup";\ninitializeOTEL();\n```\nat the beginning of your code.'),this.hasWarned=!0);let l;if(n.length===1&&typeof n[0]=="function"?l=n[0]:n.length===2&&typeof n[1]=="function"?l=n[1]:n.length===3&&typeof n[2]=="function"&&(l=n[2]),typeof l=="function")return l()}},NAe=class{constructor(){Object.defineProperty(this,"mockTracer",{enumerable:!0,configurable:!0,writable:!0,value:new WAe})}getTracer(e,n){return this.mockTracer}getActiveSpan(){}setSpan(e,n){return e}getSpan(e){}setSpanContext(e,n){return e}getTracerProvider(){}setGlobalTracerProvider(e){return!1}},VAe=class{active(){return{}}with(e,n){return n()}},hAe=Symbol.for("ls:otel_trace"),ZAe=Symbol.for("ls:otel_context"),Ztt=Symbol.for("ls:otel_get_default_otlp_tracer_provider"),YEn=new NAe,gEn=new VAe,YAe=class{getTraceInstance(){return globalThis[hAe]??YEn}getContextInstance(){return globalThis[ZAe]??gEn}initializeGlobalInstances(e){globalThis[hAe]===void 0&&(globalThis[hAe]=e.trace),globalThis[ZAe]===void 0&&(globalThis[ZAe]=e.context)}setDefaultOTLPTracerComponents(e){globalThis[Ztt]=e}getDefaultOTLPTracerComponents(){return globalThis[Ztt]??void 0}},gAe=new YAe});function yEn(t){return REn[t]||t}var REn,K8,Vtt=B(()=>{Gtt();RAe();REn={llm:"chat",tool:"execute_tool",retriever:"embeddings",embedding:"embeddings",prompt:"chat"};K8=class{constructor(){Object.defineProperty(this,"spans",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}exportBatch(e,n){for(let l of e)try{if(!l.run)continue;if(l.operation==="post"){let I=this.createSpanForRun(l,l.run,n.get(l.id));I&&!l.run.end_time&&this.spans.set(l.id,I)}else this.updateSpanForRun(l,l.run)}catch(I){console.error(`Error processing operation ${l.id}:`,I)}}createSpanForRun(e,n,l){let I=l&&D8().getSpan(l);if(I)try{return this.finishSpanSetup(I,n,e)}catch(a){console.error(`Failed to create span for run ${e.id}:`,a);return}}finishSpanSetup(e,n,l){return this.setSpanAttributes(e,n,l),n.error?(e.setStatus({code:2}),e.recordException(new Error(n.error))):e.setStatus({code:1}),n.end_time&&e.end(new Date(n.end_time)),e}updateSpanForRun(e,n){try{let l=this.spans.get(e.id);if(!l){console.debug(`No span found for run ${e.id} during update`);return}this.setSpanAttributes(l,n,e),n.error?(l.setStatus({code:2}),l.recordException(new Error(n.error))):l.setStatus({code:1});let I=n.end_time;I&&(l.end(new Date(I)),this.spans.delete(e.id))}catch(l){console.error(`Failed to update span for run ${e.id}:`,l)}}extractModelName(e){if(e.extra?.metadata){let n=e.extra.metadata;if(n.ls_model_name)return n.ls_model_name;if(n.invocation_params){let l=n.invocation_params;if(l.model)return l.model;if(l.model_name)return l.model_name}}}setSpanAttributes(e,n,l){if("run_type"in n&&n.run_type){e.setAttribute(ott,n.run_type);let i=yEn(n.run_type||"chain");e.setAttribute(ket,i)}"name"in n&&n.name&&e.setAttribute(itt,n.name),"session_id"in n&&n.session_id&&e.setAttribute(rtt,n.session_id),"session_name"in n&&n.session_name&&e.setAttribute(ctt,n.session_name),this.setGenAiSystem(e,n);let I=this.extractModelName(n);I&&e.setAttribute(cAe,I),"prompt_tokens"in n&&typeof n.prompt_tokens=="number"&&e.setAttribute(oAe,n.prompt_tokens),"completion_tokens"in n&&typeof n.completion_tokens=="number"&&e.setAttribute(iAe,n.completion_tokens),"total_tokens"in n&&typeof n.total_tokens=="number"&&e.setAttribute(sAe,n.total_tokens),this.setInvocationParameters(e,n);let a=n.extra?.metadata||{};for(let[i,s]of Object.entries(a))s!=null&&e.setAttribute(`${stt}.${i}`,String(s));let c=n.tags;if(c&&Array.isArray(c)?e.setAttribute(uAe,c.join(", ")):c&&e.setAttribute(uAe,String(c)),"serialized"in n&&typeof n.serialized=="object"){let i=n.serialized;i.name&&e.setAttribute(qet,String(i.name)),i.signature&&e.setAttribute($et,String(i.signature)),i.doc&&e.setAttribute(ett,String(i.doc))}this.setIOAttributes(e,l)}setGenAiSystem(e,n){let l="langchain",I=this.extractModelName(n);if(I){let a=I.toLowerCase();a.includes("anthropic")||a.startsWith("claude")?l="anthropic":a.includes("bedrock")?l="aws.bedrock":a.includes("azure")&&a.includes("openai")?l="az.ai.openai":a.includes("azure")&&a.includes("inference")?l="az.ai.inference":a.includes("cohere")?l="cohere":a.includes("deepseek")?l="deepseek":a.includes("gemini")?l="gemini":a.includes("groq")?l="groq":a.includes("watson")||a.includes("ibm")?l="ibm.watsonx.ai":a.includes("mistral")?l="mistral_ai":a.includes("gpt")||a.includes("openai")?l="openai":a.includes("perplexity")||a.includes("sonar")?l="perplexity":a.includes("vertex")?l="vertex_ai":(a.includes("xai")||a.includes("grok"))&&(l="xai")}e.setAttribute(xet,l)}setInvocationParameters(e,n){if(!n.extra?.metadata?.invocation_params)return;let l=n.extra.metadata.invocation_params;l.max_tokens!==void 0&&e.setAttribute(Oet,l.max_tokens),l.temperature!==void 0&&e.setAttribute(Uet,l.temperature),l.top_p!==void 0&&e.setAttribute(zet,l.top_p),l.frequency_penalty!==void 0&&e.setAttribute(Bet,l.frequency_penalty),l.presence_penalty!==void 0&&e.setAttribute(Met,l.presence_penalty)}setIOAttributes(e,n){if(n.run.inputs)try{let l=n.run.inputs;typeof l=="object"&&l!==null&&(l.model&&Array.isArray(l.messages)&&e.setAttribute(cAe,l.model),l.stream!==void 0&&e.setAttribute(utt,l.stream),l.extra_headers&&e.setAttribute(dtt,JSON.stringify(l.extra_headers)),l.extra_query&&e.setAttribute(_et,JSON.stringify(l.extra_query)),l.extra_body&&e.setAttribute(Pet,JSON.stringify(l.extra_body))),e.setAttribute(Det,JSON.stringify(l))}catch(l){console.debug(`Failed to process inputs for run ${n.id}`,l)}if(n.run.outputs)try{let l=n.run.outputs,I=this.getUnifiedRunTokens(l);if(I&&(e.setAttribute(oAe,I[0]),e.setAttribute(iAe,I[1]),e.setAttribute(sAe,I[0]+I[1])),l&&typeof l=="object"){if(l.model&&e.setAttribute(jet,String(l.model)),l.id&&e.setAttribute(ttt,l.id),l.choices&&Array.isArray(l.choices)){let a=l.choices.map(c=>c.finish_reason).filter(c=>c).map(String);a.length>0&&e.setAttribute(Tet,a.join(", "))}if(l.service_tier&&e.setAttribute(ntt,l.service_tier),l.system_fingerprint&&e.setAttribute(ltt,l.system_fingerprint),l.usage_metadata&&typeof l.usage_metadata=="object"){let a=l.usage_metadata;a.input_token_details&&e.setAttribute(Itt,JSON.stringify(a.input_token_details)),a.output_token_details&&e.setAttribute(att,JSON.stringify(a.output_token_details))}}e.setAttribute(Ket,JSON.stringify(l))}catch(l){console.debug(`Failed to process outputs for run ${n.id}`,l)}}getUnifiedRunTokens(e){if(!e)return null;let n=this.extractUnifiedRunTokens(e.usage_metadata);if(n)return n;let l=Object.keys(e);for(let c of l){let i=e[c];if(!(!i||typeof i!="object")&&(n=this.extractUnifiedRunTokens(i.usage_metadata),n||i.lc===1&&i.kwargs&&typeof i.kwargs=="object"&&(n=this.extractUnifiedRunTokens(i.kwargs.usage_metadata),n)))return n}let I=e.generations||[];if(!Array.isArray(I))return null;let a=Array.isArray(I[0])?I.flat():I;for(let c of a)if(typeof c=="object"&&c.message&&typeof c.message=="object"&&c.message.kwargs&&typeof c.message.kwargs=="object"&&(n=this.extractUnifiedRunTokens(c.message.kwargs.usage_metadata),n))return n;return null}extractUnifiedRunTokens(e){return!e||typeof e!="object"||typeof e.input_tokens!="number"||typeof e.output_tokens!="number"?null:[e.input_tokens,e.output_tokens]}}});var AAe=f(($9I,yAe)=>{"use strict";var AEn=Object.prototype.hasOwnProperty,am="~";function Zz(){}Object.create&&(Zz.prototype=Object.create(null),new Zz().__proto__||(am=!1));function FEn(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function Ytt(t,e,n,l,I){if(typeof n!="function")throw new TypeError("The listener must be a function");var a=new FEn(n,l||t,I),c=am?am+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function _8(t,e){--t._eventsCount===0?t._events=new Zz:delete t._events[e]}function tb(){this._events=new Zz,this._eventsCount=0}tb.prototype.eventNames=function(){var e=[],n,l;if(this._eventsCount===0)return e;for(l in n=this._events)AEn.call(n,l)&&e.push(am?l.slice(1):l);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(n)):e};tb.prototype.listeners=function(e){var n=am?am+e:e,l=this._events[n];if(!l)return[];if(l.fn)return[l.fn];for(var I=0,a=l.length,c=new Array(a);I{"use strict";gtt.exports=(t,e)=>(e=e||(()=>{}),t.then(n=>new Promise(l=>{l(e())}).then(()=>n),n=>new Promise(l=>{l(e())}).then(()=>{throw n})))});var Att=f((tzI,q8)=>{"use strict";var vEn=Rtt(),P8=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},ytt=(t,e,n)=>new Promise((l,I)=>{if(typeof e!="number"||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0){l(t);return}let a=setTimeout(()=>{if(typeof n=="function"){try{l(n())}catch(s){I(s)}return}let c=typeof n=="string"?n:`Promise timed out after ${e} milliseconds`,i=n instanceof Error?n:new P8(c);typeof t.cancel=="function"&&t.cancel(),I(i)},e);vEn(t.then(l,I),()=>{clearTimeout(a)})});q8.exports=ytt;q8.exports.default=ytt;q8.exports.TimeoutError=P8});var Ftt=f(FAe=>{"use strict";Object.defineProperty(FAe,"__esModule",{value:!0});function fEn(t,e,n){let l=0,I=t.length;for(;I>0;){let a=I/2|0,c=l+a;n(t[c],e)<=0?(l=++c,I-=a+1):I=a}return l}FAe.default=fEn});var vtt=f(fAe=>{"use strict";Object.defineProperty(fAe,"__esModule",{value:!0});var XEn=Ftt(),vAe=class{constructor(){this._queue=[]}enqueue(e,n){n=Object.assign({priority:0},n);let l={priority:n.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=n.priority){this._queue.push(l);return}let I=XEn.default(this._queue,l,(a,c)=>c.priority-a.priority);this._queue.splice(I,0,l)}dequeue(){let e=this._queue.shift();return e?.run}filter(e){return this._queue.filter(n=>n.priority===e.priority).map(n=>n.run)}get size(){return this._queue.length}};fAe.default=vAe});var jH=f(wAe=>{"use strict";Object.defineProperty(wAe,"__esModule",{value:!0});var wEn=AAe(),ftt=Att(),HEn=vtt(),$8=()=>{},QEn=new ftt.TimeoutError,XAe=class extends wEn{constructor(e){var n,l,I,a;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=$8,this._resolveIdle=$8,e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:HEn.default},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(l=(n=e.intervalCap)===null||n===void 0?void 0:n.toString())!==null&&l!==void 0?l:""}\` (${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 \`${(a=(I=e.interval)===null||I===void 0?void 0:I.toString())!==null&&a!==void 0?a:""}\` (${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._onResumeInterval()},n)),!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 n=this._queue.dequeue();return n?(this.emit("active"),n(),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,n={}){return new Promise((l,I)=>{let a=async()=>{this._pendingCount++,this._intervalCount++;try{let c=this._timeout===void 0&&n.timeout===void 0?e():ftt.default(Promise.resolve(e()),n.timeout===void 0?this._timeout:n.timeout,()=>{(n.throwOnTimeout===void 0?this._throwOnTimeout:n.throwOnTimeout)&&I(QEn)});l(await c)}catch(c){I(c)}this._next()};this._queue.enqueue(a,n),this._tryToStartAnother(),this.emit("add")})}async addAll(e,n){return Promise.all(e.map(async l=>this.add(l,n)))}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 n=this._resolveEmpty;this._resolveEmpty=()=>{n(),e()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(e=>{let n=this._resolveIdle;this._resolveIdle=()=>{n(),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}};wAe.default=XAe});var Xtt,e$,EEn,JEn,Wz,wtt=B(()=>{Xtt=$(CH(),1),e$=$(jH(),1);B8();EEn=[400,401,403,404,405,406,407,408],JEn=[409],Wz=class{constructor(e){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,this.debug=e.debug,"default"in e$.default?this.queue=new e$.default.default({concurrency:this.maxConcurrency}):this.queue=new e$.default({concurrency:this.maxConcurrency}),this.onFailedResponseHook=e?.onFailedResponseHook}call(e,...n){let l=this.onFailedResponseHook;return this.queue.add(()=>(0,Xtt.default)(()=>e(...n).catch(I=>{throw I instanceof Error?I:new Error(I)}),{async onFailedAttempt(I){if(I.message.startsWith("Cancel")||I.message.startsWith("TimeoutError")||I.message.startsWith("AbortError")||I?.code==="ECONNABORTED")throw I;let a=I?.response,c=a?.status;if(c){if(EEn.includes(+c))throw I;if(JEn.includes(+c))return;l&&await l(a)}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,n,...l){return e.signal?Promise.race([this.call(n,...l),new Promise((I,a)=>{e.signal?.addEventListener("abort",()=>{a(new Error("AbortError"))})})]):this.call(n,...l)}fetch(...e){return this.call(()=>qt(this.debug)(...e).then(n=>n.ok?n:Promise.reject(n)))}}});function HAe(t){return typeof t?._getType=="function"}function QAe(t){let e={type:t._getType(),data:{content:t.content}};return t?.additional_kwargs&&Object.keys(t.additional_kwargs).length>0&&(e.data.additional_kwargs={...t.additional_kwargs}),e}var Htt=B(()=>{});function vl(t,e){if(!CEn.test(t)){let n=e!==void 0?`Invalid UUID for ${e}: ${t}`:`Invalid UUID: ${t}`;throw new Error(n)}return t}var CEn,Qtt=B(()=>{CEn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});function t$(t){Ett[t]||(console.warn(t),Ett[t]=!0)}var Ett,EAe=B(()=>{Ett={}});var Nz=f((szI,Jtt)=>{"use strict";var LEn="2.0.0",kEn=Number.MAX_SAFE_INTEGER||9007199254740991,xEn=16,jEn=250,OEn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Jtt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:xEn,MAX_SAFE_BUILD_LENGTH:jEn,MAX_SAFE_INTEGER:kEn,RELEASE_TYPES:OEn,SEMVER_SPEC_VERSION:LEn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Vz=f((uzI,Ctt)=>{"use strict";var UEn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Ctt.exports=UEn});var Z5=f((UY,Ltt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:JAe,MAX_SAFE_BUILD_LENGTH:zEn,MAX_LENGTH:BEn}=Nz(),SEn=Vz();UY=Ltt.exports={};var MEn=UY.re=[],TEn=UY.safeRe=[],ft=UY.src=[],DEn=UY.safeSrc=[],Xt=UY.t={},KEn=0,CAe="[a-zA-Z0-9-]",_En=[["\\s",1],["\\d",BEn],[CAe,zEn]],PEn=t=>{for(let[e,n]of _En)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},fl=(t,e,n)=>{let l=PEn(e),I=KEn++;SEn(t,I,e),Xt[t]=I,ft[I]=e,DEn[I]=l,MEn[I]=new RegExp(e,n?"g":void 0),TEn[I]=new RegExp(l,n?"g":void 0)};fl("NUMERICIDENTIFIER","0|[1-9]\\d*");fl("NUMERICIDENTIFIERLOOSE","\\d+");fl("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${CAe}*`);fl("MAINVERSION",`(${ft[Xt.NUMERICIDENTIFIER]})\\.(${ft[Xt.NUMERICIDENTIFIER]})\\.(${ft[Xt.NUMERICIDENTIFIER]})`);fl("MAINVERSIONLOOSE",`(${ft[Xt.NUMERICIDENTIFIERLOOSE]})\\.(${ft[Xt.NUMERICIDENTIFIERLOOSE]})\\.(${ft[Xt.NUMERICIDENTIFIERLOOSE]})`);fl("PRERELEASEIDENTIFIER",`(?:${ft[Xt.NONNUMERICIDENTIFIER]}|${ft[Xt.NUMERICIDENTIFIER]})`);fl("PRERELEASEIDENTIFIERLOOSE",`(?:${ft[Xt.NONNUMERICIDENTIFIER]}|${ft[Xt.NUMERICIDENTIFIERLOOSE]})`);fl("PRERELEASE",`(?:-(${ft[Xt.PRERELEASEIDENTIFIER]}(?:\\.${ft[Xt.PRERELEASEIDENTIFIER]})*))`);fl("PRERELEASELOOSE",`(?:-?(${ft[Xt.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ft[Xt.PRERELEASEIDENTIFIERLOOSE]})*))`);fl("BUILDIDENTIFIER",`${CAe}+`);fl("BUILD",`(?:\\+(${ft[Xt.BUILDIDENTIFIER]}(?:\\.${ft[Xt.BUILDIDENTIFIER]})*))`);fl("FULLPLAIN",`v?${ft[Xt.MAINVERSION]}${ft[Xt.PRERELEASE]}?${ft[Xt.BUILD]}?`);fl("FULL",`^${ft[Xt.FULLPLAIN]}$`);fl("LOOSEPLAIN",`[v=\\s]*${ft[Xt.MAINVERSIONLOOSE]}${ft[Xt.PRERELEASELOOSE]}?${ft[Xt.BUILD]}?`);fl("LOOSE",`^${ft[Xt.LOOSEPLAIN]}$`);fl("GTLT","((?:<|>)?=?)");fl("XRANGEIDENTIFIERLOOSE",`${ft[Xt.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);fl("XRANGEIDENTIFIER",`${ft[Xt.NUMERICIDENTIFIER]}|x|X|\\*`);fl("XRANGEPLAIN",`[v=\\s]*(${ft[Xt.XRANGEIDENTIFIER]})(?:\\.(${ft[Xt.XRANGEIDENTIFIER]})(?:\\.(${ft[Xt.XRANGEIDENTIFIER]})(?:${ft[Xt.PRERELEASE]})?${ft[Xt.BUILD]}?)?)?`);fl("XRANGEPLAINLOOSE",`[v=\\s]*(${ft[Xt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ft[Xt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ft[Xt.XRANGEIDENTIFIERLOOSE]})(?:${ft[Xt.PRERELEASELOOSE]})?${ft[Xt.BUILD]}?)?)?`);fl("XRANGE",`^${ft[Xt.GTLT]}\\s*${ft[Xt.XRANGEPLAIN]}$`);fl("XRANGELOOSE",`^${ft[Xt.GTLT]}\\s*${ft[Xt.XRANGEPLAINLOOSE]}$`);fl("COERCEPLAIN",`(^|[^\\d])(\\d{1,${JAe}})(?:\\.(\\d{1,${JAe}}))?(?:\\.(\\d{1,${JAe}}))?`);fl("COERCE",`${ft[Xt.COERCEPLAIN]}(?:$|[^\\d])`);fl("COERCEFULL",ft[Xt.COERCEPLAIN]+`(?:${ft[Xt.PRERELEASE]})?(?:${ft[Xt.BUILD]})?(?:$|[^\\d])`);fl("COERCERTL",ft[Xt.COERCE],!0);fl("COERCERTLFULL",ft[Xt.COERCEFULL],!0);fl("LONETILDE","(?:~>?)");fl("TILDETRIM",`(\\s*)${ft[Xt.LONETILDE]}\\s+`,!0);UY.tildeTrimReplace="$1~";fl("TILDE",`^${ft[Xt.LONETILDE]}${ft[Xt.XRANGEPLAIN]}$`);fl("TILDELOOSE",`^${ft[Xt.LONETILDE]}${ft[Xt.XRANGEPLAINLOOSE]}$`);fl("LONECARET","(?:\\^)");fl("CARETTRIM",`(\\s*)${ft[Xt.LONECARET]}\\s+`,!0);UY.caretTrimReplace="$1^";fl("CARET",`^${ft[Xt.LONECARET]}${ft[Xt.XRANGEPLAIN]}$`);fl("CARETLOOSE",`^${ft[Xt.LONECARET]}${ft[Xt.XRANGEPLAINLOOSE]}$`);fl("COMPARATORLOOSE",`^${ft[Xt.GTLT]}\\s*(${ft[Xt.LOOSEPLAIN]})$|^$`);fl("COMPARATOR",`^${ft[Xt.GTLT]}\\s*(${ft[Xt.FULLPLAIN]})$|^$`);fl("COMPARATORTRIM",`(\\s*)${ft[Xt.GTLT]}\\s*(${ft[Xt.LOOSEPLAIN]}|${ft[Xt.XRANGEPLAIN]})`,!0);UY.comparatorTrimReplace="$1$2$3";fl("HYPHENRANGE",`^\\s*(${ft[Xt.XRANGEPLAIN]})\\s+-\\s+(${ft[Xt.XRANGEPLAIN]})\\s*$`);fl("HYPHENRANGELOOSE",`^\\s*(${ft[Xt.XRANGEPLAINLOOSE]})\\s+-\\s+(${ft[Xt.XRANGEPLAINLOOSE]})\\s*$`);fl("STAR","(<|>)?=?\\s*\\*");fl("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");fl("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var n$=f((dzI,ktt)=>{"use strict";var qEn=Object.freeze({loose:!0}),$En=Object.freeze({}),e1n=t=>t?typeof t!="object"?qEn:t:$En;ktt.exports=e1n});var LAe=f((GzI,Ott)=>{"use strict";var xtt=/^[0-9]+$/,jtt=(t,e)=>{let n=xtt.test(t),l=xtt.test(e);return n&&l&&(t=+t,e=+e),t===e?0:n&&!l?-1:l&&!n?1:tjtt(e,t);Ott.exports={compareIdentifiers:jtt,rcompareIdentifiers:t1n}});var nb=f((bzI,ztt)=>{"use strict";var l$=Vz(),{MAX_LENGTH:Utt,MAX_SAFE_INTEGER:I$}=Nz(),{safeRe:a$,t:r$}=Z5(),n1n=n$(),{compareIdentifiers:W5}=LAe(),kAe=class t{constructor(e,n){if(n=n1n(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.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>Utt)throw new TypeError(`version is longer than ${Utt} characters`);l$("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let l=e.trim().match(n.loose?a$[r$.LOOSE]:a$[r$.FULL]);if(!l)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>I$||this.major<0)throw new TypeError("Invalid major version");if(this.minor>I$||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>I$||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map(I=>{if(/^[0-9]+$/.test(I)){let a=+I;if(a>=0&&a=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(n===this.prerelease.join(".")&&l===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(I)}}if(n){let a=[n,I];l===!1&&(a=[n]),W5(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ztt.exports=kAe});var OH=f((mzI,Stt)=>{"use strict";var Btt=nb(),l1n=(t,e,n=!1)=>{if(t instanceof Btt)return t;try{return new Btt(t,e)}catch(l){if(!n)return null;throw l}};Stt.exports=l1n});var Ttt=f((pzI,Mtt)=>{"use strict";var I1n=OH(),a1n=(t,e)=>{let n=I1n(t,e);return n?n.version:null};Mtt.exports=a1n});var Ktt=f((hzI,Dtt)=>{"use strict";var r1n=OH(),c1n=(t,e)=>{let n=r1n(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};Dtt.exports=c1n});var qtt=f((ZzI,Ptt)=>{"use strict";var _tt=nb(),o1n=(t,e,n,l,I)=>{typeof n=="string"&&(I=l,l=n,n=void 0);try{return new _tt(t instanceof _tt?t.version:t,n).inc(e,l,I).version}catch{return null}};Ptt.exports=o1n});var tnt=f((WzI,ent)=>{"use strict";var $tt=OH(),i1n=(t,e)=>{let n=$tt(t,null,!0),l=$tt(e,null,!0),I=n.compare(l);if(I===0)return null;let a=I>0,c=a?n:l,i=a?l:n,s=!!c.prerelease.length;if(!!i.prerelease.length&&!s){if(!i.patch&&!i.minor)return"major";if(i.compareMain(c)===0)return i.minor&&!i.patch?"minor":"patch"}let u=s?"pre":"";return n.major!==l.major?u+"major":n.minor!==l.minor?u+"minor":n.patch!==l.patch?u+"patch":"prerelease"};ent.exports=i1n});var lnt=f((NzI,nnt)=>{"use strict";var s1n=nb(),u1n=(t,e)=>new s1n(t,e).major;nnt.exports=u1n});var ant=f((VzI,Int)=>{"use strict";var d1n=nb(),G1n=(t,e)=>new d1n(t,e).minor;Int.exports=G1n});var cnt=f((YzI,rnt)=>{"use strict";var b1n=nb(),m1n=(t,e)=>new b1n(t,e).patch;rnt.exports=m1n});var int=f((gzI,ont)=>{"use strict";var p1n=OH(),h1n=(t,e)=>{let n=p1n(t,e);return n&&n.prerelease.length?n.prerelease:null};ont.exports=h1n});var wZ=f((RzI,unt)=>{"use strict";var snt=nb(),Z1n=(t,e,n)=>new snt(t,n).compare(new snt(e,n));unt.exports=Z1n});var Gnt=f((yzI,dnt)=>{"use strict";var W1n=wZ(),N1n=(t,e,n)=>W1n(e,t,n);dnt.exports=N1n});var mnt=f((AzI,bnt)=>{"use strict";var V1n=wZ(),Y1n=(t,e)=>V1n(t,e,!0);bnt.exports=Y1n});var c$=f((FzI,hnt)=>{"use strict";var pnt=nb(),g1n=(t,e,n)=>{let l=new pnt(t,n),I=new pnt(e,n);return l.compare(I)||l.compareBuild(I)};hnt.exports=g1n});var Wnt=f((vzI,Znt)=>{"use strict";var R1n=c$(),y1n=(t,e)=>t.sort((n,l)=>R1n(n,l,e));Znt.exports=y1n});var Vnt=f((fzI,Nnt)=>{"use strict";var A1n=c$(),F1n=(t,e)=>t.sort((n,l)=>A1n(l,n,e));Nnt.exports=F1n});var Yz=f((XzI,Ynt)=>{"use strict";var v1n=wZ(),f1n=(t,e,n)=>v1n(t,e,n)>0;Ynt.exports=f1n});var o$=f((wzI,gnt)=>{"use strict";var X1n=wZ(),w1n=(t,e,n)=>X1n(t,e,n)<0;gnt.exports=w1n});var xAe=f((HzI,Rnt)=>{"use strict";var H1n=wZ(),Q1n=(t,e,n)=>H1n(t,e,n)===0;Rnt.exports=Q1n});var jAe=f((QzI,ynt)=>{"use strict";var E1n=wZ(),J1n=(t,e,n)=>E1n(t,e,n)!==0;ynt.exports=J1n});var i$=f((EzI,Ant)=>{"use strict";var C1n=wZ(),L1n=(t,e,n)=>C1n(t,e,n)>=0;Ant.exports=L1n});var s$=f((JzI,Fnt)=>{"use strict";var k1n=wZ(),x1n=(t,e,n)=>k1n(t,e,n)<=0;Fnt.exports=x1n});var OAe=f((CzI,vnt)=>{"use strict";var j1n=xAe(),O1n=jAe(),U1n=Yz(),z1n=i$(),B1n=o$(),S1n=s$(),M1n=(t,e,n,l)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return j1n(t,n,l);case"!=":return O1n(t,n,l);case">":return U1n(t,n,l);case">=":return z1n(t,n,l);case"<":return B1n(t,n,l);case"<=":return S1n(t,n,l);default:throw new TypeError(`Invalid operator: ${e}`)}};vnt.exports=M1n});var Xnt=f((LzI,fnt)=>{"use strict";var T1n=nb(),D1n=OH(),{safeRe:u$,t:d$}=Z5(),K1n=(t,e)=>{if(t instanceof T1n)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?u$[d$.COERCEFULL]:u$[d$.COERCE]);else{let s=e.includePrerelease?u$[d$.COERCERTLFULL]:u$[d$.COERCERTL],r;for(;(r=s.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||r.index+r[0].length!==n.index+n[0].length)&&(n=r),s.lastIndex=r.index+r[1].length+r[2].length;s.lastIndex=-1}if(n===null)return null;let l=n[2],I=n[3]||"0",a=n[4]||"0",c=e.includePrerelease&&n[5]?`-${n[5]}`:"",i=e.includePrerelease&&n[6]?`+${n[6]}`:"";return D1n(`${l}.${I}.${a}${c}${i}`,e)};fnt.exports=K1n});var Hnt=f((kzI,wnt)=>{"use strict";var UAe=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let I=this.map.keys().next().value;this.delete(I)}this.map.set(e,n)}return this}};wnt.exports=UAe});var HZ=f((xzI,Cnt)=>{"use strict";var _1n=/\s+/g,zAe=class t{constructor(e,n){if(n=q1n(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof BAe)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(_1n," "),this.set=this.raw.split("||").map(l=>this.parseRange(l.trim())).filter(l=>l.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let l=this.set[0];if(this.set=this.set.filter(I=>!Ent(I[0])),this.set.length===0)this.set=[l];else if(this.set.length>1){for(let I of this.set)if(I.length===1&&aJn(I[0])){this.set=[I];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let n=this.set[e];for(let l=0;l0&&(this.formatted+=" "),this.formatted+=n[l].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let l=((this.options.includePrerelease&&lJn)|(this.options.loose&&IJn))+":"+e,I=Qnt.get(l);if(I)return I;let a=this.options.loose,c=a?Sm[rm.HYPHENRANGELOOSE]:Sm[rm.HYPHENRANGE];e=e.replace(c,mJn(this.options.includePrerelease)),Ac("hyphen replace",e),e=e.replace(Sm[rm.COMPARATORTRIM],eJn),Ac("comparator trim",e),e=e.replace(Sm[rm.TILDETRIM],tJn),Ac("tilde trim",e),e=e.replace(Sm[rm.CARETTRIM],nJn),Ac("caret trim",e);let i=e.split(" ").map(o=>rJn(o,this.options)).join(" ").split(/\s+/).map(o=>bJn(o,this.options));a&&(i=i.filter(o=>(Ac("loose invalid filter",o,this.options),!!o.match(Sm[rm.COMPARATORLOOSE])))),Ac("range list",i);let s=new Map,r=i.map(o=>new BAe(o,this.options));for(let o of r){if(Ent(o))return[o];s.set(o.value,o)}s.size>1&&s.has("")&&s.delete("");let u=[...s.values()];return Qnt.set(l,u),u}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(l=>Jnt(l,n)&&e.set.some(I=>Jnt(I,n)&&l.every(a=>I.every(c=>a.intersects(c,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new $1n(e,this.options)}catch{return!1}for(let n=0;nt.value==="<0.0.0-0",aJn=t=>t.value==="",Jnt=(t,e)=>{let n=!0,l=t.slice(),I=l.pop();for(;n&&l.length;)n=l.every(a=>I.intersects(a,e)),I=l.pop();return n},rJn=(t,e)=>(Ac("comp",t,e),t=iJn(t,e),Ac("caret",t),t=cJn(t,e),Ac("tildes",t),t=uJn(t,e),Ac("xrange",t),t=GJn(t,e),Ac("stars",t),t),cm=t=>!t||t.toLowerCase()==="x"||t==="*",cJn=(t,e)=>t.trim().split(/\s+/).map(n=>oJn(n,e)).join(" "),oJn=(t,e)=>{let n=e.loose?Sm[rm.TILDELOOSE]:Sm[rm.TILDE];return t.replace(n,(l,I,a,c,i)=>{Ac("tilde",t,l,I,a,c,i);let s;return cm(I)?s="":cm(a)?s=`>=${I}.0.0 <${+I+1}.0.0-0`:cm(c)?s=`>=${I}.${a}.0 <${I}.${+a+1}.0-0`:i?(Ac("replaceTilde pr",i),s=`>=${I}.${a}.${c}-${i} <${I}.${+a+1}.0-0`):s=`>=${I}.${a}.${c} <${I}.${+a+1}.0-0`,Ac("tilde return",s),s})},iJn=(t,e)=>t.trim().split(/\s+/).map(n=>sJn(n,e)).join(" "),sJn=(t,e)=>{Ac("caret",t,e);let n=e.loose?Sm[rm.CARETLOOSE]:Sm[rm.CARET],l=e.includePrerelease?"-0":"";return t.replace(n,(I,a,c,i,s)=>{Ac("caret",t,I,a,c,i,s);let r;return cm(a)?r="":cm(c)?r=`>=${a}.0.0${l} <${+a+1}.0.0-0`:cm(i)?a==="0"?r=`>=${a}.${c}.0${l} <${a}.${+c+1}.0-0`:r=`>=${a}.${c}.0${l} <${+a+1}.0.0-0`:s?(Ac("replaceCaret pr",s),a==="0"?c==="0"?r=`>=${a}.${c}.${i}-${s} <${a}.${c}.${+i+1}-0`:r=`>=${a}.${c}.${i}-${s} <${a}.${+c+1}.0-0`:r=`>=${a}.${c}.${i}-${s} <${+a+1}.0.0-0`):(Ac("no pr"),a==="0"?c==="0"?r=`>=${a}.${c}.${i}${l} <${a}.${c}.${+i+1}-0`:r=`>=${a}.${c}.${i}${l} <${a}.${+c+1}.0-0`:r=`>=${a}.${c}.${i} <${+a+1}.0.0-0`),Ac("caret return",r),r})},uJn=(t,e)=>(Ac("replaceXRanges",t,e),t.split(/\s+/).map(n=>dJn(n,e)).join(" ")),dJn=(t,e)=>{t=t.trim();let n=e.loose?Sm[rm.XRANGELOOSE]:Sm[rm.XRANGE];return t.replace(n,(l,I,a,c,i,s)=>{Ac("xRange",t,l,I,a,c,i,s);let r=cm(a),u=r||cm(c),o=u||cm(i),d=o;return I==="="&&d&&(I=""),s=e.includePrerelease?"-0":"",r?I===">"||I==="<"?l="<0.0.0-0":l="*":I&&d?(u&&(c=0),i=0,I===">"?(I=">=",u?(a=+a+1,c=0,i=0):(c=+c+1,i=0)):I==="<="&&(I="<",u?a=+a+1:c=+c+1),I==="<"&&(s="-0"),l=`${I+a}.${c}.${i}${s}`):u?l=`>=${a}.0.0${s} <${+a+1}.0.0-0`:o&&(l=`>=${a}.${c}.0${s} <${a}.${+c+1}.0-0`),Ac("xRange return",l),l})},GJn=(t,e)=>(Ac("replaceStars",t,e),t.trim().replace(Sm[rm.STAR],"")),bJn=(t,e)=>(Ac("replaceGTE0",t,e),t.trim().replace(Sm[e.includePrerelease?rm.GTE0PRE:rm.GTE0],"")),mJn=t=>(e,n,l,I,a,c,i,s,r,u,o,d)=>(cm(l)?n="":cm(I)?n=`>=${l}.0.0${t?"-0":""}`:cm(a)?n=`>=${l}.${I}.0${t?"-0":""}`:c?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,cm(r)?s="":cm(u)?s=`<${+r+1}.0.0-0`:cm(o)?s=`<${r}.${+u+1}.0-0`:d?s=`<=${r}.${u}.${o}-${d}`:t?s=`<${r}.${u}.${+o+1}-0`:s=`<=${s}`,`${n} ${s}`.trim()),pJn=(t,e,n)=>{for(let l=0;l0){let I=t[l].semver;if(I.major===e.major&&I.minor===e.minor&&I.patch===e.patch)return!0}return!1}return!0}});var gz=f((jzI,Unt)=>{"use strict";var Rz=Symbol("SemVer ANY"),TAe=class t{static get ANY(){return Rz}constructor(e,n){if(n=Lnt(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),MAe("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===Rz?this.value="":this.value=this.operator+this.semver.version,MAe("comp",this)}parse(e){let n=this.options.loose?knt[xnt.COMPARATORLOOSE]:knt[xnt.COMPARATOR],l=e.match(n);if(!l)throw new TypeError(`Invalid comparator: ${e}`);this.operator=l[1]!==void 0?l[1]:"",this.operator==="="&&(this.operator=""),l[2]?this.semver=new jnt(l[2],this.options.loose):this.semver=Rz}toString(){return this.value}test(e){if(MAe("Comparator.test",e,this.options.loose),this.semver===Rz||e===Rz)return!0;if(typeof e=="string")try{e=new jnt(e,this.options)}catch{return!1}return SAe(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Ont(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new Ont(this.value,n).test(e.semver):(n=Lnt(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.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("=")||SAe(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||SAe(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Unt.exports=TAe;var Lnt=n$(),{safeRe:knt,t:xnt}=Z5(),SAe=OAe(),MAe=Vz(),jnt=nb(),Ont=HZ()});var yz=f((OzI,znt)=>{"use strict";var hJn=HZ(),ZJn=(t,e,n)=>{try{e=new hJn(e,n)}catch{return!1}return e.test(t)};znt.exports=ZJn});var Snt=f((UzI,Bnt)=>{"use strict";var WJn=HZ(),NJn=(t,e)=>new WJn(t,e).set.map(n=>n.map(l=>l.value).join(" ").trim().split(" "));Bnt.exports=NJn});var Tnt=f((zzI,Mnt)=>{"use strict";var VJn=nb(),YJn=HZ(),gJn=(t,e,n)=>{let l=null,I=null,a=null;try{a=new YJn(e,n)}catch{return null}return t.forEach(c=>{a.test(c)&&(!l||I.compare(c)===-1)&&(l=c,I=new VJn(l,n))}),l};Mnt.exports=gJn});var Knt=f((BzI,Dnt)=>{"use strict";var RJn=nb(),yJn=HZ(),AJn=(t,e,n)=>{let l=null,I=null,a=null;try{a=new yJn(e,n)}catch{return null}return t.forEach(c=>{a.test(c)&&(!l||I.compare(c)===1)&&(l=c,I=new RJn(l,n))}),l};Dnt.exports=AJn});var qnt=f((SzI,Pnt)=>{"use strict";var DAe=nb(),FJn=HZ(),_nt=Yz(),vJn=(t,e)=>{t=new FJn(t,e);let n=new DAe("0.0.0");if(t.test(n)||(n=new DAe("0.0.0-0"),t.test(n)))return n;n=null;for(let l=0;l{let i=new DAe(c.semver.version);switch(c.operator){case">":i.prerelease.length===0?i.patch++:i.prerelease.push(0),i.raw=i.format();case"":case">=":(!a||_nt(i,a))&&(a=i);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),a&&(!n||_nt(n,a))&&(n=a)}return n&&t.test(n)?n:null};Pnt.exports=vJn});var elt=f((MzI,$nt)=>{"use strict";var fJn=HZ(),XJn=(t,e)=>{try{return new fJn(t,e).range||"*"}catch{return null}};$nt.exports=XJn});var G$=f((TzI,Ilt)=>{"use strict";var wJn=nb(),llt=gz(),{ANY:HJn}=llt,QJn=HZ(),EJn=yz(),tlt=Yz(),nlt=o$(),JJn=s$(),CJn=i$(),LJn=(t,e,n,l)=>{t=new wJn(t,l),e=new QJn(e,l);let I,a,c,i,s;switch(n){case">":I=tlt,a=JJn,c=nlt,i=">",s=">=";break;case"<":I=nlt,a=CJn,c=tlt,i="<",s="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(EJn(t,e,l))return!1;for(let r=0;r{b.semver===HJn&&(b=new llt(">=0.0.0")),o=o||b,d=d||b,I(b.semver,o.semver,l)?o=b:c(b.semver,d.semver,l)&&(d=b)}),o.operator===i||o.operator===s||(!d.operator||d.operator===i)&&a(t,d.semver))return!1;if(d.operator===s&&c(t,d.semver))return!1}return!0};Ilt.exports=LJn});var rlt=f((DzI,alt)=>{"use strict";var kJn=G$(),xJn=(t,e,n)=>kJn(t,e,">",n);alt.exports=xJn});var olt=f((KzI,clt)=>{"use strict";var jJn=G$(),OJn=(t,e,n)=>jJn(t,e,"<",n);clt.exports=OJn});var ult=f((_zI,slt)=>{"use strict";var ilt=HZ(),UJn=(t,e,n)=>(t=new ilt(t,n),e=new ilt(e,n),t.intersects(e,n));slt.exports=UJn});var Glt=f((PzI,dlt)=>{"use strict";var zJn=yz(),BJn=wZ();dlt.exports=(t,e,n)=>{let l=[],I=null,a=null,c=t.sort((u,o)=>BJn(u,o,n));for(let u of c)zJn(u,e,n)?(a=u,I||(I=u)):(a&&l.push([I,a]),a=null,I=null);I&&l.push([I,null]);let i=[];for(let[u,o]of l)u===o?i.push(u):!o&&u===c[0]?i.push("*"):o?u===c[0]?i.push(`<=${o}`):i.push(`${u} - ${o}`):i.push(`>=${u}`);let s=i.join(" || "),r=typeof e.raw=="string"?e.raw:String(e);return s.length{"use strict";var blt=HZ(),_Ae=gz(),{ANY:KAe}=_Ae,Az=yz(),PAe=wZ(),SJn=(t,e,n={})=>{if(t===e)return!0;t=new blt(t,n),e=new blt(e,n);let l=!1;e:for(let I of t.set){for(let a of e.set){let c=TJn(I,a,n);if(l=l||c!==null,c)continue e}if(l)return!1}return!0},MJn=[new _Ae(">=0.0.0-0")],mlt=[new _Ae(">=0.0.0")],TJn=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===KAe){if(e.length===1&&e[0].semver===KAe)return!0;n.includePrerelease?t=MJn:t=mlt}if(e.length===1&&e[0].semver===KAe){if(n.includePrerelease)return!0;e=mlt}let l=new Set,I,a;for(let b of t)b.operator===">"||b.operator===">="?I=plt(I,b,n):b.operator==="<"||b.operator==="<="?a=hlt(a,b,n):l.add(b.semver);if(l.size>1)return null;let c;if(I&&a){if(c=PAe(I.semver,a.semver,n),c>0)return null;if(c===0&&(I.operator!==">="||a.operator!=="<="))return null}for(let b of l){if(I&&!Az(b,String(I),n)||a&&!Az(b,String(a),n))return null;for(let h of e)if(!Az(b,String(h),n))return!1;return!0}let i,s,r,u,o=a&&!n.includePrerelease&&a.semver.prerelease.length?a.semver:!1,d=I&&!n.includePrerelease&&I.semver.prerelease.length?I.semver:!1;o&&o.prerelease.length===1&&a.operator==="<"&&o.prerelease[0]===0&&(o=!1);for(let b of e){if(u=u||b.operator===">"||b.operator===">=",r=r||b.operator==="<"||b.operator==="<=",I){if(d&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===d.major&&b.semver.minor===d.minor&&b.semver.patch===d.patch&&(d=!1),b.operator===">"||b.operator===">="){if(i=plt(I,b,n),i===b&&i!==I)return!1}else if(I.operator===">="&&!Az(I.semver,String(b),n))return!1}if(a){if(o&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===o.major&&b.semver.minor===o.minor&&b.semver.patch===o.patch&&(o=!1),b.operator==="<"||b.operator==="<="){if(s=hlt(a,b,n),s===b&&s!==a)return!1}else if(a.operator==="<="&&!Az(a.semver,String(b),n))return!1}if(!b.operator&&(a||I)&&c!==0)return!1}return!(I&&r&&!a&&c!==0||a&&u&&!I&&c!==0||d||o)},plt=(t,e,n)=>{if(!t)return e;let l=PAe(t.semver,e.semver,n);return l>0?t:l<0||e.operator===">"&&t.operator===">="?e:t},hlt=(t,e,n)=>{if(!t)return e;let l=PAe(t.semver,e.semver,n);return l<0?t:l>0||e.operator==="<"&&t.operator==="<="?e:t};Zlt.exports=SJn});var N5=f(($zI,Ylt)=>{"use strict";var qAe=Z5(),Nlt=Nz(),DJn=nb(),Vlt=LAe(),KJn=OH(),_Jn=Ttt(),PJn=Ktt(),qJn=qtt(),$Jn=tnt(),eCn=lnt(),tCn=ant(),nCn=cnt(),lCn=int(),ICn=wZ(),aCn=Gnt(),rCn=mnt(),cCn=c$(),oCn=Wnt(),iCn=Vnt(),sCn=Yz(),uCn=o$(),dCn=xAe(),GCn=jAe(),bCn=i$(),mCn=s$(),pCn=OAe(),hCn=Xnt(),ZCn=gz(),WCn=HZ(),NCn=yz(),VCn=Snt(),YCn=Tnt(),gCn=Knt(),RCn=qnt(),yCn=elt(),ACn=G$(),FCn=rlt(),vCn=olt(),fCn=ult(),XCn=Glt(),wCn=Wlt();Ylt.exports={parse:KJn,valid:_Jn,clean:PJn,inc:qJn,diff:$Jn,major:eCn,minor:tCn,patch:nCn,prerelease:lCn,compare:ICn,rcompare:aCn,compareLoose:rCn,compareBuild:cCn,sort:oCn,rsort:iCn,gt:sCn,lt:uCn,eq:dCn,neq:GCn,gte:bCn,lte:mCn,cmp:pCn,coerce:hCn,Comparator:ZCn,Range:WCn,satisfies:NCn,toComparators:VCn,maxSatisfying:YCn,minSatisfying:gCn,minVersion:RCn,validRange:yCn,outside:ACn,gtr:FCn,ltr:vCn,intersects:fCn,simplifyRange:XCn,subset:wCn,SemVer:DJn,re:qAe.re,src:qAe.src,tokens:qAe.t,SEMVER_SPEC_VERSION:Nlt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Nlt.RELEASE_TYPES,compareIdentifiers:Vlt.compareIdentifiers,rcompareIdentifiers:Vlt.rcompareIdentifiers}});function wy(t){if(!t||t.split("/").length>2||t.startsWith("/")||t.endsWith("/")||t.split(":").length>2)throw new Error(`Invalid identifier format: ${t}`);let[e,n]=t.split(":"),l=n||"latest";if(e.includes("/")){let[I,a]=e.split("/",2);if(!I||!a)throw new Error(`Invalid identifier format: ${t}`);return[I,a,l]}else{if(!e)throw new Error(`Invalid identifier format: ${t}`);return["-",e,l]}}var HCn,glt=B(()=>{HCn=$(N5(),1)});async function Ll(t,e,n){let l;if(t.ok){n&&(l=await t.text());return}l=await t.text();let I=`Failed to ${e}. Received status [${t.status}]: ${t.statusText}. Server response: ${l}`;if(t.status===409)throw new $Ae(I);let a=new Error(I);throw a.status=t.status,a}function ylt(t){return typeof t=="object"&&t!==null&&t.code===Rlt}var $Ae,Rlt,b$,e0e=B(()=>{$Ae=class extends Error{constructor(e){super(e),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithConflictError",this.status=409}};Rlt="ERR_CONFLICTING_ENDPOINTS",b$=class extends Error{constructor(){super("You cannot provide both LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT and LANGSMITH_RUNS_ENDPOINTS."),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:Rlt}),this.name="ConflictingEndpointsError"}}});function JCn(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function m$(t){return ECn.encode(t)}function Flt(t){if(t&&typeof t=="object"&&t!==null){if(t instanceof Map)return Object.fromEntries(t);if(t instanceof Set)return Array.from(t);if(t instanceof Date)return t.toISOString();if(t instanceof RegExp)return t.toString();if(t instanceof Error)return{name:t.name,message:t.message}}else if(typeof t=="bigint")return t.toString();return t}function CCn(t){return function(e,n){if(t){let l=t.call(this,e,n);if(l!==void 0)return l}return Flt(n)}}function Mm(t,e,n,l,I){try{let a=JSON.stringify(t,CCn(n),l);return m$(a)}catch(a){if(!a.message?.includes("Converting circular structure to JSON"))return console.warn(`[WARNING]: LangSmith received unserializable value.${e?` +Context: ${e}`:""}`),m$("[Unserializable]");hd("SUPPRESS_CIRCULAR_JSON_WARNINGS")!=="true"&&console.warn(`[WARNING]: LangSmith received circular JSON. This will decrease tracer performance. ${e?` +Context: ${e}`:""}`),typeof I>"u"&&(I=JCn()),n0e(t,"",0,[],void 0,0,I);let c;try{V5.length===0?c=JSON.stringify(t,n,l):c=JSON.stringify(t,LCn(n),l)}catch{return m$("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;p$.length!==0;){let i=p$.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return m$(c)}}function t0e(t,e,n,l){var I=Object.getOwnPropertyDescriptor(l,n);I.get!==void 0?I.configurable?(Object.defineProperty(l,n,{value:t}),p$.push([l,n,e,I])):V5.push([e,n,t]):(l[n]=t,p$.push([l,n,e]))}function n0e(t,e,n,l,I,a,c){a+=1;var i;if(typeof t=="object"&&t!==null){for(i=0;ic.depthLimit){t0e(Alt,t,e,I);return}if(typeof c.edgesLimit<"u"&&n+1>c.edgesLimit){t0e(Alt,t,e,I);return}if(l.push(t),Array.isArray(t))for(i=0;i0)for(var l=0;l{fy();Alt="[...]",QCn={result:"[Circular]"},p$=[],V5=[],ECn=new TextEncoder});function flt(t){let e=T8(),n=htt(),l=t.extra??{},I=l.metadata;return t.extra={...l,runtime:{...e,...l?.runtime},metadata:{...n,...n.revision_id||t.revision_id?{revision_id:t.revision_id??n.revision_id}:{},...I}},t}async function jCn(t){let e=[];for await(let n of t)e.push(n);return e}function l0e(t){if(t!==void 0)return t.trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}function Xlt(t){return typeof t=="number"?Number(t.toFixed(4)):t}function Hlt(t){return"dataset_id"in t||"dataset_name"in t}var kCn,xCn,OCn,I0e,UCn,zCn,wlt,wN,GAe=B(()=>{uG();Vtt();RAe();wtt();Htt();fy();M8();Qtt();EAe();glt();e0e();B8();vlt();kCn=t=>{let e=t?.toString()??hd("TRACING_SAMPLING_RATE");if(e===void 0)return;let n=parseFloat(e);if(n<0||n>1)throw new Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${n}`);return n},xCn=t=>{let n=t.replace("http://","").replace("https://","").split("/")[0].split(":")[0];return n==="localhost"||n==="127.0.0.1"||n==="::1"};OCn=async t=>{if(t?.status===429){let e=parseInt(t.headers.get("retry-after")??"30",10)*1e3;if(e>0)return await new Promise(n=>setTimeout(n,e)),!0}return!1};I0e=class{constructor(){Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0})}peek(){return this.items[0]}push(e){let n,l=new Promise(a=>{n=a}),I=Mm(e.item,`Serializing run with id: ${e.item.id}`).length;return this.items.push({action:e.action,payload:e.item,otelContext:e.otelContext,apiKey:e.apiKey,apiUrl:e.apiUrl,itemPromiseResolve:n,itemPromise:l,size:I}),this.sizeBytes+=I,l}pop(e){if(e<1)throw new Error("Number of bytes to pop off may not be less than 1.");let n=[],l=0;for(;l+(this.peek()?.size??0)0;){let I=this.items.shift();I&&(n.push(I),l+=I.size,this.sizeBytes-=I.size)}if(n.length===0&&this.items.length>0){let I=this.items.shift();n.push(I),l+=I.size,this.sizeBytes-=I.size}return[n.map(I=>({action:I.action,item:I.payload,otelContext:I.otelContext,apiKey:I.apiKey,apiUrl:I.apiUrl})),()=>n.forEach(I=>I.itemPromiseResolve())]}},UCn=20971520,zCn=2500,wlt="https://api.smith.langchain.com",wN=class t{constructor(e={}){Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"webUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchIngestCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout_ms",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tenantId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingSampleRate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filteredPostUuids",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"autoBatchTracing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"autoBatchQueue",{enumerable:!0,configurable:!0,writable:!0,value:new I0e}),Object.defineProperty(this,"autoBatchTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"autoBatchAggregationDelayMs",{enumerable:!0,configurable:!0,writable:!0,value:250}),Object.defineProperty(this,"batchSizeBytesLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"blockOnRootRunFinalization",{enumerable:!0,configurable:!0,writable:!0,value:Im("LANGSMITH_TRACING_BACKGROUND")==="false"}),Object.defineProperty(this,"traceBatchConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(this,"_serverInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_getServerInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"manualFlushMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"langSmithToOTELTranslator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"multipartStreamingDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:Im("LANGSMITH_DEBUG")==="true"});let n=t.getDefaultClientConfig();if(this.tracingSampleRate=kCn(e.tracingSamplingRate),this.apiUrl=l0e(e.apiUrl??n.apiUrl)??"",this.apiUrl.endsWith("/")&&(this.apiUrl=this.apiUrl.slice(0,-1)),this.apiKey=l0e(e.apiKey??n.apiKey),this.webUrl=l0e(e.webUrl??n.webUrl),this.webUrl?.endsWith("/")&&(this.webUrl=this.webUrl.slice(0,-1)),this.timeout_ms=e.timeout_ms??9e4,this.caller=new Wz({...e.callerOptions??{},debug:e.debug??this.debug}),this.traceBatchConcurrency=e.traceBatchConcurrency??this.traceBatchConcurrency,this.traceBatchConcurrency<1)throw new Error("Trace batch concurrency must be positive.");this.debug=e.debug??this.debug,this.batchIngestCaller=new Wz({maxRetries:2,maxConcurrency:this.traceBatchConcurrency,...e.callerOptions??{},onFailedResponseHook:OCn,debug:e.debug??this.debug}),this.hideInputs=e.hideInputs??e.anonymizer??n.hideInputs,this.hideOutputs=e.hideOutputs??e.anonymizer??n.hideOutputs,this.autoBatchTracing=e.autoBatchTracing??this.autoBatchTracing,this.blockOnRootRunFinalization=e.blockOnRootRunFinalization??this.blockOnRootRunFinalization,this.batchSizeBytesLimit=e.batchSizeBytesLimit,this.fetchOptions=e.fetchOptions||{},this.manualFlushMode=e.manualFlushMode??this.manualFlushMode,Im("OTEL_ENABLED")==="true"&&(this.langSmithToOTELTranslator=new K8)}static getDefaultClientConfig(){let e=hd("API_KEY"),n=hd("ENDPOINT")??wlt,l=hd("HIDE_INPUTS")==="true",I=hd("HIDE_OUTPUTS")==="true";return{apiUrl:n,apiKey:e,webUrl:void 0,hideInputs:l,hideOutputs:I}}getHostUrl(){return this.webUrl?this.webUrl:xCn(this.apiUrl)?(this.webUrl="http://localhost:3000",this.webUrl):this.apiUrl.endsWith("/api/v1")?(this.webUrl=this.apiUrl.replace("/api/v1",""),this.webUrl):this.apiUrl.includes("/api")&&!this.apiUrl.split(".",1)[0].endsWith("api")?(this.webUrl=this.apiUrl.replace("/api",""),this.webUrl):this.apiUrl.split(".",1)[0].includes("dev")?(this.webUrl="https://dev.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("eu")?(this.webUrl="https://eu.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("beta")?(this.webUrl="https://beta.smith.langchain.com",this.webUrl):(this.webUrl="https://smith.langchain.com",this.webUrl)}get headers(){let e={"User-Agent":`langsmith-js/${S8}`};return this.apiKey&&(e["x-api-key"]=`${this.apiKey}`),e}_getPlatformEndpointPath(e){return this.apiUrl.slice(-3)!=="/v1"&&this.apiUrl.slice(-4)!=="/v1/"?`/v1/platform/${e}`:`/platform/${e}`}async processInputs(e){return this.hideInputs===!1?e:this.hideInputs===!0?{}:typeof this.hideInputs=="function"?this.hideInputs(e):e}async processOutputs(e){return this.hideOutputs===!1?e:this.hideOutputs===!0?{}:typeof this.hideOutputs=="function"?this.hideOutputs(e):e}async prepareRunCreateOrUpdateInputs(e){let n={...e};return n.inputs!==void 0&&(n.inputs=await this.processInputs(n.inputs)),n.outputs!==void 0&&(n.outputs=await this.processOutputs(n.outputs)),n}async _getResponse(e,n){let l=n?.toString()??"",I=`${this.apiUrl}${e}?${l}`,a=await this.caller.call(qt(this.debug),I,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(a,`Failed to fetch ${e}`),a}async _get(e,n){return(await this._getResponse(e,n)).json()}async*_getPaginated(e,n=new URLSearchParams,l){let I=Number(n.get("offset"))||0,a=Number(n.get("limit"))||100;for(;;){n.set("offset",String(I)),n.set("limit",String(a));let c=`${this.apiUrl}${e}?${n}`,i=await this.caller.call(qt(this.debug),c,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(i,`Failed to fetch ${e}`);let s=l?l(await i.json()):await i.json();if(s.length===0||(yield s,s.length0;){let[l,I]=this.autoBatchQueue.pop(e);if(!l.length){I();break}let a=l.reduce((s,r)=>{let u=r.apiUrl??this.apiUrl,o=r.apiKey??this.apiKey,b=r.apiKey===this.apiKey&&r.apiUrl===this.apiUrl?"default":`${u}|${o}`;return s[b]||(s[b]=[]),s[b].push(r),s},{}),c=[];for(let[s,r]of Object.entries(a)){let u=this._processBatch(r,{apiUrl:s==="default"?void 0:s.split("|")[0],apiKey:s==="default"?void 0:s.split("|")[1]});c.push(u)}let i=Promise.all(c).finally(I);n.push(i)}return Promise.all(n)}async _processBatch(e,n){if(e.length)try{if(this.langSmithToOTELTranslator!==void 0)this._sendBatchToOTELTranslator(e);else{let l={runCreates:e.filter(a=>a.action==="create").map(a=>a.item),runUpdates:e.filter(a=>a.action==="update").map(a=>a.item)};(await this._ensureServerInfo())?.batch_ingest_config?.use_multipart_endpoint?await this.multipartIngestRuns(l,n):await this.batchIngestRuns(l,n)}}catch(l){console.error("Error exporting batch:",l)}}_sendBatchToOTELTranslator(e){if(this.langSmithToOTELTranslator!==void 0){let n=new Map,l=[];for(let I of e)I.item.id&&I.otelContext&&(n.set(I.item.id,I.otelContext),I.action==="create"?l.push({operation:"post",id:I.item.id,trace_id:I.item.trace_id??I.item.id,run:I.item}):l.push({operation:"patch",id:I.item.id,trace_id:I.item.trace_id??I.item.id,run:I.item}));this.langSmithToOTELTranslator.exportBatch(l,n)}}async processRunOperation(e){clearTimeout(this.autoBatchTimeout),this.autoBatchTimeout=void 0,e.action==="create"&&(e.item=flt(e.item));let n=this.autoBatchQueue.push(e);if(this.manualFlushMode)return n;let l=await this._getBatchSizeLimitBytes();return this.autoBatchQueue.sizeBytes>l&&this.drainAutoBatchQueue(l),this.autoBatchQueue.items.length>0&&(this.autoBatchTimeout=setTimeout(()=>{this.autoBatchTimeout=void 0,this.drainAutoBatchQueue(l)},this.autoBatchAggregationDelayMs)),n}async _getServerInfo(){let e=await this.caller.call(qt(this.debug),`${this.apiUrl}/info`,{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(zCn),...this.fetchOptions});await Ll(e,"get server info");let n=await e.json();return this.debug&&console.log(` +=== LangSmith Server Configuration === +`+JSON.stringify(n,null,2)+` +`),n}async _ensureServerInfo(){return this._getServerInfoPromise===void 0&&(this._getServerInfoPromise=(async()=>{if(this._serverInfo===void 0)try{this._serverInfo=await this._getServerInfo()}catch(e){console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations with status code ${e.status}. Falling back to batch operations and default limits.`)}return this._serverInfo??{}})()),this._getServerInfoPromise.then(e=>(this._serverInfo===void 0&&(this._getServerInfoPromise=void 0),e))}async _getSettings(){return this.settings||(this.settings=this._get("/settings")),await this.settings}async flush(){let e=await this._getBatchSizeLimitBytes();await this.drainAutoBatchQueue(e)}_cloneCurrentOTELContext(){let e=D8(),n=Wtt();if(this.langSmithToOTELTranslator!==void 0){let l=e.getActiveSpan();if(l)return e.setSpan(n.active(),l)}}async createRun(e,n){if(!this._filterForSampling([e]).length)return;let l={...this.headers,"Content-Type":"application/json"},I=e.project_name;delete e.project_name;let a=await this.prepareRunCreateOrUpdateInputs({session_name:I,...e,start_time:e.start_time??Date.now()});if(this.autoBatchTracing&&a.trace_id!==void 0&&a.dotted_order!==void 0){let s=this._cloneCurrentOTELContext();this.processRunOperation({action:"create",item:a,otelContext:s,apiKey:n?.apiKey,apiUrl:n?.apiUrl}).catch(console.error);return}let c=flt(a);n?.apiKey!==void 0&&(l["x-api-key"]=n.apiKey);let i=await this.caller.call(qt(this.debug),`${n?.apiUrl??this.apiUrl}/runs`,{method:"POST",headers:l,body:Mm(c,`Creating run with id: ${c.id}`),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(i,"create run",!0)}async batchIngestRuns({runCreates:e,runUpdates:n},l){if(e===void 0&&n===void 0)return;let I=await Promise.all(e?.map(s=>this.prepareRunCreateOrUpdateInputs(s))??[]),a=await Promise.all(n?.map(s=>this.prepareRunCreateOrUpdateInputs(s))??[]);if(I.length>0&&a.length>0){let s=I.reduce((u,o)=>(o.id&&(u[o.id]=o),u),{}),r=[];for(let u of a)u.id!==void 0&&s[u.id]?s[u.id]={...s[u.id],...u}:r.push(u);I=Object.values(s),a=r}let c={post:I,patch:a};if(!c.post.length&&!c.patch.length)return;let i={post:[],patch:[]};for(let s of["post","patch"]){let r=s,u=c[r].reverse(),o=u.pop();for(;o!==void 0;)i[r].push(o),o=u.pop()}if(i.post.length>0||i.patch.length>0){let s=i.post.map(r=>r.id).concat(i.patch.map(r=>r.id)).join(",");await this._postBatchIngestRuns(Mm(i,`Ingesting runs with ids: ${s}`),l)}}async _postBatchIngestRuns(e,n){let l={...this.headers,"Content-Type":"application/json",Accept:"application/json"};n?.apiKey!==void 0&&(l["x-api-key"]=n.apiKey);let I=await this.batchIngestCaller.call(qt(this.debug),`${n?.apiUrl??this.apiUrl}/runs/batch`,{method:"POST",headers:l,body:e,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(I,"batch create run",!0)}async multipartIngestRuns({runCreates:e,runUpdates:n},l){if(e===void 0&&n===void 0)return;let I={},a=[];for(let o of e??[]){let d=await this.prepareRunCreateOrUpdateInputs(o);d.id!==void 0&&d.attachments!==void 0&&(I[d.id]=d.attachments),delete d.attachments,a.push(d)}let c=[];for(let o of n??[])c.push(await this.prepareRunCreateOrUpdateInputs(o));if(a.find(o=>o.trace_id===void 0||o.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(c.find(o=>o.trace_id===void 0||o.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(a.length>0&&c.length>0){let o=a.reduce((b,h)=>(h.id&&(b[h.id]=h),b),{}),d=[];for(let b of c)b.id!==void 0&&o[b.id]?o[b.id]={...o[b.id],...b}:d.push(b);a=Object.values(o),c=d}if(a.length===0&&c.length===0)return;let r=[],u=[];for(let[o,d]of[["post",a],["patch",c]])for(let b of d){let{inputs:h,outputs:Z,events:N,attachments:g,...y}=b,X={inputs:h,outputs:Z,events:N},v=Mm(y,`Serializing for multipart ingestion of run with id: ${y.id}`);u.push({name:`${o}.${y.id}`,payload:new Blob([v],{type:`application/json; length=${v.length}`})});for(let[H,Q]of Object.entries(X)){if(Q===void 0)continue;let L=Mm(Q,`Serializing ${H} for multipart ingestion of run with id: ${y.id}`);u.push({name:`${o}.${y.id}.${H}`,payload:new Blob([L],{type:`application/json; length=${L.length}`})})}if(y.id!==void 0){let H=I[y.id];if(H){delete I[y.id];for(let[Q,L]of Object.entries(H)){let J,O;if(Array.isArray(L)?[J,O]=L:(J=L.mimeType,O=L.data),Q.includes(".")){console.warn(`Skipping attachment '${Q}' for run ${y.id}: Invalid attachment name. Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);continue}u.push({name:`attachment.${y.id}.${Q}`,payload:new Blob([O],{type:`${J}; length=${O.byteLength}`})})}}}r.push(`trace=${y.trace_id},id=${y.id}`)}await this._sendMultipartRequest(u,r.join("; "),l)}async _createNodeFetchBody(e,n){let l=[];for(let c of e)l.push(new Blob([`--${n}\r +`])),l.push(new Blob([`Content-Disposition: form-data; name="${c.name}"\r +`,`Content-Type: ${c.payload.type}\r +\r +`])),l.push(c.payload),l.push(new Blob([`\r +`]));return l.push(new Blob([`--${n}--\r +`])),await new Blob(l).arrayBuffer()}async _createMultipartStream(e,n){let l=new TextEncoder;return new ReadableStream({async start(a){let c=async i=>{typeof i=="string"?a.enqueue(l.encode(i)):a.enqueue(i)};for(let i of e){await c(`--${n}\r +`),await c(`Content-Disposition: form-data; name="${i.name}"\r +`),await c(`Content-Type: ${i.payload.type}\r +\r +`);let r=i.payload.stream().getReader();try{let u;for(;!(u=await r.read()).done;)a.enqueue(u.value)}finally{r.releaseLock()}await c(`\r +`)}await c(`--${n}--\r +`),a.close()}})}async _sendMultipartRequest(e,n,l){let I="----LangSmithFormBoundary"+Math.random().toString(36).slice(2),a=mtt(),c=()=>this._createNodeFetchBody(e,I),i=()=>this._createMultipartStream(e,I),s=async r=>{let u={...this.headers,"Content-Type":`multipart/form-data; boundary=${I}`};return l?.apiKey!==void 0&&(u["x-api-key"]=l.apiKey),this.batchIngestCaller.call(qt(this.debug),`${l?.apiUrl??this.apiUrl}/runs/multipart`,{method:"POST",headers:u,body:r,duplex:"half",signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})};try{let r,u=!1;!a&&!this.multipartStreamingDisabled?(u=!0,r=await s(await i())):r=await s(await c()),(!this.multipartStreamingDisabled||u)&&r.status===422&&(l?.apiUrl??this.apiUrl)!==wlt&&(console.warn(`Streaming multipart upload to ${l?.apiUrl??this.apiUrl}/runs/multipart failed. This usually means the host does not support chunked uploads. Retrying with a buffered upload for operation "${n}".`),this.multipartStreamingDisabled=!0,r=await s(await c())),await Ll(r,"ingest multipart runs",!0)}catch(r){console.warn(`${r.message.trim()} + +Context: ${n}`)}}async updateRun(e,n,l){vl(e),n.inputs&&(n.inputs=await this.processInputs(n.inputs)),n.outputs&&(n.outputs=await this.processOutputs(n.outputs));let I={...n,id:e};if(!this._filterForSampling([I],!0).length)return;if(this.autoBatchTracing&&I.trace_id!==void 0&&I.dotted_order!==void 0){let i=this._cloneCurrentOTELContext();if(n.end_time!==void 0&&I.parent_run_id===void 0&&this.blockOnRootRunFinalization&&!this.manualFlushMode){await this.processRunOperation({action:"update",item:I,otelContext:i,apiKey:l?.apiKey,apiUrl:l?.apiUrl}).catch(console.error);return}else this.processRunOperation({action:"update",item:I,otelContext:i,apiKey:l?.apiKey,apiUrl:l?.apiUrl}).catch(console.error);return}let a={...this.headers,"Content-Type":"application/json"};l?.apiKey!==void 0&&(a["x-api-key"]=l.apiKey);let c=await this.caller.call(qt(this.debug),`${l?.apiUrl??this.apiUrl}/runs/${e}`,{method:"PATCH",headers:a,body:Mm(n,`Serializing payload to update run with id: ${e}`),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(c,"update run",!0)}async readRun(e,{loadChildRuns:n}={loadChildRuns:!1}){vl(e);let l=await this._get(`/runs/${e}`);return n&&(l=await this._loadChildRuns(l)),l}async getRunUrl({runId:e,run:n,projectOpts:l}){if(n!==void 0){let I;n.session_id?I=n.session_id:l?.projectName?I=(await this.readProject({projectName:l?.projectName})).id:l?.projectId?I=l?.projectId:I=(await this.readProject({projectName:hd("PROJECT")||"default"})).id;let a=await this._getTenantId();return`${this.getHostUrl()}/o/${a}/projects/p/${I}/r/${n.id}?poll=true`}else if(e!==void 0){let I=await this.readRun(e);if(!I.app_path)throw new Error(`Run ${e} has no app_path`);return`${this.getHostUrl()}${I.app_path}`}else throw new Error("Must provide either runId or run")}async _loadChildRuns(e){let n=await jCn(this.listRuns({isRoot:!1,projectId:e.session_id,traceId:e.trace_id})),l={},I={};n.sort((a,c)=>(a?.dotted_order??"").localeCompare(c?.dotted_order??""));for(let a of n){if(a.parent_run_id===null||a.parent_run_id===void 0)throw new Error(`Child run ${a.id} has no parent`);a.dotted_order?.startsWith(e.dotted_order??"")&&a.id!==e.id&&(a.parent_run_id in l||(l[a.parent_run_id]=[]),l[a.parent_run_id].push(a),I[a.id]=a)}e.child_runs=l[e.id]||[];for(let a in l)a!==e.id&&(I[a].child_runs=l[a]);return e}async*listRuns(e){let{projectId:n,projectName:l,parentRunId:I,traceId:a,referenceExampleId:c,startTime:i,executionOrder:s,isRoot:r,runType:u,error:o,id:d,query:b,filter:h,traceFilter:Z,treeFilter:N,limit:g,select:y,order:X}=e,v=[];if(n&&(v=Array.isArray(n)?n:[n]),l){let J=Array.isArray(l)?l:[l],O=await Promise.all(J.map(U=>this.readProject({projectName:U}).then(K=>K.id)));v.push(...O)}let H=["app_path","completion_cost","completion_tokens","dotted_order","end_time","error","events","extra","feedback_stats","first_token_time","id","inputs","name","outputs","parent_run_id","parent_run_ids","prompt_cost","prompt_tokens","reference_example_id","run_type","session_id","start_time","status","tags","total_cost","total_tokens","trace_id"],Q={session:v.length?v:null,run_type:u,reference_example:c,query:b,filter:h,trace_filter:Z,tree_filter:N,execution_order:s,parent_run:I,start_time:i?i.toISOString():null,error:o,id:d,limit:g,trace:a,select:y||H,is_root:r,order:X},L=0;for await(let J of this._getCursorPaginatedList("/runs/query",Q))if(g){if(L>=g)break;if(J.length+L>g){yield*J.slice(0,g-L);break}L+=J.length,yield*J}else yield*J}async*listGroupRuns(e){let{projectId:n,projectName:l,groupBy:I,filter:a,startTime:c,endTime:i,limit:s,offset:r}=e,o={session_id:n||(await this.readProject({projectName:l})).id,group_by:I,filter:a,start_time:c?c.toISOString():null,end_time:i?i.toISOString():null,limit:Number(s)||100},d=Number(r)||0,b="/runs/group",h=`${this.apiUrl}${b}`;for(;;){let Z={...o,offset:d},N=Object.fromEntries(Object.entries(Z).filter(([H,Q])=>Q!==void 0)),g=await this.caller.call(qt(),h,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(N),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(g,`Failed to fetch ${b}`);let y=await g.json(),{groups:X,total:v}=y;if(X.length===0)break;for(let H of X)yield H;if(d+=X.length,d>=v)break}}async getRunStats({id:e,trace:n,parentRun:l,runType:I,projectNames:a,projectIds:c,referenceExampleIds:i,startTime:s,endTime:r,error:u,query:o,filter:d,traceFilter:b,treeFilter:h,isRoot:Z,dataSourceType:N}){let g=c||[];a&&(g=[...c||[],...await Promise.all(a.map(Q=>this.readProject({projectName:Q}).then(L=>L.id)))]);let X=Object.fromEntries(Object.entries({id:e,trace:n,parent_run:l,run_type:I,session:g,reference_example:i,start_time:s,end_time:r,error:u,query:o,filter:d,trace_filter:b,tree_filter:h,is_root:Z,data_source_type:N}).filter(([Q,L])=>L!==void 0));return await(await this.caller.call(qt(this.debug),`${this.apiUrl}/runs/stats`,{method:"POST",headers:this.headers,body:JSON.stringify(X),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async shareRun(e,{shareId:n}={}){let l={run_id:e,share_token:n||$n()};vl(e);let a=await(await this.caller.call(qt(this.debug),`${this.apiUrl}/runs/${e}/share`,{method:"PUT",headers:this.headers,body:JSON.stringify(l),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();if(a===null||!("share_token"in a))throw new Error("Invalid response from server");return`${this.getHostUrl()}/public/${a.share_token}/r`}async unshareRun(e){vl(e);let n=await this.caller.call(qt(this.debug),`${this.apiUrl}/runs/${e}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(n,"unshare run",!0)}async readRunSharedLink(e){vl(e);let l=await(await this.caller.call(qt(this.debug),`${this.apiUrl}/runs/${e}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();if(!(l===null||!("share_token"in l)))return`${this.getHostUrl()}/public/${l.share_token}/r`}async listSharedRuns(e,{runIds:n}={}){let l=new URLSearchParams({share_token:e});if(n!==void 0)for(let c of n)l.append("id",c);return vl(e),await(await this.caller.call(qt(this.debug),`${this.apiUrl}/public/${e}/runs${l}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async readDatasetSharedSchema(e,n){if(!e&&!n)throw new Error("Either datasetId or datasetName must be given");e||(e=(await this.readDataset({datasetName:n})).id),vl(e);let I=await(await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${e}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();return I.url=`${this.getHostUrl()}/public/${I.share_token}/d`,I}async shareDataset(e,n){if(!e&&!n)throw new Error("Either datasetId or datasetName must be given");e||(e=(await this.readDataset({datasetName:n})).id);let l={dataset_id:e};vl(e);let a=await(await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${e}/share`,{method:"PUT",headers:this.headers,body:JSON.stringify(l),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();return a.url=`${this.getHostUrl()}/public/${a.share_token}/d`,a}async unshareDataset(e){vl(e);let n=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${e}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(n,"unshare dataset",!0)}async readSharedDataset(e){return vl(e),await(await this.caller.call(qt(this.debug),`${this.apiUrl}/public/${e}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async listSharedExamples(e,n){let l={};n?.exampleIds&&(l.id=n.exampleIds);let I=new URLSearchParams;Object.entries(l).forEach(([i,s])=>{Array.isArray(s)?s.forEach(r=>I.append(i,r)):I.append(i,s)});let a=await this.caller.call(qt(this.debug),`${this.apiUrl}/public/${e}/examples?${I.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions}),c=await a.json();if(!a.ok)throw"detail"in c?new Error(`Failed to list shared examples. +Status: ${a.status} +Message: ${Array.isArray(c.detail)?c.detail.join(` +`):"Unspecified error"}`):new Error(`Failed to list shared examples: ${a.status} ${a.statusText}`);return c.map(i=>({...i,_hostUrl:this.getHostUrl()}))}async createProject({projectName:e,description:n=null,metadata:l=null,upsert:I=!1,projectExtra:a=null,referenceDatasetId:c=null}){let i=I?"?upsert=true":"",s=`${this.apiUrl}/sessions${i}`,r=a||{};l&&(r.metadata=l);let u={name:e,extra:r,description:n};c!==null&&(u.reference_dataset_id=c);let o=await this.caller.call(qt(this.debug),s,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(u),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(o,"create project"),await o.json()}async updateProject(e,{name:n=null,description:l=null,metadata:I=null,projectExtra:a=null,endTime:c=null}){let i=`${this.apiUrl}/sessions/${e}`,s=a;I&&(s={...s||{},metadata:I});let r={name:n,extra:s,description:l,end_time:c?new Date(c).toISOString():null},u=await this.caller.call(qt(this.debug),i,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(u,"update project"),await u.json()}async hasProject({projectId:e,projectName:n}){let l="/sessions",I=new URLSearchParams;if(e!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(e!==void 0)vl(e),l+=`/${e}`;else if(n!==void 0)I.append("name",n);else throw new Error("Must provide projectName or projectId");let a=await this.caller.call(qt(this.debug),`${this.apiUrl}${l}?${I}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});try{let c=await a.json();return a.ok?Array.isArray(c)?c.length>0:!0:!1}catch{return!1}}async readProject({projectId:e,projectName:n,includeStats:l}){let I="/sessions",a=new URLSearchParams;if(e!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(e!==void 0)vl(e),I+=`/${e}`;else if(n!==void 0)a.append("name",n);else throw new Error("Must provide projectName or projectId");l!==void 0&&a.append("include_stats",l.toString());let c=await this._get(I,a),i;if(Array.isArray(c)){if(c.length===0)throw new Error(`Project[id=${e}, name=${n}] not found`);i=c[0]}else i=c;return i}async getProjectUrl({projectId:e,projectName:n}){if(e===void 0&&n===void 0)throw new Error("Must provide either projectName or projectId");let l=await this.readProject({projectId:e,projectName:n}),I=await this._getTenantId();return`${this.getHostUrl()}/o/${I}/projects/p/${l.id}`}async getDatasetUrl({datasetId:e,datasetName:n}){if(e===void 0&&n===void 0)throw new Error("Must provide either datasetName or datasetId");let l=await this.readDataset({datasetId:e,datasetName:n}),I=await this._getTenantId();return`${this.getHostUrl()}/o/${I}/datasets/${l.id}`}async _getTenantId(){if(this._tenantId!==null)return this._tenantId;let e=new URLSearchParams({limit:"1"});for await(let n of this._getPaginated("/sessions",e))return this._tenantId=n[0].tenant_id,n[0].tenant_id;throw new Error("No projects found to resolve tenant.")}async*listProjects({projectIds:e,name:n,nameContains:l,referenceDatasetId:I,referenceDatasetName:a,referenceFree:c,metadata:i}={}){let s=new URLSearchParams;if(e!==void 0)for(let r of e)s.append("id",r);if(n!==void 0&&s.append("name",n),l!==void 0&&s.append("name_contains",l),I!==void 0)s.append("reference_dataset",I);else if(a!==void 0){let r=await this.readDataset({datasetName:a});s.append("reference_dataset",r.id)}c!==void 0&&s.append("reference_free",c.toString()),i!==void 0&&s.append("metadata",JSON.stringify(i));for await(let r of this._getPaginated("/sessions",s))yield*r}async deleteProject({projectId:e,projectName:n}){let l;if(e===void 0&&n===void 0)throw new Error("Must provide projectName or projectId");if(e!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");e===void 0?l=(await this.readProject({projectName:n})).id:l=e,vl(l);let I=await this.caller.call(qt(this.debug),`${this.apiUrl}/sessions/${l}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(I,`delete session ${l} (${n})`,!0)}async uploadCsv({csvFile:e,fileName:n,inputKeys:l,outputKeys:I,description:a,dataType:c,name:i}){let s=`${this.apiUrl}/datasets/upload`,r=new FormData;r.append("file",e,n),l.forEach(d=>{r.append("input_keys",d)}),I.forEach(d=>{r.append("output_keys",d)}),a&&r.append("description",a),c&&r.append("data_type",c),i&&r.append("name",i);let u=await this.caller.call(qt(this.debug),s,{method:"POST",headers:this.headers,body:r,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(u,"upload CSV"),await u.json()}async createDataset(e,{description:n,dataType:l,inputsSchema:I,outputsSchema:a,metadata:c}={}){let i={name:e,description:n,extra:c?{metadata:c}:void 0};l&&(i.data_type=l),I&&(i.inputs_schema_definition=I),a&&(i.outputs_schema_definition=a);let s=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(s,"create dataset"),await s.json()}async readDataset({datasetId:e,datasetName:n}){let l="/datasets",I=new URLSearchParams({limit:"1"});if(e&&n)throw new Error("Must provide either datasetName or datasetId, not both");if(e)vl(e),l+=`/${e}`;else if(n)I.append("name",n);else throw new Error("Must provide datasetName or datasetId");let a=await this._get(l,I),c;if(Array.isArray(a)){if(a.length===0)throw new Error(`Dataset[id=${e}, name=${n}] not found`);c=a[0]}else c=a;return c}async hasDataset({datasetId:e,datasetName:n}){try{return await this.readDataset({datasetId:e,datasetName:n}),!0}catch(l){if(l instanceof Error&&l.message.toLocaleLowerCase().includes("not found"))return!1;throw l}}async diffDatasetVersions({datasetId:e,datasetName:n,fromVersion:l,toVersion:I}){let a=e;if(a===void 0&&n===void 0)throw new Error("Must provide either datasetName or datasetId");if(a!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");a===void 0&&(a=(await this.readDataset({datasetName:n})).id);let c=new URLSearchParams({from_version:typeof l=="string"?l:l.toISOString(),to_version:typeof I=="string"?I:I.toISOString()});return await this._get(`/datasets/${a}/versions/diff`,c)}async readDatasetOpenaiFinetuning({datasetId:e,datasetName:n}){let l="/datasets";if(e===void 0)if(n!==void 0)e=(await this.readDataset({datasetName:n})).id;else throw new Error("Must provide either datasetName or datasetId");return(await(await this._getResponse(`${l}/${e}/openai_ft`)).text()).trim().split(` +`).map(i=>JSON.parse(i))}async*listDatasets({limit:e=100,offset:n=0,datasetIds:l,datasetName:I,datasetNameContains:a,metadata:c}={}){let i="/datasets",s=new URLSearchParams({limit:e.toString(),offset:n.toString()});if(l!==void 0)for(let r of l)s.append("id",r);I!==void 0&&s.append("name",I),a!==void 0&&s.append("name_contains",a),c!==void 0&&s.append("metadata",JSON.stringify(c));for await(let r of this._getPaginated(i,s))yield*r}async updateDataset(e){let{datasetId:n,datasetName:l,...I}=e;if(!n&&!l)throw new Error("Must provide either datasetName or datasetId");let a=n??(await this.readDataset({datasetName:l})).id;vl(a);let c=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${a}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(I),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(c,"update dataset"),await c.json()}async updateDatasetTag(e){let{datasetId:n,datasetName:l,asOf:I,tag:a}=e;if(!n&&!l)throw new Error("Must provide either datasetName or datasetId");let c=n??(await this.readDataset({datasetName:l})).id;vl(c);let i=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${c}/tags`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify({as_of:typeof I=="string"?I:I.toISOString(),tag:a}),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(i,"update dataset tags")}async deleteDataset({datasetId:e,datasetName:n}){let l="/datasets",I=e;if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(n!==void 0&&(I=(await this.readDataset({datasetName:n})).id),I!==void 0)vl(I),l+=`/${I}`;else throw new Error("Must provide datasetName or datasetId");let a=await this.caller.call(qt(this.debug),this.apiUrl+l,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(a,`delete ${l}`),await a.json()}async indexDataset({datasetId:e,datasetName:n,tag:l}){let I=e;if(!I&&!n)throw new Error("Must provide either datasetName or datasetId");if(I&&n)throw new Error("Must provide either datasetName or datasetId, not both");I||(I=(await this.readDataset({datasetName:n})).id),vl(I);let a={tag:l},c=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${I}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(a),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(c,"index dataset"),await c.json()}async similarExamples(e,n,l,{filter:I}={}){let a={limit:l,inputs:e};I!==void 0&&(a.filter=I),vl(n);let c=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${n}/search`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(a),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(c,"fetch similar examples"),(await c.json()).examples}async createExample(e,n,l){if(Hlt(e)&&(n!==void 0||l!==void 0))throw new Error("Cannot provide outputs or options when using ExampleCreate object");let I=n?l?.datasetId:e.dataset_id,a=n?l?.datasetName:e.dataset_name;if(I===void 0&&a===void 0)throw new Error("Must provide either datasetName or datasetId");if(I!==void 0&&a!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");I===void 0&&(I=(await this.readDataset({datasetName:a})).id);let c=(n?l?.createdAt:e.created_at)||new Date,i;Hlt(e)?i=e:i={inputs:e,outputs:n,created_at:c?.toISOString(),id:l?.exampleId,metadata:l?.metadata,split:l?.split,source_run_id:l?.sourceRunId,use_source_run_io:l?.useSourceRunIO,use_source_run_attachments:l?.useSourceRunAttachments,attachments:l?.attachments};let s=await this._uploadExamplesMultipart(I,[i]);return await this.readExample(s.example_ids?.[0]??$n())}async createExamples(e){if(Array.isArray(e)){if(e.length===0)return[];let y=e,X=y[0].dataset_id,v=y[0].dataset_name;if(X===void 0&&v===void 0)throw new Error("Must provide either datasetName or datasetId");if(X!==void 0&&v!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");X===void 0&&(X=(await this.readDataset({datasetName:v})).id);let H=await this._uploadExamplesMultipart(X,y);return await Promise.all(H.example_ids.map(L=>this.readExample(L)))}let{inputs:n,outputs:l,metadata:I,splits:a,sourceRunIds:c,useSourceRunIOs:i,useSourceRunAttachments:s,attachments:r,exampleIds:u,datasetId:o,datasetName:d}=e;if(n===void 0)throw new Error("Must provide inputs when using legacy parameters");let b=o,h=d;if(b===void 0&&h===void 0)throw new Error("Must provide either datasetName or datasetId");if(b!==void 0&&h!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");b===void 0&&(b=(await this.readDataset({datasetName:h})).id);let Z=n.map((y,X)=>({dataset_id:b,inputs:y,outputs:l?.[X],metadata:I?.[X],split:a?.[X],id:u?.[X],attachments:r?.[X],source_run_id:c?.[X],use_source_run_io:i?.[X],use_source_run_attachments:s?.[X]})),N=await this._uploadExamplesMultipart(b,Z);return await Promise.all(N.example_ids.map(y=>this.readExample(y)))}async createLLMExample(e,n,l){return this.createExample({input:e},{output:n},l)}async createChatExample(e,n,l){let I=e.map(c=>HAe(c)?QAe(c):c),a=HAe(n)?QAe(n):n;return this.createExample({input:I},{output:a},l)}async readExample(e){vl(e);let n=`/examples/${e}`,l=await this._get(n),{attachment_urls:I,...a}=l,c=a;return I&&(c.attachments=Object.entries(I).reduce((i,[s,r])=>(i[s.slice(11)]={presigned_url:r.presigned_url,mime_type:r.mime_type},i),{})),c}async*listExamples({datasetId:e,datasetName:n,exampleIds:l,asOf:I,splits:a,inlineS3Urls:c,metadata:i,limit:s,offset:r,filter:u,includeAttachments:o}={}){let d;if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(e!==void 0)d=e;else if(n!==void 0)d=(await this.readDataset({datasetName:n})).id;else throw new Error("Must provide a datasetName or datasetId");let b=new URLSearchParams({dataset:d}),h=I?typeof I=="string"?I:I?.toISOString():void 0;h&&b.append("as_of",h);let Z=c??!0;if(b.append("inline_s3_urls",Z.toString()),l!==void 0)for(let g of l)b.append("id",g);if(a!==void 0)for(let g of a)b.append("splits",g);if(i!==void 0){let g=JSON.stringify(i);b.append("metadata",g)}s!==void 0&&b.append("limit",s.toString()),r!==void 0&&b.append("offset",r.toString()),u!==void 0&&b.append("filter",u),o===!0&&["attachment_urls","outputs","metadata"].forEach(g=>b.append("select",g));let N=0;for await(let g of this._getPaginated("/examples",b)){for(let y of g){let{attachment_urls:X,...v}=y,H=v;X&&(H.attachments=Object.entries(X).reduce((Q,[L,J])=>(Q[L.slice(11)]={presigned_url:J.presigned_url,mime_type:J.mime_type||void 0},Q),{})),yield H,N++}if(s!==void 0&&N>=s)break}}async deleteExample(e){vl(e);let n=`/examples/${e}`,l=await this.caller.call(qt(this.debug),this.apiUrl+n,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(l,`delete ${n}`),await l.json()}async updateExample(e,n){let l;n?l=e:l=e.id,vl(l);let I;n?I={id:l,...n}:I=e;let a;return I.dataset_id!==void 0?a=I.dataset_id:a=(await this.readExample(l)).dataset_id,this._updateExamplesMultipart(a,[I])}async updateExamples(e){let n;return e[0].dataset_id===void 0?n=(await this.readExample(e[0].id)).dataset_id:n=e[0].dataset_id,this._updateExamplesMultipart(n,e)}async readDatasetVersion({datasetId:e,datasetName:n,asOf:l,tag:I}){let a;if(e?a=e:a=(await this.readDataset({datasetName:n})).id,vl(a),l&&I||!l&&!I)throw new Error("Exactly one of asOf and tag must be specified.");let c=new URLSearchParams;l!==void 0&&c.append("as_of",typeof l=="string"?l:l.toISOString()),I!==void 0&&c.append("tag",I);let i=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${a}/version?${c.toString()}`,{method:"GET",headers:{...this.headers},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(i,"read dataset version"),await i.json()}async listDatasetSplits({datasetId:e,datasetName:n,asOf:l}){let I;if(e===void 0&&n===void 0)throw new Error("Must provide dataset name or ID");if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");e===void 0?I=(await this.readDataset({datasetName:n})).id:I=e,vl(I);let a=new URLSearchParams,c=l?typeof l=="string"?l:l?.toISOString():void 0;return c&&a.append("as_of",c),await this._get(`/datasets/${I}/splits`,a)}async updateDatasetSplits({datasetId:e,datasetName:n,splitName:l,exampleIds:I,remove:a=!1}){let c;if(e===void 0&&n===void 0)throw new Error("Must provide dataset name or ID");if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");e===void 0?c=(await this.readDataset({datasetName:n})).id:c=e,vl(c);let i={split_name:l,examples:I.map(r=>(vl(r),r)),remove:a},s=await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/${c}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(s,"update dataset splits",!0)}async evaluateRun(e,n,{sourceInfo:l,loadChildRuns:I,referenceExample:a}={loadChildRuns:!1}){t$("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");let c;if(typeof e=="string")c=await this.readRun(e,{loadChildRuns:I});else if(typeof e=="object"&&"id"in e)c=e;else throw new Error(`Invalid run type: ${typeof e}`);c.reference_example_id!==null&&c.reference_example_id!==void 0&&(a=await this.readExample(c.reference_example_id));let i=await n.evaluateRun(c,a),[s,r]=await this._logEvaluationFeedback(i,c,l);return r[0]}async createFeedback(e,n,{score:l,value:I,correction:a,comment:c,sourceInfo:i,feedbackSourceType:s="api",sourceRunId:r,feedbackId:u,feedbackConfig:o,projectId:d,comparativeExperimentId:b}){if(!e&&!d)throw new Error("One of runId or projectId must be provided");if(e&&d)throw new Error("Only one of runId or projectId can be provided");let h={type:s??"api",metadata:i??{}};r!==void 0&&h?.metadata!==void 0&&!h.metadata.__run&&(h.metadata.__run={run_id:r}),h?.metadata!==void 0&&h.metadata.__run?.run_id!==void 0&&vl(h.metadata.__run.run_id);let Z={id:u??$n(),run_id:e,key:n,score:Xlt(l),value:I,correction:a,comment:c,feedback_source:h,comparative_experiment_id:b,feedbackConfig:o,session_id:d},N=`${this.apiUrl}/feedback`,g=await this.caller.call(qt(this.debug),N,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(Z),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(g,"create feedback",!0),Z}async updateFeedback(e,{score:n,value:l,correction:I,comment:a}){let c={};n!=null&&(c.score=Xlt(n)),l!=null&&(c.value=l),I!=null&&(c.correction=I),a!=null&&(c.comment=a),vl(e);let i=await this.caller.call(qt(this.debug),`${this.apiUrl}/feedback/${e}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(c),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(i,"update feedback",!0)}async readFeedback(e){vl(e);let n=`/feedback/${e}`;return await this._get(n)}async deleteFeedback(e){vl(e);let n=`/feedback/${e}`,l=await this.caller.call(qt(this.debug),this.apiUrl+n,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(l,`delete ${n}`),await l.json()}async*listFeedback({runIds:e,feedbackKeys:n,feedbackSourceTypes:l}={}){let I=new URLSearchParams;if(e&&I.append("run",e.join(",")),n)for(let a of n)I.append("key",a);if(l)for(let a of l)I.append("source",a);for await(let a of this._getPaginated("/feedback",I))yield*a}async createPresignedFeedbackToken(e,n,{expiration:l,feedbackConfig:I}={}){let a={run_id:e,feedback_key:n,feedback_config:I};return l?typeof l=="string"?a.expires_at=l:(l?.hours||l?.minutes||l?.days)&&(a.expires_in=l):a.expires_in={hours:3},await(await this.caller.call(qt(this.debug),`${this.apiUrl}/feedback/tokens`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(a),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async createComparativeExperiment({name:e,experimentIds:n,referenceDatasetId:l,createdAt:I,description:a,metadata:c,id:i}){if(n.length===0)throw new Error("At least one experiment is required");if(l||(l=(await this.readProject({projectId:n[0]})).reference_dataset_id),!l==null)throw new Error("A reference dataset is required");let s={id:i,name:e,experiment_ids:n,reference_dataset_id:l,description:a,created_at:(I??new Date)?.toISOString(),extra:{}};return c&&(s.extra.metadata=c),await(await this.caller.call(qt(this.debug),`${this.apiUrl}/datasets/comparative`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(s),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async*listPresignedFeedbackTokens(e){vl(e);let n=new URLSearchParams({run_id:e});for await(let l of this._getPaginated("/feedback/tokens",n))yield*l}_selectEvalResults(e){let n;return"results"in e?n=e.results:Array.isArray(e)?n=e:n=[e],n}async _logEvaluationFeedback(e,n,l){let I=this._selectEvalResults(e),a=[];for(let c of I){let i=l||{};c.evaluatorInfo&&(i={...c.evaluatorInfo,...i});let s=null;c.targetRunId?s=c.targetRunId:n&&(s=n.id),a.push(await this.createFeedback(s,c.key,{score:c.score,value:c.value,comment:c.comment,correction:c.correction,sourceInfo:i,sourceRunId:c.sourceRunId,feedbackConfig:c.feedbackConfig,feedbackSourceType:"model"}))}return[I,a]}async logEvaluationFeedback(e,n,l){let[I]=await this._logEvaluationFeedback(e,n,l);return I}async*listAnnotationQueues(e={}){let{queueIds:n,name:l,nameContains:I,limit:a}=e,c=new URLSearchParams;n&&n.forEach((s,r)=>{vl(s,`queueIds[${r}]`),c.append("ids",s)}),l&&c.append("name",l),I&&c.append("name_contains",I),c.append("limit",(a!==void 0?Math.min(a,100):100).toString());let i=0;for await(let s of this._getPaginated("/annotation-queues",c))if(yield*s,i++,a!==void 0&&i>=a)break}async createAnnotationQueue(e){let{name:n,description:l,queueId:I,rubricInstructions:a}=e,c={name:n,description:l,id:I||$n(),rubric_instructions:a},i=await this.caller.call(qt(this.debug),`${this.apiUrl}/annotation-queues`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(Object.fromEntries(Object.entries(c).filter(([r,u])=>u!==void 0))),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(i,"create annotation queue"),await i.json()}async readAnnotationQueue(e){let n=await this.caller.call(qt(this.debug),`${this.apiUrl}/annotation-queues/${vl(e,"queueId")}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(n,"read annotation queue"),await n.json()}async updateAnnotationQueue(e,n){let{name:l,description:I,rubricInstructions:a}=n,c=await this.caller.call(qt(this.debug),`${this.apiUrl}/annotation-queues/${vl(e,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify({name:l,description:I,rubric_instructions:a}),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(c,"update annotation queue")}async deleteAnnotationQueue(e){let n=await this.caller.call(qt(this.debug),`${this.apiUrl}/annotation-queues/${vl(e,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(n,"delete annotation queue")}async addRunsToAnnotationQueue(e,n){let l=await this.caller.call(qt(this.debug),`${this.apiUrl}/annotation-queues/${vl(e,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(n.map((I,a)=>vl(I,`runIds[${a}]`).toString())),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(l,"add runs to annotation queue")}async getRunFromAnnotationQueue(e,n){let l=`/annotation-queues/${vl(e,"queueId")}/run`,I=await this.caller.call(qt(this.debug),`${this.apiUrl}${l}/${n}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(I,"get run from annotation queue"),await I.json()}async deleteRunFromAnnotationQueue(e,n){let l=await this.caller.call(qt(this.debug),`${this.apiUrl}/annotation-queues/${vl(e,"queueId")}/runs/${vl(n,"queueRunId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(l,"delete run from annotation queue")}async getSizeFromAnnotationQueue(e){let n=await this.caller.call(qt(this.debug),`${this.apiUrl}/annotation-queues/${vl(e,"queueId")}/size`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(n,"get size from annotation queue"),await n.json()}async _currentTenantIsOwner(e){let n=await this._getSettings();return e=="-"||n.tenant_handle===e}async _ownerConflictError(e,n){let l=await this._getSettings();return new Error(`Cannot ${e} for another tenant. + + Current tenant: ${l.tenant_handle} + + Requested tenant: ${n}`)}async _getLatestCommitHash(e){let n=await this.caller.call(qt(this.debug),`${this.apiUrl}/commits/${e}/?limit=1&offset=0`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions}),l=await n.json();if(!n.ok){let I=typeof l.detail=="string"?l.detail:JSON.stringify(l.detail),a=new Error(`Error ${n.status}: ${n.statusText} +${I}`);throw a.statusCode=n.status,a}if(l.commits.length!==0)return l.commits[0].commit_hash}async _likeOrUnlikePrompt(e,n){let[l,I,a]=wy(e),c=await this.caller.call(qt(this.debug),`${this.apiUrl}/likes/${l}/${I}`,{method:"POST",body:JSON.stringify({like:n}),headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(c,`${n?"like":"unlike"} prompt`),await c.json()}async _getPromptUrl(e){let[n,l,I]=wy(e);if(await this._currentTenantIsOwner(n)){let a=await this._getSettings();return I!=="latest"?`${this.getHostUrl()}/prompts/${l}/${I.substring(0,8)}?organizationId=${a.id}`:`${this.getHostUrl()}/prompts/${l}?organizationId=${a.id}`}else return I!=="latest"?`${this.getHostUrl()}/hub/${n}/${l}/${I.substring(0,8)}`:`${this.getHostUrl()}/hub/${n}/${l}`}async promptExists(e){return!!await this.getPrompt(e)}async likePrompt(e){return this._likeOrUnlikePrompt(e,!0)}async unlikePrompt(e){return this._likeOrUnlikePrompt(e,!1)}async*listCommits(e){for await(let n of this._getPaginated(`/commits/${e}/`,new URLSearchParams,l=>l.commits))yield*n}async*listPrompts(e){let n=new URLSearchParams;n.append("sort_field",e?.sortField??"updated_at"),n.append("sort_direction","desc"),n.append("is_archived",(!!e?.isArchived).toString()),e?.isPublic!==void 0&&n.append("is_public",e.isPublic.toString()),e?.query&&n.append("query",e.query);for await(let l of this._getPaginated("/repos",n,I=>I.repos))yield*l}async getPrompt(e){let[n,l,I]=wy(e),a=await this.caller.call(qt(this.debug),`${this.apiUrl}/repos/${n}/${l}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});if(a.status===404)return null;await Ll(a,"get prompt");let c=await a.json();return c.repo?c.repo:null}async createPrompt(e,n){let l=await this._getSettings();if(n?.isPublic&&!l.tenant_handle)throw new Error(`Cannot create a public prompt without first + + creating a LangChain Hub handle. + You can add a handle by creating a public prompt at: + + https://smith.langchain.com/prompts`);let[I,a,c]=wy(e);if(!await this._currentTenantIsOwner(I))throw await this._ownerConflictError("create a prompt",I);let i={repo_handle:a,...n?.description&&{description:n.description},...n?.readme&&{readme:n.readme},...n?.tags&&{tags:n.tags},is_public:!!n?.isPublic},s=await this.caller.call(qt(this.debug),`${this.apiUrl}/repos/`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(s,"create prompt");let{repo:r}=await s.json();return r}async createCommit(e,n,l){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[I,a,c]=wy(e),i=l?.parentCommitHash==="latest"||!l?.parentCommitHash?await this._getLatestCommitHash(`${I}/${a}`):l?.parentCommitHash,s={manifest:JSON.parse(JSON.stringify(n)),parent_commit:i},r=await this.caller.call(qt(this.debug),`${this.apiUrl}/commits/${I}/${a}`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(s),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(r,"create commit");let u=await r.json();return this._getPromptUrl(`${I}/${a}${u.commit_hash?`:${u.commit_hash}`:""}`)}async updateExamplesMultipart(e,n=[]){return this._updateExamplesMultipart(e,n)}async _updateExamplesMultipart(e,n=[]){if(!await this._getMultiPartSupport())throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");let l=new FormData;for(let i of n){let s=i.id,r={...i.metadata&&{metadata:i.metadata},...i.split&&{split:i.split}},u=Mm(r,`Serializing body for example with id: ${s}`),o=new Blob([u],{type:"application/json"});if(l.append(s,o),i.inputs){let d=Mm(i.inputs,`Serializing inputs for example with id: ${s}`),b=new Blob([d],{type:"application/json"});l.append(`${s}.inputs`,b)}if(i.outputs){let d=Mm(i.outputs,`Serializing outputs whle updating example with id: ${s}`),b=new Blob([d],{type:"application/json"});l.append(`${s}.outputs`,b)}if(i.attachments)for(let[d,b]of Object.entries(i.attachments)){let h,Z;Array.isArray(b)?[h,Z]=b:(h=b.mimeType,Z=b.data);let N=new Blob([Z],{type:`${h}; length=${Z.byteLength}`});l.append(`${s}.attachment.${d}`,N)}if(i.attachments_operations){let d=Mm(i.attachments_operations,`Serializing attachments while updating example with id: ${s}`),b=new Blob([d],{type:"application/json"});l.append(`${s}.attachments_operations`,b)}}let I=e??n[0]?.dataset_id;return await(await this.caller.call(qt(this.debug),`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${I}/examples`)}`,{method:"PATCH",headers:this.headers,body:l})).json()}async uploadExamplesMultipart(e,n=[]){return this._uploadExamplesMultipart(e,n)}async _uploadExamplesMultipart(e,n=[]){if(!await this._getMultiPartSupport())throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");let l=new FormData;for(let c of n){let i=(c.id??$n()).toString(),s={created_at:c.created_at,...c.metadata&&{metadata:c.metadata},...c.split&&{split:c.split},...c.source_run_id&&{source_run_id:c.source_run_id},...c.use_source_run_io&&{use_source_run_io:c.use_source_run_io},...c.use_source_run_attachments&&{use_source_run_attachments:c.use_source_run_attachments}},r=Mm(s,`Serializing body for uploaded example with id: ${i}`),u=new Blob([r],{type:"application/json"});if(l.append(i,u),c.inputs){let o=Mm(c.inputs,`Serializing inputs for uploaded example with id: ${i}`),d=new Blob([o],{type:"application/json"});l.append(`${i}.inputs`,d)}if(c.outputs){let o=Mm(c.outputs,`Serializing outputs for uploaded example with id: ${i}`),d=new Blob([o],{type:"application/json"});l.append(`${i}.outputs`,d)}if(c.attachments)for(let[o,d]of Object.entries(c.attachments)){let b,h;Array.isArray(d)?[b,h]=d:(b=d.mimeType,h=d.data);let Z=new Blob([h],{type:`${b}; length=${h.byteLength}`});l.append(`${i}.attachment.${o}`,Z)}}let I=await this.caller.call(qt(this.debug),`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${e}/examples`)}`,{method:"POST",headers:this.headers,body:l});return await Ll(I,"upload examples"),await I.json()}async updatePrompt(e,n){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[l,I]=wy(e);if(!await this._currentTenantIsOwner(l))throw await this._ownerConflictError("update a prompt",l);let a={};if(n?.description!==void 0&&(a.description=n.description),n?.readme!==void 0&&(a.readme=n.readme),n?.tags!==void 0&&(a.tags=n.tags),n?.isPublic!==void 0&&(a.is_public=n.isPublic),n?.isArchived!==void 0&&(a.is_archived=n.isArchived),Object.keys(a).length===0)throw new Error("No valid update options provided");let c=await this.caller.call(qt(this.debug),`${this.apiUrl}/repos/${l}/${I}`,{method:"PATCH",body:JSON.stringify(a),headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await Ll(c,"update prompt"),c.json()}async deletePrompt(e){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[n,l,I]=wy(e);if(!await this._currentTenantIsOwner(n))throw await this._ownerConflictError("delete a prompt",n);return await(await this.caller.call(qt(this.debug),`${this.apiUrl}/repos/${n}/${l}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async pullPromptCommit(e,n){let[l,I,a]=wy(e),c=await this.caller.call(qt(this.debug),`${this.apiUrl}/commits/${l}/${I}/${a}${n?.includeModel?"?include_model=true":""}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await Ll(c,"pull prompt commit");let i=await c.json();return{owner:l,repo:I,commit_hash:i.commit_hash,manifest:i.manifest,examples:i.examples}}async _pullPrompt(e,n){let l=await this.pullPromptCommit(e,{includeModel:n?.includeModel});return JSON.stringify(l.manifest)}async pushPrompt(e,n){return await this.promptExists(e)?n&&Object.keys(n).some(I=>I!=="object")&&await this.updatePrompt(e,{description:n?.description,readme:n?.readme,tags:n?.tags,isPublic:n?.isPublic}):await this.createPrompt(e,{description:n?.description,readme:n?.readme,tags:n?.tags,isPublic:n?.isPublic}),n?.object?await this.createCommit(e,n?.object,{parentCommitHash:n?.parentCommitHash}):await this._getPromptUrl(e)}async clonePublicDataset(e,n={}){let{sourceApiUrl:l=this.apiUrl,datasetName:I}=n,[a,c]=this.parseTokenOrUrl(e,l),i=new t({apiUrl:a,apiKey:"placeholder"}),s=await i.readSharedDataset(c),r=I||s.name;try{if(await this.hasDataset({datasetId:r})){console.log(`Dataset ${r} already exists in your tenant. Skipping.`);return}}catch{}let u=await i.listSharedExamples(c),o=await this.createDataset(r,{description:s.description,dataType:s.data_type||"kv",inputsSchema:s.inputs_schema_definition??void 0,outputsSchema:s.outputs_schema_definition??void 0});try{await this.createExamples({inputs:u.map(d=>d.inputs),outputs:u.flatMap(d=>d.outputs?[d.outputs]:[]),datasetId:o.id})}catch(d){throw console.error(`An error occurred while creating dataset ${r}. You should delete it manually.`),d}}parseTokenOrUrl(e,n,l=2,I="dataset"){try{return vl(e),[n,e]}catch{}try{let c=new URL(e).pathname.split("/").filter(i=>i!=="");if(c.length>=l){let i=c[c.length-l];return[n,i]}else throw new Error(`Invalid public ${I} URL: ${e}`)}catch{throw new Error(`Invalid public ${I} URL or token: ${e}`)}}async awaitPendingTraceBatches(){if(this.manualFlushMode)return console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches."),Promise.resolve();await Promise.all([...this.autoBatchQueue.items.map(({itemPromise:e})=>e),this.batchIngestCaller.queue.onIdle()]),this.langSmithToOTELTranslator!==void 0&&await Ntt()?.DEFAULT_LANGSMITH_SPAN_PROCESSOR?.forceFlush()}}});var Qlt,Elt=B(()=>{fy();Qlt=t=>t!==void 0?t:!!["TRACING_V2","TRACING"].find(n=>hd(n)==="true")});var h$,Jlt=B(()=>{h$=Symbol.for("lc:context_variables")});function BCn(t){return t.replace(/[-:.]/g,"")}function a0e(t,e,n=1){let l=n.toFixed(0).slice(0,3).padStart(3,"0"),I=`${new Date(t).toISOString().slice(0,-1)}${l}Z`;return{dottedOrder:BCn(I)+e,microsecondPrecisionDatestring:I}}function Llt(t){return t!==void 0&&typeof t.createChild=="function"&&typeof t.postRun=="function"}function klt(t){return typeof t=="object"&&t!=null&&typeof t.name=="string"&&t.name==="langchain_tracer"}function Clt(t){return Array.isArray(t)&&t.some(e=>klt(e))}function SCn(t){return typeof t=="object"&&t!=null&&Array.isArray(t.handlers)}function MCn(t){return t!==void 0&&typeof t.callbacks=="object"&&(Clt(t.callbacks?.handlers)||Clt(t.callbacks))}function TCn(t){return t.split(".").map(n=>{let l=n.slice(0,-36),I=n.slice(-36),a=parseInt(l.slice(0,4)),c=parseInt(l.slice(4,6))-1,i=parseInt(l.slice(6,8)),s=parseInt(l.slice(9,11)),r=parseInt(l.slice(11,13)),u=parseInt(l.slice(13,15)),o=parseInt(l.slice(15,21));return[new Date(a,c,i,s,r,u,o/1e3),I]})}function DCn(){let t=Im("LANGSMITH_RUNS_ENDPOINTS");if(!t)return[];try{let e=JSON.parse(t);return _Cn(e),Object.entries(e).map(([n,l])=>({apiUrl:n.replace(/\/$/,""),apiKey:l}))}catch(e){if(ylt(e))throw e;return console.warn("Invalid LANGSMITH_RUNS_ENDPOINTS \u2013 must be valid JSON mapping of url->apiKey"),[]}}function KCn(t){return t?t.map(e=>Array.isArray(e)?{projectName:e[0],updates:e[1]}:e):DCn()}function _Cn(t){if(Object.keys(t).length>0&&hd("ENDPOINT"))throw new b$}var Z$,Bm,bAe=B(()=>{uG();GAe();Elt();e0e();Jlt();fy();dAe();fy();EAe();Z$=class t{constructor(e,n,l,I){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}),Object.defineProperty(this,"project_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"replicas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.metadata=e,this.tags=n,this.project_name=l,this.replicas=I}static fromHeader(e){let n=e.split(","),l={},I=[],a,c;for(let i of n){let[s,r]=i.split("="),u=decodeURIComponent(r);s==="langsmith-metadata"?l=JSON.parse(u):s==="langsmith-tags"?I=u.split(","):s==="langsmith-project"?a=u:s==="langsmith-replicas"&&(c=JSON.parse(u))}return new t(l,I,a,c)}toHeader(){let e=[];return this.metadata&&Object.keys(this.metadata).length>0&&e.push(`langsmith-metadata=${encodeURIComponent(JSON.stringify(this.metadata))}`),this.tags&&this.tags.length>0&&e.push(`langsmith-tags=${encodeURIComponent(this.tags.join(","))}`),this.project_name&&e.push(`langsmith-project=${encodeURIComponent(this.project_name)}`),e.join(",")}},Bm=class t{constructor(e){if(Object.defineProperty(this,"id",{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,"run_type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"project_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parent_run",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parent_run_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"start_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"end_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reference_example_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"trace_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dotted_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingEnabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"attachments",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"replicas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_serialized_start_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Llt(e)){Object.assign(this,{...e});return}let n=t.getDefaultConfig(),{metadata:l,...I}=e,a=I.client??t.getSharedClient(),c={...l,...I?.extra?.metadata};if(I.extra={...I.extra,metadata:c},Object.assign(this,{...n,...I,client:a}),this.trace_id||(this.parent_run?this.trace_id=this.parent_run.trace_id??this.id:this.trace_id=this.id),this.replicas=KCn(this.replicas),this.execution_order??=1,this.child_execution_order??=1,!this.dotted_order){let{dottedOrder:i,microsecondPrecisionDatestring:s}=a0e(this.start_time,this.id,this.execution_order);this.parent_run?this.dotted_order=this.parent_run.dotted_order+"."+i:this.dotted_order=i,this._serialized_start_time=s}}set metadata(e){this.extra={...this.extra,metadata:{...this.extra?.metadata,...e}}}get metadata(){return this.extra?.metadata}static getDefaultConfig(){return{id:$n(),run_type:"chain",project_name:hz(),child_runs:[],api_url:Im("LANGCHAIN_ENDPOINT")??"http://localhost:1984",api_key:Im("LANGCHAIN_API_KEY"),caller_options:{},start_time:Date.now(),serialized:{},inputs:{},extra:{}}}static getSharedClient(){return t.sharedClient||(t.sharedClient=new wN),t.sharedClient}createChild(e){let n=this.child_execution_order+1,l=new t({...e,parent_run:this,project_name:this.project_name,replicas:this.replicas,client:this.client,tracingEnabled:this.tracingEnabled,execution_order:n,child_execution_order:n});h$ in this&&(l[h$]=this[h$]);let I=Symbol.for("lc:child_config"),a=e.extra?.[I]??this.extra[I];if(MCn(a)){let s={...a},r=SCn(s.callbacks)?s.callbacks.copy?.():void 0;r&&(Object.assign(r,{_parentRunId:l.id}),r.handlers?.find(klt)?.updateFromRunTree?.(l),s.callbacks=r),l.extra[I]=s}let c=new Set,i=this;for(;i!=null&&!c.has(i.id);)c.add(i.id),i.child_execution_order=Math.max(i.child_execution_order,n),i=i.parent_run;return this.child_runs.push(l),l}async end(e,n,l=Date.now(),I){this.outputs=this.outputs??e,this.error=this.error??n,this.end_time=this.end_time??l,I&&Object.keys(I).length>0&&(this.extra=this.extra?{...this.extra,metadata:{...this.extra.metadata,...I}}:{metadata:I})}_convertToCreate(e,n,l=!0){let I=e.extra??{};if(I?.runtime?.library===void 0&&(I.runtime||(I.runtime={}),n))for(let[i,s]of Object.entries(n))I.runtime[i]||(I.runtime[i]=s);let a,c;return l?(c=e.parent_run?.id??e.parent_run_id,a=[]):(a=e.child_runs.map(i=>this._convertToCreate(i,n,l)),c=void 0),{id:e.id,name:e.name,start_time:e._serialized_start_time??e.start_time,end_time:e.end_time,run_type:e.run_type,reference_example_id:e.reference_example_id,extra:I,serialized:e.serialized,error:e.error,inputs:e.inputs,outputs:e.outputs,session_name:e.project_name,child_runs:a,parent_run_id:c,trace_id:e.trace_id,dotted_order:e.dotted_order,tags:e.tags,attachments:e.attachments,events:e.events}}_remapForProject(e,n,l=!0){let I=this._convertToCreate(this,n,l);if(e===this.project_name)return I;let a=o=>LH(`${o}:${e}`,LH.DNS),c=a(I.id),i=I.trace_id?a(I.trace_id):void 0,s=I.parent_run_id?a(I.parent_run_id):void 0,r;if(I.dotted_order){let o=TCn(I.dotted_order),d=[];for(let h=0;h0)for(let{projectName:l,apiKey:I,apiUrl:a}of this.replicas){let c=this._remapForProject(l??this.project_name,n,!0);await this.client.createRun(c,{apiKey:I,apiUrl:a})}else{let l=this._convertToCreate(this,n,e);await this.client.createRun(l)}if(!e){t$("Posting with excludeChildRuns=false is deprecated and will be removed in a future version.");for(let l of this.child_runs)await l.postRun(!1)}}catch(n){console.error(`Error in postRun for run ${this.id}:`,n)}}async patchRun(){if(this.replicas&&this.replicas.length>0)for(let{projectName:e,apiKey:n,apiUrl:l,updates:I}of this.replicas){let a=this._remapForProject(e??this.project_name);await this.client.updateRun(a.id,{inputs:a.inputs,outputs:a.outputs,error:a.error,parent_run_id:a.parent_run_id,session_name:a.session_name,reference_example_id:a.reference_example_id,end_time:a.end_time,dotted_order:a.dotted_order,trace_id:a.trace_id,events:a.events,tags:a.tags,extra:a.extra,attachments:this.attachments,...I},{apiKey:n,apiUrl:l})}else try{let e={end_time:this.end_time,error:this.error,inputs:this.inputs,outputs:this.outputs,parent_run_id:this.parent_run?.id??this.parent_run_id,reference_example_id:this.reference_example_id,extra:this.extra,events:this.events,dotted_order:this.dotted_order,trace_id:this.trace_id,tags:this.tags,attachments:this.attachments,session_name:this.project_name};await this.client.updateRun(this.id,e)}catch(e){console.error(`Error in patchRun for run ${this.id}`,e)}}toJSON(){return this._convertToCreate(this,void 0,!1)}addEvent(e){this.events||(this.events=[]),typeof e=="string"?this.events.push({name:"event",time:new Date().toISOString(),message:e}):this.events.push({...e,time:e.time??new Date().toISOString()})}static fromRunnableConfig(e,n){let l=e?.callbacks,I,a,c,i=Qlt();if(l){let r=l?.getParentRunId?.()??"",u=l?.handlers?.find(o=>o?.name=="langchain_tracer");I=u?.getRun?.(r),a=u?.projectName,c=u?.client,i=i||!!u}return I?new t({name:I.name,id:I.id,trace_id:I.trace_id,dotted_order:I.dotted_order,client:c,tracingEnabled:i,project_name:a,tags:[...new Set((I?.tags??[]).concat(e?.tags??[]))],extra:{metadata:{...I?.extra?.metadata,...e?.metadata}}}).createChild(n):new t({...n,client:c,tracingEnabled:i,project_name:a})}static fromDottedOrder(e){return this.fromHeaders({"langsmith-trace":e})}static fromHeaders(e,n){let l="get"in e&&typeof e.get=="function"?{"langsmith-trace":e.get("langsmith-trace"),baggage:e.get("baggage")}:e,I=l["langsmith-trace"];if(!I||typeof I!="string")return;let a=I.trim(),c=a.split(".").map(r=>{let[u,o]=r.split("Z");return{strTime:u,time:Date.parse(u+"Z"),uuid:o}}),i=c[0].uuid,s={...n,name:n?.name??"parent",run_type:n?.run_type??"chain",start_time:n?.start_time??Date.now(),id:c.at(-1)?.uuid,trace_id:i,dotted_order:a};if(l.baggage&&typeof l.baggage=="string"){let r=Z$.fromHeader(l.baggage);s.metadata=r.metadata,s.tags=r.tags,s.project_name=r.project_name,s.replicas=r.replicas}return new t(s)}toHeaders(e){let n={"langsmith-trace":this.dotted_order,baggage:new Z$(this.extra?.metadata,this.tags,this.project_name,this.replicas).toHeader()};if(e)for(let[l,I]of Object.entries(n))e.set(l,I);return n}};Object.defineProperty(Bm,"sharedClient",{enumerable:!0,configurable:!0,writable:!0,value:null})});var W$=B(()=>{bAe()});var c0e={};Xe(c0e,{getEnv:()=>zlt,getEnvironmentVariable:()=>yt,getRuntimeEnvironment:()=>PCn,getRuntimeEnvironmentSync:()=>V$,isBrowser:()=>xlt,isDeno:()=>N$,isJsDom:()=>Olt,isNode:()=>Ult,isWebWorker:()=>jlt});async function PCn(){return V$()}function V$(){return r0e===void 0&&(r0e={library:"langchain-js",runtime:zlt()}),r0e}function yt(t){try{return typeof process<"u"?process.env?.[t]:N$()?Deno?.env.get(t):void 0}catch{return}}var xlt,jlt,Olt,N$,Ult,zlt,r0e,zY=B(()=>{xlt=()=>typeof window<"u"&&typeof window.document<"u",jlt=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",Olt=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),N$=()=>typeof Deno<"u",Ult=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!N$(),zlt=()=>{let t;return xlt()?t="browser":Ult()?t="node":jlt()?t="webworker":Olt()?t="jsdom":N$()?t="deno":t="other",t}});var s0e={};Xe(s0e,{BaseCallbackHandler:()=>E2,callbackHandlerPrefersStreaming:()=>Fz,isBaseCallbackHandler:()=>i0e});function Fz(t){return"lc_prefer_streaming"in t&&t.lc_prefer_streaming}var o0e,E2,i0e,Y5=B(()=>{uG();sh();zY();o0e=class{};E2=class t extends o0e{get lc_namespace(){return["langchain_core","callbacks",this.name]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,a5(this.constructor)]}constructor(e){super(),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}),Object.defineProperty(this,"ignoreLLM",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreChain",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreAgent",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreRetriever",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreCustomEvent",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"raiseError",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"awaitHandlers",{enumerable:!0,configurable:!0,writable:!0,value:yt("LANGCHAIN_CALLBACKS_BACKGROUND")==="false"}),this.lc_kwargs=e||{},e&&(this.ignoreLLM=e.ignoreLLM??this.ignoreLLM,this.ignoreChain=e.ignoreChain??this.ignoreChain,this.ignoreAgent=e.ignoreAgent??this.ignoreAgent,this.ignoreRetriever=e.ignoreRetriever??this.ignoreRetriever,this.ignoreCustomEvent=e.ignoreCustomEvent??this.ignoreCustomEvent,this.raiseError=e.raiseError??this.raiseError,this.awaitHandlers=this.raiseError||(e._awaitHandler??this.awaitHandlers))}copy(){return new this.constructor(this)}toJSON(){return XI.prototype.toJSON.call(this)}toJSONNotImplemented(){return XI.prototype.toJSONNotImplemented.call(this)}static fromMethods(e){class n extends t{constructor(){super(),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:$n()}),Object.assign(this,e)}}return new n}},i0e=t=>{let e=t;return e!==void 0&&typeof e.copy=="function"&&typeof e.name=="string"&&typeof e.awaitHandlers=="boolean"}});var G0e={};Xe(G0e,{BaseTracer:()=>Oc,isBaseTracer:()=>UH});function d0e(t,e){if(t)return new Bm({...t,start_time:t._serialized_start_time??t.start_time,parent_run:d0e(e),child_runs:t.child_runs.map(n=>d0e(n)).filter(n=>n!==void 0),extra:{...t.extra,runtime:V$()},tracingEnabled:!1})}function u0e(t,e){return t&&!Array.isArray(t)&&typeof t=="object"?t:{[e]:t}}function UH(t){return typeof t._addRunToRunMap=="function"}var qCn,Oc,QZ=B(()=>{W$();Y5();zY();qCn=t=>{if(t)return t.events=t.events??[],t.child_runs=t.child_runs??[],t};Oc=class extends E2{constructor(e){super(...arguments),Object.defineProperty(this,"runMap",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"runTreeMap",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"usesRunTreeMap",{enumerable:!0,configurable:!0,writable:!0,value:!1})}copy(){return this}getRunById(e){if(e!==void 0)return this.usesRunTreeMap?qCn(this.runTreeMap.get(e)):this.runMap.get(e)}stringifyError(e){return e instanceof Error?e.message+(e?.stack?` + +${e.stack}`:""):typeof e=="string"?e:`${e}`}_addChildRun(e,n){e.child_runs.push(n)}_addRunToRunMap(e){let{dottedOrder:n,microsecondPrecisionDatestring:l}=a0e(new Date(e.start_time).getTime(),e.id,e.execution_order),I={...e},a=this.getRunById(I.parent_run_id);if(I.parent_run_id!==void 0?a&&(this._addChildRun(a,I),a.child_execution_order=Math.max(a.child_execution_order,I.child_execution_order),I.trace_id=a.trace_id,a.dotted_order!==void 0&&(I.dotted_order=[a.dotted_order,n].join("."),I._serialized_start_time=l)):(I.trace_id=I.id,I.dotted_order=n,I._serialized_start_time=l),this.usesRunTreeMap){let c=d0e(I,a);c!==void 0&&this.runTreeMap.set(I.id,c)}else this.runMap.set(I.id,I);return I}async _endTrace(e){let n=e.parent_run_id!==void 0&&this.getRunById(e.parent_run_id);n?n.child_execution_order=Math.max(n.child_execution_order,e.child_execution_order):await this.persistRun(e),await this.onRunUpdate?.(e),this.usesRunTreeMap?this.runTreeMap.delete(e.id):this.runMap.delete(e.id)}_getExecutionOrder(e){let n=e!==void 0&&this.getRunById(e);return n?n.child_execution_order+1:1}_createRunForLLMStart(e,n,l,I,a,c,i,s){let r=this._getExecutionOrder(I),u=Date.now(),o=i?{...a,metadata:i}:a,d={id:l,name:s??e.id[e.id.length-1],parent_run_id:I,start_time:u,serialized:e,events:[{name:"start",time:new Date(u).toISOString()}],inputs:{prompts:n},execution_order:r,child_runs:[],child_execution_order:r,run_type:"llm",extra:o??{},tags:c||[]};return this._addRunToRunMap(d)}async handleLLMStart(e,n,l,I,a,c,i,s){let r=this.getRunById(l)??this._createRunForLLMStart(e,n,l,I,a,c,i,s);return await this.onRunCreate?.(r),await this.onLLMStart?.(r),r}_createRunForChatModelStart(e,n,l,I,a,c,i,s){let r=this._getExecutionOrder(I),u=Date.now(),o=i?{...a,metadata:i}:a,d={id:l,name:s??e.id[e.id.length-1],parent_run_id:I,start_time:u,serialized:e,events:[{name:"start",time:new Date(u).toISOString()}],inputs:{messages:n},execution_order:r,child_runs:[],child_execution_order:r,run_type:"llm",extra:o??{},tags:c||[]};return this._addRunToRunMap(d)}async handleChatModelStart(e,n,l,I,a,c,i,s){let r=this.getRunById(l)??this._createRunForChatModelStart(e,n,l,I,a,c,i,s);return await this.onRunCreate?.(r),await this.onLLMStart?.(r),r}async handleLLMEnd(e,n,l,I,a){let c=this.getRunById(n);if(!c||c?.run_type!=="llm")throw new Error("No LLM run to end.");return c.end_time=Date.now(),c.outputs=e,c.events.push({name:"end",time:new Date(c.end_time).toISOString()}),c.extra={...c.extra,...a},await this.onLLMEnd?.(c),await this._endTrace(c),c}async handleLLMError(e,n,l,I,a){let c=this.getRunById(n);if(!c||c?.run_type!=="llm")throw new Error("No LLM run to end.");return c.end_time=Date.now(),c.error=this.stringifyError(e),c.events.push({name:"error",time:new Date(c.end_time).toISOString()}),c.extra={...c.extra,...a},await this.onLLMError?.(c),await this._endTrace(c),c}_createRunForChainStart(e,n,l,I,a,c,i,s){let r=this._getExecutionOrder(I),u=Date.now(),o={id:l,name:s??e.id[e.id.length-1],parent_run_id:I,start_time:u,serialized:e,events:[{name:"start",time:new Date(u).toISOString()}],inputs:n,execution_order:r,child_execution_order:r,run_type:i??"chain",child_runs:[],extra:c?{metadata:c}:{},tags:a||[]};return this._addRunToRunMap(o)}async handleChainStart(e,n,l,I,a,c,i,s){let r=this.getRunById(l)??this._createRunForChainStart(e,n,l,I,a,c,i,s);return await this.onRunCreate?.(r),await this.onChainStart?.(r),r}async handleChainEnd(e,n,l,I,a){let c=this.getRunById(n);if(!c)throw new Error("No chain run to end.");return c.end_time=Date.now(),c.outputs=u0e(e,"output"),c.events.push({name:"end",time:new Date(c.end_time).toISOString()}),a?.inputs!==void 0&&(c.inputs=u0e(a.inputs,"input")),await this.onChainEnd?.(c),await this._endTrace(c),c}async handleChainError(e,n,l,I,a){let c=this.getRunById(n);if(!c)throw new Error("No chain run to end.");return c.end_time=Date.now(),c.error=this.stringifyError(e),c.events.push({name:"error",time:new Date(c.end_time).toISOString()}),a?.inputs!==void 0&&(c.inputs=u0e(a.inputs,"input")),await this.onChainError?.(c),await this._endTrace(c),c}_createRunForToolStart(e,n,l,I,a,c,i){let s=this._getExecutionOrder(I),r=Date.now(),u={id:l,name:i??e.id[e.id.length-1],parent_run_id:I,start_time:r,serialized:e,events:[{name:"start",time:new Date(r).toISOString()}],inputs:{input:n},execution_order:s,child_execution_order:s,run_type:"tool",child_runs:[],extra:c?{metadata:c}:{},tags:a||[]};return this._addRunToRunMap(u)}async handleToolStart(e,n,l,I,a,c,i){let s=this.getRunById(l)??this._createRunForToolStart(e,n,l,I,a,c,i);return await this.onRunCreate?.(s),await this.onToolStart?.(s),s}async handleToolEnd(e,n){let l=this.getRunById(n);if(!l||l?.run_type!=="tool")throw new Error("No tool run to end");return l.end_time=Date.now(),l.outputs={output:e},l.events.push({name:"end",time:new Date(l.end_time).toISOString()}),await this.onToolEnd?.(l),await this._endTrace(l),l}async handleToolError(e,n){let l=this.getRunById(n);if(!l||l?.run_type!=="tool")throw new Error("No tool run to end");return l.end_time=Date.now(),l.error=this.stringifyError(e),l.events.push({name:"error",time:new Date(l.end_time).toISOString()}),await this.onToolError?.(l),await this._endTrace(l),l}async handleAgentAction(e,n){let l=this.getRunById(n);if(!l||l?.run_type!=="chain")return;let I=l;I.actions=I.actions||[],I.actions.push(e),I.events.push({name:"agent_action",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentAction?.(l)}async handleAgentEnd(e,n){let l=this.getRunById(n);!l||l?.run_type!=="chain"||(l.events.push({name:"agent_end",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentEnd?.(l))}_createRunForRetrieverStart(e,n,l,I,a,c,i){let s=this._getExecutionOrder(I),r=Date.now(),u={id:l,name:i??e.id[e.id.length-1],parent_run_id:I,start_time:r,serialized:e,events:[{name:"start",time:new Date(r).toISOString()}],inputs:{query:n},execution_order:s,child_execution_order:s,run_type:"retriever",child_runs:[],extra:c?{metadata:c}:{},tags:a||[]};return this._addRunToRunMap(u)}async handleRetrieverStart(e,n,l,I,a,c,i){let s=this.getRunById(l)??this._createRunForRetrieverStart(e,n,l,I,a,c,i);return await this.onRunCreate?.(s),await this.onRetrieverStart?.(s),s}async handleRetrieverEnd(e,n){let l=this.getRunById(n);if(!l||l?.run_type!=="retriever")throw new Error("No retriever run to end");return l.end_time=Date.now(),l.outputs={documents:e},l.events.push({name:"end",time:new Date(l.end_time).toISOString()}),await this.onRetrieverEnd?.(l),await this._endTrace(l),l}async handleRetrieverError(e,n){let l=this.getRunById(n);if(!l||l?.run_type!=="retriever")throw new Error("No retriever run to end");return l.end_time=Date.now(),l.error=this.stringifyError(e),l.events.push({name:"error",time:new Date(l.end_time).toISOString()}),await this.onRetrieverError?.(l),await this._endTrace(l),l}async handleText(e,n){let l=this.getRunById(n);!l||l?.run_type!=="chain"||(l.events.push({name:"text",time:new Date().toISOString(),kwargs:{text:e}}),await this.onText?.(l))}async handleLLMNewToken(e,n,l,I,a,c){let i=this.getRunById(l);if(!i||i?.run_type!=="llm")throw new Error('Invalid "runId" provided to "handleLLMNewToken" callback.');return i.events.push({name:"new_token",time:new Date().toISOString(),kwargs:{token:e,idx:n,chunk:c?.chunk}}),await this.onLLMNewToken?.(i,e,{chunk:c?.chunk}),i}}});var b0e=f((CBI,Mlt)=>{"use strict";var Blt=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Slt=(t=0)=>(e,n,l)=>`\x1B[${38+t};2;${e};${n};${l}m`;function $Cn(){let t=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[n,l]of Object.entries(e)){for(let[I,a]of Object.entries(l))e[I]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},l[I]=e[I],t.set(a[0],a[1]);Object.defineProperty(e,n,{value:l,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi256=Blt(),e.color.ansi16m=Slt(),e.bgColor.ansi256=Blt(10),e.bgColor.ansi16m=Slt(10),Object.defineProperties(e,{rgbToAnsi256:{value:(n,l,I)=>n===l&&l===I?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(l/255*5)+Math.round(I/255*5),enumerable:!1},hexToRgb:{value:n=>{let l=/(?[a-f\d]{6}|[a-f\d]{3})/i.exec(n.toString(16));if(!l)return[0,0,0];let{colorString:I}=l.groups;I.length===3&&(I=I.split("").map(c=>c+c).join(""));let a=Number.parseInt(I,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:n=>e.rgbToAnsi256(...e.hexToRgb(n)),enumerable:!1}}),e}Object.defineProperty(Mlt,"exports",{enumerable:!0,get:$Cn})});var p0e={};Xe(p0e,{ConsoleCallbackHandler:()=>C2});function om(t,e){return`${t.open}${e}${t.close}`}function EZ(t,e){try{return JSON.stringify(t,null,2)}catch{return e}}function Tlt(t){return typeof t=="string"?t.trim():t==null?t:EZ(t,t.toString())}function J2(t){if(!t.end_time)return"";let e=t.end_time-t.start_time;return e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}var m0e,Tm,C2,Y$=B(()=>{m0e=$(b0e(),1);QZ();({color:Tm}=m0e.default),C2=class extends Oc{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"console_callback_handler"})}persistRun(e){return Promise.resolve()}getParents(e){let n=[],l=e;for(;l.parent_run_id;){let I=this.runMap.get(l.parent_run_id);if(I)n.push(I),l=I;else break}return n}getBreadcrumbs(e){let l=[...this.getParents(e).reverse(),e].map((I,a,c)=>{let i=`${I.execution_order}:${I.run_type}:${I.name}`;return a===c.length-1?om(m0e.default.bold,i):i}).join(" > ");return om(Tm.grey,l)}onChainStart(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.green,"[chain/start]")} [${n}] Entering Chain run with input: ${EZ(e.inputs,"[inputs]")}`)}onChainEnd(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.cyan,"[chain/end]")} [${n}] [${J2(e)}] Exiting Chain run with output: ${EZ(e.outputs,"[outputs]")}`)}onChainError(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.red,"[chain/error]")} [${n}] [${J2(e)}] Chain run errored with error: ${EZ(e.error,"[error]")}`)}onLLMStart(e){let n=this.getBreadcrumbs(e),l="prompts"in e.inputs?{prompts:e.inputs.prompts.map(I=>I.trim())}:e.inputs;console.log(`${om(Tm.green,"[llm/start]")} [${n}] Entering LLM run with input: ${EZ(l,"[inputs]")}`)}onLLMEnd(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.cyan,"[llm/end]")} [${n}] [${J2(e)}] Exiting LLM run with output: ${EZ(e.outputs,"[response]")}`)}onLLMError(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.red,"[llm/error]")} [${n}] [${J2(e)}] LLM run errored with error: ${EZ(e.error,"[error]")}`)}onToolStart(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.green,"[tool/start]")} [${n}] Entering Tool run with input: "${Tlt(e.inputs.input)}"`)}onToolEnd(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.cyan,"[tool/end]")} [${n}] [${J2(e)}] Exiting Tool run with output: "${Tlt(e.outputs?.output)}"`)}onToolError(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.red,"[tool/error]")} [${n}] [${J2(e)}] Tool run errored with error: ${EZ(e.error,"[error]")}`)}onRetrieverStart(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.green,"[retriever/start]")} [${n}] Entering Retriever run with input: ${EZ(e.inputs,"[inputs]")}`)}onRetrieverEnd(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.cyan,"[retriever/end]")} [${n}] [${J2(e)}] Exiting Retriever run with output: ${EZ(e.outputs,"[outputs]")}`)}onRetrieverError(e){let n=this.getBreadcrumbs(e);console.log(`${om(Tm.red,"[retriever/error]")} [${n}] [${J2(e)}] Retriever run errored with error: ${EZ(e.error,"[error]")}`)}onAgentAction(e){let n=e,l=this.getBreadcrumbs(e);console.log(`${om(Tm.blue,"[agent/action]")} [${l}] Agent selected action: ${EZ(n.actions[n.actions.length-1],"[action]")}`)}}});var g5=B(()=>{M8()});var h0e,g$,Z0e=B(()=>{g5();zY();g$=()=>{if(h0e===void 0){let t=yt("LANGCHAIN_CALLBACKS_BACKGROUND")==="false"?{blockOnRootRunFinalization:!0}:{};h0e=new wN(t)}return h0e}});var W0e={};Xe(W0e,{LangChainTracer:()=>lb});var lb,vz=B(()=>{g5();W$();IAe();QZ();Z0e();lb=class t extends Oc{constructor(e={}){super(e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"langchain_tracer"}),Object.defineProperty(this,"projectName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"replicas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usesRunTreeMap",{enumerable:!0,configurable:!0,writable:!0,value:!0});let{exampleId:n,projectName:l,client:I,replicas:a}=e;this.projectName=l??hz(),this.replicas=a,this.exampleId=n,this.client=I??g$();let c=t.getTraceableRunTree();c&&this.updateFromRunTree(c)}async persistRun(e){}async onRunCreate(e){await this.getRunTreeWithTracingConfig(e.id)?.postRun()}async onRunUpdate(e){await this.getRunTreeWithTracingConfig(e.id)?.patchRun()}getRun(e){return this.runTreeMap.get(e)}updateFromRunTree(e){let n=e,l=new Set;for(;n.parent_run&&!(l.has(n.id)||(l.add(n.id),!n.parent_run));)n=n.parent_run;l.clear();let I=[n];for(;I.length>0;){let a=I.shift();!a||l.has(a.id)||(l.add(a.id),this.runTreeMap.set(a.id,a),a.child_runs&&I.push(...a.child_runs))}this.client=e.client??this.client,this.replicas=e.replicas??this.replicas,this.projectName=e.project_name??this.projectName,this.exampleId=e.reference_example_id??this.exampleId}getRunTreeWithTracingConfig(e){let n=this.runTreeMap.get(e);if(n)return new Bm({...n,client:this.client,project_name:this.projectName,replicas:this.replicas,reference_example_id:this.exampleId,tracingEnabled:!0})}static getTraceableRunTree(){try{return Het(!0)}catch{return}}}});var Dlt,zH,Klt,L2,fz=B(()=>{Dlt=Symbol.for("ls:tracing_async_local_storage"),zH=Symbol.for("lc:context_variables"),Klt=t=>{globalThis[Dlt]=t},L2=()=>globalThis[Dlt]});function e5n(){let t="default"in R$.default?R$.default.default:R$.default;return new t({autoStart:!0,concurrency:1})}function t5n(){return typeof BH>"u"&&(BH=e5n()),BH}async function Uc(t,e){if(e===!0){let n=L2();n!==void 0?await n.run(void 0,async()=>t()):await t()}else BH=t5n(),BH.add(async()=>{let n=L2();n!==void 0?await n.run(void 0,async()=>t()):await t()})}async function y$(){let t=g$();await Promise.allSettled([typeof BH<"u"?BH.onIdle():Promise.resolve(),t.awaitPendingTraceBatches()])}var R$,BH,_lt=B(()=>{R$=$(jH(),1);fz();Z0e()});var N0e={};Xe(N0e,{awaitAllCallbacks:()=>y$,consumeCallback:()=>Uc});var A$=B(()=>{_lt()});var Plt,qlt=B(()=>{zY();Plt=t=>t!==void 0?t:!!["LANGSMITH_TRACING_V2","LANGCHAIN_TRACING_V2","LANGSMITH_TRACING","LANGCHAIN_TRACING"].find(n=>yt(n)==="true")});function V0e(t){let e=L2();return e===void 0?void 0:e.getStore()?.[zH]?.[t]}var n5n,$lt,eIt=B(()=>{W$();fz();n5n=Symbol("lc:configure_hooks"),$lt=()=>V0e(n5n)||[]});var Y0e={};Xe(Y0e,{BaseCallbackManager:()=>F$,BaseRunManager:()=>SH,CallbackManager:()=>Lr,CallbackManagerForChainRun:()=>f$,CallbackManagerForLLMRun:()=>Xz,CallbackManagerForRetrieverRun:()=>v$,CallbackManagerForToolRun:()=>X$,TraceGroup:()=>w$,ensureHandler:()=>R5,parseCallbackConfigArg:()=>Hy,traceAsGroup:()=>I5n});function Hy(t){return t?Array.isArray(t)||"name"in t?{callbacks:t}:t:{}}function R5(t){return"name"in t?t:E2.fromMethods(t)}function l5n(t,e){return t&&!Array.isArray(t)&&typeof t=="object"?t:{[e]:t}}async function I5n(t,e,...n){let l=new w$(t.name,t),I=await l.start({...n});try{let a=await e(I,...n);return await l.end(l5n(a,"output")),a}catch(a){throw await l.error(a),a}}var F$,SH,v$,Xz,f$,X$,Lr,w$,Qy=B(()=>{uG();Y5();Y$();gy();zY();vz();A$();qlt();QZ();eIt();F$=class{setHandler(e){return this.setHandlers([e])}},SH=class{constructor(e,n,l,I,a,c,i,s){Object.defineProperty(this,"runId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"inheritableHandlers",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:I}),Object.defineProperty(this,"inheritableTags",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"inheritableMetadata",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_parentRunId",{enumerable:!0,configurable:!0,writable:!0,value:s})}get parentRunId(){return this._parentRunId}async handleText(e){await Promise.all(this.handlers.map(n=>Uc(async()=>{try{await n.handleText?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleText: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}async handleCustomEvent(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Uc(async()=>{try{await c.handleCustomEvent?.(e,n,this.runId,this.tags,this.metadata)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleCustomEvent: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}},v$=class extends SH{getChild(e){let n=new Lr(this.runId);return n.setHandlers(this.inheritableHandlers),n.addTags(this.inheritableTags),n.addMetadata(this.inheritableMetadata),e&&n.addTags([e],!1),n}async handleRetrieverEnd(e){await Promise.all(this.handlers.map(n=>Uc(async()=>{if(!n.ignoreRetriever)try{await n.handleRetrieverEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleRetriever`),n.raiseError)throw l}},n.awaitHandlers)))}async handleRetrieverError(e){await Promise.all(this.handlers.map(n=>Uc(async()=>{if(!n.ignoreRetriever)try{await n.handleRetrieverError?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleRetrieverError: ${l}`),n.raiseError)throw e}},n.awaitHandlers)))}},Xz=class extends SH{async handleLLMNewToken(e,n,l,I,a,c){await Promise.all(this.handlers.map(i=>Uc(async()=>{if(!i.ignoreLLM)try{await i.handleLLMNewToken?.(e,n??{prompt:0,completion:0},this.runId,this._parentRunId,this.tags,c)}catch(s){if((i.raiseError?console.error:console.warn)(`Error in handler ${i.constructor.name}, handleLLMNewToken: ${s}`),i.raiseError)throw s}},i.awaitHandlers)))}async handleLLMError(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Uc(async()=>{if(!c.ignoreLLM)try{await c.handleLLMError?.(e,this.runId,this._parentRunId,this.tags,a)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleLLMError: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}async handleLLMEnd(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Uc(async()=>{if(!c.ignoreLLM)try{await c.handleLLMEnd?.(e,this.runId,this._parentRunId,this.tags,a)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleLLMEnd: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}},f$=class extends SH{getChild(e){let n=new Lr(this.runId);return n.setHandlers(this.inheritableHandlers),n.addTags(this.inheritableTags),n.addMetadata(this.inheritableMetadata),e&&n.addTags([e],!1),n}async handleChainError(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Uc(async()=>{if(!c.ignoreChain)try{await c.handleChainError?.(e,this.runId,this._parentRunId,this.tags,a)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleChainError: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}async handleChainEnd(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Uc(async()=>{if(!c.ignoreChain)try{await c.handleChainEnd?.(e,this.runId,this._parentRunId,this.tags,a)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleChainEnd: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}async handleAgentAction(e){await Promise.all(this.handlers.map(n=>Uc(async()=>{if(!n.ignoreAgent)try{await n.handleAgentAction?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleAgentAction: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}async handleAgentEnd(e){await Promise.all(this.handlers.map(n=>Uc(async()=>{if(!n.ignoreAgent)try{await n.handleAgentEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleAgentEnd: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}},X$=class extends SH{getChild(e){let n=new Lr(this.runId);return n.setHandlers(this.inheritableHandlers),n.addTags(this.inheritableTags),n.addMetadata(this.inheritableMetadata),e&&n.addTags([e],!1),n}async handleToolError(e){await Promise.all(this.handlers.map(n=>Uc(async()=>{if(!n.ignoreAgent)try{await n.handleToolError?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleToolError: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}async handleToolEnd(e){await Promise.all(this.handlers.map(n=>Uc(async()=>{if(!n.ignoreAgent)try{await n.handleToolEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleToolEnd: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}},Lr=class t extends F${constructor(e,n){super(),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"inheritableHandlers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"inheritableTags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"inheritableMetadata",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"callback_manager"}),Object.defineProperty(this,"_parentRunId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.handlers=n?.handlers??this.handlers,this.inheritableHandlers=n?.inheritableHandlers??this.inheritableHandlers,this.tags=n?.tags??this.tags,this.inheritableTags=n?.inheritableTags??this.inheritableTags,this.metadata=n?.metadata??this.metadata,this.inheritableMetadata=n?.inheritableMetadata??this.inheritableMetadata,this._parentRunId=e}getParentRunId(){return this._parentRunId}async handleLLMStart(e,n,l=void 0,I=void 0,a=void 0,c=void 0,i=void 0,s=void 0){return Promise.all(n.map(async(r,u)=>{let o=u===0&&l?l:$n();return await Promise.all(this.handlers.map(d=>{if(!d.ignoreLLM)return UH(d)&&d._createRunForLLMStart(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s),Uc(async()=>{try{await d.handleLLMStart?.(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s)}catch(b){if((d.raiseError?console.error:console.warn)(`Error in handler ${d.constructor.name}, handleLLMStart: ${b}`),d.raiseError)throw b}},d.awaitHandlers)})),new Xz(o,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChatModelStart(e,n,l=void 0,I=void 0,a=void 0,c=void 0,i=void 0,s=void 0){return Promise.all(n.map(async(r,u)=>{let o=u===0&&l?l:$n();return await Promise.all(this.handlers.map(d=>{if(!d.ignoreLLM)return UH(d)&&d._createRunForChatModelStart(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s),Uc(async()=>{try{if(d.handleChatModelStart)await d.handleChatModelStart?.(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s);else if(d.handleLLMStart){let b=mr(r);await d.handleLLMStart?.(e,[b],o,this._parentRunId,a,this.tags,this.metadata,s)}}catch(b){if((d.raiseError?console.error:console.warn)(`Error in handler ${d.constructor.name}, handleLLMStart: ${b}`),d.raiseError)throw b}},d.awaitHandlers)})),new Xz(o,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChainStart(e,n,l=$n(),I=void 0,a=void 0,c=void 0,i=void 0){return await Promise.all(this.handlers.map(s=>{if(!s.ignoreChain)return UH(s)&&s._createRunForChainStart(e,n,l,this._parentRunId,this.tags,this.metadata,I,i),Uc(async()=>{try{await s.handleChainStart?.(e,n,l,this._parentRunId,this.tags,this.metadata,I,i)}catch(r){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleChainStart: ${r}`),s.raiseError)throw r}},s.awaitHandlers)})),new f$(l,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleToolStart(e,n,l=$n(),I=void 0,a=void 0,c=void 0,i=void 0){return await Promise.all(this.handlers.map(s=>{if(!s.ignoreAgent)return UH(s)&&s._createRunForToolStart(e,n,l,this._parentRunId,this.tags,this.metadata,i),Uc(async()=>{try{await s.handleToolStart?.(e,n,l,this._parentRunId,this.tags,this.metadata,i)}catch(r){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleToolStart: ${r}`),s.raiseError)throw r}},s.awaitHandlers)})),new X$(l,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleRetrieverStart(e,n,l=$n(),I=void 0,a=void 0,c=void 0,i=void 0){return await Promise.all(this.handlers.map(s=>{if(!s.ignoreRetriever)return UH(s)&&s._createRunForRetrieverStart(e,n,l,this._parentRunId,this.tags,this.metadata,i),Uc(async()=>{try{await s.handleRetrieverStart?.(e,n,l,this._parentRunId,this.tags,this.metadata,i)}catch(r){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleRetrieverStart: ${r}`),s.raiseError)throw r}},s.awaitHandlers)})),new v$(l,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleCustomEvent(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Uc(async()=>{if(!c.ignoreCustomEvent)try{await c.handleCustomEvent?.(e,n,l,this.tags,this.metadata)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleCustomEvent: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}addHandler(e,n=!0){this.handlers.push(e),n&&this.inheritableHandlers.push(e)}removeHandler(e){this.handlers=this.handlers.filter(n=>n!==e),this.inheritableHandlers=this.inheritableHandlers.filter(n=>n!==e)}setHandlers(e,n=!0){this.handlers=[],this.inheritableHandlers=[];for(let l of e)this.addHandler(l,n)}addTags(e,n=!0){this.removeTags(e),this.tags.push(...e),n&&this.inheritableTags.push(...e)}removeTags(e){this.tags=this.tags.filter(n=>!e.includes(n)),this.inheritableTags=this.inheritableTags.filter(n=>!e.includes(n))}addMetadata(e,n=!0){this.metadata={...this.metadata,...e},n&&(this.inheritableMetadata={...this.inheritableMetadata,...e})}removeMetadata(e){for(let n of Object.keys(e))delete this.metadata[n],delete this.inheritableMetadata[n]}copy(e=[],n=!0){let l=new t(this._parentRunId);for(let I of this.handlers){let a=this.inheritableHandlers.includes(I);l.addHandler(I,a)}for(let I of this.tags){let a=this.inheritableTags.includes(I);l.addTags([I],a)}for(let I of Object.keys(this.metadata)){let a=Object.keys(this.inheritableMetadata).includes(I);l.addMetadata({[I]:this.metadata[I]},a)}for(let I of e)l.handlers.filter(a=>a.name==="console_callback_handler").some(a=>a.name===I.name)||l.addHandler(I,n);return l}static fromHandlers(e){class n extends E2{constructor(){super(),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:$n()}),Object.assign(this,e)}}let l=new this;return l.addHandler(new n),l}static configure(e,n,l,I,a,c,i){return this._configureSync(e,n,l,I,a,c,i)}static _configureSync(e,n,l,I,a,c,i){let s;(e||n)&&(Array.isArray(e)||!e?(s=new t,s.setHandlers(e?.map(R5)??[],!0)):s=e,s=s.copy(Array.isArray(n)?n.map(R5):n?.handlers,!1));let r=yt("LANGCHAIN_VERBOSE")==="true"||i?.verbose,u=lb.getTraceableRunTree()?.tracingEnabled||Plt(),o=u||(yt("LANGCHAIN_TRACING")??!1);if(r||o){if(s||(s=new t),r&&!s.handlers.some(d=>d.name===C2.prototype.name)){let d=new C2;s.addHandler(d,!0)}if(o&&!s.handlers.some(d=>d.name==="langchain_tracer")&&u){let d=new lb;s.addHandler(d,!0),s._parentRunId=lb.getTraceableRunTree()?.id??s._parentRunId}}for(let{contextVar:d,inheritable:b=!0,handlerClass:h,envVar:Z}of $lt()){let N=Z&&yt(Z)==="true"&&h,g,y=d!==void 0?V0e(d):void 0;y&&i0e(y)?g=y:N&&(g=new h({})),g!==void 0&&(s||(s=new t),s.handlers.some(X=>X.name===g.name)||s.addHandler(g,b))}return(l||I)&&s&&(s.addTags(l??[]),s.addTags(I??[],!1)),(a||c)&&s&&(s.addMetadata(a??{}),s.addMetadata(c??{},!1)),s}};w$=class{constructor(e,n){Object.defineProperty(this,"groupName",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"runManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async getTraceGroupCallbackManager(e,n,l){let I=new lb(l),c=await(await Lr.configure([I]))?.handleChainStart({lc:1,type:"not_implemented",id:["langchain","callbacks","groups",e]},n??{});if(!c)throw new Error("Failed to create run group callback manager.");return c}async start(e){return this.runManager||(this.runManager=await this.getTraceGroupCallbackManager(this.groupName,e,this.options)),this.runManager.getChild()}async error(e){this.runManager&&(await this.runManager.handleChainError(e),this.runManager=void 0)}async end(e){this.runManager&&(await this.runManager.handleChainEnd(e??{}),this.runManager=void 0)}}});var H$,a5n,tIt,g0e,Ib,nIt=B(()=>{g5();fz();Qy();H$=class{getStore(){}run(e,n){return n()}enterWith(e){}},a5n=new H$,tIt=Symbol.for("lc:child_config"),g0e=class{getInstance(){return L2()??a5n}getRunnableConfig(){return this.getInstance().getStore()?.extra?.[tIt]}runWithConfig(e,n,l){let I=Lr._configureSync(e?.callbacks,void 0,e?.tags,void 0,e?.metadata),a=this.getInstance(),c=a.getStore(),i=I?.getParentRunId(),s=I?.handlers?.find(u=>u?.name==="langchain_tracer"),r;return s&&i?r=s.getRunTreeWithTracingConfig(i):l||(r=new Bm({name:"",tracingEnabled:!1})),r&&(r.extra={...r.extra,[tIt]:e}),c!==void 0&&c[zH]!==void 0&&(r===void 0&&(r={}),r[zH]=c[zH]),a.run(r,n)}initializeGlobalInstance(e){L2()===void 0&&Klt(e)}},Ib=new g0e});var y5=B(()=>{nIt();fz()});async function Ao(t){return Lr._configureSync(t?.callbacks,void 0,t?.tags,void 0,t?.metadata)}function wz(...t){let e={};for(let n of t.filter(l=>!!l))for(let l of Object.keys(n))if(l==="metadata")e[l]={...e[l],...n[l]};else if(l==="tags"){let I=e[l]??[];e[l]=[...new Set(I.concat(n[l]??[]))]}else if(l==="configurable")e[l]={...e[l],...n[l]};else if(l==="timeout")e.timeout===void 0?e.timeout=n.timeout:n.timeout!==void 0&&(e.timeout=Math.min(e.timeout,n.timeout));else if(l==="signal")e.signal===void 0?e.signal=n.signal:n.signal!==void 0&&("any"in AbortSignal?e.signal=AbortSignal.any([e.signal,n.signal]):e.signal=n.signal);else if(l==="callbacks"){let I=e.callbacks,a=n.callbacks;if(Array.isArray(a))if(!I)e.callbacks=a;else if(Array.isArray(I))e.callbacks=I.concat(a);else{let c=I.copy();for(let i of a)c.addHandler(R5(i),!0);e.callbacks=c}else if(a)if(!I)e.callbacks=a;else if(Array.isArray(I)){let c=a.copy();for(let i of I)c.addHandler(R5(i),!0);e.callbacks=c}else e.callbacks=new Lr(a._parentRunId,{handlers:I.handlers.concat(a.handlers),inheritableHandlers:I.inheritableHandlers.concat(a.inheritableHandlers),tags:Array.from(new Set(I.tags.concat(a.tags))),inheritableTags:Array.from(new Set(I.inheritableTags.concat(a.inheritableTags))),metadata:{...I.metadata,...a.metadata}})}else{let I=l;e[I]=n[I]??e[I]}return e}function Xl(t){let e=Ib.getRunnableConfig(),n={tags:[],metadata:{},recursionLimit:25,runId:void 0};if(e){let{runId:l,runName:I,...a}=e;n=Object.entries(a).reduce((c,[i,s])=>(s!==void 0&&(c[i]=s),c),n)}if(t&&(n=Object.entries(t).reduce((l,[I,a])=>(a!==void 0&&(l[I]=a),l),n)),n?.configurable)for(let l of Object.keys(n.configurable))r5n.has(typeof n.configurable[l])&&!n.metadata?.[l]&&(n.metadata||(n.metadata={}),n.metadata[l]=n.configurable[l]);if(n.timeout!==void 0){if(n.timeout<=0)throw new Error("Timeout must be a positive number");let l=AbortSignal.timeout(n.timeout);n.signal!==void 0?"any"in AbortSignal&&(n.signal=AbortSignal.any([n.signal,l])):n.signal=l,delete n.timeout}return n}function wI(t={},{callbacks:e,maxConcurrency:n,recursionLimit:l,runName:I,configurable:a,runId:c}={}){let i=Xl(t);return e!==void 0&&(delete i.runName,i.callbacks=e),l!==void 0&&(i.recursionLimit=l),n!==void 0&&(i.maxConcurrency=n),I!==void 0&&(i.runName=I),a!==void 0&&(i.configurable={...i.configurable,...a}),c!==void 0&&delete i.runId,i}function Dm(t){return t?{configurable:t.configurable,recursionLimit:t.recursionLimit,callbacks:t.callbacks,tags:t.tags,metadata:t.metadata,maxConcurrency:t.maxConcurrency,timeout:t.timeout,signal:t.signal}:void 0}var Q$,r5n,HN=B(()=>{Qy();y5();Q$=25;r5n=new Set(["string","number","boolean"])});async function BY(t,e){if(e===void 0)return t;let n;return Promise.race([t.catch(l=>{if(!e?.aborted)throw l}),new Promise((l,I)=>{n=()=>{I(new Error("Aborted"))},e.addEventListener("abort",n),e.aborted&&I(new Error("Aborted"))})]).finally(()=>e.removeEventListener("abort",n))}var R0e=B(()=>{});var A0e={};Xe(A0e,{AsyncGeneratorWithSetup:()=>SY,IterableReadableStream:()=>Uo,atee:()=>E$,concat:()=>Fo,pipeGeneratorWithSetup:()=>y0e});function E$(t,e=2){let n=Array.from({length:e},()=>[]);return n.map(async function*(I){for(;;)if(I.length===0){let a=await t.next();for(let c of n)c.push(a)}else{if(I[0].done)return;yield I.shift().value}})}function Fo(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.concat(e);if(typeof t=="string"&&typeof e=="string")return t+e;if(typeof t=="number"&&typeof e=="number")return t+e;if("concat"in t&&typeof t.concat=="function")return t.concat(e);if(typeof t=="object"&&typeof e=="object"){let n={...t};for(let[l,I]of Object.entries(e))l in n&&!Array.isArray(n[l])?n[l]=Fo(n[l],I):n[l]=I;return n}else throw new Error(`Cannot concat ${typeof t} and ${typeof e}`)}async function y0e(t,e,n,l,...I){let a=new SY({generator:e,startSetup:n,signal:l}),c=await a.setup;return{output:t(a,c,...I),setup:c}}var Uo,SY,JZ=B(()=>{HN();y5();R0e();Uo=class t extends ReadableStream{constructor(){super(...arguments),Object.defineProperty(this,"reader",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{let e=await this.reader.read();return e.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:e.value}}catch(e){throw this.reader.releaseLock(),e}}async return(){if(this.ensureReader(),this.locked){let e=this.reader.cancel();this.reader.releaseLock(),await e}return{done:!0,value:void 0}}async throw(e){if(this.ensureReader(),this.locked){let n=this.reader.cancel();this.reader.releaseLock(),await n}throw e}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(e){let n=e.getReader();return new t({start(l){return I();function I(){return n.read().then(({done:a,value:c})=>{if(a){l.close();return}return l.enqueue(c),I()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(e){return new t({async pull(n){let{value:l,done:I}=await e.next();I&&n.close(),n.enqueue(l)},async cancel(n){await e.return(n)}})}};SY=class{constructor(e){Object.defineProperty(this,"generator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"setup",{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,"signal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"firstResult",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"firstResultUsed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.generator=e.generator,this.config=e.config,this.signal=e.signal??this.config?.signal,this.setup=new Promise((n,l)=>{Ib.runWithConfig(Dm(e.config),async()=>{this.firstResult=e.generator.next(),e.startSetup?this.firstResult.then(e.startSetup).then(n,l):this.firstResult.then(I=>n(void 0),l)},!0)})}async next(...e){return this.signal?.throwIfAborted(),this.firstResultUsed?Ib.runWithConfig(Dm(this.config),this.signal?async()=>BY(this.generator.next(...e),this.signal):async()=>this.generator.next(...e),!0):(this.firstResultUsed=!0,this.firstResult)}async return(e){return this.generator.return(e)}async throw(e){return this.generator.throw(e)}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}}});var v0e={};Xe(v0e,{LogStreamCallbackHandler:()=>A5,RunLog:()=>k2,RunLogPatch:()=>Km,isLogStreamHandler:()=>F0e});async function lIt(t,e){if(e==="original")throw new Error("Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.");let{inputs:n}=t;if(["retriever","llm","prompt"].includes(t.run_type))return n;if(!(Object.keys(n).length===1&&n?.input===""))return n.input}async function IIt(t,e){let{outputs:n}=t;return e==="original"||["retriever","llm","prompt"].includes(t.run_type)?n:n!==void 0&&Object.keys(n).length===1&&n?.output!==void 0?n.output:n}function c5n(t){return t!==void 0&&t.message!==void 0}var Km,k2,F0e,A5,J$=B(()=>{rAe();QZ();JZ();ZH();Km=class{constructor(e){Object.defineProperty(this,"ops",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ops=e.ops??[]}concat(e){let n=this.ops.concat(e.ops),l=vy({},n);return new k2({ops:n,state:l[l.length-1].newDocument})}},k2=class t extends Km{constructor(e){super(e),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.state=e.state}concat(e){let n=this.ops.concat(e.ops),l=vy(this.state,e.ops);return new t({ops:n,state:l[l.length-1].newDocument})}static fromRunLogPatch(e){let n=vy({},e.ops);return new t({ops:e.ops,state:n[n.length-1].newDocument})}},F0e=t=>t.name==="log_stream_tracer";A5=class extends Oc{constructor(e){super({_awaitHandler:!0,...e}),Object.defineProperty(this,"autoClose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"includeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_schemaFormat",{enumerable:!0,configurable:!0,writable:!0,value:"original"}),Object.defineProperty(this,"rootId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyMapByRunId",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"counterMapByRunName",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"transformStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"receiveStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"log_stream_tracer"}),Object.defineProperty(this,"lc_prefer_streaming",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this._schemaFormat=e?._schemaFormat??this._schemaFormat,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=Uo.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){if(e.id===this.rootId)return!1;let n=e.tags??[],l=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(l=l||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(l=l||this.includeTypes.includes(e.run_type)),this.includeTags!==void 0&&(l=l||n.find(I=>this.includeTags?.includes(I))!==void 0),this.excludeNames!==void 0&&(l=l&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(l=l&&!this.excludeTypes.includes(e.run_type)),this.excludeTags!==void 0&&(l=l&&n.every(I=>!this.excludeTags?.includes(I))),l}async*tapOutputIterable(e,n){for await(let l of n){if(e!==this.rootId){let I=this.keyMapByRunId[e];I&&await this.writer.write(new Km({ops:[{op:"add",path:`/logs/${I}/streamed_output/-`,value:l}]}))}yield l}}async onRunCreate(e){if(this.rootId===void 0&&(this.rootId=e.id,await this.writer.write(new Km({ops:[{op:"replace",path:"",value:{id:e.id,name:e.name,type:e.run_type,streamed_output:[],final_output:void 0,logs:{}}}]}))),!this._includeRun(e))return;this.counterMapByRunName[e.name]===void 0&&(this.counterMapByRunName[e.name]=0),this.counterMapByRunName[e.name]+=1;let n=this.counterMapByRunName[e.name];this.keyMapByRunId[e.id]=n===1?e.name:`${e.name}:${n}`;let l={id:e.id,name:e.name,type:e.run_type,tags:e.tags??[],metadata:e.extra?.metadata??{},start_time:new Date(e.start_time).toISOString(),streamed_output:[],streamed_output_str:[],final_output:void 0,end_time:void 0};this._schemaFormat==="streaming_events"&&(l.inputs=await lIt(e,this._schemaFormat)),await this.writer.write(new Km({ops:[{op:"add",path:`/logs/${this.keyMapByRunId[e.id]}`,value:l}]}))}async onRunUpdate(e){try{let n=this.keyMapByRunId[e.id];if(n===void 0)return;let l=[];this._schemaFormat==="streaming_events"&&l.push({op:"replace",path:`/logs/${n}/inputs`,value:await lIt(e,this._schemaFormat)}),l.push({op:"add",path:`/logs/${n}/final_output`,value:await IIt(e,this._schemaFormat)}),e.end_time!==void 0&&l.push({op:"add",path:`/logs/${n}/end_time`,value:new Date(e.end_time).toISOString()});let I=new Km({ops:l});await this.writer.write(I)}finally{if(e.id===this.rootId){let n=new Km({ops:[{op:"replace",path:"/final_output",value:await IIt(e,this._schemaFormat)}]});await this.writer.write(n),this.autoClose&&await this.writer.close()}}}async onLLMNewToken(e,n,l){let I=this.keyMapByRunId[e.id];if(I===void 0)return;let a=e.inputs.messages!==void 0,c;a?c5n(l?.chunk)?c=l?.chunk:c=new Jl({id:`run-${e.id}`,content:n}):c=n;let i=new Km({ops:[{op:"add",path:`/logs/${I}/streamed_output_str/-`,value:n},{op:"add",path:`/logs/${I}/streamed_output/-`,value:c}]});await this.writer.write(i)}}});var f0e={};Xe(f0e,{ChatGenerationChunk:()=>Io,GenerationChunk:()=>zo,RUN_KEY:()=>cc});var cc,zo,Io,Ey=B(()=>{cc="__run",zo=class t{constructor(e){Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generationInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.text=e.text,this.generationInfo=e.generationInfo}concat(e){return new t({text:this.text+e.text,generationInfo:{...this.generationInfo,...e.generationInfo}})}},Io=class t extends zo{constructor(e){super(e),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.message=e.message}concat(e){return new t({text:this.text+e.text,generationInfo:{...this.generationInfo,...e.generationInfo},message:this.message.concat(e.message)})}}});function C$({name:t,serialized:e}){return t!==void 0?t:e?.name!==void 0?e.name:e?.id!==void 0&&Array.isArray(e?.id)?e.id[e.id.length-1]:"Unnamed"}var aIt,L$,rIt=B(()=>{QZ();JZ();ZH();Ey();aIt=t=>t.name==="event_stream_tracer",L$=class extends Oc{constructor(e){super({_awaitHandler:!0,...e}),Object.defineProperty(this,"autoClose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"includeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runInfoMap",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"tappedPromises",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"transformStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"receiveStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"event_stream_tracer"}),Object.defineProperty(this,"lc_prefer_streaming",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=Uo.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){let n=e.tags??[],l=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(l=l||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(l=l||this.includeTypes.includes(e.runType)),this.includeTags!==void 0&&(l=l||n.find(I=>this.includeTags?.includes(I))!==void 0),this.excludeNames!==void 0&&(l=l&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(l=l&&!this.excludeTypes.includes(e.runType)),this.excludeTags!==void 0&&(l=l&&n.every(I=>!this.excludeTags?.includes(I))),l}async*tapOutputIterable(e,n){let l=await n.next();if(l.done)return;let I=this.runInfoMap.get(e);if(I===void 0){yield l.value;return}function a(i,s){return i==="llm"&&typeof s=="string"?new zo({text:s}):s}let c=this.tappedPromises.get(e);if(c===void 0){let i;c=new Promise(s=>{i=s}),this.tappedPromises.set(e,c);try{let s={event:`on_${I.runType}_stream`,run_id:e,name:I.name,tags:I.tags,metadata:I.metadata,data:{}};await this.send({...s,data:{chunk:a(I.runType,l.value)}},I),yield l.value;for await(let r of n)I.runType!=="tool"&&I.runType!=="retriever"&&await this.send({...s,data:{chunk:a(I.runType,r)}},I),yield r}finally{i()}}else{yield l.value;for await(let i of n)yield i}}async send(e,n){this._includeRun(n)&&await this.writer.write(e)}async sendEndEvent(e,n){let l=this.tappedPromises.get(e.run_id);l!==void 0?l.then(()=>{this.send(e,n)}):await this.send(e,n)}async onLLMStart(e){let n=C$(e),l=e.inputs.messages!==void 0?"chat_model":"llm",I={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:l,inputs:e.inputs};this.runInfoMap.set(e.id,I);let a=`on_${l}_start`;await this.send({event:a,data:{input:e.inputs},name:n,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},I)}async onLLMNewToken(e,n,l){let I=this.runInfoMap.get(e.id),a,c;if(I===void 0)throw new Error(`onLLMNewToken: Run ID ${e.id} not found in run map.`);if(this.runInfoMap.size!==1){if(I.runType==="chat_model")c="on_chat_model_stream",l?.chunk===void 0?a=new Jl({content:n,id:`run-${e.id}`}):a=l.chunk.message;else if(I.runType==="llm")c="on_llm_stream",l?.chunk===void 0?a=new zo({text:n}):a=l.chunk;else throw new Error(`Unexpected run type ${I.runType}`);await this.send({event:c,data:{chunk:a},run_id:e.id,name:I.name,tags:I.tags,metadata:I.metadata},I)}}async onLLMEnd(e){let n=this.runInfoMap.get(e.id);this.runInfoMap.delete(e.id);let l;if(n===void 0)throw new Error(`onLLMEnd: Run ID ${e.id} not found in run map.`);let I=e.outputs?.generations,a;if(n.runType==="chat_model"){for(let c of I??[]){if(a!==void 0)break;a=c[0]?.message}l="on_chat_model_end"}else if(n.runType==="llm")a={generations:I?.map(c=>c.map(i=>({text:i.text,generationInfo:i.generationInfo}))),llmOutput:e.outputs?.llmOutput??{}},l="on_llm_end";else throw new Error(`onLLMEnd: Unexpected run type: ${n.runType}`);await this.sendEndEvent({event:l,data:{output:a,input:n.inputs},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}async onChainStart(e){let n=C$(e),l=e.run_type??"chain",I={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:e.run_type},a={};e.inputs.input===""&&Object.keys(e.inputs).length===1?(a={},I.inputs={}):e.inputs.input!==void 0?(a.input=e.inputs.input,I.inputs=e.inputs.input):(a.input=e.inputs,I.inputs=e.inputs),this.runInfoMap.set(e.id,I),await this.send({event:`on_${l}_start`,data:a,name:n,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},I)}async onChainEnd(e){let n=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),n===void 0)throw new Error(`onChainEnd: Run ID ${e.id} not found in run map.`);let l=`on_${e.run_type}_end`,I=e.inputs??n.inputs??{},c={output:e.outputs?.output??e.outputs,input:I};I.input&&Object.keys(I).length===1&&(c.input=I.input,n.inputs=I.input),await this.sendEndEvent({event:l,data:c,run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata??{}},n)}async onToolStart(e){let n=C$(e),l={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:"tool",inputs:e.inputs??{}};this.runInfoMap.set(e.id,l),await this.send({event:"on_tool_start",data:{input:e.inputs??{}},name:n,run_id:e.id,tags:e.tags??[],metadata:e.extra?.metadata??{}},l)}async onToolEnd(e){let n=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),n===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(n.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);let l=e.outputs?.output===void 0?e.outputs:e.outputs.output;await this.sendEndEvent({event:"on_tool_end",data:{output:l,input:n.inputs},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}async onRetrieverStart(e){let n=C$(e),I={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:"retriever",inputs:{query:e.inputs.query}};this.runInfoMap.set(e.id,I),await this.send({event:"on_retriever_start",data:{input:{query:e.inputs.query}},name:n,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},I)}async onRetrieverEnd(e){let n=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),n===void 0)throw new Error(`onRetrieverEnd: Run ID ${e.id} not found in run map.`);await this.sendEndEvent({event:"on_retriever_end",data:{output:e.outputs?.documents??e.outputs,input:n.inputs},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}async handleCustomEvent(e,n,l){let I=this.runInfoMap.get(l);if(I===void 0)throw new Error(`handleCustomEvent: Run ID ${l} not found in run map.`);await this.send({event:"on_custom_event",run_id:l,name:e,tags:I.tags,metadata:I.metadata,data:n},I)}async finish(){let e=[...this.tappedPromises.values()];Promise.all(e).finally(()=>{this.writer.close()})}}});var X0e={};Xe(X0e,{AsyncCaller:()=>_u});var cIt,k$,o5n,i5n,_u,MH=B(()=>{cIt=$(CH(),1),k$=$(jH(),1),o5n=[400,401,402,403,404,405,406,407,409],i5n=t=>{if(t.message.startsWith("Cancel")||t.message.startsWith("AbortError")||t.name==="AbortError"||t?.code==="ECONNABORTED")throw t;let e=t?.response?.status??t?.status;if(e&&o5n.includes(+e))throw t;if(t?.error?.code==="insufficient_quota"){let n=new Error(t?.message);throw n.name="InsufficientQuotaError",n}},_u=class{constructor(e){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedAttempt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,this.onFailedAttempt=e.onFailedAttempt??i5n;let n="default"in k$.default?k$.default.default:k$.default;this.queue=new n({concurrency:this.maxConcurrency})}call(e,...n){return this.queue.add(()=>(0,cIt.default)(()=>e(...n).catch(l=>{throw l instanceof Error?l:new Error(l)}),{onFailedAttempt:this.onFailedAttempt,retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,n,...l){return e.signal?Promise.race([this.call(n,...l),new Promise((I,a)=>{e.signal?.addEventListener("abort",()=>{a(new Error("AbortError"))})})]):this.call(n,...l)}fetch(...e){return this.call(()=>fetch(...e).then(n=>n.ok?n:Promise.reject(n)))}}});var Hz,oIt=B(()=>{QZ();Hz=class extends Oc{constructor({config:e,onStart:n,onEnd:l,onError:I}){super({_awaitHandler:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RootListenersTracer"}),Object.defineProperty(this,"rootId",{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,"argOnStart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"argOnEnd",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"argOnError",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.config=e,this.argOnStart=n,this.argOnEnd=l,this.argOnError=I}persistRun(e){return Promise.resolve()}async onRunCreate(e){this.rootId||(this.rootId=e.id,this.argOnStart&&await this.argOnStart(e,this.config))}async onRunUpdate(e){e.id===this.rootId&&(e.error?this.argOnError&&await this.argOnError(e,this.config):this.argOnEnd&&await this.argOnEnd(e,this.config))}}});function Qz(t){return t?t.lc_runnable:!1}var x$,w0e=B(()=>{x$=class{constructor(e){Object.defineProperty(this,"includeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.includeNames=e.includeNames,this.includeTypes=e.includeTypes,this.includeTags=e.includeTags,this.excludeNames=e.excludeNames,this.excludeTypes=e.excludeTypes,this.excludeTags=e.excludeTags}includeEvent(e,n){let l=this.includeNames===void 0&&this.includeTypes===void 0&&this.includeTags===void 0,I=e.tags??[];return this.includeNames!==void 0&&(l=l||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(l=l||this.includeTypes.includes(n)),this.includeTags!==void 0&&(l=l||I.some(a=>this.includeTags?.includes(a))),this.excludeNames!==void 0&&(l=l&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(l=l&&!this.excludeTypes.includes(n)),this.excludeTags!==void 0&&(l=l&&I.every(a=>!this.excludeTags?.includes(a))),l}}});function H0e(t){return t.replace(/[^a-zA-Z-_0-9]/g,"_")}function u5n(t){let e="";for(let[n,l]of Object.entries(t))e+=` classDef ${n} ${l}; +`;return e}function iIt(t,e,n){let{firstNode:l,lastNode:I,nodeColors:a,withStyles:c=!0,curveStyle:i="linear",wrapLabelNWords:s=9}=n??{},r=c?`%%{init: {'flowchart': {'curve': '${i}'}}}%% +graph TD; +`:`graph TD; +`;if(c){let b="default",h={[b]:"{0}({1})"};l!==void 0&&(h[l]="{0}([{1}]):::first"),I!==void 0&&(h[I]="{0}([{1}]):::last");for(let[Z,N]of Object.entries(t)){let g=N.name.split(":").pop()??"",X=s5n.some(H=>g.startsWith(H)&&g.endsWith(H))?`

${g}

`:g;Object.keys(N.metadata??{}).length&&(X+=`
${Object.entries(N.metadata??{}).map(([H,Q])=>`${H} = ${Q}`).join(` +`)}`);let v=(h[Z]??h[b]).replace("{0}",H0e(Z)).replace("{1}",X);r+=` ${v} +`}}let u={};for(let b of e){let h=b.source.split(":"),Z=b.target.split(":"),N=h.filter((g,y)=>g===Z[y]).join(":");u[N]||(u[N]=[]),u[N].push(b)}let o=new Set;function d(b,h){let Z=b.length===1&&b[0].source===b[0].target;if(h&&!Z){let N=h.split(":").pop();if(o.has(N))throw new Error(`Found duplicate subgraph '${N}' -- this likely means that you're reusing a subgraph node with the same name. Please adjust your graph to have subgraph nodes with unique names.`);o.add(N),r+=` subgraph ${N} +`}for(let N of b){let{source:g,target:y,data:X,conditional:v}=N,H="";if(X!==void 0){let Q=X,L=Q.split(" ");L.length>s&&(Q=Array.from({length:Math.ceil(L.length/s)},(J,O)=>L.slice(O*s,(O+1)*s).join(" ")).join(" 
 ")),H=v?` -.  ${Q}  .-> `:` --  ${Q}  --> `}else H=v?" -.-> ":" --> ";r+=` ${H0e(g)}${H}${H0e(y)}; +`}for(let N in u)N.startsWith(`${h}:`)&&N!==h&&d(u[N],N);h&&!Z&&(r+=` end +`)}d(u[""]??[],"");for(let b in u)!b.includes(":")&&b!==""&&d(u[b],b);return c&&(r+=u5n(a??{})),r}async function sIt(t,e){let{backgroundColor:n="white"}=e??{},l=btoa(t);n!==void 0&&(/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(n)||(n=`!${n}`));let I=`https://mermaid.ink/img/${l}?bgColor=${n}`,a=await fetch(I);if(!a.ok)throw new Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${a.status}`,`Status text: ${a.statusText}`].join(` +`));return await a.blob()}var s5n,uIt=B(()=>{s5n=["*","_","`"]});function j2(t,e,n){function l(i,s){var r;Object.defineProperty(i,"_zod",{value:i._zod??{},enumerable:!1}),(r=i._zod).traits??(r.traits=new Set),i._zod.traits.add(t),e(i,s);for(let u in c.prototype)u in i||Object.defineProperty(i,u,{value:c.prototype[u].bind(i)});i._zod.constr=c,i._zod.def=s}let I=n?.Parent??Object;class a extends I{}Object.defineProperty(a,"name",{value:t});function c(i){var s;let r=n?.Parent?new a:this;l(r,i),(s=r._zod).deferred??(s.deferred=[]);for(let u of r._zod.deferred)u();return r}return Object.defineProperty(c,"init",{value:l}),Object.defineProperty(c,Symbol.hasInstance,{value:i=>n?.Parent&&i instanceof n.Parent?!0:i?._zod?.traits?.has(t)}),Object.defineProperty(c,"name",{value:t}),c}function F5(t){return t&&Object.assign(Q0e,t),Q0e}var OSI,USI,x2,Q0e,Ez=B(()=>{OSI=Object.freeze({status:"aborted"});USI=Symbol("zod_brand"),x2=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Q0e={}});var Jy={};Xe(Jy,{BIGINT_FORMAT_RANGES:()=>F5n,Class:()=>E0e,NUMBER_FORMAT_RANGES:()=>A5n,aborted:()=>Cz,allowsEval:()=>bIt,assert:()=>p5n,assertEqual:()=>d5n,assertIs:()=>b5n,assertNever:()=>m5n,assertNotEqual:()=>G5n,assignProp:()=>k0e,cached:()=>C0e,captureStackTrace:()=>z$,cleanEnum:()=>C5n,cleanRegex:()=>L0e,clone:()=>im,createTransparentProxy:()=>y5n,defineLazy:()=>U$,esc:()=>GIt,escapeRegex:()=>hIt,extend:()=>X5n,finalizeIssue:()=>TH,floatSafeRemainder:()=>W5n,getElementAtPath:()=>N5n,getEnumValues:()=>O$,getLengthableOrigin:()=>J5n,getParsedType:()=>R5n,getSizableOrigin:()=>E5n,isObject:()=>j$,isPlainObject:()=>x0e,issue:()=>VIt,joinValues:()=>h5n,jsonStringifyReplacer:()=>J0e,merge:()=>w5n,normalizeParams:()=>j0e,nullish:()=>Z5n,numKeys:()=>g5n,omit:()=>f5n,optionalKeys:()=>WIt,partial:()=>H5n,pick:()=>v5n,prefixIssues:()=>NIt,primitiveTypes:()=>pIt,promiseAllObject:()=>V5n,propertyKeyTypes:()=>mIt,randomString:()=>Y5n,required:()=>Q5n,stringifyPrimitive:()=>ZIt,unwrapMessage:()=>Jz});function d5n(t){return t}function G5n(t){return t}function b5n(t){}function m5n(t){throw new Error}function p5n(t){}function O$(t){let e=Object.values(t).filter(l=>typeof l=="number");return Object.entries(t).filter(([l,I])=>e.indexOf(+l)===-1).map(([l,I])=>I)}function h5n(t,e="|"){return t.map(n=>ZIt(n)).join(e)}function J0e(t,e){return typeof e=="bigint"?e.toString():e}function C0e(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Z5n(t){return t==null}function L0e(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function W5n(t,e){let n=(t.toString().split(".")[1]||"").length,l=(e.toString().split(".")[1]||"").length,I=n>l?n:l,a=Number.parseInt(t.toFixed(I).replace(".","")),c=Number.parseInt(e.toFixed(I).replace(".",""));return a%c/10**I}function U$(t,e,n){Object.defineProperty(t,e,{get(){{let I=n();return t[e]=I,I}throw new Error("cached value already set")},set(I){Object.defineProperty(t,e,{value:I})},configurable:!0})}function k0e(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function N5n(t,e){return e?e.reduce((n,l)=>n?.[l],t):t}function V5n(t){let e=Object.keys(t),n=e.map(l=>t[l]);return Promise.all(n).then(l=>{let I={};for(let a=0;ae};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function y5n(t){let e;return new Proxy({},{get(n,l,I){return e??(e=t()),Reflect.get(e,l,I)},set(n,l,I,a){return e??(e=t()),Reflect.set(e,l,I,a)},has(n,l){return e??(e=t()),Reflect.has(e,l)},deleteProperty(n,l){return e??(e=t()),Reflect.deleteProperty(e,l)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,l){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,l)},defineProperty(n,l,I){return e??(e=t()),Reflect.defineProperty(e,l,I)}})}function ZIt(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function WIt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function v5n(t,e){let n={},l=t._zod.def;for(let I in e){if(!(I in l.shape))throw new Error(`Unrecognized key: "${I}"`);e[I]&&(n[I]=l.shape[I])}return im(t,{...t._zod.def,shape:n,checks:[]})}function f5n(t,e){let n={...t._zod.def.shape},l=t._zod.def;for(let I in e){if(!(I in l.shape))throw new Error(`Unrecognized key: "${I}"`);e[I]&&delete n[I]}return im(t,{...t._zod.def,shape:n,checks:[]})}function X5n(t,e){if(!x0e(e))throw new Error("Invalid input to extend: expected a plain object");let n={...t._zod.def,get shape(){let l={...t._zod.def.shape,...e};return k0e(this,"shape",l),l},checks:[]};return im(t,n)}function w5n(t,e){return im(t,{...t._zod.def,get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return k0e(this,"shape",n),n},catchall:e._zod.def.catchall,checks:[]})}function H5n(t,e,n){let l=e._zod.def.shape,I={...l};if(n)for(let a in n){if(!(a in l))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(I[a]=t?new t({type:"optional",innerType:l[a]}):l[a])}else for(let a in l)I[a]=t?new t({type:"optional",innerType:l[a]}):l[a];return im(e,{...e._zod.def,shape:I,checks:[]})}function Q5n(t,e,n){let l=e._zod.def.shape,I={...l};if(n)for(let a in n){if(!(a in I))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(I[a]=new t({type:"nonoptional",innerType:l[a]}))}else for(let a in l)I[a]=new t({type:"nonoptional",innerType:l[a]});return im(e,{...e._zod.def,shape:I,checks:[]})}function Cz(t,e=0){for(let n=e;n{var l;return(l=n).path??(l.path=[]),n.path.unshift(t),n})}function Jz(t){return typeof t=="string"?t:t?.message}function TH(t,e,n){let l={...t,path:t.path??[]};if(!t.message){let I=Jz(t.inst?._zod.def?.error?.(t))??Jz(e?.error?.(t))??Jz(n.customError?.(t))??Jz(n.localeError?.(t))??"Invalid input";l.message=I}return delete l.inst,delete l.continue,e?.reportInput||delete l.input,l}function E5n(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function J5n(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function VIt(...t){let[e,n,l]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:l}:{...e}}function C5n(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var z$,bIt,R5n,mIt,pIt,A5n,F5n,E0e,O2=B(()=>{z$=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};bIt=C0e(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});R5n=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},mIt=new Set(["string","number","symbol"]),pIt=new Set(["string","number","bigint","boolean","symbol","undefined"]);A5n={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},F5n={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};E0e=class{constructor(...e){}}});var YIt,gIt,Lz,O0e=B(()=>{Ez();O2();YIt=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,J0e,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},gIt=j2("$ZodError",YIt),Lz=j2("$ZodError",YIt,{Parent:Error})});var k5n,kz,x5n,RIt,j5n,yIt,O5n,AIt,U0e=B(()=>{Ez();O0e();O2();k5n=t=>(e,n,l,I)=>{let a=l?Object.assign(l,{async:!1}):{async:!1},c=e._zod.run({value:n,issues:[]},a);if(c instanceof Promise)throw new x2;if(c.issues.length){let i=new(I?.Err??t)(c.issues.map(s=>TH(s,a,F5())));throw z$(i,I?.callee),i}return c.value},kz=k5n(Lz),x5n=t=>async(e,n,l,I)=>{let a=l?Object.assign(l,{async:!0}):{async:!0},c=e._zod.run({value:n,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){let i=new(I?.Err??t)(c.issues.map(s=>TH(s,a,F5())));throw z$(i,I?.callee),i}return c.value},RIt=x5n(Lz),j5n=t=>(e,n,l)=>{let I=l?{...l,async:!1}:{async:!1},a=e._zod.run({value:n,issues:[]},I);if(a instanceof Promise)throw new x2;return a.issues.length?{success:!1,error:new(t??gIt)(a.issues.map(c=>TH(c,I,F5())))}:{success:!0,data:a.value}},yIt=j5n(Lz),O5n=t=>async(e,n,l)=>{let I=l?Object.assign(l,{async:!0}):{async:!0},a=e._zod.run({value:n,issues:[]},I);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(c=>TH(c,I,F5())))}:{success:!0,data:a.value}},AIt=O5n(Lz)});var U5n,SSI,FIt=B(()=>{U5n="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",SSI=new RegExp(`^${U5n}$`)});var vIt=B(()=>{});var fIt=B(()=>{});var XIt,z0e=B(()=>{XIt={major:4,minor:0,patch:0}});var B0e,wIt,HIt,QIt,EIt=B(()=>{Ez();U0e();O2();z0e();O2();B0e=j2("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=XIt;let l=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&l.unshift(t);for(let I of l)for(let a of I._zod.onattach)a(t);if(l.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let I=(a,c,i)=>{let s=Cz(a),r;for(let u of c){if(u._zod.def.when){if(!u._zod.def.when(a))continue}else if(s)continue;let o=a.issues.length,d=u._zod.check(a);if(d instanceof Promise&&i?.async===!1)throw new x2;if(r||d instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await d,a.issues.length!==o&&(s||(s=Cz(a,o)))});else{if(a.issues.length===o)continue;s||(s=Cz(a,o))}}return r?r.then(()=>a):a};t._zod.run=(a,c)=>{let i=t._zod.parse(a,c);if(i instanceof Promise){if(c.async===!1)throw new x2;return i.then(s=>I(s,l,c))}return I(i,l,c)}}t["~standard"]={validate:I=>{try{let a=yIt(t,I);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return AIt(t,I).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}}),wIt=j2("$ZodUnknown",(t,e)=>{B0e.init(t,e),t._zod.parse=n=>n}),HIt=j2("$ZodNever",(t,e)=>{B0e.init(t,e),t._zod.parse=(n,l)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),QIt=j2("$ZodOptional",(t,e)=>{B0e.init(t,e),t._zod.optin="optional",t._zod.optout="optional",U$(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),U$(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${L0e(n.source)})?$`):void 0}),t._zod.parse=(n,l)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,l):n.value===void 0?n:e.innerType._zod.run(n,l)})});var JIt=B(()=>{});function S5n(){return new xz}var $SI,eMI,xz,_m,S0e=B(()=>{$SI=Symbol("ZodOutput"),eMI=Symbol("ZodInput"),xz=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){let l=n[0];if(this._map.set(e,l),l&&typeof l=="object"&&"id"in l){if(this._idmap.has(l.id))throw new Error(`ID ${l.id} already exists in the registry`);this._idmap.set(l.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let l={...this.get(n)??{}};return delete l.id,{...l,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};_m=S5n()});function CIt(t){return new t({type:"unknown"})}function LIt(t,e){return new t({type:"never",...j0e(e)})}var kIt=B(()=>{O2()});var xIt=B(()=>{});function M0e(t,e){if(t instanceof xz){let l=new B$(e),I={};for(let i of t._idmap.entries()){let[s,r]=i;l.process(r)}let a={},c={registry:t,uri:e?.uri,defs:I};for(let i of t._idmap.entries()){let[s,r]=i;a[s]=l.emit(r,{...e,external:c})}if(Object.keys(I).length>0){let i=l.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[i]:I}}return{schemas:a}}let n=new B$(e);return n.process(t),n.emit(t,e)}function Pu(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let I=t._zod.def;switch(I.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Pu(I.element,n);case"object":{for(let a in I.shape)if(Pu(I.shape[a],n))return!0;return!1}case"union":{for(let a of I.options)if(Pu(a,n))return!0;return!1}case"intersection":return Pu(I.left,n)||Pu(I.right,n);case"tuple":{for(let a of I.items)if(Pu(a,n))return!0;return!!(I.rest&&Pu(I.rest,n))}case"record":return Pu(I.keyType,n)||Pu(I.valueType,n);case"map":return Pu(I.keyType,n)||Pu(I.valueType,n);case"set":return Pu(I.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Pu(I.innerType,n);case"lazy":return Pu(I.getter(),n);case"default":return Pu(I.innerType,n);case"prefault":return Pu(I.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Pu(I.in,n)||Pu(I.out,n);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${I.type}`)}var B$,jIt=B(()=>{S0e();O2();B$=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??_m,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,n={path:[],schemaPath:[]}){var l;let I=e._zod.def,a={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.schema;let i={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(e,i);let s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{let o={...n,schemaPath:[...n.schemaPath,e],path:n.path},d=e._zod.parent;if(d)i.ref=d,this.process(d,o),this.seen.get(d).isParent=!0;else{let b=i.schema;switch(I.type){case"string":{let h=b;h.type="string";let{minimum:Z,maximum:N,format:g,patterns:y,contentEncoding:X}=e._zod.bag;if(typeof Z=="number"&&(h.minLength=Z),typeof N=="number"&&(h.maxLength=N),g&&(h.format=a[g]??g,h.format===""&&delete h.format),X&&(h.contentEncoding=X),y&&y.size>0){let v=[...y];v.length===1?h.pattern=v[0].source:v.length>1&&(i.schema.allOf=[...v.map(H=>({...this.target==="draft-7"?{type:"string"}:{},pattern:H.source}))])}break}case"number":{let h=b,{minimum:Z,maximum:N,format:g,multipleOf:y,exclusiveMaximum:X,exclusiveMinimum:v}=e._zod.bag;typeof g=="string"&&g.includes("int")?h.type="integer":h.type="number",typeof v=="number"&&(h.exclusiveMinimum=v),typeof Z=="number"&&(h.minimum=Z,typeof v=="number"&&(v>=Z?delete h.minimum:delete h.exclusiveMinimum)),typeof X=="number"&&(h.exclusiveMaximum=X),typeof N=="number"&&(h.maximum=N,typeof X=="number"&&(X<=N?delete h.maximum:delete h.exclusiveMaximum)),typeof y=="number"&&(h.multipleOf=y);break}case"boolean":{let h=b;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{b.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{b.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let h=b,{minimum:Z,maximum:N}=e._zod.bag;typeof Z=="number"&&(h.minItems=Z),typeof N=="number"&&(h.maxItems=N),h.type="array",h.items=this.process(I.element,{...o,path:[...o.path,"items"]});break}case"object":{let h=b;h.type="object",h.properties={};let Z=I.shape;for(let y in Z)h.properties[y]=this.process(Z[y],{...o,path:[...o.path,"properties",y]});let N=new Set(Object.keys(Z)),g=new Set([...N].filter(y=>{let X=I.shape[y]._zod;return this.io==="input"?X.optin===void 0:X.optout===void 0}));g.size>0&&(h.required=Array.from(g)),I.catchall?._zod.def.type==="never"?h.additionalProperties=!1:I.catchall?I.catchall&&(h.additionalProperties=this.process(I.catchall,{...o,path:[...o.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{let h=b;h.anyOf=I.options.map((Z,N)=>this.process(Z,{...o,path:[...o.path,"anyOf",N]}));break}case"intersection":{let h=b,Z=this.process(I.left,{...o,path:[...o.path,"allOf",0]}),N=this.process(I.right,{...o,path:[...o.path,"allOf",1]}),g=X=>"allOf"in X&&Object.keys(X).length===1,y=[...g(Z)?Z.allOf:[Z],...g(N)?N.allOf:[N]];h.allOf=y;break}case"tuple":{let h=b;h.type="array";let Z=I.items.map((y,X)=>this.process(y,{...o,path:[...o.path,"prefixItems",X]}));if(this.target==="draft-2020-12"?h.prefixItems=Z:h.items=Z,I.rest){let y=this.process(I.rest,{...o,path:[...o.path,"items"]});this.target==="draft-2020-12"?h.items=y:h.additionalItems=y}I.rest&&(h.items=this.process(I.rest,{...o,path:[...o.path,"items"]}));let{minimum:N,maximum:g}=e._zod.bag;typeof N=="number"&&(h.minItems=N),typeof g=="number"&&(h.maxItems=g);break}case"record":{let h=b;h.type="object",h.propertyNames=this.process(I.keyType,{...o,path:[...o.path,"propertyNames"]}),h.additionalProperties=this.process(I.valueType,{...o,path:[...o.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let h=b,Z=O$(I.entries);Z.every(N=>typeof N=="number")&&(h.type="number"),Z.every(N=>typeof N=="string")&&(h.type="string"),h.enum=Z;break}case"literal":{let h=b,Z=[];for(let N of I.values)if(N===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof N=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");Z.push(Number(N))}else Z.push(N);if(Z.length!==0)if(Z.length===1){let N=Z[0];h.type=N===null?"null":typeof N,h.const=N}else Z.every(N=>typeof N=="number")&&(h.type="number"),Z.every(N=>typeof N=="string")&&(h.type="string"),Z.every(N=>typeof N=="boolean")&&(h.type="string"),Z.every(N=>N===null)&&(h.type="null"),h.enum=Z;break}case"file":{let h=b,Z={type:"string",format:"binary",contentEncoding:"binary"},{minimum:N,maximum:g,mime:y}=e._zod.bag;N!==void 0&&(Z.minLength=N),g!==void 0&&(Z.maxLength=g),y?y.length===1?(Z.contentMediaType=y[0],Object.assign(h,Z)):h.anyOf=y.map(X=>({...Z,contentMediaType:X})):Object.assign(h,Z);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let h=this.process(I.innerType,o);b.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(I.innerType,o),i.ref=I.innerType;break}case"success":{let h=b;h.type="boolean";break}case"default":{this.process(I.innerType,o),i.ref=I.innerType,b.default=JSON.parse(JSON.stringify(I.defaultValue));break}case"prefault":{this.process(I.innerType,o),i.ref=I.innerType,this.io==="input"&&(b._prefault=JSON.parse(JSON.stringify(I.defaultValue)));break}case"catch":{this.process(I.innerType,o),i.ref=I.innerType;let h;try{h=I.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}b.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let h=b,Z=e._zod.pattern;if(!Z)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=Z.source;break}case"pipe":{let h=this.io==="input"?I.in._zod.def.type==="transform"?I.out:I.in:I.out;this.process(h,o),i.ref=h;break}case"readonly":{this.process(I.innerType,o),i.ref=I.innerType,b.readOnly=!0;break}case"promise":{this.process(I.innerType,o),i.ref=I.innerType;break}case"optional":{this.process(I.innerType,o),i.ref=I.innerType;break}case"lazy":{let h=e._zod.innerType;this.process(h,o),i.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let r=this.metadataRegistry.get(e);return r&&Object.assign(i.schema,r),this.io==="input"&&Pu(e)&&(delete i.schema.examples,delete i.schema.default),this.io==="input"&&i.schema._prefault&&((l=i.schema).default??(l.default=i.schema._prefault)),delete i.schema._prefault,this.seen.get(e).schema}emit(e,n){let l={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},I=this.seen.get(e);if(!I)throw new Error("Unprocessed schema. This is a bug in Zod.");let a=u=>{let o=this.target==="draft-2020-12"?"$defs":"definitions";if(l.external){let Z=l.external.registry.get(u[0])?.id,N=l.external.uri??(y=>y);if(Z)return{ref:N(Z)};let g=u[1].defId??u[1].schema.id??`schema${this.counter++}`;return u[1].defId=g,{defId:g,ref:`${N("__shared")}#/${o}/${g}`}}if(u[1]===I)return{ref:"#"};let b=`#/${o}/`,h=u[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:b+h}},c=u=>{if(u[1].schema.$ref)return;let o=u[1],{ref:d,defId:b}=a(u);o.def={...o.schema},b&&(o.defId=b);let h=o.schema;for(let Z in h)delete h[Z];h.$ref=d};if(l.cycles==="throw")for(let u of this.seen.entries()){let o=u[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let u of this.seen.entries()){let o=u[1];if(e===u[0]){c(u);continue}if(l.external){let b=l.external.registry.get(u[0])?.id;if(e!==u[0]&&b){c(u);continue}}if(this.metadataRegistry.get(u[0])?.id){c(u);continue}if(o.cycle){c(u);continue}if(o.count>1&&l.reused==="ref"){c(u);continue}}let i=(u,o)=>{let d=this.seen.get(u),b=d.def??d.schema,h={...b};if(d.ref===null)return;let Z=d.ref;if(d.ref=null,Z){i(Z,o);let N=this.seen.get(Z).schema;N.$ref&&o.target==="draft-7"?(b.allOf=b.allOf??[],b.allOf.push(N)):(Object.assign(b,N),Object.assign(b,h))}d.isParent||this.override({zodSchema:u,jsonSchema:b,path:d.path??[]})};for(let u of[...this.seen.entries()].reverse())i(u[0],{target:this.target});let s={};if(this.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?s.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),l.external?.uri){let u=l.external.registry.get(e)?.id;if(!u)throw new Error("Schema is missing an `id` property");s.$id=l.external.uri(u)}Object.assign(s,I.def);let r=l.external?.defs??{};for(let u of this.seen.entries()){let o=u[1];o.def&&o.defId&&(r[o.defId]=o.def)}l.external||Object.keys(r).length>0&&(this.target==="draft-2020-12"?s.$defs=r:s.definitions=r);try{return JSON.parse(JSON.stringify(s))}catch{throw new Error("Error converting schema to JSON.")}}}});var OIt=B(()=>{});var T0e=B(()=>{Ez();U0e();O0e();EIt();vIt();z0e();O2();FIt();JIt();S0e();fIt();xIt();kIt();jIt();OIt()});var zIt,UIt,BIt,S$=B(()=>{zIt=Symbol("Let zodToJsonSchema decide on which parser to use"),UIt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},BIt=t=>typeof t=="string"?{...UIt,name:t}:{...UIt,...t}});var SIt,D0e=B(()=>{S$();SIt=t=>{let e=BIt(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([l,I])=>[I._def,{def:I._def,path:[...e.basePath,e.definitionPath,l],jsonSchema:void 0}]))}}});function K0e(t,e,n,l){l?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}function gI(t,e,n,l,I){t[e]=n,K0e(t,e,l,I)}var U2=B(()=>{});var M$,T$=B(()=>{M$=(t,e)=>{let n=0;for(;n{Gz();Gz()});function zc(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?M$(e,t.currentPath):e.join("/")}}var CZ=B(()=>{T$()});function MIt(t,e){let n={type:"array"};return t.type?._def&&t.type?._def?.typeName!==ve.ZodAny&&(n.items=En(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&gI(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&gI(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(gI(n,"minItems",t.exactLength.value,t.exactLength.message,e),gI(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}var _0e=B(()=>{ab();U2();$o()});function TIt(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let l of t.checks)switch(l.kind){case"min":e.target==="jsonSchema7"?l.inclusive?gI(n,"minimum",l.value,l.message,e):gI(n,"exclusiveMinimum",l.value,l.message,e):(l.inclusive||(n.exclusiveMinimum=!0),gI(n,"minimum",l.value,l.message,e));break;case"max":e.target==="jsonSchema7"?l.inclusive?gI(n,"maximum",l.value,l.message,e):gI(n,"exclusiveMaximum",l.value,l.message,e):(l.inclusive||(n.exclusiveMaximum=!0),gI(n,"maximum",l.value,l.message,e));break;case"multipleOf":gI(n,"multipleOf",l.value,l.message,e);break}return n}var P0e=B(()=>{U2()});function DIt(){return{type:"boolean"}}var q0e=B(()=>{});function D$(t,e){return En(t.type._def,e)}var K$=B(()=>{$o()});var KIt,$0e=B(()=>{$o();KIt=(t,e)=>En(t.innerType._def,e)});function eFe(t,e,n){let l=n??e.dateStrategy;if(Array.isArray(l))return{anyOf:l.map((I,a)=>eFe(t,e,I))};switch(l){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return M5n(t,e)}}var M5n,tFe=B(()=>{U2();M5n=(t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let l of t.checks)switch(l.kind){case"min":gI(n,"minimum",l.value,l.message,e);break;case"max":gI(n,"maximum",l.value,l.message,e);break}return n}});function _It(t,e){return{...En(t.innerType._def,e),default:t.defaultValue()}}var nFe=B(()=>{$o()});function PIt(t,e){return e.effectStrategy==="input"?En(t.schema._def,e):zc(e)}var lFe=B(()=>{$o();CZ()});function qIt(t){return{type:"string",enum:Array.from(t.values)}}var IFe=B(()=>{});function $It(t,e){let n=[En(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),En(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(a=>!!a),l=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,I=[];return n.forEach(a=>{if(T5n(a))I.push(...a.allOf),a.unevaluatedProperties===void 0&&(l=void 0);else{let c=a;if("additionalProperties"in a&&a.additionalProperties===!1){let{additionalProperties:i,...s}=a;c=s}else l=void 0;I.push(c)}}),I.length?{allOf:I,...l}:void 0}var T5n,aFe=B(()=>{$o();T5n=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function eat(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}var rFe=B(()=>{});function _$(t,e){let n={type:"string"};if(t.checks)for(let l of t.checks)switch(l.kind){case"min":gI(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,l.value):l.value,l.message,e);break;case"max":gI(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,l.value):l.value,l.message,e);break;case"email":switch(e.emailStrategy){case"format:email":EN(n,"email",l.message,e);break;case"format:idn-email":EN(n,"idn-email",l.message,e);break;case"pattern:zod":sm(n,QN.email,l.message,e);break}break;case"url":EN(n,"uri",l.message,e);break;case"uuid":EN(n,"uuid",l.message,e);break;case"regex":sm(n,l.regex,l.message,e);break;case"cuid":sm(n,QN.cuid,l.message,e);break;case"cuid2":sm(n,QN.cuid2,l.message,e);break;case"startsWith":sm(n,RegExp(`^${oFe(l.value,e)}`),l.message,e);break;case"endsWith":sm(n,RegExp(`${oFe(l.value,e)}$`),l.message,e);break;case"datetime":EN(n,"date-time",l.message,e);break;case"date":EN(n,"date",l.message,e);break;case"time":EN(n,"time",l.message,e);break;case"duration":EN(n,"duration",l.message,e);break;case"length":gI(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,l.value):l.value,l.message,e),gI(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,l.value):l.value,l.message,e);break;case"includes":{sm(n,RegExp(oFe(l.value,e)),l.message,e);break}case"ip":{l.version!=="v6"&&EN(n,"ipv4",l.message,e),l.version!=="v4"&&EN(n,"ipv6",l.message,e);break}case"base64url":sm(n,QN.base64url,l.message,e);break;case"jwt":sm(n,QN.jwt,l.message,e);break;case"cidr":{l.version!=="v6"&&sm(n,QN.ipv4Cidr,l.message,e),l.version!=="v4"&&sm(n,QN.ipv6Cidr,l.message,e);break}case"emoji":sm(n,QN.emoji(),l.message,e);break;case"ulid":{sm(n,QN.ulid,l.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{EN(n,"binary",l.message,e);break}case"contentEncoding:base64":{gI(n,"contentEncoding","base64",l.message,e);break}case"pattern:zod":{sm(n,QN.base64,l.message,e);break}}break}case"nanoid":sm(n,QN.nanoid,l.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function oFe(t,e){return e.patternStrategy==="escape"?K5n(t):t}function K5n(t){let e="";for(let n=0;nI.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&l.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&l.errorMessages&&{errorMessage:{format:n}}})):gI(t,"format",e,n,l)}function sm(t,e,n,l){t.pattern||t.allOf?.some(I=>I.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&l.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:tat(e,l),...n&&l.errorMessages&&{errorMessage:{pattern:n}}})):gI(t,"pattern",tat(e,l),n,l)}function tat(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},l=n.i?t.source.toLowerCase():t.source,I="",a=!1,c=!1,i=!1;for(let s=0;s{U2();QN={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(cFe===void 0&&(cFe=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),cFe),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};D5n=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function q$(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===ve.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((l,I)=>({...l,[I]:En(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",I]})??zc(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:En(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===ve.ZodString&&t.keyType._def.checks?.length){let{type:l,...I}=_$(t.keyType._def,e);return{...n,propertyNames:I}}else{if(t.keyType?._def.typeName===ve.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===ve.ZodBranded&&t.keyType._def.type._def.typeName===ve.ZodString&&t.keyType._def.type._def.checks?.length){let{type:l,...I}=D$(t.keyType._def,e);return{...n,propertyNames:I}}}return n}var $$=B(()=>{ab();$o();P$();K$();CZ()});function nat(t,e){if(e.mapStrategy==="record")return q$(t,e);let n=En(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||zc(e),l=En(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||zc(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,l],minItems:2,maxItems:2}}}var iFe=B(()=>{$o();$$();CZ()});function lat(t){let e=t.values,l=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),I=Array.from(new Set(l.map(a=>typeof a)));return{type:I.length===1?I[0]==="string"?"string":"number":["string","number"],enum:l}}var sFe=B(()=>{});function Iat(t){return t.target==="openAi"?void 0:{not:zc({...t,currentPath:[...t.currentPath,"not"]})}}var uFe=B(()=>{CZ()});function aat(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var dFe=B(()=>{});function cat(t,e){if(e.target==="openApi3")return rat(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(l=>l._def.typeName in jz&&(!l._def.checks||!l._def.checks.length))){let l=n.reduce((I,a)=>{let c=jz[a._def.typeName];return c&&!I.includes(c)?[...I,c]:I},[]);return{type:l.length>1?l:l[0]}}else if(n.every(l=>l._def.typeName==="ZodLiteral"&&!l.description)){let l=n.reduce((I,a)=>{let c=typeof a._def.value;switch(c){case"string":case"number":case"boolean":return[...I,c];case"bigint":return[...I,"integer"];case"object":if(a._def.value===null)return[...I,"null"];case"symbol":case"undefined":case"function":default:return I}},[]);if(l.length===n.length){let I=l.filter((a,c,i)=>i.indexOf(a)===c);return{type:I.length>1?I:I[0],enum:n.reduce((a,c)=>a.includes(c._def.value)?a:[...a,c._def.value],[])}}}else if(n.every(l=>l._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((l,I)=>[...l,...I._def.values.filter(a=>!l.includes(a))],[])};return rat(t,e)}var jz,rat,eee=B(()=>{$o();jz={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};rat=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((l,I)=>En(l._def,{...e,currentPath:[...e.currentPath,"anyOf",`${I}`]})).filter(l=>!!l&&(!e.strictUnions||typeof l=="object"&&Object.keys(l).length>0));return n.length?{anyOf:n}:void 0}});function oat(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:jz[t.innerType._def.typeName],nullable:!0}:{type:[jz[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let l=En(t.innerType._def,{...e,currentPath:[...e.currentPath]});return l&&"$ref"in l?{allOf:[l],nullable:!0}:l&&{...l,nullable:!0}}let n=En(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}var GFe=B(()=>{$o();eee()});function iat(t,e){let n={type:"number"};if(!t.checks)return n;for(let l of t.checks)switch(l.kind){case"int":n.type="integer",K0e(n,"type",l.message,e);break;case"min":e.target==="jsonSchema7"?l.inclusive?gI(n,"minimum",l.value,l.message,e):gI(n,"exclusiveMinimum",l.value,l.message,e):(l.inclusive||(n.exclusiveMinimum=!0),gI(n,"minimum",l.value,l.message,e));break;case"max":e.target==="jsonSchema7"?l.inclusive?gI(n,"maximum",l.value,l.message,e):gI(n,"exclusiveMaximum",l.value,l.message,e):(l.inclusive||(n.exclusiveMaximum=!0),gI(n,"maximum",l.value,l.message,e));break;case"multipleOf":gI(n,"multipleOf",l.value,l.message,e);break}return n}var bFe=B(()=>{U2()});function sat(t,e){let n=e.target==="openAi",l={type:"object",properties:{}},I=[],a=t.shape();for(let i in a){let s=a[i];if(s===void 0||s._def===void 0)continue;let r=P5n(s);r&&n&&(s._def.typeName==="ZodOptional"&&(s=s._def.innerType),s.isNullable()||(s=s.nullable()),r=!1);let u=En(s._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});u!==void 0&&(l.properties[i]=u,r||I.push(i))}I.length&&(l.required=I);let c=_5n(t,e);return c!==void 0&&(l.additionalProperties=c),l}function _5n(t,e){if(t.catchall._def.typeName!=="ZodNever")return En(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function P5n(t){try{return t.isOptional()}catch{return!0}}var mFe=B(()=>{$o()});var uat,pFe=B(()=>{$o();CZ();uat=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return En(t.innerType._def,e);let n=En(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:zc(e)},n]}:zc(e)}});var dat,hFe=B(()=>{$o();dat=(t,e)=>{if(e.pipeStrategy==="input")return En(t.in._def,e);if(e.pipeStrategy==="output")return En(t.out._def,e);let n=En(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),l=En(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,l].filter(I=>I!==void 0)}}});function Gat(t,e){return En(t.type._def,e)}var ZFe=B(()=>{$o()});function bat(t,e){let l={type:"array",uniqueItems:!0,items:En(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&gI(l,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&gI(l,"maxItems",t.maxSize.value,t.maxSize.message,e),l}var WFe=B(()=>{U2();$o()});function mat(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,l)=>En(n._def,{...e,currentPath:[...e.currentPath,"items",`${l}`]})).reduce((n,l)=>l===void 0?n:[...n,l],[]),additionalItems:En(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,l)=>En(n._def,{...e,currentPath:[...e.currentPath,"items",`${l}`]})).reduce((n,l)=>l===void 0?n:[...n,l],[])}}var NFe=B(()=>{$o()});function pat(t){return{not:zc(t)}}var VFe=B(()=>{CZ()});function hat(t){return zc(t)}var YFe=B(()=>{CZ()});var Zat,gFe=B(()=>{$o();Zat=(t,e)=>En(t.innerType._def,e)});var Wat,RFe=B(()=>{ab();CZ();_0e();P0e();q0e();K$();$0e();tFe();nFe();lFe();IFe();aFe();rFe();iFe();sFe();uFe();dFe();GFe();bFe();mFe();pFe();hFe();ZFe();$$();WFe();P$();NFe();VFe();eee();YFe();gFe();Wat=(t,e,n)=>{switch(e){case ve.ZodString:return _$(t,n);case ve.ZodNumber:return iat(t,n);case ve.ZodObject:return sat(t,n);case ve.ZodBigInt:return TIt(t,n);case ve.ZodBoolean:return DIt();case ve.ZodDate:return eFe(t,n);case ve.ZodUndefined:return pat(n);case ve.ZodNull:return aat(n);case ve.ZodArray:return MIt(t,n);case ve.ZodUnion:case ve.ZodDiscriminatedUnion:return cat(t,n);case ve.ZodIntersection:return $It(t,n);case ve.ZodTuple:return mat(t,n);case ve.ZodRecord:return q$(t,n);case ve.ZodLiteral:return eat(t,n);case ve.ZodEnum:return qIt(t);case ve.ZodNativeEnum:return lat(t);case ve.ZodNullable:return oat(t,n);case ve.ZodOptional:return uat(t,n);case ve.ZodMap:return nat(t,n);case ve.ZodSet:return bat(t,n);case ve.ZodLazy:return()=>t.getter()._def;case ve.ZodPromise:return Gat(t,n);case ve.ZodNaN:case ve.ZodNever:return Iat(n);case ve.ZodEffects:return PIt(t,n);case ve.ZodAny:return zc(n);case ve.ZodUnknown:return hat(n);case ve.ZodDefault:return _It(t,n);case ve.ZodBranded:return D$(t,n);case ve.ZodReadonly:return Zat(t,n);case ve.ZodCatch:return KIt(t,n);case ve.ZodPipeline:return dat(t,n);case ve.ZodFunction:case ve.ZodVoid:case ve.ZodSymbol:return;default:return(l=>{})(e)}}});function En(t,e,n=!1){let l=e.seen.get(t);if(e.override){let i=e.override?.(t,e,l,n);if(i!==zIt)return i}if(l&&!n){let i=q5n(l,e);if(i!==void 0)return i}let I={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,I);let a=Wat(t,t.typeName,e),c=typeof a=="function"?En(a(),e):a;if(c&&$5n(t,e,c),e.postProcess){let i=e.postProcess(c,t,e);return I.jsonSchema=c,i}return I.jsonSchema=c,c}var q5n,$5n,$o=B(()=>{S$();RFe();T$();CZ();q5n=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:M$(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[l]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),zc(e)):e.$refStrategy==="seen"?zc(e):void 0}},$5n=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n)});var Nat=B(()=>{});var JN,yFe=B(()=>{$o();D0e();CZ();JN=(t,e)=>{let n=SIt(e),l=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((s,[r,u])=>({...s,[r]:En(u._def,{...n,currentPath:[...n.basePath,n.definitionPath,r]},!0)??zc(n)}),{}):void 0,I=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=En(t._def,I===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,I]},!1)??zc(n),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(a.title=c),n.flags.hasReferencedOpenAiAnyType&&(l||(l={}),l[n.openAiAnyTypeName]||(l[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let i=I===void 0?l?{...a,[n.definitionPath]:l}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,I].join("/"),[n.definitionPath]:{...l,[I]:a}};return n.target==="jsonSchema7"?i.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(i.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in i||"oneOf"in i||"allOf"in i||"type"in i&&Array.isArray(i.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),i}});var v5=B(()=>{S$();D0e();U2();T$();$o();Nat();CZ();_0e();P0e();q0e();K$();$0e();tFe();nFe();lFe();IFe();aFe();rFe();iFe();sFe();uFe();dFe();GFe();bFe();mFe();pFe();hFe();ZFe();gFe();$$();WFe();P$();NFe();VFe();eee();YFe();RFe();yFe();yFe()});function MY(t,e){let n=typeof t;if(n!==typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e))return!1;let l=t.length;if(l!==e.length)return!1;for(let I=0;I{});function Gh(t){return encodeURI(eLn(t))}function eLn(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var tee=B(()=>{});function CN(t,e=Object.create(null),n=ILn,l=""){if(t&&typeof t=="object"&&!Array.isArray(t)){let a=t.$id||t.id;if(a){let c=new URL(a,n.href);c.hash.length>1?e[c.href]=t:(c.hash="",l===""?n=c:CN(t,e,n))}}else if(t!==!0&&t!==!1)return e;let I=n.href+(l?"#"+l:"");if(e[I]!==void 0)throw new Error(`Duplicate schema URI "${I}".`);if(e[I]=t,t===!0||t===!1)return e;if(t.__absolute_uri__===void 0&&Object.defineProperty(t,"__absolute_uri__",{enumerable:!1,value:I}),t.$ref&&t.__absolute_ref__===void 0){let a=new URL(t.$ref,n.href);a.hash=a.hash,Object.defineProperty(t,"__absolute_ref__",{enumerable:!1,value:a.href})}if(t.$recursiveRef&&t.__absolute_recursive_ref__===void 0){let a=new URL(t.$recursiveRef,n.href);a.hash=a.hash,Object.defineProperty(t,"__absolute_recursive_ref__",{enumerable:!1,value:a.href})}if(t.$anchor){let a=new URL("#"+t.$anchor,n.href);e[a.href]=t}for(let a in t){if(lLn[a])continue;let c=`${l}/${Gh(a)}`,i=t[a];if(Array.isArray(i)){if(tLn[a]){let s=i.length;for(let r=0;r{tee();tLn={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},nLn={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},lLn={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},ILn=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker")});function TY(t){return t.test.bind(t)}function NLn(t){return t%4===0&&(t%100!==0||t%400===0)}function Vat(t){let e=t.match(aLn);if(!e)return!1;let n=+e[1],l=+e[2],I=+e[3];return l>=1&&l<=12&&I>=1&&I<=(l==2&&NLn(n)?29:rLn[l])}function Yat(t,e){let n=e.match(cLn);if(!n)return!1;let l=+n[1],I=+n[2],a=+n[3],c=!!n[5];return(l<=23&&I<=59&&a<=59||l==23&&I==59&&a==60)&&(!t||c)}function YLn(t){let e=t.split(VLn);return e.length==2&&Vat(e[0])&&Yat(!0,e[1])}function yLn(t){return gLn.test(t)&&RLn.test(t)}function FLn(t){if(ALn.test(t))return!1;try{return new RegExp(t,"u"),!0}catch{return!1}}var aLn,rLn,cLn,oLn,iLn,sLn,uLn,dLn,GLn,bLn,mLn,pLn,hLn,ZLn,WLn,FFe,VLn,gLn,RLn,ALn,vFe=B(()=>{aLn=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rLn=[0,31,28,31,30,31,30,31,31,30,31,30,31],cLn=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,oLn=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,iLn=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,sLn=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,uLn=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,dLn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,GLn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,bLn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,mLn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,pLn=t=>{if(t[0]==='"')return!1;let[e,n,...l]=t.split("@");return!e||!n||l.length!==0||e.length>64||n.length>253||e[0]==="."||e.endsWith(".")||e.includes("..")||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(e)?!1:n.split(".").every(I=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(I))},hLn=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ZLn=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,WLn=t=>t.length>1&&t.length<80&&(/^P\d+([.,]\d+)?W$/.test(t)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(t)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(t));FFe={date:Vat,time:Yat.bind(void 0,!1),"date-time":YLn,duration:WLn,uri:yLn,"uri-reference":TY(iLn),"uri-template":TY(sLn),url:TY(uLn),email:pLn,hostname:TY(oLn),ipv4:TY(hLn),ipv6:TY(ZLn),regex:FLn,uuid:TY(dLn),"json-pointer":TY(GLn),"json-pointer-uri-fragment":TY(bLn),"relative-json-pointer":TY(mLn)};VLn=/t|\s/i;gLn=/\/|:/,RLn=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;ALn=/[^\\]\\Z/});var gat,Rat=B(()=>{(function(t){t[t.Flag=1]="Flag",t[t.Basic=2]="Basic",t[t.Detailed=4]="Detailed"})(gat||(gat={}))});function yat(t){let e=0,n=t.length,l=0,I;for(;l=55296&&I<=56319&&l{});function oc(t,e,n="2019-09",l=CN(e),I=!0,a=null,c="#",i="#",s=Object.create(null)){if(e===!0)return{valid:!0,errors:[]};if(e===!1)return{valid:!1,errors:[{instanceLocation:c,keyword:"false",keywordLocation:c,error:"False boolean schema."}]};let r=typeof t,u;switch(r){case"boolean":case"number":case"string":u=r;break;case"object":t===null?u="null":Array.isArray(t)?u="array":u="object";break;default:throw new Error(`Instances of "${r}" type are not supported.`)}let{$ref:o,$recursiveRef:d,$recursiveAnchor:b,type:h,const:Z,enum:N,required:g,not:y,anyOf:X,allOf:v,oneOf:H,if:Q,then:L,else:J,format:O,properties:U,patternProperties:K,additionalProperties:D,unevaluatedProperties:_,minProperties:P,maxProperties:le,propertyNames:q,dependentRequired:ee,dependentSchemas:ne,dependencies:ie,prefixItems:me,items:Ze,additionalItems:Fe,unevaluatedItems:ce,contains:fe,minContains:ke,maxContains:j,minItems:E,maxItems:S,uniqueItems:m,minimum:Y,maximum:R,exclusiveMinimum:C,exclusiveMaximum:M,multipleOf:te,minLength:ae,maxLength:p,pattern:V,__absolute_ref__:F,__absolute_recursive_ref__:G}=e,W=[];if(b===!0&&a===null&&(a=e),d==="#"){let x=a===null?l[G]:a,ue=`${i}/$recursiveRef`,Ue=oc(t,a===null?e:a,n,l,I,x,c,ue,s);Ue.valid||W.push({instanceLocation:c,keyword:"$recursiveRef",keywordLocation:ue,error:"A subschema had errors."},...Ue.errors)}if(o!==void 0){let ue=l[F||o];if(ue===void 0){let Re=`Unresolved $ref "${o}".`;throw F&&F!==o&&(Re+=` Absolute URI "${F}".`),Re+=` +Known schemas: +- ${Object.keys(l).join(` +- `)}`,new Error(Re)}let Ue=`${i}/$ref`,He=oc(t,ue,n,l,I,a,c,Ue,s);if(He.valid||W.push({instanceLocation:c,keyword:"$ref",keywordLocation:Ue,error:"A subschema had errors."},...He.errors),n==="4"||n==="7")return{valid:W.length===0,errors:W}}if(Array.isArray(h)){let x=h.length,ue=!1;for(let Ue=0;UeMY(t,x))||W.push({instanceLocation:c,keyword:"enum",keywordLocation:`${i}/enum`,error:`Instance does not match any of ${JSON.stringify(N)}.`}):N.some(x=>t===x)||W.push({instanceLocation:c,keyword:"enum",keywordLocation:`${i}/enum`,error:`Instance does not match any of ${JSON.stringify(N)}.`})),y!==void 0){let x=`${i}/not`;oc(t,y,n,l,I,a,c,x).valid&&W.push({instanceLocation:c,keyword:"not",keywordLocation:x,error:'Instance matched "not" schema.'})}let A=[];if(X!==void 0){let x=`${i}/anyOf`,ue=W.length,Ue=!1;for(let He=0;He{let et=Object.create(s),Oe=oc(t,He,n,l,I,b===!0?a:null,c,`${x}/${Re}`,et);return W.push(...Oe.errors),Oe.valid&&A.push(et),Oe.valid}).length;Ue===1?W.length=ue:W.splice(ue,0,{instanceLocation:c,keyword:"oneOf",keywordLocation:x,error:`Instance does not match exactly one subschema (${Ue} matches).`})}if((u==="object"||u==="array")&&Object.assign(s,...A),Q!==void 0){let x=`${i}/if`;if(oc(t,Q,n,l,I,a,c,x,s).valid){if(L!==void 0){let Ue=oc(t,L,n,l,I,a,c,`${i}/then`,s);Ue.valid||W.push({instanceLocation:c,keyword:"if",keywordLocation:x,error:'Instance does not match "then" schema.'},...Ue.errors)}}else if(J!==void 0){let Ue=oc(t,J,n,l,I,a,c,`${i}/else`,s);Ue.valid||W.push({instanceLocation:c,keyword:"if",keywordLocation:x,error:'Instance does not match "else" schema.'},...Ue.errors)}}if(u==="object"){if(g!==void 0)for(let He of g)He in t||W.push({instanceLocation:c,keyword:"required",keywordLocation:`${i}/required`,error:`Instance does not have required property "${He}".`});let x=Object.keys(t);if(P!==void 0&&x.lengthle&&W.push({instanceLocation:c,keyword:"maxProperties",keywordLocation:`${i}/maxProperties`,error:`Instance does not have at least ${le} properties.`}),q!==void 0){let He=`${i}/propertyNames`;for(let Re in t){let et=`${c}/${Gh(Re)}`,Oe=oc(Re,q,n,l,I,a,et,He);Oe.valid||W.push({instanceLocation:c,keyword:"propertyNames",keywordLocation:He,error:`Property name "${Re}" does not match schema.`},...Oe.errors)}}if(ee!==void 0){let He=`${i}/dependantRequired`;for(let Re in ee)if(Re in t){let et=ee[Re];for(let Oe of et)Oe in t||W.push({instanceLocation:c,keyword:"dependentRequired",keywordLocation:He,error:`Instance has "${Re}" but does not have "${Oe}".`})}}if(ne!==void 0)for(let He in ne){let Re=`${i}/dependentSchemas`;if(He in t){let et=oc(t,ne[He],n,l,I,a,c,`${Re}/${Gh(He)}`,s);et.valid||W.push({instanceLocation:c,keyword:"dependentSchemas",keywordLocation:Re,error:`Instance has "${He}" but does not match dependant schema.`},...et.errors)}}if(ie!==void 0){let He=`${i}/dependencies`;for(let Re in ie)if(Re in t){let et=ie[Re];if(Array.isArray(et))for(let Oe of et)Oe in t||W.push({instanceLocation:c,keyword:"dependencies",keywordLocation:He,error:`Instance has "${Re}" but does not have "${Oe}".`});else{let Oe=oc(t,et,n,l,I,a,c,`${He}/${Gh(Re)}`);Oe.valid||W.push({instanceLocation:c,keyword:"dependencies",keywordLocation:He,error:`Instance has "${Re}" but does not match dependant schema.`},...Oe.errors)}}}let ue=Object.create(null),Ue=!1;if(U!==void 0){let He=`${i}/properties`;for(let Re in U){if(!(Re in t))continue;let et=`${c}/${Gh(Re)}`,Oe=oc(t[Re],U[Re],n,l,I,a,et,`${He}/${Gh(Re)}`);if(Oe.valid)s[Re]=ue[Re]=!0;else if(Ue=I,W.push({instanceLocation:c,keyword:"properties",keywordLocation:He,error:`Property "${Re}" does not match schema.`},...Oe.errors),Ue)break}}if(!Ue&&K!==void 0){let He=`${i}/patternProperties`;for(let Re in K){let et=new RegExp(Re,"u"),Oe=K[Re];for(let Mt in t){if(!et.test(Mt))continue;let ch=`${c}/${Gh(Mt)}`,no=oc(t[Mt],Oe,n,l,I,a,ch,`${He}/${Gh(Re)}`);no.valid?s[Mt]=ue[Mt]=!0:(Ue=I,W.push({instanceLocation:c,keyword:"patternProperties",keywordLocation:He,error:`Property "${Mt}" matches pattern "${Re}" but does not match associated schema.`},...no.errors))}}}if(!Ue&&D!==void 0){let He=`${i}/additionalProperties`;for(let Re in t){if(ue[Re])continue;let et=`${c}/${Gh(Re)}`,Oe=oc(t[Re],D,n,l,I,a,et,He);Oe.valid?s[Re]=!0:(Ue=I,W.push({instanceLocation:c,keyword:"additionalProperties",keywordLocation:He,error:`Property "${Re}" does not match additional properties schema.`},...Oe.errors))}}else if(!Ue&&_!==void 0){let He=`${i}/unevaluatedProperties`;for(let Re in t)if(!s[Re]){let et=`${c}/${Gh(Re)}`,Oe=oc(t[Re],_,n,l,I,a,et,He);Oe.valid?s[Re]=!0:W.push({instanceLocation:c,keyword:"unevaluatedProperties",keywordLocation:He,error:`Property "${Re}" does not match unevaluated properties schema.`},...Oe.errors)}}}else if(u==="array"){S!==void 0&&t.length>S&&W.push({instanceLocation:c,keyword:"maxItems",keywordLocation:`${i}/maxItems`,error:`Array has too many items (${t.length} > ${S}).`}),E!==void 0&&t.length=(ke||0)&&(W.length=Re),ke===void 0&&j===void 0&&et===0?W.splice(Re,0,{instanceLocation:c,keyword:"contains",keywordLocation:He,error:"Array does not contain item matching schema."}):ke!==void 0&&etj&&W.push({instanceLocation:c,keyword:"maxContains",keywordLocation:`${i}/maxContains`,error:`Array may contain at most ${j} items matching schema. ${et} items were found.`})}if(!Ue&&ce!==void 0){let He=`${i}/unevaluatedItems`;for(ue;ue=R||t>R)&&W.push({instanceLocation:c,keyword:"maximum",keywordLocation:`${i}/maximum`,error:`${t} is greater than ${M?"or equal to ":""} ${R}.`})):(Y!==void 0&&tR&&W.push({instanceLocation:c,keyword:"maximum",keywordLocation:`${i}/maximum`,error:`${t} is greater than ${R}.`}),C!==void 0&&t<=C&&W.push({instanceLocation:c,keyword:"exclusiveMinimum",keywordLocation:`${i}/exclusiveMinimum`,error:`${t} is less than ${C}.`}),M!==void 0&&t>=M&&W.push({instanceLocation:c,keyword:"exclusiveMaximum",keywordLocation:`${i}/exclusiveMaximum`,error:`${t} is greater than or equal to ${M}.`})),te!==void 0){let x=t%te;Math.abs(0-x)>=11920929e-14&&Math.abs(te-x)>=11920929e-14&&W.push({instanceLocation:c,keyword:"multipleOf",keywordLocation:`${i}/multipleOf`,error:`${t} is not a multiple of ${te}.`})}}else if(u==="string"){let x=ae===void 0&&p===void 0?0:yat(t);ae!==void 0&&xp&&W.push({instanceLocation:c,keyword:"maxLength",keywordLocation:`${i}/maxLength`,error:`String is too long (${x} > ${p}).`}),V!==void 0&&!new RegExp(V,"u").test(t)&&W.push({instanceLocation:c,keyword:"pattern",keywordLocation:`${i}/pattern`,error:"String does not match pattern."}),O!==void 0&&FFe[O]&&!FFe[O](t)&&W.push({instanceLocation:c,keyword:"format",keywordLocation:`${i}/format`,error:`String does not match format "${O}".`})}return{valid:W.length===0,errors:W}}var XFe=B(()=>{AFe();nee();vFe();tee();fFe()});var f5,Aat=B(()=>{nee();XFe();f5=class{schema;draft;shortCircuit;lookup;constructor(e,n="2019-09",l=!0){this.schema=e,this.draft=n,this.shortCircuit=l,this.lookup=CN(e)}validate(e){return oc(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,n){n&&(e={...e,$id:n}),CN(e,this.lookup)}}});var Oz=B(()=>{AFe();nee();vFe();tee();Rat();fFe();XFe();Aat()});function ei(t){if(typeof t!="object"||t===null)return!1;let e=t;if(!("_zod"in e))return!1;let n=e._zod;return typeof n=="object"&&n!==null&&"def"in n}function qu(t){if(typeof t!="object"||t===null)return!1;let e=t;if(!("_def"in e)||"_zod"in e)return!1;let n=e._def;return typeof n=="object"&&n!=null&&"typeName"in n}function vLn(t){return ei(t)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),qu(t)}function wr(t){return!t||typeof t!="object"||Array.isArray(t)?!1:!!(ei(t)||qu(t))}async function Cy(t,e){if(ei(t))try{return{success:!0,data:await RIt(t,e)}}catch(n){return{success:!1,error:n}}if(qu(t))return t.safeParse(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function DY(t,e){if(ei(t))return kz(t,e);if(qu(t))return t.parse(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function fLn(t,e){if(ei(t))try{return{success:!0,data:kz(t,e)}}catch(n){return{success:!1,error:n}}if(qu(t))return t.safeParse(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function XLn(t,e){if(ei(t))return kz(t,e);if(qu(t))return t.parse(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function zz(t){if(ei(t))return _m.get(t)?.description;if(qu(t)||"description"in t&&typeof t.description=="string")return t.description}function wLn(t){if(!wr(t))return!1;if(qu(t)){let e=t._def;if(e.typeName==="ZodObject"){let n=t;return!n.shape||Object.keys(n.shape).length===0}if(e.typeName==="ZodRecord")return!0}if(ei(t)){let e=t._zod.def;if(e.type==="object"){let n=t;return!n.shape||Object.keys(n.shape).length===0}if(e.type==="record")return!0}return typeof t=="object"&&t!==null&&!("shape"in t)}function Bz(t){return wr(t)?qu(t)?t._def.typeName==="ZodString":ei(t)?t._zod.def.type==="string":!1:!1}function HFe(t){return typeof t=="object"&&t!==null&&"_def"in t&&typeof t._def=="object"&&t._def!==null&&"typeName"in t._def&&t._def.typeName==="ZodObject"}function LN(t){return ei(t)?typeof t=="object"&&t!==null&&"_zod"in t&&typeof t._zod=="object"&&t._zod!==null&&"def"in t._zod&&typeof t._zod.def=="object"&&t._zod.def!==null&&"type"in t._zod.def&&t._zod.def.type==="object":!1}function lee(t){return ei(t)?typeof t=="object"&&t!==null&&"_zod"in t&&typeof t._zod=="object"&&t._zod!==null&&"def"in t._zod&&typeof t._zod.def=="object"&&t._zod.def!==null&&"type"in t._zod.def&&t._zod.def.type==="array":!1}function HLn(t){return!!(HFe(t)||LN(t))}function QLn(t){if(qu(t))return t.shape;if(ei(t))return t._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function ELn(t,e){if(qu(t))return t.extend(e);if(ei(t))return Jy.extend(t,e);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function JLn(t){if(qu(t))return t.partial();if(ei(t))return Jy.partial(QIt,t,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Uz(t,e=!1){if(qu(t))return t.strict();if(LN(t)){let n=t._zod.def.shape;if(e)for(let[a,c]of Object.entries(t._zod.def.shape)){if(LN(c)){let s=Uz(c,e);n[a]=s}else if(lee(c)){let s=c._zod.def.element;LN(s)&&(s=Uz(s,e)),n[a]=im(c,{...c._zod.def,element:s})}else n[a]=c;let i=_m.get(c);i&&_m.add(n[a],i)}let l=im(t,{...t._zod.def,shape:n,catchall:LIt(HIt)}),I=_m.get(t);return I&&_m.add(l,I),l}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function wFe(t,e=!1){if(HFe(t))return t.passthrough();if(LN(t)){let n=t._zod.def.shape;if(e)for(let[a,c]of Object.entries(t._zod.def.shape)){if(LN(c)){let s=wFe(c,e);n[a]=s}else if(lee(c)){let s=c._zod.def.element;LN(s)&&(s=wFe(s,e)),n[a]=im(c,{...c._zod.def,element:s})}else n[a]=c;let i=_m.get(c);i&&_m.add(n[a],i)}let l=im(t,{...t._zod.def,shape:n,catchall:CIt(wIt)}),I=_m.get(t);return I&&_m.add(l,I),l}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function CLn(t){if(qu(t))try{let e=t.parse(void 0);return()=>e}catch{return}if(ei(t))try{let e=kz(t,void 0);return()=>e}catch{return}}function LLn(t){return qu(t)&&"typeName"in t._def&&t._def.typeName==="ZodEffects"}function kLn(t){return ei(t)&&t._zod.def.type==="pipe"}function DH(t,e=!1){if(qu(t))return LLn(t)?DH(t._def.schema,e):t;if(ei(t)){let n=t;if(kLn(t)&&(n=DH(t._zod.def.in,e)),e){if(LN(n)){let I=n._zod.def.shape;for(let[a,c]of Object.entries(n._zod.def.shape))I[a]=DH(c,e);n=im(n,{...n._zod.def,shape:I})}else if(lee(n)){let I=DH(n._zod.def.element,e);n=im(n,{...n._zod.def,element:I})}}let l=_m.get(t);return l&&_m.add(n,l),n}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}var Ly=B(()=>{T0e()});var QFe={};Xe(QFe,{Validator:()=>f5,deepCompareStrict:()=>MY,toJsonSchema:()=>Wl,validatesOnlyStrings:()=>X5});function Wl(t){if(ei(t)){let e=DH(t,!0);if(LN(e)){let n=Uz(e,!0);return M0e(n)}else return M0e(t)}return qu(t)?JN(t):t}function X5(t){if(!t||typeof t!="object"||Object.keys(t).length===0||Array.isArray(t))return!1;if("type"in t)return typeof t.type=="string"?t.type==="string":Array.isArray(t.type)?t.type.every(e=>e==="string"):!1;if("enum"in t)return Array.isArray(t.enum)&&t.enum.length>0&&t.enum.every(e=>typeof e=="string");if("const"in t)return typeof t.const=="string";if("allOf"in t&&Array.isArray(t.allOf))return t.allOf.some(e=>X5(e));if("anyOf"in t&&Array.isArray(t.anyOf)||"oneOf"in t&&Array.isArray(t.oneOf)){let e="anyOf"in t?t.anyOf:t.oneOf;return e.length>0&&e.every(n=>X5(n))}if("not"in t)return!1;if("$ref"in t&&typeof t.$ref=="string"){let e=t.$ref,n=CN(t);return n[e]?X5(n[e]):!1}return!1}var ky=B(()=>{T0e();v5();Oz();Ly();Oz()});function xLn(t,e){if(t!==void 0&&!zm(t))return t;if(Qz(e))try{let n=e.getName();return n=n.startsWith("Runnable")?n.slice(8):n,n}catch{return e.getName()}else return e.name??"UnknownSchema"}function jLn(t){return Qz(t.data)?{type:"runnable",data:{id:t.data.lc_id,name:t.data.getName()}}:{type:"schema",data:{...Wl(t.data.schema),title:t.data.name}}}function Fat(t,e=[]){let n=new Set(t.edges.filter(I=>!e.includes(I.source)).map(I=>I.target)),l=[];for(let I of Object.values(t.nodes))!e.includes(I.id)&&!n.has(I.id)&&l.push(I);return l.length===1?l[0]:void 0}function vat(t,e=[]){let n=new Set(t.edges.filter(I=>!e.includes(I.target)).map(I=>I.source)),l=[];for(let I of Object.values(t.nodes))!e.includes(I.id)&&!n.has(I.id)&&l.push(I);return l.length===1?l[0]:void 0}var Sz,fat=B(()=>{uG();w0e();uIt();ky();Sz=class t{constructor(e){Object.defineProperty(this,"nodes",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"edges",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.nodes=e?.nodes??this.nodes,this.edges=e?.edges??this.edges}toJSON(){let e={};return Object.values(this.nodes).forEach((n,l)=>{e[n.id]=zm(n.id)?l:n.id}),{nodes:Object.values(this.nodes).map(n=>({id:e[n.id],...jLn(n)})),edges:this.edges.map(n=>{let l={source:e[n.source],target:e[n.target]};return typeof n.data<"u"&&(l.data=n.data),typeof n.conditional<"u"&&(l.conditional=n.conditional),l})}}addNode(e,n,l){if(n!==void 0&&this.nodes[n]!==void 0)throw new Error(`Node with id ${n} already exists`);let I=n??$n(),a={id:I,data:e,name:xLn(n,e),metadata:l};return this.nodes[I]=a,a}removeNode(e){delete this.nodes[e.id],this.edges=this.edges.filter(n=>n.source!==e.id&&n.target!==e.id)}addEdge(e,n,l,I){if(this.nodes[e.id]===void 0)throw new Error(`Source node ${e.id} not in graph`);if(this.nodes[n.id]===void 0)throw new Error(`Target node ${n.id} not in graph`);let a={source:e.id,target:n.id,data:l,conditional:I};return this.edges.push(a),a}firstNode(){return Fat(this)}lastNode(){return vat(this)}extend(e,n=""){let l=n;Object.values(e.nodes).map(r=>r.id).every(zm)&&(l="");let a=r=>l?`${l}:${r}`:r;Object.entries(e.nodes).forEach(([r,u])=>{this.nodes[a(r)]={...u,id:a(r)}});let c=e.edges.map(r=>({...r,source:a(r.source),target:a(r.target)}));this.edges=[...this.edges,...c];let i=e.firstNode(),s=e.lastNode();return[i?{id:a(i.id),data:i.data}:void 0,s?{id:a(s.id),data:s.data}:void 0]}trimFirstNode(){let e=this.firstNode();e&&Fat(this,[e.id])&&this.removeNode(e)}trimLastNode(){let e=this.lastNode();e&&vat(this,[e.id])&&this.removeNode(e)}reid(){let e=Object.fromEntries(Object.values(this.nodes).map(I=>[I.id,I.name])),n=new Map;Object.values(e).forEach(I=>{n.set(I,(n.get(I)||0)+1)});let l=I=>{let a=e[I];return zm(I)&&n.get(a)===1?a:I};return new t({nodes:Object.fromEntries(Object.entries(this.nodes).map(([I,a])=>[l(I),{...a,id:l(I)}])),edges:this.edges.map(I=>({...I,source:l(I.source),target:l(I.target)}))})}drawMermaid(e){let{withStyles:n,curveStyle:l,nodeColors:I={default:"fill:#f2f0ff,line-height:1.2",first:"fill-opacity:0",last:"fill:#bfb6fc"},wrapLabelNWords:a}=e??{},c=this.reid(),i=c.firstNode(),s=c.lastNode();return iIt(c.nodes,c.edges,{firstNode:i?.id,lastNode:s?.id,withStyles:n,curveStyle:l,nodeColors:I,wrapLabelNWords:a})}async drawMermaidPng(e){let n=this.drawMermaid(e);return sIt(n,{backgroundColor:e?.backgroundColor})}}});function Xat(t){let e=new TextEncoder,n=new ReadableStream({async start(l){for await(let I of t)l.enqueue(e.encode(`event: data +data: ${JSON.stringify(I)} + +`));l.enqueue(e.encode(`event: end + +`)),l.close()}});return Uo.fromReadableStream(n)}var wat=B(()=>{JZ()});function EFe(t){return typeof t=="object"&&t!==null&&typeof t[Symbol.iterator]=="function"&&typeof t.next=="function"}function Iee(t){return typeof t=="object"&&t!==null&&typeof t[Symbol.asyncIterator]=="function"}function*JFe(t,e){for(;;){let{value:n,done:l}=Ib.runWithConfig(Dm(t),e.next.bind(e),!0);if(l)break;yield n}}async function*aee(t,e){let n=e[Symbol.asyncIterator]();for(;;){let{value:l,done:I}=await Ib.runWithConfig(Dm(t),n.next.bind(e),!0);if(I)break;yield l}}var Hat,Qat=B(()=>{y5();HN();Hat=t=>t!=null&&typeof t=="object"&&"next"in t&&typeof t.next=="function"});function Bc(t,e){return t&&!Array.isArray(t)&&!(t instanceof Date)&&typeof t=="object"?t:{[e]:t}}function OLn(t){if(C8(t))throw new Error("RunnableLambda requires a function that is not wrapped in traceable higher-order function. This shouldn't happen.")}function bh(t){if(typeof t=="function")return new ti({func:t});if(Zn.isRunnable(t))return t;if(!Array.isArray(t)&&typeof t=="object"){let e={};for(let[n,l]of Object.entries(t))e[n]=bh(l);return new LZ({steps:e})}else throw new Error(`Expected a Runnable, function or object. +Instead got an unsupported type.`)}function ULn(t,e){let n=e.name??t.getName(),l=e.description??zz(e.schema);return Bz(e.schema)?new H5({name:n,description:l,schema:St.object({input:St.string()}).transform(I=>I.input),bound:t}):new H5({name:n,description:l,schema:e.schema,bound:t})}var CFe,Zn,dG,KH,z2,Hr,LZ,LFe,ti,w5,_H,xy,jy,H5,Zd=B(()=>{X8();CFe=$(CH(),1);uG();IAe();J$();rIt();sh();JZ();R0e();HN();MH();oIt();w0e();y5();fat();wat();Qat();V8();Ly();Zn=class extends XI{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 n=this.name??this.constructor.lc_name()??this.constructor.name;return e?`${n}${e}`:n}bind(e){return new dG({bound:this,kwargs:e,config:{}})}map(){return new KH({bound:this})}withRetry(e){return new z2({bound:this,kwargs:{},config:{},maxAttemptNumber:e?.stopAfterAttempt,...e})}withConfig(e){return new dG({bound:this,config:e,kwargs:{}})}withFallbacks(e){let n=Array.isArray(e)?e:e.fallbacks;return new _H({runnable:this,fallbacks:n})}_getOptionsList(e,n=0){if(Array.isArray(e)&&e.length!==n)throw new Error(`Passed "options" must be an array with the same length as the inputs, but got ${e.length} options for ${n} inputs`);if(Array.isArray(e))return e.map(Xl);if(n>1&&!Array.isArray(e)&&e.runId){console.warn("Provided runId will be used only for the first element of the batch.");let l=Object.fromEntries(Object.entries(e).filter(([I])=>I!=="runId"));return Array.from({length:n},(I,a)=>Xl(a===0?e:l))}return Array.from({length:n},()=>Xl(e))}async batch(e,n,l){let I=this._getOptionsList(n??{},e.length),a=I[0]?.maxConcurrency??l?.maxConcurrency,c=new _u({maxConcurrency:a,onFailedAttempt:s=>{throw s}}),i=e.map((s,r)=>c.call(async()=>{try{return await this.invoke(s,I[r])}catch(u){if(l?.returnExceptions)return u;throw u}}));return Promise.all(i)}async*_streamIterator(e,n){yield this.invoke(e,n)}async stream(e,n){let l=Xl(n),I=new SY({generator:this._streamIterator(e,l),config:l});return await I.setup,Uo.fromAsyncGenerator(I)}_separateRunnableConfigFromCallOptions(e){let n;e===void 0?n=Xl(e):n=Xl({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 l={...e};return delete l.callbacks,delete l.tags,delete l.metadata,delete l.runName,delete l.configurable,delete l.recursionLimit,delete l.maxConcurrency,delete l.runId,delete l.timeout,delete l.signal,[n,l]}async _callWithConfig(e,n,l){let I=Xl(l),c=await(await Ao(I))?.handleChainStart(this.toJSON(),Bc(n,"input"),I.runId,I?.runType,void 0,void 0,I?.runName??this.getName());delete I.runId;let i;try{let s=e.call(this,n,I,c);i=await BY(s,l?.signal)}catch(s){throw await c?.handleChainError(s),s}return await c?.handleChainEnd(Bc(i,"output")),i}async _batchWithConfig(e,n,l,I){let a=this._getOptionsList(l??{},n.length),c=await Promise.all(a.map(Ao)),i=await Promise.all(c.map(async(r,u)=>{let o=await r?.handleChainStart(this.toJSON(),Bc(n[u],"input"),a[u].runId,a[u].runType,void 0,void 0,a[u].runName??this.getName());return delete a[u].runId,o})),s;try{let r=e.call(this,n,a,i,I);s=await BY(r,a?.[0]?.signal)}catch(r){throw await Promise.all(i.map(u=>u?.handleChainError(r))),r}return await Promise.all(i.map(r=>r?.handleChainEnd(Bc(s,"output")))),s}async*_transformStreamWithConfig(e,n,l){let I,a=!0,c,i=!0,s=Xl(l),r=await Ao(s);async function*u(){for await(let d of e){if(a)if(I===void 0)I=d;else try{I=Fo(I,d)}catch{I=void 0,a=!1}yield d}}let o;try{let d=await y0e(n.bind(this),u(),async()=>r?.handleChainStart(this.toJSON(),{input:""},s.runId,s.runType,void 0,void 0,s.runName??this.getName()),l?.signal,s);delete s.runId,o=d.setup;let b=o?.handlers.find(aIt),h=d.output;b!==void 0&&o!==void 0&&(h=b.tapOutputIterable(o.runId,h));let Z=o?.handlers.find(F0e);Z!==void 0&&o!==void 0&&(h=Z.tapOutputIterable(o.runId,h));for await(let N of h)if(yield N,i)if(c===void 0)c=N;else try{c=Fo(c,N)}catch{c=void 0,i=!1}}catch(d){throw await o?.handleChainError(d,void 0,void 0,void 0,{inputs:Bc(I,"input")}),d}await o?.handleChainEnd(c??{},void 0,void 0,void 0,{inputs:Bc(I,"input")})}getGraph(e){let n=new Sz,l=n.addNode({name:`${this.getName()}Input`,schema:St.any()}),I=n.addNode(this),a=n.addNode({name:`${this.getName()}Output`,schema:St.any()});return n.addEdge(l,I),n.addEdge(I,a),n}pipe(e){return new Hr({first:this,last:bh(e)})}pick(e){return this.pipe(new jy(e))}assign(e){return this.pipe(new xy(new LZ({steps:e})))}async*transform(e,n){let l;for await(let I of e)l===void 0?l=I:l=Fo(l,I);yield*this._streamIterator(l,Xl(n))}async*streamLog(e,n,l){let I=new A5({...l,autoClose:!1,_schemaFormat:"original"}),a=Xl(n);yield*this._streamLog(e,I,a)}async*_streamLog(e,n,l){let{callbacks:I}=l;if(I===void 0)l.callbacks=[n];else if(Array.isArray(I))l.callbacks=I.concat([n]);else{let s=I.copy();s.addHandler(n,!0),l.callbacks=s}let a=this.stream(e,l);async function c(){try{let s=await a;for await(let r of s){let u=new Km({ops:[{op:"add",path:"/streamed_output/-",value:r}]});await n.writer.write(u)}}finally{await n.writer.close()}}let i=c();try{for await(let s of n)yield s}finally{await i}}streamEvents(e,n,l){let I;if(n.version==="v1")I=this._streamEventsV1(e,n,l);else if(n.version==="v2")I=this._streamEventsV2(e,n,l);else throw new Error('Only versions "v1" and "v2" of the schema are currently supported.');return n.encoding==="text/event-stream"?Xat(I):Uo.fromAsyncGenerator(I)}async*_streamEventsV2(e,n,l){let I=new L$({...l,autoClose:!1}),a=Xl(n),c=a.runId??$n();a.runId=c;let i=a.callbacks;if(i===void 0)a.callbacks=[I];else if(Array.isArray(i))a.callbacks=i.concat(I);else{let h=i.copy();h.addHandler(I,!0),a.callbacks=h}let s=new AbortController,r=this;async function u(){let h,Z=null;try{n?.signal?"any"in AbortSignal?h=AbortSignal.any([s.signal,n.signal]):(h=n.signal,Z=()=>{s.abort()},n.signal.addEventListener("abort",Z,{once:!0})):h=s.signal;let N=await r.stream(e,{...a,signal:h}),g=I.tapOutputIterable(c,N);for await(let y of g)if(s.signal.aborted)break}finally{await I.finish(),h&&Z&&h.removeEventListener("abort",Z)}}let o=u(),d=!1,b;try{for await(let h of I){if(!d){h.data.input=e,d=!0,b=h.run_id,yield h;continue}h.run_id===b&&h.event.endsWith("_end")&&h.data?.input&&delete h.data.input,yield h}}finally{s.abort(),await o}}async*_streamEventsV1(e,n,l){let I,a=!1,c=Xl(n),i=c.tags??[],s=c.metadata??{},r=c.runName??this.getName(),u=new A5({...l,autoClose:!1,_schemaFormat:"streaming_events"}),o=new x$({...l}),d=this._streamLog(e,u,c);for await(let h of d){if(I?I=I.concat(h):I=k2.fromRunLogPatch(h),I.state===void 0)throw new Error('Internal error: "streamEvents" state is missing. Please open a bug report.');if(!a){a=!0;let y={...I.state},X={run_id:y.id,event:`on_${y.type}_start`,name:r,tags:i,metadata:s,data:{input:e}};o.includeEvent(X,y.type)&&(yield X)}let Z=h.ops.filter(y=>y.path.startsWith("/logs/")).map(y=>y.path.split("/")[2]),N=[...new Set(Z)];for(let y of N){let X,v={},H=I.state.logs[y];if(H.end_time===void 0?H.streamed_output.length>0?X="stream":X="start":X="end",X==="start")H.inputs!==void 0&&(v.input=H.inputs);else if(X==="end")H.inputs!==void 0&&(v.input=H.inputs),v.output=H.final_output;else if(X==="stream"){let Q=H.streamed_output.length;if(Q!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${Q} instead. Encountered in: "${H.name}"`);v={chunk:H.streamed_output[0]},H.streamed_output=[]}yield{event:`on_${H.type}_${X}`,name:H.name,run_id:H.id,tags:H.tags,metadata:H.metadata,data:v}}let{state:g}=I;if(g.streamed_output.length>0){let y=g.streamed_output.length;if(y!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${y} instead. Encountered in: "${g.name}"`);let X={chunk:g.streamed_output[0]};g.streamed_output=[];let v={event:`on_${g.type}_stream`,run_id:g.id,tags:i,metadata:s,name:r,data:X};o.includeEvent(v,g.type)&&(yield v)}}let b=I?.state;if(b!==void 0){let h={event:`on_${b.type}_end`,name:r,run_id:b.id,tags:i,metadata:s,data:{output:b.final_output}};o.includeEvent(h,b.type)&&(yield h)}}static isRunnable(e){return Qz(e)}withListeners({onStart:e,onEnd:n,onError:l}){return new dG({bound:this,config:{},configFactories:[I=>({callbacks:[new Hz({config:I,onStart:e,onEnd:n,onError:l})]})]})}asTool(e){return ULn(this,e)}},dG=class t extends Zn{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 n=wz(this.config,...e);return wz(n,...this.configFactories?await Promise.all(this.configFactories.map(async l=>await l(n))):[])}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 z2({bound:this.bound,kwargs:this.kwargs,config:this.config,maxAttemptNumber:e?.stopAfterAttempt,...e})}async invoke(e,n){return this.bound.invoke(e,await this._mergeConfig(Xl(n),this.kwargs))}async batch(e,n,l){let I=Array.isArray(n)?await Promise.all(n.map(async a=>this._mergeConfig(Xl(a),this.kwargs))):await this._mergeConfig(Xl(n),this.kwargs);return this.bound.batch(e,I,l)}async*_streamIterator(e,n){yield*this.bound._streamIterator(e,await this._mergeConfig(Xl(n),this.kwargs))}async stream(e,n){return this.bound.stream(e,await this._mergeConfig(Xl(n),this.kwargs))}async*transform(e,n){yield*this.bound.transform(e,await this._mergeConfig(Xl(n),this.kwargs))}streamEvents(e,n,l){let I=this,a=async function*(){yield*I.bound.streamEvents(e,{...await I._mergeConfig(Xl(n),I.kwargs),version:n.version},l)};return Uo.fromAsyncGenerator(a())}static isRunnableBinding(e){return e.bound&&Zn.isRunnable(e.bound)}withListeners({onStart:e,onEnd:n,onError:l}){return new t({bound:this.bound,kwargs:this.kwargs,config:this.config,configFactories:[I=>({callbacks:[new Hz({config:I,onStart:e,onEnd:n,onError:l})]})]})}},KH=class t extends Zn{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 t({bound:this.bound.bind(e)})}async invoke(e,n){return this._callWithConfig(this._invoke.bind(this),e,n)}async _invoke(e,n,l){return this.bound.batch(e,wI(n,{callbacks:l?.getChild()}))}withListeners({onStart:e,onEnd:n,onError:l}){return new t({bound:this.bound.withListeners({onStart:e,onEnd:n,onError:l})})}},z2=class extends dG{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,n,l){let I=e>1?`retry:attempt:${e}`:void 0;return wI(n,{callbacks:l?.getChild(I)})}async _invoke(e,n,l){return(0,CFe.default)(I=>super.invoke(e,this._patchConfigForRetry(I,n,l)),{onFailedAttempt:I=>this.onFailedAttempt(I,e),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}async invoke(e,n){return this._callWithConfig(this._invoke.bind(this),e,n)}async _batch(e,n,l,I){let a={};try{await(0,CFe.default)(async c=>{let i=e.map((d,b)=>b).filter(d=>a[d.toString()]===void 0||a[d.toString()]instanceof Error),s=i.map(d=>e[d]),r=i.map(d=>this._patchConfigForRetry(c,n?.[d],l?.[d])),u=await super.batch(s,r,{...I,returnExceptions:!0}),o;for(let d=0;dthis.onFailedAttempt(c,c.input),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}catch(c){if(I?.returnExceptions!==!0)throw c}return Object.keys(a).sort((c,i)=>parseInt(c,10)-parseInt(i,10)).map(c=>a[parseInt(c,10)])}async batch(e,n,l){return this._batchWithConfig(this._batch.bind(this),e,n,l)}},Hr=class t extends Zn{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,n){let l=Xl(n),a=await(await Ao(l))?.handleChainStart(this.toJSON(),Bc(e,"input"),l.runId,void 0,void 0,void 0,l?.runName);delete l.runId;let c=e,i;try{let s=[this.first,...this.middle];for(let r=0;r{let u=await s?.handleChainStart(this.toJSON(),Bc(e[r],"input"),I[r].runId,void 0,void 0,void 0,I[r].runName);return delete I[r].runId,u})),i=e;try{for(let s=0;s{let b=o?.getChild(this.omitSequenceTags?void 0:`seq:step:${s+1}`);return wI(I[d],{callbacks:b})}),l);i=await BY(u,I[0]?.signal)}}catch(s){throw await Promise.all(c.map(r=>r?.handleChainError(s))),s}return await Promise.all(c.map(s=>s?.handleChainEnd(Bc(i,"output")))),i}async*_streamIterator(e,n){let l=await Ao(n),{runId:I,...a}=n??{},c=await l?.handleChainStart(this.toJSON(),Bc(e,"input"),I,void 0,void 0,void 0,a?.runName),i=[this.first,...this.middle,this.last],s=!0,r;async function*u(){yield e}try{let o=i[0].transform(u(),wI(a,{callbacks:c?.getChild(this.omitSequenceTags?void 0:"seq:step:1")}));for(let d=1;d{let c=I.getGraph(e);a!==0&&c.trimFirstNode(),a!==this.steps.length-1&&c.trimLastNode(),n.extend(c);let i=c.firstNode();if(!i)throw new Error(`Runnable ${I} has no first node`);l&&n.addEdge(l,i),l=c.lastNode()}),n}pipe(e){return t.isRunnableSequence(e)?new t({first:this.first,middle:this.middle.concat([this.last,e.first,...e.middle]),last:e.last,name:this.name??e.name}):new t({first:this.first,middle:[...this.middle,this.last],last:bh(e),name:this.name})}static isRunnableSequence(e){return Array.isArray(e.middle)&&Zn.isRunnable(e)}static from([e,...n],l){let I={};return typeof l=="string"?I.name=l:l!==void 0&&(I=l),new t({...I,first:bh(e),middle:n.slice(0,-1).map(bh),last:bh(n[n.length-1])})}},LZ=class t extends Zn{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[n,l]of Object.entries(e.steps))this.steps[n]=bh(l)}static from(e){return new t({steps:e})}async invoke(e,n){let l=Xl(n),a=await(await Ao(l))?.handleChainStart(this.toJSON(),{input:e},l.runId,void 0,void 0,void 0,l?.runName);delete l.runId;let c={};try{let i=Object.entries(this.steps).map(async([s,r])=>{c[s]=await r.invoke(e,wI(l,{callbacks:a?.getChild(`map:key:${s}`)}))});await BY(Promise.all(i),n?.signal)}catch(i){throw await a?.handleChainError(i),i}return await a?.handleChainEnd(c),c}async*_transform(e,n,l){let I={...this.steps},a=E$(e,Object.keys(I).length),c=new Map(Object.entries(I).map(([i,s],r)=>{let u=s.transform(a[r],wI(l,{callbacks:n?.getChild(`map:key:${i}`)}));return[i,u.next().then(o=>({key:i,gen:u,result:o}))]}));for(;c.size;){let i=Promise.race(c.values()),{key:s,result:r,gen:u}=await BY(i,l?.signal);c.delete(s),r.done||(yield{[s]:r.value},c.set(s,u.next().then(o=>({key:s,gen:u,result:o}))))}}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=Xl(n),a=new SY({generator:this.transform(l(),I),config:I});return await a.setup,Uo.fromAsyncGenerator(a)}},LFe=class t extends Zn{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}),!C8(e.func))throw new Error("RunnableTraceable requires a function that is wrapped in traceable higher-order function");this.func=e.func}async invoke(e,n){let[l]=this._getOptionsList(n??{},1),I=await Ao(l),a=this.func(wI(l,{callbacks:I}),e);return BY(a,l?.signal)}async*_streamIterator(e,n){let[l]=this._getOptionsList(n??{},1),I=await this.invoke(e,n);if(Iee(I)){for await(let a of I)l?.signal?.throwIfAborted(),yield a;return}if(Hat(I)){for(;;){l?.signal?.throwIfAborted();let a=I.next();if(a.done)break;yield a.value}return}yield I}static from(e){return new t({func:e})}};ti=class t extends Zn{static lc_name(){return"RunnableLambda"}constructor(e){if(C8(e.func))return LFe.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}),OLn(e.func),this.func=e.func}static from(e){return new t({func:e})}async _invoke(e,n,l){return new Promise((I,a)=>{let c=wI(n,{callbacks:l?.getChild(),recursionLimit:(n?.recursionLimit??Q$)-1});Ib.runWithConfig(Dm(c),async()=>{try{let i=await this.func(e,{...c});if(i&&Zn.isRunnable(i)){if(n?.recursionLimit===0)throw new Error("Recursion limit reached.");i=await i.invoke(e,{...c,recursionLimit:(c.recursionLimit??Q$)-1})}else if(Iee(i)){let s;for await(let r of aee(c,i))if(n?.signal?.throwIfAborted(),s===void 0)s=r;else try{s=Fo(s,r)}catch{s=r}i=s}else if(EFe(i)){let s;for(let r of JFe(c,i))if(n?.signal?.throwIfAborted(),s===void 0)s=r;else try{s=Fo(s,r)}catch{s=r}i=s}I(i)}catch(i){a(i)}})})}async invoke(e,n){return this._callWithConfig(this._invoke.bind(this),e,n)}async*_transform(e,n,l){let I;for await(let i of e)if(I===void 0)I=i;else try{I=Fo(I,i)}catch{I=i}let a=wI(l,{callbacks:n?.getChild(),recursionLimit:(l?.recursionLimit??Q$)-1}),c=await new Promise((i,s)=>{Ib.runWithConfig(Dm(a),async()=>{try{let r=await this.func(I,{...a,config:a});i(r)}catch(r){s(r)}})});if(c&&Zn.isRunnable(c)){if(l?.recursionLimit===0)throw new Error("Recursion limit reached.");let i=await c.stream(I,a);for await(let s of i)yield s}else if(Iee(c))for await(let i of aee(a,c))l?.signal?.throwIfAborted(),yield i;else if(EFe(c))for(let i of JFe(a,c))l?.signal?.throwIfAborted(),yield i;else yield c}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=Xl(n),a=new SY({generator:this.transform(l(),I),config:I});return await a.setup,Uo.fromAsyncGenerator(a)}},w5=class extends LZ{},_H=class extends Zn{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,n){let l=Xl(n),I=await Ao(l),{runId:a,...c}=l,i=await I?.handleChainStart(this.toJSON(),Bc(e,"input"),a,void 0,void 0,void 0,c?.runName),s=wI(c,{callbacks:i?.getChild()});return await Ib.runWithConfig(s,async()=>{let u;for(let o of this.runnables()){l?.signal?.throwIfAborted();try{let d=await o.invoke(e,s);return await i?.handleChainEnd(Bc(d,"output")),d}catch(d){u===void 0&&(u=d)}}throw u===void 0?new Error("No error stored at end of fallback."):(await i?.handleChainError(u),u)})}async*_streamIterator(e,n){let l=Xl(n),I=await Ao(l),{runId:a,...c}=l,i=await I?.handleChainStart(this.toJSON(),Bc(e,"input"),a,void 0,void 0,void 0,c?.runName),s,r;for(let o of this.runnables()){l?.signal?.throwIfAborted();let d=wI(c,{callbacks:i?.getChild()});try{let b=await o.stream(e,d);r=aee(d,b);break}catch(b){s===void 0&&(s=b)}}if(r===void 0){let o=s??new Error("No error stored at end of fallback.");throw await i?.handleChainError(o),o}let u;try{for await(let o of r){yield o;try{u=u===void 0?u:Fo(u,o)}catch{u=void 0}}}catch(o){throw await i?.handleChainError(o),o}await i?.handleChainEnd(Bc(u,"output"))}async batch(e,n,l){if(l?.returnExceptions)throw new Error("Not implemented.");let I=this._getOptionsList(n??{},e.length),a=await Promise.all(I.map(s=>Ao(s))),c=await Promise.all(a.map(async(s,r)=>{let u=await s?.handleChainStart(this.toJSON(),Bc(e[r],"input"),I[r].runId,void 0,void 0,void 0,I[r].runName);return delete I[r].runId,u})),i;for(let s of this.runnables()){I[0].signal?.throwIfAborted();try{let r=await s.batch(e,c.map((u,o)=>wI(I[o],{callbacks:u?.getChild()})),l);return await Promise.all(c.map((u,o)=>u?.handleChainEnd(Bc(r[o],"output")))),r}catch(r){i===void 0&&(i=r)}}throw i?(await Promise.all(c.map(s=>s?.handleChainError(i))),i):new Error("No error stored at end of fallbacks.")}};xy=class extends Zn{static lc_name(){return"RunnableAssign"}constructor(e){e instanceof LZ&&(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,n){let l=await this.mapper.invoke(e,n);return{...e,...l}}async*_transform(e,n,l){let I=this.mapper.getStepsKeys(),[a,c]=E$(e),i=this.mapper.transform(c,wI(l,{callbacks:n?.getChild()})),s=i.next();for await(let r of a){if(typeof r!="object"||Array.isArray(r))throw new Error(`RunnableAssign can only be used with objects as input, got ${typeof r}`);let u=Object.fromEntries(Object.entries(r).filter(([o])=>!I.includes(o)));Object.keys(u).length>0&&(yield u)}yield(await s).value;for await(let r of i)yield r}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=Xl(n),a=new SY({generator:this.transform(l(),I),config:I});return await a.setup,Uo.fromAsyncGenerator(a)}},jy=class extends Zn{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 n=this.keys.map(l=>[l,e[l]]).filter(l=>l[1]!==void 0);return n.length===0?void 0:Object.fromEntries(n)}}async invoke(e,n){return this._callWithConfig(this._pick.bind(this),e,n)}async*_transform(e){for await(let n of e){let l=await this._pick(n);l!==void 0&&(yield l)}}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=Xl(n),a=new SY({generator:this.transform(l(),I),config:I});return await a.setup,Uo.fromAsyncGenerator(a)}},H5=class extends dG{constructor(e){let n=Hr.from([ti.from(async l=>{let I;if(F2(l))try{I=await DY(this.schema,l.args)}catch{throw new yZ("Received tool input did not match expected schema",JSON.stringify(l.args))}else I=l;return I}).withConfig({runName:`${e.name}:parse_input`}),e.bound]).withConfig({runName:e.name});super({bound:n,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"}}});var Q5,kFe=B(()=>{RZ();Q5=class extends yc{constructor(e){super({...e,content:""}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e.id}_getType(){return"remove"}get _printableFields(){return{...super._printableFields,id:this.id}}}});function zLn(t,e){return Array.isArray(t)?Eat(t,e):ti.from(n=>Eat(n,t))}function Eat(t,e={}){let{includeNames:n,excludeNames:l,includeTypes:I,excludeTypes:a,includeIds:c,excludeIds:i}=e,s=[];for(let r of t)if(!(l&&r.name&&l.includes(r.name))){{if(a&&ree(r,a))continue;if(i&&r.id&&i.includes(r.id))continue}I||c||n?(n&&r.name&&n.some(u=>u===r.name)||I&&ree(r,I)||c&&r.id&&c.some(u=>u===r.id))&&s.push(r):s.push(r)}return s}function BLn(t){return Array.isArray(t)?Jat(t):ti.from(Jat)}function Jat(t){if(!t.length)return[];let e=[];for(let n of t){let l=n,I=e.pop();if(!I)e.push(l);else if(l.getType()==="tool"||l.getType()!==I.getType())e.push(I,l);else{let a=o5(I),c=o5(l),i=a.concat(c);typeof a.content=="string"&&typeof c.content=="string"&&(i.content=`${a.content} +${c.content}`),e.push(TLn(i))}}return e}function SLn(t,e){if(Array.isArray(t)){let n=t;if(!e)throw new Error("Options parameter is required when providing messages.");return Cat(n,e)}else{let n=t;return ti.from(l=>Cat(l,n)).withConfig({runName:"trim_messages"})}}async function Cat(t,e){let{maxTokens:n,tokenCounter:l,strategy:I="last",allowPartial:a=!1,endOn:c,startOn:i,includeSystem:s=!1,textSplitter:r}=e;if(i&&I==="first")throw new Error("`startOn` should only be specified if `strategy` is 'last'.");if(s&&I==="first")throw new Error("`includeSystem` should only be specified if `strategy` is 'last'.");let u;"getNumTokens"in l?u=async d=>(await Promise.all(d.map(h=>l.getNumTokens(h.content)))).reduce((h,Z)=>h+Z,0):u=async d=>l(d);let o=xat;if(r&&("splitText"in r?o=r.splitText:o=async d=>r(d)),I==="first")return kat(t,{maxTokens:n,tokenCounter:u,textSplitter:o,partialStrategy:a?"first":void 0,endOn:c});if(I==="last")return MLn(t,{maxTokens:n,tokenCounter:u,textSplitter:o,allowPartial:a,includeSystem:s,startOn:i,endOn:c});throw new Error(`Unrecognized strategy: '${I}'. Must be one of 'first' or 'last'.`)}async function kat(t,e){let{maxTokens:n,tokenCounter:l,textSplitter:I,partialStrategy:a,endOn:c}=e,i=[...t],s=0;for(let r=0;r0?i.slice(0,-r):i;if(await l(u)<=n){s=i.length-r;break}}if(sy!=="type"&&!y.startsWith("lc_"))),N=xFe(u.getType(),{...Z,content:h}),g=[...i.slice(0,s),N];if(await l(g)<=n)i=g,s+=1,r=!0;else break}r&&a==="last"&&(u.content=[...d].reverse())}if(!r){let u=i[s],o;if(Array.isArray(u.content)&&u.content.some(d=>typeof d=="string"||d.type==="text")?o=u.content.find(b=>b.type==="text"&&b.text)?.text:typeof u.content=="string"&&(o=u.content),o){let d=await I(o),b=d.length;a==="last"&&d.reverse();for(let h=0;h0&&!ree(i[s-1],r);)s-=1}return i.slice(0,s)}async function MLn(t,e){let{allowPartial:n=!1,includeSystem:l=!1,endOn:I,startOn:a,...c}=e,i=t.map(u=>{let o=Object.fromEntries(Object.entries(u).filter(([d])=>d!=="type"&&!d.startsWith("lc_")));return xFe(u.getType(),o,rz(u))});if(I){let u=Array.isArray(I)?I:[I];for(;i.length>0&&!ree(i[i.length-1],u);)i=i.slice(0,-1)}let s=l&&i[0]?.getType()==="system",r=s?i.slice(0,1).concat(i.slice(1).reverse()):i.reverse();return r=await kat(r,{...c,partialStrategy:n?"last":void 0,endOn:a}),s?[r[0],...r.slice(1).reverse()]:r.reverse()}function xFe(t,e,n){let l,I;switch(t){case"human":n?l=new oG(e):I=new Qn(e);break;case"ai":if(n){let a={...e};"tool_calls"in a&&(a={...a,tool_call_chunks:a.tool_calls?.map(c=>({...c,type:"tool_call_chunk",index:void 0,args:JSON.stringify(c.args)}))}),l=new Jl(a)}else I=new _t(e);break;case"system":n?l=new pd(e):I=new Xr(e);break;case"developer":n?l=new pd({...e,additional_kwargs:{...e.additional_kwargs,__openai_role__:"developer"}}):I=new Xr({...e,additional_kwargs:{...e.additional_kwargs,__openai_role__:"developer"}});break;case"tool":if("tool_call_id"in e)n?l=new PG(e):I=new Oo(e);else throw new Error("Can not convert ToolMessage to ToolMessageChunk if 'tool_call_id' field is not defined.");break;case"function":if(n)l=new cG(e);else{if(!e.name)throw new Error("FunctionMessage must have a 'name' field");I=new rG(e)}break;case"generic":if("role"in e)n?l=new aG(e):I=new lo(e);else throw new Error("Can not convert ChatMessage to ChatMessageChunk if 'role' field is not defined.");break;default:throw new Error(`Unrecognized message type ${t}`)}if(n&&l)return l;if(I)return I;throw new Error(`Unrecognized message type ${t}`)}function TLn(t){let e=t.getType(),n,l=Object.fromEntries(Object.entries(t).filter(([I])=>!["type","tool_call_chunks"].includes(I)&&!I.startsWith("lc_")));if(e in Lat&&(n=xFe(e,l)),!n)throw new Error(`Unrecognized message chunk class ${e}. Supported classes are ${Object.keys(Lat)}`);return n}function xat(t){let e=t.split(` +`);return Promise.resolve([...e.slice(0,-1).map(n=>`${n} +`),e[e.length-1]])}var ree,Lat,jat=B(()=>{Zd();ZH();RZ();Z8();W8();cz();kFe();N8();c5();gy();ree=(t,e)=>{let n=[...new Set(e?.map(I=>{if(typeof I=="string")return I;let a=new I({});if(!("getType"in a)||typeof a.getType!="function")throw new Error("Invalid type provided.");return a.getType()}))],l=t.getType();return n.some(I=>I===l)};Lat={human:{message:Qn,messageChunk:oG},ai:{message:_t,messageChunk:Jl},system:{message:Xr,messageChunk:pd},developer:{message:Xr,messageChunk:pd},tool:{message:Oo,messageChunk:PG},function:{message:rG,messageChunk:cG},generic:{message:lo,messageChunk:aG},remove:{message:Q5,messageChunk:Q5}}});var jFe={};Xe(jFe,{AIMessage:()=>_t,AIMessageChunk:()=>Jl,BaseMessage:()=>yc,BaseMessageChunk:()=>md,ChatMessage:()=>lo,ChatMessageChunk:()=>aG,FunctionMessage:()=>rG,FunctionMessageChunk:()=>cG,HumanMessage:()=>Qn,HumanMessageChunk:()=>oG,RemoveMessage:()=>Q5,SystemMessage:()=>Xr,SystemMessageChunk:()=>pd,ToolMessage:()=>Oo,ToolMessageChunk:()=>PG,_isMessageFieldWithRole:()=>Oye,_mergeDicts:()=>Ro,_mergeLists:()=>r5,_mergeObj:()=>jye,_mergeStatus:()=>xye,coerceMessageLikeToMessage:()=>AZ,convertToChunk:()=>o5,convertToOpenAIImageBlock:()=>Lye,convertToProviderContentBlock:()=>az,defaultTextSplitter:()=>xat,filterMessages:()=>zLn,getBufferString:()=>mr,isAIMessage:()=>qG,isAIMessageChunk:()=>h8,isBase64ContentBlock:()=>Cye,isBaseMessage:()=>$r,isBaseMessageChunk:()=>rz,isChatMessage:()=>gHn,isChatMessageChunk:()=>RHn,isDataContentBlock:()=>uh,isFunctionMessage:()=>yHn,isFunctionMessageChunk:()=>AHn,isHumanMessage:()=>FHn,isHumanMessageChunk:()=>vHn,isIDContentBlock:()=>WHn,isOpenAIToolCallArray:()=>YHn,isPlainTextContentBlock:()=>ZHn,isSystemMessage:()=>fHn,isSystemMessageChunk:()=>XHn,isToolMessage:()=>p8,isToolMessageChunk:()=>q$e,isURLContentBlock:()=>Jye,mapChatMessagesToStoredMessages:()=>EHn,mapStoredMessageToChatMessage:()=>Y8,mapStoredMessagesToChatMessages:()=>zye,mergeContent:()=>dh,mergeMessageRuns:()=>BLn,parseBase64DataUrl:()=>y2,parseMimeType:()=>NHn,trimMessages:()=>SLn});var KY=B(()=>{ZH();RZ();Z8();W8();cz();N8();gy();jat();kFe();kye();c5()});var Vr=B(()=>{KY()});var OFe={};Xe(OFe,{BasePromptValue:()=>E5,ChatPromptValue:()=>Oy,ImagePromptValue:()=>Mz,StringPromptValue:()=>mh});var E5,mh,Oy,Mz,B2=B(()=>{sh();cz();gy();E5=class extends XI{},mh=class extends E5{static lc_name(){return"StringPromptValue"}constructor(e){super({value:e}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompt_values"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.value=e}toString(){return this.value}toChatMessages(){return[new Qn(this.value)]}},Oy=class extends E5{static lc_name(){return"ChatPromptValue"}constructor(e){Array.isArray(e)&&(e={messages:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompt_values"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.messages=e.messages}toString(){return mr(this.messages)}toChatMessages(){return this.messages}},Mz=class extends E5{static lc_name(){return"ImagePromptValue"}constructor(e){"imageUrl"in e||(e={imageUrl:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompt_values"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"imageUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.imageUrl=e.imageUrl}toString(){return this.imageUrl.url}toChatMessages(){return[new Qn({content:[{type:"image_url",image_url:{detail:this.imageUrl.detail,url:this.imageUrl.url}}]})]}}});var _Y,Tz=B(()=>{B2();J5();_Y=class extends ph{async formatPromptValue(e){let n=await this.format(e);return new mh(n)}}});function zFe(t){return typeof t=="function"}function KLn(t){return L5(t)?"array":typeof t}function UFe(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Oat(t,e){return t!=null&&typeof t=="object"&&e in t}function _Ln(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}function qLn(t,e){return PLn.call(t,e)}function ekn(t){return!qLn($Ln,t)}function nkn(t){return String(t).replace(/[&<>"'`=\/]/g,function(n){return tkn[n]})}function ckn(t,e){if(!t)return[];var n=!1,l=[],I=[],a=[],c=!1,i=!1,s="",r=0;function u(){if(c&&!i)for(;a.length;)delete I[a.pop()];else a=[];c=!1,i=!1}var o,d,b;function h(J){if(typeof J=="string"&&(J=J.split(Ikn,2)),!L5(J)||J.length!==2)throw new Error("Invalid tags: "+J);o=new RegExp(UFe(J[0])+"\\s*"),d=new RegExp("\\s*"+UFe(J[1])),b=new RegExp("\\s*"+UFe("}"+J[1]))}h(e||kZ.tags);for(var Z=new Kz(t),N,g,y,X,v,H;!Z.eos();){if(N=Z.pos,y=Z.scanUntil(o),y)for(var Q=0,L=y.length;Q"?v=[g,y,N,Z.pos,s,r,n]:v=[g,y,N,Z.pos],r++,I.push(v),g==="#"||g==="^")l.push(v);else if(g==="/"){if(H=l.pop(),!H)throw new Error('Unopened section "'+y+'" at '+N);if(H[1]!==y)throw new Error('Unclosed section "'+H[1]+'" at '+N)}else g==="name"||g==="{"||g==="&"?i=!0:g==="="&&h(y)}if(u(),H=l.pop(),H)throw new Error('Unclosed section "'+H[1]+'" at '+Z.pos);return ikn(okn(I))}function okn(t){for(var e=[],n,l,I=0,a=t.length;I0?l[l.length-1][4]:e;break;default:n.push(I)}return e}function Kz(t){this.string=t,this.tail=t,this.pos=0}function C5(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function um(){this.templateCache={_cache:{},set:function(e,n){this._cache[e]=n},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}var DLn,L5,PLn,$Ln,tkn,lkn,Ikn,Uat,akn,rkn,kZ,Dz,cee,zat=B(()=>{DLn=Object.prototype.toString,L5=Array.isArray||function(e){return DLn.call(e)==="[object Array]"};PLn=RegExp.prototype.test;$Ln=/\S/;tkn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};lkn=/\s*/,Ikn=/\s+/,Uat=/\s*=/,akn=/\s*\}/,rkn=/#|\^|\/|>|\{|&|=|!/;Kz.prototype.eos=function(){return this.tail===""};Kz.prototype.scan=function(e){var n=this.tail.match(e);if(!n||n.index!==0)return"";var l=n[0];return this.tail=this.tail.substring(l.length),this.pos+=l.length,l};Kz.prototype.scanUntil=function(e){var n=this.tail.search(e),l;switch(n){case-1:l=this.tail,this.tail="";break;case 0:l="";break;default:l=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=l.length,l};C5.prototype.push=function(e){return new C5(e,this)};C5.prototype.lookup=function(e){var n=this.cache,l;if(n.hasOwnProperty(e))l=n[e];else{for(var I=this,a,c,i,s=!1;I;){if(e.indexOf(".")>0)for(a=I.view,c=e.split("."),i=0;a!=null&&i"?r=this.renderPartial(i,n,l,a):s==="&"?r=this.unescapedValue(i,n):s==="name"?r=this.escapedValue(i,n,a):s==="text"&&(r=this.rawValue(i)),r!==void 0&&(c+=r);return c};um.prototype.renderSection=function(e,n,l,I,a){var c=this,i="",s=n.lookup(e[1]);function r(d){return c.render(d,n,l,a)}if(s){if(L5(s))for(var u=0,o=s.length;u0||!l)&&(a[c]=I+a[c]);return a.join(` +`)};um.prototype.renderPartial=function(e,n,l,I){if(l){var a=this.getConfigTags(I),c=zFe(l)?l(e[1]):l[e[1]];if(c!=null){var i=e[6],s=e[5],r=e[4],u=c;s==0&&r&&(u=this.indentPartial(c,r,i));var o=this.parse(u,a);return this.renderTokens(o,n,l,u,I)}}};um.prototype.unescapedValue=function(e,n){var l=n.lookup(e[1]);if(l!=null)return l};um.prototype.escapedValue=function(e,n,l){var I=this.getConfigEscape(l)||kZ.escape,a=n.lookup(e[1]);if(a!=null)return typeof a=="number"&&I===kZ.escape?String(a):I(a)};um.prototype.rawValue=function(e){return e[1]};um.prototype.getConfigTags=function(e){return L5(e)?e:e&&typeof e=="object"?e.tags:void 0};um.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!L5(e))return e.escape};kZ={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(t){Dz.templateCache=t},get templateCache(){return Dz.templateCache}},Dz=new um;kZ.clearCache=function(){return Dz.clearCache()};kZ.parse=function(e,n){return Dz.parse(e,n)};kZ.render=function(e,n,l,I){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+KLn(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Dz.render(e,n,l,I)};kZ.escape=nkn;kZ.Scanner=Kz;kZ.Context=C5;kZ.Writer=um;cee=kZ});function Bat(){cee.escape=t=>t}var k5,skn,_z,x5,Sat,oee,Mat,Ja,j5,S2,PH=B(()=>{zat();oz();k5=t=>{let e=t.split(""),n=[],l=(a,c)=>{for(let i=c;it.map(e=>e[0]==="name"?{type:"variable",name:e[1].includes(".")?e[1].split(".")[0]:e[1]}:["#","&","^",">"].includes(e[0])?{type:"variable",name:e[1]}:{type:"literal",text:e[1]}),_z=t=>{Bat();let e=cee.parse(t);return skn(e)},x5=(t,e)=>k5(t).reduce((n,l)=>{if(l.type==="variable"){if(l.name in e){let I=typeof e[l.name]=="string"?e[l.name]:JSON.stringify(e[l.name]);return n+I}throw new Error(`(f-string) Missing value for input ${l.name}`)}return n+l.text},""),Sat=(t,e)=>(Bat(),cee.render(t,e)),oee={"f-string":x5,mustache:Sat},Mat={"f-string":k5,mustache:_z},Ja=(t,e,n)=>{try{return oee[e](t,n)}catch(l){throw A2(l,"INVALID_PROMPT_INPUT")}},j5=(t,e)=>Mat[e](t),S2=(t,e,n)=>{if(!(e in oee)){let l=Object.keys(oee);throw new Error(`Invalid template format. Got \`${e}\`; + should be one of ${l}`)}try{let l=n.reduce((I,a)=>(I[a]="foo",I),{});Array.isArray(t)?t.forEach(I=>{if(I.type==="text")Ja(I.text,e,l);else if(I.type==="image_url")if(typeof I.image_url=="string")Ja(I.image_url,e,l);else{let a=I.image_url.url;Ja(a,e,l)}else throw new Error(`Invalid message template received. ${JSON.stringify(I,null,2)}`)}):Ja(t,e,l)}catch(l){throw new Error(`Invalid prompt schema: ${l.message}`)}}});var BFe={};Xe(BFe,{PromptTemplate:()=>xe});var xe,O5=B(()=>{Tz();PH();xe=class t extends _Y{static lc_name(){return"PromptTemplate"}constructor(e){if(super(e),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"additionalContentFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e.templateFormat==="mustache"&&e.validateTemplate===void 0&&(this.validateTemplate=!1),Object.assign(this,e),this.validateTemplate){if(this.templateFormat==="mustache")throw new Error("Mustache templates cannot be validated.");let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),S2(this.template,this.templateFormat,n)}}_getPromptType(){return"prompt"}async format(e){let n=await this.mergePartialAndUserVariables(e);return Ja(this.template,this.templateFormat,n)}static fromExamples(e,n,l,I=` + +`,a=""){let c=[a,...e,n].join(I);return new t({inputVariables:l,template:c})}static fromTemplate(e,n){let{templateFormat:l="f-string",...I}=n??{},a=new Set;return j5(e,l).forEach(c=>{c.type==="variable"&&a.add(c.name)}),new t({inputVariables:[...a],templateFormat:l,template:e,...I})}async partial(e){let n=this.inputVariables.filter(a=>!(a in e)),l={...this.partialVariables??{},...e},I={...this,inputVariables:n,partialVariables:l};return new t(I)}serialize(){if(this.outputParser!==void 0)throw new Error("Cannot serialize a prompt template with an output parser");return{_type:this._getPromptType(),input_variables:this.inputVariables,template:this.template,template_format:this.templateFormat}}static async deserialize(e){if(!e.template)throw new Error("Prompt template must have a template");return new t({inputVariables:e.input_variables,template:e.template,templateFormat:e.template_format})}}});var Uy,SFe=B(()=>{B2();J5();PH();Uy=class t extends ph{static lc_name(){return"ImagePromptTemplate"}constructor(e){if(super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","image"]}),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"additionalContentFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e.template,this.templateFormat=e.templateFormat??this.templateFormat,this.validateTemplate=e.validateTemplate??this.validateTemplate,this.additionalContentFields=e.additionalContentFields,this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),S2([{type:"image_url",image_url:this.template}],this.templateFormat,n)}}_getPromptType(){return"prompt"}async partial(e){let n=this.inputVariables.filter(a=>!(a in e)),l={...this.partialVariables??{},...e},I={...this,inputVariables:n,partialVariables:l};return new t(I)}async format(e){let n={};for(let[c,i]of Object.entries(this.template))typeof i=="string"?n[c]=Ja(i,this.templateFormat,e):n[c]=i;let l=e.url||n.url,I=e.detail||n.detail;if(!l)throw new Error("Must provide either an image URL.");if(typeof l!="string")throw new Error("url must be a string.");let a={url:l};return I&&(a.detail=I),a}async formatPromptValue(e){let n=await this.format(e);return new Mz(n)}}});function MFe(t,e){let n=[];for(let l of Object.values(t))if(typeof l=="string")j5(l,e).forEach(I=>{I.type==="variable"&&n.push(I.name)});else if(Array.isArray(l))for(let I of l)typeof I=="string"?j5(I,e).forEach(a=>{a.type==="variable"&&n.push(a.name)}):typeof I=="object"&&n.push(...MFe(I,e));else typeof l=="object"&&l!==null&&n.push(...MFe(l,e));return Array.from(new Set(n))}function TFe(t,e,n){let l={};for(let[I,a]of Object.entries(t))if(typeof a=="string")l[I]=Ja(a,n,e);else if(Array.isArray(a)){let c=[];for(let i of a)typeof i=="string"?c.push(Ja(i,n,e)):typeof i=="object"&&c.push(TFe(i,e,n));l[I]=c}else typeof a=="object"&&a!==null?l[I]=TFe(a,e,n):l[I]=a;return l}var U5,DFe=B(()=>{Zd();PH();U5=class extends Zn{static lc_name(){return"DictPromptTemplate"}constructor(e){let n=e.templateFormat??"f-string",l=MFe(e.template,n);super({inputVariables:l,...e}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","dict"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e.template,this.templateFormat=n,this.inputVariables=l}async format(e){return TFe(this.template,e,this.templateFormat)}async invoke(e){return await this._callWithConfig(this.format.bind(this),e,{runType:"prompt"})}}});function ukn(t){return t===null||typeof t!="object"||Array.isArray(t)?!1:Object.keys(t).length===1&&"text"in t&&typeof t.text=="string"}function dkn(t){return t===null||typeof t!="object"||Array.isArray(t)?!1:"image_url"in t&&(typeof t.image_url=="string"||typeof t.image_url=="object"&&t.image_url!==null&&"url"in t.image_url&&typeof t.image_url.url=="string")}function Gkn(t){return typeof t.formatMessages=="function"}function bkn(t,e){if(Gkn(t)||$r(t))return t;if(Array.isArray(t)&&t[0]==="placeholder"){let I=t[1];if(e?.templateFormat==="mustache"&&typeof I=="string"&&I.slice(0,2)==="{{"&&I.slice(-2)==="}}"){let a=I.slice(2,-2);return new hh({variableName:a,optional:!0})}else if(typeof I=="string"&&I[0]==="{"&&I[I.length-1]==="}"){let a=I.slice(1,-1);return new hh({variableName:a,optional:!0})}throw new Error(`Invalid placeholder template for format ${e?.templateFormat??'"f-string"'}: "${t[1]}". Expected a variable name surrounded by ${e?.templateFormat==="mustache"?"double":"single"} curly braces.`)}let n=AZ(t),l;if(typeof n.content=="string"?l=n.content:l=n.content.map(I=>"text"in I?{...I,text:I.text}:"image_url"in I?{...I,image_url:I.image_url}:I),n._getType()==="human")return RI.fromTemplate(l,e);if(n._getType()==="ai")return Zh.fromTemplate(l,e);if(n._getType()==="system")return kr.fromTemplate(l,e);if(lo.isInstance(n))return B5.fromTemplate(n.content,n.role,e);throw new Error(`Could not coerce message prompt template from input. Received message type: "${n._getType()}".`)}function mkn(t){return t.constructor.lc_name()==="MessagesPlaceholder"}var z5,hh,iee,M2,B5,Pz,RI,Zh,kr,HI,qz=B(()=>{KY();B2();Zd();Tz();J5();O5();SFe();PH();oz();DFe();z5=class extends Zn{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","chat"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0})}async invoke(e,n){return this._callWithConfig(l=>this.formatMessages(l),e,{...n,runType:"prompt"})}},hh=class extends z5{static lc_name(){return"MessagesPlaceholder"}constructor(e){typeof e=="string"&&(e={variableName:e}),super(e),Object.defineProperty(this,"variableName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"optional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.variableName=e.variableName,this.optional=e.optional??!1}get inputVariables(){return[this.variableName]}async formatMessages(e){let n=e[this.variableName];if(this.optional&&!n)return[];if(!n){let I=new Error(`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages as an input value. Received: undefined`);throw I.name="InputFormatError",I}let l;try{Array.isArray(n)?l=n.map(AZ):l=[AZ(n)]}catch(I){let a=typeof n=="string"?n:JSON.stringify(n,null,2),c=new Error([`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages or coerceable values as input.`,`Received value: ${a}`,`Additional message: ${I.message}`].join(` + +`));throw c.name="InputFormatError",c.lc_error_code=I.lc_error_code,c}return l}},iee=class extends z5{constructor(e){"prompt"in e||(e={prompt:e}),super(e),Object.defineProperty(this,"prompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.prompt=e.prompt}get inputVariables(){return this.prompt.inputVariables}async formatMessages(e){return[await this.format(e)]}},M2=class extends ph{constructor(e){super(e)}async format(e){return(await this.formatPromptValue(e)).toString()}async formatPromptValue(e){let n=await this.formatMessages(e);return new Oy(n)}},B5=class extends iee{static lc_name(){return"ChatMessagePromptTemplate"}constructor(e,n){"prompt"in e||(e={prompt:e,role:n}),super(e),Object.defineProperty(this,"role",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.role=e.role}async format(e){return new lo(await this.prompt.format(e),this.role)}static fromTemplate(e,n,l){return new this(xe.fromTemplate(e,{templateFormat:l?.templateFormat}),n)}};Pz=class extends z5{static _messageClass(){throw new Error("Can not invoke _messageClass from inside _StringImageMessagePromptTemplate")}constructor(e,n){if("prompt"in e||(e={prompt:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","chat"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"inputVariables",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"additionalOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"prompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chatMessageClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.prompt=e.prompt,Array.isArray(this.prompt)){let l=[];this.prompt.forEach(I=>{"inputVariables"in I&&(l=l.concat(I.inputVariables))}),this.inputVariables=l}else this.inputVariables=this.prompt.inputVariables;this.additionalOptions=n??this.additionalOptions}createMessage(e){let n=this.constructor;if(n._messageClass()){let l=n._messageClass();return new l({content:e})}else if(n.chatMessageClass){let l=n.chatMessageClass();return new l({content:e,role:this.getRoleFromMessageClass(l.lc_name())})}else throw new Error("No message class defined")}getRoleFromMessageClass(e){switch(e){case"HumanMessage":return"human";case"AIMessage":return"ai";case"SystemMessage":return"system";case"ChatMessage":return"chat";default:throw new Error("Invalid message class name")}}static fromTemplate(e,n){if(typeof e=="string")return new this(xe.fromTemplate(e,n));let l=[];for(let I of e)if(typeof I=="string")l.push(xe.fromTemplate(I,n));else if(I!==null)if(ukn(I)){let a="";typeof I.text=="string"&&(a=I.text??"");let c={...n,additionalContentFields:I};l.push(xe.fromTemplate(a,c))}else if(dkn(I)){let a=I.image_url??"",c,i=[];if(typeof a=="string"){let s;n?.templateFormat==="mustache"?s=_z(a):s=k5(a);let r=s.flatMap(u=>u.type==="variable"?[u.name]:[]);if((r?.length??0)>0){if(r.length>1)throw new Error(`Only one format variable allowed per image template. +Got: ${r} +From: ${a}`);i=[r[0]]}else i=[];a={url:a},c=new Uy({template:a,inputVariables:i,templateFormat:n?.templateFormat,additionalContentFields:I})}else if(typeof a=="object"){if("url"in a){let s;n?.templateFormat==="mustache"?s=_z(a.url):s=k5(a.url),i=s.flatMap(r=>r.type==="variable"?[r.name]:[])}else i=[];c=new Uy({template:a,inputVariables:i,templateFormat:n?.templateFormat,additionalContentFields:I})}else throw new Error("Invalid image template");l.push(c)}else typeof I=="object"&&l.push(new U5({template:I,templateFormat:n?.templateFormat}));return new this({prompt:l,additionalOptions:n})}async format(e){if(this.prompt instanceof _Y){let n=await this.prompt.format(e);return this.createMessage(n)}else{let n=[];for(let l of this.prompt){let I={};if(!("inputVariables"in l))throw new Error(`Prompt ${l} does not have inputVariables defined.`);for(let a of l.inputVariables)I||(I={[a]:e[a]}),I={...I,[a]:e[a]};if(l instanceof _Y){let a=await l.format(I),c;"additionalContentFields"in l&&(c=l.additionalContentFields),n.push({...c,type:"text",text:a})}else if(l instanceof Uy){let a=await l.format(I),c;"additionalContentFields"in l&&(c=l.additionalContentFields),n.push({...c,type:"image_url",image_url:a})}else if(l instanceof U5){let a=await l.format(I),c;"additionalContentFields"in l&&(c=l.additionalContentFields),n.push({...c,...a})}}return this.createMessage(n)}}async formatMessages(e){return[await this.format(e)]}},RI=class extends Pz{static _messageClass(){return Qn}static lc_name(){return"HumanMessagePromptTemplate"}},Zh=class extends Pz{static _messageClass(){return _t}static lc_name(){return"AIMessagePromptTemplate"}},kr=class extends Pz{static _messageClass(){return Xr}static lc_name(){return"SystemMessagePromptTemplate"}};HI=class t extends M2{static lc_name(){return"ChatPromptTemplate"}get lc_aliases(){return{promptMessages:"messages"}}constructor(e){if(super(e),Object.defineProperty(this,"promptMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),e.templateFormat==="mustache"&&e.validateTemplate===void 0&&(this.validateTemplate=!1),Object.assign(this,e),this.validateTemplate){let n=new Set;for(let i of this.promptMessages)if(!(i instanceof yc))for(let s of i.inputVariables)n.add(s);let l=this.inputVariables,I=new Set(this.partialVariables?l.concat(Object.keys(this.partialVariables)):l),a=new Set([...I].filter(i=>!n.has(i)));if(a.size>0)throw new Error(`Input variables \`${[...a]}\` are not used in any of the prompt messages.`);let c=new Set([...n].filter(i=>!I.has(i)));if(c.size>0)throw new Error(`Input variables \`${[...c]}\` are used in prompt messages but not in the prompt template.`)}}_getPromptType(){return"chat"}async _parseImagePrompts(e,n){if(typeof e.content=="string")return e;let l=await Promise.all(e.content.map(async I=>{if(I.type!=="image_url")return I;let a="";typeof I.image_url=="string"?a=I.image_url:a=I.image_url.url;let i=await xe.fromTemplate(a,{templateFormat:this.templateFormat}).format(n);return typeof I.image_url!="string"&&"url"in I.image_url?I.image_url.url=i:I.image_url=i,I}));return e.content=l,e}async formatMessages(e){let n=await this.mergePartialAndUserVariables(e),l=[];for(let I of this.promptMessages)if(I instanceof yc)l.push(await this._parseImagePrompts(I,n));else{let a=I.inputVariables.reduce((i,s)=>{if(!(s in n)&&!(mkn(I)&&I.optional))throw A2(new Error(`Missing value for input variable \`${s.toString()}\``),"INVALID_PROMPT_INPUT");return i[s]=n[s],i},{}),c=await I.formatMessages(a);l=l.concat(c)}return l}async partial(e){let n=this.inputVariables.filter(a=>!(a in e)),l={...this.partialVariables??{},...e},I={...this,inputVariables:n,partialVariables:l};return new t(I)}static fromTemplate(e,n){let l=xe.fromTemplate(e,n),I=new RI({prompt:l});return this.fromMessages([I])}static fromMessages(e,n){let l=e.reduce((c,i)=>c.concat(i instanceof t?i.promptMessages:[bkn(i,n)]),[]),I=e.reduce((c,i)=>i instanceof t?Object.assign(c,i.partialVariables):c,Object.create(null)),a=new Set;for(let c of l)if(!(c instanceof yc))for(let i of c.inputVariables)i in I||a.add(i);return new this({...n,inputVariables:[...a],promptMessages:l,partialVariables:I,templateFormat:n?.templateFormat})}static fromPromptMessages(e){return this.fromMessages(e)}}});var Tat={};Xe(Tat,{FewShotChatMessagePromptTemplate:()=>see,FewShotPromptTemplate:()=>qH});var qH,see,KFe=B(()=>{Tz();PH();O5();qz();qH=class t extends _Y{constructor(e){if(super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:` + +`}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.assign(this,e),this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),S2(this.prefix+this.suffix,this.templateFormat,n)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(e){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(e){let n=this.inputVariables.filter(a=>!(a in e)),l={...this.partialVariables??{},...e},I={...this,inputVariables:n,partialVariables:l};return new t(I)}async format(e){let n=await this.mergePartialAndUserVariables(e),l=await this.getExamples(n),I=await Promise.all(l.map(c=>this.examplePrompt.format(c))),a=[this.prefix,...I,this.suffix].join(this.exampleSeparator);return Ja(a,this.templateFormat,n)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(this.outputParser!==void 0)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(e){let{example_prompt:n}=e;if(!n)throw new Error("Missing example prompt");let l=await xe.deserialize(n),I;if(Array.isArray(e.examples))I=e.examples;else throw new Error("Invalid examples format. Only list or string are supported.");return new t({inputVariables:e.input_variables,examplePrompt:l,examples:I,exampleSeparator:e.example_separator,prefix:e.prefix,suffix:e.suffix,templateFormat:e.template_format})}},see=class t extends M2{_getPromptType(){return"few_shot_chat"}static lc_name(){return"FewShotChatMessagePromptTemplate"}constructor(e){if(super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:` + +`}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.examples=e.examples,this.examplePrompt=e.examplePrompt,this.exampleSeparator=e.exampleSeparator??` + +`,this.exampleSelector=e.exampleSelector,this.prefix=e.prefix??"",this.suffix=e.suffix??"",this.templateFormat=e.templateFormat??"f-string",this.validateTemplate=e.validateTemplate??!0,this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),S2(this.prefix+this.suffix,this.templateFormat,n)}}async getExamples(e){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async formatMessages(e){let n=await this.mergePartialAndUserVariables(e),l=await this.getExamples(n);l=l.map(a=>{let c={};return this.examplePrompt.inputVariables.forEach(i=>{c[i]=a[i]}),c});let I=[];for(let a of l){let c=await this.examplePrompt.formatMessages(a);I.push(...c)}return I}async format(e){let n=await this.mergePartialAndUserVariables(e),l=await this.getExamples(n),a=(await Promise.all(l.map(i=>this.examplePrompt.formatMessages(i)))).flat().map(i=>i.content),c=[this.prefix,...a,this.suffix].join(this.exampleSeparator);return Ja(c,this.templateFormat,n)}async partial(e){let n=this.inputVariables.filter(a=>!(a in e)),l={...this.partialVariables??{},...e},I={...this,inputVariables:n,partialVariables:l};return new t(I)}}});var ph,J5=B(()=>{Zd();ph=class extends Zn{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:n}=e;if(n.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 n=this.partialVariables??{},l={};for(let[a,c]of Object.entries(n))typeof c=="string"?l[a]=c:l[a]=await c();return{...l,...e}}async invoke(e,n){let l={...this.metadata,...n?.metadata},I=[...this.tags??[],...n?.tags??[]];return this._callWithConfig(a=>this.formatPromptValue(a),e,{...n,tags:I,metadata:l,runType:"prompt"})}serialize(){throw new Error("Use .toJSON() instead")}static async deserialize(e){switch(e._type){case"prompt":{let{PromptTemplate:n}=await Promise.resolve().then(()=>(O5(),BFe));return n.deserialize(e)}case void 0:{let{PromptTemplate:n}=await Promise.resolve().then(()=>(O5(),BFe));return n.deserialize({...e,_type:"prompt"})}case"few_shot":{let{FewShotPromptTemplate:n}=await Promise.resolve().then(()=>(KFe(),Tat));return n.deserialize(e)}default:throw new Error(`Invalid prompt type in config: ${e._type}`)}}}});var $z,Dat=B(()=>{J5();qz();$z=class t extends ph{static lc_name(){return"PipelinePromptTemplate"}constructor(e){super({...e,inputVariables:[]}),Object.defineProperty(this,"pipelinePrompts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"finalPrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pipelinePrompts=e.pipelinePrompts,this.finalPrompt=e.finalPrompt,this.inputVariables=this.computeInputValues()}computeInputValues(){let e=this.pipelinePrompts.map(l=>l.name),n=this.pipelinePrompts.map(l=>l.prompt.inputVariables.filter(I=>!e.includes(I))).flat();return[...new Set(n)]}static extractRequiredInputValues(e,n){return n.reduce((l,I)=>(l[I]=e[I],l),{})}async formatPipelinePrompts(e){let n=await this.mergePartialAndUserVariables(e);for(let{name:l,prompt:I}of this.pipelinePrompts){let a=t.extractRequiredInputValues(n,I.inputVariables);I instanceof HI?n[l]=await I.formatMessages(a):n[l]=await I.format(a)}return t.extractRequiredInputValues(n,this.finalPrompt.inputVariables)}async formatPromptValue(e){return this.finalPrompt.formatPromptValue(await this.formatPipelinePrompts(e))}async format(e){return this.finalPrompt.format(await this.formatPipelinePrompts(e))}async partial(e){let n={...this};return n.inputVariables=this.inputVariables.filter(l=>!(l in e)),n.partialVariables={...this.partialVariables??{},...e},new t(n)}serialize(){throw new Error("Not implemented.")}_getPromptType(){return"pipeline"}}});var Kat=B(()=>{});function _at(t){return typeof t=="object"&&t!=null&&"withStructuredOutput"in t&&typeof t.withStructuredOutput=="function"}function pkn(t){return typeof t=="object"&&t!=null&&"lc_id"in t&&Array.isArray(t.lc_id)&&t.lc_id.join("/")==="langchain_core/runnables/RunnableBinding"}var _Fe,Pat=B(()=>{Zd();qz();_Fe=class t extends HI{get lc_aliases(){return{...super.lc_aliases,schema:"schema_"}}constructor(e){super(e),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"method",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","structured"]}),this.schema=e.schema,this.method=e.method}pipe(e){if(_at(e))return super.pipe(e.withStructuredOutput(this.schema));if(pkn(e)&&_at(e.bound))return super.pipe(new dG({bound:e.bound.withStructuredOutput(this.schema,...this.method?[{method:this.method}]:[]),kwargs:e.kwargs??{},config:e.config,configFactories:e.configFactories}));throw new Error('Structured prompts need to be piped to a language model that supports the "withStructuredOutput()" method.')}static fromMessagesAndSchema(e,n,l){return t.fromMessages(e,{schema:n,method:l})}}});var PFe={};Xe(PFe,{AIMessagePromptTemplate:()=>Zh,BaseChatPromptTemplate:()=>M2,BaseMessagePromptTemplate:()=>z5,BaseMessageStringPromptTemplate:()=>iee,BasePromptTemplate:()=>ph,BaseStringPromptTemplate:()=>_Y,ChatMessagePromptTemplate:()=>B5,ChatPromptTemplate:()=>HI,DEFAULT_FORMATTER_MAPPING:()=>oee,DEFAULT_PARSER_MAPPING:()=>Mat,DictPromptTemplate:()=>U5,FewShotChatMessagePromptTemplate:()=>see,FewShotPromptTemplate:()=>qH,HumanMessagePromptTemplate:()=>RI,ImagePromptTemplate:()=>Uy,MessagesPlaceholder:()=>hh,PipelinePromptTemplate:()=>$z,PromptTemplate:()=>xe,StructuredPrompt:()=>_Fe,SystemMessagePromptTemplate:()=>kr,checkValidTemplate:()=>S2,interpolateFString:()=>x5,interpolateMustache:()=>Sat,parseFString:()=>k5,parseMustache:()=>_z,parseTemplate:()=>j5,renderTemplate:()=>Ja});var qFe=B(()=>{J5();qz();KFe();Dat();O5();Kat();Tz();PH();SFe();Pat();DFe()});var yn=B(()=>{qFe()});var M5=f((TPI,srt)=>{var hkn="Expected a function",nrt="__lodash_hash_undefined__",lrt=1/0,Zkn="[object Function]",Wkn="[object GeneratorFunction]",Nkn="[object Symbol]",Vkn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ykn=/^\w*$/,gkn=/^\./,Rkn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ykn=/[\\^$.*+?()[\]{}|]/g,Akn=/\\(\\)?/g,Fkn=/^\[object .+?Constructor\]$/,vkn=typeof global=="object"&&global&&global.Object===Object&&global,fkn=typeof self=="object"&&self&&self.Object===Object&&self,e2e=vkn||fkn||Function("return this")();function Xkn(t,e){return t?.[e]}function wkn(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var Hkn=Array.prototype,Qkn=Function.prototype,Irt=Object.prototype,$Fe=e2e["__core-js_shared__"],qat=function(){var t=/[^.]+$/.exec($Fe&&$Fe.keys&&$Fe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),art=Qkn.toString,t2e=Irt.hasOwnProperty,rrt=Irt.toString,Ekn=RegExp("^"+art.call(t2e).replace(ykn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$at=e2e.Symbol,Jkn=Hkn.splice,Ckn=crt(e2e,"Map"),eB=crt(Object,"create"),ert=$at?$at.prototype:void 0,trt=ert?ert.toString:void 0;function $H(t){var e=-1,n=t?t.length:0;for(this.clear();++e-1}function Mkn(t,e){var n=this.__data__,l=uee(n,t);return l<0?n.push([t,e]):n[l][1]=e,this}S5.prototype.clear=Ukn;S5.prototype.delete=zkn;S5.prototype.get=Bkn;S5.prototype.has=Skn;S5.prototype.set=Mkn;function eQ(t){var e=-1,n=t?t.length:0;for(this.clear();++e{"use strict";Wh.__esModule=!0;Wh.extend=urt;Wh.indexOf=hxn;Wh.escapeExpression=Zxn;Wh.isEmpty=Wxn;Wh.createFrame=Nxn;Wh.blockParams=Vxn;Wh.appendContextPath=Yxn;var Gxn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},bxn=/[&<>"'`=]/g,mxn=/[&<>"'`=]/;function pxn(t){return Gxn[t]}function urt(t){for(var e=1;e{"use strict";Gee.__esModule=!0;var r2e=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function c2e(t,e){var n=e&&e.loc,l=void 0,I=void 0,a=void 0,c=void 0;n&&(l=n.start.line,I=n.end.line,a=n.start.column,c=n.end.column,t+=" - "+l+":"+a);for(var i=Error.prototype.constructor.call(this,t),s=0;s{"use strict";bee.__esModule=!0;var o2e=dm();bee.default=function(t){t.registerHelper("blockHelperMissing",function(e,n){var l=n.inverse,I=n.fn;if(e===!0)return I(this);if(e===!1||e==null)return l(this);if(o2e.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):l(this);if(n.data&&n.ids){var a=o2e.createFrame(n.data);a.contextPath=o2e.appendContextPath(n.data.contextPath,n.name),n={data:a}}return I(e,n)})};brt.exports=bee.default});var hrt=f((mee,prt)=>{"use strict";mee.__esModule=!0;function gxn(t){return t&&t.__esModule?t:{default:t}}var tB=dm(),Rxn=xZ(),yxn=gxn(Rxn);mee.default=function(t){t.registerHelper("each",function(e,n){if(!n)throw new yxn.default("Must pass iterator to #each");var l=n.fn,I=n.inverse,a=0,c="",i=void 0,s=void 0;n.data&&n.ids&&(s=tB.appendContextPath(n.data.contextPath,n.ids[0])+"."),tB.isFunction(e)&&(e=e.call(this)),n.data&&(i=tB.createFrame(n.data));function r(h,Z,N){i&&(i.key=h,i.index=Z,i.first=Z===0,i.last=!!N,s&&(i.contextPath=s+h)),c=c+l(e[h],{data:i,blockParams:tB.blockParams([e[h],h],[s+h,null])})}if(e&&typeof e=="object")if(tB.isArray(e))for(var u=e.length;a{"use strict";pee.__esModule=!0;function Axn(t){return t&&t.__esModule?t:{default:t}}var Fxn=xZ(),vxn=Axn(Fxn);pee.default=function(t){t.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new vxn.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Zrt.exports=pee.default});var grt=f((hee,Yrt)=>{"use strict";hee.__esModule=!0;function fxn(t){return t&&t.__esModule?t:{default:t}}var Nrt=dm(),Xxn=xZ(),Vrt=fxn(Xxn);hee.default=function(t){t.registerHelper("if",function(e,n){if(arguments.length!=2)throw new Vrt.default("#if requires exactly one argument");return Nrt.isFunction(e)&&(e=e.call(this)),!n.hash.includeZero&&!e||Nrt.isEmpty(e)?n.inverse(this):n.fn(this)}),t.registerHelper("unless",function(e,n){if(arguments.length!=2)throw new Vrt.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})};Yrt.exports=hee.default});var yrt=f((Zee,Rrt)=>{"use strict";Zee.__esModule=!0;Zee.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],n=arguments[arguments.length-1],l=0;l{"use strict";Wee.__esModule=!0;Wee.default=function(t){t.registerHelper("lookup",function(e,n,l){return e&&l.lookupProperty(e,n)})};Art.exports=Wee.default});var frt=f((Nee,vrt)=>{"use strict";Nee.__esModule=!0;function wxn(t){return t&&t.__esModule?t:{default:t}}var nB=dm(),Hxn=xZ(),Qxn=wxn(Hxn);Nee.default=function(t){t.registerHelper("with",function(e,n){if(arguments.length!=2)throw new Qxn.default("#with requires exactly one argument");nB.isFunction(e)&&(e=e.call(this));var l=n.fn;if(nB.isEmpty(e))return n.inverse(this);var I=n.data;return n.data&&n.ids&&(I=nB.createFrame(n.data),I.contextPath=nB.appendContextPath(n.data.contextPath,n.ids[0])),l(e,{data:I,blockParams:nB.blockParams([e],[I&&I.contextPath])})})};vrt.exports=Nee.default});var i2e=f(Vee=>{"use strict";Vee.__esModule=!0;Vee.registerDefaultHelpers=Dxn;Vee.moveHelperToHooks=Kxn;function tQ(t){return t&&t.__esModule?t:{default:t}}var Exn=mrt(),Jxn=tQ(Exn),Cxn=hrt(),Lxn=tQ(Cxn),kxn=Wrt(),xxn=tQ(kxn),jxn=grt(),Oxn=tQ(jxn),Uxn=yrt(),zxn=tQ(Uxn),Bxn=Frt(),Sxn=tQ(Bxn),Mxn=frt(),Txn=tQ(Mxn);function Dxn(t){Jxn.default(t),Lxn.default(t),xxn.default(t),Oxn.default(t),zxn.default(t),Sxn.default(t),Txn.default(t)}function Kxn(t,e,n){t.helpers[e]&&(t.hooks[e]=t.helpers[e],n||delete t.helpers[e])}});var wrt=f((Yee,Xrt)=>{"use strict";Yee.__esModule=!0;var _xn=dm();Yee.default=function(t){t.registerDecorator("inline",function(e,n,l,I){var a=e;return n.partials||(n.partials={},a=function(c,i){var s=l.partials;l.partials=_xn.extend({},s,n.partials);var r=e(c,i);return l.partials=s,r}),n.partials[I.args[0]]=I.fn,a})};Xrt.exports=Yee.default});var Hrt=f(s2e=>{"use strict";s2e.__esModule=!0;s2e.registerDefaultDecorators=e3n;function Pxn(t){return t&&t.__esModule?t:{default:t}}var qxn=wrt(),$xn=Pxn(qxn);function e3n(t){$xn.default(t)}});var u2e=f((gee,Qrt)=>{"use strict";gee.__esModule=!0;var t3n=dm(),T5={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var n=t3n.indexOf(T5.methodMap,e.toLowerCase());n>=0?e=n:e=parseInt(e,10)}return e},log:function(e){if(e=T5.lookupLevel(e),typeof console<"u"&&T5.lookupLevel(T5.level)<=e){var n=T5.methodMap[e];console[n]||(n="log");for(var l=arguments.length,I=Array(l>1?l-1:0),a=1;a{"use strict";d2e.__esModule=!0;d2e.createNewLookupObject=l3n;var n3n=dm();function l3n(){for(var t=arguments.length,e=Array(t),n=0;n{"use strict";lB.__esModule=!0;lB.createProtoAccessControl=c3n;lB.resultIsAllowed=o3n;lB.resetLoggedProperties=s3n;function I3n(t){return t&&t.__esModule?t:{default:t}}var Jrt=Ert(),a3n=u2e(),r3n=I3n(a3n),Ree=Object.create(null);function c3n(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:Jrt.createNewLookupObject(n,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:Jrt.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}}function o3n(t,e,n){return Crt(typeof t=="function"?e.methods:e.properties,n)}function Crt(t,e){return t.whitelist[e]!==void 0?t.whitelist[e]===!0:t.defaultValue!==void 0?t.defaultValue:(i3n(e),!1)}function i3n(t){Ree[t]!==!0&&(Ree[t]=!0,r3n.default.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent. +You can add a runtime option to disable the check or this warning: +See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function s3n(){Object.keys(Ree).forEach(function(t){delete Ree[t]})}});var Aee=f(PY=>{"use strict";PY.__esModule=!0;PY.HandlebarsEnvironment=p2e;function Lrt(t){return t&&t.__esModule?t:{default:t}}var nQ=dm(),u3n=xZ(),b2e=Lrt(u3n),d3n=i2e(),G3n=Hrt(),b3n=u2e(),yee=Lrt(b3n),m3n=G2e(),p3n="4.7.8";PY.VERSION=p3n;var h3n=8;PY.COMPILER_REVISION=h3n;var Z3n=7;PY.LAST_COMPATIBLE_COMPILER_REVISION=Z3n;var W3n={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};PY.REVISION_CHANGES=W3n;var m2e="[object Object]";function p2e(t,e,n){this.helpers=t||{},this.partials=e||{},this.decorators=n||{},d3n.registerDefaultHelpers(this),G3n.registerDefaultDecorators(this)}p2e.prototype={constructor:p2e,logger:yee.default,log:yee.default.log,registerHelper:function(e,n){if(nQ.toString.call(e)===m2e){if(n)throw new b2e.default("Arg not supported with multiple helpers");nQ.extend(this.helpers,e)}else this.helpers[e]=n},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,n){if(nQ.toString.call(e)===m2e)nQ.extend(this.partials,e);else{if(typeof n>"u")throw new b2e.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=n}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,n){if(nQ.toString.call(e)===m2e){if(n)throw new b2e.default("Arg not supported with multiple decorators");nQ.extend(this.decorators,e)}else this.decorators[e]=n},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){m3n.resetLoggedProperties()}};var N3n=yee.default.log;PY.log=N3n;PY.createFrame=nQ.createFrame;PY.logger=yee.default});var xrt=f((Fee,krt)=>{"use strict";Fee.__esModule=!0;function h2e(t){this.string=t}h2e.prototype.toString=h2e.prototype.toHTML=function(){return""+this.string};Fee.default=h2e;krt.exports=Fee.default});var jrt=f(Z2e=>{"use strict";Z2e.__esModule=!0;Z2e.wrapHelper=V3n;function V3n(t,e){if(typeof t!="function")return t;var n=function(){var I=arguments[arguments.length-1];return arguments[arguments.length-1]=e(I),t.apply(this,arguments)};return n}});var Srt=f(T2=>{"use strict";T2.__esModule=!0;T2.checkRevision=F3n;T2.template=v3n;T2.wrapProgram=vee;T2.resolvePartial=f3n;T2.invokePartial=X3n;T2.noop=zrt;function Y3n(t){return t&&t.__esModule?t:{default:t}}function g3n(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var R3n=dm(),zy=g3n(R3n),y3n=xZ(),By=Y3n(y3n),Sy=Aee(),Ort=i2e(),A3n=jrt(),Urt=G2e();function F3n(t){var e=t&&t[0]||1,n=Sy.COMPILER_REVISION;if(!(e>=Sy.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Sy.COMPILER_REVISION))if(e{"use strict";fee.__esModule=!0;fee.default=function(t){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}};Mrt.exports=fee.default});var Prt=f((Xee,_rt)=>{"use strict";Xee.__esModule=!0;function V2e(t){return t&&t.__esModule?t:{default:t}}function Y2e(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var E3n=Aee(),Trt=Y2e(E3n),J3n=xrt(),C3n=V2e(J3n),L3n=xZ(),k3n=V2e(L3n),x3n=dm(),N2e=Y2e(x3n),j3n=Srt(),Drt=Y2e(j3n),O3n=W2e(),U3n=V2e(O3n);function Krt(){var t=new Trt.HandlebarsEnvironment;return N2e.extend(t,Trt),t.SafeString=C3n.default,t.Exception=k3n.default,t.Utils=N2e,t.escapeExpression=N2e.escapeExpression,t.VM=Drt,t.template=function(e){return Drt.template(e,t)},t}var IB=Krt();IB.create=Krt;U3n.default(IB);IB.default=IB;Xee.default=IB;_rt.exports=Xee.default});var g2e=f((wee,$rt)=>{"use strict";wee.__esModule=!0;var qrt={helpers:{helperExpression:function(e){return e.type==="SubExpression"||(e.type==="MustacheStatement"||e.type==="BlockStatement")&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return e.parts.length===1&&!qrt.helpers.scopedId(e)&&!e.depth}}};wee.default=qrt;$rt.exports=wee.default});var tct=f((Hee,ect)=>{"use strict";Hee.__esModule=!0;var z3n=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(I,a,c,i,s,r,u){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:this.$=i.prepareProgram(r[o]);break;case 3:this.$=r[o];break;case 4:this.$=r[o];break;case 5:this.$=r[o];break;case 6:this.$=r[o];break;case 7:this.$=r[o];break;case 8:this.$=r[o];break;case 9:this.$={type:"CommentStatement",value:i.stripComment(r[o]),strip:i.stripFlags(r[o],r[o]),loc:i.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:r[o],value:r[o],loc:i.locInfo(this._$)};break;case 11:this.$=i.prepareRawBlock(r[o-2],r[o-1],r[o],this._$);break;case 12:this.$={path:r[o-3],params:r[o-2],hash:r[o-1]};break;case 13:this.$=i.prepareBlock(r[o-3],r[o-2],r[o-1],r[o],!1,this._$);break;case 14:this.$=i.prepareBlock(r[o-3],r[o-2],r[o-1],r[o],!0,this._$);break;case 15:this.$={open:r[o-5],path:r[o-4],params:r[o-3],hash:r[o-2],blockParams:r[o-1],strip:i.stripFlags(r[o-5],r[o])};break;case 16:this.$={path:r[o-4],params:r[o-3],hash:r[o-2],blockParams:r[o-1],strip:i.stripFlags(r[o-5],r[o])};break;case 17:this.$={path:r[o-4],params:r[o-3],hash:r[o-2],blockParams:r[o-1],strip:i.stripFlags(r[o-5],r[o])};break;case 18:this.$={strip:i.stripFlags(r[o-1],r[o-1]),program:r[o]};break;case 19:var d=i.prepareBlock(r[o-2],r[o-1],r[o],r[o],!1,this._$),b=i.prepareProgram([d],r[o-1].loc);b.chained=!0,this.$={strip:r[o-2].strip,program:b,chain:!0};break;case 20:this.$=r[o];break;case 21:this.$={path:r[o-1],strip:i.stripFlags(r[o-2],r[o])};break;case 22:this.$=i.prepareMustache(r[o-3],r[o-2],r[o-1],r[o-4],i.stripFlags(r[o-4],r[o]),this._$);break;case 23:this.$=i.prepareMustache(r[o-3],r[o-2],r[o-1],r[o-4],i.stripFlags(r[o-4],r[o]),this._$);break;case 24:this.$={type:"PartialStatement",name:r[o-3],params:r[o-2],hash:r[o-1],indent:"",strip:i.stripFlags(r[o-4],r[o]),loc:i.locInfo(this._$)};break;case 25:this.$=i.preparePartialBlock(r[o-2],r[o-1],r[o],this._$);break;case 26:this.$={path:r[o-3],params:r[o-2],hash:r[o-1],strip:i.stripFlags(r[o-4],r[o])};break;case 27:this.$=r[o];break;case 28:this.$=r[o];break;case 29:this.$={type:"SubExpression",path:r[o-3],params:r[o-2],hash:r[o-1],loc:i.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:r[o],loc:i.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:i.id(r[o-2]),value:r[o],loc:i.locInfo(this._$)};break;case 32:this.$=i.id(r[o-1]);break;case 33:this.$=r[o];break;case 34:this.$=r[o];break;case 35:this.$={type:"StringLiteral",value:r[o],original:r[o],loc:i.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(r[o]),original:Number(r[o]),loc:i.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:r[o]==="true",original:r[o]==="true",loc:i.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:i.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:i.locInfo(this._$)};break;case 40:this.$=r[o];break;case 41:this.$=r[o];break;case 42:this.$=i.preparePath(!0,r[o],this._$);break;case 43:this.$=i.preparePath(!1,r[o],this._$);break;case 44:r[o-2].push({part:i.id(r[o]),original:r[o],separator:r[o-1]}),this.$=r[o-2];break;case 45:this.$=[{part:i.id(r[o]),original:r[o]}];break;case 46:this.$=[];break;case 47:r[o-1].push(r[o]);break;case 48:this.$=[];break;case 49:r[o-1].push(r[o]);break;case 50:this.$=[];break;case 51:r[o-1].push(r[o]);break;case 58:this.$=[];break;case 59:r[o-1].push(r[o]);break;case 64:this.$=[];break;case 65:r[o-1].push(r[o]);break;case 70:this.$=[];break;case 71:r[o-1].push(r[o]);break;case 78:this.$=[];break;case 79:r[o-1].push(r[o]);break;case 82:this.$=[];break;case 83:r[o-1].push(r[o]);break;case 86:this.$=[];break;case 87:r[o-1].push(r[o]);break;case 90:this.$=[];break;case 91:r[o-1].push(r[o]);break;case 94:this.$=[];break;case 95:r[o-1].push(r[o]);break;case 98:this.$=[r[o]];break;case 99:r[o-1].push(r[o]);break;case 100:this.$=[r[o]];break;case 101:r[o-1].push(r[o]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(I,a){throw new Error(I)},parse:function(I){var a=this,c=[0],i=[null],s=[],r=this.table,u="",o=0,d=0,b=0,h=2,Z=1;this.lexer.setInput(I),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var N=this.lexer.yylloc;s.push(N);var g=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function y(q){c.length=c.length-2*q,i.length=i.length-q,s.length=s.length-q}function X(){var q;return q=a.lexer.lex()||1,typeof q!="number"&&(q=a.symbols_[q]||q),q}for(var v,H,Q,L,J,O,U={},K,D,_,P;;){if(Q=c[c.length-1],this.defaultActions[Q]?L=this.defaultActions[Q]:((v===null||typeof v>"u")&&(v=X()),L=r[Q]&&r[Q][v]),typeof L>"u"||!L.length||!L[0]){var le="";if(!b){P=[];for(K in r[Q])this.terminals_[K]&&K>2&&P.push("'"+this.terminals_[K]+"'");this.lexer.showPosition?le="Parse error on line "+(o+1)+`: +`+this.lexer.showPosition()+` +Expecting `+P.join(", ")+", got '"+(this.terminals_[v]||v)+"'":le="Parse error on line "+(o+1)+": Unexpected "+(v==1?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(le,{text:this.lexer.match,token:this.terminals_[v]||v,line:this.lexer.yylineno,loc:N,expected:P})}}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+v);switch(L[0]){case 1:c.push(v),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),c.push(L[1]),v=null,H?(v=H,H=null):(d=this.lexer.yyleng,u=this.lexer.yytext,o=this.lexer.yylineno,N=this.lexer.yylloc,b>0&&b--);break;case 2:if(D=this.productions_[L[1]][1],U.$=i[i.length-D],U._$={first_line:s[s.length-(D||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(D||1)].first_column,last_column:s[s.length-1].last_column},g&&(U._$.range=[s[s.length-(D||1)].range[0],s[s.length-1].range[1]]),O=this.performAction.call(U,u,d,o,this.yy,L[1],i,s),typeof O<"u")return O;D&&(c=c.slice(0,-1*D*2),i=i.slice(0,-1*D),s=s.slice(0,-1*D)),c.push(this.productions_[L[1]][0]),i.push(U.$),s.push(U._$),_=r[c[c.length-2]][c[c.length-1]],c.push(_);break;case 3:return!0}}return!0}},e=function(){var l={EOF:1,parseError:function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var c=a.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var c=a.length,i=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c-1),this.offset-=c;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-c]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),c=new Array(a.length+1).join("-");return a+this.upcomingInput()+` +`+c+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,c,i,s,r,u;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),d=0;dc[0].length)&&(c=i,s=d,!this.options.flex)));d++);return c?(u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],a=this.performAction.call(this,this.yy,this,o[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return typeof a<"u"?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return l.options={},l.performAction=function(a,c,i,s){function r(o,d){return c.yytext=c.yytext.substring(o,c.yyleng-d+o)}var u=s;switch(i){case 0:if(c.yytext.slice(-2)==="\\\\"?(r(0,1),this.begin("mu")):c.yytext.slice(-1)==="\\"?(r(0,1),this.begin("emu")):this.begin("mu"),c.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(r(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(c.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return c.yytext=r(1,2).replace(/\\"/g,'"'),80;break;case 32:return c.yytext=r(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return c.yytext=c.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},l.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],l.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},l}();t.lexer=e;function n(){this.yy={}}return n.prototype=t,t.Parser=n,new n}();Hee.default=z3n;ect.exports=Hee.default});var y2e=f((Jee,Ict)=>{"use strict";Jee.__esModule=!0;function B3n(t){return t&&t.__esModule?t:{default:t}}var S3n=xZ(),R2e=B3n(S3n);function Qee(){this.parents=[]}Qee.prototype={constructor:Qee,mutating:!1,acceptKey:function(e,n){var l=this.accept(e[n]);if(this.mutating){if(l&&!Qee.prototype[l.type])throw new R2e.default('Unexpected node type "'+l.type+'" found when accepting '+n+" on "+e.type);e[n]=l}},acceptRequired:function(e,n){if(this.acceptKey(e,n),!e[n])throw new R2e.default(e.type+" requires "+n)},acceptArray:function(e){for(var n=0,l=e.length;n{"use strict";Cee.__esModule=!0;function M3n(t){return t&&t.__esModule?t:{default:t}}var T3n=y2e(),D3n=M3n(T3n);function qY(){var t=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=t}qY.prototype=new D3n.default;qY.prototype.Program=function(t){var e=!this.options.ignoreStandalone,n=!this.isRootSeen;this.isRootSeen=!0;for(var l=t.body,I=0,a=l.length;I{"use strict";jZ.__esModule=!0;jZ.SourceLocation=P3n;jZ.id=q3n;jZ.stripFlags=$3n;jZ.stripComment=e4n;jZ.preparePath=t4n;jZ.prepareMustache=n4n;jZ.prepareRawBlock=l4n;jZ.prepareBlock=I4n;jZ.prepareProgram=a4n;jZ.preparePartialBlock=r4n;function K3n(t){return t&&t.__esModule?t:{default:t}}var _3n=xZ(),v2e=K3n(_3n);function f2e(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var n={loc:t.path.loc};throw new v2e.default(t.path.original+" doesn't match "+e,n)}}function P3n(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}}function q3n(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t}function $3n(t,e){return{open:t.charAt(2)==="~",close:e.charAt(e.length-3)==="~"}}function e4n(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function t4n(t,e,n){n=this.locInfo(n);for(var l=t?"@":"",I=[],a=0,c=0,i=e.length;c0)throw new v2e.default("Invalid path: "+l,{loc:n});s===".."&&a++}else I.push(s)}return{type:"PathExpression",data:t,depth:a,parts:I,original:l,loc:n}}function n4n(t,e,n,l,I,a){var c=l.charAt(3)||l.charAt(2),i=c!=="{"&&c!=="&",s=/\*/.test(l);return{type:s?"Decorator":"MustacheStatement",path:t,params:e,hash:n,escaped:i,strip:I,loc:this.locInfo(a)}}function l4n(t,e,n,l){f2e(t,n),l=this.locInfo(l);var I={type:"Program",body:e,strip:{},loc:l};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:I,openStrip:{},inverseStrip:{},closeStrip:{},loc:l}}function I4n(t,e,n,l,I,a){l&&l.path&&f2e(t,l);var c=/\*/.test(t.open);e.blockParams=t.blockParams;var i=void 0,s=void 0;if(n){if(c)throw new v2e.default("Unexpected inverse block on decorator",n);n.chain&&(n.program.body[0].closeStrip=l.strip),s=n.strip,i=n.program}return I&&(I=i,i=e,e=I),{type:c?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:i,openStrip:t.strip,inverseStrip:s,closeStrip:l&&l.strip,loc:this.locInfo(a)}}function a4n(t,e){if(!e&&t.length){var n=t[0].loc,l=t[t.length-1].loc;n&&l&&(e={source:n.source,start:{line:n.start.line,column:n.start.column},end:{line:l.end.line,column:l.end.column}})}return{type:"Program",body:t,strip:{},loc:e}}function r4n(t,e,n,l){return f2e(t,n),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:n&&n.strip,loc:this.locInfo(l)}}});var sct=f(aB=>{"use strict";aB.__esModule=!0;aB.parseWithoutProcessing=ict;aB.parse=b4n;function c4n(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function oct(t){return t&&t.__esModule?t:{default:t}}var o4n=tct(),X2e=oct(o4n),i4n=rct(),s4n=oct(i4n),u4n=cct(),d4n=c4n(u4n),G4n=dm();aB.parser=X2e.default;var Lee={};G4n.extend(Lee,d4n);function ict(t,e){if(t.type==="Program")return t;X2e.default.yy=Lee,Lee.locInfo=function(l){return new Lee.SourceLocation(e&&e.srcName,l)};var n=X2e.default.parse(t);return n}function b4n(t,e){var n=ict(t,e),l=new s4n.default(e);return l.accept(n)}});var bct=f(iB=>{"use strict";iB.__esModule=!0;iB.Compiler=w2e;iB.precompile=Z4n;iB.compile=W4n;function dct(t){return t&&t.__esModule?t:{default:t}}var m4n=xZ(),cB=dct(m4n),oB=dm(),p4n=g2e(),rB=dct(p4n),h4n=[].slice;function w2e(){}w2e.prototype={compiler:w2e,equals:function(e){var n=this.opcodes.length;if(e.opcodes.length!==n)return!1;for(var l=0;l1)throw new cB.default("Unsupported number of partial arguments: "+l.length,e);l.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):l.push({type:"PathExpression",parts:[],depth:0}));var I=e.name.original,a=e.name.type==="SubExpression";a&&this.accept(e.name),this.setupFullMustacheParams(e,n,void 0,!0);var c=e.indent||"";this.options.preventIndent&&c&&(this.opcode("appendContent",c),c=""),this.opcode("invokePartial",a,I,c),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){uct(e);var n=this.classifySexpr(e);n==="simple"?this.simpleSexpr(e):n==="helper"?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,n,l){var I=e.path,a=I.parts[0],c=n!=null||l!=null;this.opcode("getContext",I.depth),this.opcode("pushProgram",n),this.opcode("pushProgram",l),I.strict=!0,this.accept(I),this.opcode("invokeAmbiguous",a,c)},simpleSexpr:function(e){var n=e.path;n.strict=!0,this.accept(n),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,n,l){var I=this.setupFullMustacheParams(e,n,l),a=e.path,c=a.parts[0];if(this.options.knownHelpers[c])this.opcode("invokeKnownHelper",I.length,c);else{if(this.options.knownHelpersOnly)throw new cB.default("You specified knownHelpersOnly, but used the unknown helper "+c,e);a.strict=!0,a.falsy=!0,this.accept(a),this.opcode("invokeHelper",I.length,a.original,rB.default.helpers.simpleId(a))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var n=e.parts[0],l=rB.default.helpers.scopedId(e),I=!e.depth&&!l&&this.blockParamIndex(n);I?this.opcode("lookupBlockParam",I,e.parts):n?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,l):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var n=e.pairs,l=0,I=n.length;for(this.opcode("pushHash");l=0)return[n,a]}}};function Z4n(t,e,n){if(t==null||typeof t!="string"&&t.type!=="Program")throw new cB.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var l=n.parse(t,e),I=new n.Compiler().compile(l,e);return new n.JavaScriptCompiler().compile(I,e)}function W4n(t,e,n){if(e===void 0&&(e={}),t==null||typeof t!="string"&&t.type!=="Program")throw new cB.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);e=oB.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var l=void 0;function I(){var c=n.parse(t,e),i=new n.Compiler().compile(c,e),s=new n.JavaScriptCompiler().compile(i,e,void 0,!0);return n.template(s)}function a(c,i){return l||(l=I()),l.call(this,c,i)}return a._setup=function(c){return l||(l=I()),l._setup(c)},a._child=function(c,i,s,r){return l||(l=I()),l._child(c,i,s,r)},a}function Gct(t,e){if(t===e)return!0;if(oB.isArray(t)&&oB.isArray(e)&&t.length===e.length){for(var n=0;n{var mct="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");H2e.encode=function(t){if(0<=t&&t{var hct=pct(),Q2e=5,Zct=1<>1;return e?-n:n}E2e.encode=function(e){var n="",l,I=N4n(e);do l=I&Wct,I>>>=Q2e,I>0&&(l|=Nct),n+=hct.encode(l);while(I>0);return n};E2e.decode=function(e,n,l){var I=e.length,a=0,c=0,i,s;do{if(n>=I)throw new Error("Expected more digits in base 64 VLQ value.");if(s=hct.decode(e.charCodeAt(n++)),s===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));i=!!(s&Nct),s&=Wct,a=a+(s<{function Y4n(t,e,n){if(e in t)return t[e];if(arguments.length===3)return n;throw new Error('"'+e+'" is a required argument.')}rb.getArg=Y4n;var Vct=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,g4n=/^data:.+\,.+$/;function sB(t){var e=t.match(Vct);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}rb.urlParse=sB;function D5(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}rb.urlGenerate=D5;function C2e(t){var e=t,n=sB(t);if(n){if(!n.path)return t;e=n.path}for(var l=rb.isAbsolute(e),I=e.split(/\/+/),a,c=0,i=I.length-1;i>=0;i--)a=I[i],a==="."?I.splice(i,1):a===".."?c++:c>0&&(a===""?(I.splice(i+1,c),c=0):(I.splice(i,2),c--));return e=I.join("/"),e===""&&(e=l?"/":"."),n?(n.path=e,D5(n)):e}rb.normalize=C2e;function Yct(t,e){t===""&&(t="."),e===""&&(e=".");var n=sB(e),l=sB(t);if(l&&(t=l.path||"/"),n&&!n.scheme)return l&&(n.scheme=l.scheme),D5(n);if(n||e.match(g4n))return e;if(l&&!l.host&&!l.path)return l.host=e,D5(l);var I=e.charAt(0)==="/"?e:C2e(t.replace(/\/+$/,"")+"/"+e);return l?(l.path=I,D5(l)):I}rb.join=Yct;rb.isAbsolute=function(t){return t.charAt(0)==="/"||Vct.test(t)};function R4n(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var n=0;e.indexOf(t+"/")!==0;){var l=t.lastIndexOf("/");if(l<0||(t=t.slice(0,l),t.match(/^([^\/]+:\/)?\/*$/)))return e;++n}return Array(n+1).join("../")+e.substr(t.length+1)}rb.relative=R4n;var gct=function(){var t=Object.create(null);return!("__proto__"in t)}();function Rct(t){return t}function y4n(t){return yct(t)?"$"+t:t}rb.toSetString=gct?Rct:y4n;function A4n(t){return yct(t)?t.slice(1):t}rb.fromSetString=gct?Rct:A4n;function yct(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var n=e-10;n>=0;n--)if(t.charCodeAt(n)!==36)return!1;return!0}function F4n(t,e,n){var l=K5(t.source,e.source);return l!==0||(l=t.originalLine-e.originalLine,l!==0)||(l=t.originalColumn-e.originalColumn,l!==0||n)||(l=t.generatedColumn-e.generatedColumn,l!==0)||(l=t.generatedLine-e.generatedLine,l!==0)?l:K5(t.name,e.name)}rb.compareByOriginalPositions=F4n;function v4n(t,e,n){var l=t.generatedLine-e.generatedLine;return l!==0||(l=t.generatedColumn-e.generatedColumn,l!==0||n)||(l=K5(t.source,e.source),l!==0)||(l=t.originalLine-e.originalLine,l!==0)||(l=t.originalColumn-e.originalColumn,l!==0)?l:K5(t.name,e.name)}rb.compareByGeneratedPositionsDeflated=v4n;function K5(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function f4n(t,e){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=K5(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:K5(t.name,e.name)}rb.compareByGeneratedPositionsInflated=f4n;function X4n(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}rb.parseSourceMapInput=X4n;function w4n(t,e,n){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),n){var l=sB(n);if(!l)throw new Error("sourceMapURL could not be parsed");if(l.path){var I=l.path.lastIndexOf("/");I>=0&&(l.path=l.path.substring(0,I+1))}e=Yct(D5(l),e)}return C2e(e)}rb.computeSourceURL=w4n});var x2e=f(Act=>{var L2e=_5(),k2e=Object.prototype.hasOwnProperty,IQ=typeof Map<"u";function My(){this._array=[],this._set=IQ?new Map:Object.create(null)}My.fromArray=function(e,n){for(var l=new My,I=0,a=e.length;I=0)return n}else{var l=L2e.toSetString(e);if(k2e.call(this._set,l))return this._set[l]}throw new Error('"'+e+'" is not in the set.')};My.prototype.at=function(e){if(e>=0&&e{var Fct=_5();function H4n(t,e){var n=t.generatedLine,l=e.generatedLine,I=t.generatedColumn,a=e.generatedColumn;return l>n||l==n&&a>=I||Fct.compareByGeneratedPositionsInflated(t,e)<=0}function kee(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}kee.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)};kee.prototype.add=function(e){H4n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};kee.prototype.toArray=function(){return this._sorted||(this._array.sort(Fct.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};vct.MappingList=kee});var j2e=f(Xct=>{var uB=J2e(),ni=_5(),xee=x2e().ArraySet,Q4n=fct().MappingList;function OZ(t){t||(t={}),this._file=ni.getArg(t,"file",null),this._sourceRoot=ni.getArg(t,"sourceRoot",null),this._skipValidation=ni.getArg(t,"skipValidation",!1),this._sources=new xee,this._names=new xee,this._mappings=new Q4n,this._sourcesContents=null}OZ.prototype._version=3;OZ.fromSourceMap=function(e){var n=e.sourceRoot,l=new OZ({file:e.file,sourceRoot:n});return e.eachMapping(function(I){var a={generated:{line:I.generatedLine,column:I.generatedColumn}};I.source!=null&&(a.source=I.source,n!=null&&(a.source=ni.relative(n,a.source)),a.original={line:I.originalLine,column:I.originalColumn},I.name!=null&&(a.name=I.name)),l.addMapping(a)}),e.sources.forEach(function(I){var a=I;n!==null&&(a=ni.relative(n,I)),l._sources.has(a)||l._sources.add(a);var c=e.sourceContentFor(I);c!=null&&l.setSourceContent(I,c)}),l};OZ.prototype.addMapping=function(e){var n=ni.getArg(e,"generated"),l=ni.getArg(e,"original",null),I=ni.getArg(e,"source",null),a=ni.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,l,I,a),I!=null&&(I=String(I),this._sources.has(I)||this._sources.add(I)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:l!=null&&l.line,originalColumn:l!=null&&l.column,source:I,name:a})};OZ.prototype.setSourceContent=function(e,n){var l=e;this._sourceRoot!=null&&(l=ni.relative(this._sourceRoot,l)),n!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ni.toSetString(l)]=n):this._sourcesContents&&(delete this._sourcesContents[ni.toSetString(l)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};OZ.prototype.applySourceMap=function(e,n,l){var I=n;if(n==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);I=e.file}var a=this._sourceRoot;a!=null&&(I=ni.relative(a,I));var c=new xee,i=new xee;this._mappings.unsortedForEach(function(s){if(s.source===I&&s.originalLine!=null){var r=e.originalPositionFor({line:s.originalLine,column:s.originalColumn});r.source!=null&&(s.source=r.source,l!=null&&(s.source=ni.join(l,s.source)),a!=null&&(s.source=ni.relative(a,s.source)),s.originalLine=r.line,s.originalColumn=r.column,r.name!=null&&(s.name=r.name))}var u=s.source;u!=null&&!c.has(u)&&c.add(u);var o=s.name;o!=null&&!i.has(o)&&i.add(o)},this),this._sources=c,this._names=i,e.sources.forEach(function(s){var r=e.sourceContentFor(s);r!=null&&(l!=null&&(s=ni.join(l,s)),a!=null&&(s=ni.relative(a,s)),this.setSourceContent(s,r))},this)};OZ.prototype._validateMapping=function(e,n,l,I){if(n&&typeof n.line!="number"&&typeof n.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!l&&!I)){if(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&l)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:l,original:n,name:I}))}};OZ.prototype._serializeMappings=function(){for(var e=0,n=1,l=0,I=0,a=0,c=0,i="",s,r,u,o,d=this._mappings.toArray(),b=0,h=d.length;b0){if(!ni.compareByGeneratedPositionsInflated(r,d[b-1]))continue;s+=","}s+=uB.encode(r.generatedColumn-e),e=r.generatedColumn,r.source!=null&&(o=this._sources.indexOf(r.source),s+=uB.encode(o-c),c=o,s+=uB.encode(r.originalLine-1-I),I=r.originalLine-1,s+=uB.encode(r.originalColumn-l),l=r.originalColumn,r.name!=null&&(u=this._names.indexOf(r.name),s+=uB.encode(u-a),a=u)),i+=s}return i};OZ.prototype._generateSourcesContent=function(e,n){return e.map(function(l){if(!this._sourcesContents)return null;n!=null&&(l=ni.relative(n,l));var I=ni.toSetString(l);return Object.prototype.hasOwnProperty.call(this._sourcesContents,I)?this._sourcesContents[I]:null},this)};OZ.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};OZ.prototype.toString=function(){return JSON.stringify(this.toJSON())};Xct.SourceMapGenerator=OZ});var wct=f(aQ=>{aQ.GREATEST_LOWER_BOUND=1;aQ.LEAST_UPPER_BOUND=2;function O2e(t,e,n,l,I,a){var c=Math.floor((e-t)/2)+t,i=I(n,l[c],!0);return i===0?c:i>0?e-c>1?O2e(c,e,n,l,I,a):a==aQ.LEAST_UPPER_BOUND?e1?O2e(t,c,n,l,I,a):a==aQ.LEAST_UPPER_BOUND?c:t<0?-1:t}aQ.search=function(e,n,l,I){if(n.length===0)return-1;var a=O2e(-1,n.length,e,n,l,I||aQ.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&l(n[a],n[a-1],!0)===0;)--a;return a}});var Qct=f(Hct=>{function U2e(t,e,n){var l=t[e];t[e]=t[n],t[n]=l}function E4n(t,e){return Math.round(t+Math.random()*(e-t))}function z2e(t,e,n,l){if(n{var zt=_5(),B2e=wct(),P5=x2e().ArraySet,J4n=J2e(),dB=Qct().quickSort;function Fc(t,e){var n=t;return typeof t=="string"&&(n=zt.parseSourceMapInput(t)),n.sections!=null?new kN(n,e):new GG(n,e)}Fc.fromSourceMap=function(t,e){return GG.fromSourceMap(t,e)};Fc.prototype._version=3;Fc.prototype.__generatedMappings=null;Object.defineProperty(Fc.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Fc.prototype.__originalMappings=null;Object.defineProperty(Fc.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Fc.prototype._charIsMappingSeparator=function(e,n){var l=e.charAt(n);return l===";"||l===","};Fc.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")};Fc.GENERATED_ORDER=1;Fc.ORIGINAL_ORDER=2;Fc.GREATEST_LOWER_BOUND=1;Fc.LEAST_UPPER_BOUND=2;Fc.prototype.eachMapping=function(e,n,l){var I=n||null,a=l||Fc.GENERATED_ORDER,c;switch(a){case Fc.GENERATED_ORDER:c=this._generatedMappings;break;case Fc.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var i=this.sourceRoot;c.map(function(s){var r=s.source===null?null:this._sources.at(s.source);return r=zt.computeSourceURL(i,r,this._sourceMapURL),{source:r,generatedLine:s.generatedLine,generatedColumn:s.generatedColumn,originalLine:s.originalLine,originalColumn:s.originalColumn,name:s.name===null?null:this._names.at(s.name)}},this).forEach(e,I)};Fc.prototype.allGeneratedPositionsFor=function(e){var n=zt.getArg(e,"line"),l={source:zt.getArg(e,"source"),originalLine:n,originalColumn:zt.getArg(e,"column",0)};if(l.source=this._findSourceIndex(l.source),l.source<0)return[];var I=[],a=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",zt.compareByOriginalPositions,B2e.LEAST_UPPER_BOUND);if(a>=0){var c=this._originalMappings[a];if(e.column===void 0)for(var i=c.originalLine;c&&c.originalLine===i;)I.push({line:zt.getArg(c,"generatedLine",null),column:zt.getArg(c,"generatedColumn",null),lastColumn:zt.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++a];else for(var s=c.originalColumn;c&&c.originalLine===n&&c.originalColumn==s;)I.push({line:zt.getArg(c,"generatedLine",null),column:zt.getArg(c,"generatedColumn",null),lastColumn:zt.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++a]}return I};jee.SourceMapConsumer=Fc;function GG(t,e){var n=t;typeof t=="string"&&(n=zt.parseSourceMapInput(t));var l=zt.getArg(n,"version"),I=zt.getArg(n,"sources"),a=zt.getArg(n,"names",[]),c=zt.getArg(n,"sourceRoot",null),i=zt.getArg(n,"sourcesContent",null),s=zt.getArg(n,"mappings"),r=zt.getArg(n,"file",null);if(l!=this._version)throw new Error("Unsupported version: "+l);c&&(c=zt.normalize(c)),I=I.map(String).map(zt.normalize).map(function(u){return c&&zt.isAbsolute(c)&&zt.isAbsolute(u)?zt.relative(c,u):u}),this._names=P5.fromArray(a.map(String),!0),this._sources=P5.fromArray(I,!0),this._absoluteSources=this._sources.toArray().map(function(u){return zt.computeSourceURL(c,u,e)}),this.sourceRoot=c,this.sourcesContent=i,this._mappings=s,this._sourceMapURL=e,this.file=r}GG.prototype=Object.create(Fc.prototype);GG.prototype.consumer=Fc;GG.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=zt.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var n;for(n=0;n1&&(Z.source=i+g[1],i+=g[1],Z.originalLine=a+g[2],a=Z.originalLine,Z.originalLine+=1,Z.originalColumn=c+g[3],c=Z.originalColumn,g.length>4&&(Z.name=s+g[4],s+=g[4])),h.push(Z),typeof Z.originalLine=="number"&&b.push(Z)}dB(h,zt.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,dB(b,zt.compareByOriginalPositions),this.__originalMappings=b};GG.prototype._findMapping=function(e,n,l,I,a,c){if(e[l]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[l]);if(e[I]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[I]);return B2e.search(e,n,a,c)};GG.prototype.computeColumnSpans=function(){for(var e=0;e=0){var I=this._generatedMappings[l];if(I.generatedLine===n.generatedLine){var a=zt.getArg(I,"source",null);a!==null&&(a=this._sources.at(a),a=zt.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var c=zt.getArg(I,"name",null);return c!==null&&(c=this._names.at(c)),{source:a,line:zt.getArg(I,"originalLine",null),column:zt.getArg(I,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}};GG.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};GG.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var l=this._findSourceIndex(e);if(l>=0)return this.sourcesContent[l];var I=e;this.sourceRoot!=null&&(I=zt.relative(this.sourceRoot,I));var a;if(this.sourceRoot!=null&&(a=zt.urlParse(this.sourceRoot))){var c=I.replace(/^file:\/\//,"");if(a.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!a.path||a.path=="/")&&this._sources.has("/"+I))return this.sourcesContent[this._sources.indexOf("/"+I)]}if(n)return null;throw new Error('"'+I+'" is not in the SourceMap.')};GG.prototype.generatedPositionFor=function(e){var n=zt.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var l={source:n,originalLine:zt.getArg(e,"line"),originalColumn:zt.getArg(e,"column")},I=this._findMapping(l,this._originalMappings,"originalLine","originalColumn",zt.compareByOriginalPositions,zt.getArg(e,"bias",Fc.GREATEST_LOWER_BOUND));if(I>=0){var a=this._originalMappings[I];if(a.source===l.source)return{line:zt.getArg(a,"generatedLine",null),column:zt.getArg(a,"generatedColumn",null),lastColumn:zt.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};jee.BasicSourceMapConsumer=GG;function kN(t,e){var n=t;typeof t=="string"&&(n=zt.parseSourceMapInput(t));var l=zt.getArg(n,"version"),I=zt.getArg(n,"sections");if(l!=this._version)throw new Error("Unsupported version: "+l);this._sources=new P5,this._names=new P5;var a={line:-1,column:0};this._sections=I.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var i=zt.getArg(c,"offset"),s=zt.getArg(i,"line"),r=zt.getArg(i,"column");if(s{var C4n=j2e().SourceMapGenerator,Oee=_5(),L4n=/(\r?\n)/,k4n=10,q5="$$$isSourceNode$$$";function Nh(t,e,n,l,I){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=n??null,this.name=I??null,this[q5]=!0,l!=null&&this.add(l)}Nh.fromStringWithSourceMap=function(e,n,l){var I=new Nh,a=e.split(L4n),c=0,i=function(){var d=h(),b=h()||"";return d+b;function h(){return c=0;n--)this.prepend(e[n]);else if(e[q5]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Nh.prototype.walk=function(e){for(var n,l=0,I=this.children.length;l0){for(n=[],l=0;l{Uee.SourceMapGenerator=j2e().SourceMapGenerator;Uee.SourceMapConsumer=Jct().SourceMapConsumer;Uee.SourceNode=Lct().SourceNode});var Uct=f((zee,Oct)=>{"use strict";zee.__esModule=!0;var M2e=dm(),rQ=void 0;try{(typeof define!="function"||!define.amd)&&(xct=kct(),rQ=xct.SourceNode)}catch{}var xct;rQ||(rQ=function(t,e,n,l){this.src="",l&&this.add(l)},rQ.prototype={add:function(e){M2e.isArray(e)&&(e=e.join("")),this.src+=e},prepend:function(e){M2e.isArray(e)&&(e=e.join("")),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function S2e(t,e,n){if(M2e.isArray(t)){for(var l=[],I=0,a=t.length;I{"use strict";Bee.__esModule=!0;function Sct(t){return t&&t.__esModule?t:{default:t}}var zct=Aee(),x4n=xZ(),T2e=Sct(x4n),j4n=dm(),O4n=Uct(),Bct=Sct(O4n);function $5(t){this.value=t}function eL(){}eL.prototype={nameLookup:function(e,n){return this.internalNameLookup(e,n)},depthedLookup:function(e){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(e),")"]},compilerInfo:function(){var e=zct.COMPILER_REVISION,n=zct.REVISION_CHANGES[e];return[e,n]},appendToBuffer:function(e,n,l){return j4n.isArray(e)||(e=[e]),e=this.source.wrap(e,n),this.environment.isSimple?["return ",e,";"]:l?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(e,n){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",e,",",JSON.stringify(n),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(e,n,l,I){this.environment=e,this.options=n,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!I,this.name=this.environment.name,this.isChild=!!l,this.context=l||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,n),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var a=e.opcodes,c=void 0,i=void 0,s=void 0,r=void 0;for(s=0,r=a.length;s0&&(l+=", "+I.join(", "));var a=0;Object.keys(this.aliases).forEach(function(s){var r=n.aliases[s];r.children&&r.referenceCount>1&&(l+=", alias"+ ++a+"="+s,r.children[0]="alias"+a)}),this.lookupPropertyFunctionIsUsed&&(l+=", "+this.lookupPropertyFunctionVarDeclaration());var c=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths");var i=this.mergeSource(l);return e?(c.push(i),Function.apply(this,c)):this.source.wrap(["function(",c.join(","),`) { + `,i,"}"])},mergeSource:function(e){var n=this.environment.isSimple,l=!this.forceBuffer,I=void 0,a=void 0,c=void 0,i=void 0;return this.source.each(function(s){s.appendToBuffer?(c?s.prepend(" + "):c=s,i=s):(c&&(a?c.prepend("buffer += "):I=!0,i.add(";"),c=i=void 0),a=!0,n||(l=!1))}),l?c?(c.prepend("return "),i.add(";")):a||this.source.push('return "";'):(e+=", buffer = "+(I?"":this.initializeBuffer()),c?(c.prepend("return buffer + "),i.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(I?"":`; +`)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return` + lookupProperty = container.lookupProperty || function(parent, propertyName) { + if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { + return parent[propertyName]; + } + return undefined + } + `.trim()},blockValue:function(e){var n=this.aliasable("container.hooks.blockHelperMissing"),l=[this.contextName(0)];this.setupHelperArgs(e,0,l);var I=this.popStack();l.splice(1,0,I),this.push(this.source.functionCall(n,"call",l))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs("",0,n,!0),this.flushInline();var l=this.topStack();n.splice(1,0,l),this.pushSource(["if (!",this.lastHelper,") { ",l," = ",this.source.functionCall(e,"call",n),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(n){return[" != null ? ",n,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,n,l,I){var a=0;!I&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[a++])):this.pushContext(),this.resolvePath("context",e,a,n,l)},lookupBlockParam:function(e,n){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",n,1)},lookupData:function(e,n,l){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",n,0,!0,l)},resolvePath:function(e,n,l,I,a){var c=this;if(this.options.strict||this.options.assumeObjects){this.push(U4n(this.options.strict&&a,this,n,l,e));return}for(var i=n.length;lthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var n=0,l=e.length;n{"use strict";See.__esModule=!0;function GB(t){return t&&t.__esModule?t:{default:t}}var z4n=Prt(),B4n=GB(z4n),S4n=g2e(),M4n=GB(S4n),D2e=sct(),K2e=bct(),T4n=Tct(),D4n=GB(T4n),K4n=y2e(),_4n=GB(K4n),P4n=W2e(),q4n=GB(P4n),$4n=B4n.default.create;function Dct(){var t=$4n();return t.compile=function(e,n){return K2e.compile(e,n,t)},t.precompile=function(e,n){return K2e.precompile(e,n,t)},t.AST=M4n.default,t.Compiler=K2e.Compiler,t.JavaScriptCompiler=D4n.default,t.Parser=D2e.parser,t.parse=D2e.parse,t.parseWithoutProcessing=D2e.parseWithoutProcessing,t}var tL=Dct();tL.create=Dct;q4n.default(tL);tL.Visitor=_4n.default;tL.default=tL;See.default=tL;Kct.exports=See.default});function jN(t){t?(Wd[0]=Wd[16]=Wd[1]=Wd[2]=Wd[3]=Wd[4]=Wd[5]=Wd[6]=Wd[7]=Wd[8]=Wd[9]=Wd[10]=Wd[11]=Wd[12]=Wd[13]=Wd[14]=Wd[15]=0,this.blocks=Wd):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ejn,Ml,tjn,xN,Wd,qct,K2,$ct=B(()=>{"use strict";ejn=typeof window=="object"?window:{},Ml="0123456789abcdef".split(""),tjn=[-2147483648,8388608,32768,128],xN=[24,16,8,0],Wd=[];jN.prototype.update=function(t){if(!this.finalized){var e=typeof t!="string";e&&t.constructor===ejn.ArrayBuffer&&(t=new Uint8Array(t));for(var n,l=0,I,a=t.length||0,c=this.blocks;l>2]|=t[l]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|n&63)<=57344?(c[I>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|n&63)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|n&63)<=64?(this.block=c[16],this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};jN.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=tjn[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}};jN.prototype.hash=function(){var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4,a,c,i,s=this.blocks;for(c=16;c<80;++c)i=s[c-3]^s[c-8]^s[c-14]^s[c-16],s[c]=i<<1|i>>>31;for(c=0;c<20;c+=5)a=e&n|~e&l,i=t<<5|t>>>27,I=i+a+I+1518500249+s[c]<<0,e=e<<30|e>>>2,a=t&e|~t&n,i=I<<5|I>>>27,l=i+a+l+1518500249+s[c+1]<<0,t=t<<30|t>>>2,a=I&t|~I&e,i=l<<5|l>>>27,n=i+a+n+1518500249+s[c+2]<<0,I=I<<30|I>>>2,a=l&I|~l&t,i=n<<5|n>>>27,e=i+a+e+1518500249+s[c+3]<<0,l=l<<30|l>>>2,a=n&l|~n&I,i=e<<5|e>>>27,t=i+a+t+1518500249+s[c+4]<<0,n=n<<30|n>>>2;for(;c<40;c+=5)a=e^n^l,i=t<<5|t>>>27,I=i+a+I+1859775393+s[c]<<0,e=e<<30|e>>>2,a=t^e^n,i=I<<5|I>>>27,l=i+a+l+1859775393+s[c+1]<<0,t=t<<30|t>>>2,a=I^t^e,i=l<<5|l>>>27,n=i+a+n+1859775393+s[c+2]<<0,I=I<<30|I>>>2,a=l^I^t,i=n<<5|n>>>27,e=i+a+e+1859775393+s[c+3]<<0,l=l<<30|l>>>2,a=n^l^I,i=e<<5|e>>>27,t=i+a+t+1859775393+s[c+4]<<0,n=n<<30|n>>>2;for(;c<60;c+=5)a=e&n|e&l|n&l,i=t<<5|t>>>27,I=i+a+I-1894007588+s[c]<<0,e=e<<30|e>>>2,a=t&e|t&n|e&n,i=I<<5|I>>>27,l=i+a+l-1894007588+s[c+1]<<0,t=t<<30|t>>>2,a=I&t|I&e|t&e,i=l<<5|l>>>27,n=i+a+n-1894007588+s[c+2]<<0,I=I<<30|I>>>2,a=l&I|l&t|I&t,i=n<<5|n>>>27,e=i+a+e-1894007588+s[c+3]<<0,l=l<<30|l>>>2,a=n&l|n&I|l&I,i=e<<5|e>>>27,t=i+a+t-1894007588+s[c+4]<<0,n=n<<30|n>>>2;for(;c<80;c+=5)a=e^n^l,i=t<<5|t>>>27,I=i+a+I-899497514+s[c]<<0,e=e<<30|e>>>2,a=t^e^n,i=I<<5|I>>>27,l=i+a+l-899497514+s[c+1]<<0,t=t<<30|t>>>2,a=I^t^e,i=l<<5|l>>>27,n=i+a+n-899497514+s[c+2]<<0,I=I<<30|I>>>2,a=l^I^t,i=n<<5|n>>>27,e=i+a+e-899497514+s[c+3]<<0,l=l<<30|l>>>2,a=n^l^I,i=e<<5|e>>>27,t=i+a+t-899497514+s[c+4]<<0,n=n<<30|n>>>2;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+n<<0,this.h3=this.h3+l<<0,this.h4=this.h4+I<<0};jN.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4;return Ml[t>>28&15]+Ml[t>>24&15]+Ml[t>>20&15]+Ml[t>>16&15]+Ml[t>>12&15]+Ml[t>>8&15]+Ml[t>>4&15]+Ml[t&15]+Ml[e>>28&15]+Ml[e>>24&15]+Ml[e>>20&15]+Ml[e>>16&15]+Ml[e>>12&15]+Ml[e>>8&15]+Ml[e>>4&15]+Ml[e&15]+Ml[n>>28&15]+Ml[n>>24&15]+Ml[n>>20&15]+Ml[n>>16&15]+Ml[n>>12&15]+Ml[n>>8&15]+Ml[n>>4&15]+Ml[n&15]+Ml[l>>28&15]+Ml[l>>24&15]+Ml[l>>20&15]+Ml[l>>16&15]+Ml[l>>12&15]+Ml[l>>8&15]+Ml[l>>4&15]+Ml[l&15]+Ml[I>>28&15]+Ml[I>>24&15]+Ml[I>>20&15]+Ml[I>>16&15]+Ml[I>>12&15]+Ml[I>>8&15]+Ml[I>>4&15]+Ml[I&15]};jN.prototype.toString=jN.prototype.hex;jN.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4;return[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,l>>24&255,l>>16&255,l>>8&255,l&255,I>>24&255,I>>16&255,I>>8&255,I&255]};jN.prototype.array=jN.prototype.digest;jN.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(20),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),t};qct=!1,K2=t=>(qct||(console.warn(["The default method for hashing keys is insecure and will be replaced in a future version,","but hasn't been replaced yet as to not break existing caches. It's recommended that you use","a more secure hashing algorithm to avoid cache poisoning.","","See this page for more information:","|","\u2514> https://js.langchain.com/docs/troubleshooting/warnings/insecure-cache-algorithm"].join(` +`)),qct=!0),new jN(!0).update(t).hex())});function UN(t,e){e?(Nd[0]=Nd[16]=Nd[1]=Nd[2]=Nd[3]=Nd[4]=Nd[5]=Nd[6]=Nd[7]=Nd[8]=Nd[9]=Nd[10]=Nd[11]=Nd[12]=Nd[13]=Nd[14]=Nd[15]=0,this.blocks=Nd):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}var Ot,njn,ON,Mee,Nd,eot,tot=B(()=>{"use strict";Ot="0123456789abcdef".split(""),njn=[-2147483648,8388608,32768,128],ON=[24,16,8,0],Mee=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Nd=[];UN.prototype.update=function(t){if(!this.finalized){var e,n=typeof t;if(n!=="string"){if(n==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);e=!0}for(var l,I=0,a,c=t.length,i=this.blocks;I>>2]|=t[I]<>>2]|=l<>>2]|=(192|l>>>6)<>>2]|=(128|l&63)<=57344?(i[a>>>2]|=(224|l>>>12)<>>2]|=(128|l>>>6&63)<>>2]|=(128|l&63)<>>2]|=(240|l>>>18)<>>2]|=(128|l>>>12&63)<>>2]|=(128|l>>>6&63)<>>2]|=(128|l&63)<=64?(this.block=i[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};UN.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>>2]|=njn[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}};UN.prototype.hash=function(){var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4,a=this.h5,c=this.h6,i=this.h7,s=this.blocks,r,u,o,d,b,h,Z,N,g,y,X;for(r=16;r<64;++r)b=s[r-15],u=(b>>>7|b<<25)^(b>>>18|b<<14)^b>>>3,b=s[r-2],o=(b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10,s[r]=s[r-16]+u+s[r-7]+o<<0;for(X=e&n,r=0;r<64;r+=4)this.first?(this.is224?(N=300032,b=s[0]-1413257819,i=b-150054599<<0,l=b+24177077<<0):(N=704751109,b=s[0]-210244248,i=b-1521486534<<0,l=b+143694565<<0),this.first=!1):(u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),o=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),N=t&e,d=N^t&n^X,Z=I&a^~I&c,b=i+o+Z+Mee[r]+s[r],h=u+d,i=l+b<<0,l=b+h<<0),u=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),o=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),g=l&t,d=g^l&e^N,Z=c&i^~c&I,b=a+o+Z+Mee[r+1]+s[r+1],h=u+d,c=n+b<<0,n=b+h<<0,u=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),o=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),y=n&l,d=y^n&t^g,Z=a&c^~a&i,b=I+o+Z+Mee[r+2]+s[r+2],h=u+d,a=e+b<<0,e=b+h<<0,u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),o=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),X=e&n,d=X^e&l^y,Z=a&c^~a&i,b=I+o+Z+Mee[r+3]+s[r+3],h=u+d,I=t+b<<0,t=b+h<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+n<<0,this.h3=this.h3+l<<0,this.h4=this.h4+I<<0,this.h5=this.h5+a<<0,this.h6=this.h6+c<<0,this.h7=this.h7+i<<0};UN.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4,a=this.h5,c=this.h6,i=this.h7,s=Ot[t>>>28&15]+Ot[t>>>24&15]+Ot[t>>>20&15]+Ot[t>>>16&15]+Ot[t>>>12&15]+Ot[t>>>8&15]+Ot[t>>>4&15]+Ot[t&15]+Ot[e>>>28&15]+Ot[e>>>24&15]+Ot[e>>>20&15]+Ot[e>>>16&15]+Ot[e>>>12&15]+Ot[e>>>8&15]+Ot[e>>>4&15]+Ot[e&15]+Ot[n>>>28&15]+Ot[n>>>24&15]+Ot[n>>>20&15]+Ot[n>>>16&15]+Ot[n>>>12&15]+Ot[n>>>8&15]+Ot[n>>>4&15]+Ot[n&15]+Ot[l>>>28&15]+Ot[l>>>24&15]+Ot[l>>>20&15]+Ot[l>>>16&15]+Ot[l>>>12&15]+Ot[l>>>8&15]+Ot[l>>>4&15]+Ot[l&15]+Ot[I>>>28&15]+Ot[I>>>24&15]+Ot[I>>>20&15]+Ot[I>>>16&15]+Ot[I>>>12&15]+Ot[I>>>8&15]+Ot[I>>>4&15]+Ot[I&15]+Ot[a>>>28&15]+Ot[a>>>24&15]+Ot[a>>>20&15]+Ot[a>>>16&15]+Ot[a>>>12&15]+Ot[a>>>8&15]+Ot[a>>>4&15]+Ot[a&15]+Ot[c>>>28&15]+Ot[c>>>24&15]+Ot[c>>>20&15]+Ot[c>>>16&15]+Ot[c>>>12&15]+Ot[c>>>8&15]+Ot[c>>>4&15]+Ot[c&15];return this.is224||(s+=Ot[i>>>28&15]+Ot[i>>>24&15]+Ot[i>>>20&15]+Ot[i>>>16&15]+Ot[i>>>12&15]+Ot[i>>>8&15]+Ot[i>>>4&15]+Ot[i&15]),s};UN.prototype.toString=UN.prototype.hex;UN.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4,a=this.h5,c=this.h6,i=this.h7,s=[t>>>24&255,t>>>16&255,t>>>8&255,t&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255];return this.is224||s.push(i>>>24&255,i>>>16&255,i>>>8&255,i&255),s};UN.prototype.array=UN.prototype.digest;UN.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t};eot=(...t)=>new UN(!1,!0).update(t.join("")).hex()});var P2e={};Xe(P2e,{insecureHash:()=>K2,sha256:()=>eot});var bB=B(()=>{$ct();tot()});var q2e={};Xe(q2e,{BaseCache:()=>Tee,InMemoryCache:()=>mB,deserializeStoredGeneration:()=>ljn,getCacheKey:()=>not,serializeGeneration:()=>Ijn});function ljn(t){return t.message!==void 0?{text:t.text,message:Y8(t.message)}:{text:t.text}}function Ijn(t){let e={text:t.text};return t.message!==void 0&&(e.message=t.message.toDict()),e}var not,Tee,ajn,mB,$2e=B(()=>{bB();gy();not=(...t)=>K2(t.join("_"));Tee=class{constructor(){Object.defineProperty(this,"keyEncoder",{enumerable:!0,configurable:!0,writable:!0,value:not})}makeDefaultKeyEncoder(e){this.keyEncoder=e}},ajn=new Map,mB=class t extends Tee{constructor(e){super(),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cache=e??new Map}lookup(e,n){return Promise.resolve(this.cache.get(this.keyEncoder(e,n))??null)}async update(e,n,l){this.cache.set(this.keyEncoder(e,n),l)}static global(){return new t(ajn)}}});var WI,hB=B(()=>{WI=class{constructor(e){Object.defineProperty(this,"pageContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pageContent=e.pageContent!==void 0?e.pageContent.toString():"",this.metadata=e.metadata??{},this.id=e.id}}});var nve={};Xe(nve,{Embeddings:()=>Pm});var Pm,Dee=B(()=>{MH();Pm=class{constructor(e){Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.caller=new _u(e??{})}}});var cQ,Kee=B(()=>{sh();cQ=class extends XI{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","example_selectors","base"]})}}});function rjn(t){return t._modelType()==="base_llm"}function Dy(t){return t._modelType()==="base_chat_model"}var _ee,zN,lot=B(()=>{_ee=class{async getPromptAsync(e,n){return this.getPrompt(e).partial(n?.partialVariables??{})}},zN=class extends _ee{constructor(e,n=[]){super(),Object.defineProperty(this,"defaultPrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"conditionals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.defaultPrompt=e,this.conditionals=n}getPrompt(e){for(let[n,l]of this.conditionals)if(n(e))return l;return this.defaultPrompt}}});function Iot(t){return t.split(/\n| /).length}var lve,aot=B(()=>{Kee();lve=class t extends cQ{constructor(e){super(e),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getTextLength",{enumerable:!0,configurable:!0,writable:!0,value:Iot}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,writable:!0,value:2048}),Object.defineProperty(this,"exampleTextLengths",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.examplePrompt=e.examplePrompt,this.maxLength=e.maxLength??2048,this.getTextLength=e.getTextLength??Iot}async addExample(e){this.examples.push(e);let n=await this.examplePrompt.format(e);this.exampleTextLengths.push(this.getTextLength(n))}async calculateExampleTextLengths(e,n){if(e.length>0)return e;let{examples:l,examplePrompt:I}=n;return(await Promise.all(l.map(c=>I.format(c)))).map(c=>this.getTextLength(c))}async selectExamples(e){let n=Object.values(e).join(" "),l=this.maxLength-this.getTextLength(n),I=0,a=[];for(;l>0&&Il.addExample(I))),l}}});function Ive(t){return Object.keys(t).sort().map(e=>t[e])}var ave,rot=B(()=>{hB();Kee();ave=class t extends cQ{constructor(e){if(super(e),Object.defineProperty(this,"vectorStoreRetriever",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleKeys",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKeys",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.exampleKeys=e.exampleKeys,this.inputKeys=e.inputKeys,e.vectorStore!==void 0)this.vectorStoreRetriever=e.vectorStore.asRetriever({k:e.k??4,filter:e.filter});else if(e.vectorStoreRetriever)this.vectorStoreRetriever=e.vectorStoreRetriever;else throw new Error('You must specify one of "vectorStore" and "vectorStoreRetriever".')}async addExample(e){let n=this.inputKeys??Object.keys(e),l=Ive(n.reduce((I,a)=>({...I,[a]:e[a]}),{})).join(" ");await this.vectorStoreRetriever.addDocuments([new WI({pageContent:l,metadata:e})])}async selectExamples(e){let n=this.inputKeys??Object.keys(e),l=Ive(n.reduce((c,i)=>({...c,[i]:e[i]}),{})).join(" "),a=(await this.vectorStoreRetriever.invoke(l)).map(c=>c.metadata);return this.exampleKeys?a.map(c=>this.exampleKeys.reduce((i,s)=>({...i,[s]:c[s]}),{})):a}static async fromExamples(e,n,l,I={}){let a=I.inputKeys??null,c=e.map(s=>Ive(a?a.reduce((r,u)=>({...r,[u]:s[u]}),{}):s).join(" ")),i=await l.fromTexts(c,e,n,I);return new t({vectorStore:i,k:I.k??4,exampleKeys:I.exampleKeys,inputKeys:I.inputKeys})}}});var rve={};Xe(rve,{BaseExampleSelector:()=>cQ,BasePromptSelector:()=>_ee,ConditionalPromptSelector:()=>zN,LengthBasedExampleSelector:()=>lve,SemanticSimilarityExampleSelector:()=>ave,isChatModel:()=>Dy,isLLM:()=>rjn});var cve=B(()=>{Kee();lot();aot();rot()});var ive=f(Pee=>{"use strict";Pee.byteLength=ojn;Pee.toByteArray=sjn;Pee.fromByteArray=Gjn;var $Y=[],UZ=[],cjn=typeof Uint8Array<"u"?Uint8Array:Array,ove="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oQ=0,cot=ove.length;oQ0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var l=n===e?0:4-n%4;return[n,l]}function ojn(t){var e=oot(t),n=e[0],l=e[1];return(n+l)*3/4-l}function ijn(t,e,n){return(e+n)*3/4-n}function sjn(t){var e,n=oot(t),l=n[0],I=n[1],a=new cjn(ijn(t,l,I)),c=0,i=I>0?l-4:l,s;for(s=0;s>16&255,a[c++]=e>>8&255,a[c++]=e&255;return I===2&&(e=UZ[t.charCodeAt(s)]<<2|UZ[t.charCodeAt(s+1)]>>4,a[c++]=e&255),I===1&&(e=UZ[t.charCodeAt(s)]<<10|UZ[t.charCodeAt(s+1)]<<4|UZ[t.charCodeAt(s+2)]>>2,a[c++]=e>>8&255,a[c++]=e&255),a}function ujn(t){return $Y[t>>18&63]+$Y[t>>12&63]+$Y[t>>6&63]+$Y[t&63]}function djn(t,e,n){for(var l,I=[],a=e;ai?i:c+a));return l===1?(e=t[n-1],I.push($Y[e>>2]+$Y[e<<4&63]+"==")):l===2&&(e=(t[n-2]<<8)+t[n-1],I.push($Y[e>>10]+$Y[e>>4&63]+$Y[e<<2&63]+"=")),I.join("")}});function hjn(t,e){let n=Array.from({length:t.length},(l,I)=>({start:I,end:I+1}));for(;n.length>1;){let l=null;for(let I=0;Ie.get(t.slice(n.start,n.end).join(","))).filter(n=>n!=null)}function Wjn(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}function WB(t){switch(t){case"gpt2":return"gpt2";case"code-cushman-001":case"code-cushman-002":case"code-davinci-001":case"code-davinci-002":case"cushman-codex":case"davinci-codex":case"davinci-002":case"text-davinci-002":case"text-davinci-003":return"p50k_base";case"code-davinci-edit-001":case"text-davinci-edit-001":return"p50k_edit";case"ada":case"babbage":case"babbage-002":case"code-search-ada-code-001":case"code-search-babbage-code-001":case"curie":case"davinci":case"text-ada-001":case"text-babbage-001":case"text-curie-001":case"text-davinci-001":case"text-search-ada-doc-001":case"text-search-babbage-doc-001":case"text-search-curie-doc-001":case"text-search-davinci-doc-001":case"text-similarity-ada-001":case"text-similarity-babbage-001":case"text-similarity-curie-001":case"text-similarity-davinci-001":return"r50k_base";case"gpt-3.5-turbo-instruct-0914":case"gpt-3.5-turbo-instruct":case"gpt-3.5-turbo-16k-0613":case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-0613":case"gpt-3.5-turbo-0301":case"gpt-3.5-turbo":case"gpt-4-32k-0613":case"gpt-4-32k-0314":case"gpt-4-32k":case"gpt-4-0613":case"gpt-4-0314":case"gpt-4":case"gpt-3.5-turbo-1106":case"gpt-35-turbo":case"gpt-4-1106-preview":case"gpt-4-vision-preview":case"gpt-3.5-turbo-0125":case"gpt-4-turbo":case"gpt-4-turbo-2024-04-09":case"gpt-4-turbo-preview":case"gpt-4-0125-preview":case"text-embedding-ada-002":case"text-embedding-3-small":case"text-embedding-3-large":return"cl100k_base";case"gpt-4o":case"gpt-4o-2024-05-13":case"gpt-4o-2024-08-06":case"gpt-4o-2024-11-20":case"gpt-4o-mini-2024-07-18":case"gpt-4o-mini":case"gpt-4o-search-preview":case"gpt-4o-search-preview-2025-03-11":case"gpt-4o-mini-search-preview":case"gpt-4o-mini-search-preview-2025-03-11":case"gpt-4o-audio-preview":case"gpt-4o-audio-preview-2024-12-17":case"gpt-4o-audio-preview-2024-10-01":case"gpt-4o-mini-audio-preview":case"gpt-4o-mini-audio-preview-2024-12-17":case"o1":case"o1-2024-12-17":case"o1-mini":case"o1-mini-2024-09-12":case"o1-preview":case"o1-preview-2024-09-12":case"o1-pro":case"o1-pro-2025-03-19":case"o3":case"o3-2025-04-16":case"o3-mini":case"o3-mini-2025-01-31":case"o4-mini":case"o4-mini-2025-04-16":case"chatgpt-4o-latest":case"gpt-4o-realtime":case"gpt-4o-realtime-preview-2024-10-01":case"gpt-4o-realtime-preview-2024-12-17":case"gpt-4o-mini-realtime-preview":case"gpt-4o-mini-realtime-preview-2024-12-17":case"gpt-4.1":case"gpt-4.1-2025-04-14":case"gpt-4.1-mini":case"gpt-4.1-mini-2025-04-14":case"gpt-4.1-nano":case"gpt-4.1-nano-2025-04-14":case"gpt-4.5-preview":case"gpt-4.5-preview-2025-02-27":return"o200k_base";default:throw new Error("Unknown model")}}var iot,bjn,mjn,pjn,sve,IL,sot=B(()=>{iot=$(ive(),1),bjn=Object.defineProperty,mjn=(t,e,n)=>e in t?bjn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,pjn=(t,e,n)=>(mjn(t,typeof e!="symbol"?e+"":e,n),n);sve=class{specialTokens;inverseSpecialTokens;patStr;textEncoder=new TextEncoder;textDecoder=new TextDecoder("utf-8");rankMap=new Map;textMap=new Map;constructor(t,e){this.patStr=t.pat_str;let n=t.bpe_ranks.split(` +`).filter(Boolean).reduce((l,I)=>{let[a,c,...i]=I.split(" "),s=Number.parseInt(c,10);return i.forEach((r,u)=>l[r]=s+u),l},{});for(let[l,I]of Object.entries(n)){let a=iot.default.toByteArray(l);this.rankMap.set(a.join(","),I),this.textMap.set(I,a)}this.specialTokens={...t.special_tokens,...e},this.inverseSpecialTokens=Object.entries(this.specialTokens).reduce((l,[I,a])=>(l[a]=this.textEncoder.encode(I),l),{})}encode(t,e=[],n="all"){let l=new RegExp(this.patStr,"ug"),I=sve.specialTokenRegex(Object.keys(this.specialTokens)),a=[],c=new Set(e==="all"?Object.keys(this.specialTokens):e),i=new Set(n==="all"?Object.keys(this.specialTokens).filter(r=>!c.has(r)):n);if(i.size>0){let r=sve.specialTokenRegex([...i]),u=t.match(r);if(u!=null)throw new Error(`The text contains a special token that is not allowed: ${u[0]}`)}let s=0;for(;;){let r=null,u=s;for(;I.lastIndex=u,r=I.exec(t),!(r==null||c.has(r[0]));)u=r.index+1;let o=r?.index??t.length;for(let b of t.substring(s,o).matchAll(l)){let h=this.textEncoder.encode(b[0]),Z=this.rankMap.get(h.join(","));if(Z!=null){a.push(Z);continue}a.push(...Zjn(h,this.rankMap))}if(r==null)break;let d=this.specialTokens[r[0]];a.push(d),s=r.index+r[0].length}return a}decode(t){let e=[],n=0;for(let a=0;anew RegExp(t.map(e=>Wjn(e)).join("|"),"g"))});var uve=B(()=>{sot()});var dve={};Xe(dve,{encodingForModel:()=>ete,getEncoding:()=>$ee});async function $ee(t){return t in qee||(qee[t]=Njn.fetch(`https://tiktoken.pages.dev/js/${t}.json`).then(e=>e.json()).then(e=>new IL(e)).catch(e=>{throw delete qee[t],e})),await qee[t]}async function ete(t){return $ee(WB(t))}var qee,Njn,tte=B(()=>{uve();MH();qee={},Njn=new _u({})});var mve={};Xe(mve,{BaseLangChain:()=>_2,BaseLanguageModel:()=>Ky,calculateMaxTokens:()=>bve,getEmbeddingContextSize:()=>Gve,getModelContextSize:()=>lte,getModelNameForTiktoken:()=>nte,isOpenAITool:()=>qm});function qm(t){return typeof t!="object"||!t?!1:!!("type"in t&&t.type==="function"&&"function"in t&&typeof t.function=="object"&&t.function&&"name"in t.function&&"parameters"in t.function)}var nte,Gve,lte,bve,Vjn,_2,Ky,aL=B(()=>{$2e();B2();gy();MH();tte();Zd();nte=t=>t.startsWith("gpt-3.5-turbo-16k")?"gpt-3.5-turbo-16k":t.startsWith("gpt-3.5-turbo-")?"gpt-3.5-turbo":t.startsWith("gpt-4-32k")?"gpt-4-32k":t.startsWith("gpt-4-")?"gpt-4":t.startsWith("gpt-4o")?"gpt-4o":t,Gve=t=>{switch(t){case"text-embedding-ada-002":return 8191;default:return 2046}},lte=t=>{switch(nte(t)){case"gpt-3.5-turbo-16k":return 16384;case"gpt-3.5-turbo":return 4096;case"gpt-4-32k":return 32768;case"gpt-4":return 8192;case"text-davinci-003":return 4097;case"text-curie-001":return 2048;case"text-babbage-001":return 2048;case"text-ada-001":return 2048;case"code-davinci-002":return 8e3;case"code-cushman-001":return 2048;default:return 4097}};bve=async({prompt:t,modelName:e})=>{let n;try{n=(await ete(nte(e))).encode(t).length}catch{console.warn("Failed to calculate number of tokens, falling back to approximate count"),n=Math.ceil(t.length/4)}return lte(e)-n},Vjn=()=>!1,_2=class extends Zn{get lc_attributes(){return{callbacks:void 0,verbose:void 0}}constructor(e){super(e),Object.defineProperty(this,"verbose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"callbacks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.verbose=e.verbose??Vjn(),this.callbacks=e.callbacks,this.tags=e.tags??[],this.metadata=e.metadata??{}}},Ky=class extends _2{get callKeys(){return["stop","timeout","signal","tags","metadata","callbacks"]}constructor({callbacks:e,callbackManager:n,...l}){let{cache:I,...a}=l;super({callbacks:e??n,...a}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_encoding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),typeof I=="object"?this.cache=I:I?this.cache=mB.global():this.cache=void 0,this.caller=new _u(l??{})}async getNumTokens(e){let n;typeof e=="string"?n=e:n=e.map(I=>typeof I=="string"?I:I.type==="text"&&"text"in I?I.text:"").join("");let l=Math.ceil(n.length/4);if(!this._encoding)try{this._encoding=await ete("modelName"in this?nte(this.modelName):"gpt2")}catch(I){console.warn("Failed to calculate number of tokens, falling back to approximate count",I)}if(this._encoding)try{l=this._encoding.encode(n).length}catch(I){console.warn("Failed to calculate number of tokens, falling back to approximate count",I)}return l}static _convertInputToPromptValue(e){return typeof e=="string"?new mh(e):Array.isArray(e)?new Oy(e.map(AZ)):e}_identifyingParams(){return{}}_getSerializedCacheKeyParametersForCall({config:e,...n}){let l={...this._identifyingParams(),...n,_type:this._llmType(),_model:this._modelType()};return Object.entries(l).filter(([c,i])=>i!==void 0).map(([c,i])=>`${c}:${JSON.stringify(i)}`).sort().join(",")}serialize(){return{...this._identifyingParams(),_type:this._llmType(),_model:this._modelType()}}static async deserialize(e){throw new Error("Use .toJSON() instead")}}});var Tl,Ite=B(()=>{JZ();Zd();HN();Tl=class extends Zn{static lc_name(){return"RunnablePassthrough"}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,"func",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e&&(this.func=e.func)}async invoke(e,n){let l=Xl(n);return this.func&&await this.func(e,l),this._callWithConfig(I=>Promise.resolve(I),e,l)}async*transform(e,n){let l=Xl(n),I,a=!0;for await(let c of this._transformStreamWithConfig(e,i=>i,l))if(yield c,a)if(I===void 0)I=c;else try{I=Fo(I,c)}catch{I=void 0,a=!1}this.func&&I!==void 0&&await this.func(I,l)}static assign(e){return new xy(new LZ({steps:e}))}}});var Zve={};Xe(Zve,{BaseChatModel:()=>Vd,SimpleChatModel:()=>hve,createChatMessageChunkEncoderStream:()=>Yjn});function Yjn(){let t=new TextEncoder;return new TransformStream({transform(e,n){n.enqueue(t.encode(typeof e.content=="string"?e.content:JSON.stringify(e.content)))}})}function pve(t){let e=[];for(let n of t){let l=n;if(Array.isArray(n.content))for(let I=0;I{KY();Ey();aL();Qy();Zd();JZ();Ite();Ly();Y5();ky();Vd=class t extends Ky{constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","chat_models",this._llmType()]}),Object.defineProperty(this,"disableStreaming",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_separateRunnableConfigFromCallOptionsCompat(e){let[n,l]=super._separateRunnableConfigFromCallOptions(e);return l.signal=n.signal,[n,l]}async invoke(e,n){let l=t._convertInputToPromptValue(e);return(await this.generatePrompt([l],n,n?.callbacks)).generations[0][0].message}async*_streamResponseChunks(e,n,l){throw new Error("Not implemented.")}async*_streamIterator(e,n){if(this._streamResponseChunks===t.prototype._streamResponseChunks||this.disableStreaming)yield this.invoke(e,n);else{let I=t._convertInputToPromptValue(e).toChatMessages(),[a,c]=this._separateRunnableConfigFromCallOptionsCompat(n),i={...a.metadata,...this.getLsParams(c)},s=await Lr.configure(a.callbacks,this.callbacks,a.tags,this.tags,i,this.metadata,{verbose:this.verbose}),r={options:c,invocation_params:this?.invocationParams(c),batch_size:1},u=await s?.handleChatModelStart(this.toJSON(),[pve(I)],a.runId,void 0,r,void 0,void 0,a.runName),o,d;try{for await(let b of this._streamResponseChunks(I,c,u?.[0])){if(b.message.id==null){let h=u?.at(0)?.runId;h!=null&&b.message._updateId(`run-${h}`)}b.message.response_metadata={...b.generationInfo,...b.message.response_metadata},yield b.message,o?o=o.concat(b):o=b,h8(b.message)&&b.message.usage_metadata!==void 0&&(d={tokenUsage:{promptTokens:b.message.usage_metadata.input_tokens,completionTokens:b.message.usage_metadata.output_tokens,totalTokens:b.message.usage_metadata.total_tokens}})}}catch(b){throw await Promise.all((u??[]).map(h=>h?.handleLLMError(b))),b}await Promise.all((u??[]).map(b=>b?.handleLLMEnd({generations:[[o]],llmOutput:d})))}}getLsParams(e){let n=this.getName().startsWith("Chat")?this.getName().replace("Chat",""):this.getName();return{ls_model_type:"chat",ls_stop:e.stop,ls_provider:n}}async _generateUncached(e,n,l,I){let a=e.map(o=>o.map(AZ)),c;if(I!==void 0&&I.length===a.length)c=I;else{let o={...l.metadata,...this.getLsParams(n)},d=await Lr.configure(l.callbacks,this.callbacks,l.tags,this.tags,o,this.metadata,{verbose:this.verbose}),b={options:n,invocation_params:this?.invocationParams(n),batch_size:1};c=await d?.handleChatModelStart(this.toJSON(),a.map(pve),l.runId,void 0,b,void 0,void 0,l.runName)}let i=[],s=[];if(!!c?.[0].handlers.find(Fz)&&!this.disableStreaming&&a.length===1&&this._streamResponseChunks!==t.prototype._streamResponseChunks)try{let o=await this._streamResponseChunks(a[0],n,c?.[0]),d,b;for await(let h of o){if(h.message.id==null){let Z=c?.at(0)?.runId;Z!=null&&h.message._updateId(`run-${Z}`)}d===void 0?d=h:d=Fo(d,h),h8(h.message)&&h.message.usage_metadata!==void 0&&(b={tokenUsage:{promptTokens:h.message.usage_metadata.input_tokens,completionTokens:h.message.usage_metadata.output_tokens,totalTokens:h.message.usage_metadata.total_tokens}})}if(d===void 0)throw new Error("Received empty response from chat model call.");i.push([d]),await c?.[0].handleLLMEnd({generations:i,llmOutput:b})}catch(o){throw await c?.[0].handleLLMError(o),o}else{let o=await Promise.allSettled(a.map((d,b)=>this._generate(d,{...n,promptIndex:b},c?.[b])));await Promise.all(o.map(async(d,b)=>{if(d.status==="fulfilled"){let h=d.value;for(let Z of h.generations){if(Z.message.id==null){let N=c?.at(0)?.runId;N!=null&&Z.message._updateId(`run-${N}`)}Z.message.response_metadata={...Z.generationInfo,...Z.message.response_metadata}}return h.generations.length===1&&(h.generations[0].message.response_metadata={...h.llmOutput,...h.generations[0].message.response_metadata}),i[b]=h.generations,s[b]=h.llmOutput,c?.[b]?.handleLLMEnd({generations:[h.generations],llmOutput:h.llmOutput})}else return await c?.[b]?.handleLLMError(d.reason),Promise.reject(d.reason)}))}let u={generations:i,llmOutput:s.length?this._combineLLMOutput?.(...s):void 0};return Object.defineProperty(u,cc,{value:c?{runIds:c?.map(o=>o.runId)}:void 0,configurable:!0}),u}async _generateCached({messages:e,cache:n,llmStringKey:l,parsedOptions:I,handledOptions:a}){let c=e.map(N=>N.map(AZ)),i={...a.metadata,...this.getLsParams(I)},s=await Lr.configure(a.callbacks,this.callbacks,a.tags,this.tags,i,this.metadata,{verbose:this.verbose}),r={options:I,invocation_params:this?.invocationParams(I),batch_size:1},u=await s?.handleChatModelStart(this.toJSON(),c.map(pve),a.runId,void 0,r,void 0,void 0,a.runName),o=[],b=(await Promise.allSettled(c.map(async(N,g)=>{let y=t._convertInputToPromptValue(N).toString(),X=await n.lookup(y,l);return X==null&&o.push(g),X}))).map((N,g)=>({result:N,runManager:u?.[g]})).filter(({result:N})=>N.status==="fulfilled"&&N.value!=null||N.status==="rejected"),h=[];await Promise.all(b.map(async({result:N,runManager:g},y)=>{if(N.status==="fulfilled"){let X=N.value;return h[y]=X.map(v=>("message"in v&&$r(v.message)&&qG(v.message)&&(v.message.usage_metadata={input_tokens:0,output_tokens:0,total_tokens:0}),v.generationInfo={...v.generationInfo,tokenUsage:{}},v)),X.length&&await g?.handleLLMNewToken(X[0].text),g?.handleLLMEnd({generations:[X]},void 0,void 0,void 0,{cached:!0})}else return await g?.handleLLMError(N.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(N.reason)}));let Z={generations:h,missingPromptIndices:o,startedRunManagers:u};return Object.defineProperty(Z,cc,{value:u?{runIds:u?.map(N=>N.runId)}:void 0,configurable:!0}),Z}async generate(e,n,l){let I;Array.isArray(n)?I={stop:n}:I=n;let a=e.map(h=>h.map(AZ)),[c,i]=this._separateRunnableConfigFromCallOptionsCompat(I);if(c.callbacks=c.callbacks??l,!this.cache)return this._generateUncached(a,i,c);let{cache:s}=this,r=this._getSerializedCacheKeyParametersForCall(i),{generations:u,missingPromptIndices:o,startedRunManagers:d}=await this._generateCached({messages:a,cache:s,llmStringKey:r,parsedOptions:i,handledOptions:c}),b={};if(o.length>0){let h=await this._generateUncached(o.map(Z=>a[Z]),i,c,d!==void 0?o.map(Z=>d?.[Z]):void 0);await Promise.all(h.generations.map(async(Z,N)=>{let g=o[N];u[g]=Z;let y=t._convertInputToPromptValue(a[g]).toString();return s.update(y,r,Z)})),b=h.llmOutput??{}}return{generations:u,llmOutput:b}}invocationParams(e){return{}}_modelType(){return"base_chat_model"}serialize(){return{...this.invocationParams(),_type:this._llmType(),_model:this._modelType()}}async generatePrompt(e,n,l){let I=e.map(a=>a.toChatMessages());return this.generate(I,n,l)}async call(e,n,l){return(await this.generate([e.map(AZ)],n,l)).generations[0][0].message}async callPrompt(e,n,l){let I=e.toChatMessages();return this.call(I,n,l)}async predictMessages(e,n,l){return this.call(e,n,l)}async predict(e,n,l){let I=new Qn(e),a=await this.call([I],n,l);if(typeof a.content!="string")throw new Error("Cannot use predict when output is not a string.");return a.content}withStructuredOutput(e,n){if(typeof this.bindTools!="function")throw new Error('Chat model must implement ".bindTools()" to use withStructuredOutput.');if(n?.strict)throw new Error('"strict" mode is not supported for this model by default.');let l=e,I=n?.name,a=zz(l)??"A function available to call.",c=n?.method,i=n?.includeRaw;if(c==="jsonMode")throw new Error('Base withStructuredOutput implementation only supports "functionCalling" as a method.');let s=I??"extract",r;wr(l)?r=[{type:"function",function:{name:s,description:a,parameters:Wl(l)}}]:("name"in l&&(s=l.name),r=[{type:"function",function:{name:s,description:a,parameters:l}}]);let u=this.bindTools(r),o=ti.from(Z=>{if(!Z.tool_calls||Z.tool_calls.length===0)throw new Error("No tool calls found in the response.");let N=Z.tool_calls.find(g=>g.name===s);if(!N)throw new Error(`No tool call found with name ${s}.`);return N.args});if(!i)return u.pipe(o).withConfig({runName:"StructuredOutput"});let d=Tl.assign({parsed:(Z,N)=>o.invoke(Z.raw,N)}),b=Tl.assign({parsed:()=>null}),h=d.withFallbacks({fallbacks:[b]});return Hr.from([{raw:u},h]).withConfig({runName:"StructuredOutputRunnable"})}},hve=class extends Vd{async _generate(e,n,l){let I=await this._call(e,n,l),a=new _t(I);if(typeof a.content!="string")throw new Error("Cannot generate with a simple chat model when output is not a string.");return{generations:[{text:a.content,message:a}]}}}});var Wve={};Xe(Wve,{BaseLLM:()=>rL,LLM:()=>eg});var rL,eg,rte=B(()=>{KY();Ey();Qy();aL();JZ();Y5();rL=class t extends Ky{constructor({concurrency:e,...n}){super(e?{maxConcurrency:e,...n}:n),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","llms",this._llmType()]})}async invoke(e,n){let l=t._convertInputToPromptValue(e);return(await this.generatePrompt([l],n,n?.callbacks)).generations[0][0].text}async*_streamResponseChunks(e,n,l){throw new Error("Not implemented.")}_separateRunnableConfigFromCallOptionsCompat(e){let[n,l]=super._separateRunnableConfigFromCallOptions(e);return l.signal=n.signal,[n,l]}async*_streamIterator(e,n){if(this._streamResponseChunks===t.prototype._streamResponseChunks)yield this.invoke(e,n);else{let l=t._convertInputToPromptValue(e),[I,a]=this._separateRunnableConfigFromCallOptionsCompat(n),c=await Lr.configure(I.callbacks,this.callbacks,I.tags,this.tags,I.metadata,this.metadata,{verbose:this.verbose}),i={options:a,invocation_params:this?.invocationParams(a),batch_size:1},s=await c?.handleLLMStart(this.toJSON(),[l.toString()],I.runId,void 0,i,void 0,void 0,I.runName),r=new zo({text:""});try{for await(let u of this._streamResponseChunks(l.toString(),a,s?.[0]))r?r=r.concat(u):r=u,typeof u.text=="string"&&(yield u.text)}catch(u){throw await Promise.all((s??[]).map(o=>o?.handleLLMError(u))),u}await Promise.all((s??[]).map(u=>u?.handleLLMEnd({generations:[[r]]})))}}async generatePrompt(e,n,l){let I=e.map(a=>a.toString());return this.generate(I,n,l)}invocationParams(e){return{}}_flattenLLMResult(e){let n=[];for(let l=0;lo?.handleLLMError(u))),u}let r=this._flattenLLMResult(i);await Promise.all((a??[]).map((u,o)=>u?.handleLLMEnd(r[o])))}let s=a?.map(r=>r.runId)||void 0;return Object.defineProperty(i,cc,{value:s?{runIds:s}:void 0,configurable:!0}),i}async _generateCached({prompts:e,cache:n,llmStringKey:l,parsedOptions:I,handledOptions:a,runId:c}){let i=await Lr.configure(a.callbacks,this.callbacks,a.tags,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),s={options:I,invocation_params:this?.invocationParams(I),batch_size:e.length},r=await i?.handleLLMStart(this.toJSON(),e,c,void 0,s,void 0,void 0,a?.runName),u=[],d=(await Promise.allSettled(e.map(async(Z,N)=>{let g=await n.lookup(Z,l);return g==null&&u.push(N),g}))).map((Z,N)=>({result:Z,runManager:r?.[N]})).filter(({result:Z})=>Z.status==="fulfilled"&&Z.value!=null||Z.status==="rejected"),b=[];await Promise.all(d.map(async({result:Z,runManager:N},g)=>{if(Z.status==="fulfilled"){let y=Z.value;return b[g]=y.map(X=>(X.generationInfo={...X.generationInfo,tokenUsage:{}},X)),y.length&&await N?.handleLLMNewToken(y[0].text),N?.handleLLMEnd({generations:[y]},void 0,void 0,void 0,{cached:!0})}else return await N?.handleLLMError(Z.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(Z.reason)}));let h={generations:b,missingPromptIndices:u,startedRunManagers:r};return Object.defineProperty(h,cc,{value:r?{runIds:r?.map(Z=>Z.runId)}:void 0,configurable:!0}),h}async generate(e,n,l){if(!Array.isArray(e))throw new Error("Argument 'prompts' is expected to be a string[]");let I;Array.isArray(n)?I={stop:n}:I=n;let[a,c]=this._separateRunnableConfigFromCallOptionsCompat(I);if(a.callbacks=a.callbacks??l,!this.cache)return this._generateUncached(e,c,a);let{cache:i}=this,s=this._getSerializedCacheKeyParametersForCall(c),{generations:r,missingPromptIndices:u,startedRunManagers:o}=await this._generateCached({prompts:e,cache:i,llmStringKey:s,parsedOptions:c,handledOptions:a,runId:a.runId}),d={};if(u.length>0){let b=await this._generateUncached(u.map(h=>e[h]),c,a,o!==void 0?u.map(h=>o?.[h]):void 0);await Promise.all(b.generations.map(async(h,Z)=>{let N=u[Z];return r[N]=h,i.update(e[N],s,h)})),d=b.llmOutput??{}}return{generations:r,llmOutput:d}}async call(e,n,l){let{generations:I}=await this.generate([e],n,l);return I[0][0].text}async predict(e,n,l){return this.call(e,n,l)}async predictMessages(e,n,l){let I=mr(e),a=await this.call(I,n,l);return new _t(a)}_identifyingParams(){return{}}serialize(){return{...this._identifyingParams(),_type:this._llmType(),_model:this._modelType()}}_modelType(){return"base_llm"}},eg=class extends rL{async _generate(e,n,l){return{generations:await Promise.all(e.map((a,c)=>this._call(a,{...n,promptIndex:c},l).then(i=>[{text:i}])))}}}});var cL,dot=B(()=>{Zd();HN();cL=class extends Zn{static lc_name(){return"RouterRunnable"}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,"runnables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.runnables=e.runnables}async invoke(e,n){let{key:l,input:I}=e,a=this.runnables[l];if(a===void 0)throw new Error(`No runnable associated with key "${l}".`);return a.invoke(I,Xl(n))}async batch(e,n,l){let I=e.map(d=>d.key),a=e.map(d=>d.input);if(I.find(d=>this.runnables[d]===void 0)!==void 0)throw new Error("One or more keys do not have a corresponding runnable.");let i=I.map(d=>this.runnables[d]),s=this._getOptionsList(n??{},e.length),r=s[0]?.maxConcurrency??l?.maxConcurrency,u=r&&r>0?r:e.length,o=[];for(let d=0;di[N].invoke(Z,s[N])),h=await Promise.all(b);o.push(h)}return o.flat()}async stream(e,n){let{key:l,input:I}=e,a=this.runnables[l];if(a===void 0)throw new Error(`No runnable associated with key "${l}".`);return a.stream(I,n)}}});var P2,Got=B(()=>{Zd();HN();JZ();P2=class extends Zn{static lc_name(){return"RunnableBranch"}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,"default",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"branches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.branches=e.branches,this.default=e.default}static from(e){if(e.length<1)throw new Error("RunnableBranch requires at least one branch");let l=e.slice(0,-1).map(([a,c])=>[bh(a),bh(c)]),I=bh(e[e.length-1]);return new this({branches:l,default:I})}async _invoke(e,n,l){let I;for(let a=0;a{KY();Zd();Ite();oL=class extends dG{constructor(e){let n=ti.from((c,i)=>this._enterHistory(c,i??{})).withConfig({runName:"loadHistory"}),l=e.historyMessagesKey??e.inputMessagesKey;l&&(n=Tl.assign({[l]:n}).withConfig({runName:"insertHistory"}));let I=n.pipe(e.runnable.withListeners({onEnd:(c,i)=>this._exitHistory(c,i??{})})).withConfig({runName:"RunnableWithMessageHistory"}),a=e.config??{};super({...e,config:a,bound:I}),Object.defineProperty(this,"runnable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputMessagesKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputMessagesKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"historyMessagesKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getMessageHistory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.runnable=e.runnable,this.getMessageHistory=e.getMessageHistory,this.inputMessagesKey=e.inputMessagesKey,this.outputMessagesKey=e.outputMessagesKey,this.historyMessagesKey=e.historyMessagesKey}_getInputMessages(e){let n;if(typeof e=="object"&&!Array.isArray(e)&&!$r(e)){let l;this.inputMessagesKey?l=this.inputMessagesKey:Object.keys(e).length===1?l=Object.keys(e)[0]:l="input",Array.isArray(e[l])&&Array.isArray(e[l][0])?n=e[l][0]:n=e[l]}else n=e;if(typeof n=="string")return[new Qn(n)];if(Array.isArray(n))return n;if($r(n))return[n];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages. +Got ${JSON.stringify(n,null,2)}`)}_getOutputMessages(e){let n;if(!Array.isArray(e)&&!$r(e)&&typeof e!="string"){let l;this.outputMessagesKey!==void 0?l=this.outputMessagesKey:Object.keys(e).length===1?l=Object.keys(e)[0]:l="output",e.generations!==void 0?n=e.generations[0][0].message:n=e[l]}else n=e;if(typeof n=="string")return[new _t(n)];if(Array.isArray(n))return n;if($r(n))return[n];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages. Received: ${JSON.stringify(n,null,2)}`)}async _enterHistory(e,n){let I=await(n?.configurable?.messageHistory).getMessages();return this.historyMessagesKey===void 0?I.concat(this._getInputMessages(e)):I}async _exitHistory(e,n){let l=n.configurable?.messageHistory,I;Array.isArray(e.inputs)&&Array.isArray(e.inputs[0])?I=e.inputs[0]:I=e.inputs;let a=this._getInputMessages(I);if(this.historyMessagesKey===void 0){let s=await l.getMessages();a=a.slice(s.length)}let c=e.outputs;if(!c)throw new Error(`Output values from 'Run' undefined. Run: ${JSON.stringify(e,null,2)}`);let i=this._getOutputMessages(c);await l.addMessages([...a,...i])}async _mergeConfig(...e){let n=await super._mergeConfig(...e);if(!n.configurable||!n.configurable.sessionId){let I={[this.inputMessagesKey??"input"]:"foo"},a={configurable:{sessionId:"123"}};throw new Error(`sessionId is required. Pass it in as part of the config argument to .invoke() or .stream() +eg. chain.invoke(${JSON.stringify(I)}, ${JSON.stringify(a)})`)}let{sessionId:l}=n.configurable;return n.configurable.messageHistory=await this.getMessageHistory(l),n}}});var Vve={};Xe(Vve,{RouterRunnable:()=>cL,Runnable:()=>Zn,RunnableAssign:()=>xy,RunnableBinding:()=>dG,RunnableBranch:()=>P2,RunnableEach:()=>KH,RunnableLambda:()=>ti,RunnableMap:()=>LZ,RunnableParallel:()=>w5,RunnablePassthrough:()=>Tl,RunnablePick:()=>jy,RunnableRetry:()=>z2,RunnableSequence:()=>Hr,RunnableToolLike:()=>H5,RunnableWithFallbacks:()=>_H,RunnableWithMessageHistory:()=>oL,_coerceToRunnable:()=>bh,ensureConfig:()=>Xl,getCallbackManagerForConfig:()=>Ao,mergeConfigs:()=>wz,patchConfig:()=>wI,pickRunnableConfigKeys:()=>Dm});var ote=B(()=>{Zd();HN();Ite();dot();Got();bot()});var vo,QI,$t,sQ=B(()=>{ote();oz();vo=class extends Zn{parseResultWithPrompt(e,n,l){return this.parseResult(e,l)}_baseMessageToString(e){return typeof e.content=="string"?e.content:this._baseMessageContentToString(e.content)}_baseMessageContentToString(e){return JSON.stringify(e)}async invoke(e,n){return typeof e=="string"?this._callWithConfig(async(l,I)=>this.parseResult([{text:l}],I?.callbacks),e,{...n,runType:"parser"}):this._callWithConfig(async(l,I)=>this.parseResult([{message:l,text:this._baseMessageToString(l)}],I?.callbacks),e,{...n,runType:"parser"})}},QI=class extends vo{parseResult(e,n){return this.parse(e[0].text,n)}async parseWithPrompt(e,n,l){return this.parse(e,l)}_type(){throw new Error("_type not implemented")}},$t=class extends Error{constructor(e,n,l,I=!1){if(super(e),Object.defineProperty(this,"llmOutput",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"observation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendToLLM",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmOutput=n,this.observation=l,this.sendToLLM=I,I&&(l===void 0||n===void 0))throw new Error("Arguments 'observation' & 'llmOutput' are required if 'sendToLlm' is true");A2(this,"OUTPUT_PARSING_FAILURE")}}});var zZ,SN,q2=B(()=>{Oz();sQ();RZ();gy();Ey();zZ=class extends QI{async*_transform(e){for await(let n of e)typeof n=="string"?yield this.parseResult([{text:n}]):yield this.parseResult([{message:n,text:this._baseMessageToString(n)}])}async*transform(e,n){yield*this._transformStreamWithConfig(e,this._transform.bind(this),{...n,runType:"parser"})}},SN=class extends zZ{constructor(e){super(e),Object.defineProperty(this,"diff",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.diff=e?.diff??this.diff}async*_transform(e){let n,l;for await(let I of e){if(typeof I!="string"&&typeof I.content!="string")throw new Error("Cannot handle non-string output.");let a;if(rz(I)){if(typeof I.content!="string")throw new Error("Cannot handle non-string message output.");a=new Io({message:I,text:I.content})}else if($r(I)){if(typeof I.content!="string")throw new Error("Cannot handle non-string message output.");a=new Io({message:o5(I),text:I.content})}else a=new zo({text:I});l===void 0?l=a:l=l.concat(a);let c=await this.parsePartialResult([l]);c!=null&&!MY(c,n)&&(this.diff?yield this._diff(n,c):yield c,n=c)}}getFormatInstructions(){return""}}});var Yve,mot=B(()=>{q2();Yve=class extends zZ{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers","bytes"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"textEncoder",{enumerable:!0,configurable:!0,writable:!0,value:new TextEncoder})}static lc_name(){return"BytesOutputParser"}parse(e){return Promise.resolve(this.textEncoder.encode(e))}getFormatInstructions(){return""}}});var tg,iL,sL,gve,Rve,pot=B(()=>{sQ();q2();tg=class extends zZ{constructor(){super(...arguments),Object.defineProperty(this,"re",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async*_transform(e){let n="";for await(let l of e)if(typeof l=="string"?n+=l:n+=l.content,this.re){let I=[...n.matchAll(this.re)];if(I.length>1){let a=0;for(let c of I.slice(0,-1))yield[c[1]],a+=(c.index??0)+c[0].length;n=n.slice(a)}}else{let I=await this.parse(n);if(I.length>1){for(let a of I.slice(0,-1))yield[a];n=I[I.length-1]}}for(let l of await this.parse(n))yield[l]}},iL=class extends tg{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers","list"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0})}static lc_name(){return"CommaSeparatedListOutputParser"}async parse(e){try{return e.trim().split(",").map(n=>n.trim())}catch{throw new $t(`Could not parse output: ${e}`,e)}}getFormatInstructions(){return"Your response should be a list of comma separated values, eg: `foo, bar, baz`"}},sL=class extends tg{constructor({length:e,separator:n}){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers","list"]}),Object.defineProperty(this,"length",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"separator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.length=e,this.separator=n||","}async parse(e){try{let n=e.trim().split(this.separator).map(l=>l.trim());if(this.length!==void 0&&n.length!==this.length)throw new $t(`Incorrect number of items. Expected ${this.length}, got ${n.length}.`);return n}catch(n){throw Object.getPrototypeOf(n)===$t.prototype?n:new $t(`Could not parse output: ${e}`)}}getFormatInstructions(){return`Your response should be a list of ${this.length===void 0?"":`${this.length} `}items separated by "${this.separator}" (eg: \`foo${this.separator} bar${this.separator} baz\`)`}},gve=class extends tg{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers","list"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"re",{enumerable:!0,configurable:!0,writable:!0,value:/\d+\.\s([^\n]+)/g})}static lc_name(){return"NumberedListOutputParser"}getFormatInstructions(){return`Your response should be a numbered list with each item on a new line. For example: + +1. foo + +2. bar + +3. baz`}async parse(e){return[...e.matchAll(this.re)??[]].map(n=>n[1])}},Rve=class extends tg{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers","list"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"re",{enumerable:!0,configurable:!0,writable:!0,value:/^\s*[-*]\s([^\n]+)$/gm})}static lc_name(){return"NumberedListOutputParser"}getFormatInstructions(){return`Your response should be a numbered list with each item on a new line. For example: + +1. foo + +2. bar + +3. baz`}async parse(e){return[...e.matchAll(this.re)??[]].map(n=>n[1])}}});var Vh,hot=B(()=>{q2();Vh=class extends zZ{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers","string"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0})}static lc_name(){return"StrOutputParser"}parse(e){return Promise.resolve(e)}getFormatInstructions(){return""}_textContentToString(e){return e.text}_imageUrlContentToString(e){throw new Error('Cannot coerce a multimodal "image_url" message part into a string.')}_messageContentComplexToString(e){switch(e.type){case"text":case"text_delta":if("text"in e)return this._textContentToString(e);break;case"image_url":if("image_url"in e)return this._imageUrlContentToString(e);break;default:throw new Error(`Cannot coerce "${e.type}" message part into a string.`)}throw new Error(`Invalid content type: ${e.type}`)}_baseMessageContentToString(e){return e.reduce((n,l)=>n+this._messageContentComplexToString(l),"")}}});var Py,ite,yve,Zot=B(()=>{X8();sQ();Ly();ky();Py=class extends QI{static lc_name(){return"StructuredOutputParser"}toJSON(){return this.toJSONNotImplemented()}constructor(e){super(e),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","output_parsers","structured"]})}static fromZodSchema(e){return new this(e)}static fromNamesAndDescriptions(e){let n=St.object(Object.fromEntries(Object.entries(e).map(([l,I])=>[l,St.string().describe(I)])));return new this(n)}getFormatInstructions(){return`You must format your output as a JSON value that adheres to a given "JSON Schema" instance. + +"JSON Schema" is a declarative language that allows you to annotate and validate JSON documents. + +For example, the example "JSON Schema" instance {{"properties": {{"foo": {{"description": "a list of test words", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}} +would match an object with one required property, "foo". The "type" property specifies "foo" must be an "array", and the "description" property semantically describes it as "a list of test words". The items within "foo" must be strings. +Thus, the object {{"foo": ["bar", "baz"]}} is a well-formatted instance of this example "JSON Schema". The object {{"properties": {{"foo": ["bar", "baz"]}}}} is not well-formatted. + +Your output will be parsed and type-checked according to the provided schema instance, so make sure all fields in your output match the schema exactly and there are no trailing commas! + +Here is the JSON Schema instance your output must adhere to. Include the enclosing markdown codeblock: +\`\`\`json +${JSON.stringify(Wl(this.schema))} +\`\`\` +`}async parse(e){try{let l=(e.includes("```")?e.trim().split(/```(?:json)?/)[1]:e.trim()).replace(/"([^"\\]*(\\.[^"\\]*)*)"/g,(I,a)=>`"${a.replace(/\n/g,"\\n")}"`).replace(/\n/g,"");return await DY(this.schema,JSON.parse(l))}catch(n){throw new $t(`Failed to parse. Text: "${e}". Error: ${n}`,e)}}},ite=class extends Py{static lc_name(){return"JsonMarkdownStructuredOutputParser"}getFormatInstructions(e){let n=e?.interpolationDepth??1;if(n<1)throw new Error("f string interpolation depth must be at least 1");return`Return a markdown code snippet with a JSON object formatted to look like: +\`\`\`json +${this._schemaToInstruction(Wl(this.schema)).replaceAll("{","{".repeat(n)).replaceAll("}","}".repeat(n))} +\`\`\``}_schemaToInstruction(e,n=2){let l=e;if("type"in l){let I=!1,a;if(Array.isArray(l.type)){let s=l.type.findIndex(r=>r==="null");s!==-1&&(I=!0,l.type.splice(s,1)),a=l.type.join(" | ")}else a=l.type;if(l.type==="object"&&l.properties){let s=l.description?` // ${l.description}`:"";return`{ +${Object.entries(l.properties).map(([u,o])=>{let d=l.required?.includes(u)?"":" (optional)";return`${" ".repeat(n)}"${u}": ${this._schemaToInstruction(o,n+2)}${d}`}).join(` +`)} +${" ".repeat(n-2)}}${s}`}if(l.type==="array"&&l.items){let s=l.description?` // ${l.description}`:"";return`array[ +${" ".repeat(n)}${this._schemaToInstruction(l.items,n+2)} +${" ".repeat(n-2)}] ${s}`}let c=I?" (nullable)":"",i=l.description?` // ${l.description}`:"";return`${a}${i}${c}`}if("anyOf"in l)return l.anyOf.map(I=>this._schemaToInstruction(I,n)).join(` +${" ".repeat(n-2)}`);throw new Error("unsupported schema type")}static fromZodSchema(e){return new this(e)}static fromNamesAndDescriptions(e){let n=St.object(Object.fromEntries(Object.entries(e).map(([l,I])=>[l,St.string().describe(I)])));return new this(n)}},yve=class extends QI{constructor({inputSchema:e}){super(...arguments),Object.defineProperty(this,"structuredInputParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.structuredInputParser=new ite(e)}async parse(e){let n;try{n=await this.structuredInputParser.parse(e)}catch(l){throw new $t(`Failed to parse. Text: "${e}". Error: ${l}`,e)}return this.outputProcessor(n)}getFormatInstructions(){return this.structuredInputParser.getFormatInstructions()}}});var Ave={};Xe(Ave,{applyPatch:()=>vy,compare:()=>Q2});var NB=B(()=>{rAe()});var ng,Fve=B(()=>{q2();NB();fye();ng=class extends SN{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0})}static lc_name(){return"JsonOutputParser"}_diff(e,n){if(n)return e?Q2(e,n):[{op:"replace",path:"",value:n}]}async parsePartialResult(e){return b8(e[0].text)}async parse(e){return b8(e,JSON.parse)}getFormatInstructions(){return""}}});var gjn,Wot,Not=B(()=>{gjn=function(){let t={};t.parser=function(j,E){return new n(j,E)},t.SAXParser=n,t.SAXStream=r,t.createStream=s,t.MAX_BUFFER_LENGTH=65536;let e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(j,E){if(!(this instanceof n))return new n(j,E);var S=this;I(S),S.q=S.c="",S.bufferCheckPosition=t.MAX_BUFFER_LENGTH,S.opt=E||{},S.opt.lowercase=S.opt.lowercase||S.opt.lowercasetags,S.looseCase=S.opt.lowercase?"toLowerCase":"toUpperCase",S.tags=[],S.closed=S.closedRoot=S.sawRoot=!1,S.tag=S.error=null,S.strict=!!j,S.noscript=!!(j||S.opt.noscript),S.state=J.BEGIN,S.strictEntities=S.opt.strictEntities,S.ENTITIES=S.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),S.attribList=[],S.opt.xmlns&&(S.ns=Object.create(h)),S.trackPosition=S.opt.position!==!1,S.trackPosition&&(S.position=S.line=S.column=0),U(S,"onready")}Object.create||(Object.create=function(j){function E(){}E.prototype=j;var S=new E;return S}),Object.keys||(Object.keys=function(j){var E=[];for(var S in j)j.hasOwnProperty(S)&&E.push(S);return E});function l(j){for(var E=Math.max(t.MAX_BUFFER_LENGTH,10),S=0,m=0,Y=e.length;mE)switch(e[m]){case"textNode":D(j);break;case"cdata":K(j,"oncdata",j.cdata),j.cdata="";break;case"script":K(j,"onscript",j.script),j.script="";break;default:P(j,"Max buffer length exceeded: "+e[m])}S=Math.max(S,R)}var C=t.MAX_BUFFER_LENGTH-S;j.bufferCheckPosition=C+j.position}function I(j){for(var E=0,S=e.length;E"||X(j)}function Q(j,E){return j.test(E)}function L(j,E){return!Q(j,E)}var J=0;t.STATE={BEGIN:J++,BEGIN_WHITESPACE:J++,TEXT:J++,TEXT_ENTITY:J++,OPEN_WAKA:J++,SGML_DECL:J++,SGML_DECL_QUOTED:J++,DOCTYPE:J++,DOCTYPE_QUOTED:J++,DOCTYPE_DTD:J++,DOCTYPE_DTD_QUOTED:J++,COMMENT_STARTING:J++,COMMENT:J++,COMMENT_ENDING:J++,COMMENT_ENDED:J++,CDATA:J++,CDATA_ENDING:J++,CDATA_ENDING_2:J++,PROC_INST:J++,PROC_INST_BODY:J++,PROC_INST_ENDING:J++,OPEN_TAG:J++,OPEN_TAG_SLASH:J++,ATTRIB:J++,ATTRIB_NAME:J++,ATTRIB_NAME_SAW_WHITE:J++,ATTRIB_VALUE:J++,ATTRIB_VALUE_QUOTED:J++,ATTRIB_VALUE_CLOSED:J++,ATTRIB_VALUE_UNQUOTED:J++,ATTRIB_VALUE_ENTITY_Q:J++,ATTRIB_VALUE_ENTITY_U:J++,CLOSE_TAG:J++,CLOSE_TAG_SAW_WHITE:J++,SCRIPT:J++,SCRIPT_ENDING:J++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(j){var E=t.ENTITIES[j],S=typeof E=="number"?String.fromCharCode(E):E;t.ENTITIES[j]=S});for(var O in t.STATE)t.STATE[t.STATE[O]]=O;J=t.STATE;function U(j,E,S){j[E]&&j[E](S)}function K(j,E,S){j.textNode&&D(j),U(j,E,S)}function D(j){j.textNode=_(j.opt,j.textNode),j.textNode&&U(j,"ontext",j.textNode),j.textNode=""}function _(j,E){return j.trim&&(E=E.trim()),j.normalize&&(E=E.replace(/\s+/g," ")),E}function P(j,E){return D(j),j.trackPosition&&(E+=` +Line: `+j.line+` +Column: `+j.column+` +Char: `+j.c),E=new Error(E),j.error=E,U(j,"onerror",E),j}function le(j){return j.sawRoot&&!j.closedRoot&&q(j,"Unclosed root tag"),j.state!==J.BEGIN&&j.state!==J.BEGIN_WHITESPACE&&j.state!==J.TEXT&&P(j,"Unexpected end"),D(j),j.c="",j.closed=!0,U(j,"onend"),n.call(j,j.strict,j.opt),j}function q(j,E){if(typeof j!="object"||!(j instanceof n))throw new Error("bad call to strictFail");j.strict&&P(j,E)}function ee(j){j.strict||(j.tagName=j.tagName[j.looseCase]());var E=j.tags[j.tags.length-1]||j,S=j.tag={name:j.tagName,attributes:{}};j.opt.xmlns&&(S.ns=E.ns),j.attribList.length=0,K(j,"onopentagstart",S)}function ne(j,E){var S=j.indexOf(":"),m=S<0?["",j]:j.split(":"),Y=m[0],R=m[1];return E&&j==="xmlns"&&(Y="xmlns",R=""),{prefix:Y,local:R}}function ie(j){if(j.strict||(j.attribName=j.attribName[j.looseCase]()),j.attribList.indexOf(j.attribName)!==-1||j.tag.attributes.hasOwnProperty(j.attribName)){j.attribName=j.attribValue="";return}if(j.opt.xmlns){var E=ne(j.attribName,!0),S=E.prefix,m=E.local;if(S==="xmlns")if(m==="xml"&&j.attribValue!==d)q(j,"xml: prefix must be bound to "+d+` +Actual: `+j.attribValue);else if(m==="xmlns"&&j.attribValue!==b)q(j,"xmlns: prefix must be bound to "+b+` +Actual: `+j.attribValue);else{var Y=j.tag,R=j.tags[j.tags.length-1]||j;Y.ns===R.ns&&(Y.ns=Object.create(R.ns)),Y.ns[m]=j.attribValue}j.attribList.push([j.attribName,j.attribValue])}else j.tag.attributes[j.attribName]=j.attribValue,K(j,"onattribute",{name:j.attribName,value:j.attribValue});j.attribName=j.attribValue=""}function me(j,E){if(j.opt.xmlns){var S=j.tag,m=ne(j.tagName);S.prefix=m.prefix,S.local=m.local,S.uri=S.ns[m.prefix]||"",S.prefix&&!S.uri&&(q(j,"Unbound namespace prefix: "+JSON.stringify(j.tagName)),S.uri=m.prefix);var Y=j.tags[j.tags.length-1]||j;S.ns&&Y.ns!==S.ns&&Object.keys(S.ns).forEach(function(A){K(j,"onopennamespace",{prefix:A,uri:S.ns[A]})});for(var R=0,C=j.attribList.length;R",j.tagName="",j.state=J.SCRIPT;return}K(j,"onscript",j.script),j.script=""}var E=j.tags.length,S=j.tagName;j.strict||(S=S[j.looseCase]());for(var m=S;E--;){var Y=j.tags[E];if(Y.name!==m)q(j,"Unexpected close tag");else break}if(E<0){q(j,"Unmatched closing tag: "+j.tagName),j.textNode+="",j.state=J.TEXT;return}j.tagName=S;for(var R=j.tags.length;R-- >E;){var C=j.tag=j.tags.pop();j.tagName=j.tag.name,K(j,"onclosetag",j.tagName);var M={};for(var te in C.ns)M[te]=C.ns[te];var ae=j.tags[j.tags.length-1]||j;j.opt.xmlns&&C.ns!==ae.ns&&Object.keys(C.ns).forEach(function(p){var V=C.ns[p];K(j,"onclosenamespace",{prefix:p,uri:V})})}E===0&&(j.closedRoot=!0),j.tagName=j.attribValue=j.attribName="",j.attribList.length=0,j.state=J.TEXT}function Fe(j){var E=j.entity,S=E.toLowerCase(),m,Y="";return j.ENTITIES[E]?j.ENTITIES[E]:j.ENTITIES[S]?j.ENTITIES[S]:(E=S,E.charAt(0)==="#"&&(E.charAt(1)==="x"?(E=E.slice(2),m=parseInt(E,16),Y=m.toString(16)):(E=E.slice(1),m=parseInt(E,10),Y=m.toString(10))),E=E.replace(/^0+/,""),isNaN(m)||Y.toLowerCase()!==E?(q(j,"Invalid character entity"),"&"+j.entity+";"):String.fromCodePoint(m))}function ce(j,E){E==="<"?(j.state=J.OPEN_WAKA,j.startTagPosition=j.position):X(E)||(q(j,"Non-whitespace before first tag."),j.textNode=E,j.state=J.TEXT)}function fe(j,E){var S="";return E"?(K(E,"onsgmldeclaration",E.sgmlDecl),E.sgmlDecl="",E.state=J.TEXT):(v(m)&&(E.state=J.SGML_DECL_QUOTED),E.sgmlDecl+=m);continue;case J.SGML_DECL_QUOTED:m===E.q&&(E.state=J.SGML_DECL,E.q=""),E.sgmlDecl+=m;continue;case J.DOCTYPE:m===">"?(E.state=J.TEXT,K(E,"ondoctype",E.doctype),E.doctype=!0):(E.doctype+=m,m==="["?E.state=J.DOCTYPE_DTD:v(m)&&(E.state=J.DOCTYPE_QUOTED,E.q=m));continue;case J.DOCTYPE_QUOTED:E.doctype+=m,m===E.q&&(E.q="",E.state=J.DOCTYPE);continue;case J.DOCTYPE_DTD:E.doctype+=m,m==="]"?E.state=J.DOCTYPE:v(m)&&(E.state=J.DOCTYPE_DTD_QUOTED,E.q=m);continue;case J.DOCTYPE_DTD_QUOTED:E.doctype+=m,m===E.q&&(E.state=J.DOCTYPE_DTD,E.q="");continue;case J.COMMENT:m==="-"?E.state=J.COMMENT_ENDING:E.comment+=m;continue;case J.COMMENT_ENDING:m==="-"?(E.state=J.COMMENT_ENDED,E.comment=_(E.opt,E.comment),E.comment&&K(E,"oncomment",E.comment),E.comment=""):(E.comment+="-"+m,E.state=J.COMMENT);continue;case J.COMMENT_ENDED:m!==">"?(q(E,"Malformed comment"),E.comment+="--"+m,E.state=J.COMMENT):E.state=J.TEXT;continue;case J.CDATA:m==="]"?E.state=J.CDATA_ENDING:E.cdata+=m;continue;case J.CDATA_ENDING:m==="]"?E.state=J.CDATA_ENDING_2:(E.cdata+="]"+m,E.state=J.CDATA);continue;case J.CDATA_ENDING_2:m===">"?(E.cdata&&K(E,"oncdata",E.cdata),K(E,"onclosecdata"),E.cdata="",E.state=J.TEXT):m==="]"?E.cdata+="]":(E.cdata+="]]"+m,E.state=J.CDATA);continue;case J.PROC_INST:m==="?"?E.state=J.PROC_INST_ENDING:X(m)?E.state=J.PROC_INST_BODY:E.procInstName+=m;continue;case J.PROC_INST_BODY:if(!E.procInstBody&&X(m))continue;m==="?"?E.state=J.PROC_INST_ENDING:E.procInstBody+=m;continue;case J.PROC_INST_ENDING:m===">"?(K(E,"onprocessinginstruction",{name:E.procInstName,body:E.procInstBody}),E.procInstName=E.procInstBody="",E.state=J.TEXT):(E.procInstBody+="?"+m,E.state=J.PROC_INST_BODY);continue;case J.OPEN_TAG:Q(N,m)?E.tagName+=m:(ee(E),m===">"?me(E):m==="/"?E.state=J.OPEN_TAG_SLASH:(X(m)||q(E,"Invalid character in tag name"),E.state=J.ATTRIB));continue;case J.OPEN_TAG_SLASH:m===">"?(me(E,!0),Ze(E)):(q(E,"Forward-slash in opening tag not followed by >"),E.state=J.ATTRIB);continue;case J.ATTRIB:if(X(m))continue;m===">"?me(E):m==="/"?E.state=J.OPEN_TAG_SLASH:Q(Z,m)?(E.attribName=m,E.attribValue="",E.state=J.ATTRIB_NAME):q(E,"Invalid attribute name");continue;case J.ATTRIB_NAME:m==="="?E.state=J.ATTRIB_VALUE:m===">"?(q(E,"Attribute without value"),E.attribValue=E.attribName,ie(E),me(E)):X(m)?E.state=J.ATTRIB_NAME_SAW_WHITE:Q(N,m)?E.attribName+=m:q(E,"Invalid attribute name");continue;case J.ATTRIB_NAME_SAW_WHITE:if(m==="=")E.state=J.ATTRIB_VALUE;else{if(X(m))continue;q(E,"Attribute without value"),E.tag.attributes[E.attribName]="",E.attribValue="",K(E,"onattribute",{name:E.attribName,value:""}),E.attribName="",m===">"?me(E):Q(Z,m)?(E.attribName=m,E.state=J.ATTRIB_NAME):(q(E,"Invalid attribute name"),E.state=J.ATTRIB)}continue;case J.ATTRIB_VALUE:if(X(m))continue;v(m)?(E.q=m,E.state=J.ATTRIB_VALUE_QUOTED):(q(E,"Unquoted attribute value"),E.state=J.ATTRIB_VALUE_UNQUOTED,E.attribValue=m);continue;case J.ATTRIB_VALUE_QUOTED:if(m!==E.q){m==="&"?E.state=J.ATTRIB_VALUE_ENTITY_Q:E.attribValue+=m;continue}ie(E),E.q="",E.state=J.ATTRIB_VALUE_CLOSED;continue;case J.ATTRIB_VALUE_CLOSED:X(m)?E.state=J.ATTRIB:m===">"?me(E):m==="/"?E.state=J.OPEN_TAG_SLASH:Q(Z,m)?(q(E,"No whitespace between attributes"),E.attribName=m,E.attribValue="",E.state=J.ATTRIB_NAME):q(E,"Invalid attribute name");continue;case J.ATTRIB_VALUE_UNQUOTED:if(!H(m)){m==="&"?E.state=J.ATTRIB_VALUE_ENTITY_U:E.attribValue+=m;continue}ie(E),m===">"?me(E):E.state=J.ATTRIB;continue;case J.CLOSE_TAG:if(E.tagName)m===">"?Ze(E):Q(N,m)?E.tagName+=m:E.script?(E.script+=""?Ze(E):q(E,"Invalid characters in closing tag");continue;case J.TEXT_ENTITY:case J.ATTRIB_VALUE_ENTITY_Q:case J.ATTRIB_VALUE_ENTITY_U:var C,M;switch(E.state){case J.TEXT_ENTITY:C=J.TEXT,M="textNode";break;case J.ATTRIB_VALUE_ENTITY_Q:C=J.ATTRIB_VALUE_QUOTED,M="attribValue";break;case J.ATTRIB_VALUE_ENTITY_U:C=J.ATTRIB_VALUE_UNQUOTED,M="attribValue";break}if(m===";")if(E.opt.unparsedEntities){var te=Fe(E);E.entity="",E.state=C,E.write(te)}else E[M]+=Fe(E),E.entity="",E.state=C;else Q(E.entity.length?y:g,m)?E.entity+=m:(q(E,"Invalid character in entity name"),E[M]+="&"+E.entity+m,E.entity="",E.state=C);continue;default:throw new Error(E,"Unknown state: "+E.state)}return E.position>=E.bufferCheckPosition&&l(E),E}return String.fromCodePoint||function(){var j=String.fromCharCode,E=Math.floor,S=function(){var m=16384,Y=[],R,C,M=-1,te=arguments.length;if(!te)return"";for(var ae="";++M1114111||E(p)!==p)throw RangeError("Invalid code point: "+p);p<=65535?Y.push(p):(p-=65536,R=(p>>10)+55296,C=p%1024+56320,Y.push(R,C)),(M+1===te||Y.length>m)&&(ae+=j.apply(null,Y),Y.length=0)}return ae};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:S,configurable:!0,writable:!0}):String.fromCodePoint=S}(),t},Wot=gjn()});function Xve(t){let e=Rjn(t),n=Wot.parser(!0),l={},I=[];n.onopentag=i=>{let s={name:i.name,attributes:i.attributes,children:[],text:"",isSelfClosing:i.isSelfClosing};I.length>0?I[I.length-1].children.push(s):l=s,i.isSelfClosing||I.push(s)},n.onclosetag=()=>{if(I.length>0){let i=I.pop();I.length===0&&i&&(l=i)}},n.ontext=i=>{if(I.length>0){let s=I[I.length-1];s.text+=i}},n.onattribute=i=>{if(I.length>0){let s=I[I.length-1];s.attributes[i.name]=i.value}};let a=/```(xml)?(.*)```/s.exec(e),c=a?a[2]:e;return n.write(c).close(),l&&l.name==="?xml"&&(l=l.children[0]),Vot(l)}var vve,fve,Rjn,Vot,Yot=B(()=>{q2();NB();Not();vve=`The output should be formatted as a XML file. +1. Output should conform to the tags below. +2. If tags are not given, make them on your own. +3. Remember to always open and close all the tags. + +As an example, for the tags ["foo", "bar", "baz"]: +1. String " + + + +" is a well-formatted instance of the schema. +2. String " + + " is a badly-formatted instance. +3. String " + + +" is a badly-formatted instance. + +Here are the output tags: +\`\`\` +{tags} +\`\`\``,fve=class extends SN{constructor(e){super(e),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","output_parsers"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.tags=e?.tags}static lc_name(){return"XMLOutputParser"}_diff(e,n){if(n)return e?Q2(e,n):[{op:"replace",path:"",value:n}]}async parsePartialResult(e){return Xve(e[0].text)}async parse(e){return Xve(e)}getFormatInstructions(){return!!(this.tags&&this.tags.length>0)?vve.replace("{tags}",this.tags?.join(", ")??""):vve}},Rjn=t=>t.split(` +`).map(e=>e.replace(/^\s+/,"")).join(` +`).trim(),Vot=t=>{if(Object.keys(t).length===0)return{};let e={};return t.children.length>0?(e[t.name]=t.children.map(Vot),e):(e[t.name]=t.text??void 0,e)}});var wve={};Xe(wve,{AsymmetricStructuredOutputParser:()=>yve,BaseCumulativeTransformOutputParser:()=>SN,BaseLLMOutputParser:()=>vo,BaseOutputParser:()=>QI,BaseTransformOutputParser:()=>zZ,BytesOutputParser:()=>Yve,CommaSeparatedListOutputParser:()=>iL,CustomListOutputParser:()=>sL,JsonMarkdownStructuredOutputParser:()=>ite,JsonOutputParser:()=>ng,ListOutputParser:()=>tg,MarkdownListOutputParser:()=>Rve,NumberedListOutputParser:()=>gve,OutputParserException:()=>$t,StringOutputParser:()=>Vh,StructuredOutputParser:()=>Py,XMLOutputParser:()=>fve,XML_FORMAT_INSTRUCTIONS:()=>vve,parseJsonMarkdown:()=>b8,parsePartialJson:()=>LY,parseXMLMarkdown:()=>Xve});var Hve=B(()=>{sQ();mot();pot();hot();Zot();q2();Fve();Yot()});function uQ(t){return t!==void 0&&Array.isArray(t.lc_namespace)}function YB(t){return t!==void 0&&Zn.isRunnable(t)&&"lc_name"in t.constructor&&typeof t.constructor.lc_name=="function"&&t.constructor.lc_name()==="RunnableToolLike"}function gB(t){return!!t&&typeof t=="object"&&"name"in t&&"schema"in t&&(wr(t.schema)||t.schema!=null&&typeof t.schema=="object"&&"type"in t.schema&&typeof t.schema.type=="string"&&["null","boolean","object","array","number","string"].includes(t.schema.type))}function cb(t){return gB(t)||YB(t)||uQ(t)}var ste=B(()=>{Zd();Ly()});var Jve={};Xe(Jve,{BaseToolkit:()=>Yh,DynamicStructuredTool:()=>TN,DynamicTool:()=>MN,StructuredTool:()=>Gm,Tool:()=>$u,ToolInputParsingException:()=>yZ,isLangChainTool:()=>cb,isRunnableToolLike:()=>YB,isStructuredTool:()=>uQ,isStructuredToolParams:()=>gB,tool:()=>yjn});function yjn(t,e){let n=Bz(e.schema),l=X5(e.schema);if(!e.schema||n||l)return new MN({...e,description:e.description??e.schema?.description??`${e.name} tool`,func:async(c,i,s)=>new Promise((r,u)=>{let o=wI(s,{callbacks:i?.getChild()});Ib.runWithConfig(Dm(o),async()=>{try{r(t(c,o))}catch(d){u(d)}})})});let I=e.schema,a=e.description??e.schema.description??`${e.name} tool`;return new TN({...e,description:a,schema:I,func:async(c,i,s)=>new Promise((r,u)=>{let o=wI(s,{callbacks:i?.getChild()});Ib.runWithConfig(Dm(o),async()=>{try{r(t(c,o))}catch(d){u(d)}})})})}function Ajn(t){let{content:e,artifact:n,toolCallId:l}=t;return l&&!_$e(e)?typeof e=="string"||Array.isArray(e)&&e.every(I=>typeof I=="object")?new Oo({content:e,artifact:n,tool_call_id:l,name:t.name}):new Oo({content:Fjn(e),artifact:n,tool_call_id:l,name:t.name}):e}function Fjn(t){try{return JSON.stringify(t,null,2)??""}catch{return`${t}`}}var Gm,$u,MN,TN,Yh,ute=B(()=>{X8();Oz();Qy();aL();HN();c5();y5();V8();Ly();ky();ste();Gm=class extends _2{get lc_namespace(){return["langchain","tools"]}constructor(e){super(e??{}),Object.defineProperty(this,"returnDirect",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"verboseParsingErrors",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"responseFormat",{enumerable:!0,configurable:!0,writable:!0,value:"content"}),this.verboseParsingErrors=e?.verboseParsingErrors??this.verboseParsingErrors,this.responseFormat=e?.responseFormat??this.responseFormat}async invoke(e,n){let l,I=Xl(n);return F2(e)?(l=e.args,I={...I,toolCall:e}):l=e,this.call(l,I)}async call(e,n,l){let I=F2(e)?e.args:e,a;if(wr(this.schema))try{a=await DY(this.schema,I)}catch(h){let Z="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(Z=`${Z} +Details: ${h.message}`),new yZ(Z,JSON.stringify(e))}else{let h=oc(I,this.schema);if(!h.valid){let Z="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(Z=`${Z} +Details: ${h.errors.map(N=>`${N.keywordLocation}: ${N.error}`).join(` +`)}`),new yZ(Z,JSON.stringify(e))}a=I}let c=Hy(n),s=await Lr.configure(c.callbacks,this.callbacks,c.tags||l,this.tags,c.metadata,this.metadata,{verbose:this.verbose})?.handleToolStart(this.toJSON(),typeof e=="string"?e:JSON.stringify(e),c.runId,void 0,void 0,void 0,c.runName);delete c.runId;let r;try{r=await this._call(a,s,c)}catch(h){throw await s?.handleToolError(h),h}let u,o;if(this.responseFormat==="content_and_artifact")if(Array.isArray(r)&&r.length===2)[u,o]=r;else throw new Error(`Tool response format is "content_and_artifact" but the output was not a two-tuple. +Result: ${JSON.stringify(r)}`);else u=r;let d;F2(e)&&(d=e.id),!d&&$$e(c)&&(d=c.toolCall.id);let b=Ajn({content:u,artifact:o,toolCallId:d,name:this.name});return await s?.handleToolEnd(b),b}},$u=class extends Gm{constructor(e){super(e),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:St.object({input:St.string().optional()}).transform(n=>n.input)})}call(e,n){let l=typeof e=="string"||e==null?{input:e}:e;return super.call(l,n)}},MN=class extends $u{static lc_name(){return"DynamicTool"}constructor(e){super(e),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,"func",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect}async call(e,n){let l=Hy(n);return l.runName===void 0&&(l.runName=this.name),super.call(e,l)}async _call(e,n,l){return this.func(e,n,l)}},TN=class extends Gm{static lc_name(){return"DynamicStructuredTool"}constructor(e){super(e),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,"func",{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.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect,this.schema=e.schema}async call(e,n,l){let I=Hy(n);return I.runName===void 0&&(I.runName=this.name),super.call(e,I,l)}_call(e,n,l){return this.func(e,n,l)}},Yh=class{getTools(){return this.tools}}});var xve={};Xe(xve,{chunkArray:()=>BZ});var BZ,jve=B(()=>{BZ=(t,e)=>t.reduce((n,l,I)=>{let a=Math.floor(I/e),c=n[a]||[];return n[a]=c.concat([l]),n},[])});var Ove={};Xe(Ove,{convertToOpenAIFunction:()=>SZ,convertToOpenAITool:()=>$2,isLangChainTool:()=>cb,isRunnableToolLike:()=>YB,isStructuredTool:()=>uQ,isStructuredToolParams:()=>gB});function SZ(t,e){let n=typeof e=="number"?void 0:e;return{name:t.name,description:t.description,parameters:Wl(t.schema),...n?.strict!==void 0?{strict:n.strict}:{}}}function $2(t,e){let n=typeof e=="number"?void 0:e,l;return cb(t)?l={type:"function",function:SZ(t)}:l=t,n?.strict!==void 0&&(l.function.strict=n.strict),l}var Uve=B(()=>{ste();ky();ste()});var Tve={};Xe(Tve,{extendInteropZodObject:()=>ELn,getInteropZodDefaultGetter:()=>CLn,getInteropZodObjectShape:()=>QLn,getSchemaDescription:()=>zz,interopParse:()=>XLn,interopParseAsync:()=>DY,interopSafeParse:()=>fLn,interopSafeParseAsync:()=>Cy,interopZodObjectPartial:()=>JLn,interopZodObjectPassthrough:()=>wFe,interopZodObjectStrict:()=>Uz,interopZodTransformInputSchema:()=>DH,isInteropZodObject:()=>HLn,isInteropZodSchema:()=>wr,isShapelessZodSchema:()=>wLn,isSimpleStringZodSchema:()=>Bz,isZodArrayV4:()=>lee,isZodObjectV3:()=>HFe,isZodObjectV4:()=>LN,isZodSchema:()=>vLn,isZodSchemaV3:()=>qu,isZodSchemaV4:()=>ei});var Dve=B(()=>{Ly()});var dQ=B(()=>{sh()});var Bo=B(()=>{ote()});var DN=B(()=>{aL()});var gh=B(()=>{Ey()});var _ve=B(()=>{Qy()});function Pve(t,e){let n=new Set;for(let l of e)t.has(l)&&n.add(l);return n}function fot(t,e){let n=new Set(t);for(let l of e)n.add(l);return n}function FB(t,e){let n=new Set(t);for(let l of e)n.delete(l);return n}var Xot=B(()=>{});var qve={};Xe(qve,{SequentialChain:()=>nv,SimpleSequentialChain:()=>dL});function vB(t){return Array.from(t).map(e=>`"${e}"`).join(", ")}var nv,dL,fB=B(()=>{fo();Xot();nv=class t extends cn{static lc_name(){return"SequentialChain"}get inputKeys(){return this.inputVariables}get outputKeys(){return this.outputVariables}constructor(e){if(super(e),Object.defineProperty(this,"chains",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnAll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.chains=e.chains,this.inputVariables=e.inputVariables,this.outputVariables=e.outputVariables??[],this.outputVariables.length>0&&e.returnAll)throw new Error("Either specify variables to return using `outputVariables` or use `returnAll` param. Cannot apply both conditions at the same time.");this.returnAll=e.returnAll??!1,this._validateChains()}_validateChains(){if(this.chains.length===0)throw new Error("Sequential chain must have at least one chain.");let e=this.memory?.memoryKeys??[],n=new Set(this.inputKeys),l=new Set(e),I=Pve(n,l);if(I.size>0)throw new Error(`The following keys: ${vB(I)} are overlapping between memory and input keys of the chain variables. This can lead to unexpected behaviour. Please use input and memory keys that don't overlap.`);let a=fot(n,l);for(let c of this.chains){let i=FB(new Set(c.inputKeys),a);if(c.memory&&(i=FB(i,new Set(c.memory.memoryKeys))),i.size>0)throw new Error(`Missing variables for chain "${c._chainType()}": ${vB(i)}. Only got the following variables: ${vB(a)}.`);let s=new Set(c.outputKeys),r=Pve(a,s);if(r.size>0)throw new Error(`The following output variables for chain "${c._chainType()}" are overlapping: ${vB(r)}. This can lead to unexpected behaviour.`);for(let u of s)a.add(u)}if(this.outputVariables.length===0)if(this.returnAll){let c=FB(a,n);this.outputVariables=Array.from(c)}else this.outputVariables=this.chains[this.chains.length-1].outputKeys;else{let c=FB(new Set(this.outputVariables),new Set(a));if(c.size>0)throw new Error(`The following output variables were expected to be in the final chain output but were not found: ${vB(c)}.`)}}async _call(e,n){let l={},I=e,a=0;for(let i of this.chains){a+=1,l=await i.call(I,n?.getChild(`step_${a}`));for(let s of Object.keys(l))I[s]=l[s]}let c={};for(let i of this.outputVariables)c[i]=I[i];return c}_chainType(){return"sequential_chain"}static async deserialize(e){let n=[],l=e.input_variables,I=e.output_variables,a=e.chains;for(let c of a){let i=await cn.deserialize(c);n.push(i)}return new t({chains:n,inputVariables:l,outputVariables:I})}serialize(){let e=[];for(let n of this.chains)e.push(n.serialize());return{_type:this._chainType(),input_variables:this.inputVariables,output_variables:this.outputVariables,chains:e}}},dL=class t extends cn{static lc_name(){return"SimpleSequentialChain"}get inputKeys(){return[this.inputKey]}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"chains",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output"}),Object.defineProperty(this,"trimOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.chains=e.chains,this.trimOutputs=e.trimOutputs??!1,this._validateChains()}_validateChains(){for(let e of this.chains){if(e.inputKeys.filter(n=>!e.memory?.memoryKeys.includes(n)).length!==1)throw new Error(`Chains used in SimpleSequentialChain should all have one input, got ${e.inputKeys.length} for ${e._chainType()}.`);if(e.outputKeys.length!==1)throw new Error(`Chains used in SimpleSequentialChain should all have one output, got ${e.outputKeys.length} for ${e._chainType()}.`)}}async _call(e,n){let l=e[this.inputKey],I=0;for(let a of this.chains)I+=1,l=(await a.call({[a.inputKeys[0]]:l,signal:e.signal},n?.getChild(`step_${I}`)))[a.outputKeys[0]],this.trimOutputs&&(l=l.trim()),await n?.handleText(l);return{[this.outputKey]:l}}_chainType(){return"simple_sequential_chain"}static async deserialize(e){let n=[],l=e.chains;for(let I of l){let a=await cn.deserialize(I);n.push(a)}return new t({chains:n})}serialize(){let e=[];for(let n of this.chains)e.push(n.serialize());return{_type:this._chainType(),chains:e}}}});var Qte={};Xe(Qte,{MapReduceDocumentsChain:()=>lg,RefineDocumentsChain:()=>Ig,StuffDocumentsChain:()=>Rh});var Rh,lg,Ig,GQ=B(()=>{yn();fo();Dl();Rh=class t extends cn{static lc_name(){return"StuffDocumentsChain"}get inputKeys(){return[this.inputKey,...this.llmChain.inputKeys].filter(e=>e!==this.documentVariableName)}get outputKeys(){return this.llmChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),this.llmChain=e.llmChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey}_prepInputs(e){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);let{[this.inputKey]:n,...l}=e,a=n.map(({pageContent:c})=>c).join(` + +`);return{...l,[this.documentVariableName]:a}}async _call(e,n){return await this.llmChain.call(this._prepInputs(e),n?.getChild("combine_documents"))}_chainType(){return"stuff_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");return new t({llmChain:await ze.deserialize(e.llm_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize()}}},lg=class t extends cn{static lc_name(){return"MapReduceDocumentsChain"}get inputKeys(){return[this.inputKey,...this.combineDocumentChain.inputKeys]}get outputKeys(){return this.combineDocumentChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"returnIntermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"maxIterations",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"ensureMapStep",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"combineDocumentChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmChain=e.llmChain,this.combineDocumentChain=e.combineDocumentChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.ensureMapStep=e.ensureMapStep??this.ensureMapStep,this.inputKey=e.inputKey??this.inputKey,this.maxTokens=e.maxTokens??this.maxTokens,this.maxIterations=e.maxIterations??this.maxIterations,this.returnIntermediateSteps=e.returnIntermediateSteps??!1}async _call(e,n){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);let{[this.inputKey]:l,...I}=e,a=l,c=[];for(let r=0;r({[this.documentVariableName]:h.pageContent,...I}));if(r!==0||!this.ensureMapStep){let h=await this.combineDocumentChain.llmChain.prompt.format(this.combineDocumentChain._prepInputs({[this.combineDocumentChain.inputKey]:a,...I}));if(await this.combineDocumentChain.llmChain._getNumTokens(h)n.getChild(`map_${Z+1}`)):void 0),{outputKey:b}=this.llmChain;this.returnIntermediateSteps&&(c=c.concat(d.map(h=>h[b]))),a=d.map(h=>({pageContent:h[b],metadata:{}}))}let i={[this.combineDocumentChain.inputKey]:a,...I},s=await this.combineDocumentChain.call(i,n?.getChild("combine_documents"));return this.returnIntermediateSteps?{...s,intermediateSteps:c}:s}_chainType(){return"map_reduce_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");if(!e.combine_document_chain)throw new Error("Missing combine_document_chain");return new t({llmChain:await ze.deserialize(e.llm_chain),combineDocumentChain:await Rh.deserialize(e.combine_document_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),combine_document_chain:this.combineDocumentChain.serialize()}}},Ig=class t extends cn{static lc_name(){return"RefineDocumentsChain"}get defaultDocumentPrompt(){return new xe({inputVariables:["page_content"],template:"{page_content}"})}get inputKeys(){return[...new Set([this.inputKey,...this.llmChain.inputKeys,...this.refineLLMChain.inputKeys])].filter(e=>e!==this.documentVariableName&&e!==this.initialResponseName)}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output_text"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"initialResponseName",{enumerable:!0,configurable:!0,writable:!0,value:"existing_answer"}),Object.defineProperty(this,"refineLLMChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"documentPrompt",{enumerable:!0,configurable:!0,writable:!0,value:this.defaultDocumentPrompt}),this.llmChain=e.llmChain,this.refineLLMChain=e.refineLLMChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.documentPrompt=e.documentPrompt??this.documentPrompt,this.initialResponseName=e.initialResponseName??this.initialResponseName}async _constructInitialInputs(e,n){let l={page_content:e.pageContent,...e.metadata},I={};return this.documentPrompt.inputVariables.forEach(i=>{I[i]=l[i]}),{...{[this.documentVariableName]:await this.documentPrompt.format({...I})},...n}}async _constructRefineInputs(e,n){let l={page_content:e.pageContent,...e.metadata},I={};this.documentPrompt.inputVariables.forEach(i=>{I[i]=l[i]});let a={[this.documentVariableName]:await this.documentPrompt.format({...I})};return{[this.initialResponseName]:n,...a}}async _call(e,n){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);let{[this.inputKey]:l,...I}=e,a=l,c=await this._constructInitialInputs(a[0],I),i=await this.llmChain.predict({...c},n?.getChild("answer")),s=[i];for(let r=1;r{cve()});var Qjn,Ejn,Jjn,Cjn,wot,Hot=B(()=>{yn();Ete();Qjn=new xe({template:`Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. + +{context} + +Question: {question} +Helpful Answer:`,inputVariables:["context","question"]}),Ejn=`Use the following pieces of context to answer the users question. +If you don't know the answer, just say that you don't know, don't try to make up an answer. +---------------- +{context}`,Jjn=[kr.fromTemplate(Ejn),RI.fromTemplate("{question}")],Cjn=HI.fromMessages(Jjn),wot=new zN(Qjn,[[Dy,Cjn]])});var Ljn,kjn,xjn,jjn,Ojn,Qot,Ujn,zjn,Bjn,Sjn,Mjn,Eot,Jot=B(()=>{yn();Ete();Ljn=`Use the following portion of a long document to see if any of the text is relevant to answer the question. +Return any relevant text verbatim. +{context} +Question: {question} +Relevant text, if any:`,kjn=xe.fromTemplate(Ljn),xjn=`Use the following portion of a long document to see if any of the text is relevant to answer the question. +Return any relevant text verbatim. +---------------- +{context}`,jjn=[kr.fromTemplate(xjn),RI.fromTemplate("{question}")],Ojn=HI.fromMessages(jjn),Qot=new zN(kjn,[[Dy,Ojn]]),Ujn=`Given the following extracted parts of a long document and a question, create a final answer. +If you don't know the answer, just say that you don't know. Don't try to make up an answer. + +QUESTION: Which state/country's law governs the interpretation of the contract? +========= +Content: This Agreement is governed by English law and the parties submit to the exclusive jurisdiction of the English courts in relation to any dispute (contractual or non-contractual) concerning this Agreement save that either party may apply to any court for an injunction or other relief to protect its Intellectual Property Rights. + +Content: No Waiver. Failure or delay in exercising any right or remedy under this Agreement shall not constitute a waiver of such (or any other) right or remedy. + +11.7 Severability. The invalidity, illegality or unenforceability of any term (or part of a term) of this Agreement shall not affect the continuation in force of the remainder of the term (if any) and this Agreement. + +11.8 No Agency. Except as expressly stated otherwise, nothing in this Agreement shall create an agency, partnership or joint venture of any kind between the parties. + +11.9 No Third-Party Beneficiaries. + +Content: (b) if Google believes, in good faith, that the Distributor has violated or caused Google to violate any Anti-Bribery Laws (as defined in Clause 8.5) or that such a violation is reasonably likely to occur, +========= +FINAL ANSWER: This Agreement is governed by English law. + +QUESTION: What did the president say about Michael Jackson? +========= +Content: Madam Speaker, Madam Vice President, our First Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans. + +Last year COVID-19 kept us apart. This year we are finally together again. + +Tonight, we meet as Democrats Republicans and Independents. But most importantly as Americans. + +With a duty to one another to the American people to the Constitution. + +And with an unwavering resolve that freedom will always triumph over tyranny. + +Six days ago, Russia\u2019s Vladimir Putin sought to shake the foundations of the free world thinking he could make it bend to his menacing ways. But he badly miscalculated. + +He thought he could roll into Ukraine and the world would roll over. Instead he met a wall of strength he never imagined. + +He met the Ukrainian people. + +From President Zelenskyy to every Ukrainian, their fearlessness, their courage, their determination, inspires the world. + +Groups of citizens blocking tanks with their bodies. Everyone from students to retirees teachers turned soldiers defending their homeland. + +Content: And we won\u2019t stop. + +We have lost so much to COVID-19. Time with one another. And worst of all, so much loss of life. + +Let\u2019s use this moment to reset. Let\u2019s stop looking at COVID-19 as a partisan dividing line and see it for what it is: A God-awful disease. + +Let\u2019s stop seeing each other as enemies, and start seeing each other for who we really are: Fellow Americans. + +We can\u2019t change how divided we\u2019ve been. But we can change how we move forward\u2014on COVID-19 and other issues we must face together. + +I recently visited the New York City Police Department days after the funerals of Officer Wilbert Mora and his partner, Officer Jason Rivera. + +They were responding to a 9-1-1 call when a man shot and killed them with a stolen gun. + +Officer Mora was 27 years old. + +Officer Rivera was 22. + +Both Dominican Americans who\u2019d grown up on the same streets they later chose to patrol as police officers. + +I spoke with their families and told them that we are forever in debt for their sacrifice, and we will carry on their mission to restore the trust and safety every community deserves. + +Content: And a proud Ukrainian people, who have known 30 years of independence, have repeatedly shown that they will not tolerate anyone who tries to take their country backwards. + +To all Americans, I will be honest with you, as I\u2019ve always promised. A Russian dictator, invading a foreign country, has costs around the world. + +And I\u2019m taking robust action to make sure the pain of our sanctions is targeted at Russia\u2019s economy. And I will use every tool at our disposal to protect American businesses and consumers. + +Tonight, I can announce that the United States has worked with 30 other countries to release 60 Million barrels of oil from reserves around the world. + +America will lead that effort, releasing 30 Million barrels from our own Strategic Petroleum Reserve. And we stand ready to do more if necessary, unified with our allies. + +These steps will help blunt gas prices here at home. And I know the news about what\u2019s happening can seem alarming. + +But I want you to know that we are going to be okay. + +Content: More support for patients and families. + +To get there, I call on Congress to fund ARPA-H, the Advanced Research Projects Agency for Health. + +It\u2019s based on DARPA\u2014the Defense Department project that led to the Internet, GPS, and so much more. + +ARPA-H will have a singular purpose\u2014to drive breakthroughs in cancer, Alzheimer\u2019s, diabetes, and more. + +A unity agenda for the nation. + +We can do this. + +My fellow Americans\u2014tonight , we have gathered in a sacred space\u2014the citadel of our democracy. + +In this Capitol, generation after generation, Americans have debated great questions amid great strife, and have done great things. + +We have fought for freedom, expanded liberty, defeated totalitarianism and terror. + +And built the strongest, freest, and most prosperous nation the world has ever known. + +Now is the hour. + +Our moment of responsibility. + +Our test of resolve and conscience, of history itself. + +It is in this moment that our character is formed. Our purpose is found. Our future is forged. + +Well I know this nation. +========= +FINAL ANSWER: The president did not mention Michael Jackson. + +QUESTION: {question} +========= +{summaries} +========= +FINAL ANSWER:`,zjn=xe.fromTemplate(Ujn),Bjn=`Given the following extracted parts of a long document and a question, create a final answer. +If you don't know the answer, just say that you don't know. Don't try to make up an answer. +---------------- +{summaries}`,Sjn=[kr.fromTemplate(Bjn),RI.fromTemplate("{question}")],Mjn=HI.fromMessages(Sjn),Eot=new zN(zjn,[[Dy,Mjn]])});var Tjn,Djn,Kjn,_jn,Pjn,Cot,qjn,$jn,eOn,tOn,nOn,Lot,kot=B(()=>{yn();Ete();Tjn=`The original question is as follows: {question} +We have provided an existing answer: {existing_answer} +We have the opportunity to refine the existing answer +(only if needed) with some more context below. +------------ +{context} +------------ +Given the new context, refine the original answer to better answer the question. +If the context isn't useful, return the original answer.`,Djn=new xe({inputVariables:["question","existing_answer","context"],template:Tjn}),Kjn=`The original question is as follows: {question} +We have provided an existing answer: {existing_answer} +We have the opportunity to refine the existing answer +(only if needed) with some more context below. +------------ +{context} +------------ +Given the new context, refine the original answer to better answer the question. +If the context isn't useful, return the original answer.`,_jn=[RI.fromTemplate("{question}"),Zh.fromTemplate("{existing_answer}"),RI.fromTemplate(Kjn)],Pjn=HI.fromMessages(_jn),Cot=new zN(Djn,[[Dy,Pjn]]),qjn=`Context information is below. +--------------------- +{context} +--------------------- +Given the context information and no prior knowledge, answer the question: {question}`,$jn=new xe({inputVariables:["context","question"],template:qjn}),eOn=`Context information is below. +--------------------- +{context} +--------------------- +Given the context information and no prior knowledge, answer any questions`,tOn=[kr.fromTemplate(eOn),RI.fromTemplate("{question}")],nOn=HI.fromMessages(tOn),Lot=new zN($jn,[[Dy,nOn]])});function ag(t,e={}){let{prompt:n=wot.getPrompt(t),verbose:l}=e,I=new ze({prompt:n,llm:t,verbose:l});return new Rh({llmChain:I,verbose:l})}function Jte(t,e={}){let{combineMapPrompt:n=Qot.getPrompt(t),combinePrompt:l=Eot.getPrompt(t),verbose:I,combineLLM:a,returnIntermediateSteps:c}=e,i=new ze({prompt:n,llm:t,verbose:I}),s=new ze({prompt:l,llm:a??t,verbose:I}),r=new Rh({llmChain:s,documentVariableName:"summaries",verbose:I});return new lg({llmChain:i,combineDocumentChain:r,returnIntermediateSteps:c,verbose:I})}function Cte(t,e={}){let{questionPrompt:n=Lot.getPrompt(t),refinePrompt:l=Cot.getPrompt(t),refineLLM:I,verbose:a}=e,c=new ze({prompt:n,llm:t,verbose:a}),i=new ze({prompt:l,llm:I??t,verbose:a});return new Ig({llmChain:c,refineLLMChain:i,verbose:a})}var XB,GL=B(()=>{Dl();GQ();Hot();Jot();kot();XB=(t,e={type:"stuff"})=>{let{type:n}=e;if(n==="stuff")return ag(t,e);if(n==="map_reduce")return Jte(t,e);if(n==="refine")return Cte(t,e);throw new Error(`Invalid _type: ${n}`)}});var xot={};Xe(xot,{VectorDBQAChain:()=>lv});var lv,Lte=B(()=>{fo();GL();lv=class t extends cn{static lc_name(){return"VectorDBQAChain"}get inputKeys(){return[this.inputKey]}get outputKeys(){return this.combineDocumentsChain.outputKeys.concat(this.returnSourceDocuments?["sourceDocuments"]:[])}constructor(e){super(e),Object.defineProperty(this,"k",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"query"}),Object.defineProperty(this,"vectorstore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"combineDocumentsChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnSourceDocuments",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.vectorstore=e.vectorstore,this.combineDocumentsChain=e.combineDocumentsChain,this.inputKey=e.inputKey??this.inputKey,this.k=e.k??this.k,this.returnSourceDocuments=e.returnSourceDocuments??this.returnSourceDocuments}async _call(e,n){if(!(this.inputKey in e))throw new Error(`Question key ${this.inputKey} not found.`);let l=e[this.inputKey],I=await this.vectorstore.similaritySearch(l,this.k,e.filter,n?.getChild("vectorstore")),a={question:l,input_documents:I},c=await this.combineDocumentsChain.call(a,n?.getChild("combine_documents"));return this.returnSourceDocuments?{...c,sourceDocuments:I}:c}_chainType(){return"vector_db_qa"}static async deserialize(e,n){if(!("vectorstore"in n))throw new Error("Need to pass in a vectorstore to deserialize VectorDBQAChain");let{vectorstore:l}=n;if(!e.combine_documents_chain)throw new Error("VectorDBQAChain must have combine_documents_chain in serialized data");return new t({combineDocumentsChain:await cn.deserialize(e.combine_documents_chain),k:e.k,vectorstore:l})}serialize(){return{_type:this._chainType(),combine_documents_chain:this.combineDocumentsChain.serialize(),k:this.k}}static fromLLM(e,n,l){let I=ag(e);return new this({vectorstore:n,combineDocumentsChain:I,...l})}}});var jot,Oot,lOn,Uot,zot=B(()=>{yn();jot=`You are given the below API Documentation: +{api_docs} +Using this documentation, generate the full API url to call for answering the user question. +You should build the API url in order to get a response that is as short as possible, while still getting the necessary information to answer the question. Pay attention to deliberately exclude any unnecessary pieces of data in the API call. + +Question:{question} +API url:`,Oot=new xe({inputVariables:["api_docs","question"],template:jot}),lOn=`${jot} {api_url} + +Here is the response from the API: + +{api_response} + +Summarize this response to answer the original question. + +Summary:`,Uot=new xe({inputVariables:["api_docs","question","api_url","api_response"],template:lOn})});var Bot={};Xe(Bot,{APIChain:()=>bL});var bL,$ve=B(()=>{fo();Dl();zot();bL=class t extends cn{get inputKeys(){return[this.inputKey]}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"apiAnswerChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiRequestChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"question"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output"}),this.apiRequestChain=e.apiRequestChain,this.apiAnswerChain=e.apiAnswerChain,this.apiDocs=e.apiDocs,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.headers=e.headers??this.headers}async _call(e,n){let l=e[this.inputKey],I=await this.apiRequestChain.predict({question:l,api_docs:this.apiDocs},n?.getChild("request")),c=await(await fetch(I,{headers:this.headers})).text(),i=await this.apiAnswerChain.predict({question:l,api_docs:this.apiDocs,api_url:I,api_response:c},n?.getChild("response"));return{[this.outputKey]:i}}_chainType(){return"api_chain"}static async deserialize(e){let{api_request_chain:n,api_answer_chain:l,api_docs:I}=e;if(!n)throw new Error("LLMChain must have api_request_chain");if(!l)throw new Error("LLMChain must have api_answer_chain");if(!I)throw new Error("LLMChain must have api_docs");return new t({apiAnswerChain:await ze.deserialize(l),apiRequestChain:await ze.deserialize(n),apiDocs:I})}serialize(){return{_type:this._chainType(),api_answer_chain:this.apiAnswerChain.serialize(),api_request_chain:this.apiRequestChain.serialize(),api_docs:this.apiDocs}}static fromLLMAndAPIDocs(e,n,l={}){let{apiUrlPrompt:I=Oot,apiResponsePrompt:a=Uot}=l,c=new ze({prompt:I,llm:e}),i=new ze({prompt:a,llm:e});return new this({apiAnswerChain:i,apiRequestChain:c,apiDocs:n,...l})}}});var cn,fo=B(()=>{gh();_ve();Bo();DN();cn=class extends _2{get lc_namespace(){return["langchain","chains",this._chainType()]}constructor(e,n,l){if(arguments.length===1&&typeof e=="object"&&!("saveContext"in e)){let{memory:I,callbackManager:a,...c}=e;super({...c,callbacks:a??c.callbacks}),this.memory=I}else super({verbose:n,callbacks:l}),this.memory=e}_selectMemoryInputs(e){let n={...e};return"signal"in n&&delete n.signal,"timeout"in n&&delete n.timeout,n}async invoke(e,n){let l=Xl(n),I=await this._formatValues(e),c=await(await Lr.configure(l?.callbacks,this.callbacks,l?.tags,this.tags,l?.metadata,this.metadata,{verbose:this.verbose}))?.handleChainStart(this.toJSON(),I,void 0,void 0,void 0,void 0,l?.runName),i;try{i=await(I.signal?Promise.race([this._call(I,c,l),new Promise((s,r)=>{I.signal?.addEventListener("abort",()=>{r(new Error("AbortError"))})})]):this._call(I,c,l))}catch(s){throw await c?.handleChainError(s),s}return this.memory!=null&&await this.memory.saveContext(this._selectMemoryInputs(e),i),await c?.handleChainEnd(i),Object.defineProperty(i,cc,{value:c?{runId:c?.runId}:void 0,configurable:!0}),i}_validateOutputs(e){let n=this.outputKeys.filter(l=>!(l in e));if(n.length)throw new Error(`Missing output keys: ${n.join(", ")} from chain ${this._chainType()}`)}async prepOutputs(e,n,l=!1){return this._validateOutputs(n),this.memory&&await this.memory.saveContext(e,n),l?n:{...e,...n}}serialize(){throw new Error("Method not implemented.")}async run(e,n){let l=this.inputKeys.filter(s=>!this.memory?.memoryKeys.includes(s));if(!(l.length<=1))throw new Error(`Chain ${this._chainType()} expects multiple inputs, cannot use 'run' `);let a=l.length?{[l[0]]:e}:{},c=await this.call(a,n),i=Object.keys(c);if(i.length===1)return c[i[0]];throw new Error("return values have multiple keys, `run` only supported when one key currently")}async _formatValues(e){let n={...e};if(n.timeout&&!n.signal&&(n.signal=AbortSignal.timeout(n.timeout),delete n.timeout),this.memory!=null){let l=await this.memory.loadMemoryVariables(this._selectMemoryInputs(e));for(let[I,a]of Object.entries(l))n[I]=a}return n}async call(e,n,l){let I={tags:l,...Hy(n)};return this.invoke(e,I)}async apply(e,n){return Promise.all(e.map(async(l,I)=>this.call(l,n?.[I])))}static async deserialize(e,n={}){switch(e._type){case"llm_chain":{let{LLMChain:l}=await Promise.resolve().then(()=>(Dl(),Sot));return l.deserialize(e)}case"sequential_chain":{let{SequentialChain:l}=await Promise.resolve().then(()=>(fB(),qve));return l.deserialize(e)}case"simple_sequential_chain":{let{SimpleSequentialChain:l}=await Promise.resolve().then(()=>(fB(),qve));return l.deserialize(e)}case"stuff_documents_chain":{let{StuffDocumentsChain:l}=await Promise.resolve().then(()=>(GQ(),Qte));return l.deserialize(e)}case"map_reduce_documents_chain":{let{MapReduceDocumentsChain:l}=await Promise.resolve().then(()=>(GQ(),Qte));return l.deserialize(e)}case"refine_documents_chain":{let{RefineDocumentsChain:l}=await Promise.resolve().then(()=>(GQ(),Qte));return l.deserialize(e)}case"vector_db_qa":{let{VectorDBQAChain:l}=await Promise.resolve().then(()=>(Lte(),xot));return l.deserialize(e,n)}case"api_chain":{let{APIChain:l}=await Promise.resolve().then(()=>($ve(),Bot));return l.deserialize(e)}default:throw new Error(`Invalid prompt type in config: ${e._type}`)}}}});var Ul=B(()=>{Hve()});var kte,Mot=B(()=>{Ul();kte=class extends QI{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","output_parsers","default"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0})}static lc_name(){return"NoOpOutputParser"}parse(e){return Promise.resolve(e)}getFormatInstructions(){return""}}});var Sot={};Xe(Sot,{LLMChain:()=>ze});function IOn(t){return typeof t._llmType=="function"}function xte(t){if(IOn(t))return t;if("bound"in t&&Zn.isRunnable(t.bound))return xte(t.bound);if("runnable"in t&&"fallbacks"in t&&Zn.isRunnable(t.runnable))return xte(t.runnable);if("default"in t&&Zn.isRunnable(t.default))return xte(t.default);throw new Error("Unable to extract BaseLanguageModel from llmLike object.")}var ze,Dl=B(()=>{DN();yn();Bo();fo();Mot();ze=class t extends cn{static lc_name(){return"LLMChain"}get inputKeys(){return this.prompt.inputVariables}get outputKeys(){return[this.outputKey]}constructor(e){if(super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"prompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"llm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"llmKwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"text"}),Object.defineProperty(this,"outputParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.prompt=e.prompt,this.llm=e.llm,this.llmKwargs=e.llmKwargs,this.outputKey=e.outputKey??this.outputKey,this.outputParser=e.outputParser??new kte,this.prompt.outputParser){if(e.outputParser)throw new Error("Cannot set both outputParser and prompt.outputParser");this.outputParser=this.prompt.outputParser}}getCallKeys(){return"callKeys"in this.llm?this.llm.callKeys:[]}_selectMemoryInputs(e){let n=super._selectMemoryInputs(e),l=this.getCallKeys();for(let I of l)I in e&&delete n[I];return n}async _getFinalOutput(e,n,l){let I;return this.outputParser?I=await this.outputParser.parseResultWithPrompt(e,n,l?.getChild()):I=e[0].text,I}call(e,n){return super.call(e,n)}async _call(e,n){let l={...e},I={...this.llmKwargs},a=this.getCallKeys();for(let r of a)r in e&&I&&(I[r]=e[r],delete l[r]);let c=await this.prompt.formatPromptValue(l);if("generatePrompt"in this.llm){let{generations:r}=await this.llm.generatePrompt([c],I,n?.getChild());return{[this.outputKey]:await this._getFinalOutput(r[0],c,n)}}let s=await(this.outputParser?this.llm.pipe(this.outputParser):this.llm).invoke(c,n?.getChild());return{[this.outputKey]:s}}async predict(e,n){return(await this.call(e,n))[this.outputKey]}_chainType(){return"llm"}static async deserialize(e){let{llm:n,prompt:l}=e;if(!n)throw new Error("LLMChain must have llm");if(!l)throw new Error("LLMChain must have prompt");return new t({llm:await Ky.deserialize(n),prompt:await ph.deserialize(l)})}serialize(){let e="serialize"in this.llm?this.llm.serialize():void 0;return{_type:`${this._chainType()}_chain`,llm:e,prompt:this.prompt.serialize()}}_getNumTokens(e){return xte(this.llm).getNumTokens(e)}}});var Tot,Dot=B(()=>{Dl();Tot=async(t,e,n,l,I)=>{if(n.load_from_llm_and_tools){if(!t)throw new Error("Loading from llm and tools, llm must be provided.");if(!e)throw new Error("Loading from llm and tools, tools must be provided.");return l(t,e,n)}if(!n.llm_chain)throw new Error("Loading from constructor, llm_chain must be provided.");let a=await ze.deserialize(n.llm_chain);return I({...n,llmChain:a})}});var li,mL,KN=B(()=>{Ul();li=class extends QI{},mL=class extends QI{}});var Kot,jte,wB,Ote=B(()=>{Kot="Answer the following questions as best you can. You have access to the following tools:",jte=`Use the following format in your response: + +Question: the input question you must answer +Thought: you should always think about what to do +Action: the action to take, should be one of [{tool_names}] +Action Input: the input to the action +Observation: the result of the action +... (this Thought/Action/Action Input/Observation can repeat N times) +Thought: I now know the final answer +Final Answer: the final answer to the original input question`,wB=`Begin! + +Question: {input} +Thought:{agent_scratchpad}`});var aOn,pL,efe=B(()=>{Ul();KN();Ote();aOn="Final Answer:",pL=class extends li{constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","mrkl"]}),Object.defineProperty(this,"finishToolName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.finishToolName=e?.finishToolName||aOn}async parse(e){if(e.includes(this.finishToolName)){let l=e.split(this.finishToolName);return{returnValues:{output:l[l.length-1].trim()},log:e}}let n=/Action:([\s\S]*?)(?:\nAction Input:([\s\S]*?))?$/.exec(e);if(!n)throw new $t(`Could not parse LLM output: ${e}`);return{tool:n[1].trim(),toolInput:n[2]?n[2].trim().replace(/^("+)(.*?)(\1)$/,"$2"):"",log:e}}getFormatInstructions(){return jte}}});var _ot={};Xe(_ot,{ZeroShotAgent:()=>ed});var ed,bQ=B(()=>{yn();Dl();TZ();Dot();efe();Ote();ed=class t extends $m{static lc_name(){return"ZeroShotAgent"}constructor(e){let n=e?.outputParser??t.getDefaultOutputParser();super({...e,outputParser:n}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","mrkl"]})}_agentType(){return"zero-shot-react-description"}observationPrefix(){return"Observation: "}llmPrefix(){return"Thought:"}static getDefaultOutputParser(e){return new pL(e)}static validateTools(e){let n=e.find(l=>!l.description);if(n){let l=`Got a tool ${n.name} without a description. This agent requires descriptions for all tools.`;throw new Error(l)}}static createPrompt(e,n){let{prefix:l=Kot,suffix:I=wB,inputVariables:a=["input","agent_scratchpad"]}=n??{},c=e.map(u=>`${u.name}: ${u.description}`).join(` +`),i=e.map(u=>`"${u.name}"`).join(", "),s=Ja(jte,"f-string",{tool_names:i}),r=[l,c,s,I].join(` + +`);return new xe({template:r,inputVariables:a})}static fromLLMAndTools(e,n,l){t.validateTools(n);let I=t.createPrompt(n,l),a=l?.outputParser??t.getDefaultOutputParser(),c=new ze({prompt:I,llm:e,callbacks:l?.callbacks??l?.callbackManager});return new t({llmChain:c,allowedTools:n.map(i=>i.name),outputParser:a})}static async deserialize(e){let{llm:n,tools:l,...I}=e;return Tot(n,l,I,(a,c,i)=>t.fromLLMAndTools(a,c,{prefix:i.prefix,suffix:i.suffix,inputVariables:i.input_variables}),a=>new t(a))}}});function rOn(t){return!Array.isArray(t)&&t?.tool!==void 0}function Pot(t){return t.runnable!==void 0}var tfe,Ute,qy,HB,ob,zte,hL,Bte,Ste,$m,TZ=B(()=>{dQ();Bo();tfe=class extends Error{constructor(e,n){super(e),Object.defineProperty(this,"output",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.output=n}},Ute=class extends XI{get returnValues(){return["output"]}get allowedTools(){}_agentType(){throw new Error("Not implemented")}returnStoppedResponse(e,n,l,I){if(e==="force")return Promise.resolve({returnValues:{output:"Agent stopped due to max iterations."},log:""});throw new Error(`Invalid stopping method: ${e}`)}async prepareForOutput(e,n){return{}}},qy=class extends Ute{_agentActionType(){return"single"}},HB=class extends Ute{_agentActionType(){return"multi"}};ob=class extends Hr{constructor(){super(...arguments),Object.defineProperty(this,"streamRunnable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"singleAction",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}static fromRunnables([e,...n],l){let I=Hr.from([e,...n],l.name);return I.singleAction=l.singleAction,I.streamRunnable=l.streamRunnable,I}static isAgentRunnableSequence(e){return typeof e.singleAction=="boolean"}},zte=class extends qy{get inputKeys(){return[]}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","runnable"]}),Object.defineProperty(this,"runnable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streamRunnable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"defaultRunName",{enumerable:!0,configurable:!0,writable:!0,value:"RunnableAgent"}),this.runnable=e.runnable,this.defaultRunName=e.defaultRunName??this.runnable.name??this.defaultRunName,this.streamRunnable=e.streamRunnable??this.streamRunnable}async plan(e,n,l,I){let a={...n,steps:e},c=wI(I,{callbacks:l,runName:this.defaultRunName});if(this.streamRunnable){let i=await this.runnable.stream(a,c),s;for await(let r of i)if(s===void 0)s=r;else throw new Error(["Multiple agent actions/finishes received in streamed agent output.",'Set "streamRunnable: false" when initializing the agent to invoke this agent in non-streaming mode.'].join(` +`));if(s===void 0)throw new Error(["No streaming output received from underlying runnable.",'Set "streamRunnable: false" when initializing the agent to invoke this agent in non-streaming mode.'].join(` +`));return s}else return this.runnable.invoke(a,c)}},hL=class extends HB{get inputKeys(){return[]}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","runnable"]}),Object.defineProperty(this,"runnable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultRunName",{enumerable:!0,configurable:!0,writable:!0,value:"RunnableAgent"}),Object.defineProperty(this,"stop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streamRunnable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.runnable=e.runnable,this.stop=e.stop,this.defaultRunName=e.defaultRunName??this.runnable.name??this.defaultRunName,this.streamRunnable=e.streamRunnable??this.streamRunnable}async plan(e,n,l,I){let a={...n,steps:e},c=wI(I,{callbacks:l,runName:this.defaultRunName}),i;if(this.streamRunnable){let s=await this.runnable.stream(a,c),r;for await(let u of s)if(r===void 0)r=u;else throw new Error(["Multiple agent actions/finishes received in streamed agent output.",'Set "streamRunnable: false" when initializing the agent to invoke this agent in non-streaming mode.'].join(` +`));if(r===void 0)throw new Error(["No streaming output received from underlying runnable.",'Set "streamRunnable: false" when initializing the agent to invoke this agent in non-streaming mode.'].join(` +`));i=r}else i=await this.runnable.invoke(a,c);return rOn(i)?[i]:i}},Bte=class extends hL{},Ste=class extends qy{constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents"]}),Object.defineProperty(this,"llmChain",{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,"stop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.stop=e.stop,this.llmChain=e.llmChain,this.outputParser=e.outputParser}get inputKeys(){return this.llmChain.inputKeys}async plan(e,n,l){let I=await this.llmChain.call({intermediate_steps:e,stop:this.stop,...n},l);return this.outputParser.parse(I[this.llmChain.outputKey],l)}},$m=class extends qy{get allowedTools(){return this._allowedTools}get inputKeys(){return this.llmChain.inputKeys.filter(e=>e!=="agent_scratchpad")}constructor(e){super(e),Object.defineProperty(this,"llmChain",{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,"_allowedTools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmChain=e.llmChain,this._allowedTools=e.allowedTools,this.outputParser=e.outputParser}static getDefaultOutputParser(e){throw new Error("Not implemented")}static createPrompt(e,n){throw new Error("Not implemented")}static fromLLMAndTools(e,n,l){throw new Error("Not implemented")}static validateTools(e){}_stop(){return[` +${this.observationPrefix()}`]}finishToolName(){return"Final Answer"}async constructScratchPad(e){return e.reduce((n,{action:l,observation:I})=>n+[l.log,`${this.observationPrefix()}${I}`,this.llmPrefix()].join(` +`),"")}async _plan(e,n,l,I){let a=await this.constructScratchPad(e),c={...n,agent_scratchpad:l?`${a}${l}`:a};this._stop().length!==0&&(c.stop=this._stop());let i=await this.llmChain.predict(c,I);if(!this.outputParser)throw new Error("Output parser not set");return this.outputParser.parse(i,I)}plan(e,n,l){return this._plan(e,n,void 0,l)}async returnStoppedResponse(e,n,l,I){if(e==="force")return{returnValues:{output:"Agent stopped due to max iterations."},log:""};if(e==="generate")try{let a=await this._plan(n,l,` + +I now need to return a final answer based on the previous steps:`,I);return"returnValues"in a?a:{returnValues:{output:a.log},log:a.log}}catch(a){if(!(a instanceof tfe))throw a;return{returnValues:{output:a.output},log:a.output}}throw new Error(`Invalid stopping method: ${e}`)}static async deserialize(e){switch(e._type){case"zero-shot-react-description":{let{ZeroShotAgent:n}=await Promise.resolve().then(()=>(bQ(),_ot));return n.deserialize(e)}default:throw new Error("Unknown agent type")}}}});var mG=B(()=>{ute()});var lfe=f(Mte=>{var cOn=/~/,oOn=/~[01]/g;function iOn(t){switch(t){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+t)}function qot(t){return cOn.test(t)?t.replace(oOn,iOn):t}function sOn(t,e,n){for(var l,I,a=1,c=e.length;aa,typeof t[l]>"u"&&(Array.isArray(t)&&l==="-"&&(l=t.length),I&&(e[a]!==""&&e[a]<1/0||e[a]==="-"?t[l]=[]:t[l]={})),!I)break;t=t[l]}var i=t[l];return n===void 0?delete t[l]:t[l]=n,i}function nfe(t){if(typeof t=="string"){if(t=t.split("/"),t[0]==="")return t;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(t)){for(let e of t)if(typeof e!="string"&&typeof e!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return t}throw new Error("Invalid JSON pointer.")}function $ot(t,e){if(typeof t!="object")throw new Error("Invalid input object.");e=nfe(e);var n=e.length;if(n===1)return t;for(var l=1;l{Uve()});var ep=B(()=>{Dve()});var tp=B(()=>{ky()});var rne,cne,xit,wfe=B(()=>{rne="RFC3986",cne={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:t=>String(t)},xit="RFC1738"});function Oit(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function Qfe(t,e){if(JOn(t)){let n=[];for(let l=0;l{wfe();JOn=Array.isArray,rg=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),Hfe=1024,jit=(t,e,n,l,I)=>{if(t.length===0)return t;let a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(i){return"%26%23"+parseInt(i.slice(2),16)+"%3B"});let c="";for(let i=0;i=Hfe?a.slice(i,i+Hfe):a,r=[];for(let u=0;u=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||I===xit&&(o===40||o===41)){r[r.length]=s.charAt(u);continue}if(o<128){r[r.length]=rg[o];continue}if(o<2048){r[r.length]=rg[192|o>>6]+rg[128|o&63];continue}if(o<55296||o>=57344){r[r.length]=rg[224|o>>12]+rg[128|o>>6&63]+rg[128|o&63];continue}u+=1,o=65536+((o&1023)<<10|s.charCodeAt(u)&1023),r[r.length]=rg[240|o>>18]+rg[128|o>>12&63]+rg[128|o>>6&63]+rg[128|o&63]}c+=r.join("")}return c}});function xOn(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function Sit(t,e,n,l,I,a,c,i,s,r,u,o,d,b,h,Z,N,g){let y=t,X=g,v=0,H=!1;for(;(X=X.get(Efe))!==void 0&&!H;){let U=X.get(t);if(v+=1,typeof U<"u"){if(U===v)throw new RangeError("Cyclic object value");H=!0}typeof X.get(Efe)>"u"&&(v=0)}if(typeof r=="function"?y=r(e,y):y instanceof Date?y=d?.(y):n==="comma"&&cg(y)&&(y=Qfe(y,function(U){return U instanceof Date?d?.(U):U})),y===null){if(a)return s&&!Z?s(e,nd.encoder,N,"key",b):e;y=""}if(xOn(y)||Oit(y)){if(s){let U=Z?e:s(e,nd.encoder,N,"key",b);return[h?.(U)+"="+h?.(s(y,nd.encoder,N,"value",b))]}return[h?.(e)+"="+h?.(String(y))]}let Q=[];if(typeof y>"u")return Q;let L;if(n==="comma"&&cg(y))Z&&s&&(y=Qfe(y,s)),L=[{value:y.length>0?y.join(",")||null:void 0}];else if(cg(r))L=r;else{let U=Object.keys(y);L=u?U.sort(u):U}let J=i?String(e).replace(/\./g,"%2E"):String(e),O=l&&cg(y)&&y.length===1?J+"[]":J;if(I&&cg(y)&&y.length===0)return O+"[]";for(let U=0;U"u"?t.encodeDotInKeys?!0:nd.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:nd.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:nd.allowEmptyArrays,arrayFormat:a,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:nd.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?nd.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:nd.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:nd.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:nd.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:nd.encodeValuesOnly,filter:I,format:n,formatter:l,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:nd.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:nd.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:nd.strictNullHandling}}function Jfe(t,e={}){let n=t,l=jOn(e),I,a;typeof l.filter=="function"?(a=l.filter,n=a("",n)):cg(l.filter)&&(a=l.filter,I=a);let c=[];if(typeof n!="object"||n===null)return"";let i=zit[l.arrayFormat],s=i==="comma"&&l.commaRoundTrip;I||(I=Object.keys(n)),l.sort&&I.sort(l.sort);let r=new WeakMap;for(let d=0;d0?o+u:""}var COn,zit,cg,LOn,Bit,kOn,nd,Efe,Mit=B(()=>{Uit();wfe();COn=Object.prototype.hasOwnProperty,zit={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},cg=Array.isArray,LOn=Array.prototype.push,Bit=function(t,e){LOn.apply(t,cg(e)?e:[e])},kOn=Date.prototype.toISOString,nd={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:jit,encodeValuesOnly:!1,format:rne,formatter:cne[rne],indices:!1,serializeDate(t){return kOn.call(t)},skipNulls:!1,strictNullHandling:!1};Efe={}});var Tit=B(()=>{Mit()});var VQ,Dit=B(()=>{VQ="4.104.0"});function _it(t,e={auto:!1}){if(Kit)throw new Error(`you must \`import 'openai/shims/${t.kind}'\` before importing anything else from openai`);if(YQ)throw new Error(`can't \`import 'openai/shims/${t.kind}'\` after \`import 'openai/shims/${YQ}'\``);Kit=e.auto,YQ=t.kind,Cfe=t.fetch,UOn=t.Request,zOn=t.Response,BOn=t.Headers,Lfe=t.FormData,SOn=t.Blob,one=t.File,kfe=t.ReadableStream,xfe=t.getMultipartRequestOptions,jfe=t.getDefaultAgent,TB=t.fileFromPath,Ofe=t.isFsReadStream}var Kit,YQ,Cfe,UOn,zOn,BOn,Lfe,SOn,one,kfe,xfe,jfe,TB,Ofe,Ufe=B(()=>{Kit=!1});var ine,Pit=B(()=>{ine=class{constructor(e){this.body=e}get[Symbol.toStringTag](){return"MultipartBody"}}});function qit({manuallyImported:t}={}){let e=t?"You may need to use polyfills":"Add one of these imports before your first `import \u2026 from 'openai'`:\n- `import 'openai/shims/node'` (if you're running on Node)\n- `import 'openai/shims/web'` (otherwise)\n",n,l,I,a;try{n=fetch,l=Request,I=Response,a=Headers}catch(c){throw new Error(`this environment is missing the following Web Fetch API type: ${c.message}. ${e}`)}return{kind:"web",fetch:n,Request:l,Response:I,Headers:a,FormData:typeof FormData<"u"?FormData:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${e}`)}},Blob:typeof Blob<"u"?Blob:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${e}`)}},File:typeof File<"u"?File:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${e}`)}},ReadableStream:typeof ReadableStream<"u"?ReadableStream:class{constructor(){throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${e}`)}},getMultipartRequestOptions:async(c,i)=>({...i,body:new ine(c)}),getDefaultAgent:c=>{},fileFromPath:()=>{throw new Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:c=>!1}}var $it=B(()=>{Pit()});var est=B(()=>{$it()});var zfe,DB=B(()=>{Ufe();est();Ufe();zfe=()=>{YQ||_it(qit(),{auto:!0})};zfe()});var At,Ii,ao,lA,qN,LL,kL,xL,jL,OL,UL,zL,BL,SL,ML,np=B(()=>{dI();At=class extends Error{},Ii=class t extends At{constructor(e,n,l,I){super(`${t.makeMessage(e,n,l)}`),this.status=e,this.headers=I,this.request_id=I?.["x-request-id"],this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,n,l){let I=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):l;return e&&I?`${e} ${I}`:e?`${e} status code (no body)`:I||"(no status code or body)"}static generate(e,n,l,I){if(!e||!I)return new lA({message:l,cause:sne(n)});let a=n?.error;return e===400?new LL(e,a,l,I):e===401?new kL(e,a,l,I):e===403?new xL(e,a,l,I):e===404?new jL(e,a,l,I):e===409?new OL(e,a,l,I):e===422?new UL(e,a,l,I):e===429?new zL(e,a,l,I):e>=500?new BL(e,a,l,I):new t(e,a,l,I)}},ao=class extends Ii{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},lA=class extends Ii{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},qN=class extends lA{constructor({message:e}={}){super({message:e??"Request timed out."})}},LL=class extends Ii{},kL=class extends Ii{},xL=class extends Ii{},jL=class extends Ii{},OL=class extends Ii{},UL=class extends Ii{},zL=class extends Ii{},BL=class extends Ii{},SL=class extends At{constructor(){super("Could not parse response content as the length limit was reached")}},ML=class extends At{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}});function KOn(t,e){for(let I=e??0;I{np();une=function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},gQ=function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},RQ=class{constructor(){yh.set(this,void 0),this.buffer=new Uint8Array,une(this,yh,null,"f")}decode(e){if(e==null)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?new TextEncoder().encode(e):e,l=new Uint8Array(this.buffer.length+n.length);l.set(this.buffer),l.set(n,this.buffer.length),this.buffer=l;let I=[],a;for(;(a=KOn(this.buffer,gQ(this,yh,"f")))!=null;){if(a.carriage&&gQ(this,yh,"f")==null){une(this,yh,a.index,"f");continue}if(gQ(this,yh,"f")!=null&&(a.index!==gQ(this,yh,"f")+1||a.carriage)){I.push(this.decodeText(this.buffer.slice(0,gQ(this,yh,"f")-1))),this.buffer=this.buffer.slice(gQ(this,yh,"f")),une(this,yh,null,"f");continue}let c=gQ(this,yh,"f")!==null?a.preceding-1:a.preceding,i=this.decodeText(this.buffer.slice(0,c));I.push(i),this.buffer=this.buffer.slice(a.index),une(this,yh,null,"f")}return I}decodeText(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof Buffer<"u"){if(e instanceof Buffer)return e.toString();if(e instanceof Uint8Array)return Buffer.from(e).toString();throw new At(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if(typeof TextDecoder<"u"){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new At(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new At("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode(` +`):[]}};yh=new WeakMap;RQ.NEWLINE_CHARS=new Set([` +`,"\r"]);RQ.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function Bfe(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}var lst=B(()=>{});async function*_On(t,e){if(!t.body)throw e.abort(),new At("Attempted to iterate over a response with no body");let n=new Sfe,l=new RQ,I=Bfe(t.body);for await(let a of POn(I))for(let c of l.decode(a)){let i=n.decode(c);i&&(yield i)}for(let a of l.flush()){let c=n.decode(a);c&&(yield c)}}async function*POn(t){let e=new Uint8Array;for await(let n of t){if(n==null)continue;let l=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?new TextEncoder().encode(n):n,I=new Uint8Array(e.length+l.length);I.set(e),I.set(l,e.length),e=I;let a;for(;(a=tst(e))!==-1;)yield e.slice(0,a),e=e.slice(a)}e.length>0&&(yield e)}function qOn(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}var og,Sfe,dne=B(()=>{DB();np();nst();lst();dI();np();og=class t{constructor(e,n){this.iterator=e,this.controller=n}static fromSSEResponse(e,n){let l=!1;async function*I(){if(l)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");l=!0;let a=!1;try{for await(let c of _On(e,n))if(!a){if(c.data.startsWith("[DONE]")){a=!0;continue}if(c.event===null||c.event.startsWith("response.")||c.event.startsWith("transcript.")){let i;try{i=JSON.parse(c.data)}catch(s){throw console.error("Could not parse message into JSON:",c.data),console.error("From chunk:",c.raw),s}if(i&&i.error)throw new Ii(void 0,i.error,void 0,Mfe(e.headers));yield i}else{let i;try{i=JSON.parse(c.data)}catch(s){throw console.error("Could not parse message into JSON:",c.data),console.error("From chunk:",c.raw),s}if(c.event=="error")throw new Ii(void 0,i.error,i.message,void 0);yield{event:c.event,data:i}}}a=!0}catch(c){if(c instanceof Error&&c.name==="AbortError")return;throw c}finally{a||n.abort()}}return new t(I,n)}static fromReadableStream(e,n){let l=!1;async function*I(){let c=new RQ,i=Bfe(e);for await(let s of i)for(let r of c.decode(s))yield r;for(let s of c.flush())yield s}async function*a(){if(l)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");l=!0;let c=!1;try{for await(let i of I())c||i&&(yield JSON.parse(i));c=!0}catch(i){if(i instanceof Error&&i.name==="AbortError")return;throw i}finally{c||n.abort()}}return new t(a,n)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],n=[],l=this.iterator(),I=a=>({next:()=>{if(a.length===0){let c=l.next();e.push(c),n.push(c)}return a.shift()}});return[new t(()=>I(e),this.controller),new t(()=>I(n),this.controller)]}toReadableStream(){let e=this,n,l=new TextEncoder;return new kfe({async start(){n=e[Symbol.asyncIterator]()},async pull(I){try{let{value:a,done:c}=await n.next();if(c)return I.close();let i=l.encode(JSON.stringify(a)+` +`);I.enqueue(i)}catch(a){I.error(a)}},async cancel(){await n.return?.()}})}};Sfe=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let a={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],a}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,l,I]=qOn(e,":");return I.startsWith(" ")&&(I=I.substring(1)),n==="event"?this.event=I:n==="data"&&this.data.push(I),null}}});async function TL(t,e,n){if(t=await t,ast(t))return t;if(Ist(t)){let I=await t.blob();e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()??"unknown_file");let a=KB(I)?[await I.arrayBuffer()]:[I];return new one(a,e,n)}let l=await eUn(t);if(e||(e=nUn(t)??"unknown_file"),!n?.type){let I=l[0]?.type;typeof I=="string"&&(n={...n,type:I})}return new one(l,e,n)}async function eUn(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(KB(t))e.push(await t.arrayBuffer());else if(lUn(t))for await(let n of t)e.push(n);else throw new Error(`Unexpected data type: ${typeof t}; constructor: ${t?.constructor?.name}; props: ${tUn(t)}`);return e}function tUn(t){return`[${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}function nUn(t){return Tfe(t.name)||Tfe(t.filename)||Tfe(t.path)?.split(/[\\/]/).pop()}var Ist,ast,KB,$On,Tfe,lUn,Kfe,lp,rst,Dfe,_B=B(()=>{DB();DB();Ist=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function",ast=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&KB(t),KB=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",$On=t=>ast(t)||Ist(t)||Ofe(t);Tfe=t=>{if(typeof t=="string")return t;if(typeof Buffer<"u"&&t instanceof Buffer)return String(t)},lUn=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",Kfe=t=>t&&typeof t=="object"&&t.body&&t[Symbol.toStringTag]==="MultipartBody",lp=async t=>{let e=await rst(t.body);return xfe(e,t)},rst=async t=>{let e=new Lfe;return await Promise.all(Object.entries(t||{}).map(([n,l])=>Dfe(e,n,l))),e},Dfe=async(t,e,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if($On(n)){let l=await TL(n);t.append(e,l)}else if(Array.isArray(n))await Promise.all(n.map(l=>Dfe(t,e+"[]",l)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([l,I])=>Dfe(t,`${e}[${l}]`,I)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}});async function dst(t){let{response:e}=t;if(t.options.stream)return IA("response",e.status,e.url,e.headers,e.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(e,t.controller):og.fromSSEResponse(e,t.controller);if(e.status===204)return null;if(t.options.__binaryResponse)return e;let l=e.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){let c=await e.json();return IA("response",e.status,e.url,e.headers,c),Gst(c,e)}let a=await e.text();return IA("response",e.status,e.url,e.headers,a),a}function Gst(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("x-request-id"),enumerable:!1})}function iUn(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:n}of t){let l=n.exec(navigator.userAgent);if(l){let I=l[1]||0,a=l[2]||0,c=l[3]||0;return{browser:e,version:`${I}.${a}.${c}`}}}return null}function bst(t){if(!t)return!0;for(let e in t)return!1;return!0}function mst(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function sst(t,e){for(let n in e){if(!mst(e,n))continue;let l=n.toLowerCase();if(!l)continue;let I=e[n];I===null?delete t[l]:I!==void 0&&(t[l]=I)}}function IA(t,...e){if(typeof process<"u"&&process?.env?.DEBUG==="true"){let n=e.map(l=>{if(!l)return l;if(l.headers){let a={...l,headers:{...l.headers}};for(let c in l.headers)ust.has(c.toLowerCase())&&(a.headers[c]="REDACTED");return a}let I=null;for(let a in l)ust.has(a.toLowerCase())&&(I??(I={...l}),I[a]="REDACTED");return I??l});console.log(`OpenAI:DEBUG:${t}`,...n)}}function DL(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var aUn,rUn,Gne,mne,pne,PB,Pfe,Mfe,cUn,Al,oUn,cst,ost,ist,sUn,uUn,dUn,GUn,aA,_fe,sne,sv,ust,bUn,pst,mUn,bne,hst,dI=B(()=>{Dit();dne();np();DB();_B();_B();aUn=function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},rUn=function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)};zfe();mne=class t extends Promise{constructor(e,n=dst){super(l=>{l(null)}),this.responsePromise=e,this.parseResponse=n}_thenUnwrap(e){return new t(this.responsePromise,async n=>Gst(e(await this.parseResponse(n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}},pne=class{constructor({baseURL:e,maxRetries:n=2,timeout:l=6e5,httpAgent:I,fetch:a}){this.baseURL=e,this.maxRetries=_fe("maxRetries",n),this.timeout=_fe("timeout",l),this.httpAgent=I,this.fetch=a??Cfe}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...sUn(),...this.authHeaders(e)}}validateHeaders(e,n){}defaultIdempotencyKey(){return`stainless-node-retry-${bUn()}`}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,l){return this.request(Promise.resolve(l).then(async I=>{let a=I&&KB(I?.body)?new DataView(await I.body.arrayBuffer()):I?.body instanceof DataView?I.body:I?.body instanceof ArrayBuffer?new DataView(I.body):I&&ArrayBuffer.isView(I?.body)?new DataView(I.body.buffer):I?.body;return{method:e,path:n,...I,body:a}}))}getAPIList(e,n,l){return this.requestAPIList(n,{method:"get",path:e,...l})}calculateContentLength(e){if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.byteLength(e,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(e).length.toString()}else if(ArrayBuffer.isView(e))return e.byteLength.toString();return null}buildRequest(e,{retryCount:n=0}={}){let l={...e},{method:I,path:a,query:c,headers:i={}}=l,s=ArrayBuffer.isView(l.body)||l.__binaryRequest&&typeof l.body=="string"?l.body:Kfe(l.body)?l.body.body:l.body?JSON.stringify(l.body,null,2):null,r=this.calculateContentLength(s),u=this.buildURL(a,c);"timeout"in l&&_fe("timeout",l.timeout),l.timeout=l.timeout??this.timeout;let o=l.httpAgent??this.httpAgent??jfe(u),d=l.timeout+1e3;typeof o?.options?.timeout=="number"&&d>(o.options.timeout??0)&&(o.options.timeout=d),this.idempotencyHeader&&I!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let b=this.buildHeaders({options:l,headers:i,contentLength:r,retryCount:n});return{req:{method:I,...s&&{body:s},headers:b,...o&&{agent:o},signal:l.signal??null},url:u,timeout:l.timeout}}buildHeaders({options:e,headers:n,contentLength:l,retryCount:I}){let a={};l&&(a["content-length"]=l);let c=this.defaultHeaders(e);return sst(a,c),sst(a,n),Kfe(e.body)&&YQ!=="node"&&delete a["content-type"],bne(c,"x-stainless-retry-count")===void 0&&bne(n,"x-stainless-retry-count")===void 0&&(a["x-stainless-retry-count"]=String(I)),bne(c,"x-stainless-timeout")===void 0&&bne(n,"x-stainless-timeout")===void 0&&e.timeout&&(a["x-stainless-timeout"]=String(Math.trunc(e.timeout/1e3))),this.validateHeaders(a,n),a}async prepareOptions(e){}async prepareRequest(e,{url:n,options:l}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(n=>[...n])):{...e}:{}}makeStatusError(e,n,l,I){return Ii.generate(e,n,l,I)}request(e,n=null){return new mne(this.makeRequest(e,n))}async makeRequest(e,n){let l=await e,I=l.maxRetries??this.maxRetries;n==null&&(n=I),await this.prepareOptions(l);let{req:a,url:c,timeout:i}=this.buildRequest(l,{retryCount:I-n});if(await this.prepareRequest(a,{url:c,options:l}),IA("request",c,l,a.headers),l.signal?.aborted)throw new ao;let s=new AbortController,r=await this.fetchWithTimeout(c,a,i,s).catch(sne);if(r instanceof Error){if(l.signal?.aborted)throw new ao;if(n)return this.retryRequest(l,n);throw r.name==="AbortError"?new qN:new lA({cause:r})}let u=Mfe(r.headers);if(!r.ok){if(n&&this.shouldRetry(r)){let N=`retrying, ${n} attempts remaining`;return IA(`response (error; ${N})`,r.status,c,u),this.retryRequest(l,n,u)}let o=await r.text().catch(N=>sne(N).message),d=uUn(o),b=d?void 0:o;throw IA(`response (error; ${n?"(error; no more retries left)":"(error; not retryable)"})`,r.status,c,u,b),this.makeStatusError(r.status,d,b,u)}return{response:r,options:l,controller:s}}requestAPIList(e,n){let l=this.makeRequest(n,null);return new Pfe(this,l,e)}buildURL(e,n){let l=GUn(e)?new URL(e):new URL(this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),I=this.defaultQuery();return bst(I)||(n={...I,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(l.search=this.stringifyQuery(n)),l.toString()}stringifyQuery(e){return Object.entries(e).filter(([n,l])=>typeof l<"u").map(([n,l])=>{if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(l)}`;if(l===null)return`${encodeURIComponent(n)}=`;throw new At(`Cannot stringify type ${typeof l}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,n,l,I){let{signal:a,...c}=n||{};a&&a.addEventListener("abort",()=>I.abort());let i=setTimeout(()=>I.abort(),l),s={signal:I.signal,...c};return s.method&&(s.method=s.method.toUpperCase()),this.fetch.call(void 0,e,s).finally(()=>{clearTimeout(i)})}shouldRetry(e){let n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,l){let I,a=l?.["retry-after-ms"];if(a){let i=parseFloat(a);Number.isNaN(i)||(I=i)}let c=l?.["retry-after"];if(c&&!I){let i=parseFloat(c);Number.isNaN(i)?I=Date.parse(c)-Date.now():I=i*1e3}if(!(I&&0<=I&&I<60*1e3)){let i=e.maxRetries??this.maxRetries;I=this.calculateDefaultRetryTimeoutMillis(n,i)}return await aA(I),this.makeRequest(e,n-1)}calculateDefaultRetryTimeoutMillis(e,n){let a=n-e,c=Math.min(.5*Math.pow(2,a),8),i=1-Math.random()*.25;return c*i*1e3}getUserAgent(){return`${this.constructor.name}/JS ${VQ}`}},PB=class{constructor(e,n,l,I){Gne.set(this,void 0),aUn(this,Gne,e,"f"),this.options=I,this.response=n,this.body=l}hasNextPage(){return this.getPaginatedItems().length?this.nextPageInfo()!=null:!1}async getNextPage(){let e=this.nextPageInfo();if(!e)throw new At("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let n={...this.options};if("params"in e&&typeof n.query=="object")n.query={...n.query,...e.params};else if("url"in e){let l=[...Object.entries(n.query||{}),...e.url.searchParams.entries()];for(let[I,a]of l)e.url.searchParams.set(I,a);n.query=void 0,n.path=e.url.toString()}return await rUn(this,Gne,"f").requestAPIList(this.constructor,n)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(Gne=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let n of e.getPaginatedItems())yield n}},Pfe=class extends mne{constructor(e,n,l){super(n,async I=>new l(e,I.response,await dst(I),I.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let n of e)yield n}},Mfe=t=>new Proxy(Object.fromEntries(t.entries()),{get(e,n){let l=n.toString();return e[l.toLowerCase()]||e[l]}}),cUn={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},Al=t=>typeof t=="object"&&t!==null&&!bst(t)&&Object.keys(t).every(e=>mst(cUn,e)),oUn=()=>{if(typeof Deno<"u"&&Deno.build!=null)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":VQ,"X-Stainless-OS":ost(Deno.build.os),"X-Stainless-Arch":cst(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":VQ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":process.version};if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":VQ,"X-Stainless-OS":ost(process.platform),"X-Stainless-Arch":cst(process.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":process.version};let t=iUn();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":VQ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":VQ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};cst=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",ost=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),sUn=()=>ist??(ist=oUn()),uUn=t=>{try{return JSON.parse(t)}catch{return}},dUn=/^[a-z][a-z0-9+.-]*:/i,GUn=t=>dUn.test(t),aA=t=>new Promise(e=>setTimeout(e,t)),_fe=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new At(`${t} must be an integer`);if(e<0)throw new At(`${t} must be a positive integer`);return e},sne=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null)try{return new Error(JSON.stringify(t))}catch{}return new Error(t)},sv=t=>{if(typeof process<"u")return process.env?.[t]?.trim()??void 0;if(typeof Deno<"u")return Deno.env?.get?.(t)?.trim()};ust=new Set(["authorization","api-key"]);bUn=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)}),pst=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",mUn=t=>typeof t?.get=="function",bne=(t,e)=>{let n=e.toLowerCase();if(mUn(t)){let l=e[0]?.toUpperCase()+e.substring(1).replace(/([^\w])(\w)/g,(I,a,c)=>a+c.toUpperCase());for(let I of[e,n,e.toUpperCase(),l]){let a=t.get(I);if(a)return a}}for(let[l,I]of Object.entries(t))if(l.toLowerCase()===n)return Array.isArray(I)?(I.length<=1||console.warn(`Received ${I.length} entries for the ${e} header, using the first entry.`),I[0]):I},hst=t=>{if(typeof Buffer<"u"){let e=Buffer.from(t,"base64");return Array.from(new Float32Array(e.buffer,e.byteOffset,e.length/Float32Array.BYTES_PER_ELEMENT))}else{let e=atob(t),n=e.length,l=new Uint8Array(n);for(let I=0;I{dI();ig=class extends PB{constructor(e,n,l,I){super(e,n,l,I),this.data=l.data||[],this.object=l.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}},lI=class extends PB{constructor(e,n,l,I){super(e,n,l,I),this.data=l.data||[],this.has_more=l.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageParams(){let e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;let n=Object.fromEntries(e.url.searchParams);return Object.keys(n).length?n:null}nextPageInfo(){let e=this.getPaginatedItems();if(!e.length)return null;let n=e[e.length-1]?.id;return n?{params:{after:n}}:null}}});var Se,Jn=B(()=>{Se=class{constructor(e){this._client=e}}});var KL,qfe=B(()=>{Jn();dI();qB();KL=class extends Se{list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/chat/completions/${e}/messages`,hne,{query:n,...l})}}});var uv,dv,hne,qB=B(()=>{Jn();dI();qfe();qfe();ai();uv=class extends Se{constructor(){super(...arguments),this.messages=new KL(this._client)}create(e,n){return this._client.post("/chat/completions",{body:e,...n,stream:e.stream??!1})}retrieve(e,n){return this._client.get(`/chat/completions/${e}`,n)}update(e,n,l){return this._client.post(`/chat/completions/${e}`,{body:n,...l})}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/chat/completions",dv,{query:e,...n})}del(e,n){return this._client.delete(`/chat/completions/${e}`,n)}},dv=class extends lI{},hne=class extends lI{};uv.ChatCompletionsPage=dv;uv.Messages=KL});var cA,$fe=B(()=>{Jn();qB();qB();cA=class extends Se{constructor(){super(...arguments),this.completions=new uv(this._client)}};cA.Completions=uv;cA.ChatCompletionsPage=dv});var Zst=B(()=>{$fe()});var Wst=B(()=>{});var _L,eXe=B(()=>{Jn();_L=class extends Se{create(e,n){return this._client.post("/audio/speech",{body:e,...n,headers:{Accept:"application/octet-stream",...n?.headers},__binaryResponse:!0})}}});var PL,tXe=B(()=>{Jn();dI();PL=class extends Se{create(e,n){return this._client.post("/audio/transcriptions",lp({body:e,...n,stream:e.stream??!1,__metadata:{model:e.model}}))}}});var qL,nXe=B(()=>{Jn();dI();qL=class extends Se{create(e,n){return this._client.post("/audio/translations",lp({body:e,...n,__metadata:{model:e.model}}))}}});var sg,lXe=B(()=>{Jn();eXe();eXe();tXe();tXe();nXe();nXe();sg=class extends Se{constructor(){super(...arguments),this.transcriptions=new PL(this._client),this.translations=new qL(this._client),this.speech=new _L(this._client)}};sg.Transcriptions=PL;sg.Translations=qL;sg.Speech=_L});var Gv,yQ,IXe=B(()=>{Jn();dI();ai();Gv=class extends Se{create(e,n){return this._client.post("/batches",{body:e,...n})}retrieve(e,n){return this._client.get(`/batches/${e}`,n)}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/batches",yQ,{query:e,...n})}cancel(e,n){return this._client.post(`/batches/${e}/cancel`,n)}},yQ=class extends lI{};Gv.BatchesPage=yQ});var $N,ro,aXe,Zne,Wne,$B,eS,Nne,tS,oA,nS,Vne,Yne,$L,Nst,bv,gne=B(()=>{np();$N=function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},ro=function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},bv=class{constructor(){aXe.add(this),this.controller=new AbortController,Zne.set(this,void 0),Wne.set(this,()=>{}),$B.set(this,()=>{}),eS.set(this,void 0),Nne.set(this,()=>{}),tS.set(this,()=>{}),oA.set(this,{}),nS.set(this,!1),Vne.set(this,!1),Yne.set(this,!1),$L.set(this,!1),$N(this,Zne,new Promise((e,n)=>{$N(this,Wne,e,"f"),$N(this,$B,n,"f")}),"f"),$N(this,eS,new Promise((e,n)=>{$N(this,Nne,e,"f"),$N(this,tS,n,"f")}),"f"),ro(this,Zne,"f").catch(()=>{}),ro(this,eS,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},ro(this,aXe,"m",Nst).bind(this))},0)}_connected(){this.ended||(ro(this,Wne,"f").call(this),this._emit("connect"))}get ended(){return ro(this,nS,"f")}get errored(){return ro(this,Vne,"f")}get aborted(){return ro(this,Yne,"f")}abort(){this.controller.abort()}on(e,n){return(ro(this,oA,"f")[e]||(ro(this,oA,"f")[e]=[])).push({listener:n}),this}off(e,n){let l=ro(this,oA,"f")[e];if(!l)return this;let I=l.findIndex(a=>a.listener===n);return I>=0&&l.splice(I,1),this}once(e,n){return(ro(this,oA,"f")[e]||(ro(this,oA,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,l)=>{$N(this,$L,!0,"f"),e!=="error"&&this.once("error",l),this.once(e,n)})}async done(){$N(this,$L,!0,"f"),await ro(this,eS,"f")}_emit(e,...n){if(ro(this,nS,"f"))return;e==="end"&&($N(this,nS,!0,"f"),ro(this,Nne,"f").call(this));let l=ro(this,oA,"f")[e];if(l&&(ro(this,oA,"f")[e]=l.filter(I=>!I.once),l.forEach(({listener:I})=>I(...n))),e==="abort"){let I=n[0];!ro(this,$L,"f")&&!l?.length&&Promise.reject(I),ro(this,$B,"f").call(this,I),ro(this,tS,"f").call(this,I),this._emit("end");return}if(e==="error"){let I=n[0];!ro(this,$L,"f")&&!l?.length&&Promise.reject(I),ro(this,$B,"f").call(this,I),ro(this,tS,"f").call(this,I),this._emit("end")}}_emitFinal(){}};Zne=new WeakMap,Wne=new WeakMap,$B=new WeakMap,eS=new WeakMap,Nne=new WeakMap,tS=new WeakMap,oA=new WeakMap,nS=new WeakMap,Vne=new WeakMap,Yne=new WeakMap,$L=new WeakMap,aXe=new WeakSet,Nst=function(e){if($N(this,Vne,!0,"f"),e instanceof Error&&e.name==="AbortError"&&(e=new ao),e instanceof ao)return $N(this,Yne,!0,"f"),this._emit("abort",e);if(e instanceof At)return this._emit("error",e);if(e instanceof Error){let n=new At(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new At(String(e)))}});var on,Ah,pG,rXe,ug,Rne,eV,FQ,ek,AQ,Fne,Fh,yne,Ane,aS,lS,IS,Vst,Yst,gst,Rst,yst,Ast,Fst,dg,cXe=B(()=>{dI();dne();np();gne();on=function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},Ah=function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},dg=class t extends bv{constructor(){super(...arguments),pG.add(this),rXe.set(this,[]),ug.set(this,{}),Rne.set(this,{}),eV.set(this,void 0),FQ.set(this,void 0),ek.set(this,void 0),AQ.set(this,void 0),Fne.set(this,void 0),Fh.set(this,void 0),yne.set(this,void 0),Ane.set(this,void 0),aS.set(this,void 0)}[(rXe=new WeakMap,ug=new WeakMap,Rne=new WeakMap,eV=new WeakMap,FQ=new WeakMap,ek=new WeakMap,AQ=new WeakMap,Fne=new WeakMap,Fh=new WeakMap,yne=new WeakMap,Ane=new WeakMap,aS=new WeakMap,pG=new WeakSet,Symbol.asyncIterator)](){let e=[],n=[],l=!1;return this.on("event",I=>{let a=n.shift();a?a.resolve(I):e.push(I)}),this.on("end",()=>{l=!0;for(let I of n)I.resolve(void 0);n.length=0}),this.on("abort",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),this.on("error",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:l?{value:void 0,done:!0}:new Promise((a,c)=>n.push({resolve:a,reject:c})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let n=new t;return n._run(()=>n._fromReadableStream(e)),n}async _fromReadableStream(e,n){let l=n?.signal;l&&(l.aborted&&this.controller.abort(),l.addEventListener("abort",()=>this.controller.abort())),this._connected();let I=og.fromReadableStream(e,this.controller);for await(let a of I)on(this,pG,"m",lS).call(this,a);if(I.controller.signal?.aborted)throw new ao;return this._addRun(on(this,pG,"m",IS).call(this))}toReadableStream(){return new og(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,n,l,I,a){let c=new t;return c._run(()=>c._runToolAssistantStream(e,n,l,I,{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),c}async _createToolAssistantStream(e,n,l,I,a){let c=a?.signal;c&&(c.aborted&&this.controller.abort(),c.addEventListener("abort",()=>this.controller.abort()));let i={...I,stream:!0},s=await e.submitToolOutputs(n,l,i,{...a,signal:this.controller.signal});this._connected();for await(let r of s)on(this,pG,"m",lS).call(this,r);if(s.controller.signal?.aborted)throw new ao;return this._addRun(on(this,pG,"m",IS).call(this))}static createThreadAssistantStream(e,n,l){let I=new t;return I._run(()=>I._threadAssistantStream(e,n,{...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"stream"}})),I}static createAssistantStream(e,n,l,I){let a=new t;return a._run(()=>a._runAssistantStream(e,n,l,{...I,headers:{...I?.headers,"X-Stainless-Helper-Method":"stream"}})),a}currentEvent(){return on(this,yne,"f")}currentRun(){return on(this,Ane,"f")}currentMessageSnapshot(){return on(this,eV,"f")}currentRunStepSnapshot(){return on(this,aS,"f")}async finalRunSteps(){return await this.done(),Object.values(on(this,ug,"f"))}async finalMessages(){return await this.done(),Object.values(on(this,Rne,"f"))}async finalRun(){if(await this.done(),!on(this,FQ,"f"))throw Error("Final run was not received.");return on(this,FQ,"f")}async _createThreadAssistantStream(e,n,l){let I=l?.signal;I&&(I.aborted&&this.controller.abort(),I.addEventListener("abort",()=>this.controller.abort()));let a={...n,stream:!0},c=await e.createAndRun(a,{...l,signal:this.controller.signal});this._connected();for await(let i of c)on(this,pG,"m",lS).call(this,i);if(c.controller.signal?.aborted)throw new ao;return this._addRun(on(this,pG,"m",IS).call(this))}async _createAssistantStream(e,n,l,I){let a=I?.signal;a&&(a.aborted&&this.controller.abort(),a.addEventListener("abort",()=>this.controller.abort()));let c={...l,stream:!0},i=await e.create(n,c,{...I,signal:this.controller.signal});this._connected();for await(let s of i)on(this,pG,"m",lS).call(this,s);if(i.controller.signal?.aborted)throw new ao;return this._addRun(on(this,pG,"m",IS).call(this))}static accumulateDelta(e,n){for(let[l,I]of Object.entries(n)){if(!e.hasOwnProperty(l)){e[l]=I;continue}let a=e[l];if(a==null){e[l]=I;continue}if(l==="index"||l==="type"){e[l]=I;continue}if(typeof a=="string"&&typeof I=="string")a+=I;else if(typeof a=="number"&&typeof I=="number")a+=I;else if(DL(a)&&DL(I))a=this.accumulateDelta(a,I);else if(Array.isArray(a)&&Array.isArray(I)){if(a.every(c=>typeof c=="string"||typeof c=="number")){a.push(...I);continue}for(let c of I){if(!DL(c))throw new Error(`Expected array delta entry to be an object but got: ${c}`);let i=c.index;if(i==null)throw console.error(c),new Error("Expected array delta entry to have an `index` property");if(typeof i!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${i}`);let s=a[i];s==null?a.push(c):a[i]=this.accumulateDelta(s,c)}continue}else throw Error(`Unhandled record type: ${l}, deltaValue: ${I}, accValue: ${a}`);e[l]=a}return e}_addRun(e){return e}async _threadAssistantStream(e,n,l){return await this._createThreadAssistantStream(n,e,l)}async _runAssistantStream(e,n,l,I){return await this._createAssistantStream(n,e,l,I)}async _runToolAssistantStream(e,n,l,I,a){return await this._createToolAssistantStream(l,e,n,I,a)}};lS=function(e){if(!this.ended)switch(Ah(this,yne,e,"f"),on(this,pG,"m",gst).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":on(this,pG,"m",Fst).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":on(this,pG,"m",Yst).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":on(this,pG,"m",Vst).call(this,e);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier");default:}},IS=function(){if(this.ended)throw new At("stream has ended, this shouldn't happen");if(!on(this,FQ,"f"))throw Error("Final run has not been received");return on(this,FQ,"f")},Vst=function(e){let[n,l]=on(this,pG,"m",yst).call(this,e,on(this,eV,"f"));Ah(this,eV,n,"f"),on(this,Rne,"f")[n.id]=n;for(let I of l){let a=n.content[I.index];a?.type=="text"&&this._emit("textCreated",a.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,n),e.data.delta.content)for(let I of e.data.delta.content){if(I.type=="text"&&I.text){let a=I.text,c=n.content[I.index];if(c&&c.type=="text")this._emit("textDelta",a,c.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(I.index!=on(this,ek,"f")){if(on(this,AQ,"f"))switch(on(this,AQ,"f").type){case"text":this._emit("textDone",on(this,AQ,"f").text,on(this,eV,"f"));break;case"image_file":this._emit("imageFileDone",on(this,AQ,"f").image_file,on(this,eV,"f"));break}Ah(this,ek,I.index,"f")}Ah(this,AQ,n.content[I.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(on(this,ek,"f")!==void 0){let I=e.data.content[on(this,ek,"f")];if(I)switch(I.type){case"image_file":this._emit("imageFileDone",I.image_file,on(this,eV,"f"));break;case"text":this._emit("textDone",I.text,on(this,eV,"f"));break}}on(this,eV,"f")&&this._emit("messageDone",e.data),Ah(this,eV,void 0,"f")}},Yst=function(e){let n=on(this,pG,"m",Rst).call(this,e);switch(Ah(this,aS,n,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let l=e.data.delta;if(l.step_details&&l.step_details.type=="tool_calls"&&l.step_details.tool_calls&&n.step_details.type=="tool_calls")for(let a of l.step_details.tool_calls)a.index==on(this,Fne,"f")?this._emit("toolCallDelta",a,n.step_details.tool_calls[a.index]):(on(this,Fh,"f")&&this._emit("toolCallDone",on(this,Fh,"f")),Ah(this,Fne,a.index,"f"),Ah(this,Fh,n.step_details.tool_calls[a.index],"f"),on(this,Fh,"f")&&this._emit("toolCallCreated",on(this,Fh,"f")));this._emit("runStepDelta",e.data.delta,n);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Ah(this,aS,void 0,"f"),e.data.step_details.type=="tool_calls"&&on(this,Fh,"f")&&(this._emit("toolCallDone",on(this,Fh,"f")),Ah(this,Fh,void 0,"f")),this._emit("runStepDone",e.data,n);break;case"thread.run.step.in_progress":break}},gst=function(e){on(this,rXe,"f").push(e),this._emit("event",e)},Rst=function(e){switch(e.event){case"thread.run.step.created":return on(this,ug,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let n=on(this,ug,"f")[e.data.id];if(!n)throw Error("Received a RunStepDelta before creation of a snapshot");let l=e.data;if(l.delta){let I=dg.accumulateDelta(n,l.delta);on(this,ug,"f")[e.data.id]=I}return on(this,ug,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":on(this,ug,"f")[e.data.id]=e.data;break}if(on(this,ug,"f")[e.data.id])return on(this,ug,"f")[e.data.id];throw new Error("No snapshot available")},yst=function(e,n){let l=[];switch(e.event){case"thread.message.created":return[e.data,l];case"thread.message.delta":if(!n)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let I=e.data;if(I.delta.content)for(let a of I.delta.content)if(a.index in n.content){let c=n.content[a.index];n.content[a.index]=on(this,pG,"m",Ast).call(this,a,c)}else n.content[a.index]=a,l.push(a);return[n,l];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(n)return[n,l];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},Ast=function(e,n){return dg.accumulateDelta(n,e)},Fst=function(e){switch(Ah(this,Ane,e.data,"f"),e.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":Ah(this,FQ,e.data,"f"),on(this,Fh,"f")&&(this._emit("toolCallDone",on(this,Fh,"f")),Ah(this,Fh,void 0,"f"));break;case"thread.run.cancelling":break}}});var vQ,tk,oXe=B(()=>{Jn();dI();ai();vQ=class extends Se{create(e,n){return this._client.post("/assistants",{body:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,n){return this._client.get(`/assistants/${e}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,n,l){return this._client.post(`/assistants/${e}`,{body:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/assistants",tk,{query:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,n){return this._client.delete(`/assistants/${e}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}},tk=class extends lI{};vQ.AssistantsPage=tk});function iXe(t){return typeof t.parse=="function"}var vst=B(()=>{});var mv,sXe,uXe,dXe=B(()=>{mv=t=>t?.role==="assistant",sXe=t=>t?.role==="function",uXe=t=>t?.role==="tool"});function fst(t,e){let n={...t};return Object.defineProperties(n,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:e,enumerable:!1}}),n}function rS(t){return t?.$brand==="auto-parseable-response-format"}function Xst(t,{parser:e,callback:n}){let l={...t};return Object.defineProperties(l,{$brand:{value:"auto-parseable-tool",enumerable:!1},$parseRaw:{value:e,enumerable:!1},$callback:{value:n,enumerable:!1}}),l}function fQ(t){return t?.$brand==="auto-parseable-tool"}function wst(t,e){return!e||!GXe(e)?{...t,choices:t.choices.map(n=>({...n,message:{...n.message,parsed:null,...n.message.tool_calls?{tool_calls:n.message.tool_calls}:void 0}}))}:cS(t,e)}function cS(t,e){let n=t.choices.map(l=>{if(l.finish_reason==="length")throw new SL;if(l.finish_reason==="content_filter")throw new ML;return{...l,message:{...l.message,...l.message.tool_calls?{tool_calls:l.message.tool_calls?.map(I=>gUn(e,I))??void 0}:void 0,parsed:l.message.content&&!l.message.refusal?YUn(e,l.message.content):null}}});return{...t,choices:n}}function YUn(t,e){return t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(e):JSON.parse(e):null}function gUn(t,e){let n=t.tools?.find(l=>l.function?.name===e.function.name);return{...e,function:{...e.function,parsed_arguments:fQ(n)?n.$parseRaw(e.function.arguments):n?.function.strict?JSON.parse(e.function.arguments):null}}}function Hst(t,e){if(!t)return!1;let n=t.tools?.find(l=>l.function?.name===e.function.name);return fQ(n)||n?.function.strict||!1}function GXe(t){return rS(t.response_format)?!0:t.tools?.some(e=>fQ(e)||e.type==="function"&&e.function.strict===!0)??!1}function Qst(t){for(let e of t??[]){if(e.type!=="function")throw new At(`Currently only \`function\` tool types support auto-parsing; Received \`${e.type}\``);if(e.function.strict!==!0)throw new At(`The \`${e.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var nk=B(()=>{np()});var Ip,ib,bXe,vne,mXe,pXe,hXe,Jst,ZXe,Est,lk,WXe=B(()=>{np();vst();dXe();gne();nk();Ip=function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},Est=10,lk=class extends bv{constructor(){super(...arguments),ib.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let n=e.choices[0]?.message;return n&&this._addMessage(n),e}_addMessage(e,n=!0){if("content"in e||(e.content=null),this.messages.push(e),n){if(this._emit("message",e),(sXe(e)||uXe(e))&&e.content)this._emit("functionCallResult",e.content);else if(mv(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(mv(e)&&e.tool_calls)for(let l of e.tool_calls)l.type==="function"&&this._emit("functionCall",l.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new At("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),Ip(this,ib,"m",bXe).call(this)}async finalMessage(){return await this.done(),Ip(this,ib,"m",vne).call(this)}async finalFunctionCall(){return await this.done(),Ip(this,ib,"m",mXe).call(this)}async finalFunctionCallResult(){return await this.done(),Ip(this,ib,"m",pXe).call(this)}async totalUsage(){return await this.done(),Ip(this,ib,"m",hXe).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let n=Ip(this,ib,"m",vne).call(this);n&&this._emit("finalMessage",n);let l=Ip(this,ib,"m",bXe).call(this);l&&this._emit("finalContent",l);let I=Ip(this,ib,"m",mXe).call(this);I&&this._emit("finalFunctionCall",I);let a=Ip(this,ib,"m",pXe).call(this);a!=null&&this._emit("finalFunctionCallResult",a),this._chatCompletions.some(c=>c.usage)&&this._emit("totalUsage",Ip(this,ib,"m",hXe).call(this))}async _createChatCompletion(e,n,l){let I=l?.signal;I&&(I.aborted&&this.controller.abort(),I.addEventListener("abort",()=>this.controller.abort())),Ip(this,ib,"m",Jst).call(this,n);let a=await e.chat.completions.create({...n,stream:!1},{...l,signal:this.controller.signal});return this._connected(),this._addChatCompletion(cS(a,n))}async _runChatCompletion(e,n,l){for(let I of n.messages)this._addMessage(I,!1);return await this._createChatCompletion(e,n,l)}async _runFunctions(e,n,l){let I="function",{function_call:a="auto",stream:c,...i}=n,s=typeof a!="string"&&a?.name,{maxChatCompletions:r=Est}=l||{},u={};for(let d of n.functions)u[d.name||d.function.name]=d;let o=n.functions.map(d=>({name:d.name||d.function.name,parameters:d.parameters,description:d.description}));for(let d of n.messages)this._addMessage(d,!1);for(let d=0;dJSON.stringify(Q.name)).join(", ")}. Please try again`;this._addMessage({role:I,name:Z,content:H});continue}let y;try{y=iXe(g)?await g.parse(N):N}catch(H){this._addMessage({role:I,name:Z,content:H instanceof Error?H.message:String(H)});continue}let X=await g.function(y,this),v=Ip(this,ib,"m",ZXe).call(this,X);if(this._addMessage({role:I,name:Z,content:v}),s)return}}async _runTools(e,n,l){let I="tool",{tool_choice:a="auto",stream:c,...i}=n,s=typeof a!="string"&&a?.function?.name,{maxChatCompletions:r=Est}=l||{},u=n.tools.map(b=>{if(fQ(b)){if(!b.$callback)throw new At("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:b.$callback,name:b.function.name,description:b.function.description||"",parameters:b.function.parameters,parse:b.$parseRaw,strict:!0}}}return b}),o={};for(let b of u)b.type==="function"&&(o[b.function.name||b.function.function.name]=b.function);let d="tools"in n?u.map(b=>b.type==="function"?{type:"function",function:{name:b.function.name||b.function.function.name,parameters:b.function.parameters,description:b.function.description,strict:b.function.strict}}:b):void 0;for(let b of n.messages)this._addMessage(b,!1);for(let b=0;bJSON.stringify(O)).join(", ")}. Please try again`;this._addMessage({role:I,tool_call_id:g,content:J});continue}let H;try{H=iXe(v)?await v.parse(X):X}catch(J){let O=J instanceof Error?J.message:String(J);this._addMessage({role:I,tool_call_id:g,content:O});continue}let Q=await v.function(H,this),L=Ip(this,ib,"m",ZXe).call(this,Q);if(this._addMessage({role:I,tool_call_id:g,content:L}),s)return}}}};ib=new WeakSet,bXe=function(){return Ip(this,ib,"m",vne).call(this).content??null},vne=function(){let e=this.messages.length;for(;e-- >0;){let n=this.messages[e];if(mv(n)){let{function_call:l,...I}=n,a={...I,content:n.content??null,refusal:n.refusal??null};return l&&(a.function_call=l),a}}throw new At("stream ended without producing a ChatCompletionMessage with role=assistant")},mXe=function(){for(let e=this.messages.length-1;e>=0;e--){let n=this.messages[e];if(mv(n)&&n?.function_call)return n.function_call;if(mv(n)&&n?.tool_calls?.length)return n.tool_calls.at(-1)?.function}},pXe=function(){for(let e=this.messages.length-1;e>=0;e--){let n=this.messages[e];if(sXe(n)&&n.content!=null||uXe(n)&&n.content!=null&&typeof n.content=="string"&&this.messages.some(l=>l.role==="assistant"&&l.tool_calls?.some(I=>I.type==="function"&&I.id===n.tool_call_id)))return n.content}},hXe=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:n}of this._chatCompletions)n&&(e.completion_tokens+=n.completion_tokens,e.prompt_tokens+=n.prompt_tokens,e.total_tokens+=n.total_tokens);return e},Jst=function(e){if(e.n!=null&&e.n>1)throw new At("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},ZXe=function(e){return typeof e=="string"?e:e===void 0?"undefined":JSON.stringify(e)}});var oS,Cst=B(()=>{WXe();dXe();oS=class t extends lk{static runFunctions(e,n,l){let I=new t,a={...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return I._run(()=>I._runFunctions(e,n,a)),I}static runTools(e,n,l){let I=new t,a={...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"runTools"}};return I._run(()=>I._runTools(e,n,a)),I}_addMessage(e,n=!0){super._addMessage(e,n),mv(e)&&e.content&&this._emit("content",e.content)}}});function RUn(t,e=Yd.ALL){if(typeof t!="string")throw new TypeError(`expecting str, got ${typeof t}`);if(!t.trim())throw new Error(`${t} is empty`);return yUn(t.trim(),e)}var Yd,NXe,VXe,yUn,YXe,Lst=B(()=>{Yd={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511},NXe=class extends Error{},VXe=class extends Error{};yUn=(t,e)=>{let n=t.length,l=0,I=d=>{throw new NXe(`${d} at position ${l}`)},a=d=>{throw new VXe(`${d} at position ${l}`)},c=()=>(o(),l>=n&&I("Unexpected end of input"),t[l]==='"'?i():t[l]==="{"?s():t[l]==="["?r():t.substring(l,l+4)==="null"||Yd.NULL&e&&n-l<4&&"null".startsWith(t.substring(l))?(l+=4,null):t.substring(l,l+4)==="true"||Yd.BOOL&e&&n-l<4&&"true".startsWith(t.substring(l))?(l+=4,!0):t.substring(l,l+5)==="false"||Yd.BOOL&e&&n-l<5&&"false".startsWith(t.substring(l))?(l+=5,!1):t.substring(l,l+8)==="Infinity"||Yd.INFINITY&e&&n-l<8&&"Infinity".startsWith(t.substring(l))?(l+=8,1/0):t.substring(l,l+9)==="-Infinity"||Yd.MINUS_INFINITY&e&&1{let d=l,b=!1;for(l++;l{l++,o();let d={};try{for(;t[l]!=="}";){if(o(),l>=n&&Yd.OBJ&e)return d;let b=i();o(),l++;try{let h=c();Object.defineProperty(d,b,{value:h,writable:!0,enumerable:!0,configurable:!0})}catch(h){if(Yd.OBJ&e)return d;throw h}o(),t[l]===","&&l++}}catch{if(Yd.OBJ&e)return d;I("Expected '}' at end of object")}return l++,d},r=()=>{l++;let d=[];try{for(;t[l]!=="]";)d.push(c()),o(),t[l]===","&&l++}catch{if(Yd.ARR&e)return d;I("Expected ']' at end of array")}return l++,d},u=()=>{if(l===0){t==="-"&&Yd.NUM&e&&I("Not sure what '-' is");try{return JSON.parse(t)}catch(b){if(Yd.NUM&e)try{return t[t.length-1]==="."?JSON.parse(t.substring(0,t.lastIndexOf("."))):JSON.parse(t.substring(0,t.lastIndexOf("e")))}catch{}a(String(b))}}let d=l;for(t[l]==="-"&&l++;t[l]&&!",]}".includes(t[l]);)l++;l==n&&!(Yd.NUM&e)&&I("Unterminated number literal");try{return JSON.parse(t.substring(d,l))}catch{t.substring(d,l)==="-"&&Yd.NUM&e&&I("Not sure what '-' is");try{return JSON.parse(t.substring(d,t.lastIndexOf("e")))}catch(h){a(String(h))}}},o=()=>{for(;lRUn(t,Yd.ALL^Yd.NUM)});function AUn(t,e){let{id:n,choices:l,created:I,model:a,system_fingerprint:c,...i}=t,s={...i,id:n,choices:l.map(({message:r,finish_reason:u,index:o,logprobs:d,...b})=>{if(!u)throw new At(`missing finish_reason for choice ${o}`);let{content:h=null,function_call:Z,tool_calls:N,...g}=r,y=r.role;if(!y)throw new At(`missing role for choice ${o}`);if(Z){let{arguments:X,name:v}=Z;if(X==null)throw new At(`missing function_call.arguments for choice ${o}`);if(!v)throw new At(`missing function_call.name for choice ${o}`);return{...b,message:{content:h,function_call:{arguments:X,name:v},role:y,refusal:r.refusal??null},finish_reason:u,index:o,logprobs:d}}return N?{...b,index:o,finish_reason:u,logprobs:d,message:{...g,role:y,content:h,refusal:r.refusal??null,tool_calls:N.map((X,v)=>{let{function:H,type:Q,id:L,...J}=X,{arguments:O,name:U,...K}=H||{};if(L==null)throw new At(`missing choices[${o}].tool_calls[${v}].id +${wne(t)}`);if(Q==null)throw new At(`missing choices[${o}].tool_calls[${v}].type +${wne(t)}`);if(U==null)throw new At(`missing choices[${o}].tool_calls[${v}].function.name +${wne(t)}`);if(O==null)throw new At(`missing choices[${o}].tool_calls[${v}].function.arguments +${wne(t)}`);return{...J,id:L,type:Q,function:{...K,name:U,arguments:O}}})}}:{...b,message:{...g,content:h,role:y,refusal:r.refusal??null},finish_reason:u,index:o,logprobs:d}}),created:I,model:a,object:"chat.completion",...c?{system_fingerprint:c}:{}};return wst(s,e)}function wne(t){return JSON.stringify(t)}var Ik,xr,ld,iA,ak,pv,gXe,fne,RXe,yXe,AXe,Xne,FXe,kst,rk,vXe=B(()=>{np();WXe();dne();nk();Lst();Ik=function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},xr=function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},rk=class t extends lk{constructor(e){super(),ld.add(this),iA.set(this,void 0),ak.set(this,void 0),pv.set(this,void 0),Ik(this,iA,e,"f"),Ik(this,ak,[],"f")}get currentChatCompletionSnapshot(){return xr(this,pv,"f")}static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static createChatCompletion(e,n,l){let I=new t(n);return I._run(()=>I._runChatCompletion(e,{...n,stream:!0},{...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"stream"}})),I}async _createChatCompletion(e,n,l){super._createChatCompletion;let I=l?.signal;I&&(I.aborted&&this.controller.abort(),I.addEventListener("abort",()=>this.controller.abort())),xr(this,ld,"m",gXe).call(this);let a=await e.chat.completions.create({...n,stream:!0},{...l,signal:this.controller.signal});this._connected();for await(let c of a)xr(this,ld,"m",RXe).call(this,c);if(a.controller.signal?.aborted)throw new ao;return this._addChatCompletion(xr(this,ld,"m",Xne).call(this))}async _fromReadableStream(e,n){let l=n?.signal;l&&(l.aborted&&this.controller.abort(),l.addEventListener("abort",()=>this.controller.abort())),xr(this,ld,"m",gXe).call(this),this._connected();let I=og.fromReadableStream(e,this.controller),a;for await(let c of I)a&&a!==c.id&&this._addChatCompletion(xr(this,ld,"m",Xne).call(this)),xr(this,ld,"m",RXe).call(this,c),a=c.id;if(I.controller.signal?.aborted)throw new ao;return this._addChatCompletion(xr(this,ld,"m",Xne).call(this))}[(iA=new WeakMap,ak=new WeakMap,pv=new WeakMap,ld=new WeakSet,gXe=function(){this.ended||Ik(this,pv,void 0,"f")},fne=function(n){let l=xr(this,ak,"f")[n.index];return l||(l={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},xr(this,ak,"f")[n.index]=l,l)},RXe=function(n){if(this.ended)return;let l=xr(this,ld,"m",kst).call(this,n);this._emit("chunk",n,l);for(let I of n.choices){let a=l.choices[I.index];I.delta.content!=null&&a.message?.role==="assistant"&&a.message?.content&&(this._emit("content",I.delta.content,a.message.content),this._emit("content.delta",{delta:I.delta.content,snapshot:a.message.content,parsed:a.message.parsed})),I.delta.refusal!=null&&a.message?.role==="assistant"&&a.message?.refusal&&this._emit("refusal.delta",{delta:I.delta.refusal,snapshot:a.message.refusal}),I.logprobs?.content!=null&&a.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:I.logprobs?.content,snapshot:a.logprobs?.content??[]}),I.logprobs?.refusal!=null&&a.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:I.logprobs?.refusal,snapshot:a.logprobs?.refusal??[]});let c=xr(this,ld,"m",fne).call(this,a);a.finish_reason&&(xr(this,ld,"m",AXe).call(this,a),c.current_tool_call_index!=null&&xr(this,ld,"m",yXe).call(this,a,c.current_tool_call_index));for(let i of I.delta.tool_calls??[])c.current_tool_call_index!==i.index&&(xr(this,ld,"m",AXe).call(this,a),c.current_tool_call_index!=null&&xr(this,ld,"m",yXe).call(this,a,c.current_tool_call_index)),c.current_tool_call_index=i.index;for(let i of I.delta.tool_calls??[]){let s=a.message.tool_calls?.[i.index];s?.type&&(s?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:s.function?.name,index:i.index,arguments:s.function.arguments,parsed_arguments:s.function.parsed_arguments,arguments_delta:i.function?.arguments??""}):(s?.type,void 0))}}},yXe=function(n,l){if(xr(this,ld,"m",fne).call(this,n).done_tool_calls.has(l))return;let a=n.message.tool_calls?.[l];if(!a)throw new Error("no tool call snapshot");if(!a.type)throw new Error("tool call snapshot missing `type`");if(a.type==="function"){let c=xr(this,iA,"f")?.tools?.find(i=>i.type==="function"&&i.function.name===a.function.name);this._emit("tool_calls.function.arguments.done",{name:a.function.name,index:l,arguments:a.function.arguments,parsed_arguments:fQ(c)?c.$parseRaw(a.function.arguments):c?.function.strict?JSON.parse(a.function.arguments):null})}else a.type},AXe=function(n){let l=xr(this,ld,"m",fne).call(this,n);if(n.message.content&&!l.content_done){l.content_done=!0;let I=xr(this,ld,"m",FXe).call(this);this._emit("content.done",{content:n.message.content,parsed:I?I.$parseRaw(n.message.content):null})}n.message.refusal&&!l.refusal_done&&(l.refusal_done=!0,this._emit("refusal.done",{refusal:n.message.refusal})),n.logprobs?.content&&!l.logprobs_content_done&&(l.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:n.logprobs.content})),n.logprobs?.refusal&&!l.logprobs_refusal_done&&(l.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:n.logprobs.refusal}))},Xne=function(){if(this.ended)throw new At("stream has ended, this shouldn't happen");let n=xr(this,pv,"f");if(!n)throw new At("request ended without sending any chunks");return Ik(this,pv,void 0,"f"),Ik(this,ak,[],"f"),AUn(n,xr(this,iA,"f"))},FXe=function(){let n=xr(this,iA,"f")?.response_format;return rS(n)?n:null},kst=function(n){var l,I,a,c;let i=xr(this,pv,"f"),{choices:s,...r}=n;i?Object.assign(i,r):i=Ik(this,pv,{...r,choices:[]},"f");for(let{delta:u,finish_reason:o,index:d,logprobs:b=null,...h}of n.choices){let Z=i.choices[d];if(Z||(Z=i.choices[d]={finish_reason:o,index:d,message:{},logprobs:b,...h}),b)if(!Z.logprobs)Z.logprobs=Object.assign({},b);else{let{content:Q,refusal:L,...J}=b;Object.assign(Z.logprobs,J),Q&&((l=Z.logprobs).content??(l.content=[]),Z.logprobs.content.push(...Q)),L&&((I=Z.logprobs).refusal??(I.refusal=[]),Z.logprobs.refusal.push(...L))}if(o&&(Z.finish_reason=o,xr(this,iA,"f")&&GXe(xr(this,iA,"f")))){if(o==="length")throw new SL;if(o==="content_filter")throw new ML}if(Object.assign(Z,h),!u)continue;let{content:N,refusal:g,function_call:y,role:X,tool_calls:v,...H}=u;if(Object.assign(Z.message,H),g&&(Z.message.refusal=(Z.message.refusal||"")+g),X&&(Z.message.role=X),y&&(Z.message.function_call?(y.name&&(Z.message.function_call.name=y.name),y.arguments&&((a=Z.message.function_call).arguments??(a.arguments=""),Z.message.function_call.arguments+=y.arguments)):Z.message.function_call=y),N&&(Z.message.content=(Z.message.content||"")+N,!Z.message.refusal&&xr(this,ld,"m",FXe).call(this)&&(Z.message.parsed=YXe(Z.message.content))),v){Z.message.tool_calls||(Z.message.tool_calls=[]);for(let{index:Q,id:L,type:J,function:O,...U}of v){let K=(c=Z.message.tool_calls)[Q]??(c[Q]={});Object.assign(K,U),L&&(K.id=L),J&&(K.type=J),O&&(K.function??(K.function={name:O.name??"",arguments:""})),O?.name&&(K.function.name=O.name),O?.arguments&&(K.function.arguments+=O.arguments,Hst(xr(this,iA,"f"),K)&&(K.function.parsed_arguments=YXe(K.function.arguments)))}}}return i},Symbol.asyncIterator)](){let e=[],n=[],l=!1;return this.on("chunk",I=>{let a=n.shift();a?a.resolve(I):e.push(I)}),this.on("end",()=>{l=!0;for(let I of n)I.resolve(void 0);n.length=0}),this.on("abort",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),this.on("error",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:l?{value:void 0,done:!0}:new Promise((a,c)=>n.push({resolve:a,reject:c})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new og(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var iS,xst=B(()=>{vXe();iS=class t extends rk{static fromReadableStream(e){let n=new t(null);return n._run(()=>n._fromReadableStream(e)),n}static runFunctions(e,n,l){let I=new t(null),a={...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return I._run(()=>I._runFunctions(e,n,a)),I}static runTools(e,n,l){let I=new t(n),a={...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"runTools"}};return I._run(()=>I._runTools(e,n,a)),I}}});var sS,jst=B(()=>{Jn();Cst();xst();vXe();nk();sS=class extends Se{parse(e,n){return Qst(e.tools),this._client.chat.completions.create(e,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"beta.chat.completions.parse"}})._thenUnwrap(l=>cS(l,e))}runFunctions(e,n){return e.stream?iS.runFunctions(this._client,e,n):oS.runFunctions(this._client,e,n)}runTools(e,n){return e.stream?iS.runTools(this._client,e,n):oS.runTools(this._client,e,n)}stream(e,n){return rk.createChatCompletion(this._client,e,n)}}});var ck,Ost=B(()=>{Jn();jst();ck=class extends Se{constructor(){super(...arguments),this.completions=new sS(this._client)}};(function(t){t.Completions=sS})(ck||(ck={}))});var ok,fXe=B(()=>{Jn();ok=class extends Se{create(e,n){return this._client.post("/realtime/sessions",{body:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}});var ik,XXe=B(()=>{Jn();ik=class extends Se{create(e,n){return this._client.post("/realtime/transcription_sessions",{body:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}});var hv,wXe=B(()=>{Jn();fXe();fXe();XXe();XXe();hv=class extends Se{constructor(){super(...arguments),this.sessions=new ok(this._client),this.transcriptionSessions=new ik(this._client)}};hv.Sessions=ok;hv.TranscriptionSessions=ik});var XQ,sk,HXe=B(()=>{Jn();dI();ai();XQ=class extends Se{create(e,n,l){return this._client.post(`/threads/${e}/messages`,{body:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}retrieve(e,n,l){return this._client.get(`/threads/${e}/messages/${n}`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}update(e,n,l,I){return this._client.post(`/threads/${e}/messages/${n}`,{body:l,...I,headers:{"OpenAI-Beta":"assistants=v2",...I?.headers}})}list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/threads/${e}/messages`,sk,{query:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}del(e,n,l){return this._client.delete(`/threads/${e}/messages/${n}`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}},sk=class extends lI{};XQ.MessagesPage=sk});var wQ,uk,QXe=B(()=>{Jn();dI();ai();wQ=class extends Se{retrieve(e,n,l,I={},a){return Al(I)?this.retrieve(e,n,l,{},I):this._client.get(`/threads/${e}/runs/${n}/steps/${l}`,{query:I,...a,headers:{"OpenAI-Beta":"assistants=v2",...a?.headers}})}list(e,n,l={},I){return Al(l)?this.list(e,n,{},l):this._client.getAPIList(`/threads/${e}/runs/${n}/steps`,uk,{query:l,...I,headers:{"OpenAI-Beta":"assistants=v2",...I?.headers}})}},uk=class extends lI{};wQ.RunStepsPage=uk});var sA,dk,EXe=B(()=>{Jn();dI();cXe();dI();QXe();QXe();ai();sA=class extends Se{constructor(){super(...arguments),this.steps=new wQ(this._client)}create(e,n,l){let{include:I,...a}=n;return this._client.post(`/threads/${e}/runs`,{query:{include:I},body:a,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers},stream:n.stream??!1})}retrieve(e,n,l){return this._client.get(`/threads/${e}/runs/${n}`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}update(e,n,l,I){return this._client.post(`/threads/${e}/runs/${n}`,{body:l,...I,headers:{"OpenAI-Beta":"assistants=v2",...I?.headers}})}list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/threads/${e}/runs`,dk,{query:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}cancel(e,n,l){return this._client.post(`/threads/${e}/runs/${n}/cancel`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}async createAndPoll(e,n,l){let I=await this.create(e,n,l);return await this.poll(e,I.id,l)}createAndStream(e,n,l){return dg.createAssistantStream(e,this._client.beta.threads.runs,n,l)}async poll(e,n,l){let I={...l?.headers,"X-Stainless-Poll-Helper":"true"};for(l?.pollIntervalMs&&(I["X-Stainless-Custom-Poll-Interval"]=l.pollIntervalMs.toString());;){let{data:a,response:c}=await this.retrieve(e,n,{...l,headers:{...l?.headers,...I}}).withResponse();switch(a.status){case"queued":case"in_progress":case"cancelling":let i=5e3;if(l?.pollIntervalMs)i=l.pollIntervalMs;else{let s=c.headers.get("openai-poll-after-ms");if(s){let r=parseInt(s);isNaN(r)||(i=r)}}await aA(i);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return a}}}stream(e,n,l){return dg.createAssistantStream(e,this._client.beta.threads.runs,n,l)}submitToolOutputs(e,n,l,I){return this._client.post(`/threads/${e}/runs/${n}/submit_tool_outputs`,{body:l,...I,headers:{"OpenAI-Beta":"assistants=v2",...I?.headers},stream:l.stream??!1})}async submitToolOutputsAndPoll(e,n,l,I){let a=await this.submitToolOutputs(e,n,l,I);return await this.poll(e,a.id,I)}submitToolOutputsStream(e,n,l,I){return dg.createToolAssistantStream(e,n,this._client.beta.threads.runs,l,I)}},dk=class extends lI{};sA.RunsPage=dk;sA.Steps=wQ;sA.RunStepsPage=uk});var Gg,JXe=B(()=>{Jn();dI();cXe();HXe();HXe();EXe();EXe();Gg=class extends Se{constructor(){super(...arguments),this.runs=new sA(this._client),this.messages=new XQ(this._client)}create(e={},n){return Al(e)?this.create({},e):this._client.post("/threads",{body:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,n){return this._client.get(`/threads/${e}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,n,l){return this._client.post(`/threads/${e}`,{body:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}del(e,n){return this._client.delete(`/threads/${e}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}createAndRun(e,n){return this._client.post("/threads/runs",{body:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers},stream:e.stream??!1})}async createAndRunPoll(e,n){let l=await this.createAndRun(e,n);return await this.runs.poll(l.thread_id,l.id,n)}createAndRunStream(e,n){return dg.createThreadAssistantStream(e,this._client.beta.threads,n)}};Gg.Runs=sA;Gg.RunsPage=dk;Gg.Messages=XQ;Gg.MessagesPage=sk});var tV,CXe=B(()=>{Jn();oXe();Ost();oXe();wXe();wXe();JXe();JXe();tV=class extends Se{constructor(){super(...arguments),this.realtime=new hv(this._client),this.chat=new ck(this._client),this.assistants=new vQ(this._client),this.threads=new Gg(this._client)}};tV.Realtime=hv;tV.Assistants=vQ;tV.AssistantsPage=tk;tV.Threads=Gg});var HQ,LXe=B(()=>{Jn();HQ=class extends Se{create(e,n){return this._client.post("/completions",{body:e,...n,stream:e.stream??!1})}}});var Gk,kXe=B(()=>{Jn();Gk=class extends Se{retrieve(e,n,l){return this._client.get(`/containers/${e}/files/${n}/content`,{...l,headers:{Accept:"application/binary",...l?.headers},__binaryResponse:!0})}}});var Zv,bk,xXe=B(()=>{Jn();dI();dI();kXe();kXe();ai();Zv=class extends Se{constructor(){super(...arguments),this.content=new Gk(this._client)}create(e,n,l){return this._client.post(`/containers/${e}/files`,lp({body:n,...l}))}retrieve(e,n,l){return this._client.get(`/containers/${e}/files/${n}`,l)}list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/containers/${e}/files`,bk,{query:n,...l})}del(e,n,l){return this._client.delete(`/containers/${e}/files/${n}`,{...l,headers:{Accept:"*/*",...l?.headers}})}},bk=class extends lI{};Zv.FileListResponsesPage=bk;Zv.Content=Gk});var bg,QQ,jXe=B(()=>{Jn();dI();xXe();xXe();ai();bg=class extends Se{constructor(){super(...arguments),this.files=new Zv(this._client)}create(e,n){return this._client.post("/containers",{body:e,...n})}retrieve(e,n){return this._client.get(`/containers/${e}`,n)}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/containers",QQ,{query:e,...n})}del(e,n){return this._client.delete(`/containers/${e}`,{...n,headers:{Accept:"*/*",...n?.headers}})}},QQ=class extends lI{};bg.ContainerListResponsesPage=QQ;bg.Files=Zv;bg.FileListResponsesPage=bk});var EQ,OXe=B(()=>{Jn();dI();EQ=class extends Se{create(e,n){let l=!!e.encoding_format,I=l?e.encoding_format:"base64";l&&IA("Request","User defined encoding_format:",e.encoding_format);let a=this._client.post("/embeddings",{body:{...e,encoding_format:I},...n});return l?a:(IA("response","Decoding base64 embeddings to float32 array"),a._thenUnwrap(c=>(c&&c.data&&c.data.forEach(i=>{let s=i.embedding;i.embedding=hst(s)}),c)))}}});var JQ,mk,UXe=B(()=>{Jn();dI();ai();JQ=class extends Se{retrieve(e,n,l,I){return this._client.get(`/evals/${e}/runs/${n}/output_items/${l}`,I)}list(e,n,l={},I){return Al(l)?this.list(e,n,{},l):this._client.getAPIList(`/evals/${e}/runs/${n}/output_items`,mk,{query:l,...I})}},mk=class extends lI{};JQ.OutputItemListResponsesPage=mk});var uA,pk,zXe=B(()=>{Jn();dI();UXe();UXe();ai();uA=class extends Se{constructor(){super(...arguments),this.outputItems=new JQ(this._client)}create(e,n,l){return this._client.post(`/evals/${e}/runs`,{body:n,...l})}retrieve(e,n,l){return this._client.get(`/evals/${e}/runs/${n}`,l)}list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/evals/${e}/runs`,pk,{query:n,...l})}del(e,n,l){return this._client.delete(`/evals/${e}/runs/${n}`,l)}cancel(e,n,l){return this._client.post(`/evals/${e}/runs/${n}`,l)}},pk=class extends lI{};uA.RunListResponsesPage=pk;uA.OutputItems=JQ;uA.OutputItemListResponsesPage=mk});var mg,CQ,BXe=B(()=>{Jn();dI();zXe();zXe();ai();mg=class extends Se{constructor(){super(...arguments),this.runs=new uA(this._client)}create(e,n){return this._client.post("/evals",{body:e,...n})}retrieve(e,n){return this._client.get(`/evals/${e}`,n)}update(e,n,l){return this._client.post(`/evals/${e}`,{body:n,...l})}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/evals",CQ,{query:e,...n})}del(e,n){return this._client.delete(`/evals/${e}`,n)}},CQ=class extends lI{};mg.EvalListResponsesPage=CQ;mg.Runs=uA;mg.RunListResponsesPage=pk});var Wv,LQ,SXe=B(()=>{Jn();dI();dI();np();dI();ai();Wv=class extends Se{create(e,n){return this._client.post("/files",lp({body:e,...n}))}retrieve(e,n){return this._client.get(`/files/${e}`,n)}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/files",LQ,{query:e,...n})}del(e,n){return this._client.delete(`/files/${e}`,n)}content(e,n){return this._client.get(`/files/${e}/content`,{...n,headers:{Accept:"application/binary",...n?.headers},__binaryResponse:!0})}retrieveContent(e,n){return this._client.get(`/files/${e}/content`,n)}async waitForProcessing(e,{pollInterval:n=5e3,maxWait:l=30*60*1e3}={}){let I=new Set(["processed","error","deleted"]),a=Date.now(),c=await this.retrieve(e);for(;!c.status||!I.has(c.status);)if(await aA(n),c=await this.retrieve(e),Date.now()-a>l)throw new qN({message:`Giving up on waiting for file ${e} to finish processing after ${l} milliseconds.`});return c}},LQ=class extends lI{};Wv.FileObjectsPage=LQ});var hk,MXe=B(()=>{Jn();hk=class extends Se{}});var Zk,TXe=B(()=>{Jn();Zk=class extends Se{run(e,n){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...n})}validate(e,n){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...n})}}});var kQ,DXe=B(()=>{Jn();TXe();TXe();kQ=class extends Se{constructor(){super(...arguments),this.graders=new Zk(this._client)}};kQ.Graders=Zk});var xQ,Wk,KXe=B(()=>{Jn();dI();ai();xQ=class extends Se{create(e,n,l){return this._client.getAPIList(`/fine_tuning/checkpoints/${e}/permissions`,Wk,{body:n,method:"post",...l})}retrieve(e,n={},l){return Al(n)?this.retrieve(e,{},n):this._client.get(`/fine_tuning/checkpoints/${e}/permissions`,{query:n,...l})}del(e,n,l){return this._client.delete(`/fine_tuning/checkpoints/${e}/permissions/${n}`,l)}},Wk=class extends ig{};xQ.PermissionCreateResponsesPage=Wk});var Nv,_Xe=B(()=>{Jn();KXe();KXe();Nv=class extends Se{constructor(){super(...arguments),this.permissions=new xQ(this._client)}};Nv.Permissions=xQ;Nv.PermissionCreateResponsesPage=Wk});var jQ,Nk,PXe=B(()=>{Jn();dI();ai();jQ=class extends Se{list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/fine_tuning/jobs/${e}/checkpoints`,Nk,{query:n,...l})}},Nk=class extends lI{};jQ.FineTuningJobCheckpointsPage=Nk});var pg,Vk,Yk,qXe=B(()=>{Jn();dI();PXe();PXe();ai();pg=class extends Se{constructor(){super(...arguments),this.checkpoints=new jQ(this._client)}create(e,n){return this._client.post("/fine_tuning/jobs",{body:e,...n})}retrieve(e,n){return this._client.get(`/fine_tuning/jobs/${e}`,n)}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/fine_tuning/jobs",Vk,{query:e,...n})}cancel(e,n){return this._client.post(`/fine_tuning/jobs/${e}/cancel`,n)}listEvents(e,n={},l){return Al(n)?this.listEvents(e,{},n):this._client.getAPIList(`/fine_tuning/jobs/${e}/events`,Yk,{query:n,...l})}pause(e,n){return this._client.post(`/fine_tuning/jobs/${e}/pause`,n)}resume(e,n){return this._client.post(`/fine_tuning/jobs/${e}/resume`,n)}},Vk=class extends lI{},Yk=class extends lI{};pg.FineTuningJobsPage=Vk;pg.FineTuningJobEventsPage=Yk;pg.Checkpoints=jQ;pg.FineTuningJobCheckpointsPage=Nk});var vh,$Xe=B(()=>{Jn();MXe();MXe();DXe();DXe();_Xe();_Xe();qXe();qXe();vh=class extends Se{constructor(){super(...arguments),this.methods=new hk(this._client),this.jobs=new pg(this._client),this.checkpoints=new Nv(this._client),this.alpha=new kQ(this._client)}};vh.Methods=hk;vh.Jobs=pg;vh.FineTuningJobsPage=Vk;vh.FineTuningJobEventsPage=Yk;vh.Checkpoints=Nv;vh.Alpha=kQ});var gk,ewe=B(()=>{Jn();gk=class extends Se{}});var Vv,twe=B(()=>{Jn();ewe();ewe();Vv=class extends Se{constructor(){super(...arguments),this.graderModels=new gk(this._client)}};Vv.GraderModels=gk});var OQ,nwe=B(()=>{Jn();dI();OQ=class extends Se{createVariation(e,n){return this._client.post("/images/variations",lp({body:e,...n}))}edit(e,n){return this._client.post("/images/edits",lp({body:e,...n}))}generate(e,n){return this._client.post("/images/generations",{body:e,...n})}}});var Yv,UQ,lwe=B(()=>{Jn();ai();Yv=class extends Se{retrieve(e,n){return this._client.get(`/models/${e}`,n)}list(e){return this._client.getAPIList("/models",UQ,e)}del(e,n){return this._client.delete(`/models/${e}`,n)}},UQ=class extends ig{};Yv.ModelsPage=UQ});var zQ,Iwe=B(()=>{Jn();zQ=class extends Se{create(e,n){return this._client.post("/moderations",{body:e,...n})}}});function Ust(t,e){return!e||!KUn(e)?{...t,output_parsed:null,output:t.output.map(n=>n.type==="function_call"?{...n,parsed_arguments:null}:n.type==="message"?{...n,content:n.content.map(l=>({...l,parsed:null}))}:n)}:awe(t,e)}function awe(t,e){let n=t.output.map(I=>{if(I.type==="function_call")return{...I,parsed_arguments:qUn(e,I)};if(I.type==="message"){let a=I.content.map(c=>c.type==="output_text"?{...c,parsed:DUn(e,c.text)}:c);return{...I,content:a}}return I}),l=Object.assign({},t,{output:n});return Object.getOwnPropertyDescriptor(t,"output_text")||rwe(l),Object.defineProperty(l,"output_parsed",{enumerable:!0,get(){for(let I of l.output)if(I.type==="message"){for(let a of I.content)if(a.type==="output_text"&&a.parsed!==null)return a.parsed}return null}}),l}function DUn(t,e){return t.text?.format?.type!=="json_schema"?null:"$parseRaw"in t.text?.format?(t.text?.format).$parseRaw(e):JSON.parse(e)}function KUn(t){return!!rS(t.text?.format)}function _Un(t){return t?.$brand==="auto-parseable-tool"}function PUn(t,e){return t.find(n=>n.type==="function"&&n.name===e)}function qUn(t,e){let n=PUn(t.tools??[],e.name);return{...e,...e,parsed_arguments:_Un(n)?n.$parseRaw(e.arguments):n?.strict?JSON.parse(e.arguments):null}}function rwe(t){let e=[];for(let n of t.output)if(n.type==="message")for(let l of n.content)l.type==="output_text"&&e.push(l.text);t.output_text=e.join("")}var cwe=B(()=>{nk()});var Rk,owe=B(()=>{Jn();dI();Qne();Rk=class extends Se{list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/responses/${e}/input_items`,Hne,{query:n,...l})}}});function e9n(t,e){return Ust(t,e)}var yk,gv,Ak,Ene,Rv,Jne,zst,Bst,Sst,Mst,Cne,Tst=B(()=>{np();gne();cwe();yk=function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},gv=function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},Cne=class t extends bv{constructor(e){super(),Ak.add(this),Ene.set(this,void 0),Rv.set(this,void 0),Jne.set(this,void 0),yk(this,Ene,e,"f")}static createResponse(e,n,l){let I=new t(n);return I._run(()=>I._createOrRetrieveResponse(e,n,{...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"stream"}})),I}async _createOrRetrieveResponse(e,n,l){let I=l?.signal;I&&(I.aborted&&this.controller.abort(),I.addEventListener("abort",()=>this.controller.abort())),gv(this,Ak,"m",zst).call(this);let a,c=null;"response_id"in n?(a=await e.responses.retrieve(n.response_id,{stream:!0},{...l,signal:this.controller.signal,stream:!0}),c=n.starting_after??null):a=await e.responses.create({...n,stream:!0},{...l,signal:this.controller.signal}),this._connected();for await(let i of a)gv(this,Ak,"m",Bst).call(this,i,c);if(a.controller.signal?.aborted)throw new ao;return gv(this,Ak,"m",Sst).call(this)}[(Ene=new WeakMap,Rv=new WeakMap,Jne=new WeakMap,Ak=new WeakSet,zst=function(){this.ended||yk(this,Rv,void 0,"f")},Bst=function(n,l){if(this.ended)return;let I=(c,i)=>{(l==null||i.sequence_number>l)&&this._emit(c,i)},a=gv(this,Ak,"m",Mst).call(this,n);switch(I("event",n),n.type){case"response.output_text.delta":{let c=a.output[n.output_index];if(!c)throw new At(`missing output at index ${n.output_index}`);if(c.type==="message"){let i=c.content[n.content_index];if(!i)throw new At(`missing content at index ${n.content_index}`);if(i.type!=="output_text")throw new At(`expected content to be 'output_text', got ${i.type}`);I("response.output_text.delta",{...n,snapshot:i.text})}break}case"response.function_call_arguments.delta":{let c=a.output[n.output_index];if(!c)throw new At(`missing output at index ${n.output_index}`);c.type==="function_call"&&I("response.function_call_arguments.delta",{...n,snapshot:c.arguments});break}default:I(n.type,n);break}},Sst=function(){if(this.ended)throw new At("stream has ended, this shouldn't happen");let n=gv(this,Rv,"f");if(!n)throw new At("request ended without sending any events");yk(this,Rv,void 0,"f");let l=e9n(n,gv(this,Ene,"f"));return yk(this,Jne,l,"f"),l},Mst=function(n){let l=gv(this,Rv,"f");if(!l){if(n.type!=="response.created")throw new At(`When snapshot hasn't been set yet, expected 'response.created' event, got ${n.type}`);return l=yk(this,Rv,n.response,"f"),l}switch(n.type){case"response.output_item.added":{l.output.push(n.item);break}case"response.content_part.added":{let I=l.output[n.output_index];if(!I)throw new At(`missing output at index ${n.output_index}`);I.type==="message"&&I.content.push(n.part);break}case"response.output_text.delta":{let I=l.output[n.output_index];if(!I)throw new At(`missing output at index ${n.output_index}`);if(I.type==="message"){let a=I.content[n.content_index];if(!a)throw new At(`missing content at index ${n.content_index}`);if(a.type!=="output_text")throw new At(`expected content to be 'output_text', got ${a.type}`);a.text+=n.delta}break}case"response.function_call_arguments.delta":{let I=l.output[n.output_index];if(!I)throw new At(`missing output at index ${n.output_index}`);I.type==="function_call"&&(I.arguments+=n.delta);break}case"response.completed":{yk(this,Rv,n.response,"f");break}}return l},Symbol.asyncIterator)](){let e=[],n=[],l=!1;return this.on("event",I=>{let a=n.shift();a?a.resolve(I):e.push(I)}),this.on("end",()=>{l=!0;for(let I of n)I.resolve(void 0);n.length=0}),this.on("abort",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),this.on("error",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:l?{value:void 0,done:!0}:new Promise((a,c)=>n.push({resolve:a,reject:c})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let e=gv(this,Jne,"f");if(!e)throw new At("stream ended without producing a ChatCompletion");return e}}});var yv,Hne,Qne=B(()=>{cwe();Jn();owe();owe();Tst();ai();yv=class extends Se{constructor(){super(...arguments),this.inputItems=new Rk(this._client)}create(e,n){return this._client.post("/responses",{body:e,...n,stream:e.stream??!1})._thenUnwrap(l=>("object"in l&&l.object==="response"&&rwe(l),l))}retrieve(e,n={},l){return this._client.get(`/responses/${e}`,{query:n,...l,stream:n?.stream??!1})}del(e,n){return this._client.delete(`/responses/${e}`,{...n,headers:{Accept:"*/*",...n?.headers}})}parse(e,n){return this._client.responses.create(e,n)._thenUnwrap(l=>awe(l,e))}stream(e,n){return Cne.createResponse(this._client,e,n)}cancel(e,n){return this._client.post(`/responses/${e}/cancel`,{...n,headers:{Accept:"*/*",...n?.headers}})}},Hne=class extends lI{};yv.InputItems=Rk});var Fk,iwe=B(()=>{Jn();dI();Fk=class extends Se{create(e,n,l){return this._client.post(`/uploads/${e}/parts`,lp({body:n,...l}))}}});var Av,swe=B(()=>{Jn();iwe();iwe();Av=class extends Se{constructor(){super(...arguments),this.parts=new Fk(this._client)}create(e,n){return this._client.post("/uploads",{body:e,...n})}cancel(e,n){return this._client.post(`/uploads/${e}/cancel`,n)}complete(e,n,l){return this._client.post(`/uploads/${e}/complete`,{body:n,...l})}};Av.Parts=Fk});var Dst,Kst=B(()=>{Dst=async t=>{let e=await Promise.allSettled(t),n=e.filter(I=>I.status==="rejected");if(n.length){for(let I of n)console.error(I.reason);throw new Error(`${n.length} promise(s) failed - see the above errors`)}let l=[];for(let I of e)I.status==="fulfilled"&&l.push(I.value);return l}});var Fv,vv,vk,Lne=B(()=>{Jn();dI();ai();Fv=class extends Se{create(e,n,l){return this._client.post(`/vector_stores/${e}/files`,{body:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}retrieve(e,n,l){return this._client.get(`/vector_stores/${e}/files/${n}`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}update(e,n,l,I){return this._client.post(`/vector_stores/${e}/files/${n}`,{body:l,...I,headers:{"OpenAI-Beta":"assistants=v2",...I?.headers}})}list(e,n={},l){return Al(n)?this.list(e,{},n):this._client.getAPIList(`/vector_stores/${e}/files`,vv,{query:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}del(e,n,l){return this._client.delete(`/vector_stores/${e}/files/${n}`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}async createAndPoll(e,n,l){let I=await this.create(e,n,l);return await this.poll(e,I.id,l)}async poll(e,n,l){let I={...l?.headers,"X-Stainless-Poll-Helper":"true"};for(l?.pollIntervalMs&&(I["X-Stainless-Custom-Poll-Interval"]=l.pollIntervalMs.toString());;){let a=await this.retrieve(e,n,{...l,headers:I}).withResponse(),c=a.data;switch(c.status){case"in_progress":let i=5e3;if(l?.pollIntervalMs)i=l.pollIntervalMs;else{let s=a.response.headers.get("openai-poll-after-ms");if(s){let r=parseInt(s);isNaN(r)||(i=r)}}await aA(i);break;case"failed":case"completed":return c}}}async upload(e,n,l){let I=await this._client.files.create({file:n,purpose:"assistants"},l);return this.create(e,{file_id:I.id},l)}async uploadAndPoll(e,n,l){let I=await this.upload(e,n,l);return await this.poll(e,I.id,l)}content(e,n,l){return this._client.getAPIList(`/vector_stores/${e}/files/${n}/content`,vk,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}},vv=class extends lI{},vk=class extends ig{};Fv.VectorStoreFilesPage=vv;Fv.FileContentResponsesPage=vk});var fk,uwe=B(()=>{Jn();dI();dI();Kst();Lne();fk=class extends Se{create(e,n,l){return this._client.post(`/vector_stores/${e}/file_batches`,{body:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}retrieve(e,n,l){return this._client.get(`/vector_stores/${e}/file_batches/${n}`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}cancel(e,n,l){return this._client.post(`/vector_stores/${e}/file_batches/${n}/cancel`,{...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}async createAndPoll(e,n,l){let I=await this.create(e,n);return await this.poll(e,I.id,l)}listFiles(e,n,l={},I){return Al(l)?this.listFiles(e,n,{},l):this._client.getAPIList(`/vector_stores/${e}/file_batches/${n}/files`,vv,{query:l,...I,headers:{"OpenAI-Beta":"assistants=v2",...I?.headers}})}async poll(e,n,l){let I={...l?.headers,"X-Stainless-Poll-Helper":"true"};for(l?.pollIntervalMs&&(I["X-Stainless-Custom-Poll-Interval"]=l.pollIntervalMs.toString());;){let{data:a,response:c}=await this.retrieve(e,n,{...l,headers:I}).withResponse();switch(a.status){case"in_progress":let i=5e3;if(l?.pollIntervalMs)i=l.pollIntervalMs;else{let s=c.headers.get("openai-poll-after-ms");if(s){let r=parseInt(s);isNaN(r)||(i=r)}}await aA(i);break;case"failed":case"cancelled":case"completed":return a}}}async uploadAndPoll(e,{files:n,fileIds:l=[]},I){if(n==null||n.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let a=I?.maxConcurrency??5,c=Math.min(a,n.length),i=this._client,s=n.values(),r=[...l];async function u(d){for(let b of d){let h=await i.files.create({file:b,purpose:"assistants"},I);r.push(h.id)}}let o=Array(c).fill(s).map(u);return await Dst(o),await this.createAndPoll(e,{file_ids:r})}}});var fh,BQ,SQ,dwe=B(()=>{Jn();dI();uwe();uwe();Lne();Lne();ai();fh=class extends Se{constructor(){super(...arguments),this.files=new Fv(this._client),this.fileBatches=new fk(this._client)}create(e,n){return this._client.post("/vector_stores",{body:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,n){return this._client.get(`/vector_stores/${e}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,n,l){return this._client.post(`/vector_stores/${e}`,{body:n,...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}list(e={},n){return Al(e)?this.list({},e):this._client.getAPIList("/vector_stores",BQ,{query:e,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,n){return this._client.delete(`/vector_stores/${e}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}search(e,n,l){return this._client.getAPIList(`/vector_stores/${e}/search`,SQ,{body:n,method:"post",...l,headers:{"OpenAI-Beta":"assistants=v2",...l?.headers}})}},BQ=class extends lI{},SQ=class extends ig{};fh.VectorStoresPage=BQ;fh.VectorStoreSearchResponsesPage=SQ;fh.Files=Fv;fh.VectorStoreFilesPage=vv;fh.FileContentResponsesPage=vk;fh.FileBatches=fk});var _st=B(()=>{Zst();Wst();lXe();IXe();CXe();LXe();jXe();OXe();BXe();SXe();$Xe();twe();nwe();lwe();Iwe();Qne();swe();dwe()});var qst,xt,fv,a9n,Pst,nV=B(()=>{Tit();dI();np();_B();_st();IXe();LXe();OXe();SXe();nwe();lwe();Iwe();lXe();CXe();$fe();jXe();BXe();$Xe();twe();Qne();swe();dwe();qB();_B();np();xt=class extends pne{constructor({baseURL:e=sv("OPENAI_BASE_URL"),apiKey:n=sv("OPENAI_API_KEY"),organization:l=sv("OPENAI_ORG_ID")??null,project:I=sv("OPENAI_PROJECT_ID")??null,...a}={}){if(n===void 0)throw new At("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");let c={apiKey:n,organization:l,project:I,...a,baseURL:e||"https://api.openai.com/v1"};if(!c.dangerouslyAllowBrowser&&pst())throw new At(`It looks like you're running in a browser-like environment. + +This is disabled by default, as it risks exposing your secret API credentials to attackers. +If you understand the risks and have appropriate mitigations in place, +you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., + +new OpenAI({ apiKey, dangerouslyAllowBrowser: true }); + +https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety +`);super({baseURL:c.baseURL,timeout:c.timeout??6e5,httpAgent:c.httpAgent,maxRetries:c.maxRetries,fetch:c.fetch}),this.completions=new HQ(this),this.chat=new cA(this),this.embeddings=new EQ(this),this.files=new Wv(this),this.images=new OQ(this),this.audio=new sg(this),this.moderations=new zQ(this),this.models=new Yv(this),this.fineTuning=new vh(this),this.graders=new Vv(this),this.vectorStores=new fh(this),this.beta=new tV(this),this.batches=new Gv(this),this.uploads=new Av(this),this.responses=new yv(this),this.evals=new mg(this),this.containers=new bg(this),this._options=c,this.apiKey=n,this.organization=l,this.project=I}defaultQuery(){return this._options.defaultQuery}defaultHeaders(e){return{...super.defaultHeaders(e),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project,...this._options.defaultHeaders}}authHeaders(e){return{Authorization:`Bearer ${this.apiKey}`}}stringifyQuery(e){return Jfe(e,{arrayFormat:"brackets"})}};qst=xt;xt.OpenAI=qst;xt.DEFAULT_TIMEOUT=6e5;xt.OpenAIError=At;xt.APIError=Ii;xt.APIConnectionError=lA;xt.APIConnectionTimeoutError=qN;xt.APIUserAbortError=ao;xt.NotFoundError=jL;xt.ConflictError=OL;xt.RateLimitError=zL;xt.BadRequestError=LL;xt.AuthenticationError=kL;xt.InternalServerError=BL;xt.PermissionDeniedError=xL;xt.UnprocessableEntityError=UL;xt.toFile=TL;xt.fileFromPath=TB;xt.Completions=HQ;xt.Chat=cA;xt.ChatCompletionsPage=dv;xt.Embeddings=EQ;xt.Files=Wv;xt.FileObjectsPage=LQ;xt.Images=OQ;xt.Audio=sg;xt.Moderations=zQ;xt.Models=Yv;xt.ModelsPage=UQ;xt.FineTuning=vh;xt.Graders=Vv;xt.VectorStores=fh;xt.VectorStoresPage=BQ;xt.VectorStoreSearchResponsesPage=SQ;xt.Beta=tV;xt.Batches=Gv;xt.BatchesPage=yQ;xt.Uploads=Av;xt.Responses=yv;xt.Evals=mg;xt.EvalListResponsesPage=CQ;xt.Containers=bg;xt.ContainerListResponsesPage=QQ;fv=class extends xt{constructor({baseURL:e=sv("OPENAI_BASE_URL"),apiKey:n=sv("AZURE_OPENAI_API_KEY"),apiVersion:l=sv("OPENAI_API_VERSION"),endpoint:I,deployment:a,azureADTokenProvider:c,dangerouslyAllowBrowser:i,...s}={}){if(!l)throw new At("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");if(typeof c=="function"&&(i=!0),!c&&!n)throw new At("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");if(c&&n)throw new At("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");if(n??(n=Pst),s.defaultQuery={...s.defaultQuery,"api-version":l},e){if(I)throw new At("baseURL and endpoint are mutually exclusive")}else{if(I||(I=process.env.AZURE_OPENAI_ENDPOINT),!I)throw new At("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable");e=`${I}/openai`}super({apiKey:n,baseURL:e,...s,...i!==void 0?{dangerouslyAllowBrowser:i}:{}}),this.apiVersion="",this._azureADTokenProvider=c,this.apiVersion=l,this.deploymentName=a}buildRequest(e,n={}){if(a9n.has(e.path)&&e.method==="post"&&e.body!==void 0){if(!DL(e.body))throw new Error("Expected request body to be an object");let l=this.deploymentName||e.body.model||e.__metadata?.model;l!==void 0&&!this.baseURL.includes("/deployments")&&(e.path=`/deployments/${l}${e.path}`)}return super.buildRequest(e,n)}async _getAzureADToken(){if(typeof this._azureADTokenProvider=="function"){let e=await this._azureADTokenProvider();if(!e||typeof e!="string")throw new At(`Expected 'azureADTokenProvider' argument to return a string but it returned ${e}`);return e}}authHeaders(e){return{}}async prepareOptions(e){if(e.headers?.["api-key"])return super.prepareOptions(e);let n=await this._getAzureADToken();if(e.headers??(e.headers={}),n)e.headers.Authorization=`Bearer ${n}`;else if(this.apiKey!==Pst)e.headers["api-key"]=this.apiKey;else throw new At("Unable to handle auth");return super.prepareOptions(e)}},a9n=new Set(["/completions","/chat/completions","/embeddings","/audio/transcriptions","/audio/translations","/audio/speech","/images/generations","/images/edits"]),Pst=""});var Xh=B(()=>{zY()});var Xk=B(()=>{ate()});function uS(t,e){if(t.function===void 0)return;let n;if(e?.partial)try{n=LY(t.function.arguments??"{}")}catch{return}else try{n=JSON.parse(t.function.arguments)}catch(I){throw new $t([`Function "${t.function.name}" arguments:`,"",t.function.arguments,"","are not valid JSON.",`Error: ${I.message}`].join(` +`))}let l={name:t.function.name,args:n,type:"tool_call"};return e?.returnId&&(l.id=t.id),l}function kne(t){if(t.id===void 0)throw new Error('All OpenAI tool calls must have an "id" field.');return{id:t.id,type:"function",function:{name:t.name,arguments:JSON.stringify(t.args)}}}function xne(t,e){return{name:t.function?.name,args:t.function?.arguments,id:t.id,error:e,type:"invalid_tool_call"}}var Gwe,Xv,$st=B(()=>{sQ();Fve();q2();ZH();Ly();Gwe=class extends SN{static lc_name(){return"JsonOutputToolsParser"}constructor(e){super(e),Object.defineProperty(this,"returnId",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","output_parsers","openai_tools"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.returnId=e?.returnId??this.returnId}_diff(){throw new Error("Not supported.")}async parse(){throw new Error("Not implemented.")}async parseResult(e){return await this.parsePartialResult(e,!1)}async parsePartialResult(e,n=!0){let l=e[0].message,I;if(qG(l)&&l.tool_calls?.length?I=l.tool_calls.map(c=>{let{id:i,...s}=c;return this.returnId?{id:i,...s}:s}):l.additional_kwargs.tool_calls!==void 0&&(I=JSON.parse(JSON.stringify(l.additional_kwargs.tool_calls)).map(i=>uS(i,{returnId:this.returnId,partial:n}))),!I)return[];let a=[];for(let c of I)if(c!==void 0){let i={type:c.name,args:c.args,id:c.id};a.push(i)}return a}},Xv=class extends Gwe{static lc_name(){return"JsonOutputKeyToolsParser"}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","output_parsers","openai_tools"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"returnId",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"keyName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnSingle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"zodSchema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.keyName=e.keyName,this.returnSingle=e.returnSingle??this.returnSingle,this.zodSchema=e.zodSchema}async _validateResult(e){if(this.zodSchema===void 0)return e;let n=await Cy(this.zodSchema,e);if(n.success)return n.data;throw new $t(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(n.error?.issues)}`,JSON.stringify(e,null,2))}async parsePartialResult(e){let l=(await super.parsePartialResult(e)).filter(a=>a.type===this.keyName),I=l;if(l.length)return this.returnId||(I=l.map(a=>a.args)),this.returnSingle?I[0]:I}async parseResult(e){let l=(await super.parsePartialResult(e,!1)).filter(c=>c.type===this.keyName),I=l;return l.length?(this.returnId||(I=l.map(c=>c.args)),this.returnSingle?this._validateResult(I[0]):await Promise.all(I.map(c=>this._validateResult(c)))):void 0}}});var eut=B(()=>{$st()});var bwe=B(()=>{eut()});var nut,tut,lut,jne=B(()=>{nut=Symbol("Let zodToJsonSchema decide on which parser to use"),tut={name:void 0,$refStrategy:"root",effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",nullableStrategy:"from-target",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},lut=t=>typeof t=="string"?{...tut,basePath:["#"],definitions:{},name:t}:{...tut,basePath:["#"],definitions:{},...t}});function Iut(t){if(!t)return!0;for(let e in t)return!1;return!0}var dS,mwe=B(()=>{dS=t=>"_def"in t?t._def:t});var aut,pwe=B(()=>{jne();mwe();aut=t=>{let e=lut(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seenRefs:new Set,seen:new Map(Object.entries(e.definitions).map(([l,I])=>[dS(I),{def:dS(I),path:[...e.basePath,e.definitionPath,l],jsonSchema:void 0}]))}}});function hwe(t,e,n,l){l?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}function yI(t,e,n,l,I){t[e]=n,hwe(t,e,l,I)}var wv=B(()=>{});function rut(){return{}}var Zwe=B(()=>{});function cut(t,e){let n={type:"array"};return t.type?._def?.typeName!==ve.ZodAny&&(n.items=Fn(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&yI(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&yI(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(yI(n,"minItems",t.exactLength.value,t.exactLength.message,e),yI(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}var Wwe=B(()=>{ab();wv();ri()});function out(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let l of t.checks)switch(l.kind){case"min":e.target==="jsonSchema7"?l.inclusive?yI(n,"minimum",l.value,l.message,e):yI(n,"exclusiveMinimum",l.value,l.message,e):(l.inclusive||(n.exclusiveMinimum=!0),yI(n,"minimum",l.value,l.message,e));break;case"max":e.target==="jsonSchema7"?l.inclusive?yI(n,"maximum",l.value,l.message,e):yI(n,"exclusiveMaximum",l.value,l.message,e):(l.inclusive||(n.exclusiveMaximum=!0),yI(n,"maximum",l.value,l.message,e));break;case"multipleOf":yI(n,"multipleOf",l.value,l.message,e);break}return n}var Nwe=B(()=>{wv()});function iut(){return{type:"boolean"}}var Vwe=B(()=>{});function sut(t,e){return Fn(t.type._def,e)}var Ywe=B(()=>{ri()});var uut,gwe=B(()=>{ri();uut=(t,e)=>Fn(t.innerType._def,e)});function Rwe(t,e,n){let l=n??e.dateStrategy;if(Array.isArray(l))return{anyOf:l.map((I,a)=>Rwe(t,e,I))};switch(l){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return r9n(t,e)}}var r9n,ywe=B(()=>{wv();r9n=(t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let l of t.checks)switch(l.kind){case"min":yI(n,"minimum",l.value,l.message,e);break;case"max":yI(n,"maximum",l.value,l.message,e);break}return n}});function dut(t,e){return{...Fn(t.innerType._def,e),default:t.defaultValue()}}var Awe=B(()=>{ri()});function Gut(t,e,n){return e.effectStrategy==="input"?Fn(t.schema._def,e,n):{}}var Fwe=B(()=>{ri()});function but(t){return{type:"string",enum:[...t.values]}}var vwe=B(()=>{});function mut(t,e){let n=[Fn(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Fn(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(a=>!!a),l=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,I=[];return n.forEach(a=>{if(c9n(a))I.push(...a.allOf),a.unevaluatedProperties===void 0&&(l=void 0);else{let c=a;if("additionalProperties"in a&&a.additionalProperties===!1){let{additionalProperties:i,...s}=a;c=s}else l=void 0;I.push(c)}}),I.length?{allOf:I,...l}:void 0}var c9n,fwe=B(()=>{ri();c9n=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function put(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}var Xwe=B(()=>{});function One(t,e){let n={type:"string"};function l(I){return e.patternStrategy==="escape"?o9n(I):I}if(t.checks)for(let I of t.checks)switch(I.kind){case"min":yI(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,I.value):I.value,I.message,e);break;case"max":yI(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,I.value):I.value,I.message,e);break;case"email":switch(e.emailStrategy){case"format:email":lV(n,"email",I.message,e);break;case"format:idn-email":lV(n,"idn-email",I.message,e);break;case"pattern:zod":IV(n,MQ.email,I.message,e);break}break;case"url":lV(n,"uri",I.message,e);break;case"uuid":lV(n,"uuid",I.message,e);break;case"regex":IV(n,I.regex,I.message,e);break;case"cuid":IV(n,MQ.cuid,I.message,e);break;case"cuid2":IV(n,MQ.cuid2,I.message,e);break;case"startsWith":IV(n,RegExp(`^${l(I.value)}`),I.message,e);break;case"endsWith":IV(n,RegExp(`${l(I.value)}$`),I.message,e);break;case"datetime":lV(n,"date-time",I.message,e);break;case"date":lV(n,"date",I.message,e);break;case"time":lV(n,"time",I.message,e);break;case"duration":lV(n,"duration",I.message,e);break;case"length":yI(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,I.value):I.value,I.message,e),yI(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,I.value):I.value,I.message,e);break;case"includes":{IV(n,RegExp(l(I.value)),I.message,e);break}case"ip":{I.version!=="v6"&&lV(n,"ipv4",I.message,e),I.version!=="v4"&&lV(n,"ipv6",I.message,e);break}case"emoji":IV(n,MQ.emoji,I.message,e);break;case"ulid":{IV(n,MQ.ulid,I.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{lV(n,"binary",I.message,e);break}case"contentEncoding:base64":{yI(n,"contentEncoding","base64",I.message,e);break}case"pattern:zod":{IV(n,MQ.base64,I.message,e);break}}break}case"nanoid":IV(n,MQ.nanoid,I.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}var wwe,MQ,o9n,lV,IV,hut,Une=B(()=>{wv();MQ={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(wwe===void 0&&(wwe=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),wwe),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/};o9n=t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),lV=(t,e,n,l)=>{t.format||t.anyOf?.some(I=>I.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&l.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&l.errorMessages&&{errorMessage:{format:n}}})):yI(t,"format",e,n,l)},IV=(t,e,n,l)=>{t.pattern||t.allOf?.some(I=>I.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&l.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:hut(e,l),...n&&l.errorMessages&&{errorMessage:{pattern:n}}})):yI(t,"pattern",hut(e,l),n,l)},hut=(t,e)=>{let n=typeof t=="function"?t():t;if(!e.applyRegexFlags||!n.flags)return n.source;let l={i:n.flags.includes("i"),m:n.flags.includes("m"),s:n.flags.includes("s")},I=l.i?n.source.toLowerCase():n.source,a="",c=!1,i=!1,s=!1;for(let r=0;r({...l,[I]:Fn(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",I]})??{}}),{}),additionalProperties:!1};let n={type:"object",additionalProperties:Fn(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??{}};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===ve.ZodString&&t.keyType._def.checks?.length){let l=Object.entries(One(t.keyType._def,e)).reduce((I,[a,c])=>a==="type"?I:{...I,[a]:c},{});return{...n,propertyNames:l}}else if(t.keyType?._def.typeName===ve.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};return n}var Bne=B(()=>{ab();ri();Une()});function Zut(t,e){if(e.mapStrategy==="record")return zne(t,e);let n=Fn(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},l=Fn(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,l],minItems:2,maxItems:2}}}var Hwe=B(()=>{ri();Bne()});function Wut(t){let e=t.values,l=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),I=Array.from(new Set(l.map(a=>typeof a)));return{type:I.length===1?I[0]==="string"?"string":"number":["string","number"],enum:l}}var Qwe=B(()=>{});function Nut(){return{not:{}}}var Ewe=B(()=>{});function Vut(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Jwe=B(()=>{});function gut(t,e){if(e.target==="openApi3")return Yut(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(l=>l._def.typeName in GS&&(!l._def.checks||!l._def.checks.length))){let l=n.reduce((I,a)=>{let c=GS[a._def.typeName];return c&&!I.includes(c)?[...I,c]:I},[]);return{type:l.length>1?l:l[0]}}else if(n.every(l=>l._def.typeName==="ZodLiteral"&&!l.description)){let l=n.reduce((I,a)=>{let c=typeof a._def.value;switch(c){case"string":case"number":case"boolean":return[...I,c];case"bigint":return[...I,"integer"];case"object":if(a._def.value===null)return[...I,"null"];case"symbol":case"undefined":case"function":default:return I}},[]);if(l.length===n.length){let I=l.filter((a,c,i)=>i.indexOf(a)===c);return{type:I.length>1?I:I[0],enum:n.reduce((a,c)=>a.includes(c._def.value)?a:[...a,c._def.value],[])}}}else if(n.every(l=>l._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((l,I)=>[...l,...I._def.values.filter(a=>!l.includes(a))],[])};return Yut(t,e)}var GS,Yut,Sne=B(()=>{ri();GS={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Yut=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((l,I)=>Fn(l._def,{...e,currentPath:[...e.currentPath,"anyOf",`${I}`]})).filter(l=>!!l&&(!e.strictUnions||typeof l=="object"&&Object.keys(l).length>0));return n.length?{anyOf:n}:void 0}});function Rut(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"||e.nullableStrategy==="property"?{type:GS[t.innerType._def.typeName],nullable:!0}:{type:[GS[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let l=Fn(t.innerType._def,{...e,currentPath:[...e.currentPath]});return l&&"$ref"in l?{allOf:[l],nullable:!0}:l&&{...l,nullable:!0}}let n=Fn(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}var Cwe=B(()=>{ri();Sne()});function yut(t,e){let n={type:"number"};if(!t.checks)return n;for(let l of t.checks)switch(l.kind){case"int":n.type="integer",hwe(n,"type",l.message,e);break;case"min":e.target==="jsonSchema7"?l.inclusive?yI(n,"minimum",l.value,l.message,e):yI(n,"exclusiveMinimum",l.value,l.message,e):(l.inclusive||(n.exclusiveMinimum=!0),yI(n,"minimum",l.value,l.message,e));break;case"max":e.target==="jsonSchema7"?l.inclusive?yI(n,"maximum",l.value,l.message,e):yI(n,"exclusiveMaximum",l.value,l.message,e):(l.inclusive||(n.exclusiveMaximum=!0),yI(n,"maximum",l.value,l.message,e));break;case"multipleOf":yI(n,"multipleOf",l.value,l.message,e);break}return n}var Lwe=B(()=>{wv()});function i9n(t,e){return e.removeAdditionalStrategy==="strict"?t.catchall._def.typeName==="ZodNever"?t.unknownKeys!=="strict":Fn(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":Fn(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0}function Aut(t,e){let n={type:"object",...Object.entries(t.shape()).reduce((l,[I,a])=>{if(a===void 0||a._def===void 0)return l;let c=[...e.currentPath,"properties",I],i=Fn(a._def,{...e,currentPath:c,propertyPath:c});return i===void 0?l:(e.openaiStrictMode&&a.isOptional()&&!a.isNullable()&&console.warn(`Zod field at \`${c.join("/")}\` uses \`.optional()\` without \`.nullable()\` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required +This will become an error in a future version of the SDK.`),{properties:{...l.properties,[I]:i},required:a.isOptional()&&!e.openaiStrictMode?l.required:[...l.required,I]})},{properties:{},required:[]}),additionalProperties:i9n(t,e)};return n.required.length||delete n.required,n}var kwe=B(()=>{ri()});var Fut,xwe=B(()=>{ri();Fut=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Fn(t.innerType._def,e);let n=Fn(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}}});var vut,jwe=B(()=>{ri();vut=(t,e)=>{if(e.pipeStrategy==="input")return Fn(t.in._def,e);if(e.pipeStrategy==="output")return Fn(t.out._def,e);let n=Fn(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),l=Fn(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,l].filter(I=>I!==void 0)}}});function fut(t,e){return Fn(t.type._def,e)}var Owe=B(()=>{ri()});function Xut(t,e){let l={type:"array",uniqueItems:!0,items:Fn(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&yI(l,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&yI(l,"maxItems",t.maxSize.value,t.maxSize.message,e),l}var Uwe=B(()=>{wv();ri()});function wut(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,l)=>Fn(n._def,{...e,currentPath:[...e.currentPath,"items",`${l}`]})).reduce((n,l)=>l===void 0?n:[...n,l],[]),additionalItems:Fn(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,l)=>Fn(n._def,{...e,currentPath:[...e.currentPath,"items",`${l}`]})).reduce((n,l)=>l===void 0?n:[...n,l],[])}}var zwe=B(()=>{ri()});function Hut(){return{not:{}}}var Bwe=B(()=>{});function Qut(){return{}}var Swe=B(()=>{});var Eut,Mwe=B(()=>{ri();Eut=(t,e)=>Fn(t.innerType._def,e)});function Fn(t,e,n=!1){let l=e.seen.get(t);if(e.override){let c=e.override?.(t,e,l,n);if(c!==nut)return c}if(l&&!n){let c=s9n(l,e);if(c!==void 0)return"$ref"in c&&e.seenRefs.add(c.$ref),c}let I={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,I);let a=d9n(t,t.typeName,e,n);return a&&G9n(t,e,a),I.jsonSchema=a,a}var s9n,u9n,d9n,G9n,ri=B(()=>{ab();Zwe();Wwe();Nwe();Vwe();Ywe();gwe();ywe();Awe();Fwe();vwe();fwe();Xwe();Hwe();Qwe();Ewe();Jwe();Cwe();Lwe();kwe();xwe();jwe();Owe();Bne();Uwe();Une();zwe();Bwe();Sne();Swe();Mwe();jne();s9n=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"extract-to-root":let n=t.path.slice(e.basePath.length+1).join("_");return n!==e.name&&e.nameStrategy==="duplicate-ref"&&(e.definitions[n]=t.def),{$ref:[...e.basePath,e.definitionPath,n].join("/")};case"relative":return{$ref:u9n(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[I]===l)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},u9n=(t,e)=>{let n=0;for(;n{switch(e){case ve.ZodString:return One(t,n);case ve.ZodNumber:return yut(t,n);case ve.ZodObject:return Aut(t,n);case ve.ZodBigInt:return out(t,n);case ve.ZodBoolean:return iut();case ve.ZodDate:return Rwe(t,n);case ve.ZodUndefined:return Hut();case ve.ZodNull:return Vut(n);case ve.ZodArray:return cut(t,n);case ve.ZodUnion:case ve.ZodDiscriminatedUnion:return gut(t,n);case ve.ZodIntersection:return mut(t,n);case ve.ZodTuple:return wut(t,n);case ve.ZodRecord:return zne(t,n);case ve.ZodLiteral:return put(t,n);case ve.ZodEnum:return but(t);case ve.ZodNativeEnum:return Wut(t);case ve.ZodNullable:return Rut(t,n);case ve.ZodOptional:return Fut(t,n);case ve.ZodMap:return Zut(t,n);case ve.ZodSet:return Xut(t,n);case ve.ZodLazy:return Fn(t.getter()._def,n);case ve.ZodPromise:return fut(t,n);case ve.ZodNaN:case ve.ZodNever:return Nut();case ve.ZodEffects:return Gut(t,n,l);case ve.ZodAny:return rut();case ve.ZodUnknown:return Qut();case ve.ZodDefault:return dut(t,n);case ve.ZodBranded:return sut(t,n);case ve.ZodReadonly:return Eut(t,n);case ve.ZodCatch:return uut(t,n);case ve.ZodPipeline:return vut(t,n);case ve.ZodFunction:case ve.ZodVoid:case ve.ZodSymbol:return;default:return(I=>{})(e)}},G9n=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n)});var Jut,Cut=B(()=>{ri();pwe();mwe();Jut=(t,e)=>{let n=aut(e),l=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,I=Fn(t._def,l===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,l]},!1)??{},a=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;a!==void 0&&(I.title=a);let c=(()=>{if(Iut(n.definitions))return;let s={},r=new Set;for(let u=0;u<500;u++){let o=Object.entries(n.definitions).filter(([d])=>!r.has(d));if(o.length===0)break;for(let[d,b]of o)s[d]=Fn(dS(b),{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0)??{},r.add(d)}return s})(),i=l===void 0?c?{...I,[n.definitionPath]:c}:I:n.nameStrategy==="duplicate-ref"?{...I,...c||n.seenRefs.size?{[n.definitionPath]:{...c,...n.seenRefs.size?{[l]:I}:void 0}}:void 0}:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,l].join("/"),[n.definitionPath]:{...c,[l]:I}};return n.target==="jsonSchema7"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="jsonSchema2019-09"&&(i.$schema="https://json-schema.org/draft/2019-09/schema#"),i}});var Lut=B(()=>{jne();pwe();wv();ri();Zwe();Wwe();Nwe();Vwe();Ywe();gwe();ywe();Awe();Fwe();vwe();fwe();Xwe();Hwe();Qwe();Ewe();Jwe();Cwe();Lwe();kwe();xwe();jwe();Owe();Mwe();Bne();Uwe();Une();zwe();Bwe();Sne();Swe();Cut()});function kut(t,e){return Jut(t,{openaiStrictMode:!0,name:e.name,nameStrategy:"duplicate-ref",$refStrategy:"extract-to-root",nullableStrategy:"property"})}function xut(t,e,n){return fst({type:"json_schema",json_schema:{...n,name:e,strict:!0,schema:kut(t,{name:e})}},l=>t.parse(JSON.parse(l)))}function jut(t){return Xst({type:"function",function:{name:t.name,parameters:kut(t.parameters,{name:t.name}),strict:!0,...t.description?{description:t.description}:void 0}},{callback:t.function,parser:e=>t.parameters.parse(JSON.parse(e))})}var Twe=B(()=>{nk();Lut()});function bm(t){let{azureOpenAIApiDeploymentName:e,azureOpenAIApiInstanceName:n,azureOpenAIApiKey:l,azureOpenAIBasePath:I,baseURL:a,azureADTokenProvider:c,azureOpenAIEndpoint:i}=t;if((l||c)&&I&&e)return`${I}/${e}`;if((l||c)&&i&&e)return`${i}/openai/deployments/${e}`;if(l||c){if(!n)throw new Error("azureOpenAIApiInstanceName is required when using azureOpenAIApiKey");if(!e)throw new Error("azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey");return`https://${n}.openai.azure.com/openai/deployments/${e}`}return a}var dA=B(()=>{});function bS(t,e){return t.lc_error_code=e,t.message=`${t.message} + +Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${e}/ +`,t}var Out=B(()=>{});function DZ(t){let e;return t.constructor.name===qN.name?(e=new Error(t.message),e.name="TimeoutError"):t.constructor.name===ao.name?(e=new Error(t.message),e.name="AbortError"):t.status===400&&t.message.includes("tool_calls")?e=bS(t,"INVALID_TOOL_RESULTS"):t.status===401?e=bS(t,"MODEL_AUTHENTICATION"):t.status===429?e=bS(t,"MODEL_RATE_LIMIT"):t.status===404?e=bS(t,"MODEL_NOT_FOUND"):e=t,e}function Dwe(t){return{type:"function",function:{name:t.name,description:t.description,parameters:JN(t.schema)}}}function Kwe(t){if(t)return t==="any"||t==="required"?"required":t==="auto"?"auto":t==="none"?"none":typeof t=="string"?{type:"function",function:{name:t}}:t}var TQ=B(()=>{nV();v5();_N();Out()});function b9n(t){return t.anyOf!==void 0&&Array.isArray(t.anyOf)}function Uut(t){let e=["namespace functions {",""];for(let n of t)n.description&&e.push(`// ${n.description}`),Object.keys(n.parameters.properties??{}).length>0?(e.push(`type ${n.name} = (_: {`),e.push(zut(n.parameters,0)),e.push("}) => any;")):e.push(`type ${n.name} = () => any;`),e.push("");return e.push("} // namespace functions"),e.join(` +`)}function zut(t,e){let n=[];for(let[l,I]of Object.entries(t.properties??{}))I.description&&e<2&&n.push(`// ${I.description}`),t.required?.includes(l)?n.push(`${l}: ${Mne(I,e)},`):n.push(`${l}?: ${Mne(I,e)},`);return n.map(l=>" ".repeat(e)+l).join(` +`)}function Mne(t,e){if(b9n(t))return t.anyOf.map(n=>Mne(n,e)).join(" | ");switch(t.type){case"string":return t.enum?t.enum.map(n=>`"${n}"`).join(" | "):"string";case"number":return t.enum?t.enum.map(n=>`${n}`).join(" | "):"number";case"integer":return t.enum?t.enum.map(n=>`${n}`).join(" | "):"number";case"boolean":return"boolean";case"null":return"null";case"object":return["{",zut(t,e+2),"}"].join(` +`);case"array":return t.items?`${Mne(t.items,e)}[]`:"any[]";default:return""}}var But=B(()=>{});function Sut(t,e){let n;if(cb(t)){let l=jut({name:t.name,parameters:t.schema,description:t.description});l.function.parameters?n={type:l.type,function:{name:l.function.name,description:l.function.description,parameters:l.function.parameters,...e?.strict!==void 0?{strict:e.strict}:{}}}:n={type:"function",function:SZ(t,e)}}else n=t;return e?.strict!==void 0&&(n.function.strict=e.strict),n}var Mut=B(()=>{_N();Twe()});function m9n(t){return t.role!=="system"&&t.role!=="developer"&&t.role!=="assistant"&&t.role!=="user"&&t.role!=="function"&&t.role!=="tool"&&console.warn(`Unknown message role: ${t.role}`),t.role}function _we(t){let e=t._getType();switch(e){case"system":return"system";case"ai":return"assistant";case"human":return"user";case"function":return"function";case"tool":return"tool";case"generic":{if(!lo.isInstance(t))throw new Error("Invalid generic chat message");return m9n(t)}default:throw new Error(`Unknown message type: ${e}`)}}function p9n(t,e,n){let l=t.tool_calls;switch(t.role){case"assistant":{let I=[],a=[];for(let s of l??[])try{I.push(uS(s,{returnId:!0}))}catch(r){a.push(xne(s,r.message))}let c={function_call:t.function_call,tool_calls:l};n!==void 0&&(c.__raw_response=e);let i={model_name:e.model,...e.system_fingerprint?{usage:{...e.usage},system_fingerprint:e.system_fingerprint}:{}};return t.audio&&(c.audio=t.audio),new _t({content:t.content||"",tool_calls:I,invalid_tool_calls:a,additional_kwargs:c,response_metadata:i,id:e.id})}default:return new lo(t.content||"",t.role??"unknown")}}function h9n(t,e,n,l){let I=t.role??n,a=t.content??"",c;t.function_call?c={function_call:t.function_call}:t.tool_calls?c={tool_calls:t.tool_calls}:c={},l&&(c.__raw_response=e),t.audio&&(c.audio={...t.audio,index:e.choices[0].index});let i={usage:{...e.usage}};if(I==="user")return new oG({content:a,response_metadata:i});if(I==="assistant"){let s=[];if(Array.isArray(t.tool_calls))for(let r of t.tool_calls)s.push({name:r.function?.name,args:r.function?.arguments,id:r.id,index:r.index,type:"tool_call_chunk"});return new Jl({content:a,tool_call_chunks:s,additional_kwargs:c,id:e.id,response_metadata:i})}else return I==="system"?new pd({content:a,response_metadata:i}):I==="developer"?new pd({content:a,response_metadata:i,additional_kwargs:{__openai_role__:"developer"}}):I==="function"?new cG({content:a,additional_kwargs:c,name:t.name,response_metadata:i}):I==="tool"?new PG({content:a,additional_kwargs:c,tool_call_id:t.tool_call_id,response_metadata:i}):new aG({content:a,role:I,response_metadata:i})}function mS(t,e){return t.flatMap(n=>{let l=_we(n);l==="system"&&e?.startsWith("o1")&&(l="developer");let I={role:l,content:n.content};if(n.name!=null&&(I.name=n.name),n.additional_kwargs.function_call!=null&&(I.function_call=n.additional_kwargs.function_call,I.content=null),qG(n)&&n.tool_calls?.length?(I.tool_calls=n.tool_calls.map(kne),I.content=null):(n.additional_kwargs.tool_calls!=null&&(I.tool_calls=n.additional_kwargs.tool_calls),n.tool_call_id!=null&&(I.tool_call_id=n.tool_call_id)),n.additional_kwargs.audio&&typeof n.additional_kwargs.audio=="object"&&"id"in n.additional_kwargs.audio){let a={role:"assistant",audio:{id:n.additional_kwargs.audio.id}};return[I,a]}return I})}function Tut(t,e){return qm(t)?e?.strict!==void 0?{...t,function:{...t.function,strict:e.strict}}:t:Sut(t,e)}function Tne(t){return typeof t?.parse=="function"}function Z9n(t){return t!==void 0&&typeof t.schema=="object"}var hG,Dne=B(()=>{nV();Vr();gh();Xh();Xk();DN();Bo();Ul();bwe();v5();Twe();dA();TQ();But();Mut();hG=class extends Vd{static lc_name(){return"ChatOpenAI"}get callKeys(){return[...super.callKeys,"options","function_call","functions","tools","tool_choice","promptIndex","response_format","seed","reasoning_effort"]}get lc_secrets(){return{openAIApiKey:"OPENAI_API_KEY",apiKey:"OPENAI_API_KEY",azureOpenAIApiKey:"AZURE_OPENAI_API_KEY",organization:"OPENAI_ORGANIZATION"}}get lc_aliases(){return{modelName:"model",openAIApiKey:"openai_api_key",apiKey:"openai_api_key",azureOpenAIApiVersion:"azure_openai_api_version",azureOpenAIApiKey:"azure_openai_api_key",azureOpenAIApiInstanceName:"azure_openai_api_instance_name",azureOpenAIApiDeploymentName:"azure_openai_api_deployment_name"}}constructor(e,n){if(super(e??{}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"frequencyPenalty",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"presencePenalty",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"n",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"logitBias",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"gpt-3.5-turbo"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"gpt-3.5-turbo"}),Object.defineProperty(this,"modelKwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stopSequences",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"user",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streaming",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"streamUsage",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logprobs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topLogprobs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"openAIApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureADTokenProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiInstanceName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiDeploymentName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIBasePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIEndpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"organization",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__includeRawResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"supportsStrictToolCalling",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"audio",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modalities",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reasoningEffort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.openAIApiKey=e?.apiKey??e?.openAIApiKey??e?.configuration?.apiKey??yt("OPENAI_API_KEY"),this.apiKey=this.openAIApiKey,this.azureOpenAIApiKey=e?.azureOpenAIApiKey??yt("AZURE_OPENAI_API_KEY"),this.azureADTokenProvider=e?.azureADTokenProvider??void 0,!this.azureOpenAIApiKey&&!this.apiKey&&!this.azureADTokenProvider)throw new Error("OpenAI or Azure OpenAI API key or Token Provider not found");if(this.azureOpenAIApiInstanceName=e?.azureOpenAIApiInstanceName??yt("AZURE_OPENAI_API_INSTANCE_NAME"),this.azureOpenAIApiDeploymentName=e?.azureOpenAIApiDeploymentName??yt("AZURE_OPENAI_API_DEPLOYMENT_NAME"),this.azureOpenAIApiVersion=e?.azureOpenAIApiVersion??yt("AZURE_OPENAI_API_VERSION"),this.azureOpenAIBasePath=e?.azureOpenAIBasePath??yt("AZURE_OPENAI_BASE_PATH"),this.organization=e?.configuration?.organization??yt("OPENAI_ORGANIZATION"),this.azureOpenAIEndpoint=e?.azureOpenAIEndpoint??yt("AZURE_OPENAI_ENDPOINT"),this.modelName=e?.model??e?.modelName??this.model,this.model=this.modelName,this.modelKwargs=e?.modelKwargs??{},this.timeout=e?.timeout,this.temperature=e?.temperature??this.temperature,this.topP=e?.topP??this.topP,this.frequencyPenalty=e?.frequencyPenalty??this.frequencyPenalty,this.presencePenalty=e?.presencePenalty??this.presencePenalty,this.maxTokens=e?.maxTokens,this.logprobs=e?.logprobs,this.topLogprobs=e?.topLogprobs,this.n=e?.n??this.n,this.logitBias=e?.logitBias,this.stop=e?.stopSequences??e?.stop,this.stopSequences=this?.stop,this.user=e?.user,this.__includeRawResponse=e?.__includeRawResponse,this.audio=e?.audio,this.modalities=e?.modalities,this.reasoningEffort=e?.reasoningEffort,this.azureOpenAIApiKey||this.azureADTokenProvider){if(!this.azureOpenAIApiInstanceName&&!this.azureOpenAIBasePath&&!this.azureOpenAIEndpoint)throw new Error("Azure OpenAI API instance name not found");if(!this.azureOpenAIApiDeploymentName&&this.azureOpenAIBasePath){let l=this.azureOpenAIBasePath.split("/openai/deployments/");if(l.length===2){let[,I]=l;this.azureOpenAIApiDeploymentName=I}}if(!this.azureOpenAIApiDeploymentName)throw new Error("Azure OpenAI API deployment name not found");if(!this.azureOpenAIApiVersion)throw new Error("Azure OpenAI API version not found");this.apiKey=this.apiKey??"",this.streamUsage=!1}this.model==="o1"&&(this.disableStreaming=!0),this.streaming=e?.streaming??!1,this.streamUsage=e?.streamUsage??this.streamUsage,this.clientConfig={apiKey:this.apiKey,organization:this.organization,baseURL:n?.basePath??e?.configuration?.basePath,dangerouslyAllowBrowser:!0,defaultHeaders:n?.baseOptions?.headers??e?.configuration?.baseOptions?.headers,defaultQuery:n?.baseOptions?.params??e?.configuration?.baseOptions?.params,...n,...e?.configuration},e?.supportsStrictToolCalling!==void 0&&(this.supportsStrictToolCalling=e.supportsStrictToolCalling)}getLsParams(e){let n=this.invocationParams(e);return{ls_provider:"openai",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:n.temperature??void 0,ls_max_tokens:n.max_tokens??void 0,ls_stop:e.stop}}bindTools(e,n){let l;return n?.strict!==void 0?l=n.strict:this.supportsStrictToolCalling!==void 0&&(l=this.supportsStrictToolCalling),this.bind({tools:e.map(I=>Tut(I,{strict:l})),...n})}createResponseFormat(e){return e&&e.type==="json_schema"&&e.json_schema.schema&&Tne(e.json_schema.schema)?xut(e.json_schema.schema,e.json_schema.name,{description:e.json_schema.description}):e}invocationParams(e,n){let l;e?.strict!==void 0?l=e.strict:this.supportsStrictToolCalling!==void 0&&(l=this.supportsStrictToolCalling);let I={};e?.stream_options!==void 0?I={stream_options:e.stream_options}:this.streamUsage&&(this.streaming||n?.streaming)&&(I={stream_options:{include_usage:!0}});let a={model:this.model,temperature:this.temperature,top_p:this.topP,frequency_penalty:this.frequencyPenalty,presence_penalty:this.presencePenalty,max_tokens:this.maxTokens===-1?void 0:this.maxTokens,logprobs:this.logprobs,top_logprobs:this.topLogprobs,n:this.n,logit_bias:this.logitBias,stop:e?.stop??this.stopSequences,user:this.user,stream:this.streaming,functions:e?.functions,function_call:e?.function_call,tools:e?.tools?.length?e.tools.map(i=>Tut(i,{strict:l})):void 0,tool_choice:Kwe(e?.tool_choice),response_format:this.createResponseFormat(e?.response_format),seed:e?.seed,...I,parallel_tool_calls:e?.parallel_tool_calls,...this.audio||e?.audio?{audio:this.audio||e?.audio}:{},...this.modalities||e?.modalities?{modalities:this.modalities||e?.modalities}:{},...this.modelKwargs};e?.prediction!==void 0&&(a.prediction=e.prediction);let c=e?.reasoning_effort??this.reasoningEffort;return c!==void 0&&(a.reasoning_effort=c),a}_identifyingParams(){return{model_name:this.model,...this.invocationParams(),...this.clientConfig}}async*_streamResponseChunks(e,n,l){let I=mS(e,this.model),a={...this.invocationParams(n,{streaming:!0}),messages:I,stream:!0},c,i=await this.completionWithRetry(a,n),s;for await(let r of i){let u=r?.choices?.[0];if(r.usage&&(s=r.usage),!u)continue;let{delta:o}=u;if(!o)continue;let d=h9n(o,r,c,this.__includeRawResponse);c=o.role??c;let b={prompt:n.promptIndex??0,completion:u.index??0};if(typeof d.content!="string"){console.log("[WARNING]: Received non-string content from OpenAI. This is currently not supported.");continue}let h={...b};u.finish_reason!=null&&(h.finish_reason=u.finish_reason,h.system_fingerprint=r.system_fingerprint,h.model_name=r.model),this.logprobs&&(h.logprobs=u.logprobs);let Z=new Io({message:d,text:d.content,generationInfo:h});yield Z,await l?.handleLLMNewToken(Z.text??"",b,void 0,void 0,void 0,{chunk:Z})}if(s){let r={...s.prompt_tokens_details?.audio_tokens!==null&&{audio:s.prompt_tokens_details?.audio_tokens},...s.prompt_tokens_details?.cached_tokens!==null&&{cache_read:s.prompt_tokens_details?.cached_tokens}},u={...s.completion_tokens_details?.audio_tokens!==null&&{audio:s.completion_tokens_details?.audio_tokens},...s.completion_tokens_details?.reasoning_tokens!==null&&{reasoning:s.completion_tokens_details?.reasoning_tokens}};yield new Io({message:new Jl({content:"",response_metadata:{usage:{...s}},usage_metadata:{input_tokens:s.prompt_tokens,output_tokens:s.completion_tokens,total_tokens:s.total_tokens,...Object.keys(r).length>0&&{input_token_details:r},...Object.keys(u).length>0&&{output_token_details:u}}}),text:""})}if(n.signal?.aborted)throw new Error("AbortError")}identifyingParams(){return this._identifyingParams()}async _generate(e,n,l){let I={},a=this.invocationParams(n),c=mS(e,this.model);if(a.stream){let i=this._streamResponseChunks(e,n,l),s={};for await(let h of i){h.message.response_metadata={...h.generationInfo,...h.message.response_metadata};let Z=h.generationInfo?.completion??0;s[Z]===void 0?s[Z]=h:s[Z]=s[Z].concat(h)}let r=Object.entries(s).sort(([h],[Z])=>parseInt(h,10)-parseInt(Z,10)).map(([h,Z])=>Z),{functions:u,function_call:o}=this.invocationParams(n),d=await this.getEstimatedTokenCountFromPrompt(e,u,o),b=await this.getNumTokensFromGenerations(r);return I.input_tokens=d,I.output_tokens=b,I.total_tokens=d+b,{generations:r,llmOutput:{estimatedTokenUsage:{promptTokens:I.input_tokens,completionTokens:I.output_tokens,totalTokens:I.total_tokens}}}}else{let i;n.response_format&&n.response_format.type==="json_schema"?i=await this.betaParsedCompletionWithRetry({...a,stream:!1,messages:c},{signal:n?.signal,...n?.options}):i=await this.completionWithRetry({...a,stream:!1,messages:c},{signal:n?.signal,...n?.options});let{completion_tokens:s,prompt_tokens:r,total_tokens:u,prompt_tokens_details:o,completion_tokens_details:d}=i?.usage??{};s&&(I.output_tokens=(I.output_tokens??0)+s),r&&(I.input_tokens=(I.input_tokens??0)+r),u&&(I.total_tokens=(I.total_tokens??0)+u),(o?.audio_tokens!==null||o?.cached_tokens!==null)&&(I.input_token_details={...o?.audio_tokens!==null&&{audio:o?.audio_tokens},...o?.cached_tokens!==null&&{cache_read:o?.cached_tokens}}),(d?.audio_tokens!==null||d?.reasoning_tokens!==null)&&(I.output_token_details={...d?.audio_tokens!==null&&{audio:d?.audio_tokens},...d?.reasoning_tokens!==null&&{reasoning:d?.reasoning_tokens}});let b=[];for(let h of i?.choices??[]){let N={text:h.message?.content??"",message:p9n(h.message??{role:"assistant"},i,this.__includeRawResponse)};N.generationInfo={...h.finish_reason?{finish_reason:h.finish_reason}:{},...h.logprobs?{logprobs:h.logprobs}:{}},qG(N.message)&&(N.message.usage_metadata=I),N.message=new _t(Object.fromEntries(Object.entries(N.message).filter(([g])=>!g.startsWith("lc_")))),b.push(N)}return{generations:b,llmOutput:{tokenUsage:{promptTokens:I.input_tokens,completionTokens:I.output_tokens,totalTokens:I.total_tokens}}}}}async getEstimatedTokenCountFromPrompt(e,n,l){let I=(await this.getNumTokensFromMessages(e)).totalCount;if(n&&l!=="auto"){let a=Uut(n);I+=await this.getNumTokens(a),I+=9}return n&&e.find(a=>a._getType()==="system")&&(I-=4),l==="none"?I+=1:typeof l=="object"&&(I+=await this.getNumTokens(l.name)+4),I}async getNumTokensFromGenerations(e){return(await Promise.all(e.map(async l=>l.message.additional_kwargs?.function_call?(await this.getNumTokensFromMessages([l.message])).countPerMessage[0]:await this.getNumTokens(l.message.content)))).reduce((l,I)=>l+I,0)}async getNumTokensFromMessages(e){let n=0,l=0,I=0;this.model==="gpt-3.5-turbo-0301"?(l=4,I=-1):(l=3,I=1);let a=await Promise.all(e.map(async c=>{let i=await this.getNumTokens(c.content),s=await this.getNumTokens(_we(c)),r=c.name!==void 0?I+await this.getNumTokens(c.name):0,u=i+l+s+r,o=c;if(o._getType()==="function"&&(u-=2),o.additional_kwargs?.function_call&&(u+=3),o?.additional_kwargs.function_call?.name&&(u+=await this.getNumTokens(o.additional_kwargs.function_call?.name)),o.additional_kwargs.function_call?.arguments)try{u+=await this.getNumTokens(JSON.stringify(JSON.parse(o.additional_kwargs.function_call?.arguments)))}catch(d){console.error("Error parsing function arguments",d,JSON.stringify(o.additional_kwargs.function_call)),u+=await this.getNumTokens(o.additional_kwargs.function_call?.arguments)}return n+=u,u}));return n+=3,{totalCount:n,countPerMessage:a}}async completionWithRetry(e,n){let l=this._getClientOptions(n);return this.caller.call(async()=>{try{return await this.client.chat.completions.create(e,l)}catch(I){throw DZ(I)}})}async betaParsedCompletionWithRetry(e,n){let l=this._getClientOptions(n);return this.caller.call(async()=>{try{return await this.client.beta.chat.completions.parse(e,l)}catch(I){throw DZ(I)}})}_getClientOptions(e){if(!this.client){let l={azureOpenAIApiDeploymentName:this.azureOpenAIApiDeploymentName,azureOpenAIApiInstanceName:this.azureOpenAIApiInstanceName,azureOpenAIApiKey:this.azureOpenAIApiKey,azureOpenAIBasePath:this.azureOpenAIBasePath,baseURL:this.clientConfig.baseURL,azureOpenAIEndpoint:this.azureOpenAIEndpoint},I=bm(l),a={...this.clientConfig,baseURL:I,timeout:this.timeout,maxRetries:0};a.baseURL||delete a.baseURL,this.client=new xt(a)}let n={...this.clientConfig,...e};return this.azureOpenAIApiKey&&(n.headers={"api-key":this.azureOpenAIApiKey,...n.headers},n.query={"api-version":this.azureOpenAIApiVersion,...n.query}),n}_llmType(){return"openai"}_combineLLMOutput(...e){return e.reduce((n,l)=>(l&&l.tokenUsage&&(n.tokenUsage.completionTokens+=l.tokenUsage.completionTokens??0,n.tokenUsage.promptTokens+=l.tokenUsage.promptTokens??0,n.tokenUsage.totalTokens+=l.tokenUsage.totalTokens??0),n),{tokenUsage:{completionTokens:0,promptTokens:0,totalTokens:0}})}withStructuredOutput(e,n){let l,I,a,c;Z9n(e)?(l=e.schema,I=e.name,a=e.method,c=e.includeRaw):(l=e,I=n?.name,a=n?.method,c=n?.includeRaw);let i,s;if(n?.strict!==void 0&&a==="jsonMode")throw new Error("Argument `strict` is only supported for `method` = 'function_calling'");if(a==="jsonMode")i=this.bind({response_format:{type:"json_object"}}),Tne(l)?s=Py.fromZodSchema(l):s=new ng;else if(a==="jsonSchema")i=this.bind({response_format:{type:"json_schema",json_schema:{name:I??"extract",description:l.description,schema:l,strict:n?.strict}}}),Tne(l)?s=Py.fromZodSchema(l):s=new ng;else{let d=I??"extract";if(Tne(l)){let b=JN(l);i=this.bind({tools:[{type:"function",function:{name:d,description:b.description,parameters:b}}],tool_choice:{type:"function",function:{name:d}},...n?.strict!==void 0?{strict:n.strict}:{}}),s=new Xv({returnSingle:!0,keyName:d,zodSchema:l})}else{let b;typeof l.name=="string"&&typeof l.parameters=="object"&&l.parameters!=null?(b=l,d=l.name):(d=l.title??d,b={name:d,description:l.description??"",parameters:l}),i=this.bind({tools:[{type:"function",function:b}],tool_choice:{type:"function",function:{name:d}},...n?.strict!==void 0?{strict:n.strict}:{}}),s=new Xv({returnSingle:!0,keyName:d})}}if(!c)return i.pipe(s);let r=Tl.assign({parsed:(d,b)=>s.invoke(d.raw,b)}),u=Tl.assign({parsed:()=>null}),o=r.withFallbacks({fallbacks:[u]});return Hr.from([{raw:i},o])}}});var pS,Dut=B(()=>{nV();Dne();dA();pS=class extends hG{_llmType(){return"azure_openai"}get lc_aliases(){return{openAIApiKey:"openai_api_key",openAIApiVersion:"openai_api_version",openAIBasePath:"openai_api_base",deploymentName:"deployment_name",azureOpenAIEndpoint:"azure_endpoint",azureOpenAIApiVersion:"openai_api_version",azureOpenAIBasePath:"openai_api_base",azureOpenAIApiDeploymentName:"deployment_name"}}constructor(e){let n=e&&{...e};n&&(n.azureOpenAIApiDeploymentName=n.azureOpenAIApiDeploymentName??n.deploymentName,n.azureOpenAIApiKey=n.azureOpenAIApiKey??n.openAIApiKey,n.azureOpenAIApiVersion=n.azureOpenAIApiVersion??n.openAIApiVersion),super(n)}getLsParams(e){let n=super.getLsParams(e);return n.ls_provider="azure",n}_getClientOptions(e){if(!this.client){let l={azureOpenAIApiDeploymentName:this.azureOpenAIApiDeploymentName,azureOpenAIApiInstanceName:this.azureOpenAIApiInstanceName,azureOpenAIApiKey:this.azureOpenAIApiKey,azureOpenAIBasePath:this.azureOpenAIBasePath,azureADTokenProvider:this.azureADTokenProvider,baseURL:this.clientConfig.baseURL,azureOpenAIEndpoint:this.azureOpenAIEndpoint},I=bm(l),a={...this.clientConfig,baseURL:I,timeout:this.timeout,maxRetries:0};this.azureADTokenProvider||(a.apiKey=l.azureOpenAIApiKey),a.baseURL||delete a.baseURL,a.defaultHeaders={...a.defaultHeaders,"User-Agent":a.defaultHeaders?.["User-Agent"]?`${a.defaultHeaders["User-Agent"]}: langchainjs-azure-openai-v2`:"langchainjs-azure-openai-v2"},this.client=new fv({apiVersion:this.azureOpenAIApiVersion,azureADTokenProvider:this.azureADTokenProvider,deployment:this.azureOpenAIApiDeploymentName,...a})}let n={...this.clientConfig,...e};return this.azureOpenAIApiKey&&(n.headers={"api-key":this.azureOpenAIApiKey,...n.headers},n.query={"api-version":this.azureOpenAIApiVersion,...n.query}),n}toJSON(){let e=super.toJSON();function n(l){return typeof l=="object"&&l!=null}if(n(e)&&n(e.kwargs)){if(delete e.kwargs.azure_openai_base_path,delete e.kwargs.azure_openai_api_deployment_name,delete e.kwargs.azure_openai_api_key,delete e.kwargs.azure_openai_api_version,delete e.kwargs.azure_open_ai_base_path,!e.kwargs.azure_endpoint&&this.azureOpenAIEndpoint&&(e.kwargs.azure_endpoint=this.azureOpenAIEndpoint),!e.kwargs.azure_endpoint&&this.azureOpenAIBasePath){let l=this.azureOpenAIBasePath.split("/openai/deployments/");if(l.length===2&&l[0].startsWith("http")){let[I]=l;e.kwargs.azure_endpoint=I}}if(!e.kwargs.azure_endpoint&&this.azureOpenAIApiInstanceName&&(e.kwargs.azure_endpoint=`https://${this.azureOpenAIApiInstanceName}.openai.azure.com/`),!e.kwargs.deployment_name&&this.azureOpenAIApiDeploymentName&&(e.kwargs.deployment_name=this.azureOpenAIApiDeploymentName),!e.kwargs.deployment_name&&this.azureOpenAIBasePath){let l=this.azureOpenAIBasePath.split("/openai/deployments/");if(l.length===2){let[,I]=l;e.kwargs.deployment_name=I}}e.kwargs.azure_endpoint&&e.kwargs.deployment_name&&e.kwargs.openai_api_base&&delete e.kwargs.openai_api_base,e.kwargs.azure_openai_api_instance_name&&e.kwargs.azure_endpoint&&delete e.kwargs.azure_openai_api_instance_name}return e}}});var Kne=B(()=>{rte()});var wk=B(()=>{jve()});var hS,Kut=B(()=>{nV();gh();Xh();Kne();dA();TQ();hS=class extends eg{static lc_name(){return"OpenAIChat"}get callKeys(){return[...super.callKeys,"options","promptIndex"]}get lc_secrets(){return{openAIApiKey:"OPENAI_API_KEY",azureOpenAIApiKey:"AZURE_OPENAI_API_KEY",organization:"OPENAI_ORGANIZATION"}}get lc_aliases(){return{modelName:"model",openAIApiKey:"openai_api_key",azureOpenAIApiVersion:"azure_openai_api_version",azureOpenAIApiKey:"azure_openai_api_key",azureOpenAIApiInstanceName:"azure_openai_api_instance_name",azureOpenAIApiDeploymentName:"azure_openai_api_deployment_name"}}constructor(e,n){if(super(e??{}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"frequencyPenalty",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"presencePenalty",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"n",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"logitBias",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"gpt-3.5-turbo"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"gpt-3.5-turbo"}),Object.defineProperty(this,"prefixMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelKwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"user",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streaming",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"openAIApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiInstanceName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiDeploymentName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIBasePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"organization",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.openAIApiKey=e?.apiKey??e?.openAIApiKey??yt("OPENAI_API_KEY"),this.azureOpenAIApiKey=e?.azureOpenAIApiKey??yt("AZURE_OPENAI_API_KEY"),!this.azureOpenAIApiKey&&!this.openAIApiKey)throw new Error("OpenAI or Azure OpenAI API key not found");if(this.azureOpenAIApiInstanceName=e?.azureOpenAIApiInstanceName??yt("AZURE_OPENAI_API_INSTANCE_NAME"),this.azureOpenAIApiDeploymentName=(e?.azureOpenAIApiCompletionsDeploymentName||e?.azureOpenAIApiDeploymentName)??(yt("AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME")||yt("AZURE_OPENAI_API_DEPLOYMENT_NAME")),this.azureOpenAIApiVersion=e?.azureOpenAIApiVersion??yt("AZURE_OPENAI_API_VERSION"),this.azureOpenAIBasePath=e?.azureOpenAIBasePath??yt("AZURE_OPENAI_BASE_PATH"),this.organization=e?.configuration?.organization??yt("OPENAI_ORGANIZATION"),this.modelName=e?.model??e?.modelName??this.modelName,this.prefixMessages=e?.prefixMessages??this.prefixMessages,this.modelKwargs=e?.modelKwargs??{},this.timeout=e?.timeout,this.temperature=e?.temperature??this.temperature,this.topP=e?.topP??this.topP,this.frequencyPenalty=e?.frequencyPenalty??this.frequencyPenalty,this.presencePenalty=e?.presencePenalty??this.presencePenalty,this.n=e?.n??this.n,this.logitBias=e?.logitBias,this.maxTokens=e?.maxTokens,this.stop=e?.stop,this.user=e?.user,this.streaming=e?.streaming??!1,this.n>1)throw new Error("Cannot use n > 1 in OpenAIChat LLM. Use ChatOpenAI Chat Model instead.");if(this.azureOpenAIApiKey){if(!this.azureOpenAIApiInstanceName&&!this.azureOpenAIBasePath)throw new Error("Azure OpenAI API instance name not found");if(!this.azureOpenAIApiDeploymentName)throw new Error("Azure OpenAI API deployment name not found");if(!this.azureOpenAIApiVersion)throw new Error("Azure OpenAI API version not found");this.openAIApiKey=this.openAIApiKey??""}this.clientConfig={apiKey:this.openAIApiKey,organization:this.organization,baseURL:n?.basePath??e?.configuration?.basePath,dangerouslyAllowBrowser:!0,defaultHeaders:n?.baseOptions?.headers??e?.configuration?.baseOptions?.headers,defaultQuery:n?.baseOptions?.params??e?.configuration?.baseOptions?.params,...n,...e?.configuration}}invocationParams(e){return{model:this.modelName,temperature:this.temperature,top_p:this.topP,frequency_penalty:this.frequencyPenalty,presence_penalty:this.presencePenalty,n:this.n,logit_bias:this.logitBias,max_tokens:this.maxTokens===-1?void 0:this.maxTokens,stop:e?.stop??this.stop,user:this.user,stream:this.streaming,...this.modelKwargs}}_identifyingParams(){return{model_name:this.modelName,...this.invocationParams(),...this.clientConfig}}identifyingParams(){return{model_name:this.modelName,...this.invocationParams(),...this.clientConfig}}formatMessages(e){let n={role:"user",content:e};return this.prefixMessages?[...this.prefixMessages,n]:[n]}async*_streamResponseChunks(e,n,l){let I={...this.invocationParams(n),messages:this.formatMessages(e),stream:!0},a=await this.completionWithRetry(I,n);for await(let c of a){let i=c?.choices[0];if(!i)continue;let{delta:s}=i,r=new zo({text:s.content??""});yield r;let u={prompt:n.promptIndex??0,completion:i.index??0};l?.handleLLMNewToken(r.text??"",u)}if(n.signal?.aborted)throw new Error("AbortError")}async _call(e,n,l){let I=this.invocationParams(n);if(I.stream){let a=await this._streamResponseChunks(e,n,l),c;for await(let i of a)c===void 0?c=i:c=c.concat(i);return c?.text??""}else return(await this.completionWithRetry({...I,stream:!1,messages:this.formatMessages(e)},{signal:n.signal,...n.options}))?.choices[0]?.message?.content??""}async completionWithRetry(e,n){let l=this._getClientOptions(n);return this.caller.call(async()=>{try{return await this.client.chat.completions.create(e,l)}catch(I){throw DZ(I)}})}_getClientOptions(e){if(!this.client){let l={azureOpenAIApiDeploymentName:this.azureOpenAIApiDeploymentName,azureOpenAIApiInstanceName:this.azureOpenAIApiInstanceName,azureOpenAIApiKey:this.azureOpenAIApiKey,azureOpenAIBasePath:this.azureOpenAIBasePath,baseURL:this.clientConfig.baseURL},I=bm(l),a={...this.clientConfig,baseURL:I,timeout:this.timeout,maxRetries:0};a.baseURL||delete a.baseURL,this.client=new xt(a)}let n={...this.clientConfig,...e};return this.azureOpenAIApiKey&&(n.headers={"api-key":this.azureOpenAIApiKey,...n.headers},n.query={"api-version":this.azureOpenAIApiVersion,...n.query}),n}_llmType(){return"openai"}}});var DQ,Pwe=B(()=>{nV();DN();gh();Xh();Kne();wk();dA();Kut();TQ();DQ=class extends rL{static lc_name(){return"OpenAI"}get callKeys(){return[...super.callKeys,"options"]}get lc_secrets(){return{openAIApiKey:"OPENAI_API_KEY",apiKey:"OPENAI_API_KEY",azureOpenAIApiKey:"AZURE_OPENAI_API_KEY",organization:"OPENAI_ORGANIZATION"}}get lc_aliases(){return{modelName:"model",openAIApiKey:"openai_api_key",apiKey:"openai_api_key",azureOpenAIApiVersion:"azure_openai_api_version",azureOpenAIApiKey:"azure_openai_api_key",azureOpenAIApiInstanceName:"azure_openai_api_instance_name",azureOpenAIApiDeploymentName:"azure_openai_api_deployment_name"}}constructor(e,n){let l=e?.model??e?.modelName;if((l?.startsWith("gpt-3.5-turbo")||l?.startsWith("gpt-4"))&&!l?.includes("-instruct"))return console.warn([`Your chosen OpenAI model, "${l}", is a chat model and not a text-in/text-out LLM.`,'Passing it into the "OpenAI" class is deprecated and only permitted for backwards-compatibility. You may experience odd behavior.','Please use the "ChatOpenAI" class instead.',"","See this page for more information:","|","\u2514> https://js.langchain.com/docs/integrations/chat/openai"].join(` +`)),new hS(e,n);if(super(e??{}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:.7}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:256}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"frequencyPenalty",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"presencePenalty",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"n",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"bestOf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logitBias",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"gpt-3.5-turbo-instruct"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"gpt-3.5-turbo-instruct"}),Object.defineProperty(this,"modelKwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchSize",{enumerable:!0,configurable:!0,writable:!0,value:20}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stopSequences",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"user",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streaming",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"openAIApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureADTokenProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiInstanceName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiDeploymentName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIBasePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"organization",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l=l??this.model,this.openAIApiKey=e?.apiKey??e?.openAIApiKey??yt("OPENAI_API_KEY"),this.apiKey=this.openAIApiKey,this.azureOpenAIApiKey=e?.azureOpenAIApiKey??yt("AZURE_OPENAI_API_KEY"),this.azureADTokenProvider=e?.azureADTokenProvider??void 0,!this.azureOpenAIApiKey&&!this.apiKey&&!this.azureADTokenProvider)throw new Error("OpenAI or Azure OpenAI API key or Token Provider not found");if(this.azureOpenAIApiInstanceName=e?.azureOpenAIApiInstanceName??yt("AZURE_OPENAI_API_INSTANCE_NAME"),this.azureOpenAIApiDeploymentName=(e?.azureOpenAIApiCompletionsDeploymentName||e?.azureOpenAIApiDeploymentName)??(yt("AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME")||yt("AZURE_OPENAI_API_DEPLOYMENT_NAME")),this.azureOpenAIApiVersion=e?.azureOpenAIApiVersion??yt("AZURE_OPENAI_API_VERSION"),this.azureOpenAIBasePath=e?.azureOpenAIBasePath??yt("AZURE_OPENAI_BASE_PATH"),this.organization=e?.configuration?.organization??yt("OPENAI_ORGANIZATION"),this.modelName=l,this.model=l,this.modelKwargs=e?.modelKwargs??{},this.batchSize=e?.batchSize??this.batchSize,this.timeout=e?.timeout,this.temperature=e?.temperature??this.temperature,this.maxTokens=e?.maxTokens??this.maxTokens,this.topP=e?.topP??this.topP,this.frequencyPenalty=e?.frequencyPenalty??this.frequencyPenalty,this.presencePenalty=e?.presencePenalty??this.presencePenalty,this.n=e?.n??this.n,this.bestOf=e?.bestOf??this.bestOf,this.logitBias=e?.logitBias,this.stop=e?.stopSequences??e?.stop,this.stopSequences=e?.stopSequences,this.user=e?.user,this.streaming=e?.streaming??!1,this.streaming&&this.bestOf&&this.bestOf>1)throw new Error("Cannot stream results when bestOf > 1");if(this.azureOpenAIApiKey||this.azureADTokenProvider){if(!this.azureOpenAIApiInstanceName&&!this.azureOpenAIBasePath)throw new Error("Azure OpenAI API instance name not found");if(!this.azureOpenAIApiDeploymentName)throw new Error("Azure OpenAI API deployment name not found");if(!this.azureOpenAIApiVersion)throw new Error("Azure OpenAI API version not found");this.apiKey=this.apiKey??""}this.clientConfig={apiKey:this.apiKey,organization:this.organization,baseURL:n?.basePath??e?.configuration?.basePath,dangerouslyAllowBrowser:!0,defaultHeaders:n?.baseOptions?.headers??e?.configuration?.baseOptions?.headers,defaultQuery:n?.baseOptions?.params??e?.configuration?.baseOptions?.params,...n,...e?.configuration}}invocationParams(e){return{model:this.model,temperature:this.temperature,max_tokens:this.maxTokens,top_p:this.topP,frequency_penalty:this.frequencyPenalty,presence_penalty:this.presencePenalty,n:this.n,best_of:this.bestOf,logit_bias:this.logitBias,stop:e?.stop??this.stopSequences,user:this.user,stream:this.streaming,...this.modelKwargs}}_identifyingParams(){return{model_name:this.model,...this.invocationParams(),...this.clientConfig}}identifyingParams(){return this._identifyingParams()}async _generate(e,n,l){let I=BZ(e,this.batchSize),a=[],c={},i=this.invocationParams(n);if(i.max_tokens===-1){if(e.length!==1)throw new Error("max_tokens set to -1 not supported for multiple inputs");i.max_tokens=await bve({prompt:e[0],modelName:this.model})}for(let r=0;r{let h=[],Z,N=await this.completionWithRetry({...i,stream:!0,prompt:I[r]},n);for await(let g of N){Z||(Z={id:g.id,object:g.object,created:g.created,model:g.model});for(let y of g.choices){if(!h[y.index])h[y.index]=y;else{let X=h[y.index];X.text+=y.text,X.finish_reason=y.finish_reason,X.logprobs=y.logprobs}l?.handleLLMNewToken(y.text,{prompt:Math.floor(y.index/this.n),completion:y.index%this.n})}}if(n.signal?.aborted)throw new Error("AbortError");return{...Z,choices:h}})():await this.completionWithRetry({...i,stream:!1,prompt:I[r]},{signal:n.signal,...n.options});a.push(...u.choices);let{completion_tokens:o,prompt_tokens:d,total_tokens:b}=u.usage?u.usage:{completion_tokens:void 0,prompt_tokens:void 0,total_tokens:void 0};o&&(c.completionTokens=(c.completionTokens??0)+o),d&&(c.promptTokens=(c.promptTokens??0)+d),b&&(c.totalTokens=(c.totalTokens??0)+b)}return{generations:BZ(a,this.n).map(r=>r.map(u=>({text:u.text??"",generationInfo:{finishReason:u.finish_reason,logprobs:u.logprobs}}))),llmOutput:{tokenUsage:c}}}async*_streamResponseChunks(e,n,l){let I={...this.invocationParams(n),prompt:e,stream:!0},a=await this.completionWithRetry(I,n);for await(let c of a){let i=c?.choices[0];if(!i)continue;let s=new zo({text:i.text,generationInfo:{finishReason:i.finish_reason}});yield s,l?.handleLLMNewToken(s.text??"")}if(n.signal?.aborted)throw new Error("AbortError")}async completionWithRetry(e,n){let l=this._getClientOptions(n);return this.caller.call(async()=>{try{return await this.client.completions.create(e,l)}catch(I){throw DZ(I)}})}_getClientOptions(e){if(!this.client){let l={azureOpenAIApiDeploymentName:this.azureOpenAIApiDeploymentName,azureOpenAIApiInstanceName:this.azureOpenAIApiInstanceName,azureOpenAIApiKey:this.azureOpenAIApiKey,azureOpenAIBasePath:this.azureOpenAIBasePath,baseURL:this.clientConfig.baseURL},I=bm(l),a={...this.clientConfig,baseURL:I,timeout:this.timeout,maxRetries:0};a.baseURL||delete a.baseURL,this.client=new xt(a)}let n={...this.clientConfig,...e};return this.azureOpenAIApiKey&&(n.headers={"api-key":this.azureOpenAIApiKey,...n.headers},n.query={"api-version":this.azureOpenAIApiVersion,...n.query}),n}_llmType(){return"openai"}}});var ZS,_ut=B(()=>{nV();Pwe();dA();ZS=class extends DQ{get lc_aliases(){return{openAIApiKey:"openai_api_key",openAIApiVersion:"openai_api_version",openAIBasePath:"openai_api_base"}}constructor(e){let n=e&&{...e};n&&(n.azureOpenAIApiDeploymentName=n.azureOpenAIApiDeploymentName??n.deploymentName,n.azureOpenAIApiKey=n.azureOpenAIApiKey??n.openAIApiKey,n.azureOpenAIApiVersion=n.azureOpenAIApiVersion??n.openAIApiVersion),super(n)}_getClientOptions(e){if(!this.client){let l={azureOpenAIApiDeploymentName:this.azureOpenAIApiDeploymentName,azureOpenAIApiInstanceName:this.azureOpenAIApiInstanceName,azureOpenAIApiKey:this.azureOpenAIApiKey,azureOpenAIBasePath:this.azureOpenAIBasePath,azureADTokenProvider:this.azureADTokenProvider,baseURL:this.clientConfig.baseURL},I=bm(l),a={...this.clientConfig,baseURL:I,timeout:this.timeout,maxRetries:0};this.azureADTokenProvider||(a.apiKey=l.azureOpenAIApiKey),a.baseURL||delete a.baseURL,a.defaultHeaders={...a.defaultHeaders,"User-Agent":a.defaultHeaders?.["User-Agent"]?`${a.defaultHeaders["User-Agent"]}: langchainjs-azure-openai-v2`:"langchainjs-azure-openai-v2"},this.client=new fv({apiVersion:this.azureOpenAIApiVersion,azureADTokenProvider:this.azureADTokenProvider,...a})}let n={...this.clientConfig,...e};return this.azureOpenAIApiKey&&(n.headers={"api-key":this.azureOpenAIApiKey,...n.headers},n.query={"api-version":this.azureOpenAIApiVersion,...n.query}),n}toJSON(){let e=super.toJSON();function n(l){return typeof l=="object"&&l!=null}return n(e)&&n(e.kwargs)&&(delete e.kwargs.azure_openai_base_path,delete e.kwargs.azure_openai_api_deployment_name,delete e.kwargs.azure_openai_api_key,delete e.kwargs.azure_openai_api_version,delete e.kwargs.azure_open_ai_base_path),e}}});var WS=B(()=>{Dee()});var hg,qwe=B(()=>{nV();Xh();WS();wk();dA();TQ();hg=class extends Pm{constructor(e,n){let l={maxConcurrency:2,...e};super(l),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"text-embedding-ada-002"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"text-embedding-ada-002"}),Object.defineProperty(this,"batchSize",{enumerable:!0,configurable:!0,writable:!0,value:512}),Object.defineProperty(this,"stripNewLines",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"dimensions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureADTokenProvider",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiInstanceName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIApiDeploymentName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"azureOpenAIBasePath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"organization",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let I=l?.apiKey??l?.openAIApiKey??yt("OPENAI_API_KEY"),a=l?.azureOpenAIApiKey??yt("AZURE_OPENAI_API_KEY");if(this.azureADTokenProvider=e?.azureADTokenProvider??void 0,!a&&!I&&!this.azureADTokenProvider)throw new Error("OpenAI or Azure OpenAI API key or Token Provider not found");let c=l?.azureOpenAIApiInstanceName??yt("AZURE_OPENAI_API_INSTANCE_NAME"),i=(l?.azureOpenAIApiEmbeddingsDeploymentName||l?.azureOpenAIApiDeploymentName)??(yt("AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME")||yt("AZURE_OPENAI_API_DEPLOYMENT_NAME")),s=l?.azureOpenAIApiVersion??yt("AZURE_OPENAI_API_VERSION");if(this.azureOpenAIBasePath=l?.azureOpenAIBasePath??yt("AZURE_OPENAI_BASE_PATH"),this.organization=l?.configuration?.organization??yt("OPENAI_ORGANIZATION"),this.modelName=l?.model??l?.modelName??this.model,this.model=this.modelName,this.batchSize=l?.batchSize??(a?1:this.batchSize),this.stripNewLines=l?.stripNewLines??this.stripNewLines,this.timeout=l?.timeout,this.dimensions=l?.dimensions,this.azureOpenAIApiVersion=s,this.azureOpenAIApiKey=a,this.azureOpenAIApiInstanceName=c,this.azureOpenAIApiDeploymentName=i,this.azureOpenAIApiKey||this.azureADTokenProvider){if(!this.azureOpenAIApiInstanceName&&!this.azureOpenAIBasePath)throw new Error("Azure OpenAI API instance name not found");if(!this.azureOpenAIApiDeploymentName)throw new Error("Azure OpenAI API deployment name not found");if(!this.azureOpenAIApiVersion)throw new Error("Azure OpenAI API version not found");I=I??""}this.clientConfig={apiKey:I,organization:this.organization,baseURL:n?.basePath,dangerouslyAllowBrowser:!0,defaultHeaders:n?.baseOptions?.headers,defaultQuery:n?.baseOptions?.params,...n,...e?.configuration}}async embedDocuments(e){let n=BZ(this.stripNewLines?e.map(c=>c.replace(/\n/g," ")):e,this.batchSize),l=n.map(c=>{let i={model:this.model,input:c};return this.dimensions&&(i.dimensions=this.dimensions),this.embeddingWithRetry(i)}),I=await Promise.all(l),a=[];for(let c=0;c{try{return await this.client.embeddings.create(e,n)}catch(l){throw DZ(l)}})}}});var NS,Put=B(()=>{nV();qwe();dA();TQ();NS=class extends hg{constructor(e,n){let l={...e};Object.entries(l).length&&(l.azureOpenAIApiDeploymentName=l.azureOpenAIApiDeploymentName??l.deploymentName,l.azureOpenAIApiKey=l.azureOpenAIApiKey??l.apiKey,l.azureOpenAIApiVersion=l.azureOpenAIApiVersion??l.openAIApiVersion),super(l,n)}async embeddingWithRetry(e){if(!this.client){let l={azureOpenAIApiDeploymentName:this.azureOpenAIApiDeploymentName,azureOpenAIApiInstanceName:this.azureOpenAIApiInstanceName,azureOpenAIApiKey:this.azureOpenAIApiKey,azureOpenAIBasePath:this.azureOpenAIBasePath,azureADTokenProvider:this.azureADTokenProvider,baseURL:this.clientConfig.baseURL},I=bm(l),a={...this.clientConfig,baseURL:I,timeout:this.timeout,maxRetries:0};this.azureADTokenProvider||(a.apiKey=l.azureOpenAIApiKey),a.baseURL||delete a.baseURL,a.defaultHeaders={...a.defaultHeaders,"User-Agent":a.defaultHeaders?.["User-Agent"]?`${a.defaultHeaders["User-Agent"]}: langchainjs-azure-openai-v2`:"langchainjs-azure-openai-v2"},this.client=new fv({apiVersion:this.azureOpenAIApiVersion,azureADTokenProvider:this.azureADTokenProvider,deployment:this.azureOpenAIApiDeploymentName,...a})}let n={};return this.azureOpenAIApiKey&&(n.headers={"api-key":this.azureOpenAIApiKey,...n.headers},n.query={"api-version":this.azureOpenAIApiVersion,...n.query}),this.caller.call(async()=>{try{return await this.client.embeddings.create(e,n)}catch(l){throw DZ(l)}})}}});var qut=B(()=>{});var _ne,$ut=B(()=>{Xh();nV();mG();_ne=class extends $u{static lc_name(){return"DallEAPIWrapper"}constructor(e){e?.responseFormat!==void 0&&["url","b64_json"].includes(e.responseFormat)&&(e.dallEResponseFormat=e.responseFormat,e.responseFormat="content"),super(e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"dalle_api_wrapper"}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:"A wrapper around OpenAI DALL-E API. Useful for when you need to generate images from a text description. Input should be an image description."}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"dall-e-3"}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:"vivid"}),Object.defineProperty(this,"quality",{enumerable:!0,configurable:!0,writable:!0,value:"standard"}),Object.defineProperty(this,"n",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:"1024x1024"}),Object.defineProperty(this,"dallEResponseFormat",{enumerable:!0,configurable:!0,writable:!0,value:"url"}),Object.defineProperty(this,"user",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let n=e?.apiKey??e?.openAIApiKey??yt("OPENAI_API_KEY"),l=e?.organization??yt("OPENAI_ORGANIZATION"),I={apiKey:n,organization:l,dangerouslyAllowBrowser:!0,baseUrl:e?.baseUrl};this.client=new xt(I),this.model=e?.model??e?.modelName??this.model,this.style=e?.style??this.style,this.quality=e?.quality??this.quality,this.n=e?.n??this.n,this.size=e?.size??this.size,this.dallEResponseFormat=e?.dallEResponseFormat??this.dallEResponseFormat,this.user=e?.user}processMultipleGeneratedUrls(e){return this.dallEResponseFormat==="url"?e.flatMap(n=>n.data.flatMap(I=>I.url?{type:"image_url",image_url:I.url}:[]).filter(I=>I!==void 0&&I.type==="image_url"&&typeof I.image_url=="string"&&I.image_url!==void 0)):e.flatMap(n=>n.data.flatMap(I=>I.b64_json?{type:"image_url",image_url:{url:I.b64_json}}:[]).filter(I=>I!==void 0&&I.type==="image_url"&&typeof I.image_url=="object"&&"url"in I.image_url&&typeof I.image_url.url=="string"&&I.image_url.url!==void 0))}async _call(e){let n={model:this.model,prompt:e,n:1,size:this.size,response_format:this.dallEResponseFormat,style:this.style,quality:this.quality,user:this.user};if(this.n>1){let a=await Promise.all(Array.from({length:this.n}).map(()=>this.client.images.generate(n)));return this.processMultipleGeneratedUrls(a)}let l=await this.client.images.generate(n),I="";return this.dallEResponseFormat==="url"?[I]=l.data.map(a=>a.url).filter(a=>a!=="undefined"):[I]=l.data.map(a=>a.b64_json).filter(a=>a!=="undefined"),I}};Object.defineProperty(_ne,"toolName",{enumerable:!0,configurable:!0,writable:!0,value:"dalle_api_wrapper"})});var edt=B(()=>{$ut()});function tdt(t){let e=t.toChatMessages();return{messages:mS(e)}}var ndt=B(()=>{Dne()});var ldt=B(()=>{nV();Dne();Dut();Pwe();_ut();Put();qwe();qut();TQ();dA();edt();ndt()});var Hk={};Xe(Hk,{AzureChatOpenAI:()=>pS,AzureOpenAI:()=>ZS,AzureOpenAIEmbeddings:()=>NS,ChatOpenAI:()=>hG,DallEAPIWrapper:()=>_ne,OpenAI:()=>DQ,OpenAIChat:()=>hS,OpenAIClient:()=>xt,OpenAIEmbeddings:()=>hg,_convertMessagesToOpenAIParams:()=>mS,convertPromptToOpenAI:()=>tdt,formatToOpenAIAssistantTool:()=>Dwe,formatToOpenAIFunction:()=>SZ,formatToOpenAITool:()=>$2,formatToOpenAIToolChoice:()=>Kwe,getEndpoint:()=>bm,messageToOpenAIRole:()=>_we,toFile:()=>TL,wrapOpenAIClientError:()=>DZ});var ZG=B(()=>{ldt()});var VS=B(()=>{MH()});var zEe=f(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});require("obsidian");var ZA=class extends Error{},mEe=class extends ZA{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},pEe=class extends ZA{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},hEe=class extends ZA{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},aE=class extends ZA{},Ple=class extends ZA{constructor(e){super(`Invalid unit ${e}`)}},cp=class extends ZA{},Wg=class extends ZA{constructor(){super("Zone is an abstract class")}},ht="numeric",iV="short",Eh="long",qle={year:ht,month:ht,day:ht},ubt={year:ht,month:iV,day:ht},SSn={year:ht,month:iV,day:ht,weekday:iV},dbt={year:ht,month:Eh,day:ht},Gbt={year:ht,month:Eh,day:ht,weekday:Eh},bbt={hour:ht,minute:ht},mbt={hour:ht,minute:ht,second:ht},pbt={hour:ht,minute:ht,second:ht,timeZoneName:iV},hbt={hour:ht,minute:ht,second:ht,timeZoneName:Eh},Zbt={hour:ht,minute:ht,hourCycle:"h23"},Wbt={hour:ht,minute:ht,second:ht,hourCycle:"h23"},Nbt={hour:ht,minute:ht,second:ht,hourCycle:"h23",timeZoneName:iV},Vbt={hour:ht,minute:ht,second:ht,hourCycle:"h23",timeZoneName:Eh},Ybt={year:ht,month:ht,day:ht,hour:ht,minute:ht},gbt={year:ht,month:ht,day:ht,hour:ht,minute:ht,second:ht},Rbt={year:ht,month:iV,day:ht,hour:ht,minute:ht},ybt={year:ht,month:iV,day:ht,hour:ht,minute:ht,second:ht},MSn={year:ht,month:iV,day:ht,weekday:iV,hour:ht,minute:ht},Abt={year:ht,month:Eh,day:ht,hour:ht,minute:ht,timeZoneName:iV},Fbt={year:ht,month:Eh,day:ht,hour:ht,minute:ht,second:ht,timeZoneName:iV},vbt={year:ht,month:Eh,day:ht,weekday:Eh,hour:ht,minute:ht,timeZoneName:Eh},fbt={year:ht,month:Eh,day:ht,weekday:Eh,hour:ht,minute:ht,second:ht,timeZoneName:Eh},oE=class{get type(){throw new Wg}get name(){throw new Wg}get ianaName(){return this.name}get isUniversal(){throw new Wg}offsetName(e,n){throw new Wg}formatOffset(e,n){throw new Wg}offset(e){throw new Wg}equals(e){throw new Wg}get isValid(){throw new Wg}},cEe=null,$le=class t extends oE{static get instance(){return cEe===null&&(cEe=new t),cEe}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:l}){return wbt(e,n,l)}formatOffset(e,n){return aM(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},Kle={};function TSn(t){return Kle[t]||(Kle[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Kle[t]}var DSn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function KSn(t,e){let n=t.format(e).replace(/\u200E/g,""),l=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,I,a,c,i,s,r,u]=l;return[c,I,a,i,s,r,u]}function _Sn(t,e){let n=t.formatToParts(e),l=[];for(let I=0;I=0?h:1e3+h,(d-b)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},EGt={};function PSn(t,e={}){let n=JSON.stringify([t,e]),l=EGt[n];return l||(l=new Intl.ListFormat(t,e),EGt[n]=l),l}var ZEe={};function WEe(t,e={}){let n=JSON.stringify([t,e]),l=ZEe[n];return l||(l=new Intl.DateTimeFormat(t,e),ZEe[n]=l),l}var NEe={};function qSn(t,e={}){let n=JSON.stringify([t,e]),l=NEe[n];return l||(l=new Intl.NumberFormat(t,e),NEe[n]=l),l}var VEe={};function $Sn(t,e={}){let{base:n,...l}=e,I=JSON.stringify([t,l]),a=VEe[I];return a||(a=new Intl.RelativeTimeFormat(t,e),VEe[I]=a),a}var lM=null;function eMn(){return lM||(lM=new Intl.DateTimeFormat().resolvedOptions().locale,lM)}function tMn(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let l,I;try{l=WEe(t).resolvedOptions(),I=t}catch{let s=t.substring(0,n);l=WEe(s).resolvedOptions(),I=s}let{numberingSystem:a,calendar:c}=l;return[I,a,c]}}function nMn(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function lMn(t){let e=[];for(let n=1;n<=12;n++){let l=$l.utc(2009,n,1);e.push(t(l))}return e}function IMn(t){let e=[];for(let n=1;n<=7;n++){let l=$l.utc(2016,11,13+n);e.push(t(l))}return e}function Ble(t,e,n,l){let I=t.listingMode();return I==="error"?null:I==="en"?n(e):l(e)}function aMn(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var YEe=class{constructor(e,n,l){this.padTo=l.padTo||0,this.floor=l.floor||!1;let{padTo:I,floor:a,...c}=l;if(!n||Object.keys(c).length>0){let i={useGrouping:!1,...l};l.padTo>0&&(i.minimumIntegerDigits=l.padTo),this.inf=qSn(e,i)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):CEe(e,3);return oi(n,this.padTo)}}},gEe=class{constructor(e,n,l){this.opts=l,this.originalZone=void 0;let I;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let c=-1*(e.offset/60),i=c>=0?`Etc/GMT+${c}`:`Etc/GMT${c}`;e.offset!==0&&jv.create(i).valid?(I=i,this.dt=e):(I="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,I=e.zone.name):(I="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let a={...this.opts};a.timeZone=a.timeZone||I,this.dtf=WEe(n,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){let l=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:l}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},REe=class{constructor(e,n,l){this.opts={style:"long",...l},!n&&Xbt()&&(this.rtf=$Sn(e,l))}format(e,n){return this.rtf?this.rtf.format(e,n):VMn(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},Ho=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,n,l,I=!1){let a=e||wo.defaultLocale,c=a||(I?"en-US":eMn()),i=n||wo.defaultNumberingSystem,s=l||wo.defaultOutputCalendar;return new t(c,i,s,a)}static resetCache(){lM=null,ZEe={},NEe={},VEe={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:l}={}){return t.create(e,n,l)}constructor(e,n,l,I){let[a,c,i]=tMn(e);this.locale=a,this.numberingSystem=n||c||null,this.outputCalendar=l||i||null,this.intl=nMn(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=I,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=aMn(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Ble(this,e,Ebt,()=>{let l=n?{month:e,day:"numeric"}:{month:e},I=n?"format":"standalone";return this.monthsCache[I][e]||(this.monthsCache[I][e]=lMn(a=>this.extract(a,l,"month"))),this.monthsCache[I][e]})}weekdays(e,n=!1){return Ble(this,e,Lbt,()=>{let l=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},I=n?"format":"standalone";return this.weekdaysCache[I][e]||(this.weekdaysCache[I][e]=IMn(a=>this.extract(a,l,"weekday"))),this.weekdaysCache[I][e]})}meridiems(){return Ble(this,void 0,()=>kbt,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[$l.utc(2016,11,13,9),$l.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ble(this,e,xbt,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[$l.utc(-40,1,1),$l.utc(2017,1,1)].map(l=>this.extract(l,n,"era"))),this.eraCache[e]})}extract(e,n,l){let I=this.dtFormatter(e,n),a=I.formatToParts(),c=a.find(i=>i.type.toLowerCase()===l);return c?c.value:null}numberFormatter(e={}){return new YEe(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new gEe(e,this.intl,n)}relFormatter(e={}){return new REe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return PSn(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}},oEe=null,PZ=class t extends oE{static get utcInstance(){return oEe===null&&(oEe=new t(0)),oEe}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(iIe(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${aM(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${aM(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return aM(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},yEe=class extends oE{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function xv(t,e){if(AI(t)||t===null)return e;if(t instanceof oE)return t;if(rMn(t)){let n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?$le.instance:n==="utc"||n==="gmt"?PZ.utcInstance:PZ.parseSpecifier(n)||jv.create(t)}else return cE(t)?PZ.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new yEe(t)}var JGt=()=>Date.now(),CGt="system",LGt=null,kGt=null,xGt=null,jGt=60,OGt,wo=class{static get now(){return JGt}static set now(e){JGt=e}static set defaultZone(e){CGt=e}static get defaultZone(){return xv(CGt,$le.instance)}static get defaultLocale(){return LGt}static set defaultLocale(e){LGt=e}static get defaultNumberingSystem(){return kGt}static set defaultNumberingSystem(e){kGt=e}static get defaultOutputCalendar(){return xGt}static set defaultOutputCalendar(e){xGt=e}static get twoDigitCutoffYear(){return jGt}static set twoDigitCutoffYear(e){jGt=e%100}static get throwOnInvalid(){return OGt}static set throwOnInvalid(e){OGt=e}static resetCaches(){Ho.resetCache(),jv.resetCache()}};function AI(t){return typeof t>"u"}function cE(t){return typeof t=="number"}function cIe(t){return typeof t=="number"&&t%1===0}function rMn(t){return typeof t=="string"}function cMn(t){return Object.prototype.toString.call(t)==="[object Date]"}function Xbt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function oMn(t){return Array.isArray(t)?t:[t]}function UGt(t,e,n){if(t.length!==0)return t.reduce((l,I)=>{let a=[e(I),I];return l&&n(l[0],a[0])===l[0]?l:a},null)[1]}function iMn(t,e){return e.reduce((n,l)=>(n[l]=t[l],n),{})}function Ix(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function hA(t,e,n){return cIe(t)&&t>=e&&t<=n}function sMn(t,e){return t-e*Math.floor(t/e)}function oi(t,e=2){let n=t<0,l;return n?l="-"+(""+-t).padStart(e,"0"):l=(""+t).padStart(e,"0"),l}function kv(t){if(!(AI(t)||t===null||t===""))return parseInt(t,10)}function lE(t){if(!(AI(t)||t===null||t===""))return parseFloat(t)}function JEe(t){if(!(AI(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function CEe(t,e,n=!1){let l=10**e;return(n?Math.trunc:Math.round)(t*l)/l}function oM(t){return t%4===0&&(t%100!==0||t%400===0)}function IM(t){return oM(t)?366:365}function eIe(t,e){let n=sMn(e-1,12)+1,l=t+(e-n)/12;return n===2?oM(l)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function oIe(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function tIe(t){let e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,n=t-1,l=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return e===4||l===3?53:52}function AEe(t){return t>99?t:t>wo.twoDigitCutoffYear?1900+t:2e3+t}function wbt(t,e,n,l=null){let I=new Date(t),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};l&&(a.timeZone=l);let c={timeZoneName:e,...a},i=new Intl.DateTimeFormat(n,c).formatToParts(I).find(s=>s.type.toLowerCase()==="timezonename");return i?i.value:null}function iIe(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let l=parseInt(e,10)||0,I=n<0||Object.is(n,-0)?-l:l;return n*60+I}function Hbt(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new cp(`Invalid unit value ${t}`);return e}function nIe(t,e){let n={};for(let l in t)if(Ix(t,l)){let I=t[l];if(I==null)continue;n[e(l)]=Hbt(I)}return n}function aM(t,e){let n=Math.trunc(Math.abs(t/60)),l=Math.trunc(Math.abs(t%60)),I=t>=0?"+":"-";switch(e){case"short":return`${I}${oi(n,2)}:${oi(l,2)}`;case"narrow":return`${I}${n}${l>0?`:${l}`:""}`;case"techie":return`${I}${oi(n,2)}${oi(l,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function sIe(t){return iMn(t,["hour","minute","second","millisecond"])}var uMn=["January","February","March","April","May","June","July","August","September","October","November","December"],Qbt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dMn=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ebt(t){switch(t){case"narrow":return[...dMn];case"short":return[...Qbt];case"long":return[...uMn];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Jbt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Cbt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],GMn=["M","T","W","T","F","S","S"];function Lbt(t){switch(t){case"narrow":return[...GMn];case"short":return[...Cbt];case"long":return[...Jbt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var kbt=["AM","PM"],bMn=["Before Christ","Anno Domini"],mMn=["BC","AD"],pMn=["B","A"];function xbt(t){switch(t){case"narrow":return[...pMn];case"short":return[...mMn];case"long":return[...bMn];default:return null}}function hMn(t){return kbt[t.hour<12?0:1]}function ZMn(t,e){return Lbt(e)[t.weekday-1]}function WMn(t,e){return Ebt(e)[t.month-1]}function NMn(t,e){return xbt(e)[t.year<0?0:1]}function VMn(t,e,n="always",l=!1){let I={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&a){let o=t==="days";switch(e){case 1:return o?"tomorrow":`next ${I[t][0]}`;case-1:return o?"yesterday":`last ${I[t][0]}`;case 0:return o?"today":`this ${I[t][0]}`}}let c=Object.is(e,-0)||e<0,i=Math.abs(e),s=i===1,r=I[t],u=l?s?r[1]:r[2]||r[1]:s?I[t][0]:t;return c?`${i} ${u} ago`:`in ${i} ${u}`}function zGt(t,e){let n="";for(let l of t)l.literal?n+=l.val:n+=e(l.val);return n}var YMn={D:qle,DD:ubt,DDD:dbt,DDDD:Gbt,t:bbt,tt:mbt,ttt:pbt,tttt:hbt,T:Zbt,TT:Wbt,TTT:Nbt,TTTT:Vbt,f:Ybt,ff:Rbt,fff:Abt,ffff:vbt,F:gbt,FF:ybt,FFF:Fbt,FFFF:fbt},Hh=class t{static create(e,n={}){return new t(e,n)}static parseFormat(e){let n=null,l="",I=!1,a=[];for(let c=0;c0&&a.push({literal:I||/^\s+$/.test(l),val:l}),n=null,l="",I=!I):I||i===n?l+=i:(l.length>0&&a.push({literal:/^\s+$/.test(l),val:l}),l=i,n=i)}return l.length>0&&a.push({literal:I||/^\s+$/.test(l),val:l}),a}static macroTokenToFormatOpts(e){return YMn[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return oi(e,n);let l={...this.opts};return n>0&&(l.padTo=n),this.loc.numberFormatter(l).format(e)}formatDateTimeFromString(e,n){let l=this.loc.listingMode()==="en",I=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(b,h)=>this.loc.extract(e,b,h),c=b=>e.isOffsetFixed&&e.offset===0&&b.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,b.format):"",i=()=>l?hMn(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),s=(b,h)=>l?WMn(e,b):a(h?{month:b}:{month:b,day:"numeric"},"month"),r=(b,h)=>l?ZMn(e,b):a(h?{weekday:b}:{weekday:b,month:"long",day:"numeric"},"weekday"),u=b=>{let h=t.macroTokenToFormatOpts(b);return h?this.formatWithSystemDefault(e,h):b},o=b=>l?NMn(e,b):a({era:b},"era"),d=b=>{switch(b){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return c({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return c({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return c({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return I?a({day:"numeric"},"day"):this.num(e.day);case"dd":return I?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return r("short",!0);case"cccc":return r("long",!0);case"ccccc":return r("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return r("short",!1);case"EEEE":return r("long",!1);case"EEEEE":return r("narrow",!1);case"L":return I?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return I?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return s("short",!0);case"LLLL":return s("long",!0);case"LLLLL":return s("narrow",!0);case"M":return I?a({month:"numeric"},"month"):this.num(e.month);case"MM":return I?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return s("short",!1);case"MMMM":return s("long",!1);case"MMMMM":return s("narrow",!1);case"y":return I?a({year:"numeric"},"year"):this.num(e.year);case"yy":return I?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return I?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return I?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return o("short");case"GG":return o("long");case"GGGGG":return o("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(b)}};return zGt(t.parseFormat(n),d)}formatDurationFromString(e,n){let l=s=>{switch(s[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},I=s=>r=>{let u=l(r);return u?this.num(s.get(u),r.length):r},a=t.parseFormat(n),c=a.reduce((s,{literal:r,val:u})=>r?s:s.concat(u),[]),i=e.shiftTo(...c.map(l).filter(s=>s));return zGt(a,I(i))}},Qh=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},jbt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ax(...t){let e=t.reduce((n,l)=>n+l.source,"");return RegExp(`^${e}$`)}function rx(...t){return e=>t.reduce(([n,l,I],a)=>{let[c,i,s]=a(e,I);return[{...n,...c},i||l,s]},[{},null,1]).slice(0,2)}function cx(t,...e){if(t==null)return[null,null];for(let[n,l]of e){let I=n.exec(t);if(I)return l(I)}return[null,null]}function Obt(...t){return(e,n)=>{let l={},I;for(I=0;Ib!==void 0&&(h||b&&u)?-b:b;return[{years:d(lE(n)),months:d(lE(l)),weeks:d(lE(I)),days:d(lE(a)),hours:d(lE(c)),minutes:d(lE(i)),seconds:d(lE(s),s==="-0"),milliseconds:d(JEe(r),o)}]}var JMn={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function xEe(t,e,n,l,I,a,c){let i={year:e.length===2?AEe(kv(e)):kv(e),month:Qbt.indexOf(n)+1,day:kv(l),hour:kv(I),minute:kv(a)};return c&&(i.second=kv(c)),t&&(i.weekday=t.length>3?Jbt.indexOf(t)+1:Cbt.indexOf(t)+1),i}var CMn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function LMn(t){let[,e,n,l,I,a,c,i,s,r,u,o]=t,d=xEe(e,I,l,n,a,c,i),b;return s?b=JMn[s]:r?b=0:b=iIe(u,o),[d,new PZ(b)]}function kMn(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var xMn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,jMn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,OMn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function BGt(t){let[,e,n,l,I,a,c,i]=t;return[xEe(e,I,l,n,a,c,i),PZ.utcInstance]}function UMn(t){let[,e,n,l,I,a,c,i]=t;return[xEe(e,i,n,l,I,a,c),PZ.utcInstance]}var zMn=ax(RMn,kEe),BMn=ax(yMn,kEe),SMn=ax(AMn,kEe),MMn=ax(zbt),Sbt=rx(wMn,ox,iM,sM),TMn=rx(FMn,ox,iM,sM),DMn=rx(vMn,ox,iM,sM),KMn=rx(ox,iM,sM);function _Mn(t){return cx(t,[zMn,Sbt],[BMn,TMn],[SMn,DMn],[MMn,KMn])}function PMn(t){return cx(kMn(t),[CMn,LMn])}function qMn(t){return cx(t,[xMn,BGt],[jMn,BGt],[OMn,UMn])}function $Mn(t){return cx(t,[QMn,EMn])}var eTn=rx(ox);function tTn(t){return cx(t,[HMn,eTn])}var nTn=ax(fMn,XMn),lTn=ax(Bbt),ITn=rx(ox,iM,sM);function aTn(t){return cx(t,[nTn,Sbt],[lTn,ITn])}var SGt="Invalid Duration",Mbt={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},rTn={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Mbt},KZ=146097/400,$k=146097/4800,cTn={years:{quarters:4,months:12,weeks:KZ/7,days:KZ,hours:KZ*24,minutes:KZ*24*60,seconds:KZ*24*60*60,milliseconds:KZ*24*60*60*1e3},quarters:{months:3,weeks:KZ/28,days:KZ/4,hours:KZ*24/4,minutes:KZ*24*60/4,seconds:KZ*24*60*60/4,milliseconds:KZ*24*60*60*1e3/4},months:{weeks:$k/7,days:$k,hours:$k*24,minutes:$k*24*60,seconds:$k*24*60*60,milliseconds:$k*24*60*60*1e3},...Mbt},rE=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],oTn=rE.slice(0).reverse();function Lv(t,e,n=!1){let l={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Nn(l)}function Tbt(t,e){let n=e.milliseconds??0;for(let l of oTn.slice(1))e[l]&&(n+=e[l]*t[l].milliseconds);return n}function MGt(t,e){let n=Tbt(t,e)<0?-1:1;rE.reduceRight((l,I)=>{if(AI(e[I]))return l;if(l){let a=e[l]*n,c=t[I][l],i=Math.floor(a/c);e[I]+=i*n,e[l]-=i*c*n}return I},null),rE.reduce((l,I)=>{if(AI(e[I]))return l;if(l){let a=e[l]%1;e[l]-=a,e[I]+=a*t[l][I]}return I},null)}function iTn(t){let e={};for(let[n,l]of Object.entries(t))l!==0&&(e[n]=l);return e}var Nn=class t{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,l=n?cTn:rTn;e.matrix&&(l=e.matrix),this.values=e.values,this.loc=e.loc||Ho.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=l,this.isLuxonDuration=!0}static fromMillis(e,n){return t.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new cp(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:nIe(e,t.normalizeUnit),loc:Ho.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(cE(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new cp(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[l]=$Mn(e);return l?t.fromObject(l,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[l]=tTn(e);return l?t.fromObject(l,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new cp("need to specify a reason the Duration is invalid");let l=e instanceof Qh?e:new Qh(e,n);if(wo.throwOnInvalid)throw new hEe(l);return new t({invalid:l})}static normalizeUnit(e){let n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new Ple(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){let l={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Hh.create(this.loc,l).formatDurationFromString(this,e):SGt}toHuman(e={}){if(!this.isValid)return SGt;let n=rE.map(l=>{let I=this.values[l];return AI(I)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:l.slice(0,-1)}).format(I)}).filter(l=>l);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=CEe(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},$l.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.isValid?Tbt(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e),l={};for(let I of rE)(Ix(n.values,I)||Ix(this.values,I))&&(l[I]=n.get(I)+this.get(I));return Lv(this,{values:l},!0)}minus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let l of Object.keys(this.values))n[l]=Hbt(e(this.values[l],l));return Lv(this,{values:n},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...nIe(e,t.normalizeUnit)};return Lv(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:l,matrix:I}={}){let c={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:I,conversionAccuracy:l};return Lv(this,c)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return MGt(this.matrix,e),Lv(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=iTn(this.normalize().shiftToAll().toObject());return Lv(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(c=>t.normalizeUnit(c));let n={},l={},I=this.toObject(),a;for(let c of rE)if(e.indexOf(c)>=0){a=c;let i=0;for(let r in l)i+=this.matrix[r][c]*l[r],l[r]=0;cE(I[c])&&(i+=I[c]);let s=Math.trunc(i);n[c]=s,l[c]=(i*1e3-s*1e3)/1e3}else cE(I[c])&&(l[c]=I[c]);for(let c in l)l[c]!==0&&(n[a]+=c===a?l[c]:l[c]/this.matrix[a][c]);return MGt(this.matrix,n),Lv(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Lv(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(l,I){return l===void 0||l===0?I===void 0||I===0:l===I}for(let l of rE)if(!n(this.values[l],e.values[l]))return!1;return!0}},ex="Invalid Interval";function sTn(t,e){return!t||!t.isValid?lx.invalid("missing or invalid start"):!e||!e.isValid?lx.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(tM).filter(c=>this.contains(c)).sort(),l=[],{s:I}=this,a=0;for(;I+this.e?this.e:c;l.push(t.fromDateTimes(I,i)),I=i,a+=1}return l}splitBy(e){let n=Nn.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:l}=this,I=1,a,c=[];for(;ls*I));a=+i>+this.e?this.e:i,c.push(t.fromDateTimes(l,a)),l=a,I+=1}return c}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let n=this.s>e.s?this.s:e.s,l=this.e=l?null:t.fromDateTimes(n,l)}union(e){if(!this.isValid)return this;let n=this.se.e?this.e:e.e;return t.fromDateTimes(n,l)}static merge(e){let[n,l]=e.sort((I,a)=>I.s-a.s).reduce(([I,a],c)=>a?a.overlaps(c)||a.abutsStart(c)?[I,a.union(c)]:[I.concat([a]),c]:[I,c],[[],null]);return l&&n.push(l),n}static xor(e){let n=null,l=0,I=[],a=e.map(s=>[{time:s.s,type:"s"},{time:s.e,type:"e"}]),c=Array.prototype.concat(...a),i=c.sort((s,r)=>s.time-r.time);for(let s of i)l+=s.type==="s"?1:-1,l===1?n=s.time:(n&&+n!=+s.time&&I.push(t.fromDateTimes(n,s.time)),n=null);return t.merge(I)}difference(...e){return t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:ex}toLocaleString(e=qle,n={}){return this.isValid?Hh.create(this.s.loc.clone(n),e).formatInterval(this):ex}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ex}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ex}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ex}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:ex}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):Nn.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},tx=class{static hasDST(e=wo.defaultZone){let n=$l.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return jv.isValidZone(e)}static normalizeZone(e){return xv(e,wo.defaultZone)}static months(e="long",{locale:n=null,numberingSystem:l=null,locObj:I=null,outputCalendar:a="gregory"}={}){return(I||Ho.create(n,l,a)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:l=null,locObj:I=null,outputCalendar:a="gregory"}={}){return(I||Ho.create(n,l,a)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:l=null,locObj:I=null}={}){return(I||Ho.create(n,l,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:l=null,locObj:I=null}={}){return(I||Ho.create(n,l,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ho.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Ho.create(n,null,"gregory").eras(e)}static features(){return{relative:Xbt()}}};function TGt(t,e){let n=I=>I.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),l=n(e)-n(t);return Math.floor(Nn.fromMillis(l).as("days"))}function uTn(t,e,n){let l=[["years",(s,r)=>r.year-s.year],["quarters",(s,r)=>r.quarter-s.quarter+(r.year-s.year)*4],["months",(s,r)=>r.month-s.month+(r.year-s.year)*12],["weeks",(s,r)=>{let u=TGt(s,r);return(u-u%7)/7}],["days",TGt]],I={},a=t,c,i;for(let[s,r]of l)n.indexOf(s)>=0&&(c=s,I[s]=r(t,e),i=a.plus(I),i>e?(I[s]--,t=a.plus(I),t>e&&(i=t,I[s]--,t=a.plus(I))):t=i);return[t,I,i,c]}function dTn(t,e,n,l){let[I,a,c,i]=uTn(t,e,n),s=e-I,r=n.filter(o=>["hours","minutes","seconds","milliseconds"].indexOf(o)>=0);r.length===0&&(c0?Nn.fromMillis(s,l).shiftTo(...r).plus(u):u}var jEe={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},DGt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},GTn=jEe.hanidec.replace(/[\[|\]]/g,"").split("");function bTn(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=a&&l<=c&&(e+=l-a)}}return parseInt(e,10)}else return e}function rV({numberingSystem:t},e=""){return new RegExp(`${jEe[t||"latn"]}${e}`)}var mTn="missing Intl.DateTimeFormat.formatToParts support";function pr(t,e=n=>n){return{regex:t,deser:([n])=>e(bTn(n))}}var pTn="\xA0",Dbt=`[ ${pTn}]`,Kbt=new RegExp(Dbt,"g");function hTn(t){return t.replace(/\./g,"\\.?").replace(Kbt,Dbt)}function KGt(t){return t.replace(/\./g,"").replace(Kbt," ").toLowerCase()}function cV(t,e){return t===null?null:{regex:RegExp(t.map(hTn).join("|")),deser:([n])=>t.findIndex(l=>KGt(n)===KGt(l))+e}}function _Gt(t,e){return{regex:t,deser:([,n,l])=>iIe(n,l),groups:e}}function Sle(t){return{regex:t,deser:([e])=>e}}function ZTn(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function WTn(t,e){let n=rV(e),l=rV(e,"{2}"),I=rV(e,"{3}"),a=rV(e,"{4}"),c=rV(e,"{6}"),i=rV(e,"{1,2}"),s=rV(e,"{1,3}"),r=rV(e,"{1,6}"),u=rV(e,"{1,9}"),o=rV(e,"{2,4}"),d=rV(e,"{4,6}"),b=N=>({regex:RegExp(ZTn(N.val)),deser:([g])=>g,literal:!0}),Z=(N=>{if(t.literal)return b(N);switch(N.val){case"G":return cV(e.eras("short"),0);case"GG":return cV(e.eras("long"),0);case"y":return pr(r);case"yy":return pr(o,AEe);case"yyyy":return pr(a);case"yyyyy":return pr(d);case"yyyyyy":return pr(c);case"M":return pr(i);case"MM":return pr(l);case"MMM":return cV(e.months("short",!0),1);case"MMMM":return cV(e.months("long",!0),1);case"L":return pr(i);case"LL":return pr(l);case"LLL":return cV(e.months("short",!1),1);case"LLLL":return cV(e.months("long",!1),1);case"d":return pr(i);case"dd":return pr(l);case"o":return pr(s);case"ooo":return pr(I);case"HH":return pr(l);case"H":return pr(i);case"hh":return pr(l);case"h":return pr(i);case"mm":return pr(l);case"m":return pr(i);case"q":return pr(i);case"qq":return pr(l);case"s":return pr(i);case"ss":return pr(l);case"S":return pr(s);case"SSS":return pr(I);case"u":return Sle(u);case"uu":return Sle(i);case"uuu":return pr(n);case"a":return cV(e.meridiems(),0);case"kkkk":return pr(a);case"kk":return pr(o,AEe);case"W":return pr(i);case"WW":return pr(l);case"E":case"c":return pr(n);case"EEE":return cV(e.weekdays("short",!1),1);case"EEEE":return cV(e.weekdays("long",!1),1);case"ccc":return cV(e.weekdays("short",!0),1);case"cccc":return cV(e.weekdays("long",!0),1);case"Z":case"ZZ":return _Gt(new RegExp(`([+-]${i.source})(?::(${l.source}))?`),2);case"ZZZ":return _Gt(new RegExp(`([+-]${i.source})(${l.source})?`),2);case"z":return Sle(/[a-z_+-/]{1,256}?/i);case" ":return Sle(/[^\S\n\r]/);default:return b(N)}})(t)||{invalidReason:mTn};return Z.token=t,Z}var NTn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function VTn(t,e,n){let{type:l,value:I}=t;if(l==="literal"){let s=/^\s+$/.test(I);return{literal:!s,val:s?" ":I}}let a=e[l],c=l;l==="hour"&&(e.hour12!=null?c=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?c="hour12":c="hour24":c=n.hour12?"hour12":"hour24");let i=NTn[c];if(typeof i=="object"&&(i=i[a]),i)return{literal:!1,val:i}}function YTn(t){return[`^${t.map(n=>n.regex).reduce((n,l)=>`${n}(${l.source})`,"")}$`,t]}function gTn(t,e,n){let l=t.match(e);if(l){let I={},a=1;for(let c in n)if(Ix(n,c)){let i=n[c],s=i.groups?i.groups+1:1;!i.literal&&i.token&&(I[i.token.val[0]]=i.deser(l.slice(a,a+s))),a+=s}return[l,I]}else return[l,{}]}function RTn(t){let e=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null,l;return AI(t.z)||(n=jv.create(t.z)),AI(t.Z)||(n||(n=new PZ(t.Z)),l=t.Z),AI(t.q)||(t.M=(t.q-1)*3+1),AI(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),AI(t.u)||(t.S=JEe(t.u)),[Object.keys(t).reduce((a,c)=>{let i=e(c);return i&&(a[i]=t[c]),a},{}),n,l]}var iEe=null;function yTn(){return iEe||(iEe=$l.fromMillis(1555555555555)),iEe}function ATn(t,e){if(t.literal)return t;let n=Hh.macroTokenToFormatOpts(t.val),l=qbt(n,e);return l==null||l.includes(void 0)?t:l}function _bt(t,e){return Array.prototype.concat(...t.map(n=>ATn(n,e)))}function Pbt(t,e,n){let l=_bt(Hh.parseFormat(n),t),I=l.map(c=>WTn(c,t)),a=I.find(c=>c.invalidReason);if(a)return{input:e,tokens:l,invalidReason:a.invalidReason};{let[c,i]=YTn(I),s=RegExp(c,"i"),[r,u]=gTn(e,s,i),[o,d,b]=u?RTn(u):[null,null,void 0];if(Ix(u,"a")&&Ix(u,"H"))throw new aE("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:l,regex:s,rawMatches:r,matches:u,result:o,zone:d,specificOffset:b}}}function FTn(t,e,n){let{result:l,zone:I,specificOffset:a,invalidReason:c}=Pbt(t,e,n);return[l,I,a,c]}function qbt(t,e){if(!t)return null;let l=Hh.create(e,t).dtFormatter(yTn()),I=l.formatToParts(),a=l.resolvedOptions();return I.map(c=>VTn(c,t,a))}var $bt=[0,31,59,90,120,151,181,212,243,273,304,334],emt=[0,31,60,91,121,152,182,213,244,274,305,335];function _Z(t,e){return new Qh("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function tmt(t,e,n){let l=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&l.setUTCFullYear(l.getUTCFullYear()-1900);let I=l.getUTCDay();return I===0?7:I}function nmt(t,e,n){return n+(oM(t)?emt:$bt)[e-1]}function lmt(t,e){let n=oM(t)?emt:$bt,l=n.findIndex(a=>atIe(e)?(i=e+1,c=1):i=e,{weekYear:i,weekNumber:c,weekday:a,...sIe(t)}}function PGt(t){let{weekYear:e,weekNumber:n,weekday:l}=t,I=tmt(e,1,4),a=IM(e),c=n*7+l-I-3,i;c<1?(i=e-1,c+=IM(i)):c>a?(i=e+1,c-=IM(e)):i=e;let{month:s,day:r}=lmt(i,c);return{year:i,month:s,day:r,...sIe(t)}}function sEe(t){let{year:e,month:n,day:l}=t,I=nmt(e,n,l);return{year:e,ordinal:I,...sIe(t)}}function qGt(t){let{year:e,ordinal:n}=t,{month:l,day:I}=lmt(e,n);return{year:e,month:l,day:I,...sIe(t)}}function vTn(t){let e=cIe(t.weekYear),n=hA(t.weekNumber,1,tIe(t.weekYear)),l=hA(t.weekday,1,7);return e?n?l?!1:_Z("weekday",t.weekday):_Z("week",t.week):_Z("weekYear",t.weekYear)}function fTn(t){let e=cIe(t.year),n=hA(t.ordinal,1,IM(t.year));return e?n?!1:_Z("ordinal",t.ordinal):_Z("year",t.year)}function Imt(t){let e=cIe(t.year),n=hA(t.month,1,12),l=hA(t.day,1,eIe(t.year,t.month));return e?n?l?!1:_Z("day",t.day):_Z("month",t.month):_Z("year",t.year)}function amt(t){let{hour:e,minute:n,second:l,millisecond:I}=t,a=hA(e,0,23)||e===24&&n===0&&l===0&&I===0,c=hA(n,0,59),i=hA(l,0,59),s=hA(I,0,999);return a?c?i?s?!1:_Z("millisecond",I):_Z("second",l):_Z("minute",n):_Z("hour",e)}var uEe="Invalid DateTime",$Gt=864e13;function Mle(t){return new Qh("unsupported zone",`the zone "${t.name}" is not supported`)}function dEe(t){return t.weekData===null&&(t.weekData=FEe(t.c)),t.weekData}function IE(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new $l({...n,...e,old:n})}function rmt(t,e,n){let l=t-e*60*1e3,I=n.offset(l);if(e===I)return[l,e];l-=(I-e)*60*1e3;let a=n.offset(l);return I===a?[l,I]:[t-Math.min(I,a)*60*1e3,Math.max(I,a)]}function Tle(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function _le(t,e,n){return rmt(oIe(t),e,n)}function ebt(t,e){let n=t.o,l=t.c.year+Math.trunc(e.years),I=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,a={...t.c,year:l,month:I,day:Math.min(t.c.day,eIe(l,I))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},c=Nn.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),i=oIe(a),[s,r]=rmt(i,n,t.zone);return c!==0&&(s+=c,r=t.zone.offset(s)),{ts:s,o:r}}function eM(t,e,n,l,I,a){let{setZone:c,zone:i}=n;if(t&&Object.keys(t).length!==0||e){let s=e||i,r=$l.fromObject(t,{...n,zone:s,specificOffset:a});return c?r:r.setZone(i)}else return $l.invalid(new Qh("unparsable",`the input "${I}" can't be parsed as ${l}`))}function Dle(t,e,n=!0){return t.isValid?Hh.create(Ho.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function GEe(t,e){let n=t.c.year>9999||t.c.year<0,l="";return n&&t.c.year>=0&&(l+="+"),l+=oi(t.c.year,n?6:4),e?(l+="-",l+=oi(t.c.month),l+="-",l+=oi(t.c.day)):(l+=oi(t.c.month),l+=oi(t.c.day)),l}function tbt(t,e,n,l,I,a){let c=oi(t.c.hour);return e?(c+=":",c+=oi(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(c+=":")):c+=oi(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(c+=oi(t.c.second),(t.c.millisecond!==0||!l)&&(c+=".",c+=oi(t.c.millisecond,3))),I&&(t.isOffsetFixed&&t.offset===0&&!a?c+="Z":t.o<0?(c+="-",c+=oi(Math.trunc(-t.o/60)),c+=":",c+=oi(Math.trunc(-t.o%60))):(c+="+",c+=oi(Math.trunc(t.o/60)),c+=":",c+=oi(Math.trunc(t.o%60)))),a&&(c+="["+t.zone.ianaName+"]"),c}var cmt={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},XTn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},wTn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},omt=["year","month","day","hour","minute","second","millisecond"],HTn=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],QTn=["year","ordinal","hour","minute","second","millisecond"];function nbt(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Ple(t);return e}function lbt(t,e){let n=xv(e.zone,wo.defaultZone),l=Ho.fromObject(e),I=wo.now(),a,c;if(AI(t.year))a=I;else{for(let r of omt)AI(t[r])&&(t[r]=cmt[r]);let i=Imt(t)||amt(t);if(i)return $l.invalid(i);let s=n.offset(I);[a,c]=_le(t,s,n)}return new $l({ts:a,zone:n,loc:l,o:c})}function Ibt(t,e,n){let l=AI(n.round)?!0:n.round,I=(c,i)=>(c=CEe(c,l||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(c,i)),a=c=>n.calendary?e.hasSame(t,c)?0:e.startOf(c).diff(t.startOf(c),c).get(c):e.diff(t,c).get(c);if(n.unit)return I(a(n.unit),n.unit);for(let c of n.units){let i=a(c);if(Math.abs(i)>=1)return I(i,c)}return I(t>e?-0:0,n.units[n.units.length-1])}function abt(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var $l=class t{constructor(e){let n=e.zone||wo.defaultZone,l=e.invalid||(Number.isNaN(e.ts)?new Qh("invalid input"):null)||(n.isValid?null:Mle(n));this.ts=AI(e.ts)?wo.now():e.ts;let I=null,a=null;if(!l)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[I,a]=[e.old.c,e.old.o];else{let i=n.offset(this.ts);I=Tle(this.ts,i),l=Number.isNaN(I.year)?new Qh("invalid input"):null,I=l?null:I,a=l?null:i}this._zone=n,this.loc=e.loc||Ho.create(),this.invalid=l,this.weekData=null,this.c=I,this.o=a,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,n]=abt(arguments),[l,I,a,c,i,s,r]=n;return lbt({year:l,month:I,day:a,hour:c,minute:i,second:s,millisecond:r},e)}static utc(){let[e,n]=abt(arguments),[l,I,a,c,i,s,r]=n;return e.zone=PZ.utcInstance,lbt({year:l,month:I,day:a,hour:c,minute:i,second:s,millisecond:r},e)}static fromJSDate(e,n={}){let l=cMn(e)?e.valueOf():NaN;if(Number.isNaN(l))return t.invalid("invalid input");let I=xv(n.zone,wo.defaultZone);return I.isValid?new t({ts:l,zone:I,loc:Ho.fromObject(n)}):t.invalid(Mle(I))}static fromMillis(e,n={}){if(cE(e))return e<-$Gt||e>$Gt?t.invalid("Timestamp out of range"):new t({ts:e,zone:xv(n.zone,wo.defaultZone),loc:Ho.fromObject(n)});throw new cp(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(cE(e))return new t({ts:e*1e3,zone:xv(n.zone,wo.defaultZone),loc:Ho.fromObject(n)});throw new cp("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let l=xv(n.zone,wo.defaultZone);if(!l.isValid)return t.invalid(Mle(l));let I=wo.now(),a=AI(n.specificOffset)?l.offset(I):n.specificOffset,c=nIe(e,nbt),i=!AI(c.ordinal),s=!AI(c.year),r=!AI(c.month)||!AI(c.day),u=s||r,o=c.weekYear||c.weekNumber,d=Ho.fromObject(n);if((u||i)&&o)throw new aE("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(r&&i)throw new aE("Can't mix ordinal dates with month/day");let b=o||c.weekday&&!u,h,Z,N=Tle(I,a);b?(h=HTn,Z=XTn,N=FEe(N)):i?(h=QTn,Z=wTn,N=sEe(N)):(h=omt,Z=cmt);let g=!1;for(let J of h){let O=c[J];AI(O)?g?c[J]=Z[J]:c[J]=N[J]:g=!0}let y=b?vTn(c):i?fTn(c):Imt(c),X=y||amt(c);if(X)return t.invalid(X);let v=b?PGt(c):i?qGt(c):c,[H,Q]=_le(v,a,l),L=new t({ts:H,zone:l,o:Q,loc:d});return c.weekday&&u&&e.weekday!==L.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${c.weekday} and a date of ${L.toISO()}`):L}static fromISO(e,n={}){let[l,I]=_Mn(e);return eM(l,I,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[l,I]=PMn(e);return eM(l,I,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[l,I]=qMn(e);return eM(l,I,n,"HTTP",n)}static fromFormat(e,n,l={}){if(AI(e)||AI(n))throw new cp("fromFormat requires an input string and a format");let{locale:I=null,numberingSystem:a=null}=l,c=Ho.fromOpts({locale:I,numberingSystem:a,defaultToEN:!0}),[i,s,r,u]=FTn(c,e,n);return u?t.invalid(u):eM(i,s,l,`format ${n}`,e,r)}static fromString(e,n,l={}){return t.fromFormat(e,n,l)}static fromSQL(e,n={}){let[l,I]=aTn(e);return eM(l,I,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new cp("need to specify a reason the DateTime is invalid");let l=e instanceof Qh?e:new Qh(e,n);if(wo.throwOnInvalid)throw new mEe(l);return new t({invalid:l})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let l=qbt(e,Ho.fromObject(n));return l?l.map(I=>I?I.val:null).join(""):null}static expandFormat(e,n={}){return _bt(Hh.parseFormat(e),Ho.fromObject(n)).map(I=>I.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?dEe(this).weekYear:NaN}get weekNumber(){return this.isValid?dEe(this).weekNumber:NaN}get weekday(){return this.isValid?dEe(this).weekday:NaN}get ordinal(){return this.isValid?sEe(this.c).ordinal:NaN}get monthShort(){return this.isValid?tx.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?tx.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?tx.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?tx.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,n=6e4,l=oIe(this.c),I=this.zone.offset(l-e),a=this.zone.offset(l+e),c=this.zone.offset(l-I*n),i=this.zone.offset(l-a*n);if(c===i)return[this];let s=l-c*n,r=l-i*n,u=Tle(s,c),o=Tle(r,i);return u.hour===o.hour&&u.minute===o.minute&&u.second===o.second&&u.millisecond===o.millisecond?[IE(this,{ts:s}),IE(this,{ts:r})]:[this]}get isInLeapYear(){return oM(this.year)}get daysInMonth(){return eIe(this.year,this.month)}get daysInYear(){return this.isValid?IM(this.year):NaN}get weeksInWeekYear(){return this.isValid?tIe(this.weekYear):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:l,calendar:I}=Hh.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:l,outputCalendar:I}}toUTC(e=0,n={}){return this.setZone(PZ.instance(e),n)}toLocal(){return this.setZone(wo.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:l=!1}={}){if(e=xv(e,wo.defaultZone),e.equals(this.zone))return this;if(e.isValid){let I=this.ts;if(n||l){let a=e.offset(this.ts),c=this.toObject();[I]=_le(c,a,e)}return IE(this,{ts:I,zone:e})}else return t.invalid(Mle(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:l}={}){let I=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:l});return IE(this,{loc:I})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=nIe(e,nbt),l=!AI(n.weekYear)||!AI(n.weekNumber)||!AI(n.weekday),I=!AI(n.ordinal),a=!AI(n.year),c=!AI(n.month)||!AI(n.day),i=a||c,s=n.weekYear||n.weekNumber;if((i||I)&&s)throw new aE("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&I)throw new aE("Can't mix ordinal dates with month/day");let r;l?r=PGt({...FEe(this.c),...n}):AI(n.ordinal)?(r={...this.toObject(),...n},AI(n.day)&&(r.day=Math.min(eIe(r.year,r.month),r.day))):r=qGt({...sEe(this.c),...n});let[u,o]=_le(r,this.o,this.zone);return IE(this,{ts:u,o})}plus(e){if(!this.isValid)return this;let n=Nn.fromDurationLike(e);return IE(this,ebt(this,n))}minus(e){if(!this.isValid)return this;let n=Nn.fromDurationLike(e).negate();return IE(this,ebt(this,n))}startOf(e){if(!this.isValid)return this;let n={},l=Nn.normalizeUnit(e);switch(l){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(l==="weeks"&&(n.weekday=1),l==="quarters"){let I=Math.ceil(this.month/3);n.month=(I-1)*3+1}return this.set(n)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,n={}){return this.isValid?Hh.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):uEe}toLocaleString(e=qle,n={}){return this.isValid?Hh.create(this.loc.clone(n),e).formatDateTime(this):uEe}toLocaleParts(e={}){return this.isValid?Hh.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:l=!1,includeOffset:I=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;let c=e==="extended",i=GEe(this,c);return i+="T",i+=tbt(this,c,n,l,I,a),i}toISODate({format:e="extended"}={}){return this.isValid?GEe(this,e==="extended"):null}toISOWeekDate(){return Dle(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:l=!0,includePrefix:I=!1,extendedZone:a=!1,format:c="extended"}={}){return this.isValid?(I?"T":"")+tbt(this,c==="extended",n,e,l,a):null}toRFC2822(){return Dle(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Dle(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?GEe(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:l=!0}={}){let I="HH:mm:ss.SSS";return(n||e)&&(l&&(I+=" "),n?I+="z":e&&(I+="ZZ")),Dle(this,I,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():uEe}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",l={}){if(!this.isValid||!e.isValid)return Nn.invalid("created by diffing an invalid DateTime");let I={locale:this.locale,numberingSystem:this.numberingSystem,...l},a=oMn(n).map(Nn.normalizeUnit),c=e.valueOf()>this.valueOf(),i=c?this:e,s=c?e:this,r=dTn(i,s,a,I);return c?r.negate():r}diffNow(e="milliseconds",n={}){return this.diff(t.now(),e,n)}until(e){return this.isValid?lx.fromDateTimes(this,e):this}hasSame(e,n){if(!this.isValid)return!1;let l=e.valueOf(),I=this.setZone(e.zone,{keepLocalTime:!0});return I.startOf(n)<=l&&l<=I.endOf(n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let n=e.base||t.fromObject({},{zone:this.zone}),l=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new cp("max requires all arguments be DateTimes");return UGt(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,l={}){let{locale:I=null,numberingSystem:a=null}=l,c=Ho.fromOpts({locale:I,numberingSystem:a,defaultToEN:!0});return Pbt(c,e,n)}static fromStringExplain(e,n,l={}){return t.fromFormatExplain(e,n,l)}static get DATE_SHORT(){return qle}static get DATE_MED(){return ubt}static get DATE_MED_WITH_WEEKDAY(){return SSn}static get DATE_FULL(){return dbt}static get DATE_HUGE(){return Gbt}static get TIME_SIMPLE(){return bbt}static get TIME_WITH_SECONDS(){return mbt}static get TIME_WITH_SHORT_OFFSET(){return pbt}static get TIME_WITH_LONG_OFFSET(){return hbt}static get TIME_24_SIMPLE(){return Zbt}static get TIME_24_WITH_SECONDS(){return Wbt}static get TIME_24_WITH_SHORT_OFFSET(){return Nbt}static get TIME_24_WITH_LONG_OFFSET(){return Vbt}static get DATETIME_SHORT(){return Ybt}static get DATETIME_SHORT_WITH_SECONDS(){return gbt}static get DATETIME_MED(){return Rbt}static get DATETIME_MED_WITH_SECONDS(){return ybt}static get DATETIME_MED_WITH_WEEKDAY(){return MSn}static get DATETIME_FULL(){return Abt}static get DATETIME_FULL_WITH_SECONDS(){return Fbt}static get DATETIME_HUGE(){return vbt}static get DATETIME_HUGE_WITH_SECONDS(){return fbt}};function tM(t){if($l.isDateTime(t))return t;if(t&&t.valueOf&&cE(t.valueOf()))return $l.fromJSDate(t);if(t&&typeof t=="object")return $l.fromObject(t);throw new cp(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var OEe={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},ETn={allowHtml:!0};({...OEe,...ETn});var vEe=class t{value;successful;constructor(e){this.value=e,this.successful=!0}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}mapErr(e){return this}bimap(e,n){return this.map(e)}orElse(e){return this.value}cast(){return this}orElseThrow(e){return this.value}},fEe=class t{error;successful;constructor(e){this.error=e,this.successful=!1}map(e){return this}flatMap(e){return this}mapErr(e){return new t(e(this.error))}bimap(e,n){return this.mapErr(n)}orElse(e){return e}cast(){return this}orElseThrow(e){throw e?new Error(e(this.error)):new Error(""+this.error)}},lIe;(function(t){function e(a){return new vEe(a)}t.success=e;function n(a){return new fEe(a)}t.failure=n;function l(a,c,i){return a.successful?c.successful?i(a.value,c.value):n(c.error):n(a.error)}t.flatMap2=l;function I(a,c,i){return l(a,c,(s,r)=>e(i(s,r)))}t.map2=I})(lIe||(lIe={}));var JTn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},IIe={exports:{}};IIe.exports;(function(t,e){(function(n,l){t.exports=l()})(typeof self<"u"?self:JTn,function(){return function(n){var l={};function I(a){if(l[a])return l[a].exports;var c=l[a]={i:a,l:!1,exports:{}};return n[a].call(c.exports,c,c.exports,I),c.l=!0,c.exports}return I.m=n,I.c=l,I.d=function(a,c,i){I.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:i})},I.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},I.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return I.d(c,"a",c),c},I.o=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)},I.p="",I(I.s=0)}([function(n,l,I){function a(re){if(!(this instanceof a))return new a(re);this._=re}var c=a.prototype;function i(re,pe){for(var ye=0;ye>7),buf:function(Le){var ge=s(function(tt,Hn,ql,Ra){return tt.concat(ql===Ra.length-1?Buffer.from([Hn,0]).readUInt16BE(0):Ra.readUInt16BE(ql))},[],Le);return Buffer.from(r(function(tt){return(tt<<1&65535)>>8},ge))}(ye.buf)}}),ye}function o(){return typeof Buffer<"u"}function d(){if(!o())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function b(re){d();var pe=s(function(ge,tt){return ge+tt},0,re);if(pe%8!=0)throw new Error("The bits ["+re.join(", ")+"] add up to "+pe+" which is not an even number of bytes; the total should be divisible by 8");var ye,Ce=pe/8,Le=(ye=function(ge){return ge>48},s(function(ge,tt){return ge||(ye(tt)?tt:ge)},null,re));if(Le)throw new Error(Le+" bit range requested exceeds 48 bit (6 byte) Number max.");return new a(function(ge,tt){var Hn=Ce+tt;return Hn>ge.length?J(tt,Ce.toString()+" bytes"):L(Hn,s(function(ql,Ra){var rn=u(Ra,ql.buf);return{coll:ql.coll.concat(rn.v),buf:rn.buf}},{coll:[],buf:ge.slice(tt,Hn)},re).coll)})}function h(re,pe){return new a(function(ye,Ce){return d(),Ce+pe>ye.length?J(Ce,pe+" bytes for "+re):L(Ce+pe,ye.slice(Ce,Ce+pe))})}function Z(re,pe){if(typeof(ye=pe)!="number"||Math.floor(ye)!==ye||pe<0||pe>6)throw new Error(re+" requires integer length in range [0, 6].");var ye}function N(re){return Z("uintBE",re),h("uintBE("+re+")",re).map(function(pe){return pe.readUIntBE(0,re)})}function g(re){return Z("uintLE",re),h("uintLE("+re+")",re).map(function(pe){return pe.readUIntLE(0,re)})}function y(re){return Z("intBE",re),h("intBE("+re+")",re).map(function(pe){return pe.readIntBE(0,re)})}function X(re){return Z("intLE",re),h("intLE("+re+")",re).map(function(pe){return pe.readIntLE(0,re)})}function v(re){return re instanceof a}function H(re){return{}.toString.call(re)==="[object Array]"}function Q(re){return o()&&Buffer.isBuffer(re)}function L(re,pe){return{status:!0,index:re,value:pe,furthest:-1,expected:[]}}function J(re,pe){return H(pe)||(pe=[pe]),{status:!1,index:-1,value:null,furthest:re,expected:pe}}function O(re,pe){if(!pe||re.furthest>pe.furthest)return re;var ye=re.furthest===pe.furthest?function(Ce,Le){if(function(){if(a._supportsSet!==void 0)return a._supportsSet;var nG=typeof Set<"u";return a._supportsSet=nG,nG}()&&Array.from){for(var ge=new Set(Ce),tt=0;tt=0;){if(tt in ye){Ce=ye[tt].line,ge===0&&(ge=ye[tt].lineStart);break}(re.charAt(tt)===` +`||re.charAt(tt)==="\r"&&re.charAt(tt+1)!==` +`)&&(Le++,ge===0&&(ge=tt+1)),tt--}var Hn=Ce+Le,ql=pe-ge;return ye[pe]={line:Hn,lineStart:ge},{offset:pe,line:Hn+1,column:ql+1}}function D(re){if(!v(re))throw new Error("not a parser: "+re)}function _(re,pe){return typeof re=="string"?re.charAt(pe):re[pe]}function P(re){if(typeof re!="number")throw new Error("not a number: "+re)}function le(re){if(typeof re!="function")throw new Error("not a function: "+re)}function q(re){if(typeof re!="string")throw new Error("not a string: "+re)}var ee=2,ne=3,ie=8,me=5*ie,Ze=4*ie,Fe=" ";function ce(re,pe){return new Array(pe+1).join(re)}function fe(re,pe,ye){var Ce=pe-re.length;return Ce<=0?re:ce(ye,Ce)+re}function ke(re,pe,ye,Ce){return{from:re-pe>0?re-pe:0,to:re+ye>Ce?Ce:re+ye}}function j(re,pe){var ye,Ce,Le,ge,tt,Hn=pe.index,ql=Hn.offset,Ra=1;if(ql===re.length)return"Got the end of the input";if(Q(re)){var rn=ql-ql%ie,tm=ql-rn,yl=ke(rn,me,Ze+ie,re.length),nG=r(function(Be){return r(function(it){return fe(it.toString(16),2,"0")},Be)},function(Be,it){var Ht=Be.length,Ct=[],hn=0;if(Ht<=it)return[Be.slice()];for(var Qa=0;Qa=4&&(ye+=1),Ra=2,Le=r(function(Be){return Be.length<=4?Be.join(" "):Be.slice(0,4).join(" ")+" "+Be.slice(4).join(" ")},nG),(tt=(8*(ge.to>0?ge.to-1:ge.to)).toString(16).length)<2&&(tt=2)}else{var he=re.split(/\r\n|[\n\r\u2028\u2029]/);ye=Hn.column-1,Ce=Hn.line-1,ge=ke(Ce,ee,ne,he.length),Le=he.slice(ge.from,ge.to),tt=ge.to.toString().length}var Qe=Ce-ge.from;return Q(re)&&(tt=(8*(ge.to>0?ge.to-1:ge.to)).toString(16).length)<2&&(tt=2),s(function(Be,it,Ht){var Ct,hn=Ht===Qe,Qa=hn?"> ":Fe;return Ct=Q(re)?fe((8*(ge.from+Ht)).toString(16),tt,"0"):fe((ge.from+Ht+1).toString(),tt," "),[].concat(Be,[Qa+Ct+" | "+it],hn?[Fe+ce(" ",tt)+" | "+fe("",ye," ")+ce("^",Ra)]:[])},[],Le).join(` +`)}function E(re,pe){return[` +`,"-- PARSING FAILED "+ce("-",50),` + +`,j(re,pe),` + +`,(ye=pe.expected,ye.length===1?`Expected: + +`+ye[0]:`Expected one of the following: + +`+ye.join(", ")),` +`].join("");var ye}function S(re){return re.flags!==void 0?re.flags:[re.global?"g":"",re.ignoreCase?"i":"",re.multiline?"m":"",re.unicode?"u":"",re.sticky?"y":""].join("")}function m(){for(var re=[].slice.call(arguments),pe=re.length,ye=0;ye=2?P(pe):pe=0;var ye=function(Le){return RegExp("^(?:"+Le.source+")",S(Le))}(re),Ce=""+re;return a(function(Le,ge){var tt=ye.exec(Le.slice(ge));if(tt){if(0<=pe&&pe<=tt.length){var Hn=tt[0],ql=tt[pe];return L(ge+Hn.length,ql)}return J(ge,"valid match group (0 to "+tt.length+") in "+Ce)}return J(ge,Ce)})}function p(re){return a(function(pe,ye){return L(ye,re)})}function V(re){return a(function(pe,ye){return J(ye,re)})}function F(re){if(v(re))return a(function(pe,ye){var Ce=re._(pe,ye);return Ce.index=ye,Ce.value="",Ce});if(typeof re=="string")return F(te(re));if(re instanceof RegExp)return F(ae(re));throw new Error("not a string, regexp, or parser: "+re)}function G(re){return D(re),a(function(pe,ye){var Ce=re._(pe,ye),Le=pe.slice(ye,Ce.index);return Ce.status?J(ye,'not "'+Le+'"'):L(ye,null)})}function W(re){return le(re),a(function(pe,ye){var Ce=_(pe,ye);return ye=re.length?J(pe,"any character/byte"):L(pe+1,_(re,pe))}),He=a(function(re,pe){return L(re.length,re.slice(pe))}),Re=a(function(re,pe){return pe=0}).desc(pe)},a.optWhitespace=no,a.Parser=a,a.range=function(re,pe){return W(function(ye){return re<=ye&&ye<=pe}).desc(re+"-"+pe)},a.regex=ae,a.regexp=ae,a.sepBy=C,a.sepBy1=M,a.seq=m,a.seqMap=Y,a.seqObj=function(){for(var re,pe={},ye=0,Ce=(re=arguments,Array.prototype.slice.call(re)),Le=Ce.length,ge=0;ge255)throw new Error("Value specified to byte constructor ("+re+"=0x"+re.toString(16)+") is larger in value than a single byte.");var pe=(re>15?"0x":"0x0")+re.toString(16);return a(function(ye,Ce){var Le=_(ye,Ce);return Le===re?L(Ce+1,Le):J(Ce,pe)})},buffer:function(re){return h("buffer",re).map(function(pe){return Buffer.from(pe)})},encodedString:function(re,pe){return h("string",pe).map(function(ye){return ye.toString(re)})},uintBE:N,uint8BE:N(1),uint16BE:N(2),uint32BE:N(4),uintLE:g,uint8LE:g(1),uint16LE:g(2),uint32LE:g(4),intBE:y,int8BE:y(1),int16BE:y(2),int32BE:y(4),intLE:X,int8LE:X(1),int16LE:X(2),int32LE:X(4),floatBE:h("floatBE",4).map(function(re){return re.readFloatBE(0)}),floatLE:h("floatLE",4).map(function(re){return re.readFloatLE(0)}),doubleBE:h("doubleBE",8).map(function(re){return re.readDoubleBE(0)}),doubleLE:h("doubleLE",8).map(function(re){return re.readDoubleLE(0)})},n.exports=a}])})})(IIe,IIe.exports);var de=IIe.exports,UEe=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function imt(t){return t==null?t:t.shiftToAll().normalize()}function rbt(t){return t.includes("/")&&(t=t.substring(t.lastIndexOf("/")+1)),t.endsWith(".md")&&(t=t.substring(0,t.length-3)),t}de.alt(de.regex(new RegExp(UEe(),"")),de.regex(/[0-9\p{Letter}_-]+/u).map(t=>t.toLocaleLowerCase()),de.whitespace.map(t=>"-"),de.any.map(t=>"")).many().map(t=>t.join(""));var CTn=de.alt(de.regex(new RegExp(UEe(),"")),de.regex(/[0-9\p{Letter}_-]+/u),de.whitespace.map(t=>" "),de.any.map(t=>" ")).many().map(t=>t.join("").split(/\s+/).join(" ").trim());function LTn(t){return CTn.tryParse(t)}function kTn(t){return t=imt(t),t=Nn.fromObject(Object.fromEntries(Object.entries(t.toObject()).filter(([,e])=>e!=0))),t.toHuman()}var rM;(function(t){function e(v,H=OEe,Q=!1){let L=n(v);if(!L)return H.renderNullAs;switch(L.type){case"null":return H.renderNullAs;case"string":return L.value;case"number":case"boolean":return""+L.value;case"html":return L.value.outerHTML;case"widget":return L.value.markdown();case"link":return L.value.markdown();case"function":return"";case"array":let J="";return Q&&(J+="["),J+=L.value.map(O=>e(O,H,!0)).join(", "),Q&&(J+="]"),J;case"object":return"{ "+Object.entries(L.value).map(O=>O[0]+": "+e(O[1],H,!0)).join(", ")+" }";case"date":return L.value.second==0&&L.value.hour==0&&L.value.minute==0?L.value.toFormat(H.defaultDateFormat):L.value.toFormat(H.defaultDateTimeFormat);case"duration":return kTn(L.value)}}t.toString=e;function n(v){return d(v)?{type:"null",value:v}:r(v)?{type:"number",value:v}:s(v)?{type:"string",value:v}:h(v)?{type:"boolean",value:v}:o(v)?{type:"duration",value:v}:u(v)?{type:"date",value:v}:N(v)?{type:"widget",value:v}:b(v)?{type:"array",value:v}:Z(v)?{type:"link",value:v}:X(v)?{type:"function",value:v}:g(v)?{type:"html",value:v}:y(v)?{type:"object",value:v}:void 0}t.wrapValue=n;function l(v,H){if(y(v)){let Q={};for(let[L,J]of Object.entries(v))Q[L]=l(J,H);return Q}else if(b(v)){let Q=[];for(let L of v)Q.push(l(L,H));return Q}else return H(v)}t.mapLeaves=l;function I(v,H,Q){if(v===void 0&&(v=null),H===void 0&&(H=null),v===null&&H===null)return 0;if(v===null)return-1;if(H===null)return 1;let L=n(v),J=n(H);if(L===void 0&&J===void 0)return 0;if(L===void 0)return-1;if(J===void 0)return 1;if(L.type!=J.type)return L.type.localeCompare(J.type);if(L.value===J.value)return 0;switch(L.type){case"string":return L.value.localeCompare(J.value);case"number":return L.valueZe),D=K(O.path).localeCompare(K(U.path));if(D!=0)return D;let _=O.type.localeCompare(U.type);return _!=0?_:O.subpath&&!U.subpath?1:!O.subpath&&U.subpath?-1:!O.subpath&&!U.subpath?0:(O.subpath??"").localeCompare(U.subpath??"");case"date":return L.value0;case"boolean":return H.value;case"link":return!!H.value.path;case"date":return H.value.toMillis()!=0;case"duration":return H.value.as("seconds")!=0;case"object":return Object.keys(H.value).length>0;case"array":return H.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}t.isTruthy=c;function i(v){if(v==null)return v;if(t.isArray(v))return[].concat(v.map(H=>i(H)));if(t.isObject(v)){let H={};for(let[Q,L]of Object.entries(v))H[Q]=i(L);return H}else return v}t.deepCopy=i;function s(v){return typeof v=="string"}t.isString=s;function r(v){return typeof v=="number"}t.isNumber=r;function u(v){return v instanceof $l}t.isDate=u;function o(v){return v instanceof Nn}t.isDuration=o;function d(v){return v==null}t.isNull=d;function b(v){return Array.isArray(v)}t.isArray=b;function h(v){return typeof v=="boolean"}t.isBoolean=h;function Z(v){return v instanceof aIe}t.isLink=Z;function N(v){return v instanceof cM}t.isWidget=N;function g(v){return typeof HTMLElement<"u"?v instanceof HTMLElement:!1}t.isHtml=g;function y(v){return typeof v=="object"&&!g(v)&&!N(v)&&!b(v)&&!o(v)&&!u(v)&&!Z(v)&&v!==void 0&&!d(v)}t.isObject=y;function X(v){return typeof v=="function"}t.isFunction=X})(rM||(rM={}));var cbt;(function(t){function e(I){return rM.isObject(I)&&Object.keys(I).length==2&&"key"in I&&"rows"in I}t.isElementGroup=e;function n(I){for(let a of I)if(!e(a))return!1;return!0}t.isGrouping=n;function l(I){if(n(I)){let a=0;for(let c of I)a+=l(c.rows);return a}else return I.length}t.count=l})(cbt||(cbt={}));var aIe=class t{path;display;subpath;embed;type;static file(e,n=!1,l){return new t({path:e,embed:n,display:l,subpath:void 0,type:"file"})}static infer(e,n=!1,l){if(e.includes("#^")){let I=e.split("#^");return t.block(I[0],I[1],n,l)}else if(e.includes("#")){let I=e.split("#");return t.header(I[0],I[1],n,l)}else return t.file(e,n,l)}static header(e,n,l,I){return new t({path:e,embed:l,display:I,subpath:LTn(n),type:"header"})}static block(e,n,l,I){return new t({path:e,embed:l,display:I,subpath:n,type:"block"})}static fromObject(e){return new t(e)}constructor(e){Object.assign(this,e)}equals(e){return e==null||e==null?!1:this.path==e.path&&this.type==e.type&&this.subpath==e.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(e){return new t(Object.assign({},this,{path:e}))}withDisplay(e){return new t(Object.assign({},this,{display:e}))}withHeader(e){return t.header(this.path,e,this.embed,this.display)}toFile(){return t.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let e=new t(this);return e.embed=!0,e}}fromEmbed(){if(this.embed){let e=new t(this);return e.embed=!1,e}else return this}markdown(){let e=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?e+="|"+this.display:(e+="|"+rbt(this.path),(this.type=="header"||this.type=="block")&&(e+=" > "+this.subpath)),e+="]]",e}obsidianLink(){let e=this.path.replaceAll("|","\\|");return this.type=="header"?e+"#"+this.subpath?.replaceAll("|","\\|"):this.type=="block"?e+"#^"+this.subpath?.replaceAll("|","\\|"):e}fileName(){return rbt(this.path).replace(".md","")}},cM=class{$widget;constructor(e){this.$widget=e}},XEe=class extends cM{key;value;constructor(e,n){super("dataview:list-pair"),this.key=e,this.value=n}markdown(){return`${rM.toString(this.key)}: ${rM.toString(this.value)}`}},wEe=class extends cM{url;display;constructor(e,n){super("dataview:external-link"),this.url=e,this.display=n}markdown(){return`[${this.display??this.url}](${this.url})`}},obt;(function(t){function e(c,i){return new XEe(c,i)}t.listPair=e;function n(c,i){return new wEe(c,i)}t.externalLink=n;function l(c){return c.$widget==="dataview:list-pair"}t.isListPair=l;function I(c){return c.$widget==="dataview:external-link"}t.isExternalLink=I;function a(c){return l(c)||I(c)}t.isBuiltin=a})(obt||(obt={}));var Xo;(function(t){function e(d){return{type:"variable",name:d}}t.variable=e;function n(d){return{type:"literal",value:d}}t.literal=n;function l(d,b,h){return{type:"binaryop",left:d,op:b,right:h}}t.binaryOp=l;function I(d,b){return{type:"index",object:d,index:b}}t.index=I;function a(d){let b=d.split("."),h=t.variable(b[0]);for(let Z=1;Z"||d==">="||d=="!="||d=="="}t.isCompareOp=o,t.NULL=t.literal(null)})(Xo||(Xo={}));var Ng;(function(t){function e(u){return{type:"tag",tag:u}}t.tag=e;function n(u){return{type:"csv",path:u}}t.csv=n;function l(u){return{type:"folder",folder:u}}t.folder=l;function I(u,o){return{type:"link",file:u,direction:o?"incoming":"outgoing"}}t.link=I;function a(u,o,d){return{type:"binaryop",left:u,op:o,right:d}}t.binaryOp=a;function c(u,o){return{type:"binaryop",left:u,op:"&",right:o}}t.and=c;function i(u,o){return{type:"binaryop",left:u,op:"|",right:o}}t.or=i;function s(u){return{type:"negate",child:u}}t.negate=s;function r(){return{type:"empty"}}t.empty=r})(Ng||(Ng={}));var ibt=new RegExp(UEe(),""),HEe={year:Nn.fromObject({years:1}),years:Nn.fromObject({years:1}),yr:Nn.fromObject({years:1}),yrs:Nn.fromObject({years:1}),month:Nn.fromObject({months:1}),months:Nn.fromObject({months:1}),mo:Nn.fromObject({months:1}),mos:Nn.fromObject({months:1}),week:Nn.fromObject({weeks:1}),weeks:Nn.fromObject({weeks:1}),wk:Nn.fromObject({weeks:1}),wks:Nn.fromObject({weeks:1}),w:Nn.fromObject({weeks:1}),day:Nn.fromObject({days:1}),days:Nn.fromObject({days:1}),d:Nn.fromObject({days:1}),hour:Nn.fromObject({hours:1}),hours:Nn.fromObject({hours:1}),hr:Nn.fromObject({hours:1}),hrs:Nn.fromObject({hours:1}),h:Nn.fromObject({hours:1}),minute:Nn.fromObject({minutes:1}),minutes:Nn.fromObject({minutes:1}),min:Nn.fromObject({minutes:1}),mins:Nn.fromObject({minutes:1}),m:Nn.fromObject({minutes:1}),second:Nn.fromObject({seconds:1}),seconds:Nn.fromObject({seconds:1}),sec:Nn.fromObject({seconds:1}),secs:Nn.fromObject({seconds:1}),s:Nn.fromObject({seconds:1})},QEe={now:()=>$l.local(),today:()=>$l.local().startOf("day"),yesterday:()=>$l.local().startOf("day").minus(Nn.fromObject({days:1})),tomorrow:()=>$l.local().startOf("day").plus(Nn.fromObject({days:1})),sow:()=>$l.local().startOf("week"),"start-of-week":()=>$l.local().startOf("week"),eow:()=>$l.local().endOf("week"),"end-of-week":()=>$l.local().endOf("week"),soy:()=>$l.local().startOf("year"),"start-of-year":()=>$l.local().startOf("year"),eoy:()=>$l.local().endOf("year"),"end-of-year":()=>$l.local().endOf("year"),som:()=>$l.local().startOf("month"),"start-of-month":()=>$l.local().startOf("month"),eom:()=>$l.local().endOf("month"),"end-of-month":()=>$l.local().endOf("month")},EEe=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function xTn(t){let e=-1;for(;(e=t.indexOf("|",e+1))>=0;)if(!(e>0&&t[e-1]=="\\"))return[t.substring(0,e).replace(/\\\|/g,"|"),t.substring(e+1)];return[t.replace(/\\\|/g,"|"),void 0]}function jTn(t){let[e,n]=xTn(t);return aIe.infer(e,!1,n)}function nM(t,e,n){return de.seqMap(t,de.seq(de.optWhitespace,e,de.optWhitespace,t).many(),(l,I)=>{if(I.length==0)return l;let a=n(l,I[0][1],I[0][3]);for(let c=1;c(I,a)=>{let c=t._(I,a);if(!c.status)return c;for(let i of e){let s=i(c.value)._(I,c.index);if(!s.status)return c;c=s}return c})}var oV=de.createLanguage({number:t=>de.regexp(/-?[0-9]+(\.[0-9]+)?/).map(e=>Number.parseFloat(e)).desc("number"),string:t=>de.string('"').then(de.alt(t.escapeCharacter,de.noneOf('"\\')).atLeast(0).map(e=>e.join(""))).skip(de.string('"')).desc("string"),escapeCharacter:t=>de.string("\\").then(de.any).map(e=>e==='"'?'"':e==="\\"?"\\":"\\"+e),bool:t=>de.regexp(/true|false|True|False/).map(e=>e.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:t=>de.seqMap(de.string("#"),de.alt(de.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(e,n)=>e+n.join("")).desc("tag ('#hello/stuff')"),identifier:t=>de.seqMap(de.alt(de.regexp(/\p{Letter}/u),de.regexp(ibt).desc("text")),de.alt(de.regexp(/[0-9\p{Letter}_-]/u),de.regexp(ibt).desc("text")).many(),(e,n)=>e+n.join("")).desc("variable identifier"),link:t=>de.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(e=>jTn(e)).desc("file link"),embedLink:t=>de.seqMap(de.string("!").atMost(1),t.link,(e,n)=>(e.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:t=>de.regexp(/\+|-/).map(e=>e).desc("'+' or '-'"),binaryMulDiv:t=>de.regexp(/\*|\/|%/).map(e=>e).desc("'*' or '/' or '%'"),binaryCompareOp:t=>de.regexp(/>=|<=|!=|>|<|=/).map(e=>e).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:t=>de.regexp(/and|or|&|\|/i).map(e=>e.toLowerCase()=="and"?"&":e.toLowerCase()=="or"?"|":e).desc("'and' or 'or'"),rootDate:t=>de.seqMap(de.regexp(/\d{4}/),de.string("-"),de.regexp(/\d{2}/),(e,n,l)=>$l.fromObject({year:Number.parseInt(e),month:Number.parseInt(l)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:t=>de.alt(...Object.keys(QEe).sort((e,n)=>n.length-e.length).map(de.string)),date:t=>OTn(t.rootDate,e=>de.seqMap(de.string("-"),de.regexp(/\d{2}/),(n,l)=>e.set({day:Number.parseInt(l)})),e=>de.seqMap(de.string("T"),de.regexp(/\d{2}/),(n,l)=>e.set({hour:Number.parseInt(l)})),e=>de.seqMap(de.string(":"),de.regexp(/\d{2}/),(n,l)=>e.set({minute:Number.parseInt(l)})),e=>de.seqMap(de.string(":"),de.regexp(/\d{2}/),(n,l)=>e.set({second:Number.parseInt(l)})),e=>de.alt(de.seqMap(de.string("."),de.regexp(/\d{3}/),(n,l)=>e.set({millisecond:Number.parseInt(l)})),de.succeed(e)),e=>de.alt(de.seqMap(de.string("+").or(de.string("-")),de.regexp(/\d{1,2}(:\d{2})?/),(n,l)=>e.setZone("UTC"+n+l,{keepLocalTime:!0})),de.seqMap(de.string("Z"),()=>e.setZone("utc",{keepLocalTime:!0})),de.seqMap(de.string("["),de.regexp(/[0-9A-Za-z+-\/]+/u),de.string("]"),(n,l,I)=>e.setZone(l,{keepLocalTime:!0})))).assert(e=>e.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:t=>de.alt(t.dateShorthand.map(e=>QEe[e]()),t.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:t=>de.alt(...Object.keys(HEe).sort((e,n)=>n.length-e.length).map(de.string)),duration:t=>de.seqMap(t.number,de.optWhitespace,t.durationType,(e,n,l)=>HEe[l].mapUnits(I=>I*e)).sepBy1(de.string(",").trim(de.optWhitespace).or(de.optWhitespace)).map(e=>e.reduce((n,l)=>n.plus(l))).desc("duration like 4hr2min"),rawNull:t=>de.string("null"),tagSource:t=>t.tag.map(e=>Ng.tag(e)),csvSource:t=>de.seqMap(de.string("csv(").skip(de.optWhitespace),t.string,de.string(")"),(e,n,l)=>Ng.csv(n)),linkIncomingSource:t=>t.link.map(e=>Ng.link(e.path,!0)),linkOutgoingSource:t=>de.seqMap(de.string("outgoing(").skip(de.optWhitespace),t.link,de.string(")"),(e,n,l)=>Ng.link(n.path,!1)),folderSource:t=>t.string.map(e=>Ng.folder(e)),parensSource:t=>de.seqMap(de.string("("),de.optWhitespace,t.source,de.optWhitespace,de.string(")"),(e,n,l,I,a)=>l),negateSource:t=>de.seqMap(de.alt(de.string("-"),de.string("!")),t.atomSource,(e,n)=>Ng.negate(n)),atomSource:t=>de.alt(t.parensSource,t.negateSource,t.linkOutgoingSource,t.linkIncomingSource,t.folderSource,t.tagSource,t.csvSource),binaryOpSource:t=>nM(t.atomSource,t.binaryBooleanOp.map(e=>e),Ng.binaryOp),source:t=>t.binaryOpSource,variableField:t=>t.identifier.chain(e=>EEe.includes(e.toUpperCase())?de.fail("Variable fields cannot be a keyword ("+EEe.join(" or ")+")"):de.succeed(Xo.variable(e))).desc("variable"),numberField:t=>t.number.map(e=>Xo.literal(e)).desc("number"),stringField:t=>t.string.map(e=>Xo.literal(e)).desc("string"),boolField:t=>t.bool.map(e=>Xo.literal(e)).desc("boolean"),dateField:t=>de.seqMap(de.string("date("),de.optWhitespace,t.datePlus,de.optWhitespace,de.string(")"),(e,n,l,I,a)=>Xo.literal(l)).desc("date"),durationField:t=>de.seqMap(de.string("dur("),de.optWhitespace,t.duration,de.optWhitespace,de.string(")"),(e,n,l,I,a)=>Xo.literal(l)).desc("duration"),nullField:t=>t.rawNull.map(e=>Xo.NULL),linkField:t=>t.link.map(e=>Xo.literal(e)),listField:t=>t.field.sepBy(de.string(",").trim(de.optWhitespace)).wrap(de.string("[").skip(de.optWhitespace),de.optWhitespace.then(de.string("]"))).map(e=>Xo.list(e)).desc("list ('[1, 2, 3]')"),objectField:t=>de.seqMap(t.identifier.or(t.string),de.string(":").trim(de.optWhitespace),t.field,(e,n,l)=>({name:e,value:l})).sepBy(de.string(",").trim(de.optWhitespace)).wrap(de.string("{").skip(de.optWhitespace),de.optWhitespace.then(de.string("}"))).map(e=>{let n={};for(let l of e)n[l.name]=l.value;return Xo.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:t=>de.alt(t.date,t.duration.map(e=>imt(e)),t.string,t.tag,t.embedLink,t.bool,t.number,t.rawNull),inlineFieldList:t=>t.atomInlineField.sepBy(de.string(",").trim(de.optWhitespace).lookahead(t.atomInlineField)),inlineField:t=>de.alt(de.seqMap(t.atomInlineField,de.string(",").trim(de.optWhitespace),t.inlineFieldList,(e,n,l)=>[e].concat(l)),t.atomInlineField),atomField:t=>de.alt(t.embedLink.map(e=>Xo.literal(e)),t.negatedField,t.linkField,t.listField,t.objectField,t.lambdaField,t.parensField,t.boolField,t.numberField,t.stringField,t.dateField,t.durationField,t.nullField,t.variableField),indexField:t=>de.seqMap(t.atomField,de.alt(t.dotPostfix,t.indexPostfix,t.functionPostfix).many(),(e,n)=>{let l=e;for(let I of n)switch(I.type){case"dot":l=Xo.index(l,Xo.literal(I.field));break;case"index":l=Xo.index(l,I.field);break;case"function":l=Xo.func(l,I.fields);break}return l}),negatedField:t=>de.seqMap(de.string("!"),t.indexField,(e,n)=>Xo.negate(n)).desc("negated field"),parensField:t=>de.seqMap(de.string("("),de.optWhitespace,t.field,de.optWhitespace,de.string(")"),(e,n,l,I,a)=>l),lambdaField:t=>de.seqMap(t.identifier.sepBy(de.string(",").trim(de.optWhitespace)).wrap(de.string("(").trim(de.optWhitespace),de.string(")").trim(de.optWhitespace)),de.string("=>").trim(de.optWhitespace),t.field,(e,n,l)=>({type:"lambda",arguments:e,value:l})),dotPostfix:t=>de.seqMap(de.string("."),t.identifier,(e,n)=>({type:"dot",field:n})),indexPostfix:t=>de.seqMap(de.string("["),de.optWhitespace,t.field,de.optWhitespace,de.string("]"),(e,n,l,I,a)=>({type:"index",field:l})),functionPostfix:t=>de.seqMap(de.string("("),de.optWhitespace,t.field.sepBy(de.string(",").trim(de.optWhitespace)),de.optWhitespace,de.string(")"),(e,n,l,I,a)=>({type:"function",fields:l})),binaryMulDivField:t=>nM(t.indexField,t.binaryMulDiv,Xo.binaryOp),binaryPlusMinusField:t=>nM(t.binaryMulDivField,t.binaryPlusMinus,Xo.binaryOp),binaryCompareField:t=>nM(t.binaryPlusMinusField,t.binaryCompareOp,Xo.binaryOp),binaryBooleanField:t=>nM(t.binaryCompareField,t.binaryBooleanOp,Xo.binaryOp),binaryOpField:t=>t.binaryBooleanField,field:t=>t.binaryOpField});function UTn(t){try{return lIe.success(oV.field.tryParse(t))}catch(e){return lIe.failure(""+e)}}var rIe;(function(t){function e(l,I){return{name:l,field:I}}t.named=e;function n(l,I){return{field:l,direction:I}}t.sortBy=n})(rIe||(rIe={}));function zTn(t){return de.custom((e,n)=>(l,I)=>{let a=t._(l,I);return a.status?Object.assign({},a,{value:[a.value,l.substring(I,a.index)]}):a})}function BTn(t){return t.split(/[\r\n]+/).map(e=>e.trim()).join("")}function sbt(t,e){return de.eof.map(t).or(de.whitespace.then(e))}var smt=de.createLanguage({queryType:t=>de.alt(de.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(e=>e.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:t=>de.seqMap(oV.field.skip(de.whitespace),de.regexp(/AS/i).skip(de.whitespace),oV.identifier.or(oV.string),(e,n,l)=>rIe.named(l,e)),comment:()=>de.Parser((t,e)=>{let n=t.substring(e);if(!n.startsWith("//"))return de.makeFailure(e,"Not a comment");n=n.split(` +`)[0];let l=n.substring(2).trim();return de.makeSuccess(e+n.length,l)}),namedField:t=>de.alt(t.explicitNamedField,zTn(oV.field).map(([e,n])=>rIe.named(BTn(n),e))),sortField:t=>de.seqMap(oV.field.skip(de.optWhitespace),de.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(e,n)=>{let l=n.length==0?"ascending":n[0].toLowerCase();return l=="desc"&&(l="descending"),l=="asc"&&(l="ascending"),{field:e,direction:l}}),headerClause:t=>t.queryType.chain(e=>{switch(e){case"table":return sbt(()=>({type:e,fields:[],showId:!0}),de.seqMap(de.regexp(/WITHOUT\s+ID/i).skip(de.optWhitespace).atMost(1),de.sepBy(t.namedField,de.string(",").trim(de.optWhitespace)),(n,l)=>({type:e,fields:l,showId:n.length==0})));case"list":return sbt(()=>({type:e,format:void 0,showId:!0}),de.seqMap(de.regexp(/WITHOUT\s+ID/i).skip(de.optWhitespace).atMost(1),oV.field.atMost(1),(n,l)=>({type:e,format:l.length==1?l[0]:void 0,showId:n.length==0})));case"task":return de.succeed({type:e});case"calendar":return de.whitespace.then(de.seqMap(t.namedField,n=>({type:e,showId:!0,field:n})));default:return de.fail(`Unrecognized query type '${e}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:t=>de.seqMap(de.regexp(/FROM/i),de.whitespace,oV.source,(e,n,l)=>l),whereClause:t=>de.seqMap(de.regexp(/WHERE/i),de.whitespace,oV.field,(e,n,l)=>({type:"where",clause:l})).desc("WHERE "),sortByClause:t=>de.seqMap(de.regexp(/SORT/i),de.whitespace,t.sortField.sepBy1(de.string(",").trim(de.optWhitespace)),(e,n,l)=>({type:"sort",fields:l})).desc("SORT field [ASC/DESC]"),limitClause:t=>de.seqMap(de.regexp(/LIMIT/i),de.whitespace,oV.field,(e,n,l)=>({type:"limit",amount:l})).desc("LIMIT "),flattenClause:t=>de.seqMap(de.regexp(/FLATTEN/i).skip(de.whitespace),t.namedField,(e,n)=>({type:"flatten",field:n})).desc("FLATTEN [AS ]"),groupByClause:t=>de.seqMap(de.regexp(/GROUP BY/i).skip(de.whitespace),t.namedField,(e,n)=>({type:"group",field:n})).desc("GROUP BY [AS ]"),clause:t=>de.alt(t.fromClause,t.whereClause,t.sortByClause,t.limitClause,t.groupByClause,t.flattenClause),query:t=>de.seqMap(t.headerClause.trim(bEe),t.fromClause.trim(bEe).atMost(1),t.clause.trim(bEe).many(),(e,n,l)=>({header:e,source:n.length==0?Ng.folder(""):n[0],operations:l,settings:OEe}))}),bEe=de.alt(de.whitespace,smt.comment).many().map(t=>t.join("")),STn=t=>t?t.plugins.plugins.dataview?.api:window.DataviewAPI,MTn=t=>t.plugins.enabledPlugins.has("dataview");Vg.DATE_SHORTHANDS=QEe;Vg.DURATION_TYPES=HEe;Vg.EXPRESSION=oV;Vg.KEYWORDS=EEe;Vg.QUERY_LANGUAGE=smt;Vg.getAPI=STn;Vg.isPluginEnabled=MTn;Vg.parseField=UTn});var umt=f((BEe,ix)=>{(function(t,e){typeof BEe=="object"&&typeof ix<"u"?ix.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(BEe,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function n(w){t=w}function l(w){return w instanceof Array||Object.prototype.toString.call(w)==="[object Array]"}function I(w){return w!=null&&Object.prototype.toString.call(w)==="[object Object]"}function a(w,k){return Object.prototype.hasOwnProperty.call(w,k)}function c(w){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(w).length===0;var k;for(k in w)if(a(w,k))return!1;return!0}function i(w){return w===void 0}function s(w){return typeof w=="number"||Object.prototype.toString.call(w)==="[object Number]"}function r(w){return w instanceof Date||Object.prototype.toString.call(w)==="[object Date]"}function u(w,k){var z=[],T,Ie=w.length;for(T=0;T>>0,T;for(T=0;T0)for(z=0;z=0;return(Ge?z?"+":"":"-")+Math.pow(10,Math.max(0,Ie)).toString().substr(1)+T}var ie=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,me=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ze={},Fe={};function ce(w,k,z,T){var Ie=T;typeof T=="string"&&(Ie=function(){return this[T]()}),w&&(Fe[w]=Ie),k&&(Fe[k[0]]=function(){return ne(Ie.apply(this,arguments),k[1],k[2])}),z&&(Fe[z]=function(){return this.localeData().ordinal(Ie.apply(this,arguments),w)})}function fe(w){return w.match(/\[[\s\S]/)?w.replace(/^\[|\]$/g,""):w.replace(/\\/g,"")}function ke(w){var k=w.match(ie),z,T;for(z=0,T=k.length;z=0&&me.test(w);)w=w.replace(me,T),me.lastIndex=0,z-=1;return w}var S={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function m(w){var k=this._longDateFormat[w],z=this._longDateFormat[w.toUpperCase()];return k||!z?k:(this._longDateFormat[w]=z.match(ie).map(function(T){return T==="MMMM"||T==="MM"||T==="DD"||T==="dddd"?T.slice(1):T}).join(""),this._longDateFormat[w])}var Y="Invalid date";function R(){return this._invalidDate}var C="%d",M=/\d{1,2}/;function te(w){return this._ordinal.replace("%d",w)}var ae={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function p(w,k,z,T){var Ie=this._relativeTime[z];return K(Ie)?Ie(w,k,z,T):Ie.replace(/%d/i,w)}function V(w,k){var z=this._relativeTime[w>0?"future":"past"];return K(z)?z(k):z.replace(/%s/i,k)}var F={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function G(w){return typeof w=="string"?F[w]||F[w.toLowerCase()]:void 0}function W(w){var k={},z,T;for(T in w)a(w,T)&&(z=G(T),z&&(k[z]=w[T]));return k}var A={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function x(w){var k=[],z;for(z in w)a(w,z)&&k.push({unit:z,priority:A[z]});return k.sort(function(T,Ie){return T.priority-Ie.priority}),k}var ue=/\d/,Ue=/\d\d/,He=/\d{3}/,Re=/\d{4}/,et=/[+-]?\d{6}/,Oe=/\d\d?/,Mt=/\d\d\d\d?/,ch=/\d\d\d\d\d\d?/,no=/\d{1,3}/,Je=/\d{1,4}/,_G=/[+-]?\d{1,6}/,xn=/\d+/,br=/[+-]?\d+/,vr=/Z|[+-]\d\d:?\d\d/gi,N2=/Z|[+-]\d\d(?::?\d\d)?/gi,re=/[+-]?\d+(\.\d{1,3})?/,pe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ye=/^[1-9]\d?/,Ce=/^([1-9]\d|\d)/,Le;Le={};function ge(w,k,z){Le[w]=K(k)?k:function(T,Ie){return T&&z?z:k}}function tt(w,k){return a(Le,w)?Le[w](k._strict,k._locale):new RegExp(Hn(w))}function Hn(w){return ql(w.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(k,z,T,Ie,Ge){return z||T||Ie||Ge}))}function ql(w){return w.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ra(w){return w<0?Math.ceil(w)||0:Math.floor(w)}function rn(w){var k=+w,z=0;return k!==0&&isFinite(k)&&(z=Ra(k)),z}var tm={};function yl(w,k){var z,T=k,Ie;for(typeof w=="string"&&(w=[w]),s(k)&&(T=function(Ge,we){we[k]=rn(Ge)}),Ie=w.length,z=0;z68?1900:2e3)};var oh=ih("FullYear",!0);function IG(){return Qe(this.year())}function ih(w,k){return function(z){return z!=null?($7(this,w,z),e.updateOffset(this,k),this):JY(this,w)}}function JY(w,k){if(!w.isValid())return NaN;var z=w._d,T=w._isUTC;switch(k){case"Milliseconds":return T?z.getUTCMilliseconds():z.getMilliseconds();case"Seconds":return T?z.getUTCSeconds():z.getSeconds();case"Minutes":return T?z.getUTCMinutes():z.getMinutes();case"Hours":return T?z.getUTCHours():z.getHours();case"Date":return T?z.getUTCDate():z.getDate();case"Day":return T?z.getUTCDay():z.getDay();case"Month":return T?z.getUTCMonth():z.getMonth();case"FullYear":return T?z.getUTCFullYear():z.getFullYear();default:return NaN}}function $7(w,k,z){var T,Ie,Ge,we,vt;if(!(!w.isValid()||isNaN(z))){switch(T=w._d,Ie=w._isUTC,k){case"Milliseconds":return void(Ie?T.setUTCMilliseconds(z):T.setMilliseconds(z));case"Seconds":return void(Ie?T.setUTCSeconds(z):T.setSeconds(z));case"Minutes":return void(Ie?T.setUTCMinutes(z):T.setMinutes(z));case"Hours":return void(Ie?T.setUTCHours(z):T.setHours(z));case"Date":return void(Ie?T.setUTCDate(z):T.setDate(z));case"FullYear":break;default:return}Ge=z,we=w.month(),vt=w.date(),vt=vt===29&&we===1&&!Qe(Ge)?28:vt,Ie?T.setUTCFullYear(Ge,we,vt):T.setFullYear(Ge,we,vt)}}function cye(w){return w=G(w),K(this[w])?this[w]():this}function oye(w,k){if(typeof w=="object"){w=W(w);var z=x(w),T,Ie=z.length;for(T=0;T=0?(vt=new Date(w+400,k,z,T,Ie,Ge,we),isFinite(vt.getFullYear())&&vt.setFullYear(w)):vt=new Date(w,k,z,T,Ie,Ge,we),vt}function _9(w){var k,z;return w<100&&w>=0?(z=Array.prototype.slice.call(arguments),z[0]=w+400,k=new Date(Date.UTC.apply(null,z)),isFinite(k.getUTCFullYear())&&k.setUTCFullYear(w)):k=new Date(Date.UTC.apply(null,arguments)),k}function e8(w,k,z){var T=7+k-z,Ie=(7+_9(w,0,T).getUTCDay()-k)%7;return-Ie+T-1}function _8e(w,k,z,T,Ie){var Ge=(7+z-T)%7,we=e8(w,T,Ie),vt=1+7*(k-1)+Ge+we,qn,YI;return vt<=0?(qn=w-1,YI=lG(qn)+vt):vt>lG(w)?(qn=w+1,YI=vt-lG(w)):(qn=w,YI=vt),{year:qn,dayOfYear:YI}}function P9(w,k,z){var T=e8(w.year(),k,z),Ie=Math.floor((w.dayOfYear()-T-1)/7)+1,Ge,we;return Ie<1?(we=w.year()-1,Ge=Ie+hy(we,k,z)):Ie>hy(w.year(),k,z)?(Ge=Ie-hy(w.year(),k,z),we=w.year()+1):(we=w.year(),Ge=Ie),{week:Ge,year:we}}function hy(w,k,z){var T=e8(w,k,z),Ie=e8(w+1,k,z);return(lG(w)-T+Ie)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),ge("w",Oe,ye),ge("ww",Oe,Ue),ge("W",Oe,ye),ge("WW",Oe,Ue),nG(["w","ww","W","WW"],function(w,k,z,T){k[T.substr(0,1)]=rn(w)});function Hvn(w){return P9(w,this._week.dow,this._week.doy).week}var Qvn={dow:0,doy:6};function Evn(){return this._week.dow}function Jvn(){return this._week.doy}function Cvn(w){var k=this.localeData().week(this);return w==null?k:this.add((w-k)*7,"d")}function Lvn(w){var k=P9(this,1,4).week;return w==null?k:this.add((w-k)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(w){return this.localeData().weekdaysMin(this,w)}),ce("ddd",0,0,function(w){return this.localeData().weekdaysShort(this,w)}),ce("dddd",0,0,function(w){return this.localeData().weekdays(this,w)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),ge("d",Oe),ge("e",Oe),ge("E",Oe),ge("dd",function(w,k){return k.weekdaysMinRegex(w)}),ge("ddd",function(w,k){return k.weekdaysShortRegex(w)}),ge("dddd",function(w,k){return k.weekdaysRegex(w)}),nG(["dd","ddd","dddd"],function(w,k,z,T){var Ie=z._locale.weekdaysParse(w,T,z._strict);Ie!=null?k.d=Ie:h(z).invalidWeekday=w}),nG(["d","e","E"],function(w,k,z,T){k[T]=rn(w)});function kvn(w,k){return typeof w!="string"?w:isNaN(w)?(w=k.weekdaysParse(w),typeof w=="number"?w:null):parseInt(w,10)}function xvn(w,k){return typeof w=="string"?k.weekdaysParse(w)%7||7:isNaN(w)?null:w}function sye(w,k){return w.slice(k,7).concat(w.slice(0,k))}var jvn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),P8e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ovn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Uvn=pe,zvn=pe,Bvn=pe;function Svn(w,k){var z=l(this._weekdays)?this._weekdays:this._weekdays[w&&w!==!0&&this._weekdays.isFormat.test(k)?"format":"standalone"];return w===!0?sye(z,this._week.dow):w?z[w.day()]:z}function Mvn(w){return w===!0?sye(this._weekdaysShort,this._week.dow):w?this._weekdaysShort[w.day()]:this._weekdaysShort}function Tvn(w){return w===!0?sye(this._weekdaysMin,this._week.dow):w?this._weekdaysMin[w.day()]:this._weekdaysMin}function Dvn(w,k,z){var T,Ie,Ge,we=w.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],T=0;T<7;++T)Ge=d([2e3,1]).day(T),this._minWeekdaysParse[T]=this.weekdaysMin(Ge,"").toLocaleLowerCase(),this._shortWeekdaysParse[T]=this.weekdaysShort(Ge,"").toLocaleLowerCase(),this._weekdaysParse[T]=this.weekdays(Ge,"").toLocaleLowerCase();return z?k==="dddd"?(Ie=nI.call(this._weekdaysParse,we),Ie!==-1?Ie:null):k==="ddd"?(Ie=nI.call(this._shortWeekdaysParse,we),Ie!==-1?Ie:null):(Ie=nI.call(this._minWeekdaysParse,we),Ie!==-1?Ie:null):k==="dddd"?(Ie=nI.call(this._weekdaysParse,we),Ie!==-1||(Ie=nI.call(this._shortWeekdaysParse,we),Ie!==-1)?Ie:(Ie=nI.call(this._minWeekdaysParse,we),Ie!==-1?Ie:null)):k==="ddd"?(Ie=nI.call(this._shortWeekdaysParse,we),Ie!==-1||(Ie=nI.call(this._weekdaysParse,we),Ie!==-1)?Ie:(Ie=nI.call(this._minWeekdaysParse,we),Ie!==-1?Ie:null)):(Ie=nI.call(this._minWeekdaysParse,we),Ie!==-1||(Ie=nI.call(this._weekdaysParse,we),Ie!==-1)?Ie:(Ie=nI.call(this._shortWeekdaysParse,we),Ie!==-1?Ie:null))}function Kvn(w,k,z){var T,Ie,Ge;if(this._weekdaysParseExact)return Dvn.call(this,w,k,z);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),T=0;T<7;T++){if(Ie=d([2e3,1]).day(T),z&&!this._fullWeekdaysParse[T]&&(this._fullWeekdaysParse[T]=new RegExp("^"+this.weekdays(Ie,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[T]=new RegExp("^"+this.weekdaysShort(Ie,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[T]=new RegExp("^"+this.weekdaysMin(Ie,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[T]||(Ge="^"+this.weekdays(Ie,"")+"|^"+this.weekdaysShort(Ie,"")+"|^"+this.weekdaysMin(Ie,""),this._weekdaysParse[T]=new RegExp(Ge.replace(".",""),"i")),z&&k==="dddd"&&this._fullWeekdaysParse[T].test(w))return T;if(z&&k==="ddd"&&this._shortWeekdaysParse[T].test(w))return T;if(z&&k==="dd"&&this._minWeekdaysParse[T].test(w))return T;if(!z&&this._weekdaysParse[T].test(w))return T}}function _vn(w){if(!this.isValid())return w!=null?this:NaN;var k=JY(this,"Day");return w!=null?(w=kvn(w,this.localeData()),this.add(w-k,"d")):k}function Pvn(w){if(!this.isValid())return w!=null?this:NaN;var k=(this.day()+7-this.localeData()._week.dow)%7;return w==null?k:this.add(w-k,"d")}function qvn(w){if(!this.isValid())return w!=null?this:NaN;if(w!=null){var k=xvn(w,this.localeData());return this.day(this.day()%7?k:k-7)}else return this.day()||7}function $vn(w){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||uye.call(this),w?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Uvn),this._weekdaysStrictRegex&&w?this._weekdaysStrictRegex:this._weekdaysRegex)}function efn(w){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||uye.call(this),w?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=zvn),this._weekdaysShortStrictRegex&&w?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function tfn(w){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||uye.call(this),w?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Bvn),this._weekdaysMinStrictRegex&&w?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function uye(){function w(nm,Yy){return Yy.length-nm.length}var k=[],z=[],T=[],Ie=[],Ge,we,vt,qn,YI;for(Ge=0;Ge<7;Ge++)we=d([2e3,1]).day(Ge),vt=ql(this.weekdaysMin(we,"")),qn=ql(this.weekdaysShort(we,"")),YI=ql(this.weekdays(we,"")),k.push(vt),z.push(qn),T.push(YI),Ie.push(vt),Ie.push(qn),Ie.push(YI);k.sort(w),z.sort(w),T.sort(w),Ie.sort(w),this._weekdaysRegex=new RegExp("^("+Ie.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+T.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+k.join("|")+")","i")}function dye(){return this.hours()%12||12}function nfn(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,dye),ce("k",["kk",2],0,nfn),ce("hmm",0,0,function(){return""+dye.apply(this)+ne(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+dye.apply(this)+ne(this.minutes(),2)+ne(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+ne(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+ne(this.minutes(),2)+ne(this.seconds(),2)});function q8e(w,k){ce(w,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),k)})}q8e("a",!0),q8e("A",!1);function $8e(w,k){return k._meridiemParse}ge("a",$8e),ge("A",$8e),ge("H",Oe,Ce),ge("h",Oe,ye),ge("k",Oe,ye),ge("HH",Oe,Ue),ge("hh",Oe,Ue),ge("kk",Oe,Ue),ge("hmm",Mt),ge("hmmss",ch),ge("Hmm",Mt),ge("Hmmss",ch),yl(["H","HH"],Ct),yl(["k","kk"],function(w,k,z){var T=rn(w);k[Ct]=T===24?0:T}),yl(["a","A"],function(w,k,z){z._isPm=z._locale.isPM(w),z._meridiem=w}),yl(["h","hh"],function(w,k,z){k[Ct]=rn(w),h(z).bigHour=!0}),yl("hmm",function(w,k,z){var T=w.length-2;k[Ct]=rn(w.substr(0,T)),k[hn]=rn(w.substr(T)),h(z).bigHour=!0}),yl("hmmss",function(w,k,z){var T=w.length-4,Ie=w.length-2;k[Ct]=rn(w.substr(0,T)),k[hn]=rn(w.substr(T,2)),k[Qa]=rn(w.substr(Ie)),h(z).bigHour=!0}),yl("Hmm",function(w,k,z){var T=w.length-2;k[Ct]=rn(w.substr(0,T)),k[hn]=rn(w.substr(T))}),yl("Hmmss",function(w,k,z){var T=w.length-4,Ie=w.length-2;k[Ct]=rn(w.substr(0,T)),k[hn]=rn(w.substr(T,2)),k[Qa]=rn(w.substr(Ie))});function lfn(w){return(w+"").toLowerCase().charAt(0)==="p"}var Ifn=/[ap]\.?m?\.?/i,afn=ih("Hours",!0);function rfn(w,k,z){return w>11?z?"pm":"PM":z?"am":"AM"}var e$e={calendar:q,longDateFormat:S,invalidDate:Y,ordinal:C,dayOfMonthOrdinalParse:M,relativeTime:ae,months:Du,monthsShort:jm,week:Qvn,weekdays:jvn,weekdaysMin:Ovn,weekdaysShort:P8e,meridiemParse:Ifn},jc={},q9={},$9;function cfn(w,k){var z,T=Math.min(w.length,k.length);for(z=0;z0;){if(Ie=t8(Ge.slice(0,z).join("-")),Ie)return Ie;if(T&&T.length>=z&&cfn(Ge,T)>=z-1)break;z--}k++}return $9}function ifn(w){return!!(w&&w.match("^[^/\\\\]*$"))}function t8(w){var k=null,z;if(jc[w]===void 0&&typeof ix<"u"&&ix&&ix.exports&&ifn(w))try{k=$9._abbr,z=require,z("./locale/"+w),Y2(k)}catch{jc[w]=null}return jc[w]}function Y2(w,k){var z;return w&&(i(k)?z=Zy(w):z=Gye(w,k),z?$9=z:typeof console<"u"&&console.warn&&console.warn("Locale "+w+" not found. Did you forget to load it?")),$9._abbr}function Gye(w,k){if(k!==null){var z,T=e$e;if(k.abbr=w,jc[w]!=null)U("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),T=jc[w]._config;else if(k.parentLocale!=null)if(jc[k.parentLocale]!=null)T=jc[k.parentLocale]._config;else if(z=t8(k.parentLocale),z!=null)T=z._config;else return q9[k.parentLocale]||(q9[k.parentLocale]=[]),q9[k.parentLocale].push({name:w,config:k}),null;return jc[w]=new P(_(T,k)),q9[w]&&q9[w].forEach(function(Ie){Gye(Ie.name,Ie.config)}),Y2(w),jc[w]}else return delete jc[w],null}function sfn(w,k){if(k!=null){var z,T,Ie=e$e;jc[w]!=null&&jc[w].parentLocale!=null?jc[w].set(_(jc[w]._config,k)):(T=t8(w),T!=null&&(Ie=T._config),k=_(Ie,k),T==null&&(k.abbr=w),z=new P(k),z.parentLocale=jc[w],jc[w]=z),Y2(w)}else jc[w]!=null&&(jc[w].parentLocale!=null?(jc[w]=jc[w].parentLocale,w===Y2()&&Y2(w)):jc[w]!=null&&delete jc[w]);return jc[w]}function Zy(w){var k;if(w&&w._locale&&w._locale._abbr&&(w=w._locale._abbr),!w)return $9;if(!l(w)){if(k=t8(w),k)return k;w=[w]}return ofn(w)}function ufn(){return le(jc)}function bye(w){var k,z=w._a;return z&&h(w).overflow===-2&&(k=z[it]<0||z[it]>11?it:z[Ht]<1||z[Ht]>Pn(z[Be],z[it])?Ht:z[Ct]<0||z[Ct]>24||z[Ct]===24&&(z[hn]!==0||z[Qa]!==0||z[qr]!==0)?Ct:z[hn]<0||z[hn]>59?hn:z[Qa]<0||z[Qa]>59?Qa:z[qr]<0||z[qr]>999?qr:-1,h(w)._overflowDayOfYear&&(kHt)&&(k=Ht),h(w)._overflowWeeks&&k===-1&&(k=by),h(w)._overflowWeekday&&k===-1&&(k=V2),h(w).overflow=k),w}var dfn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Gfn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bfn=/Z|[+-]\d\d(?::?\d\d)?/,n8=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],mye=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mfn=/^\/?Date\((-?\d+)/i,pfn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,hfn={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function n$e(w){var k,z,T=w._i,Ie=dfn.exec(T)||Gfn.exec(T),Ge,we,vt,qn,YI=n8.length,nm=mye.length;if(Ie){for(h(w).iso=!0,k=0,z=YI;klG(we)||w._dayOfYear===0)&&(h(w)._overflowDayOfYear=!0),z=_9(we,0,w._dayOfYear),w._a[it]=z.getUTCMonth(),w._a[Ht]=z.getUTCDate()),k=0;k<3&&w._a[k]==null;++k)w._a[k]=T[k]=Ie[k];for(;k<7;k++)w._a[k]=T[k]=w._a[k]==null?k===2?1:0:w._a[k];w._a[Ct]===24&&w._a[hn]===0&&w._a[Qa]===0&&w._a[qr]===0&&(w._nextDay=!0,w._a[Ct]=0),w._d=(w._useUTC?_9:wvn).apply(null,T),Ge=w._useUTC?w._d.getUTCDay():w._d.getDay(),w._tzm!=null&&w._d.setUTCMinutes(w._d.getUTCMinutes()-w._tzm),w._nextDay&&(w._a[Ct]=24),w._w&&typeof w._w.d<"u"&&w._w.d!==Ge&&(h(w).weekdayMismatch=!0)}}function yfn(w){var k,z,T,Ie,Ge,we,vt,qn,YI;k=w._w,k.GG!=null||k.W!=null||k.E!=null?(Ge=1,we=4,z=e5(k.GG,w._a[Be],P9(Rc(),1,4).year),T=e5(k.W,1),Ie=e5(k.E,1),(Ie<1||Ie>7)&&(qn=!0)):(Ge=w._locale._week.dow,we=w._locale._week.doy,YI=P9(Rc(),Ge,we),z=e5(k.gg,w._a[Be],YI.year),T=e5(k.w,YI.week),k.d!=null?(Ie=k.d,(Ie<0||Ie>6)&&(qn=!0)):k.e!=null?(Ie=k.e+Ge,(k.e<0||k.e>6)&&(qn=!0)):Ie=Ge),T<1||T>hy(z,Ge,we)?h(w)._overflowWeeks=!0:qn!=null?h(w)._overflowWeekday=!0:(vt=_8e(z,T,Ie,Ge,we),w._a[Be]=vt.year,w._dayOfYear=vt.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function hye(w){if(w._f===e.ISO_8601){n$e(w);return}if(w._f===e.RFC_2822){l$e(w);return}w._a=[],h(w).empty=!0;var k=""+w._i,z,T,Ie,Ge,we,vt=k.length,qn=0,YI,nm;for(Ie=E(w._f,w._locale).match(ie)||[],nm=Ie.length,z=0;z0&&h(w).unusedInput.push(we),k=k.slice(k.indexOf(T)+T.length),qn+=T.length),Fe[Ge]?(T?h(w).empty=!1:h(w).unusedTokens.push(Ge),he(Ge,T,w)):w._strict&&!T&&h(w).unusedTokens.push(Ge);h(w).charsLeftOver=vt-qn,k.length>0&&h(w).unusedInput.push(k),w._a[Ct]<=12&&h(w).bigHour===!0&&w._a[Ct]>0&&(h(w).bigHour=void 0),h(w).parsedDateParts=w._a.slice(0),h(w).meridiem=w._meridiem,w._a[Ct]=Afn(w._locale,w._a[Ct],w._meridiem),YI=h(w).era,YI!==null&&(w._a[Be]=w._locale.erasConvertYear(YI,w._a[Be])),pye(w),bye(w)}function Afn(w,k,z){var T;return z==null?k:w.meridiemHour!=null?w.meridiemHour(k,z):(w.isPM!=null&&(T=w.isPM(z),T&&k<12&&(k+=12),!T&&k===12&&(k=0)),k)}function Ffn(w){var k,z,T,Ie,Ge,we,vt=!1,qn=w._f.length;if(qn===0){h(w).invalidFormat=!0,w._d=new Date(NaN);return}for(Ie=0;Iethis?this:w:g()});function r$e(w,k){var z,T;if(k.length===1&&l(k[0])&&(k=k[0]),!k.length)return Rc();for(z=k[0],T=1;Tthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Dfn(){if(!i(this._isDSTShifted))return this._isDSTShifted;var w={},k;return v(w,this),w=I$e(w),w._a?(k=w._isUTC?d(w._a):Rc(w._a),this._isDSTShifted=this.isValid()&&xfn(w._a,k.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Kfn(){return this.isValid()?!this._isUTC:!1}function _fn(){return this.isValid()?this._isUTC:!1}function o$e(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Pfn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,qfn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function fN(w,k){var z=w,T=null,Ie,Ge,we;return I8(w)?z={ms:w._milliseconds,d:w._days,M:w._months}:s(w)||!isNaN(+w)?(z={},k?z[k]=+w:z.milliseconds=+w):(T=Pfn.exec(w))?(Ie=T[1]==="-"?-1:1,z={y:0,d:rn(T[Ht])*Ie,h:rn(T[Ct])*Ie,m:rn(T[hn])*Ie,s:rn(T[Qa])*Ie,ms:rn(Zye(T[qr]*1e3))*Ie}):(T=qfn.exec(w))?(Ie=T[1]==="-"?-1:1,z={y:pH(T[2],Ie),M:pH(T[3],Ie),w:pH(T[4],Ie),d:pH(T[5],Ie),h:pH(T[6],Ie),m:pH(T[7],Ie),s:pH(T[8],Ie)}):z==null?z={}:typeof z=="object"&&("from"in z||"to"in z)&&(we=$fn(Rc(z.from),Rc(z.to)),z={},z.ms=we.milliseconds,z.M=we.months),Ge=new l8(z),I8(w)&&a(w,"_locale")&&(Ge._locale=w._locale),I8(w)&&a(w,"_isValid")&&(Ge._isValid=w._isValid),Ge}fN.fn=l8.prototype,fN.invalid=kfn;function pH(w,k){var z=w&&parseFloat(w.replace(",","."));return(isNaN(z)?0:z)*k}function i$e(w,k){var z={};return z.months=k.month()-w.month()+(k.year()-w.year())*12,w.clone().add(z.months,"M").isAfter(k)&&--z.months,z.milliseconds=+k-+w.clone().add(z.months,"M"),z}function $fn(w,k){var z;return w.isValid()&&k.isValid()?(k=Nye(k,w),w.isBefore(k)?z=i$e(w,k):(z=i$e(k,w),z.milliseconds=-z.milliseconds,z.months=-z.months),z):{milliseconds:0,months:0}}function s$e(w,k){return function(z,T){var Ie,Ge;return T!==null&&!isNaN(+T)&&(U(k,"moment()."+k+"(period, number) is deprecated. Please use moment()."+k+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),Ge=z,z=T,T=Ge),Ie=fN(z,T),u$e(this,Ie,w),this}}function u$e(w,k,z,T){var Ie=k._milliseconds,Ge=Zye(k._days),we=Zye(k._months);w.isValid()&&(T=T??!0,we&&T8e(w,JY(w,"Month")+we*z),Ge&&$7(w,"Date",JY(w,"Date")+Ge*z),Ie&&w._d.setTime(w._d.valueOf()+Ie*z),T&&e.updateOffset(w,Ge||we))}var eXn=s$e(1,"add"),tXn=s$e(-1,"subtract");function d$e(w){return typeof w=="string"||w instanceof String}function nXn(w){return Q(w)||r(w)||d$e(w)||s(w)||IXn(w)||lXn(w)||w===null||w===void 0}function lXn(w){var k=I(w)&&!c(w),z=!1,T=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],Ie,Ge,we=T.length;for(Ie=0;Iez.valueOf():z.valueOf()9999?j(z,k?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):K(Date.prototype.toISOString)?k?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",j(z,"Z")):j(z,k?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ZXn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var w="moment",k="",z,T,Ie,Ge;return this.isLocal()||(w=this.utcOffset()===0?"moment.utc":"moment.parseZone",k="Z"),z="["+w+'("]',T=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",Ie="-MM-DD[T]HH:mm:ss.SSS",Ge=k+'[")]',this.format(z+T+Ie+Ge)}function WXn(w){w||(w=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var k=j(this,w);return this.localeData().postformat(k)}function NXn(w,k){return this.isValid()&&(Q(w)&&w.isValid()||Rc(w).isValid())?fN({to:this,from:w}).locale(this.locale()).humanize(!k):this.localeData().invalidDate()}function VXn(w){return this.from(Rc(),w)}function YXn(w,k){return this.isValid()&&(Q(w)&&w.isValid()||Rc(w).isValid())?fN({from:this,to:w}).locale(this.locale()).humanize(!k):this.localeData().invalidDate()}function gXn(w){return this.to(Rc(),w)}function G$e(w){var k;return w===void 0?this._locale._abbr:(k=Zy(w),k!=null&&(this._locale=k),this)}var b$e=J("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(w){return w===void 0?this.localeData():this.locale(w)});function m$e(){return this._locale}var r8=1e3,t5=60*r8,c8=60*t5,p$e=(365*400+97)*24*c8;function n5(w,k){return(w%k+k)%k}function h$e(w,k,z){return w<100&&w>=0?new Date(w+400,k,z)-p$e:new Date(w,k,z).valueOf()}function Z$e(w,k,z){return w<100&&w>=0?Date.UTC(w+400,k,z)-p$e:Date.UTC(w,k,z)}function RXn(w){var k,z;if(w=G(w),w===void 0||w==="millisecond"||!this.isValid())return this;switch(z=this._isUTC?Z$e:h$e,w){case"year":k=z(this.year(),0,1);break;case"quarter":k=z(this.year(),this.month()-this.month()%3,1);break;case"month":k=z(this.year(),this.month(),1);break;case"week":k=z(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":k=z(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":k=z(this.year(),this.month(),this.date());break;case"hour":k=this._d.valueOf(),k-=n5(k+(this._isUTC?0:this.utcOffset()*t5),c8);break;case"minute":k=this._d.valueOf(),k-=n5(k,t5);break;case"second":k=this._d.valueOf(),k-=n5(k,r8);break}return this._d.setTime(k),e.updateOffset(this,!0),this}function yXn(w){var k,z;if(w=G(w),w===void 0||w==="millisecond"||!this.isValid())return this;switch(z=this._isUTC?Z$e:h$e,w){case"year":k=z(this.year()+1,0,1)-1;break;case"quarter":k=z(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":k=z(this.year(),this.month()+1,1)-1;break;case"week":k=z(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":k=z(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":k=z(this.year(),this.month(),this.date()+1)-1;break;case"hour":k=this._d.valueOf(),k+=c8-n5(k+(this._isUTC?0:this.utcOffset()*t5),c8)-1;break;case"minute":k=this._d.valueOf(),k+=t5-n5(k,t5)-1;break;case"second":k=this._d.valueOf(),k+=r8-n5(k,r8)-1;break}return this._d.setTime(k),e.updateOffset(this,!0),this}function AXn(){return this._d.valueOf()-(this._offset||0)*6e4}function FXn(){return Math.floor(this.valueOf()/1e3)}function vXn(){return new Date(this.valueOf())}function fXn(){var w=this;return[w.year(),w.month(),w.date(),w.hour(),w.minute(),w.second(),w.millisecond()]}function XXn(){var w=this;return{years:w.year(),months:w.month(),date:w.date(),hours:w.hours(),minutes:w.minutes(),seconds:w.seconds(),milliseconds:w.milliseconds()}}function wXn(){return this.isValid()?this.toISOString():null}function HXn(){return N(this)}function QXn(){return o({},h(this))}function EXn(){return h(this).overflow}function JXn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ce("N",0,0,"eraAbbr"),ce("NN",0,0,"eraAbbr"),ce("NNN",0,0,"eraAbbr"),ce("NNNN",0,0,"eraName"),ce("NNNNN",0,0,"eraNarrow"),ce("y",["y",1],"yo","eraYear"),ce("y",["yy",2],0,"eraYear"),ce("y",["yyy",3],0,"eraYear"),ce("y",["yyyy",4],0,"eraYear"),ge("N",Yye),ge("NN",Yye),ge("NNN",Yye),ge("NNNN",MXn),ge("NNNNN",TXn),yl(["N","NN","NNN","NNNN","NNNNN"],function(w,k,z,T){var Ie=z._locale.erasParse(w,T,z._strict);Ie?h(z).era=Ie:h(z).invalidEra=w}),ge("y",xn),ge("yy",xn),ge("yyy",xn),ge("yyyy",xn),ge("yo",DXn),yl(["y","yy","yyy","yyyy"],Be),yl(["yo"],function(w,k,z,T){var Ie;z._locale._eraYearOrdinalRegex&&(Ie=w.match(z._locale._eraYearOrdinalRegex)),z._locale.eraYearOrdinalParse?k[Be]=z._locale.eraYearOrdinalParse(w,Ie):k[Be]=parseInt(w,10)});function CXn(w,k){var z,T,Ie,Ge=this._eras||Zy("en")._eras;for(z=0,T=Ge.length;z=0)return Ge[T]}function kXn(w,k){var z=w.since<=w.until?1:-1;return k===void 0?e(w.since).year():e(w.since).year()+(k-w.offset)*z}function xXn(){var w,k,z,T=this.localeData().eras();for(w=0,k=T.length;wGe&&(k=Ge),twn.call(this,w,k,z,T,Ie))}function twn(w,k,z,T,Ie){var Ge=_8e(w,k,z,T,Ie),we=_9(Ge.year,0,Ge.dayOfYear);return this.year(we.getUTCFullYear()),this.month(we.getUTCMonth()),this.date(we.getUTCDate()),this}ce("Q",0,"Qo","quarter"),ge("Q",ue),yl("Q",function(w,k){k[it]=(rn(w)-1)*3});function nwn(w){return w==null?Math.ceil((this.month()+1)/3):this.month((w-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),ge("D",Oe,ye),ge("DD",Oe,Ue),ge("Do",function(w,k){return w?k._dayOfMonthOrdinalParse||k._ordinalParse:k._dayOfMonthOrdinalParseLenient}),yl(["D","DD"],Ht),yl("Do",function(w,k){k[Ht]=rn(w.match(Oe)[0])});var N$e=ih("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),ge("DDD",no),ge("DDDD",He),yl(["DDD","DDDD"],function(w,k,z){z._dayOfYear=rn(w)});function lwn(w){var k=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return w==null?k:this.add(w-k,"d")}ce("m",["mm",2],0,"minute"),ge("m",Oe,Ce),ge("mm",Oe,Ue),yl(["m","mm"],hn);var Iwn=ih("Minutes",!1);ce("s",["ss",2],0,"second"),ge("s",Oe,Ce),ge("ss",Oe,Ue),yl(["s","ss"],Qa);var awn=ih("Seconds",!1);ce("S",0,0,function(){return~~(this.millisecond()/100)}),ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ce(0,["SSS",3],0,"millisecond"),ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ge("S",no,ue),ge("SS",no,Ue),ge("SSS",no,He);var g2,V$e;for(g2="SSSS";g2.length<=9;g2+="S")ge(g2,xn);function rwn(w,k){k[qr]=rn(("0."+w)*1e3)}for(g2="S";g2.length<=9;g2+="S")yl(g2,rwn);V$e=ih("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function cwn(){return this._isUTC?"UTC":""}function own(){return this._isUTC?"Coordinated Universal Time":""}var _e=H.prototype;_e.add=eXn,_e.calendar=cXn,_e.clone=oXn,_e.diff=mXn,_e.endOf=yXn,_e.format=WXn,_e.from=NXn,_e.fromNow=VXn,_e.to=YXn,_e.toNow=gXn,_e.get=cye,_e.invalidAt=EXn,_e.isAfter=iXn,_e.isBefore=sXn,_e.isBetween=uXn,_e.isSame=dXn,_e.isSameOrAfter=GXn,_e.isSameOrBefore=bXn,_e.isValid=HXn,_e.lang=b$e,_e.locale=G$e,_e.localeData=m$e,_e.max=Hfn,_e.min=wfn,_e.parsingFlags=QXn,_e.set=oye,_e.startOf=RXn,_e.subtract=tXn,_e.toArray=fXn,_e.toObject=XXn,_e.toDate=vXn,_e.toISOString=hXn,_e.inspect=ZXn,typeof Symbol<"u"&&Symbol.for!=null&&(_e[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),_e.toJSON=wXn,_e.toString=pXn,_e.unix=FXn,_e.valueOf=AXn,_e.creationData=JXn,_e.eraName=xXn,_e.eraNarrow=jXn,_e.eraAbbr=OXn,_e.eraYear=UXn,_e.year=oh,_e.isLeapYear=IG,_e.weekYear=KXn,_e.isoWeekYear=_Xn,_e.quarter=_e.quarters=nwn,_e.month=D8e,_e.daysInMonth=vvn,_e.week=_e.weeks=Cvn,_e.isoWeek=_e.isoWeeks=Lvn,_e.weeksInYear=$Xn,_e.weeksInWeekYear=ewn,_e.isoWeeksInYear=PXn,_e.isoWeeksInISOWeekYear=qXn,_e.date=N$e,_e.day=_e.days=_vn,_e.weekday=Pvn,_e.isoWeekday=qvn,_e.dayOfYear=lwn,_e.hour=_e.hours=afn,_e.minute=_e.minutes=Iwn,_e.second=_e.seconds=awn,_e.millisecond=_e.milliseconds=V$e,_e.utcOffset=Ofn,_e.utc=zfn,_e.local=Bfn,_e.parseZone=Sfn,_e.hasAlignedHourOffset=Mfn,_e.isDST=Tfn,_e.isLocal=Kfn,_e.isUtcOffset=_fn,_e.isUtc=o$e,_e.isUTC=o$e,_e.zoneAbbr=cwn,_e.zoneName=own,_e.dates=J("dates accessor is deprecated. Use date instead.",N$e),_e.months=J("months accessor is deprecated. Use month instead",D8e),_e.years=J("years accessor is deprecated. Use year instead",oh),_e.zone=J("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ufn),_e.isDSTShifted=J("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Dfn);function iwn(w){return Rc(w*1e3)}function swn(){return Rc.apply(null,arguments).parseZone()}function Y$e(w){return w}var Ea=P.prototype;Ea.calendar=ee,Ea.longDateFormat=m,Ea.invalidDate=R,Ea.ordinal=te,Ea.preparse=Y$e,Ea.postformat=Y$e,Ea.relativeTime=p,Ea.pastFuture=V,Ea.set=D,Ea.eras=CXn,Ea.erasParse=LXn,Ea.erasConvertYear=kXn,Ea.erasAbbrRegex=BXn,Ea.erasNameRegex=zXn,Ea.erasNarrowRegex=SXn,Ea.months=CY,Ea.monthsShort=py,Ea.monthsParse=iye,Ea.monthsRegex=Xvn,Ea.monthsShortRegex=fvn,Ea.week=Hvn,Ea.firstDayOfYear=Jvn,Ea.firstDayOfWeek=Evn,Ea.weekdays=Svn,Ea.weekdaysMin=Tvn,Ea.weekdaysShort=Mvn,Ea.weekdaysParse=Kvn,Ea.weekdaysRegex=$vn,Ea.weekdaysShortRegex=efn,Ea.weekdaysMinRegex=tfn,Ea.isPM=lfn,Ea.meridiem=rfn;function i8(w,k,z,T){var Ie=Zy(),Ge=d().set(T,k);return Ie[z](Ge,w)}function g$e(w,k,z){if(s(w)&&(k=w,w=void 0),w=w||"",k!=null)return i8(w,k,z,"month");var T,Ie=[];for(T=0;T<12;T++)Ie[T]=i8(w,T,z,"month");return Ie}function Rye(w,k,z,T){typeof w=="boolean"?(s(k)&&(z=k,k=void 0),k=k||""):(k=w,z=k,w=!1,s(k)&&(z=k,k=void 0),k=k||"");var Ie=Zy(),Ge=w?Ie._week.dow:0,we,vt=[];if(z!=null)return i8(k,(z+Ge)%7,T,"day");for(we=0;we<7;we++)vt[we]=i8(k,(we+Ge)%7,T,"day");return vt}function uwn(w,k){return g$e(w,k,"months")}function dwn(w,k){return g$e(w,k,"monthsShort")}function Gwn(w,k,z){return Rye(w,k,z,"weekdays")}function bwn(w,k,z){return Rye(w,k,z,"weekdaysShort")}function mwn(w,k,z){return Rye(w,k,z,"weekdaysMin")}Y2("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(w){var k=w%10,z=rn(w%100/10)===1?"th":k===1?"st":k===2?"nd":k===3?"rd":"th";return w+z}}),e.lang=J("moment.lang is deprecated. Use moment.locale instead.",Y2),e.langData=J("moment.langData is deprecated. Use moment.localeData instead.",Zy);var Wy=Math.abs;function pwn(){var w=this._data;return this._milliseconds=Wy(this._milliseconds),this._days=Wy(this._days),this._months=Wy(this._months),w.milliseconds=Wy(w.milliseconds),w.seconds=Wy(w.seconds),w.minutes=Wy(w.minutes),w.hours=Wy(w.hours),w.months=Wy(w.months),w.years=Wy(w.years),this}function R$e(w,k,z,T){var Ie=fN(k,z);return w._milliseconds+=T*Ie._milliseconds,w._days+=T*Ie._days,w._months+=T*Ie._months,w._bubble()}function hwn(w,k){return R$e(this,w,k,1)}function Zwn(w,k){return R$e(this,w,k,-1)}function y$e(w){return w<0?Math.floor(w):Math.ceil(w)}function Wwn(){var w=this._milliseconds,k=this._days,z=this._months,T=this._data,Ie,Ge,we,vt,qn;return w>=0&&k>=0&&z>=0||w<=0&&k<=0&&z<=0||(w+=y$e(yye(z)+k)*864e5,k=0,z=0),T.milliseconds=w%1e3,Ie=Ra(w/1e3),T.seconds=Ie%60,Ge=Ra(Ie/60),T.minutes=Ge%60,we=Ra(Ge/60),T.hours=we%24,k+=Ra(we/24),qn=Ra(A$e(k)),z+=qn,k-=y$e(yye(qn)),vt=Ra(z/12),z%=12,T.days=k,T.months=z,T.years=vt,this}function A$e(w){return w*4800/146097}function yye(w){return w*146097/4800}function Nwn(w){if(!this.isValid())return NaN;var k,z,T=this._milliseconds;if(w=G(w),w==="month"||w==="quarter"||w==="year")switch(k=this._days+T/864e5,z=this._months+A$e(k),w){case"month":return z;case"quarter":return z/3;case"year":return z/12}else switch(k=this._days+Math.round(yye(this._months)),w){case"week":return k/7+T/6048e5;case"day":return k+T/864e5;case"hour":return k*24+T/36e5;case"minute":return k*1440+T/6e4;case"second":return k*86400+T/1e3;case"millisecond":return Math.floor(k*864e5)+T;default:throw new Error("Unknown unit "+w)}}function Ny(w){return function(){return this.as(w)}}var F$e=Ny("ms"),Vwn=Ny("s"),Ywn=Ny("m"),gwn=Ny("h"),Rwn=Ny("d"),ywn=Ny("w"),Awn=Ny("M"),Fwn=Ny("Q"),vwn=Ny("y"),fwn=F$e;function Xwn(){return fN(this)}function wwn(w){return w=G(w),this.isValid()?this[w+"s"]():NaN}function hH(w){return function(){return this.isValid()?this._data[w]:NaN}}var Hwn=hH("milliseconds"),Qwn=hH("seconds"),Ewn=hH("minutes"),Jwn=hH("hours"),Cwn=hH("days"),Lwn=hH("months"),kwn=hH("years");function xwn(){return Ra(this.days()/7)}var Vy=Math.round,l5={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function jwn(w,k,z,T,Ie){return Ie.relativeTime(k||1,!!z,w,T)}function Own(w,k,z,T){var Ie=fN(w).abs(),Ge=Vy(Ie.as("s")),we=Vy(Ie.as("m")),vt=Vy(Ie.as("h")),qn=Vy(Ie.as("d")),YI=Vy(Ie.as("M")),nm=Vy(Ie.as("w")),Yy=Vy(Ie.as("y")),R2=Ge<=z.ss&&["s",Ge]||Ge0,R2[4]=T,jwn.apply(null,R2)}function Uwn(w){return w===void 0?Vy:typeof w=="function"?(Vy=w,!0):!1}function zwn(w,k){return l5[w]===void 0?!1:k===void 0?l5[w]:(l5[w]=k,w==="s"&&(l5.ss=k-1),!0)}function Bwn(w,k){if(!this.isValid())return this.localeData().invalidDate();var z=!1,T=l5,Ie,Ge;return typeof w=="object"&&(k=w,w=!1),typeof w=="boolean"&&(z=w),typeof k=="object"&&(T=Object.assign({},l5,k),k.s!=null&&k.ss==null&&(T.ss=k.s-1)),Ie=this.localeData(),Ge=Own(this,!z,T,Ie),z&&(Ge=Ie.pastFuture(+this,Ge)),Ie.postformat(Ge)}var Aye=Math.abs;function I5(w){return(w>0)-(w<0)||+w}function s8(){if(!this.isValid())return this.localeData().invalidDate();var w=Aye(this._milliseconds)/1e3,k=Aye(this._days),z=Aye(this._months),T,Ie,Ge,we,vt=this.asSeconds(),qn,YI,nm,Yy;return vt?(T=Ra(w/60),Ie=Ra(T/60),w%=60,T%=60,Ge=Ra(z/12),z%=12,we=w?w.toFixed(3).replace(/\.?0+$/,""):"",qn=vt<0?"-":"",YI=I5(this._months)!==I5(vt)?"-":"",nm=I5(this._days)!==I5(vt)?"-":"",Yy=I5(this._milliseconds)!==I5(vt)?"-":"",qn+"P"+(Ge?YI+Ge+"Y":"")+(z?YI+z+"M":"")+(k?nm+k+"D":"")+(Ie||T||w?"T":"")+(Ie?Yy+Ie+"H":"")+(T?Yy+T+"M":"")+(w?Yy+we+"S":"")):"P0D"}var fI=l8.prototype;fI.isValid=Lfn,fI.abs=pwn,fI.add=hwn,fI.subtract=Zwn,fI.as=Nwn,fI.asMilliseconds=F$e,fI.asSeconds=Vwn,fI.asMinutes=Ywn,fI.asHours=gwn,fI.asDays=Rwn,fI.asWeeks=ywn,fI.asMonths=Awn,fI.asQuarters=Fwn,fI.asYears=vwn,fI.valueOf=fwn,fI._bubble=Wwn,fI.clone=Xwn,fI.get=wwn,fI.milliseconds=Hwn,fI.seconds=Qwn,fI.minutes=Ewn,fI.hours=Jwn,fI.days=Cwn,fI.weeks=xwn,fI.months=Lwn,fI.years=kwn,fI.humanize=Bwn,fI.toISOString=s8,fI.toString=s8,fI.toJSON=s8,fI.locale=G$e,fI.localeData=m$e,fI.toIsoString=J("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",s8),fI.lang=b$e,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),ge("x",br),ge("X",re),yl("X",function(w,k,z){z._d=new Date(parseFloat(w)*1e3)}),yl("x",function(w,k,z){z._d=new Date(rn(w))});return e.version="2.30.1",n(Rc),e.fn=_e,e.min=Qfn,e.max=Efn,e.now=Jfn,e.utc=d,e.unix=iwn,e.months=uwn,e.isDate=r,e.locale=Y2,e.invalid=g,e.duration=fN,e.isMoment=Q,e.weekdays=Gwn,e.parseZone=swn,e.localeData=Zy,e.isDuration=I8,e.monthsShort=dwn,e.weekdaysMin=mwn,e.defineLocale=Gye,e.updateLocale=sfn,e.locales=ufn,e.weekdaysShort=bwn,e.normalizeUnits=G,e.relativeTimeRounding=Uwn,e.relativeTimeThreshold=zwn,e.calendarFormat=rXn,e.prototype=_e,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var uIe=f((gRa,Gmt)=>{"use strict";function TTn(t,e){return t.path=e,t}function dmt(t){for(let e=1;e{"use strict";var{appendContextPath:qTn,createFrame:$Tn,blockParams:eDn,isPromise:tDn}=uIe();bmt.exports=t=>{t.registerHelper("each",async function(e,n){if(!n)throw new Error("Must pass iterator to #each");let{fn:l}=n,{inverse:I}=n,a=0,c=[],i,s;n.data&&n.ids&&(s=`${qTn(n.data.contextPath,n.ids[0])}.`),typeof e=="function"&&(e=e.call(this)),n.data&&(i=$Tn(n.data));async function r(u,o,d){i&&(i.key=u,i.index=o,i.first=o===0,i.last=!!d,s&&(i.contextPath=s+u)),c.push(l(e[u],{data:i,blockParams:eDn([e[u],u],[s+u,null])}))}if(e&&typeof e=="object")if(tDn(e)&&(e=await e),Array.isArray(e))for(let u=e.length;a{"use strict";var{isPromise:nDn,isEmpty:lDn}=uIe();pmt.exports=t=>{t.registerHelper("if",async function(e,n){if(arguments.length!==2)throw new Error("#if requires exactly one argument");return typeof e=="function"?e=e.call(this):nDn(e)&&(e=await e),!n.hash.includeZero&&!e||lDn(e)?n.inverse(this):n.fn(this)}),t.registerHelper("unless",function(e,n){if(arguments.length!==2)throw new Error("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})}});var Wmt=f((ARa,Zmt)=>{"use strict";var{isPromise:IDn,isEmpty:aDn,createFrame:rDn,appendContextPath:cDn,blockParams:oDn}=uIe();Zmt.exports=t=>{t.registerHelper("with",async function(e,n){if(arguments.length!==2)throw new Error("#with requires exactly one argument");typeof e=="function"?e=e.call(this):IDn(e)&&(e=await e);let{fn:l}=n;if(!aDn(e)){let{data:I}=n;return n.data&&n.ids&&(I=rDn(n.data),I.contextPath=cDn(n.data.contextPath,n.ids[0])),l(e,{data:I,blockParams:oDn([e],[I&&I.contextPath])})}return n.inverse(this)})}});var Vmt=f((FRa,Nmt)=>{"use strict";Nmt.exports={registerCoreHelpers:t=>{mmt()(t),hmt()(t),Wmt()(t)}}});var op=f((SEe,MEe)=>{(function(t,e){typeof SEe=="object"&&typeof MEe<"u"?MEe.exports=e():typeof define=="function"&&define.amd?define(e):t.JSON5=e()})(SEe,function(){"use strict";function t(he,Qe){return Qe={exports:{}},he(Qe,Qe.exports),Qe.exports}var e=t(function(he){var Qe=he.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=Qe)}),n=t(function(he){var Qe=he.exports={version:"2.6.5"};typeof __e=="number"&&(__e=Qe)}),l=n.version,I=function(he){return typeof he=="object"?he!==null:typeof he=="function"},a=function(he){if(!I(he))throw TypeError(he+" is not an object!");return he},c=function(he){try{return!!he()}catch{return!0}},i=!c(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),s=e.document,r=I(s)&&I(s.createElement),u=function(he){return r?s.createElement(he):{}},o=!i&&!c(function(){return Object.defineProperty(u("div"),"a",{get:function(){return 7}}).a!=7}),d=function(he,Qe){if(!I(he))return he;var Be,it;if(Qe&&typeof(Be=he.toString)=="function"&&!I(it=Be.call(he))||typeof(Be=he.valueOf)=="function"&&!I(it=Be.call(he))||!Qe&&typeof(Be=he.toString)=="function"&&!I(it=Be.call(he)))return it;throw TypeError("Can't convert object to primitive value")},b=Object.defineProperty,h=i?Object.defineProperty:function(Qe,Be,it){if(a(Qe),Be=d(Be,!0),a(it),o)try{return b(Qe,Be,it)}catch{}if("get"in it||"set"in it)throw TypeError("Accessors not supported!");return"value"in it&&(Qe[Be]=it.value),Qe},Z={f:h},N=function(he,Qe){return{enumerable:!(he&1),configurable:!(he&2),writable:!(he&4),value:Qe}},g=i?function(he,Qe,Be){return Z.f(he,Qe,N(1,Be))}:function(he,Qe,Be){return he[Qe]=Be,he},y={}.hasOwnProperty,X=function(he,Qe){return y.call(he,Qe)},v=0,H=Math.random(),Q=function(he){return"Symbol(".concat(he===void 0?"":he,")_",(++v+H).toString(36))},L=!1,J=t(function(he){var Qe="__core-js_shared__",Be=e[Qe]||(e[Qe]={});(he.exports=function(it,Ht){return Be[it]||(Be[it]=Ht!==void 0?Ht:{})})("versions",[]).push({version:n.version,mode:L?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),O=J("native-function-to-string",Function.toString),U=t(function(he){var Qe=Q("src"),Be="toString",it=(""+O).split(Be);n.inspectSource=function(Ht){return O.call(Ht)},(he.exports=function(Ht,Ct,hn,Qa){var qr=typeof hn=="function";qr&&(X(hn,"name")||g(hn,"name",Ct)),Ht[Ct]!==hn&&(qr&&(X(hn,Qe)||g(hn,Qe,Ht[Ct]?""+Ht[Ct]:it.join(String(Ct)))),Ht===e?Ht[Ct]=hn:Qa?Ht[Ct]?Ht[Ct]=hn:g(Ht,Ct,hn):(delete Ht[Ct],g(Ht,Ct,hn)))})(Function.prototype,Be,function(){return typeof this=="function"&&this[Qe]||O.call(this)})}),K=function(he){if(typeof he!="function")throw TypeError(he+" is not a function!");return he},D=function(he,Qe,Be){if(K(he),Qe===void 0)return he;switch(Be){case 1:return function(it){return he.call(Qe,it)};case 2:return function(it,Ht){return he.call(Qe,it,Ht)};case 3:return function(it,Ht,Ct){return he.call(Qe,it,Ht,Ct)}}return function(){return he.apply(Qe,arguments)}},_="prototype",P=function(he,Qe,Be){var it=he&P.F,Ht=he&P.G,Ct=he&P.S,hn=he&P.P,Qa=he&P.B,qr=Ht?e:Ct?e[Qe]||(e[Qe]={}):(e[Qe]||{})[_],by=Ht?n:n[Qe]||(n[Qe]={}),V2=by[_]||(by[_]={}),lG,oh,IG,ih;Ht&&(Be=Qe);for(lG in Be)oh=!it&&qr&&qr[lG]!==void 0,IG=(oh?qr:Be)[lG],ih=Qa&&oh?D(IG,e):hn&&typeof IG=="function"?D(Function.call,IG):IG,qr&&U(qr,lG,IG,he&P.U),by[lG]!=IG&&g(by,lG,ih),hn&&V2[lG]!=IG&&(V2[lG]=IG)};e.core=n,P.F=1,P.G=2,P.S=4,P.P=8,P.B=16,P.W=32,P.U=64,P.R=128;var le=P,q=Math.ceil,ee=Math.floor,ne=function(he){return isNaN(he=+he)?0:(he>0?ee:q)(he)},ie=function(he){if(he==null)throw TypeError("Can't call method on "+he);return he},me=function(he){return function(Qe,Be){var it=String(ie(Qe)),Ht=ne(Be),Ct=it.length,hn,Qa;return Ht<0||Ht>=Ct?he?"":void 0:(hn=it.charCodeAt(Ht),hn<55296||hn>56319||Ht+1===Ct||(Qa=it.charCodeAt(Ht+1))<56320||Qa>57343?he?it.charAt(Ht):hn:he?it.slice(Ht,Ht+2):(hn-55296<<10)+(Qa-56320)+65536)}},Ze=me(!1);le(le.P,"String",{codePointAt:function(Qe){return Ze(this,Qe)}});var Fe=n.String.codePointAt,ce=Math.max,fe=Math.min,ke=function(he,Qe){return he=ne(he),he<0?ce(he+Qe,0):fe(he,Qe)},j=String.fromCharCode,E=String.fromCodePoint;le(le.S+le.F*(!!E&&E.length!=1),"String",{fromCodePoint:function(Qe){for(var Be=arguments,it=[],Ht=arguments.length,Ct=0,hn;Ht>Ct;){if(hn=+Be[Ct++],ke(hn,1114111)!==hn)throw RangeError(hn+" is not a valid code point");it.push(hn<65536?j(hn):j(((hn-=65536)>>10)+55296,hn%1024+56320))}return it.join("")}});var S=n.String.fromCodePoint,m=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Y=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,R=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,C={Space_Separator:m,ID_Start:Y,ID_Continue:R},M={isSpaceSeparator:function(Qe){return typeof Qe=="string"&&C.Space_Separator.test(Qe)},isIdStartChar:function(Qe){return typeof Qe=="string"&&(Qe>="a"&&Qe<="z"||Qe>="A"&&Qe<="Z"||Qe==="$"||Qe==="_"||C.ID_Start.test(Qe))},isIdContinueChar:function(Qe){return typeof Qe=="string"&&(Qe>="a"&&Qe<="z"||Qe>="A"&&Qe<="Z"||Qe>="0"&&Qe<="9"||Qe==="$"||Qe==="_"||Qe==="\u200C"||Qe==="\u200D"||C.ID_Continue.test(Qe))},isDigit:function(Qe){return typeof Qe=="string"&&/[0-9]/.test(Qe)},isHexDigit:function(Qe){return typeof Qe=="string"&&/[0-9A-Fa-f]/.test(Qe)}},te,ae,p,V,F,G,W,A,x,ue=function(Qe,Be){te=String(Qe),ae="start",p=[],V=0,F=1,G=0,W=void 0,A=void 0,x=void 0;do W=ch(),pe[ae]();while(W.type!=="eof");return typeof Be=="function"?Ue({"":x},"",Be):x};function Ue(he,Qe,Be){var it=he[Qe];if(it!=null&&typeof it=="object")if(Array.isArray(it))for(var Ht=0;Ht0;){var Be=no();if(!M.isHexDigit(Be))throw Le(Je());he+=Je()}return String.fromCodePoint(parseInt(he,16))}var pe={start:function(){if(W.type==="eof")throw ge();ye()},beforePropertyName:function(){switch(W.type){case"identifier":case"string":A=W.value,ae="afterPropertyName";return;case"punctuator":Ce();return;case"eof":throw ge()}},afterPropertyName:function(){if(W.type==="eof")throw ge();ae="beforePropertyValue"},beforePropertyValue:function(){if(W.type==="eof")throw ge();ye()},beforeArrayValue:function(){if(W.type==="eof")throw ge();if(W.type==="punctuator"&&W.value==="]"){Ce();return}ye()},afterPropertyValue:function(){if(W.type==="eof")throw ge();switch(W.value){case",":ae="beforePropertyName";return;case"}":Ce()}},afterArrayValue:function(){if(W.type==="eof")throw ge();switch(W.value){case",":ae="beforeArrayValue";return;case"]":Ce()}},end:function(){}};function ye(){var he;switch(W.type){case"punctuator":switch(W.value){case"{":he={};break;case"[":he=[];break}break;case"null":case"boolean":case"numeric":case"string":he=W.value;break}if(x===void 0)x=he;else{var Qe=p[p.length-1];Array.isArray(Qe)?Qe.push(he):Object.defineProperty(Qe,A,{value:he,writable:!0,enumerable:!0,configurable:!0})}if(he!==null&&typeof he=="object")p.push(he),Array.isArray(he)?ae="beforeArrayValue":ae="beforePropertyName";else{var Be=p[p.length-1];Be==null?ae="end":Array.isArray(Be)?ae="afterArrayValue":ae="afterPropertyValue"}}function Ce(){p.pop();var he=p[p.length-1];he==null?ae="end":Array.isArray(he)?ae="afterArrayValue":ae="afterPropertyValue"}function Le(he){return Ra(he===void 0?"JSON5: invalid end of input at "+F+":"+G:"JSON5: invalid character '"+ql(he)+"' at "+F+":"+G)}function ge(){return Ra("JSON5: invalid end of input at "+F+":"+G)}function tt(){return G-=5,Ra("JSON5: invalid identifier character at "+F+":"+G)}function Hn(he){console.warn("JSON5: '"+ql(he)+"' in strings is not valid ECMAScript; consider escaping")}function ql(he){var Qe={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(Qe[he])return Qe[he];if(he<" "){var Be=he.charCodeAt(0).toString(16);return"\\x"+("00"+Be).substring(Be.length)}return he}function Ra(he){var Qe=new SyntaxError(he);return Qe.lineNumber=F,Qe.columnNumber=G,Qe}var rn=function(Qe,Be,it){var Ht=[],Ct="",hn,Qa,qr="",by;if(Be!=null&&typeof Be=="object"&&!Array.isArray(Be)&&(it=Be.space,by=Be.quote,Be=Be.replacer),typeof Be=="function")Qa=Be;else if(Array.isArray(Be)){hn=[];for(var V2=0,lG=Be;V20&&(it=Math.min(10,Math.floor(it)),qr=" ".substr(0,it)):typeof it=="string"&&(qr=it.substr(0,10)),ih("",{"":Qe});function ih(fr,nI){var Pn=nI[fr];switch(Pn!=null&&(typeof Pn.toJSON5=="function"?Pn=Pn.toJSON5(fr):typeof Pn.toJSON=="function"&&(Pn=Pn.toJSON(fr))),Qa&&(Pn=Qa.call(nI,fr,Pn)),Pn instanceof Number?Pn=Number(Pn):Pn instanceof String?Pn=String(Pn):Pn instanceof Boolean&&(Pn=Pn.valueOf()),Pn){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof Pn=="string")return JY(Pn,!1);if(typeof Pn=="number")return String(Pn);if(typeof Pn=="object")return Array.isArray(Pn)?oye(Pn):$7(Pn)}function JY(fr){for(var nI={"'":.1,'"':.2},Pn={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},Du="",jm=0;jm=0)throw TypeError("Converting circular structure to JSON5");Ht.push(fr);var nI=Ct;Ct=Ct+qr;for(var Pn=hn||Object.keys(fr),Du=[],jm=0,Ku=Pn;jm=0)throw TypeError("Converting circular structure to JSON5");Ht.push(fr);var nI=Ct;Ct=Ct+qr;for(var Pn=[],Du=0;Du{function jmt(t,e){if(e&&e.documentElement)t=e,e=arguments[2];else if(!t||!t.documentElement)throw new Error("First argument to Readability constructor should be a document object.");if(e=e||{},this._doc=t,this._docJSDOMParser=this._doc.firstChild.__JSDOMParser__,this._articleTitle=null,this._articleByline=null,this._articleDir=null,this._articleSiteName=null,this._attempts=[],this._debug=!!e.debug,this._maxElemsToParse=e.maxElemsToParse||this.DEFAULT_MAX_ELEMS_TO_PARSE,this._nbTopCandidates=e.nbTopCandidates||this.DEFAULT_N_TOP_CANDIDATES,this._charThreshold=e.charThreshold||this.DEFAULT_CHAR_THRESHOLD,this._classesToPreserve=this.CLASSES_TO_PRESERVE.concat(e.classesToPreserve||[]),this._keepClasses=!!e.keepClasses,this._serializer=e.serializer||function(n){return n.innerHTML},this._disableJSONLD=!!e.disableJSONLD,this._allowedVideoRegex=e.allowedVideoRegex||this.REGEXPS.videos,this._flags=this.FLAG_STRIP_UNLIKELYS|this.FLAG_WEIGHT_CLASSES|this.FLAG_CLEAN_CONDITIONALLY,this._debug){let n=function(l){if(l.nodeType==l.TEXT_NODE)return`${l.nodeName} ("${l.textContent}")`;let I=Array.from(l.attributes||[],function(a){return`${a.name}="${a.value}"`}).join(" ");return`<${l.localName} ${I}>`};this.log=function(){if(typeof console<"u"){let I=Array.from(arguments,a=>a&&a.nodeType==this.ELEMENT_NODE?n(a):a);I.unshift("Reader: (Readability)"),console.log.apply(console,I)}else if(typeof dump<"u"){var l=Array.prototype.map.call(arguments,function(I){return I&&I.nodeName?n(I):I}).join(" ");dump("Reader: (Readability) "+l+` +`)}}}else this.log=function(){}}jmt.prototype={FLAG_STRIP_UNLIKELYS:1,FLAG_WEIGHT_CLASSES:2,FLAG_CLEAN_CONDITIONALLY:4,ELEMENT_NODE:1,TEXT_NODE:3,DEFAULT_MAX_ELEMS_TO_PARSE:0,DEFAULT_N_TOP_CANDIDATES:5,DEFAULT_TAGS_TO_SCORE:"section,h2,h3,h4,h5,h6,p,td,pre".toUpperCase().split(","),DEFAULT_CHAR_THRESHOLD:500,REGEXPS:{unlikelyCandidates:/-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,okMaybeItsACandidate:/and|article|body|column|content|main|shadow/i,positive:/article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,negative:/-ad-|hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|gdpr|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i,extraneous:/print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i,byline:/byline|author|dateline|writtenby|p-author/i,replaceFonts:/<(\/?)font[^>]*>/gi,normalize:/\s{2,}/g,videos:/\/\/(www\.)?((dailymotion|youtube|youtube-nocookie|player\.vimeo|v\.qq)\.com|(archive|upload\.wikimedia)\.org|player\.twitch\.tv)/i,shareElements:/(\b|_)(share|sharedaddy)(\b|_)/i,nextLink:/(next|weiter|continue|>([^\|]|$)|»([^\|]|$))/i,prevLink:/(prev|earl|old|new|<|«)/i,tokenize:/\W+/g,whitespace:/^\s*$/,hasContent:/\S$/,hashUrl:/^#.+/,srcsetUrl:/(\S+)(\s+[\d.]+[xw])?(\s*(?:,|$))/g,b64DataUrl:/^data:\s*([^\s;,]+)\s*;\s*base64\s*,/i,jsonLdArticleTypes:/^Article|AdvertiserContentArticle|NewsArticle|AnalysisNewsArticle|AskPublicNewsArticle|BackgroundNewsArticle|OpinionNewsArticle|ReportageNewsArticle|ReviewNewsArticle|Report|SatiricalArticle|ScholarlyArticle|MedicalScholarlyArticle|SocialMediaPosting|BlogPosting|LiveBlogPosting|DiscussionForumPosting|TechArticle|APIReference$/},UNLIKELY_ROLES:["menu","menubar","complementary","navigation","alert","alertdialog","dialog"],DIV_TO_P_ELEMS:new Set(["BLOCKQUOTE","DL","DIV","IMG","OL","P","PRE","TABLE","UL"]),ALTER_TO_DIV_EXCEPTIONS:["DIV","ARTICLE","SECTION","P"],PRESENTATIONAL_ATTRIBUTES:["align","background","bgcolor","border","cellpadding","cellspacing","frame","hspace","rules","style","valign","vspace"],DEPRECATED_SIZE_ATTRIBUTE_ELEMS:["TABLE","TH","TD","HR","PRE"],PHRASING_ELEMS:["ABBR","AUDIO","B","BDO","BR","BUTTON","CITE","CODE","DATA","DATALIST","DFN","EM","EMBED","I","IMG","INPUT","KBD","LABEL","MARK","MATH","METER","NOSCRIPT","OBJECT","OUTPUT","PROGRESS","Q","RUBY","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRONG","SUB","SUP","TEXTAREA","TIME","VAR","WBR"],CLASSES_TO_PRESERVE:["page"],HTML_ESCAPE_MAP:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"},_postProcessContent:function(t){this._fixRelativeUris(t),this._simplifyNestedElements(t),this._keepClasses||this._cleanClasses(t)},_removeNodes:function(t,e){if(this._docJSDOMParser&&t._isLiveNodeList)throw new Error("Do not pass live node lists to _removeNodes");for(var n=t.length-1;n>=0;n--){var l=t[n],I=l.parentNode;I&&(!e||e.call(this,l,n,t))&&I.removeChild(l)}},_replaceNodeTags:function(t,e){if(this._docJSDOMParser&&t._isLiveNodeList)throw new Error("Do not pass live node lists to _replaceNodeTags");for(let n of t)this._setNodeTag(n,e)},_forEachNode:function(t,e){Array.prototype.forEach.call(t,e,this)},_findNode:function(t,e){return Array.prototype.find.call(t,e,this)},_someNode:function(t,e){return Array.prototype.some.call(t,e,this)},_everyNode:function(t,e){return Array.prototype.every.call(t,e,this)},_concatNodeLists:function(){var t=Array.prototype.slice,e=t.call(arguments),n=e.map(function(l){return t.call(l)});return Array.prototype.concat.apply([],n)},_getAllNodesWithTag:function(t,e){return t.querySelectorAll?t.querySelectorAll(e.join(",")):[].concat.apply([],e.map(function(n){var l=t.getElementsByTagName(n);return Array.isArray(l)?l:Array.from(l)}))},_cleanClasses:function(t){var e=this._classesToPreserve,n=(t.getAttribute("class")||"").split(/\s+/).filter(function(l){return e.indexOf(l)!=-1}).join(" ");for(n?t.setAttribute("class",n):t.removeAttribute("class"),t=t.firstElementChild;t;t=t.nextElementSibling)this._cleanClasses(t)},_fixRelativeUris:function(t){var e=this._doc.baseURI,n=this._doc.documentURI;function l(c){if(e==n&&c.charAt(0)=="#")return c;try{return new URL(c,e).href}catch{}return c}var I=this._getAllNodesWithTag(t,["a"]);this._forEachNode(I,function(c){var i=c.getAttribute("href");if(i)if(i.indexOf("javascript:")===0)if(c.childNodes.length===1&&c.childNodes[0].nodeType===this.TEXT_NODE){var s=this._doc.createTextNode(c.textContent);c.parentNode.replaceChild(s,c)}else{for(var r=this._doc.createElement("span");c.firstChild;)r.appendChild(c.firstChild);c.parentNode.replaceChild(r,c)}else c.setAttribute("href",l(i))});var a=this._getAllNodesWithTag(t,["img","picture","figure","video","audio","source"]);this._forEachNode(a,function(c){var i=c.getAttribute("src"),s=c.getAttribute("poster"),r=c.getAttribute("srcset");if(i&&c.setAttribute("src",l(i)),s&&c.setAttribute("poster",l(s)),r){var u=r.replace(this.REGEXPS.srcsetUrl,function(o,d,b,h){return l(d)+(b||"")+h});c.setAttribute("srcset",u)}})},_simplifyNestedElements:function(t){for(var e=t;e;){if(e.parentNode&&["DIV","SECTION"].includes(e.tagName)&&!(e.id&&e.id.startsWith("readability"))){if(this._isElementWithoutContent(e)){e=this._removeAndGetNext(e);continue}else if(this._hasSingleTagInsideElement(e,"DIV")||this._hasSingleTagInsideElement(e,"SECTION")){for(var n=e.children[0],l=0;l»] /.test(e))l=/ [\\\/>»] /.test(e),e=n.replace(/(.*)[\|\-\\\/>»] .*/gi,"$1"),I(e)<3&&(e=n.replace(/[^\|\-\\\/>»]*[\|\-\\\/>»](.*)/gi,"$1"));else if(e.indexOf(": ")!==-1){var a=this._concatNodeLists(t.getElementsByTagName("h1"),t.getElementsByTagName("h2")),c=e.trim(),i=this._someNode(a,function(u){return u.textContent.trim()===c});i||(e=n.substring(n.lastIndexOf(":")+1),I(e)<3?e=n.substring(n.indexOf(":")+1):I(n.substr(0,n.indexOf(":")))>5&&(e=n))}else if(e.length>150||e.length<15){var s=t.getElementsByTagName("h1");s.length===1&&(e=this._getInnerText(s[0]))}e=e.trim().replace(this.REGEXPS.normalize," ");var r=I(e);return r<=4&&(!l||r!=I(n.replace(/[\|\-\\\/>»]+/g,""))-1)&&(e=n),e},_prepDocument:function(){var t=this._doc;this._removeNodes(this._getAllNodesWithTag(t,["style"])),t.body&&this._replaceBrs(t.body),this._replaceNodeTags(this._getAllNodesWithTag(t,["font"]),"SPAN")},_nextNode:function(t){for(var e=t;e&&e.nodeType!=this.ELEMENT_NODE&&this.REGEXPS.whitespace.test(e.textContent);)e=e.nextSibling;return e},_replaceBrs:function(t){this._forEachNode(this._getAllNodesWithTag(t,["br"]),function(e){for(var n=e.nextSibling,l=!1;(n=this._nextNode(n))&&n.tagName=="BR";){l=!0;var I=n.nextSibling;n.parentNode.removeChild(n),n=I}if(l){var a=this._doc.createElement("p");for(e.parentNode.replaceChild(a,e),n=a.nextSibling;n;){if(n.tagName=="BR"){var c=this._nextNode(n.nextSibling);if(c&&c.tagName=="BR")break}if(!this._isPhrasingContent(n))break;var i=n.nextSibling;a.appendChild(n),n=i}for(;a.lastChild&&this._isWhitespace(a.lastChild);)a.removeChild(a.lastChild);a.parentNode.tagName==="P"&&this._setNodeTag(a.parentNode,"DIV")}})},_setNodeTag:function(t,e){if(this.log("_setNodeTag",t,e),this._docJSDOMParser)return t.localName=e.toLowerCase(),t.tagName=e.toUpperCase(),t;for(var n=t.ownerDocument.createElement(e);t.firstChild;)n.appendChild(t.firstChild);t.parentNode.replaceChild(n,t),t.readability&&(n.readability=t.readability);for(var l=0;l!n.includes(c)),a=I.join(" ").length/l.join(" ").length;return 1-a},_checkByline:function(t,e){if(this._articleByline)return!1;if(t.getAttribute!==void 0)var n=t.getAttribute("rel"),l=t.getAttribute("itemprop");return(n==="author"||l&&l.indexOf("author")!==-1||this.REGEXPS.byline.test(e))&&this._isValidByline(t.textContent)?(this._articleByline=t.textContent.trim(),!0):!1},_getNodeAncestors:function(t,e){e=e||0;for(var n=0,l=[];t.parentNode&&(l.push(t.parentNode),!(e&&++n===e));)t=t.parentNode;return l},_grabArticle:function(t){this.log("**** grabArticle ****");var e=this._doc,n=t!==null;if(t=t||this._doc.body,!t)return this.log("No body found in document. Abort."),null;for(var l=t.innerHTML;;){this.log("Starting grabArticle loop");var I=this._flagIsActive(this.FLAG_STRIP_UNLIKELYS),a=[],c=this._doc.documentElement;let Y=!0;for(;c;){c.tagName==="HTML"&&(this._articleLang=c.getAttribute("lang"));var i=c.className+" "+c.id;if(!this._isProbablyVisible(c)){this.log("Removing hidden node - "+i),c=this._removeAndGetNext(c);continue}if(c.getAttribute("aria-modal")=="true"&&c.getAttribute("role")=="dialog"){c=this._removeAndGetNext(c);continue}if(this._checkByline(c,i)){c=this._removeAndGetNext(c);continue}if(Y&&this._headerDuplicatesTitle(c)){this.log("Removing header: ",c.textContent.trim(),this._articleTitle.trim()),Y=!1,c=this._removeAndGetNext(c);continue}if(I){if(this.REGEXPS.unlikelyCandidates.test(i)&&!this.REGEXPS.okMaybeItsACandidate.test(i)&&!this._hasAncestorTag(c,"table")&&!this._hasAncestorTag(c,"code")&&c.tagName!=="BODY"&&c.tagName!=="A"){this.log("Removing unlikely candidate - "+i),c=this._removeAndGetNext(c);continue}if(this.UNLIKELY_ROLES.includes(c.getAttribute("role"))){this.log("Removing content with role "+c.getAttribute("role")+" - "+i),c=this._removeAndGetNext(c);continue}}if((c.tagName==="DIV"||c.tagName==="SECTION"||c.tagName==="HEADER"||c.tagName==="H1"||c.tagName==="H2"||c.tagName==="H3"||c.tagName==="H4"||c.tagName==="H5"||c.tagName==="H6")&&this._isElementWithoutContent(c)){c=this._removeAndGetNext(c);continue}if(this.DEFAULT_TAGS_TO_SCORE.indexOf(c.tagName)!==-1&&a.push(c),c.tagName==="DIV"){for(var s=null,r=c.firstChild;r;){var u=r.nextSibling;if(this._isPhrasingContent(r))s!==null?s.appendChild(r):this._isWhitespace(r)||(s=e.createElement("p"),c.replaceChild(s,r),s.appendChild(r));else if(s!==null){for(;s.lastChild&&this._isWhitespace(s.lastChild);)s.removeChild(s.lastChild);s=null}r=u}if(this._hasSingleTagInsideElement(c,"P")&&this._getLinkDensity(c)<.25){var o=c.children[0];c.parentNode.replaceChild(o,c),c=o,a.push(c)}else this._hasChildBlockElement(c)||(c=this._setNodeTag(c,"P"),a.push(c))}c=this._getNextNode(c)}var d=[];this._forEachNode(a,function(R){if(!(!R.parentNode||typeof R.parentNode.tagName>"u")){var C=this._getInnerText(R);if(!(C.length<25)){var M=this._getNodeAncestors(R,5);if(M.length!==0){var te=0;te+=1,te+=C.split(",").length,te+=Math.min(Math.floor(C.length/100),3),this._forEachNode(M,function(ae,p){if(!(!ae.tagName||!ae.parentNode||typeof ae.parentNode.tagName>"u")){if(typeof ae.readability>"u"&&(this._initializeNode(ae),d.push(ae)),p===0)var V=1;else p===1?V=2:V=p*3;ae.readability.contentScore+=te/V}})}}}});for(var b=[],h=0,Z=d.length;hX.readability.contentScore){b.splice(y,0,N),b.length>this._nbTopCandidates&&b.pop();break}}}var v=b[0]||null,H=!1,Q;if(v===null||v.tagName==="BODY"){for(v=e.createElement("DIV"),H=!0;t.firstChild;)this.log("Moving child out:",t.firstChild),v.appendChild(t.firstChild);t.appendChild(v),this._initializeNode(v)}else if(v){for(var L=[],J=1;J=.75&&L.push(this._getNodeAncestors(b[J]));var O=3;if(L.length>=O)for(Q=v.parentNode;Q.tagName!=="BODY";){for(var U=0,K=0;K=O){v=Q;break}Q=Q.parentNode}v.readability||this._initializeNode(v),Q=v.parentNode;for(var D=v.readability.contentScore,_=D/3;Q.tagName!=="BODY";){if(!Q.readability){Q=Q.parentNode;continue}var P=Q.readability.contentScore;if(P<_)break;if(P>D){v=Q;break}D=Q.readability.contentScore,Q=Q.parentNode}for(Q=v.parentNode;Q.tagName!="BODY"&&Q.children.length==1;)v=Q,Q=v.parentNode;v.readability||this._initializeNode(v)}var le=e.createElement("DIV");n&&(le.id="readability-content");var q=Math.max(10,v.readability.contentScore*.2);Q=v.parentNode;for(var ee=Q.children,ne=0,ie=ee.length;ne=q)Ze=!0;else if(me.nodeName==="P"){var ce=this._getLinkDensity(me),fe=this._getInnerText(me),ke=fe.length;(ke>80&&ce<.25||ke<80&&ke>0&&ce===0&&fe.search(/\.( |$)/)!==-1)&&(Ze=!0)}}Ze&&(this.log("Appending node:",me),this.ALTER_TO_DIV_EXCEPTIONS.indexOf(me.nodeName)===-1&&(this.log("Altering sibling:",me,"to div."),me=this._setNodeTag(me,"DIV")),le.appendChild(me),ee=Q.children,ne-=1,ie-=1)}if(this._debug&&this.log("Article content pre-prep: "+le.innerHTML),this._prepArticle(le),this._debug&&this.log("Article content post-prep: "+le.innerHTML),H)v.id="readability-page-1",v.className="page";else{var j=e.createElement("DIV");for(j.id="readability-page-1",j.className="page";le.firstChild;)j.appendChild(le.firstChild);le.appendChild(j)}this._debug&&this.log("Article content after paging: "+le.innerHTML);var E=!0,S=this._getInnerText(le,!0).length;if(S0&&t.length<100):!1},_unescapeHtmlEntities:function(t){if(!t)return t;var e=this.HTML_ESCAPE_MAP;return t.replace(/&(quot|amp|apos|lt|gt);/g,function(n,l){return e[l]}).replace(/&#(?:x([0-9a-z]{1,4})|([0-9]{1,4}));/gi,function(n,l,I){var a=parseInt(l||I,l?16:10);return String.fromCharCode(a)})},_getJSONLD:function(t){var e=this._getAllNodesWithTag(t,["script"]),n;return this._forEachNode(e,function(l){if(!n&&l.getAttribute("type")==="application/ld+json")try{var I=l.textContent.replace(/^\s*\s*$/g,""),a=JSON.parse(I);if(!a["@context"]||!a["@context"].match(/^https?\:\/\/schema\.org$/)||(!a["@type"]&&Array.isArray(a["@graph"])&&(a=a["@graph"].find(function(r){return(r["@type"]||"").match(this.REGEXPS.jsonLdArticleTypes)})),!a||!a["@type"]||!a["@type"].match(this.REGEXPS.jsonLdArticleTypes)))return;if(n={},typeof a.name=="string"&&typeof a.headline=="string"&&a.name!==a.headline){var c=this._getArticleTitle(),i=this._textSimilarity(a.name,c)>.75,s=this._textSimilarity(a.headline,c)>.75;s&&!i?n.title=a.headline:n.title=a.name}else typeof a.name=="string"?n.title=a.name.trim():typeof a.headline=="string"&&(n.title=a.headline.trim());a.author&&(typeof a.author.name=="string"?n.byline=a.author.name.trim():Array.isArray(a.author)&&a.author[0]&&typeof a.author[0].name=="string"&&(n.byline=a.author.filter(function(r){return r&&typeof r.name=="string"}).map(function(r){return r.name.trim()}).join(", "))),typeof a.description=="string"&&(n.excerpt=a.description.trim()),a.publisher&&typeof a.publisher.name=="string"&&(n.siteName=a.publisher.name.trim());return}catch(r){this.log(r.message)}}),n||{}},_getArticleMetadata:function(t){var e={},n={},l=this._doc.getElementsByTagName("meta"),I=/\s*(dc|dcterm|og|twitter)\s*:\s*(author|creator|description|title|site_name)\s*/gi,a=/^\s*(?:(dc|dcterm|og|twitter|weibo:(article|webpage))\s*[\.:]\s*)?(author|creator|description|title|site_name)\s*$/i;return this._forEachNode(l,function(c){var i=c.getAttribute("name"),s=c.getAttribute("property"),r=c.getAttribute("content");if(r){var u=null,o=null;s&&(u=s.match(I),u&&(o=u[0].toLowerCase().replace(/\s/g,""),n[o]=r.trim())),!u&&i&&a.test(i)&&(o=i,r&&(o=o.toLowerCase().replace(/\s/g,"").replace(/\./g,":"),n[o]=r.trim()))}}),e.title=t.title||n["dc:title"]||n["dcterm:title"]||n["og:title"]||n["weibo:article:title"]||n["weibo:webpage:title"]||n.title||n["twitter:title"],e.title||(e.title=this._getArticleTitle()),e.byline=t.byline||n["dc:creator"]||n["dcterm:creator"]||n.author,e.excerpt=t.excerpt||n["dc:description"]||n["dcterm:description"]||n["og:description"]||n["weibo:article:description"]||n["weibo:webpage:description"]||n.description||n["twitter:description"],e.siteName=t.siteName||n["og:site_name"],e.title=this._unescapeHtmlEntities(e.title),e.byline=this._unescapeHtmlEntities(e.byline),e.excerpt=this._unescapeHtmlEntities(e.excerpt),e.siteName=this._unescapeHtmlEntities(e.siteName),e},_isSingleImage:function(t){return t.tagName==="IMG"?!0:t.children.length!==1||t.textContent.trim()!==""?!1:this._isSingleImage(t.children[0])},_unwrapNoscriptImages:function(t){var e=Array.from(t.getElementsByTagName("img"));this._forEachNode(e,function(l){for(var I=0;I"u"?!0:e;var n=t.textContent.trim();return e?n.replace(this.REGEXPS.normalize," "):n},_getCharCount:function(t,e){return e=e||",",this._getInnerText(t).split(e).length-1},_cleanStyles:function(t){if(!(!t||t.tagName.toLowerCase()==="svg")){for(var e=0;e0&&I>n)return!1;if(t.parentNode.tagName===e&&(!l||l(t.parentNode)))return!0;t=t.parentNode,I++}return!1},_getRowAndColumnCount:function(t){for(var e=0,n=0,l=t.getElementsByTagName("tr"),I=0;I0){l._readabilityDataTable=!0;continue}var s=["col","colgroup","tfoot","thead","th"],r=function(o){return!!l.getElementsByTagName(o)[0]};if(s.some(r)){this.log("Data table because found data-y descendant"),l._readabilityDataTable=!0;continue}if(l.getElementsByTagName("table")[0]){l._readabilityDataTable=!1;continue}var u=this._getRowAndColumnCount(l);if(u.rows>=10||u.columns>4){l._readabilityDataTable=!0;continue}l._readabilityDataTable=u.rows*u.columns>10}},_fixLazyImages:function(t){this._forEachNode(this._getAllNodesWithTag(t,["img","picture","figure"]),function(e){if(e.src&&this.REGEXPS.b64DataUrl.test(e.src)){var n=this.REGEXPS.b64DataUrl.exec(e.src);if(n[1]==="image/svg+xml")return;for(var l=!1,I=0;Il+=this._getInnerText(a,!0).length),l/n},_cleanConditionally:function(t,e){this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)&&this._removeNodes(this._getAllNodesWithTag(t,[e]),function(n){var l=function(Q){return Q._readabilityDataTable},I=e==="ul"||e==="ol";if(!I){var a=0,c=this._getAllNodesWithTag(n,["ul","ol"]);this._forEachNode(c,Q=>a+=this._getInnerText(Q).length),I=a/this._getInnerText(n).length>.9}if(e==="table"&&l(n)||this._hasAncestorTag(n,"table",-1,l)||this._hasAncestorTag(n,"code"))return!1;var i=this._getClassWeight(n);this.log("Cleaning Conditionally",n);var s=0;if(i+s<0)return!0;if(this._getCharCount(n,",")<10){for(var r=n.getElementsByTagName("p").length,u=n.getElementsByTagName("img").length,o=n.getElementsByTagName("li").length-100,d=n.getElementsByTagName("input").length,b=this._getTextDensity(n,["h1","h2","h3","h4","h5","h6"]),h=0,Z=this._getAllNodesWithTag(n,["object","embed","iframe"]),N=0;N1&&r/u<.5&&!this._hasAncestorTag(n,"figure")||!I&&o>r||d>Math.floor(r/3)||!I&&b<.9&&X<25&&(u===0||u>2)&&!this._hasAncestorTag(n,"figure")||!I&&i<25&&y>.2||i>=25&&y>.5||h===1&&X<75||h>1;if(I&&v){for(var H=0;H1)return v;let Q=n.getElementsByTagName("li").length;if(u==Q)return!1}return v}return!1})},_cleanMatchedNodes:function(t,e){for(var n=this._getNextNode(t,!0),l=this._getNextNode(t);l&&l!=n;)e.call(this,l,l.className+" "+l.id)?l=this._removeAndGetNext(l):l=this._getNextNode(l)},_cleanHeaders:function(t){let e=this._getAllNodesWithTag(t,["h1","h2"]);this._removeNodes(e,function(n){let l=this._getClassWeight(n)<0;return l&&this.log("Removing header with low class weight:",n),l})},_headerDuplicatesTitle:function(t){if(t.tagName!="H1"&&t.tagName!="H2")return!1;var e=this._getInnerText(t,!1);return this.log("Evaluating similarity of header:",e,this._articleTitle),this._textSimilarity(this._articleTitle,e)>.75},_flagIsActive:function(t){return(this._flags&t)>0},_removeFlag:function(t){this._flags=this._flags&~t},_isProbablyVisible:function(t){return(!t.style||t.style.display!="none")&&!t.hasAttribute("hidden")&&(!t.hasAttribute("aria-hidden")||t.getAttribute("aria-hidden")!="true"||t.className&&t.className.indexOf&&t.className.indexOf("fallback-image")!==-1)},parse:function(){if(this._maxElemsToParse>0){var t=this._doc.getElementsByTagName("*").length;if(t>this._maxElemsToParse)throw new Error("Aborting parsing document; "+t+" elements found")}this._unwrapNoscriptImages(this._doc);var e=this._disableJSONLD?{}:this._getJSONLD(this._doc);this._removeScripts(this._doc),this._prepDocument();var n=this._getArticleMetadata(e);this._articleTitle=n.title;var l=this._grabArticle();if(!l)return null;if(this.log("Grabbed: "+l.innerHTML),this._postProcessContent(l),!n.excerpt){var I=l.getElementsByTagName("p");I.length>0&&(n.excerpt=I[0].textContent.trim())}var a=l.textContent;return{title:this._articleTitle,byline:n.byline||this._articleByline,dir:this._articleDir,lang:this._articleLang,content:this._serializer(l),textContent:a,length:a.length,excerpt:n.excerpt,siteName:n.siteName||this._articleSiteName}}};typeof t1e=="object"&&(t1e.exports=jmt)});var zmt=f((xRa,n1e)=>{var Umt={unlikelyCandidates:/-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,okMaybeItsACandidate:/and|article|body|column|content|main|shadow/i};function EDn(t){return(!t.style||t.style.display!="none")&&!t.hasAttribute("hidden")&&(!t.hasAttribute("aria-hidden")||t.getAttribute("aria-hidden")!="true"||t.className&&t.className.indexOf&&t.className.indexOf("fallback-image")!==-1)}function JDn(t,e={}){typeof e=="function"&&(e={visibilityChecker:e});var n={minScore:20,minContentLength:140,visibilityChecker:EDn};e=Object.assign(n,e);var l=t.querySelectorAll("p, pre, article"),I=t.querySelectorAll("div > br");if(I.length){var a=new Set(l);[].forEach.call(I,function(i){a.add(i.parentNode)}),l=Array.from(a)}var c=0;return[].some.call(l,function(i){if(!e.visibilityChecker(i))return!1;var s=i.className+" "+i.id;if(Umt.unlikelyCandidates.test(s)&&!Umt.okMaybeItsACandidate.test(s)||i.matches("li p"))return!1;var r=i.textContent.trim().length;return re.minScore)})}typeof n1e=="object"&&(n1e.exports=JDn)});var Smt=f((jRa,Bmt)=>{var CDn=Omt(),LDn=zmt();Bmt.exports={Readability:CDn,isProbablyReaderable:LDn}});var cpt=f(GI=>{"use strict";var pM=Symbol.for("react.element"),jDn=Symbol.for("react.portal"),ODn=Symbol.for("react.fragment"),UDn=Symbol.for("react.strict_mode"),zDn=Symbol.for("react.profiler"),BDn=Symbol.for("react.provider"),SDn=Symbol.for("react.context"),MDn=Symbol.for("react.forward_ref"),TDn=Symbol.for("react.suspense"),DDn=Symbol.for("react.memo"),KDn=Symbol.for("react.lazy"),_mt=Symbol.iterator;function _Dn(t){return t===null||typeof t!="object"?null:(t=_mt&&t[_mt]||t["@@iterator"],typeof t=="function"?t:null)}var $mt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ept=Object.assign,tpt={};function sx(t,e,n){this.props=t,this.context=e,this.refs=tpt,this.updater=n||$mt}sx.prototype.isReactComponent={};sx.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};sx.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function npt(){}npt.prototype=sx.prototype;function a1e(t,e,n){this.props=t,this.context=e,this.refs=tpt,this.updater=n||$mt}var r1e=a1e.prototype=new npt;r1e.constructor=a1e;ept(r1e,sx.prototype);r1e.isPureReactComponent=!0;var Pmt=Array.isArray,lpt=Object.prototype.hasOwnProperty,c1e={current:null},Ipt={key:!0,ref:!0,__self:!0,__source:!0};function apt(t,e,n){var l,I={},a=null,c=null;if(e!=null)for(l in e.ref!==void 0&&(c=e.ref),e.key!==void 0&&(a=""+e.key),e)lpt.call(e,l)&&!Ipt.hasOwnProperty(l)&&(I[l]=e[l]);var i=arguments.length-2;if(i===1)I.children=n;else if(1{"use strict";opt.exports=cpt()});var Gpt=f((PRa,dpt)=>{var tKn="Expected a function",spt=NaN,nKn="[object Symbol]",lKn=/^\s+|\s+$/g,IKn=/^[-+]0x[0-9a-f]+$/i,aKn=/^0b[01]+$/i,rKn=/^0o[0-7]+$/i,cKn=parseInt,oKn=typeof global=="object"&&global&&global.Object===Object&&global,iKn=typeof self=="object"&&self&&self.Object===Object&&self,sKn=oKn||iKn||Function("return this")(),uKn=Object.prototype,dKn=uKn.toString,GKn=Math.max,bKn=Math.min,u1e=function(){return sKn.Date.now()};function mKn(t,e,n){var l,I,a,c,i,s,r=0,u=!1,o=!1,d=!0;if(typeof t!="function")throw new TypeError(tKn);e=upt(e)||0,d1e(n)&&(u=!!n.leading,o="maxWait"in n,a=o?GKn(upt(n.maxWait)||0,e):a,d="trailing"in n?!!n.trailing:d);function b(Q){var L=l,J=I;return l=I=void 0,r=Q,c=t.apply(J,L),c}function h(Q){return r=Q,i=setTimeout(g,e),u?b(Q):c}function Z(Q){var L=Q-s,J=Q-r,O=e-L;return o?bKn(O,a-J):O}function N(Q){var L=Q-s,J=Q-r;return s===void 0||L>=e||L<0||o&&J>=a}function g(){var Q=u1e();if(N(Q))return y(Q);i=setTimeout(g,Z(Q))}function y(Q){return i=void 0,d&&l?b(Q):(l=I=void 0,c)}function X(){i!==void 0&&clearTimeout(i),r=0,l=s=I=i=void 0}function v(){return i===void 0?c:y(u1e())}function H(){var Q=u1e(),L=N(Q);if(l=arguments,I=this,s=Q,L){if(i===void 0)return h(s);if(o)return i=setTimeout(g,e),b(s)}return i===void 0&&(i=setTimeout(g,e)),c}return H.cancel=X,H.flush=v,H}function d1e(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function pKn(t){return!!t&&typeof t=="object"}function hKn(t){return typeof t=="symbol"||pKn(t)&&dKn.call(t)==nKn}function upt(t){if(typeof t=="number")return t;if(hKn(t))return spt;if(d1e(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=d1e(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(lKn,"");var n=aKn.test(t);return n||rKn.test(t)?cKn(t.slice(2),n?2:8):IKn.test(t)?spt:+t}dpt.exports=mKn});var Npt=f((oya,Wpt)=>{"use strict";var WKn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Wpt.exports=WKn});var Rpt=f((iya,gpt)=>{"use strict";var NKn=Npt();function Vpt(){}function Ypt(){}Ypt.resetWarningCache=Vpt;gpt.exports=function(){function t(l,I,a,c,i,s){if(s!==NKn){var r=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw r.name="Invariant Violation",r}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Ypt,resetWarningCache:Vpt};return n.PropTypes=n,n}});var W1e=f((dya,ypt)=>{ypt.exports=Rpt()();var sya,uya});var Ept=f((hAa,J1e)=>{var E1e=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,l=Object.defineProperty||function(ee,ne,ie){ee[ne]=ie.value},I,a=typeof Symbol=="function"?Symbol:{},c=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function r(ee,ne,ie){return Object.defineProperty(ee,ne,{value:ie,enumerable:!0,configurable:!0,writable:!0}),ee[ne]}try{r({},"")}catch{r=function(ne,ie,me){return ne[ie]=me}}function u(ee,ne,ie,me){var Ze=ne&&ne.prototype instanceof g?ne:g,Fe=Object.create(Ze.prototype),ce=new P(me||[]);return l(Fe,"_invoke",{value:U(ee,ie,ce)}),Fe}t.wrap=u;function o(ee,ne,ie){try{return{type:"normal",arg:ee.call(ne,ie)}}catch(me){return{type:"throw",arg:me}}}var d="suspendedStart",b="suspendedYield",h="executing",Z="completed",N={};function g(){}function y(){}function X(){}var v={};r(v,c,function(){return this});var H=Object.getPrototypeOf,Q=H&&H(H(le([])));Q&&Q!==e&&n.call(Q,c)&&(v=Q);var L=X.prototype=g.prototype=Object.create(v);y.prototype=X,l(L,"constructor",{value:X,configurable:!0}),l(X,"constructor",{value:y,configurable:!0}),y.displayName=r(X,s,"GeneratorFunction");function J(ee){["next","throw","return"].forEach(function(ne){r(ee,ne,function(ie){return this._invoke(ne,ie)})})}t.isGeneratorFunction=function(ee){var ne=typeof ee=="function"&&ee.constructor;return ne?ne===y||(ne.displayName||ne.name)==="GeneratorFunction":!1},t.mark=function(ee){return Object.setPrototypeOf?Object.setPrototypeOf(ee,X):(ee.__proto__=X,r(ee,s,"GeneratorFunction")),ee.prototype=Object.create(L),ee},t.awrap=function(ee){return{__await:ee}};function O(ee,ne){function ie(Fe,ce,fe,ke){var j=o(ee[Fe],ee,ce);if(j.type==="throw")ke(j.arg);else{var E=j.arg,S=E.value;return S&&typeof S=="object"&&n.call(S,"__await")?ne.resolve(S.__await).then(function(m){ie("next",m,fe,ke)},function(m){ie("throw",m,fe,ke)}):ne.resolve(S).then(function(m){E.value=m,fe(E)},function(m){return ie("throw",m,fe,ke)})}}var me;function Ze(Fe,ce){function fe(){return new ne(function(ke,j){ie(Fe,ce,ke,j)})}return me=me?me.then(fe,fe):fe()}l(this,"_invoke",{value:Ze})}J(O.prototype),r(O.prototype,i,function(){return this}),t.AsyncIterator=O,t.async=function(ee,ne,ie,me,Ze){Ze===void 0&&(Ze=Promise);var Fe=new O(u(ee,ne,ie,me),Ze);return t.isGeneratorFunction(ne)?Fe:Fe.next().then(function(ce){return ce.done?ce.value:Fe.next()})};function U(ee,ne,ie){var me=d;return function(Fe,ce){if(me===h)throw new Error("Generator is already running");if(me===Z){if(Fe==="throw")throw ce;return q()}for(ie.method=Fe,ie.arg=ce;;){var fe=ie.delegate;if(fe){var ke=K(fe,ie);if(ke){if(ke===N)continue;return ke}}if(ie.method==="next")ie.sent=ie._sent=ie.arg;else if(ie.method==="throw"){if(me===d)throw me=Z,ie.arg;ie.dispatchException(ie.arg)}else ie.method==="return"&&ie.abrupt("return",ie.arg);me=h;var j=o(ee,ne,ie);if(j.type==="normal"){if(me=ie.done?Z:b,j.arg===N)continue;return{value:j.arg,done:ie.done}}else j.type==="throw"&&(me=Z,ie.method="throw",ie.arg=j.arg)}}}function K(ee,ne){var ie=ne.method,me=ee.iterator[ie];if(me===I)return ne.delegate=null,ie==="throw"&&ee.iterator.return&&(ne.method="return",ne.arg=I,K(ee,ne),ne.method==="throw")||ie!=="return"&&(ne.method="throw",ne.arg=new TypeError("The iterator does not provide a '"+ie+"' method")),N;var Ze=o(me,ee.iterator,ne.arg);if(Ze.type==="throw")return ne.method="throw",ne.arg=Ze.arg,ne.delegate=null,N;var Fe=Ze.arg;if(!Fe)return ne.method="throw",ne.arg=new TypeError("iterator result is not an object"),ne.delegate=null,N;if(Fe.done)ne[ee.resultName]=Fe.value,ne.next=ee.nextLoc,ne.method!=="return"&&(ne.method="next",ne.arg=I);else return Fe;return ne.delegate=null,N}J(L),r(L,s,"Generator"),r(L,c,function(){return this}),r(L,"toString",function(){return"[object Generator]"});function D(ee){var ne={tryLoc:ee[0]};1 in ee&&(ne.catchLoc=ee[1]),2 in ee&&(ne.finallyLoc=ee[2],ne.afterLoc=ee[3]),this.tryEntries.push(ne)}function _(ee){var ne=ee.completion||{};ne.type="normal",delete ne.arg,ee.completion=ne}function P(ee){this.tryEntries=[{tryLoc:"root"}],ee.forEach(D,this),this.reset(!0)}t.keys=function(ee){var ne=Object(ee),ie=[];for(var me in ne)ie.push(me);return ie.reverse(),function Ze(){for(;ie.length;){var Fe=ie.pop();if(Fe in ne)return Ze.value=Fe,Ze.done=!1,Ze}return Ze.done=!0,Ze}};function le(ee){if(ee){var ne=ee[c];if(ne)return ne.call(ee);if(typeof ee.next=="function")return ee;if(!isNaN(ee.length)){var ie=-1,me=function Ze(){for(;++ie=0;--me){var Ze=this.tryEntries[me],Fe=Ze.completion;if(Ze.tryLoc==="root")return ie("end");if(Ze.tryLoc<=this.prev){var ce=n.call(Ze,"catchLoc"),fe=n.call(Ze,"finallyLoc");if(ce&&fe){if(this.prev=0;--ie){var me=this.tryEntries[ie];if(me.tryLoc<=this.prev&&n.call(me,"finallyLoc")&&this.prev=0;--ne){var ie=this.tryEntries[ne];if(ie.finallyLoc===ee)return this.complete(ie.completion,ie.afterLoc),_(ie),N}},catch:function(ee){for(var ne=this.tryEntries.length-1;ne>=0;--ne){var ie=this.tryEntries[ne];if(ie.tryLoc===ee){var me=ie.completion;if(me.type==="throw"){var Ze=me.arg;_(ie)}return Ze}}throw new Error("illegal catch attempt")},delegateYield:function(ee,ne,ie){return this.delegate={iterator:le(ee),resultName:ne,nextLoc:ie},this.method==="next"&&(this.arg=I),N}},t}(typeof J1e=="object"?J1e.exports:{});try{regeneratorRuntime=E1e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=E1e:Function("r","regeneratorRuntime = r")(E1e)}});var yIe=f((ZAa,Jpt)=>{Jpt.exports=(t,e)=>`${t}-${e}-${Math.random().toString(16).slice(3,8)}`});var C1e=f((WAa,Lpt)=>{var FKn=yIe(),Cpt=0;Lpt.exports=({id:t,action:e,payload:n={}})=>{let l=t;return typeof l>"u"&&(l=FKn("Job",Cpt),Cpt+=1),{id:l,action:e,payload:n}}});var AIe=f(VM=>{var L1e=!1;VM.logging=L1e;VM.setLogging=t=>{L1e=t};VM.log=(...t)=>L1e?console.log.apply(VM,t):null});var Opt=f((xpt,jpt)=>{var vKn=C1e(),{log:FIe}=AIe(),fKn=yIe(),kpt=0;jpt.exports=()=>{let t=fKn("Scheduler",kpt),e={},n={},l=[];kpt+=1;let I=()=>l.length,a=()=>Object.keys(e).length,c=()=>{if(l.length!==0){let o=Object.keys(e);for(let d=0;d"u"){l[0](e[o[d]]);break}}},i=(o,d)=>new Promise((b,h)=>{let Z=vKn({action:o,payload:d});l.push(async N=>{l.shift(),n[N.id]=Z;try{b(await N[o].apply(xpt,[...d,Z.id]))}catch(g){h(g)}finally{delete n[N.id],c()}}),FIe(`[${t}]: Add ${Z.id} to JobQueue`),FIe(`[${t}]: JobQueue length=${l.length}`),c()});return{addWorker:o=>(e[o.id]=o,FIe(`[${t}]: Add ${o.id}`),FIe(`[${t}]: Number of workers=${a()}`),c(),o.id),addJob:async(o,...d)=>{if(a()===0)throw Error(`[${t}]: You need to have at least one worker before adding jobs`);return i(o,d)},terminate:async()=>{Object.keys(e).forEach(async o=>{await e[o].terminate()}),l=[]},getQueueLen:I,getNumWorkers:a}}});var zpt=f((VAa,Upt)=>{function XKn(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}Upt.exports=XKn});var Spt=f((YAa,Bpt)=>{var wKn=zpt();Bpt.exports=t=>{let e={};return typeof WorkerGlobalScope<"u"?e.type="webworker":wKn()?e.type="electron":typeof document=="object"?e.type="browser":typeof process=="object"&&typeof require=="function"&&(e.type="node"),typeof t>"u"?e:e[t]}});var Tpt=f((gAa,Mpt)=>{var HKn=Spt()("type")==="browser",QKn=HKn?t=>new URL(t,window.location.href).href:t=>t;Mpt.exports=t=>{let e={...t};return["corePath","workerPath","langPath"].forEach(n=>{t[n]&&(e[n]=QKn(e[n]))}),e}});var Kpt=f((RAa,Dpt)=>{Dpt.exports=t=>{let e=[],n=[],l=[],I=[],a=[];return t.blocks&&t.blocks.forEach(c=>{c.paragraphs.forEach(i=>{i.lines.forEach(s=>{s.words.forEach(r=>{r.symbols.forEach(u=>{a.push({...u,page:t,block:c,paragraph:i,line:s,word:r})}),I.push({...r,page:t,block:c,paragraph:i,line:s})}),l.push({...s,page:t,block:c,paragraph:i})}),n.push({...i,page:t,block:c})}),e.push({...c,page:t})}),{...t,blocks:e,paragraphs:n,lines:l,words:I,symbols:a}}});var k1e=f((yAa,_pt)=>{_pt.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}});var qpt=f((AAa,Ppt)=>{var EKn=k1e();Ppt.exports={defaultOEM:EKn.DEFAULT}});var $pt=f((FAa,JKn)=>{JKn.exports={name:"tesseract.js",version:"4.1.4",description:"Pure Javascript Multilingual OCR",main:"src/index.js",types:"src/index.d.ts",unpkg:"dist/tesseract.min.js",jsdelivr:"dist/tesseract.min.js",scripts:{start:"node scripts/server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js && rollup -c scripts/rollup.esm.mjs","profile:tesseract":"webpack-bundle-analyzer dist/tesseract-stats.json","profile:worker":"webpack-bundle-analyzer dist/worker-stats.json",prepublishOnly:"npm run build",wait:"rimraf dist && wait-on http://localhost:3000/dist/tesseract.dev.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:* test:node:all","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser-tpl":"mocha-headless-chrome -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:detect":"npm run test:browser-tpl -- -f ./tests/detect.test.html","test:browser:recognize":"npm run test:browser-tpl -- -f ./tests/recognize.test.html","test:browser:scheduler":"npm run test:browser-tpl -- -f ./tests/scheduler.test.html","test:browser:FS":"npm run test:browser-tpl -- -f ./tests/FS.test.html",lint:"eslint src","lint:fix":"eslint --fix src",postinstall:"opencollective-postinstall || true"},browser:{"./src/worker/node/index.js":"./src/worker/browser/index.js"},author:"",contributors:["jeromewu"],license:"Apache-2.0",devDependencies:{"@babel/core":"^7.21.4","@babel/eslint-parser":"^7.21.3","@babel/preset-env":"^7.21.4","@rollup/plugin-commonjs":"^24.1.0",acorn:"^8.8.2","babel-loader":"^9.1.2",buffer:"^6.0.3",cors:"^2.8.5",eslint:"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.27.5","expect.js":"^0.3.1",express:"^4.18.2",mocha:"^10.2.0","mocha-headless-chrome":"^4.0.0","npm-run-all":"^4.1.5",nyc:"^15.1.0",rimraf:"^5.0.0",rollup:"^3.20.7","wait-on":"^7.0.1",webpack:"^5.79.0","webpack-bundle-analyzer":"^4.8.0","webpack-cli":"^5.0.1","webpack-dev-middleware":"^6.0.2","rollup-plugin-sourcemaps":"^0.6.3"},dependencies:{"bmp-js":"^0.1.0","idb-keyval":"^6.2.0","is-electron":"^2.2.2","is-url":"^1.2.4","node-fetch":"^2.6.9","opencollective-postinstall":"^2.0.3","regenerator-runtime":"^0.13.3","tesseract.js-core":"^4.0.4","wasm-feature-detect":"^1.2.11",zlibjs:"^0.3.1"},overrides:{"@rollup/pluginutils":"^5.0.2"},repository:{type:"git",url:"https://github.com/naptha/tesseract.js.git"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},homepage:"https://github.com/naptha/tesseract.js",collective:{type:"opencollective",url:"https://opencollective.com/tesseractjs"}}});var tht=f((vAa,eht)=>{eht.exports={langPath:"https://tessdata.projectnaptha.com/4.0.0",workerBlobURL:!0,logger:()=>{}}});var lht=f((fAa,nht)=>{var CKn=t=>new URL(t,window.location.href).href,{version:LKn}=$pt(),kKn=tht();nht.exports={...kKn,workerPath:typeof process<"u"&&process.env.TESS_ENV==="development"?CKn(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`):`https://cdn.jsdelivr.net/npm/tesseract.js@v${LKn}/dist/worker.min.js`,corePath:null}});var aht=f((XAa,Iht)=>{Iht.exports=({workerPath:t,workerBlobURL:e})=>{let n;if(Blob&&URL&&e){let l=new Blob([`importScripts("${t}");`],{type:"application/javascript"});n=new Worker(URL.createObjectURL(l))}else n=new Worker(t);return n}});var cht=f((wAa,rht)=>{rht.exports=t=>{t.terminate()}});var iht=f((HAa,oht)=>{oht.exports=(t,e)=>{t.onmessage=({data:n})=>{e(n)}}});var uht=f((QAa,sht)=>{sht.exports=async(t,e)=>{t.postMessage(e)}});var Ght=f((EAa,dht)=>{var x1e=t=>new Promise((e,n)=>{let l=new FileReader;l.onload=()=>{e(l.result)},l.onerror=({target:{error:{code:I}}})=>{n(Error(`File could not be read! Code=${I}`))},l.readAsArrayBuffer(t)}),j1e=async t=>{let e=t;if(typeof t>"u")return"undefined";if(typeof t=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(t)?e=atob(t.split(",")[1]).split("").map(n=>n.charCodeAt(0)):e=await(await fetch(t)).arrayBuffer();else if(typeof HTMLElement<"u"&&t instanceof HTMLElement)t.tagName==="IMG"&&(e=await j1e(t.src)),t.tagName==="VIDEO"&&(e=await j1e(t.poster)),t.tagName==="CANVAS"&&await new Promise(n=>{t.toBlob(async l=>{e=await x1e(l),n()})});else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas){let n=await t.convertToBlob();e=await x1e(n)}else(t instanceof File||t instanceof Blob)&&(e=await x1e(t));return new Uint8Array(e)};dht.exports=j1e});var mht=f((JAa,bht)=>{var xKn=lht(),jKn=aht(),OKn=cht(),UKn=iht(),zKn=uht(),BKn=Ght();bht.exports={defaultOptions:xKn,spawnWorker:jKn,terminateWorker:OKn,onMessage:UKn,send:zKn,loadImage:BKn}});var O1e=f((CAa,Wht)=>{var SKn=Tpt(),MKn=Kpt(),sV=C1e(),{log:pht}=AIe(),TKn=yIe(),{defaultOEM:DKn}=qpt(),{defaultOptions:KKn,spawnWorker:_Kn,terminateWorker:PKn,onMessage:qKn,loadImage:hht,send:$Kn}=mht(),Zht=0;Wht.exports=async(t={})=>{let e=TKn("Worker",Zht),{logger:n,errorHandler:l,...I}=SKn({...KKn,...t}),a={},c={},i,s,r=new Promise((_,P)=>{s=_,i=P}),u=_=>{i(_.message)},o=_Kn(I);o.onerror=u,Zht+=1;let d=(_,P)=>{a[_]=P},b=(_,P)=>{c[_]=P},h=({id:_,action:P,payload:le})=>new Promise((q,ee)=>{pht(`[${e}]: Start ${_}, action=${P}`),d(P,q),b(P,ee),$Kn(o,{workerId:e,jobId:_,action:P,payload:le})}),Z=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),N=_=>h(sV({id:_,action:"load",payload:{options:I}})),g=(_,P,le)=>h(sV({id:le,action:"FS",payload:{method:"writeFile",args:[_,P]}})),y=(_,P)=>h(sV({id:P,action:"FS",payload:{method:"readFile",args:[_,{encoding:"utf8"}]}})),X=(_,P)=>h(sV({id:P,action:"FS",payload:{method:"unlink",args:[_]}})),v=(_,P,le)=>h(sV({id:le,action:"FS",payload:{method:_,args:P}})),H=(_="eng",P)=>h(sV({id:P,action:"loadLanguage",payload:{langs:_,options:I}})),Q=(_="eng",P=DKn,le,q)=>h(sV({id:q,action:"initialize",payload:{langs:_,oem:P,config:le}})),L=(_={},P)=>h(sV({id:P,action:"setParameters",payload:{params:_}})),J=async(_,P={},le={blocks:!0,text:!0,hocr:!0,tsv:!0},q)=>h(sV({id:q,action:"recognize",payload:{image:await hht(_),options:P,output:le}})),O=(_="Tesseract OCR Result",P=!1,le)=>(console.log("`getPDF` function is depreciated. `recognize` option `savePDF` should be used instead."),h(sV({id:le,action:"getPDF",payload:{title:_,textonly:P}}))),U=async(_,P)=>h(sV({id:P,action:"detect",payload:{image:await hht(_)}})),K=async()=>(o!==null&&(PKn(o),o=null),Promise.resolve());qKn(o,({workerId:_,jobId:P,status:le,action:q,data:ee})=>{if(le==="resolve"){pht(`[${_}]: Complete ${P}`);let ne=ee;q==="recognize"?ne=MKn(ee):q==="getPDF"&&(ne=Array.from({...ee,length:Object.keys(ee).length})),a[q]({jobId:P,data:ne})}else if(le==="reject")if(c[q](ee),q==="load"&&i(ee),l)l(ee);else throw Error(ee);else le==="progress"&&n({...ee,userJobId:P})});let D={id:e,worker:o,setResolve:d,setReject:b,load:Z,writeText:g,readText:y,removeFile:X,FS:v,loadLanguage:H,initialize:Q,setParameters:L,recognize:J,getPDF:O,detect:U,terminate:K};return N().then(()=>s(D)).catch(()=>{}),r}});var Yht=f((LAa,Vht)=>{var Nht=O1e(),e_n=async(t,e,n)=>{let l=await Nht(n);return await l.loadLanguage(e),await l.initialize(e),l.recognize(t).finally(async()=>{await l.terminate()})},t_n=async(t,e)=>{let n=await Nht(e);return await n.loadLanguage("osd"),await n.initialize("osd"),n.detect(t).finally(async()=>{await n.terminate()})};Vht.exports={recognize:e_n,detect:t_n}});var Rht=f((kAa,ght)=>{ght.exports={AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"}});var Aht=f((xAa,yht)=>{yht.exports={OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12",RAW_LINE:"13"}});var U1e=f((jAa,Fht)=>{Ept();var n_n=Opt(),l_n=O1e(),I_n=Yht(),a_n=Rht(),r_n=k1e(),c_n=Aht(),{setLogging:o_n}=AIe();Fht.exports={languages:a_n,OEM:r_n,PSM:c_n,createScheduler:n_n,createWorker:l_n,setLogging:o_n,...I_n}});var fIe=f(z1e=>{(function(){z1e.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:` +`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(z1e)});var yg=f((Hht,zv)=>{(function(){var t,e,n,l,I,a,c,i=[].slice,s={}.hasOwnProperty;t=function(){var r,u,o,d,b,h;if(h=arguments[0],b=2<=arguments.length?i.call(arguments,1):[],I(Object.assign))Object.assign.apply(null,arguments);else for(r=0,o=b.length;r{(function(){var t;Eht.exports=t=function(){function e(){}return e.prototype.hasFeature=function(n,l){return!0},e.prototype.createDocumentType=function(n,l,I){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(n,l,I){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(n){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(n,l){throw new Error("This DOM method is not implemented.")},e}()}).call(Qht)});var Lht=f((Jht,Cht)=>{(function(){var t;Cht.exports=t=function(){function e(){}return e.prototype.handleError=function(n){throw new Error(n)},e}()}).call(Jht)});var jht=f((kht,xht)=>{(function(){var t;xht.exports=t=function(){function e(n){this.arr=n||[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}}),e.prototype.item=function(n){return this.arr[n]||null},e.prototype.contains=function(n){return this.arr.indexOf(n)!==-1},e}()}).call(kht)});var zht=f((Oht,Uht)=>{(function(){var t,e,n;e=Lht(),n=jht(),Uht.exports=t=function(){function l(){var I;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=I=Object.create(this.defaultParams)}return Object.defineProperty(l.prototype,"parameterNames",{get:function(){return new n(Object.keys(this.defaultParams))}}),l.prototype.getParameter=function(I){return this.params.hasOwnProperty(I)?this.params[I]:null},l.prototype.canSetParameter=function(I,a){return!0},l.prototype.setParameter=function(I,a){return a!=null?this.params[I]=a:delete this.params[I]},l}()}).call(Oht)});var So=f((Bht,Sht)=>{(function(){Sht.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(Bht)});var S1e=f((Mht,Tht)=>{(function(){var t,e,n;t=So(),n=Ch(),Tht.exports=e=function(){function l(I,a,c){if(this.parent=I,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),a==null)throw new Error("Missing attribute name. "+this.debugInfo(a));this.name=this.stringify.name(a),this.value=this.stringify.attValue(c),this.type=t.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(l.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(l.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(l.prototype,"textContent",{get:function(){return this.value},set:function(I){return this.value=I||""}}),Object.defineProperty(l.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(l.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(l.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(l.prototype,"specified",{get:function(){return!0}}),l.prototype.clone=function(){return Object.create(this)},l.prototype.toString=function(I){return this.options.writer.attribute(this,this.options.writer.filterOptions(I))},l.prototype.debugInfo=function(I){return I=I||this.name,I==null?"parent: <"+this.parent.name+">":"attribute: {"+I+"}, parent: <"+this.parent.name+">"},l.prototype.isEqualNode=function(I){return!(I.namespaceURI!==this.namespaceURI||I.prefix!==this.prefix||I.localName!==this.localName||I.value!==this.value)},l}()}).call(Mht)});var XIe=f((Dht,Kht)=>{(function(){var t;Kht.exports=t=function(){function e(n){this.nodes=n}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(n){return this.nodes[n]},e.prototype.setNamedItem=function(n){var l;return l=this.nodes[n.nodeName],this.nodes[n.nodeName]=n,l||null},e.prototype.removeNamedItem=function(n){var l;return l=this.nodes[n],delete this.nodes[n],l||null},e.prototype.item=function(n){return this.nodes[Object.keys(this.nodes)[n]]||null},e.prototype.getNamedItemNS=function(n,l){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(n){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(n,l){throw new Error("This DOM method is not implemented.")},e}()}).call(Dht)});var wIe=f((_ht,Pht)=>{(function(){var t,e,n,l,I,a,c,i,s,r=function(o,d){for(var b in d)u.call(d,b)&&(o[b]=d[b]);function h(){this.constructor=o}return h.prototype=d.prototype,o.prototype=new h,o.__super__=d.prototype,o},u={}.hasOwnProperty;s=yg(),i=s.isObject,c=s.isFunction,a=s.getValue,I=Ch(),t=So(),e=S1e(),l=XIe(),Pht.exports=n=function(o){r(d,o);function d(b,h,Z){var N,g,y,X;if(d.__super__.constructor.call(this,b),h==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(h),this.type=t.Element,this.attribs={},this.schemaTypeInfo=null,Z!=null&&this.attribute(Z),b.type===t.Document&&(this.isRoot=!0,this.documentObject=b,b.rootObject=this,b.children)){for(X=b.children,g=0,y=X.length;g=N;h=0<=N?++Z:--Z)if(!this.attribs[h].isEqualNode(b.attribs[h]))return!1;return!0},d}(I)}).call(_ht)});var RM=f((qht,$ht)=>{(function(){var t,e,n=function(I,a){for(var c in a)l.call(a,c)&&(I[c]=a[c]);function i(){this.constructor=I}return i.prototype=a.prototype,I.prototype=new i,I.__super__=a.prototype,I},l={}.hasOwnProperty;e=Ch(),$ht.exports=t=function(I){n(a,I);function a(c){a.__super__.constructor.call(this,c),this.value=""}return Object.defineProperty(a.prototype,"data",{get:function(){return this.value},set:function(c){return this.value=c||""}}),Object.defineProperty(a.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(a.prototype,"textContent",{get:function(){return this.value},set:function(c){return this.value=c||""}}),a.prototype.clone=function(){return Object.create(this)},a.prototype.substringData=function(c,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.appendData=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.insertData=function(c,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.deleteData=function(c,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceData=function(c,i,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.isEqualNode=function(c){return!(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(c)||c.data!==this.data)},a}(e)}).call(qht)});var HIe=f((eZt,tZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;t=So(),n=RM(),tZt.exports=e=function(a){l(c,a);function c(i,s){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=t.CData,this.value=this.stringify.cdata(s)}return c.prototype.clone=function(){return Object.create(this)},c.prototype.toString=function(i){return this.options.writer.cdata(this,this.options.writer.filterOptions(i))},c}(n)}).call(eZt)});var QIe=f((nZt,lZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;t=So(),e=RM(),lZt.exports=n=function(a){l(c,a);function c(i,s){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=t.Comment,this.value=this.stringify.comment(s)}return c.prototype.clone=function(){return Object.create(this)},c.prototype.toString=function(i){return this.options.writer.comment(this,this.options.writer.filterOptions(i))},c}(e)}).call(nZt)});var EIe=f((IZt,aZt)=>{(function(){var t,e,n,l,I=function(c,i){for(var s in i)a.call(i,s)&&(c[s]=i[s]);function r(){this.constructor=c}return r.prototype=i.prototype,c.prototype=new r,c.__super__=i.prototype,c},a={}.hasOwnProperty;l=yg().isObject,n=Ch(),t=So(),aZt.exports=e=function(c){I(i,c);function i(s,r,u,o){var d;i.__super__.constructor.call(this,s),l(r)&&(d=r,r=d.version,u=d.encoding,o=d.standalone),r||(r="1.0"),this.type=t.Declaration,this.version=this.stringify.xmlVersion(r),u!=null&&(this.encoding=this.stringify.xmlEncoding(u)),o!=null&&(this.standalone=this.stringify.xmlStandalone(o))}return i.prototype.toString=function(s){return this.options.writer.declaration(this,this.options.writer.filterOptions(s))},i}(n)}).call(IZt)});var JIe=f((rZt,cZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;n=Ch(),t=So(),cZt.exports=e=function(a){l(c,a);function c(i,s,r,u,o,d){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(r==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(s));if(!u)throw new Error("Missing DTD attribute type. "+this.debugInfo(s));if(!o)throw new Error("Missing DTD attribute default. "+this.debugInfo(s));if(o.indexOf("#")!==0&&(o="#"+o),!o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(s));if(d&&!o.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(s));this.elementName=this.stringify.name(s),this.type=t.AttributeDeclaration,this.attributeName=this.stringify.name(r),this.attributeType=this.stringify.dtdAttType(u),d&&(this.defaultValue=this.stringify.dtdAttDefault(d)),this.defaultValueType=o}return c.prototype.toString=function(i){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(i))},c}(n)}).call(rZt)});var CIe=f((oZt,iZt)=>{(function(){var t,e,n,l,I=function(c,i){for(var s in i)a.call(i,s)&&(c[s]=i[s]);function r(){this.constructor=c}return r.prototype=i.prototype,c.prototype=new r,c.__super__=i.prototype,c},a={}.hasOwnProperty;l=yg().isObject,n=Ch(),t=So(),iZt.exports=e=function(c){I(i,c);function i(s,r,u,o){if(i.__super__.constructor.call(this,s),u==null)throw new Error("Missing DTD entity name. "+this.debugInfo(u));if(o==null)throw new Error("Missing DTD entity value. "+this.debugInfo(u));if(this.pe=!!r,this.name=this.stringify.name(u),this.type=t.EntityDeclaration,!l(o))this.value=this.stringify.dtdEntityValue(o),this.internal=!0;else{if(!o.pubID&&!o.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(u));if(o.pubID&&!o.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(u));if(this.internal=!1,o.pubID!=null&&(this.pubID=this.stringify.dtdPubID(o.pubID)),o.sysID!=null&&(this.sysID=this.stringify.dtdSysID(o.sysID)),o.nData!=null&&(this.nData=this.stringify.dtdNData(o.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(u))}}return Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(i.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(i.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlVersion",{get:function(){return null}}),i.prototype.toString=function(s){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(s))},i}(n)}).call(oZt)});var LIe=f((sZt,uZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;n=Ch(),t=So(),uZt.exports=e=function(a){l(c,a);function c(i,s,r){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());r||(r="(#PCDATA)"),Array.isArray(r)&&(r="("+r.join(",")+")"),this.name=this.stringify.name(s),this.type=t.ElementDeclaration,this.value=this.stringify.dtdElementValue(r)}return c.prototype.toString=function(i){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(i))},c}(n)}).call(sZt)});var kIe=f((dZt,GZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;n=Ch(),t=So(),GZt.exports=e=function(a){l(c,a);function c(i,s,r){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing DTD notation name. "+this.debugInfo(s));if(!r.pubID&&!r.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(s));this.name=this.stringify.name(s),this.type=t.NotationDeclaration,r.pubID!=null&&(this.pubID=this.stringify.dtdPubID(r.pubID)),r.sysID!=null&&(this.sysID=this.stringify.dtdSysID(r.sysID))}return Object.defineProperty(c.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(c.prototype,"systemId",{get:function(){return this.sysID}}),c.prototype.toString=function(i){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(i))},c}(n)}).call(dZt)});var xIe=f((bZt,mZt)=>{(function(){var t,e,n,l,I,a,c,i,s,r=function(o,d){for(var b in d)u.call(d,b)&&(o[b]=d[b]);function h(){this.constructor=o}return h.prototype=d.prototype,o.prototype=new h,o.__super__=d.prototype,o},u={}.hasOwnProperty;s=yg().isObject,i=Ch(),t=So(),e=JIe(),l=CIe(),n=LIe(),I=kIe(),c=XIe(),mZt.exports=a=function(o){r(d,o);function d(b,h,Z){var N,g,y,X,v,H;if(d.__super__.constructor.call(this,b),this.type=t.DocType,b.children){for(X=b.children,g=0,y=X.length;g{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;t=So(),e=Ch(),hZt.exports=n=function(a){l(c,a);function c(i,s){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=t.Raw,this.value=this.stringify.raw(s)}return c.prototype.clone=function(){return Object.create(this)},c.prototype.toString=function(i){return this.options.writer.raw(this,this.options.writer.filterOptions(i))},c}(e)}).call(pZt)});var OIe=f((ZZt,WZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;t=So(),e=RM(),WZt.exports=n=function(a){l(c,a);function c(i,s){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=t.Text,this.value=this.stringify.text(s)}return Object.defineProperty(c.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(c.prototype,"wholeText",{get:function(){var i,s,r;for(r="",s=this.previousSibling;s;)r=s.data+r,s=s.previousSibling;for(r+=this.data,i=this.nextSibling;i;)r=r+i.data,i=i.nextSibling;return r}}),c.prototype.clone=function(){return Object.create(this)},c.prototype.toString=function(i){return this.options.writer.text(this,this.options.writer.filterOptions(i))},c.prototype.splitText=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},c.prototype.replaceWholeText=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},c}(e)}).call(ZZt)});var UIe=f((NZt,VZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;t=So(),e=RM(),VZt.exports=n=function(a){l(c,a);function c(i,s,r){if(c.__super__.constructor.call(this,i),s==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=t.ProcessingInstruction,this.target=this.stringify.insTarget(s),this.name=this.target,r&&(this.value=this.stringify.insValue(r))}return c.prototype.clone=function(){return Object.create(this)},c.prototype.toString=function(i){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(i))},c.prototype.isEqualNode=function(i){return!(!c.__super__.isEqualNode.apply(this,arguments).isEqualNode(i)||i.target!==this.target)},c}(e)}).call(NZt)});var M1e=f((YZt,gZt)=>{(function(){var t,e,n,l=function(a,c){for(var i in c)I.call(c,i)&&(a[i]=c[i]);function s(){this.constructor=a}return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},I={}.hasOwnProperty;n=Ch(),t=So(),gZt.exports=e=function(a){l(c,a);function c(i){c.__super__.constructor.call(this,i),this.type=t.Dummy}return c.prototype.clone=function(){return Object.create(this)},c.prototype.toString=function(i){return""},c}(n)}).call(YZt)});var AZt=f((RZt,yZt)=>{(function(){var t;yZt.exports=t=function(){function e(n){this.nodes=n}return Object.defineProperty(e.prototype,"length",{get:function(){return this.nodes.length||0}}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(n){return this.nodes[n]||null},e}()}).call(RZt)});var fZt=f((FZt,vZt)=>{(function(){vZt.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(FZt)});var Ch=f((XZt,wZt)=>{(function(){var t,e,n,l,I,a,c,i,s,r,u,o,d,b,h,Z,N,g,y,X={}.hasOwnProperty;y=yg(),g=y.isObject,N=y.isFunction,Z=y.isEmpty,h=y.getValue,i=null,n=null,l=null,I=null,a=null,d=null,b=null,o=null,c=null,e=null,u=null,s=null,t=null,wZt.exports=r=function(){function v(H){this.parent=H,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,i||(i=wIe(),n=HIe(),l=QIe(),I=EIe(),a=xIe(),d=jIe(),b=OIe(),o=UIe(),c=M1e(),e=So(),u=AZt(),s=XIe(),t=fZt())}return Object.defineProperty(v.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(v.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(v.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(v.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(v.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new u(this.children)),this.childNodeList}}),Object.defineProperty(v.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(v.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(v.prototype,"previousSibling",{get:function(){var H;return H=this.parent.children.indexOf(this),this.parent.children[H-1]||null}}),Object.defineProperty(v.prototype,"nextSibling",{get:function(){var H;return H=this.parent.children.indexOf(this),this.parent.children[H+1]||null}}),Object.defineProperty(v.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(v.prototype,"textContent",{get:function(){var H,Q,L,J,O;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(O="",J=this.children,Q=0,L=J.length;Q":(L=this.parent)!=null&&L.name?"node: <"+H+">, parent: <"+this.parent.name+">":"node: <"+H+">"},v.prototype.ele=function(H,Q,L){return this.element(H,Q,L)},v.prototype.nod=function(H,Q,L){return this.node(H,Q,L)},v.prototype.txt=function(H){return this.text(H)},v.prototype.dat=function(H){return this.cdata(H)},v.prototype.com=function(H){return this.comment(H)},v.prototype.ins=function(H,Q){return this.instruction(H,Q)},v.prototype.doc=function(){return this.document()},v.prototype.dec=function(H,Q,L){return this.declaration(H,Q,L)},v.prototype.e=function(H,Q,L){return this.element(H,Q,L)},v.prototype.n=function(H,Q,L){return this.node(H,Q,L)},v.prototype.t=function(H){return this.text(H)},v.prototype.d=function(H){return this.cdata(H)},v.prototype.c=function(H){return this.comment(H)},v.prototype.r=function(H){return this.raw(H)},v.prototype.i=function(H,Q){return this.instruction(H,Q)},v.prototype.u=function(){return this.up()},v.prototype.importXMLBuilder=function(H){return this.importDocument(H)},v.prototype.replaceChild=function(H,Q){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.removeChild=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.appendChild=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.hasChildNodes=function(){return this.children.length!==0},v.prototype.cloneNode=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.isSupported=function(H,Q){return!0},v.prototype.hasAttributes=function(){return this.attribs.length!==0},v.prototype.compareDocumentPosition=function(H){var Q,L;return Q=this,Q===H?0:this.document()!==H.document()?(L=t.Disconnected|t.ImplementationSpecific,Math.random()<.5?L|=t.Preceding:L|=t.Following,L):Q.isAncestor(H)?t.Contains|t.Preceding:Q.isDescendant(H)?t.Contains|t.Following:Q.isPreceding(H)?t.Preceding:t.Following},v.prototype.isSameNode=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.lookupPrefix=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.isDefaultNamespace=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.lookupNamespaceURI=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.isEqualNode=function(H){var Q,L,J;if(H.nodeType!==this.nodeType||H.children.length!==this.children.length)return!1;for(Q=L=0,J=this.children.length-1;0<=J?L<=J:L>=J;Q=0<=J?++L:--L)if(!this.children[Q].isEqualNode(H.children[Q]))return!1;return!0},v.prototype.getFeature=function(H,Q){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.setUserData=function(H,Q,L){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getUserData=function(H){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.contains=function(H){return H?H===this||this.isDescendant(H):!1},v.prototype.isDescendant=function(H){var Q,L,J,O,U;for(U=this.children,J=0,O=U.length;JL},v.prototype.treePosition=function(H){var Q,L;return L=0,Q=!1,this.foreachTreeNode(this.document(),function(J){if(L++,!Q&&J===H)return Q=!0}),Q?L:-1},v.prototype.foreachTreeNode=function(H,Q){var L,J,O,U,K;for(H||(H=this.document()),U=H.children,J=0,O=U.length;J{(function(){var t,e=function(l,I){return function(){return l.apply(I,arguments)}},n={}.hasOwnProperty;QZt.exports=t=function(){function l(I){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var a,c,i;I||(I={}),this.options=I,this.options.version||(this.options.version="1.0"),c=I.stringify||{};for(a in c)n.call(c,a)&&(i=c[a],this[a]=i)}return l.prototype.name=function(I){return this.options.noValidation?I:this.assertLegalName(""+I||"")},l.prototype.text=function(I){return this.options.noValidation?I:this.assertLegalChar(this.textEscape(""+I||""))},l.prototype.cdata=function(I){return this.options.noValidation?I:(I=""+I||"",I=I.replace("]]>","]]]]>"),this.assertLegalChar(I))},l.prototype.comment=function(I){if(this.options.noValidation)return I;if(I=""+I||"",I.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+I);return this.assertLegalChar(I)},l.prototype.raw=function(I){return this.options.noValidation?I:""+I||""},l.prototype.attValue=function(I){return this.options.noValidation?I:this.assertLegalChar(this.attEscape(I=""+I||""))},l.prototype.insTarget=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.insValue=function(I){if(this.options.noValidation)return I;if(I=""+I||"",I.match(/\?>/))throw new Error("Invalid processing instruction value: "+I);return this.assertLegalChar(I)},l.prototype.xmlVersion=function(I){if(this.options.noValidation)return I;if(I=""+I||"",!I.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+I);return I},l.prototype.xmlEncoding=function(I){if(this.options.noValidation)return I;if(I=""+I||"",!I.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+I);return this.assertLegalChar(I)},l.prototype.xmlStandalone=function(I){return this.options.noValidation?I:I?"yes":"no"},l.prototype.dtdPubID=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.dtdSysID=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.dtdElementValue=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.dtdAttType=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.dtdAttDefault=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.dtdEntityValue=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.dtdNData=function(I){return this.options.noValidation?I:this.assertLegalChar(""+I||"")},l.prototype.convertAttKey="@",l.prototype.convertPIKey="?",l.prototype.convertTextKey="#text",l.prototype.convertCDataKey="#cdata",l.prototype.convertCommentKey="#comment",l.prototype.convertRawKey="#raw",l.prototype.assertLegalChar=function(I){var a,c;if(this.options.noValidation)return I;if(a="",this.options.version==="1.0"){if(a=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,c=I.match(a))throw new Error("Invalid character in string: "+I+" at index "+c.index)}else if(this.options.version==="1.1"&&(a=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,c=I.match(a)))throw new Error("Invalid character in string: "+I+" at index "+c.index);return I},l.prototype.assertLegalName=function(I){var a;if(this.options.noValidation)return I;if(this.assertLegalChar(I),a=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!I.match(a))throw new Error("Invalid character in name");return I},l.prototype.textEscape=function(I){var a;return this.options.noValidation?I:(a=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,I.replace(a,"&").replace(//g,">").replace(/\r/g," "))},l.prototype.attEscape=function(I){var a;return this.options.noValidation?I:(a=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,I.replace(a,"&").replace(/{(function(){JZt.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(EZt)});var D1e=f((CZt,LZt)=>{(function(){var t,e,n,l,I,a,c,i,s,r,u,o,d,b,h,Z,N,g={}.hasOwnProperty;N=yg().assign,t=So(),s=EIe(),r=xIe(),n=HIe(),l=QIe(),o=wIe(),b=jIe(),h=OIe(),d=UIe(),u=M1e(),I=JIe(),a=LIe(),c=CIe(),i=kIe(),e=yM(),LZt.exports=Z=function(){function y(X){var v,H,Q;X||(X={}),this.options=X,H=X.writer||{};for(v in H)g.call(H,v)&&(Q=H[v],this["_"+v]=this[v],this[v]=Q)}return y.prototype.filterOptions=function(X){var v,H,Q,L,J,O,U,K;return X||(X={}),X=N({},this.options,X),v={writer:this},v.pretty=X.pretty||!1,v.allowEmpty=X.allowEmpty||!1,v.indent=(H=X.indent)!=null?H:" ",v.newline=(Q=X.newline)!=null?Q:` +`,v.offset=(L=X.offset)!=null?L:0,v.dontPrettyTextNodes=(J=(O=X.dontPrettyTextNodes)!=null?O:X.dontprettytextnodes)!=null?J:0,v.spaceBeforeSlash=(U=(K=X.spaceBeforeSlash)!=null?K:X.spacebeforeslash)!=null?U:"",v.spaceBeforeSlash===!0&&(v.spaceBeforeSlash=" "),v.suppressPrettyCount=0,v.user={},v.state=e.None,v},y.prototype.indent=function(X,v,H){var Q;return!v.pretty||v.suppressPrettyCount?"":v.pretty&&(Q=(H||0)+v.offset+1,Q>0)?new Array(Q).join(v.indent):""},y.prototype.endline=function(X,v,H){return!v.pretty||v.suppressPrettyCount?"":v.newline},y.prototype.attribute=function(X,v,H){var Q;return this.openAttribute(X,v,H),Q=" "+X.name+'="'+X.value+'"',this.closeAttribute(X,v,H),Q},y.prototype.cdata=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+""+this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.comment=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+""+this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.declaration=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+"",Q+=this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.docType=function(X,v,H){var Q,L,J,O,U;if(H||(H=0),this.openNode(X,v,H),v.state=e.OpenTag,O=this.indent(X,v,H),O+="0){for(O+=" [",O+=this.endline(X,v,H),v.state=e.InsideTag,U=X.children,L=0,J=U.length;L",O+=this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),O},y.prototype.element=function(X,v,H){var Q,L,J,O,U,K,D,_,P,le,q,ee,ne,ie;H||(H=0),le=!1,q="",this.openNode(X,v,H),v.state=e.OpenTag,q+=this.indent(X,v,H)+"<"+X.name,ee=X.attribs;for(P in ee)g.call(ee,P)&&(Q=ee[P],q+=this.attribute(Q,v,H));if(J=X.children.length,O=J===0?null:X.children[0],J===0||X.children.every(function(me){return(me.type===t.Text||me.type===t.Raw)&&me.value===""}))v.allowEmpty?(q+=">",v.state=e.CloseTag,q+=""+this.endline(X,v,H)):(v.state=e.CloseTag,q+=v.spaceBeforeSlash+"/>"+this.endline(X,v,H));else if(v.pretty&&J===1&&(O.type===t.Text||O.type===t.Raw)&&O.value!=null)q+=">",v.state=e.InsideTag,v.suppressPrettyCount++,le=!0,q+=this.writeChildNode(O,v,H+1),v.suppressPrettyCount--,le=!1,v.state=e.CloseTag,q+=""+this.endline(X,v,H);else{if(v.dontPrettyTextNodes){for(ne=X.children,U=0,D=ne.length;U"+this.endline(X,v,H),v.state=e.InsideTag,ie=X.children,K=0,_=ie.length;K<_;K++)L=ie[K],q+=this.writeChildNode(L,v,H+1);v.state=e.CloseTag,q+=this.indent(X,v,H)+"",le&&v.suppressPrettyCount--,q+=this.endline(X,v,H),v.state=e.None}return this.closeNode(X,v,H),q},y.prototype.writeChildNode=function(X,v,H){switch(X.type){case t.CData:return this.cdata(X,v,H);case t.Comment:return this.comment(X,v,H);case t.Element:return this.element(X,v,H);case t.Raw:return this.raw(X,v,H);case t.Text:return this.text(X,v,H);case t.ProcessingInstruction:return this.processingInstruction(X,v,H);case t.Dummy:return"";case t.Declaration:return this.declaration(X,v,H);case t.DocType:return this.docType(X,v,H);case t.AttributeDeclaration:return this.dtdAttList(X,v,H);case t.ElementDeclaration:return this.dtdElement(X,v,H);case t.EntityDeclaration:return this.dtdEntity(X,v,H);case t.NotationDeclaration:return this.dtdNotation(X,v,H);default:throw new Error("Unknown XML node type: "+X.constructor.name)}},y.prototype.processingInstruction=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+"",Q+=this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.raw=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H),v.state=e.InsideTag,Q+=X.value,v.state=e.CloseTag,Q+=this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.text=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H),v.state=e.InsideTag,Q+=X.value,v.state=e.CloseTag,Q+=this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.dtdAttList=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+""+this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.dtdElement=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+""+this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.dtdEntity=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+""+this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.dtdNotation=function(X,v,H){var Q;return this.openNode(X,v,H),v.state=e.OpenTag,Q=this.indent(X,v,H)+""+this.endline(X,v,H),v.state=e.None,this.closeNode(X,v,H),Q},y.prototype.openNode=function(X,v,H){},y.prototype.closeNode=function(X,v,H){},y.prototype.openAttribute=function(X,v,H){},y.prototype.closeAttribute=function(X,v,H){},y}()}).call(CZt)});var zIe=f((kZt,xZt)=>{(function(){var t,e,n=function(I,a){for(var c in a)l.call(a,c)&&(I[c]=a[c]);function i(){this.constructor=I}return i.prototype=a.prototype,I.prototype=new i,I.__super__=a.prototype,I},l={}.hasOwnProperty;e=D1e(),xZt.exports=t=function(I){n(a,I);function a(c){a.__super__.constructor.call(this,c)}return a.prototype.document=function(c,i){var s,r,u,o,d;for(i=this.filterOptions(i),o="",d=c.children,r=0,u=d.length;r{(function(){var t,e,n,l,I,a,c,i,s=function(u,o){for(var d in o)r.call(o,d)&&(u[d]=o[d]);function b(){this.constructor=u}return b.prototype=o.prototype,u.prototype=new b,u.__super__=o.prototype,u},r={}.hasOwnProperty;i=yg().isPlainObject,n=B1e(),e=zht(),I=Ch(),t=So(),c=T1e(),a=zIe(),OZt.exports=l=function(u){s(o,u);function o(d){o.__super__.constructor.call(this,null),this.name="#document",this.type=t.Document,this.documentURI=null,this.domConfig=new e,d||(d={}),d.writer||(d.writer=new a),this.options=d,this.stringify=new c(d)}return Object.defineProperty(o.prototype,"implementation",{value:new n}),Object.defineProperty(o.prototype,"doctype",{get:function(){var d,b,h,Z;for(Z=this.children,b=0,h=Z.length;b{(function(){var t,e,n,l,I,a,c,i,s,r,u,o,d,b,h,Z,N,g,y,X,v,H,Q,L,J={}.hasOwnProperty;L=yg(),H=L.isObject,v=L.isFunction,Q=L.isPlainObject,X=L.getValue,t=So(),o=K1e(),b=wIe(),l=HIe(),I=QIe(),Z=jIe(),y=OIe(),h=UIe(),r=EIe(),u=xIe(),a=JIe(),i=CIe(),c=LIe(),s=kIe(),n=S1e(),g=T1e(),N=zIe(),e=yM(),zZt.exports=d=function(){function O(U,K,D){var _;this.name="?xml",this.type=t.Document,U||(U={}),_={},U.writer?Q(U.writer)&&(_=U.writer,U.writer=new N):U.writer=new N,this.options=U,this.writer=U.writer,this.writerOptions=this.writer.filterOptions(_),this.stringify=new g(U),this.onDataCallback=K||function(){},this.onEndCallback=D||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return O.prototype.createChildNode=function(U){var K,D,_,P,le,q,ee,ne;switch(U.type){case t.CData:this.cdata(U.value);break;case t.Comment:this.comment(U.value);break;case t.Element:_={},ee=U.attribs;for(D in ee)J.call(ee,D)&&(K=ee[D],_[D]=K.value);this.node(U.name,_);break;case t.Dummy:this.dummy();break;case t.Raw:this.raw(U.value);break;case t.Text:this.text(U.value);break;case t.ProcessingInstruction:this.instruction(U.target,U.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+U.constructor.name)}for(ne=U.children,le=0,q=ne.length;le=0;)this.up();return this.onEnd()},O.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},O.prototype.openNode=function(U){var K,D,_,P;if(!U.isOpen){if(!this.root&&this.currentLevel===0&&U.type===t.Element&&(this.root=U),D="",U.type===t.Element){this.writerOptions.state=e.OpenTag,D=this.writer.indent(U,this.writerOptions,this.currentLevel)+"<"+U.name,P=U.attribs;for(_ in P)J.call(P,_)&&(K=P[_],D+=this.writer.attribute(K,this.writerOptions,this.currentLevel));D+=(U.children?">":"/>")+this.writer.endline(U,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,D=this.writer.indent(U,this.writerOptions,this.currentLevel)+""),D+=this.writer.endline(U,this.writerOptions,this.currentLevel);return this.onData(D,this.currentLevel),U.isOpen=!0}},O.prototype.closeNode=function(U){var K;if(!U.isClosed)return K="",this.writerOptions.state=e.CloseTag,U.type===t.Element?K=this.writer.indent(U,this.writerOptions,this.currentLevel)+""+this.writer.endline(U,this.writerOptions,this.currentLevel):K=this.writer.indent(U,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(U,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),U.isClosed=!0},O.prototype.onData=function(U,K){return this.documentStarted=!0,this.onDataCallback(U,K+1)},O.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},O.prototype.debugInfo=function(U){return U==null?"":"node: <"+U+">"},O.prototype.ele=function(){return this.element.apply(this,arguments)},O.prototype.nod=function(U,K,D){return this.node(U,K,D)},O.prototype.txt=function(U){return this.text(U)},O.prototype.dat=function(U){return this.cdata(U)},O.prototype.com=function(U){return this.comment(U)},O.prototype.ins=function(U,K){return this.instruction(U,K)},O.prototype.dec=function(U,K,D){return this.declaration(U,K,D)},O.prototype.dtd=function(U,K,D){return this.doctype(U,K,D)},O.prototype.e=function(U,K,D){return this.element(U,K,D)},O.prototype.n=function(U,K,D){return this.node(U,K,D)},O.prototype.t=function(U){return this.text(U)},O.prototype.d=function(U){return this.cdata(U)},O.prototype.c=function(U){return this.comment(U)},O.prototype.r=function(U){return this.raw(U)},O.prototype.i=function(U,K){return this.instruction(U,K)},O.prototype.att=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},O.prototype.a=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},O.prototype.ent=function(U,K){return this.entity(U,K)},O.prototype.pent=function(U,K){return this.pEntity(U,K)},O.prototype.not=function(U,K){return this.notation(U,K)},O}()}).call(UZt)});var TZt=f((SZt,MZt)=>{(function(){var t,e,n,l,I=function(c,i){for(var s in i)a.call(i,s)&&(c[s]=i[s]);function r(){this.constructor=c}return r.prototype=i.prototype,c.prototype=new r,c.__super__=i.prototype,c},a={}.hasOwnProperty;t=So(),l=D1e(),e=yM(),MZt.exports=n=function(c){I(i,c);function i(s,r){this.stream=s,i.__super__.constructor.call(this,r)}return i.prototype.endline=function(s,r,u){return s.isLastRootNode&&r.state===e.CloseTag?"":i.__super__.endline.call(this,s,r,u)},i.prototype.document=function(s,r){var u,o,d,b,h,Z,N,g,y;for(N=s.children,o=d=0,h=N.length;d0){for(this.stream.write(" ["),this.stream.write(this.endline(s,r,u)),r.state=e.InsideTag,h=s.children,d=0,b=h.length;d"),this.stream.write(this.endline(s,r,u)),r.state=e.None,this.closeNode(s,r,u)},i.prototype.element=function(s,r,u){var o,d,b,h,Z,N,g,y,X,v;u||(u=0),this.openNode(s,r,u),r.state=e.OpenTag,this.stream.write(this.indent(s,r,u)+"<"+s.name),X=s.attribs;for(g in X)a.call(X,g)&&(o=X[g],this.attribute(o,r,u));if(b=s.children.length,h=b===0?null:s.children[0],b===0||s.children.every(function(H){return(H.type===t.Text||H.type===t.Raw)&&H.value===""}))r.allowEmpty?(this.stream.write(">"),r.state=e.CloseTag,this.stream.write("")):(r.state=e.CloseTag,this.stream.write(r.spaceBeforeSlash+"/>"));else if(r.pretty&&b===1&&(h.type===t.Text||h.type===t.Raw)&&h.value!=null)this.stream.write(">"),r.state=e.InsideTag,r.suppressPrettyCount++,y=!0,this.writeChildNode(h,r,u+1),r.suppressPrettyCount--,y=!1,r.state=e.CloseTag,this.stream.write("");else{for(this.stream.write(">"+this.endline(s,r,u)),r.state=e.InsideTag,v=s.children,Z=0,N=v.length;Z")}return this.stream.write(this.endline(s,r,u)),r.state=e.None,this.closeNode(s,r,u)},i.prototype.processingInstruction=function(s,r,u){return this.stream.write(i.__super__.processingInstruction.call(this,s,r,u))},i.prototype.raw=function(s,r,u){return this.stream.write(i.__super__.raw.call(this,s,r,u))},i.prototype.text=function(s,r,u){return this.stream.write(i.__super__.text.call(this,s,r,u))},i.prototype.dtdAttList=function(s,r,u){return this.stream.write(i.__super__.dtdAttList.call(this,s,r,u))},i.prototype.dtdElement=function(s,r,u){return this.stream.write(i.__super__.dtdElement.call(this,s,r,u))},i.prototype.dtdEntity=function(s,r,u){return this.stream.write(i.__super__.dtdEntity.call(this,s,r,u))},i.prototype.dtdNotation=function(s,r,u){return this.stream.write(i.__super__.dtdNotation.call(this,s,r,u))},i}(l)}).call(SZt)});var KZt=f((DZt,Bv)=>{(function(){var t,e,n,l,I,a,c,i,s,r;r=yg(),i=r.assign,s=r.isFunction,n=B1e(),l=K1e(),I=BZt(),c=zIe(),a=TZt(),t=So(),e=yM(),Bv.exports.create=function(u,o,d,b){var h,Z;if(u==null)throw new Error("Root element needs a name.");return b=i({},o,d,b),h=new l(b),Z=h.element(u),b.headless||(h.declaration(b),(b.pubID!=null||b.sysID!=null)&&h.dtd(b)),Z},Bv.exports.begin=function(u,o,d){var b;return s(u)&&(b=[u,o],o=b[0],d=b[1],u={}),o?new I(u,o,d):new l(u)},Bv.exports.stringWriter=function(u){return new c(u)},Bv.exports.streamWriter=function(u,o){return new a(u,o)},Bv.exports.implementation=new n,Bv.exports.nodeType=t,Bv.exports.writerState=e}).call(DZt)});var _Zt=f(_1e=>{(function(){"use strict";var t,e,n,l,I,a={}.hasOwnProperty;t=KZt(),e=fIe().defaults,l=function(c){return typeof c=="string"&&(c.indexOf("&")>=0||c.indexOf(">")>=0||c.indexOf("<")>=0)},I=function(c){return""},n=function(c){return c.replace("]]>","]]]]>")},_1e.Builder=function(){function c(i){var s,r,u;this.options={},r=e["0.2"];for(s in r)a.call(r,s)&&(u=r[s],this.options[s]=u);for(s in i)a.call(i,s)&&(u=i[s],this.options[s]=u)}return c.prototype.buildObject=function(i){var s,r,u,o,d;return s=this.options.attrkey,r=this.options.charkey,Object.keys(i).length===1&&this.options.rootName===e["0.2"].rootName?(d=Object.keys(i)[0],i=i[d]):d=this.options.rootName,u=function(b){return function(h,Z){var N,g,y,X,v,H;if(typeof Z!="object")b.options.cdata&&l(Z)?h.raw(I(Z)):h.txt(Z);else if(Array.isArray(Z)){for(X in Z)if(a.call(Z,X)){g=Z[X];for(v in g)y=g[v],h=u(h.ele(v),y).up()}}else for(v in Z)if(a.call(Z,v))if(g=Z[v],v===s){if(typeof g=="object")for(N in g)H=g[N],h=h.att(N,H)}else if(v===r)b.options.cdata&&l(g)?h=h.raw(I(g)):h=h.txt(g);else if(Array.isArray(g))for(X in g)a.call(g,X)&&(y=g[X],typeof y=="string"?b.options.cdata&&l(y)?h=h.ele(v).raw(I(y)).up():h=h.ele(v,y).up():h=u(h.ele(v),y).up());else typeof g=="object"?h=u(h.ele(v),g).up():typeof g=="string"&&b.options.cdata&&l(g)?h=h.ele(v).raw(I(g)).up():(g==null&&(g=""),h=h.ele(v,g.toString()).up());return h}}(this),o=t.create(d,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),u(o,i).end(this.options.renderOpts)},c}()}).call(_1e)});var PZt=f(BIe=>{(function(t){t.parser=function(j,E){return new n(j,E)},t.SAXParser=n,t.SAXStream=r,t.createStream=s,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(j,E){if(!(this instanceof n))return new n(j,E);var S=this;I(S),S.q=S.c="",S.bufferCheckPosition=t.MAX_BUFFER_LENGTH,S.opt=E||{},S.opt.lowercase=S.opt.lowercase||S.opt.lowercasetags,S.looseCase=S.opt.lowercase?"toLowerCase":"toUpperCase",S.tags=[],S.closed=S.closedRoot=S.sawRoot=!1,S.tag=S.error=null,S.strict=!!j,S.noscript=!!(j||S.opt.noscript),S.state=J.BEGIN,S.strictEntities=S.opt.strictEntities,S.ENTITIES=S.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),S.attribList=[],S.opt.xmlns&&(S.ns=Object.create(h)),S.opt.unquotedAttributeValues===void 0&&(S.opt.unquotedAttributeValues=!j),S.trackPosition=S.opt.position!==!1,S.trackPosition&&(S.position=S.line=S.column=0),U(S,"onready")}Object.create||(Object.create=function(j){function E(){}E.prototype=j;var S=new E;return S}),Object.keys||(Object.keys=function(j){var E=[];for(var S in j)j.hasOwnProperty(S)&&E.push(S);return E});function l(j){for(var E=Math.max(t.MAX_BUFFER_LENGTH,10),S=0,m=0,Y=e.length;mE)switch(e[m]){case"textNode":D(j);break;case"cdata":K(j,"oncdata",j.cdata),j.cdata="";break;case"script":K(j,"onscript",j.script),j.script="";break;default:P(j,"Max buffer length exceeded: "+e[m])}S=Math.max(S,R)}var C=t.MAX_BUFFER_LENGTH-S;j.bufferCheckPosition=C+j.position}function I(j){for(var E=0,S=e.length;E"||X(j)}function Q(j,E){return j.test(E)}function L(j,E){return!Q(j,E)}var J=0;t.STATE={BEGIN:J++,BEGIN_WHITESPACE:J++,TEXT:J++,TEXT_ENTITY:J++,OPEN_WAKA:J++,SGML_DECL:J++,SGML_DECL_QUOTED:J++,DOCTYPE:J++,DOCTYPE_QUOTED:J++,DOCTYPE_DTD:J++,DOCTYPE_DTD_QUOTED:J++,COMMENT_STARTING:J++,COMMENT:J++,COMMENT_ENDING:J++,COMMENT_ENDED:J++,CDATA:J++,CDATA_ENDING:J++,CDATA_ENDING_2:J++,PROC_INST:J++,PROC_INST_BODY:J++,PROC_INST_ENDING:J++,OPEN_TAG:J++,OPEN_TAG_SLASH:J++,ATTRIB:J++,ATTRIB_NAME:J++,ATTRIB_NAME_SAW_WHITE:J++,ATTRIB_VALUE:J++,ATTRIB_VALUE_QUOTED:J++,ATTRIB_VALUE_CLOSED:J++,ATTRIB_VALUE_UNQUOTED:J++,ATTRIB_VALUE_ENTITY_Q:J++,ATTRIB_VALUE_ENTITY_U:J++,CLOSE_TAG:J++,CLOSE_TAG_SAW_WHITE:J++,SCRIPT:J++,SCRIPT_ENDING:J++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(j){var E=t.ENTITIES[j],S=typeof E=="number"?String.fromCharCode(E):E;t.ENTITIES[j]=S});for(var O in t.STATE)t.STATE[t.STATE[O]]=O;J=t.STATE;function U(j,E,S){j[E]&&j[E](S)}function K(j,E,S){j.textNode&&D(j),U(j,E,S)}function D(j){j.textNode=_(j.opt,j.textNode),j.textNode&&U(j,"ontext",j.textNode),j.textNode=""}function _(j,E){return j.trim&&(E=E.trim()),j.normalize&&(E=E.replace(/\s+/g," ")),E}function P(j,E){return D(j),j.trackPosition&&(E+=` +Line: `+j.line+` +Column: `+j.column+` +Char: `+j.c),E=new Error(E),j.error=E,U(j,"onerror",E),j}function le(j){return j.sawRoot&&!j.closedRoot&&q(j,"Unclosed root tag"),j.state!==J.BEGIN&&j.state!==J.BEGIN_WHITESPACE&&j.state!==J.TEXT&&P(j,"Unexpected end"),D(j),j.c="",j.closed=!0,U(j,"onend"),n.call(j,j.strict,j.opt),j}function q(j,E){if(typeof j!="object"||!(j instanceof n))throw new Error("bad call to strictFail");j.strict&&P(j,E)}function ee(j){j.strict||(j.tagName=j.tagName[j.looseCase]());var E=j.tags[j.tags.length-1]||j,S=j.tag={name:j.tagName,attributes:{}};j.opt.xmlns&&(S.ns=E.ns),j.attribList.length=0,K(j,"onopentagstart",S)}function ne(j,E){var S=j.indexOf(":"),m=S<0?["",j]:j.split(":"),Y=m[0],R=m[1];return E&&j==="xmlns"&&(Y="xmlns",R=""),{prefix:Y,local:R}}function ie(j){if(j.strict||(j.attribName=j.attribName[j.looseCase]()),j.attribList.indexOf(j.attribName)!==-1||j.tag.attributes.hasOwnProperty(j.attribName)){j.attribName=j.attribValue="";return}if(j.opt.xmlns){var E=ne(j.attribName,!0),S=E.prefix,m=E.local;if(S==="xmlns")if(m==="xml"&&j.attribValue!==d)q(j,"xml: prefix must be bound to "+d+` +Actual: `+j.attribValue);else if(m==="xmlns"&&j.attribValue!==b)q(j,"xmlns: prefix must be bound to "+b+` +Actual: `+j.attribValue);else{var Y=j.tag,R=j.tags[j.tags.length-1]||j;Y.ns===R.ns&&(Y.ns=Object.create(R.ns)),Y.ns[m]=j.attribValue}j.attribList.push([j.attribName,j.attribValue])}else j.tag.attributes[j.attribName]=j.attribValue,K(j,"onattribute",{name:j.attribName,value:j.attribValue});j.attribName=j.attribValue=""}function me(j,E){if(j.opt.xmlns){var S=j.tag,m=ne(j.tagName);S.prefix=m.prefix,S.local=m.local,S.uri=S.ns[m.prefix]||"",S.prefix&&!S.uri&&(q(j,"Unbound namespace prefix: "+JSON.stringify(j.tagName)),S.uri=m.prefix);var Y=j.tags[j.tags.length-1]||j;S.ns&&Y.ns!==S.ns&&Object.keys(S.ns).forEach(function(A){K(j,"onopennamespace",{prefix:A,uri:S.ns[A]})});for(var R=0,C=j.attribList.length;R",j.tagName="",j.state=J.SCRIPT;return}K(j,"onscript",j.script),j.script=""}var E=j.tags.length,S=j.tagName;j.strict||(S=S[j.looseCase]());for(var m=S;E--;){var Y=j.tags[E];if(Y.name!==m)q(j,"Unexpected close tag");else break}if(E<0){q(j,"Unmatched closing tag: "+j.tagName),j.textNode+="",j.state=J.TEXT;return}j.tagName=S;for(var R=j.tags.length;R-- >E;){var C=j.tag=j.tags.pop();j.tagName=j.tag.name,K(j,"onclosetag",j.tagName);var M={};for(var te in C.ns)M[te]=C.ns[te];var ae=j.tags[j.tags.length-1]||j;j.opt.xmlns&&C.ns!==ae.ns&&Object.keys(C.ns).forEach(function(p){var V=C.ns[p];K(j,"onclosenamespace",{prefix:p,uri:V})})}E===0&&(j.closedRoot=!0),j.tagName=j.attribValue=j.attribName="",j.attribList.length=0,j.state=J.TEXT}function Fe(j){var E=j.entity,S=E.toLowerCase(),m,Y="";return j.ENTITIES[E]?j.ENTITIES[E]:j.ENTITIES[S]?j.ENTITIES[S]:(E=S,E.charAt(0)==="#"&&(E.charAt(1)==="x"?(E=E.slice(2),m=parseInt(E,16),Y=m.toString(16)):(E=E.slice(1),m=parseInt(E,10),Y=m.toString(10))),E=E.replace(/^0+/,""),isNaN(m)||Y.toLowerCase()!==E?(q(j,"Invalid character entity"),"&"+j.entity+";"):String.fromCodePoint(m))}function ce(j,E){E==="<"?(j.state=J.OPEN_WAKA,j.startTagPosition=j.position):X(E)||(q(j,"Non-whitespace before first tag."),j.textNode=E,j.state=J.TEXT)}function fe(j,E){var S="";return E"?(K(E,"onsgmldeclaration",E.sgmlDecl),E.sgmlDecl="",E.state=J.TEXT):(v(m)&&(E.state=J.SGML_DECL_QUOTED),E.sgmlDecl+=m);continue;case J.SGML_DECL_QUOTED:m===E.q&&(E.state=J.SGML_DECL,E.q=""),E.sgmlDecl+=m;continue;case J.DOCTYPE:m===">"?(E.state=J.TEXT,K(E,"ondoctype",E.doctype),E.doctype=!0):(E.doctype+=m,m==="["?E.state=J.DOCTYPE_DTD:v(m)&&(E.state=J.DOCTYPE_QUOTED,E.q=m));continue;case J.DOCTYPE_QUOTED:E.doctype+=m,m===E.q&&(E.q="",E.state=J.DOCTYPE);continue;case J.DOCTYPE_DTD:m==="]"?(E.doctype+=m,E.state=J.DOCTYPE):m==="<"?(E.state=J.OPEN_WAKA,E.startTagPosition=E.position):v(m)?(E.doctype+=m,E.state=J.DOCTYPE_DTD_QUOTED,E.q=m):E.doctype+=m;continue;case J.DOCTYPE_DTD_QUOTED:E.doctype+=m,m===E.q&&(E.state=J.DOCTYPE_DTD,E.q="");continue;case J.COMMENT:m==="-"?E.state=J.COMMENT_ENDING:E.comment+=m;continue;case J.COMMENT_ENDING:m==="-"?(E.state=J.COMMENT_ENDED,E.comment=_(E.opt,E.comment),E.comment&&K(E,"oncomment",E.comment),E.comment=""):(E.comment+="-"+m,E.state=J.COMMENT);continue;case J.COMMENT_ENDED:m!==">"?(q(E,"Malformed comment"),E.comment+="--"+m,E.state=J.COMMENT):E.doctype&&E.doctype!==!0?E.state=J.DOCTYPE_DTD:E.state=J.TEXT;continue;case J.CDATA:m==="]"?E.state=J.CDATA_ENDING:E.cdata+=m;continue;case J.CDATA_ENDING:m==="]"?E.state=J.CDATA_ENDING_2:(E.cdata+="]"+m,E.state=J.CDATA);continue;case J.CDATA_ENDING_2:m===">"?(E.cdata&&K(E,"oncdata",E.cdata),K(E,"onclosecdata"),E.cdata="",E.state=J.TEXT):m==="]"?E.cdata+="]":(E.cdata+="]]"+m,E.state=J.CDATA);continue;case J.PROC_INST:m==="?"?E.state=J.PROC_INST_ENDING:X(m)?E.state=J.PROC_INST_BODY:E.procInstName+=m;continue;case J.PROC_INST_BODY:if(!E.procInstBody&&X(m))continue;m==="?"?E.state=J.PROC_INST_ENDING:E.procInstBody+=m;continue;case J.PROC_INST_ENDING:m===">"?(K(E,"onprocessinginstruction",{name:E.procInstName,body:E.procInstBody}),E.procInstName=E.procInstBody="",E.state=J.TEXT):(E.procInstBody+="?"+m,E.state=J.PROC_INST_BODY);continue;case J.OPEN_TAG:Q(N,m)?E.tagName+=m:(ee(E),m===">"?me(E):m==="/"?E.state=J.OPEN_TAG_SLASH:(X(m)||q(E,"Invalid character in tag name"),E.state=J.ATTRIB));continue;case J.OPEN_TAG_SLASH:m===">"?(me(E,!0),Ze(E)):(q(E,"Forward-slash in opening tag not followed by >"),E.state=J.ATTRIB);continue;case J.ATTRIB:if(X(m))continue;m===">"?me(E):m==="/"?E.state=J.OPEN_TAG_SLASH:Q(Z,m)?(E.attribName=m,E.attribValue="",E.state=J.ATTRIB_NAME):q(E,"Invalid attribute name");continue;case J.ATTRIB_NAME:m==="="?E.state=J.ATTRIB_VALUE:m===">"?(q(E,"Attribute without value"),E.attribValue=E.attribName,ie(E),me(E)):X(m)?E.state=J.ATTRIB_NAME_SAW_WHITE:Q(N,m)?E.attribName+=m:q(E,"Invalid attribute name");continue;case J.ATTRIB_NAME_SAW_WHITE:if(m==="=")E.state=J.ATTRIB_VALUE;else{if(X(m))continue;q(E,"Attribute without value"),E.tag.attributes[E.attribName]="",E.attribValue="",K(E,"onattribute",{name:E.attribName,value:""}),E.attribName="",m===">"?me(E):Q(Z,m)?(E.attribName=m,E.state=J.ATTRIB_NAME):(q(E,"Invalid attribute name"),E.state=J.ATTRIB)}continue;case J.ATTRIB_VALUE:if(X(m))continue;v(m)?(E.q=m,E.state=J.ATTRIB_VALUE_QUOTED):(E.opt.unquotedAttributeValues||P(E,"Unquoted attribute value"),E.state=J.ATTRIB_VALUE_UNQUOTED,E.attribValue=m);continue;case J.ATTRIB_VALUE_QUOTED:if(m!==E.q){m==="&"?E.state=J.ATTRIB_VALUE_ENTITY_Q:E.attribValue+=m;continue}ie(E),E.q="",E.state=J.ATTRIB_VALUE_CLOSED;continue;case J.ATTRIB_VALUE_CLOSED:X(m)?E.state=J.ATTRIB:m===">"?me(E):m==="/"?E.state=J.OPEN_TAG_SLASH:Q(Z,m)?(q(E,"No whitespace between attributes"),E.attribName=m,E.attribValue="",E.state=J.ATTRIB_NAME):q(E,"Invalid attribute name");continue;case J.ATTRIB_VALUE_UNQUOTED:if(!H(m)){m==="&"?E.state=J.ATTRIB_VALUE_ENTITY_U:E.attribValue+=m;continue}ie(E),m===">"?me(E):E.state=J.ATTRIB;continue;case J.CLOSE_TAG:if(E.tagName)m===">"?Ze(E):Q(N,m)?E.tagName+=m:E.script?(E.script+=""?Ze(E):q(E,"Invalid characters in closing tag");continue;case J.TEXT_ENTITY:case J.ATTRIB_VALUE_ENTITY_Q:case J.ATTRIB_VALUE_ENTITY_U:var C,M;switch(E.state){case J.TEXT_ENTITY:C=J.TEXT,M="textNode";break;case J.ATTRIB_VALUE_ENTITY_Q:C=J.ATTRIB_VALUE_QUOTED,M="attribValue";break;case J.ATTRIB_VALUE_ENTITY_U:C=J.ATTRIB_VALUE_UNQUOTED,M="attribValue";break}if(m===";"){var te=Fe(E);E.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(te)?(E.entity="",E.state=C,E.write(te)):(E[M]+=te,E.entity="",E.state=C)}else Q(E.entity.length?y:g,m)?E.entity+=m:(q(E,"Invalid character in entity name"),E[M]+="&"+E.entity+m,E.entity="",E.state=C);continue;default:throw new Error(E,"Unknown state: "+E.state)}return E.position>=E.bufferCheckPosition&&l(E),E}String.fromCodePoint||function(){var j=String.fromCharCode,E=Math.floor,S=function(){var m=16384,Y=[],R,C,M=-1,te=arguments.length;if(!te)return"";for(var ae="";++M1114111||E(p)!==p)throw RangeError("Invalid code point: "+p);p<=65535?Y.push(p):(p-=65536,R=(p>>10)+55296,C=p%1024+56320,Y.push(R,C)),(M+1===te||Y.length>m)&&(ae+=j.apply(null,Y),Y.length=0)}return ae};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:S,configurable:!0,writable:!0}):String.fromCodePoint=S}()})(typeof BIe>"u"?BIe.sax={}:BIe)});var qZt=f(P1e=>{(function(){"use strict";P1e.stripBOM=function(t){return t[0]==="\uFEFF"?t.substring(1):t}}).call(P1e)});var q1e=f(uE=>{(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),uE.normalize=function(e){return e.toLowerCase()},uE.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},uE.stripPrefix=function(e){return e.replace(t,"")},uE.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},uE.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(uE)});var $Zt=f(WA=>{(function(){"use strict";var t,e,n,l,I,a,c,i,s=function(o,d){return function(){return o.apply(d,arguments)}},r=function(o,d){for(var b in d)u.call(d,b)&&(o[b]=d[b]);function h(){this.constructor=o}return h.prototype=d.prototype,o.prototype=new h,o.__super__=d.prototype,o},u={}.hasOwnProperty;c=PZt(),n=require("events"),t=qZt(),a=q1e(),i=require("timers").setImmediate,e=fIe().defaults,l=function(o){return typeof o=="object"&&o!=null&&Object.keys(o).length===0},I=function(o,d,b){var h,Z,N;for(h=0,Z=o.length;h0&&(H[g.options.childkey]=L),L=H;else if(U){U[g.options.childkey]=U[g.options.childkey]||[],J=Object.create(null);for(v in L)u.call(L,v)&&(J[v]=L[v]);U[g.options.childkey].push(J),delete L["#name"],Object.keys(L).length===1&&h in L&&!g.EXPLICIT_CHARKEY&&(L=L[h])}}return N.length>0?g.assignOrPush(U,Q,L):(g.options.explicitRoot&&(O=L,L=Object.create(null),L[Q]=O),g.resultObject=L,g.saxParser.ended=!0,g.emit("end",g.resultObject))}}(this),Z=function(g){return function(y){var X,v;if(v=N[N.length-1],v)return v[h]+=y,g.options.explicitChildren&&g.options.preserveChildrenOrder&&g.options.charsAsChildren&&(g.options.includeWhiteChars||y.replace(/\\n/g,"").trim()!=="")&&(v[g.options.childkey]=v[g.options.childkey]||[],X={"#name":"__text__"},X[h]=y,g.options.normalize&&(X[h]=X[h].replace(/\s{2,}/g," ").trim()),v[g.options.childkey].push(X)),v}}(this),this.saxParser.ontext=Z,this.saxParser.oncdata=function(g){return function(y){var X;if(X=Z(y),X)return X.cdata=!0}}(this)},d.prototype.parseString=function(b,h){var Z;h!=null&&typeof h=="function"&&(this.on("end",function(N){return this.reset(),h(null,N)}),this.on("error",function(N){return this.reset(),h(N)}));try{return b=b.toString(),b.trim()===""?(this.emit("end",null),!0):(b=t.stripBOM(b),this.options.async?(this.remaining=b,i(this.processAsync),this.saxParser):this.saxParser.write(b).close())}catch(N){if(Z=N,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw Z}else return this.emit("error",Z),this.saxParser.errThrown=!0}},d.prototype.parseStringPromise=function(b){return new Promise(function(h){return function(Z,N){return h.parseString(b,function(g,y){return g?N(g):Z(y)})}}(this))},d}(n),WA.parseString=function(o,d,b){var h,Z,N;return b!=null?(typeof b=="function"&&(h=b),typeof d=="object"&&(Z=d)):(typeof d=="function"&&(h=d),Z={}),N=new WA.Parser(Z),N.parseString(o,h)},WA.parseStringPromise=function(o,d){var b,h;return typeof d=="object"&&(b=d),h=new WA.Parser(b),h.parseStringPromise(o)}}).call(WA)});var $1e=f(NA=>{(function(){"use strict";var t,e,n,l,I=function(c,i){for(var s in i)a.call(i,s)&&(c[s]=i[s]);function r(){this.constructor=c}return r.prototype=i.prototype,c.prototype=new r,c.__super__=i.prototype,c},a={}.hasOwnProperty;e=fIe(),t=_Zt(),n=$Zt(),l=q1e(),NA.defaults=e.defaults,NA.processors=l,NA.ValidationError=function(c){I(i,c);function i(s){this.message=s}return i}(Error),NA.Builder=t.Builder,NA.Parser=n.Parser,NA.parseString=n.parseString,NA.parseStringPromise=n.parseStringPromise}).call(NA)});var nWt=f((qAa,tWt)=>{var SIe=tWt.exports={};SIe.feed=[["author","creator"],["dc:publisher","publisher"],["dc:creator","creator"],["dc:source","source"],["dc:title","title"],["dc:type","type"],"title","description","author","pubDate","webMaster","managingEditor","generator","link","language","copyright","lastBuildDate","docs","generator","ttl","rating","skipHours","skipDays"];SIe.item=[["author","creator"],["dc:creator","creator"],["dc:date","date"],["dc:language","language"],["dc:rights","rights"],["dc:source","source"],["dc:title","title"],"title","link","pubDate","author","summary",["content:encoded","content:encoded",{includeSnippet:!0}],"enclosure","dc:creator","dc:date","comments"];var eWt=function(t){return["itunes:"+t,t]};SIe.podcastFeed=["author","subtitle","summary","explicit"].map(eWt);SIe.podcastItem=["author","subtitle","summary","explicit","duration","image","episode","image","season","keywords","episodeType"].map(eWt)});var MIe=f(($Aa,i_n)=>{i_n.exports={Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",amp:"&",AMP:"&",andand:"\u2A55",And:"\u2A53",and:"\u2227",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angmsd:"\u2221",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",apacir:"\u2A6F",ap:"\u2248",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsolb:"\u29C5",bsol:"\\",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",cap:"\u2229",Cap:"\u22D2",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25CB",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cup:"\u222A",Cup:"\u22D3",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21A1",dArr:"\u21D3",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21CA",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21D3",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21BD",DownRightTeeVector:"\u295F",DownRightVectorBar:"\u2957",DownRightVector:"\u21C1",DownTeeArrow:"\u21A7",DownTee:"\u22A4",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",Ecirc:"\xCA",ecirc:"\xEA",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",gescc:"\u2AA9",ges:"\u2A7E",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2AA5",gl:"\u2277",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gt:">",GT:">",Gt:"\u226B",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",harrcir:"\u2948",harr:"\u2194",hArr:"\u21D4",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",incare:"\u2105",in:"\u2208",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",intcal:"\u22BA",int:"\u222B",Int:"\u222C",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larrb:"\u21E4",larrbfs:"\u291F",larr:"\u2190",Larr:"\u219E",lArr:"\u21D0",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",latail:"\u2919",lAtail:"\u291B",lat:"\u2AAB",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",LeftArrowBar:"\u21E4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21D0",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21C3",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTeeArrow:"\u21A4",LeftTee:"\u22A3",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangleBar:"\u29CF",LeftTriangle:"\u22B2",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21BF",LeftVectorBar:"\u2952",LeftVector:"\u21BC",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",lescc:"\u2AA8",les:"\u2A7D",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21C7",ll:"\u226A",Ll:"\u22D8",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoustache:"\u23B0",lmoust:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftrightarrow:"\u27F7",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longmapsto:"\u27FC",longrightarrow:"\u27F6",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",lt:"<",LT:"<",Lt:"\u226A",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midast:"*",midcir:"\u2AF0",mid:"\u2223",middot:"\xB7",minusb:"\u229F",minus:"\u2212",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266E",naturals:"\u2115",natur:"\u266E",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangle:"\u22EB",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",nprec:"\u2280",npreceq:"\u2AAF\u0338",npre:"\u2AAF\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",Ocirc:"\xD4",ocirc:"\xF4",ocir:"\u229A",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",orarr:"\u21BB",Or:"\u2A54",or:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",otimesas:"\u2A36",Otimes:"\u2A37",otimes:"\u2297",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",para:"\xB6",parallel:"\u2225",par:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plus:"+",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",prap:"\u2AB7",Pr:"\u2ABB",pr:"\u227A",prcue:"\u227C",precapprox:"\u2AB7",prec:"\u227A",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",pre:"\u2AAF",prE:"\u2AB3",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportional:"\u221D",Proportion:"\u2237",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21A0",rArr:"\u21D2",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",Re:"\u211C",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrowBar:"\u21E5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21D2",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVectorBar:"\u2955",RightDownVector:"\u21C2",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTeeArrow:"\u21A6",RightTee:"\u22A2",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangleBar:"\u29D0",RightTriangle:"\u22B3",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVectorBar:"\u2954",RightUpVector:"\u21BE",RightVectorBar:"\u2953",RightVector:"\u21C0",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoustache:"\u23B1",rmoust:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2ABC",sc:"\u227B",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdotb:"\u22A1",sdot:"\u22C5",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",solbar:"\u233F",solb:"\u29C4",sol:"/",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squ:"\u25A1",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succapprox:"\u2AB8",succ:"\u227B",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",Sup:"\u22D1",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2A31",timesb:"\u22A0",times:"\xD7",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",topbot:"\u2336",topcir:"\u2AF1",top:"\u22A4",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",uarr:"\u2191",Uarr:"\u219F",uArr:"\u21D1",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21D1",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21D5",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTeeArrow:"\u21A5",UpTee:"\u22A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",veebar:"\u22BB",vee:"\u2228",Vee:"\u22C1",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xharr:"\u27F7",xhArr:"\u27FA",Xi:"\u039E",xi:"\u03BE",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",yuml:"\xFF",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",zfr:"\u{1D537}",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});var eJe=f((e0a,s_n)=>{s_n.exports={Aacute:"\xC1",aacute:"\xE1",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",AElig:"\xC6",aelig:"\xE6",Agrave:"\xC0",agrave:"\xE0",amp:"&",AMP:"&",Aring:"\xC5",aring:"\xE5",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",brvbar:"\xA6",Ccedil:"\xC7",ccedil:"\xE7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",Eacute:"\xC9",eacute:"\xE9",Ecirc:"\xCA",ecirc:"\xEA",Egrave:"\xC8",egrave:"\xE8",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",Iacute:"\xCD",iacute:"\xED",Icirc:"\xCE",icirc:"\xEE",iexcl:"\xA1",Igrave:"\xCC",igrave:"\xEC",iquest:"\xBF",Iuml:"\xCF",iuml:"\xEF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",Ntilde:"\xD1",ntilde:"\xF1",Oacute:"\xD3",oacute:"\xF3",Ocirc:"\xD4",ocirc:"\xF4",Ograve:"\xD2",ograve:"\xF2",ordf:"\xAA",ordm:"\xBA",Oslash:"\xD8",oslash:"\xF8",Otilde:"\xD5",otilde:"\xF5",Ouml:"\xD6",ouml:"\xF6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",THORN:"\xDE",thorn:"\xFE",times:"\xD7",Uacute:"\xDA",uacute:"\xFA",Ucirc:"\xDB",ucirc:"\xFB",Ugrave:"\xD9",ugrave:"\xF9",uml:"\xA8",Uuml:"\xDC",uuml:"\xFC",Yacute:"\xDD",yacute:"\xFD",yen:"\xA5",yuml:"\xFF"}});var TIe=f((t0a,u_n)=>{u_n.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}});var lWt=f((n0a,d_n)=>{d_n.exports={"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}});var tJe=f(AM=>{"use strict";var G_n=AM&&AM.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(AM,"__esModule",{value:!0});var IWt=G_n(lWt()),b_n=String.fromCodePoint||function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function m_n(t){return t>=55296&&t<=57343||t>1114111?"\uFFFD":(t in IWt.default&&(t=IWt.default[t]),b_n(t))}AM.default=m_n});var lJe=f(Ag=>{"use strict";var DIe=Ag&&Ag.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ag,"__esModule",{value:!0});Ag.decodeHTML=Ag.decodeHTMLStrict=Ag.decodeXML=void 0;var nJe=DIe(MIe()),p_n=DIe(eJe()),h_n=DIe(TIe()),aWt=DIe(tJe()),Z_n=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;Ag.decodeXML=cWt(h_n.default);Ag.decodeHTMLStrict=cWt(nJe.default);function cWt(t){var e=oWt(t);return function(n){return String(n).replace(Z_n,e)}}var rWt=function(t,e){return t{"use strict";var iWt=ip&&ip.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ip,"__esModule",{value:!0});ip.escapeUTF8=ip.escape=ip.encodeNonAsciiHTML=ip.encodeHTML=ip.encodeXML=void 0;var W_n=iWt(TIe()),sWt=dWt(W_n.default),uWt=GWt(sWt);ip.encodeXML=pWt(sWt);var N_n=iWt(MIe()),IJe=dWt(N_n.default),V_n=GWt(IJe);ip.encodeHTML=g_n(IJe,V_n);ip.encodeNonAsciiHTML=pWt(IJe);function dWt(t){return Object.keys(t).sort().reduce(function(e,n){return e[t[n]]="&"+n+";",e},{})}function GWt(t){for(var e=[],n=[],l=0,I=Object.keys(t);l1?Y_n(t):t.charCodeAt(0)).toString(16).toUpperCase()+";"}function g_n(t,e){return function(n){return n.replace(e,function(l){return t[l]}).replace(bWt,KIe)}}var mWt=new RegExp(uWt.source+"|"+bWt.source,"g");function R_n(t){return t.replace(mWt,KIe)}ip.escape=R_n;function y_n(t){return t.replace(uWt,KIe)}ip.escapeUTF8=y_n;function pWt(t){return function(e){return e.replace(mWt,function(n){return t[n]||KIe(n)})}}});var PIe=f(II=>{"use strict";Object.defineProperty(II,"__esModule",{value:!0});II.decodeXMLStrict=II.decodeHTML5Strict=II.decodeHTML4Strict=II.decodeHTML5=II.decodeHTML4=II.decodeHTMLStrict=II.decodeHTML=II.decodeXML=II.encodeHTML5=II.encodeHTML4=II.escapeUTF8=II.escape=II.encodeNonAsciiHTML=II.encodeHTML=II.encodeXML=II.encode=II.decodeStrict=II.decode=void 0;var _Ie=lJe(),hWt=aJe();function A_n(t,e){return(!e||e<=0?_Ie.decodeXML:_Ie.decodeHTML)(t)}II.decode=A_n;function F_n(t,e){return(!e||e<=0?_Ie.decodeXML:_Ie.decodeHTMLStrict)(t)}II.decodeStrict=F_n;function v_n(t,e){return(!e||e<=0?hWt.encodeXML:hWt.encodeHTML)(t)}II.encode=v_n;var dE=aJe();Object.defineProperty(II,"encodeXML",{enumerable:!0,get:function(){return dE.encodeXML}});Object.defineProperty(II,"encodeHTML",{enumerable:!0,get:function(){return dE.encodeHTML}});Object.defineProperty(II,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return dE.encodeNonAsciiHTML}});Object.defineProperty(II,"escape",{enumerable:!0,get:function(){return dE.escape}});Object.defineProperty(II,"escapeUTF8",{enumerable:!0,get:function(){return dE.escapeUTF8}});Object.defineProperty(II,"encodeHTML4",{enumerable:!0,get:function(){return dE.encodeHTML}});Object.defineProperty(II,"encodeHTML5",{enumerable:!0,get:function(){return dE.encodeHTML}});var Sv=lJe();Object.defineProperty(II,"decodeXML",{enumerable:!0,get:function(){return Sv.decodeXML}});Object.defineProperty(II,"decodeHTML",{enumerable:!0,get:function(){return Sv.decodeHTML}});Object.defineProperty(II,"decodeHTMLStrict",{enumerable:!0,get:function(){return Sv.decodeHTMLStrict}});Object.defineProperty(II,"decodeHTML4",{enumerable:!0,get:function(){return Sv.decodeHTML}});Object.defineProperty(II,"decodeHTML5",{enumerable:!0,get:function(){return Sv.decodeHTML}});Object.defineProperty(II,"decodeHTML4Strict",{enumerable:!0,get:function(){return Sv.decodeHTMLStrict}});Object.defineProperty(II,"decodeHTML5Strict",{enumerable:!0,get:function(){return Sv.decodeHTMLStrict}});Object.defineProperty(II,"decodeXMLStrict",{enumerable:!0,get:function(){return Sv.decodeXML}})});var WWt=f((c0a,ZWt)=>{var VA=ZWt.exports={},f_n=PIe(),X_n=$1e();VA.stripHtml=function(t){return t=t.replace(/([^\n])<\/?(h|br|p|ul|ol|li|blockquote|section|table|tr|div)(?:.|\n)*?>([^\n])/gm,`$1 +$3`),t=t.replace(/<(?:.|\n)*?>/gm,""),t};VA.getSnippet=function(t){return f_n.decodeHTML(VA.stripHtml(t)).trim()};VA.getLink=function(t,e,n){if(t){for(let l=0;l2&&(c=l[2]));let{keepArray:i,includeSnippet:s}=c;t[I]!==void 0&&(e[a]=i?t[I]:t[I][0]),e[a]&&typeof e[a]._=="string"&&(e[a]=e[a]._),s&&e[a]&&typeof e[a]=="string"&&(e[a+"Snippet"]=VA.getSnippet(e[a]))})};VA.maybePromisify=function(t,e){return t?e.then(n=>setTimeout(()=>t(null,n)),n=>setTimeout(()=>t(n))):e};var w_n="utf8",H_n=/(encoding|charset)\s*=\s*(\S+)/,Q_n=["ascii","utf8","utf16le","ucs2","base64","latin1","binary","hex"],E_n={"utf-8":"utf8","iso-8859-1":"latin1"};VA.getEncodingFromContentType=function(t){t=t||"";let n=(t.match(H_n)||[])[2]||"";return n=n.toLowerCase(),n=E_n[n]||n,(!n||Q_n.indexOf(n)===-1)&&(n=w_n),n}});var YWt=f((o0a,VWt)=>{"use strict";var J_n=require("http"),C_n=require("https"),L_n=$1e(),NWt=require("url"),qIe=nWt(),NG=WWt(),k_n={"User-Agent":"rss-parser",Accept:"application/rss+xml"},x_n=5,j_n=6e4,rJe=class{constructor(e={}){e.headers=e.headers||{},e.xml2js=e.xml2js||{},e.customFields=e.customFields||{},e.customFields.item=e.customFields.item||[],e.customFields.feed=e.customFields.feed||[],e.requestOptions=e.requestOptions||{},e.maxRedirects||(e.maxRedirects=x_n),e.timeout||(e.timeout=j_n),this.options=e,this.xmlParser=new L_n.Parser(this.options.xml2js)}parseString(e,n){let l=new Promise((I,a)=>{this.xmlParser.parseString(e,(c,i)=>{if(c)return a(c);if(!i)return a(new Error("Unable to parse XML."));let s=null;if(i.feed)s=this.buildAtomFeed(i);else if(i.rss&&i.rss.$&&i.rss.$.version&&i.rss.$.version.match(/^2/))s=this.buildRSS2(i);else if(i["rdf:RDF"])s=this.buildRSS1(i);else if(i.rss&&i.rss.$&&i.rss.$.version&&i.rss.$.version.match(/0\.9/))s=this.buildRSS0_9(i);else if(i.rss&&this.options.defaultRSS)switch(this.options.defaultRSS){case .9:s=this.buildRSS0_9(i);break;case 1:s=this.buildRSS1(i);break;case 2:s=this.buildRSS2(i);break;default:return a(new Error("default RSS version not recognized."))}else return a(new Error("Feed not recognized as RSS 1 or 2."));I(s)})});return l=NG.maybePromisify(n,l),l}parseURL(e,n,l=0){let I="",a=e.indexOf("https")===0?C_n.get:J_n.get,c=NWt.parse(e),i=Object.assign({},k_n,this.options.headers),s=null,r=new Promise((u,o)=>{let d=Object.assign({headers:i},c,this.options.requestOptions);a(d,h=>{if(this.options.maxRedirects&&h.statusCode>=300&&h.statusCode<400&&h.headers.location){if(l===this.options.maxRedirects)return o(new Error("Too many redirects"));{let N=NWt.resolve(e,h.headers.location);return this.parseURL(N,null,l+1).then(u,o)}}else if(h.statusCode>=300)return o(new Error("Status code "+h.statusCode));let Z=NG.getEncodingFromContentType(h.headers["content-type"]);h.setEncoding(Z),h.on("data",N=>{I+=N}),h.on("end",()=>this.parseString(I).then(u,o))}).on("error",o),s=setTimeout(()=>o(new Error("Request timed out after "+this.options.timeout+"ms")),this.options.timeout)}).then(u=>(clearTimeout(s),Promise.resolve(u)),u=>(clearTimeout(s),Promise.reject(u)));return r=NG.maybePromisify(n,r),r}buildAtomFeed(e){let n={items:[]};if(NG.copyFromXML(e.feed,n,this.options.customFields.feed),e.feed.link&&(n.link=NG.getLink(e.feed.link,"alternate",0),n.feedUrl=NG.getLink(e.feed.link,"self",1)),e.feed.title){let l=e.feed.title[0]||"";l._&&(l=l._),l&&(n.title=l)}return e.feed.updated&&(n.lastBuildDate=e.feed.updated[0]),n.items=(e.feed.entry||[]).map(l=>this.parseItemAtom(l)),n}parseItemAtom(e){let n={};if(NG.copyFromXML(e,n,this.options.customFields.item),e.title){let l=e.title[0]||"";l._&&(l=l._),l&&(n.title=l)}return e.link&&e.link.length&&(n.link=NG.getLink(e.link,"alternate",0)),e.published&&e.published.length&&e.published[0].length&&(n.pubDate=new Date(e.published[0]).toISOString()),!n.pubDate&&e.updated&&e.updated.length&&e.updated[0].length&&(n.pubDate=new Date(e.updated[0]).toISOString()),e.author&&e.author.length&&e.author[0].name&&e.author[0].name.length&&(n.author=e.author[0].name[0]),e.content&&e.content.length&&(n.content=NG.getContent(e.content[0]),n.contentSnippet=NG.getSnippet(n.content)),e.summary&&e.summary.length&&(n.summary=NG.getContent(e.summary[0])),e.id&&(n.id=e.id[0]),this.setISODate(n),n}buildRSS0_9(e){var n=e.rss.channel[0],l=n.item;return this.buildRSS(n,l)}buildRSS1(e){e=e["rdf:RDF"];let n=e.channel[0],l=e.item;return this.buildRSS(n,l)}buildRSS2(e){let n=e.rss.channel[0],l=n.item,I=this.buildRSS(n,l);return e.rss.$&&e.rss.$["xmlns:itunes"]&&this.decorateItunes(I,n),I}buildRSS(e,n){n=n||[];let l={items:[]},I=qIe.feed.concat(this.options.customFields.feed),a=qIe.item.concat(this.options.customFields.item);if(e["atom:link"]&&e["atom:link"][0]&&e["atom:link"][0].$&&(l.feedUrl=e["atom:link"][0].$.href),e.image&&e.image[0]&&e.image[0].url){l.image={};let i=e.image[0];i.link&&(l.image.link=i.link[0]),i.url&&(l.image.url=i.url[0]),i.title&&(l.image.title=i.title[0]),i.width&&(l.image.width=i.width[0]),i.height&&(l.image.height=i.height[0])}let c=this.generatePaginationLinks(e);return Object.keys(c).length&&(l.paginationLinks=c),NG.copyFromXML(e,l,I),l.items=n.map(i=>this.parseItemRss(i,a)),l}parseItemRss(e,n){let l={};return NG.copyFromXML(e,l,n),e.enclosure&&(l.enclosure=e.enclosure[0].$),e.description&&(l.content=NG.getContent(e.description[0]),l.contentSnippet=NG.getSnippet(l.content)),e.guid&&(l.guid=e.guid[0],l.guid._&&(l.guid=l.guid._)),e.$&&e.$["rdf:about"]&&(l["rdf:about"]=e.$["rdf:about"]),e.category&&(l.categories=e.category),this.setISODate(l),l}decorateItunes(e,n){let l=n.item||[],I=[];if(e.itunes={},n["itunes:owner"]){let a={};n["itunes:owner"][0]["itunes:name"]&&(a.name=n["itunes:owner"][0]["itunes:name"][0]),n["itunes:owner"][0]["itunes:email"]&&(a.email=n["itunes:owner"][0]["itunes:email"][0]),e.itunes.owner=a}if(n["itunes:image"]){let a;a=n["itunes:image"][0]&&n["itunes:image"][0].$&&n["itunes:image"][0].$.href?n["itunes:image"][0].$.href:null,a&&(e.itunes.image=a)}if(n["itunes:category"]){let a=n["itunes:category"].map(c=>({name:c&&c.$&&c.$.text,subs:c["itunes:category"]?c["itunes:category"].map(i=>({name:i&&i.$&&i.$.text})):null}));e.itunes.categories=a.map(c=>c.name),e.itunes.categoriesWithSubs=a}if(n["itunes:keywords"])if(n["itunes:keywords"].length>1)e.itunes.keywords=n["itunes:keywords"].map(a=>a&&a.$&&a.$.text);else{let a=n["itunes:keywords"][0];a&&typeof a._=="string"&&(a=a._),a&&a.$&&a.$.text?e.itunes.keywords=a.$.text.split(","):typeof a=="string"&&(e.itunes.keywords=a.split(","))}NG.copyFromXML(n,e.itunes,qIe.podcastFeed),l.forEach((a,c)=>{let i=e.items[c];i.itunes={},NG.copyFromXML(a,i.itunes,qIe.podcastItem);let s=a["itunes:image"];s&&s[0]&&s[0].$&&s[0].$.href&&(i.itunes.image=s[0].$.href)})}setISODate(e){let n=e.pubDate||e.date;if(n)try{e.isoDate=new Date(n.trim()).toISOString()}catch{}}generatePaginationLinks(e){if(!e["atom:link"])return{};let n=["self","first","next","prev","last"];return e["atom:link"].reduce((l,I)=>(!I.$||!n.includes(I.$.rel)||(l[I.$.rel]=I.$.href),l),{})}};VWt.exports=rJe});var RWt=f((i0a,gWt)=>{"use strict";gWt.exports=YWt()});var Mv=f((F0a,OWt)=>{var z_n="Expected a function",QWt="__lodash_hash_undefined__",EWt=1/0,B_n=9007199254740991,S_n="[object Function]",M_n="[object GeneratorFunction]",T_n="[object Symbol]",D_n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K_n=/^\w*$/,__n=/^\./,P_n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q_n=/[\\^$.*+?()[\]{}|]/g,$_n=/\\(\\)?/g,ePn=/^\[object .+?Constructor\]$/,tPn=/^(?:0|[1-9]\d*)$/,nPn=typeof global=="object"&&global&&global.Object===Object&&global,lPn=typeof self=="object"&&self&&self.Object===Object&&self,sJe=nPn||lPn||Function("return this")();function IPn(t,e){return t?.[e]}function aPn(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var rPn=Array.prototype,cPn=Function.prototype,JWt=Object.prototype,iJe=sJe["__core-js_shared__"],fWt=function(){var t=/[^.]+$/.exec(iJe&&iJe.keys&&iJe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),CWt=cPn.toString,tae=JWt.hasOwnProperty,LWt=JWt.toString,oPn=RegExp("^"+CWt.call(tae).replace(q_n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),XWt=sJe.Symbol,iPn=rPn.splice,sPn=kWt(sJe,"Map"),XM=kWt(Object,"create"),wWt=XWt?XWt.prototype:void 0,HWt=wWt?wWt.toString:void 0;function GE(t){var e=-1,n=t?t.length:0;for(this.clear();++e-1}function NPn(t,e){var n=this.__data__,l=nae(n,t);return l<0?n.push([t,e]):n[l][1]=e,this}Gx.prototype.clear=pPn;Gx.prototype.delete=hPn;Gx.prototype.get=ZPn;Gx.prototype.has=WPn;Gx.prototype.set=NPn;function bE(t){var e=-1,n=t?t.length:0;for(this.clear();++e-1&&t%1==0&&t{var UPn=app.vault.adapter.fsPromises,zPn={...UPn,isUsingObsidian:!0};UWt.exports=zPn});var SWt=f((Q0a,BWt)=>{"use strict";function Fg(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function zWt(t,e){for(var n="",l=0,I=-1,a=0,c,i=0;i<=t.length;++i){if(i2){var s=n.lastIndexOf("/");if(s!==n.length-1){s===-1?(n="",l=0):(n=n.slice(0,s),l=n.length-1-n.lastIndexOf("/")),I=i,a=0;continue}}else if(n.length===2||n.length===1){n="",l=0,I=i,a=0;continue}}e&&(n.length>0?n+="/..":n="..",l=2)}else n.length>0?n+="/"+t.slice(I+1,i):n=t.slice(I+1,i),l=i-I-1;I=i,a=0}else c===46&&a!==-1?++a:a=-1}return n}function BPn(t,e){var n=e.dir||e.root,l=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+l:n+t+l:l}var px={resolve:function(){for(var e="",n=!1,l,I=arguments.length-1;I>=-1&&!n;I--){var a;I>=0?a=arguments[I]:(l===void 0&&(l=process.cwd()),a=l),Fg(a),a.length!==0&&(e=a+"/"+e,n=a.charCodeAt(0)===47)}return e=zWt(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(Fg(e),e.length===0)return".";var n=e.charCodeAt(0)===47,l=e.charCodeAt(e.length-1)===47;return e=zWt(e,!n),e.length===0&&!n&&(e="."),e.length>0&&l&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return Fg(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,n=0;n0&&(e===void 0?e=l:e+="/"+l)}return e===void 0?".":px.normalize(e)},relative:function(e,n){if(Fg(e),Fg(n),e===n||(e=px.resolve(e),n=px.resolve(n),e===n))return"";for(var l=1;lr){if(n.charCodeAt(c+o)===47)return n.slice(c+o+1);if(o===0)return n.slice(c+o)}else a>r&&(e.charCodeAt(l+o)===47?u=o:o===0&&(u=0));break}var d=e.charCodeAt(l+o),b=n.charCodeAt(c+o);if(d!==b)break;d===47&&(u=o)}var h="";for(o=l+u+1;o<=I;++o)(o===I||e.charCodeAt(o)===47)&&(h.length===0?h+="..":h+="/..");return h.length>0?h+n.slice(c+u):(c+=u,n.charCodeAt(c)===47&&++c,n.slice(c))},_makeLong:function(e){return e},dirname:function(e){if(Fg(e),e.length===0)return".";for(var n=e.charCodeAt(0),l=n===47,I=-1,a=!0,c=e.length-1;c>=1;--c)if(n=e.charCodeAt(c),n===47){if(!a){I=c;break}}else a=!1;return I===-1?l?"/":".":l&&I===1?"//":e.slice(0,I)},basename:function(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Fg(e);var l=0,I=-1,a=!0,c;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var i=n.length-1,s=-1;for(c=e.length-1;c>=0;--c){var r=e.charCodeAt(c);if(r===47){if(!a){l=c+1;break}}else s===-1&&(a=!1,s=c+1),i>=0&&(r===n.charCodeAt(i)?--i===-1&&(I=c):(i=-1,I=s))}return l===I?I=s:I===-1&&(I=e.length),e.slice(l,I)}else{for(c=e.length-1;c>=0;--c)if(e.charCodeAt(c)===47){if(!a){l=c+1;break}}else I===-1&&(a=!1,I=c+1);return I===-1?"":e.slice(l,I)}},extname:function(e){Fg(e);for(var n=-1,l=0,I=-1,a=!0,c=0,i=e.length-1;i>=0;--i){var s=e.charCodeAt(i);if(s===47){if(!a){l=i+1;break}continue}I===-1&&(a=!1,I=i+1),s===46?n===-1?n=i:c!==1&&(c=1):n!==-1&&(c=-1)}return n===-1||I===-1||c===0||c===1&&n===I-1&&n===l+1?"":e.slice(n,I)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return BPn("/",e)},parse:function(e){Fg(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return n;var l=e.charCodeAt(0),I=l===47,a;I?(n.root="/",a=1):a=0;for(var c=-1,i=0,s=-1,r=!0,u=e.length-1,o=0;u>=a;--u){if(l=e.charCodeAt(u),l===47){if(!r){i=u+1;break}continue}s===-1&&(r=!1,s=u+1),l===46?c===-1?c=u:o!==1&&(o=1):c!==-1&&(o=-1)}return c===-1||s===-1||o===0||o===1&&c===s-1&&c===i+1?s!==-1&&(i===0&&I?n.base=n.name=e.slice(1,s):n.base=n.name=e.slice(i,s)):(i===0&&I?(n.name=e.slice(1,c),n.base=e.slice(1,s)):(n.name=e.slice(i,c),n.base=e.slice(i,s)),n.ext=e.slice(c,s)),i>0?n.dir=e.slice(0,i-1):I&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};px.posix=px;BWt.exports=px});var Ca=f((E0a,MWt)=>{var SPn=SWt(),MPn=app.vault.adapter.path,TPn={...MPn||SPn,isUsingObsidian:!0};MWt.exports=TPn});var co=f((J0a,TWt)=>{var DPn=app.vault.adapter.fs,KPn={...DPn,isUsingObsidian:!0};TWt.exports=KPn});var Nx=f((L0a,lNt)=>{"use strict";var nNt=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);lNt.exports=t=>t?Object.keys(t).map(e=>[nNt.has(e)?nNt.get(e):e,t[e]]).reduce((e,n)=>(e[n[0]]=n[1],e),Object.create(null)):{}});var uae=f(GNt=>{"use strict";var INt=typeof process=="object"&&process?process:{stdout:null,stderr:null},qPn=require("events"),aNt=require("stream"),$Pn=require("string_decoder"),rNt=$Pn.StringDecoder,YA=Symbol("EOF"),gA=Symbol("maybeEmitEnd"),Tv=Symbol("emittedEnd"),aae=Symbol("emittingEnd"),HM=Symbol("emittedError"),rae=Symbol("closed"),cNt=Symbol("read"),cae=Symbol("flush"),oNt=Symbol("flushChunk"),sp=Symbol("encoding"),RA=Symbol("decoder"),oae=Symbol("flowing"),QM=Symbol("paused"),Vx=Symbol("resume"),Mo=Symbol("buffer"),fg=Symbol("pipes"),gd=Symbol("bufferLength"),hJe=Symbol("bufferPush"),ZJe=Symbol("bufferShift"),VG=Symbol("objectMode"),To=Symbol("destroyed"),WJe=Symbol("error"),NJe=Symbol("emitData"),iNt=Symbol("emitEnd"),VJe=Symbol("emitEnd2"),yA=Symbol("async"),YJe=Symbol("abort"),iae=Symbol("aborted"),mE=Symbol("signal"),EM=t=>Promise.resolve().then(t),dNt=global._MP_NO_ITERATOR_SYMBOLS_!=="1",sNt=dNt&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),uNt=dNt&&Symbol.iterator||Symbol("iterator not implemented"),e6n=t=>t==="end"||t==="finish"||t==="prefinish",t6n=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,n6n=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),sae=class{constructor(e,n,l){this.src=e,this.dest=n,this.opts=l,this.ondrain=()=>e[Vx](),n.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},gJe=class extends sae{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,l){super(e,n,l),this.proxyErrors=I=>n.emit("error",I),e.on("error",this.proxyErrors)}},RJe=class t extends aNt{constructor(e){super(),this[oae]=!1,this[QM]=!1,this[fg]=[],this[Mo]=[],this[VG]=e&&e.objectMode||!1,this[VG]?this[sp]=null:this[sp]=e&&e.encoding||null,this[sp]==="buffer"&&(this[sp]=null),this[yA]=e&&!!e.async||!1,this[RA]=this[sp]?new rNt(this[sp]):null,this[YA]=!1,this[Tv]=!1,this[aae]=!1,this[rae]=!1,this[HM]=null,this.writable=!0,this.readable=!0,this[gd]=0,this[To]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Mo]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[fg]}),this[mE]=e&&e.signal,this[iae]=!1,this[mE]&&(this[mE].addEventListener("abort",()=>this[YJe]()),this[mE].aborted&&this[YJe]())}get bufferLength(){return this[gd]}get encoding(){return this[sp]}set encoding(e){if(this[VG])throw new Error("cannot set encoding in objectMode");if(this[sp]&&e!==this[sp]&&(this[RA]&&this[RA].lastNeed||this[gd]))throw new Error("cannot change encoding");this[sp]!==e&&(this[RA]=e?new rNt(e):null,this[Mo].length&&(this[Mo]=this[Mo].map(n=>this[RA].write(n)))),this[sp]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[VG]}set objectMode(e){this[VG]=this[VG]||!!e}get async(){return this[yA]}set async(e){this[yA]=this[yA]||!!e}[YJe](){this[iae]=!0,this.emit("abort",this[mE].reason),this.destroy(this[mE].reason)}get aborted(){return this[iae]}set aborted(e){}write(e,n,l){if(this[iae])return!1;if(this[YA])throw new Error("write after end");if(this[To])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(l=n,n="utf8"),n||(n="utf8");let I=this[yA]?EM:a=>a();return!this[VG]&&!Buffer.isBuffer(e)&&(n6n(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):t6n(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[VG]?(this.flowing&&this[gd]!==0&&this[cae](!0),this.flowing?this.emit("data",e):this[hJe](e),this[gd]!==0&&this.emit("readable"),l&&I(l),this.flowing):e.length?(typeof e=="string"&&!(n===this[sp]&&!this[RA].lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[sp]&&(e=this[RA].write(e)),this.flowing&&this[gd]!==0&&this[cae](!0),this.flowing?this.emit("data",e):this[hJe](e),this[gd]!==0&&this.emit("readable"),l&&I(l),this.flowing):(this[gd]!==0&&this.emit("readable"),l&&I(l),this.flowing)}read(e){if(this[To])return null;if(this[gd]===0||e===0||e>this[gd])return this[gA](),null;this[VG]&&(e=null),this[Mo].length>1&&!this[VG]&&(this.encoding?this[Mo]=[this[Mo].join("")]:this[Mo]=[Buffer.concat(this[Mo],this[gd])]);let n=this[cNt](e||null,this[Mo][0]);return this[gA](),n}[cNt](e,n){return e===n.length||e===null?this[ZJe]():(this[Mo][0]=n.slice(e),n=n.slice(0,e),this[gd]-=e),this.emit("data",n),!this[Mo].length&&!this[YA]&&this.emit("drain"),n}end(e,n,l){return typeof e=="function"&&(l=e,e=null),typeof n=="function"&&(l=n,n="utf8"),e&&this.write(e,n),l&&this.once("end",l),this[YA]=!0,this.writable=!1,(this.flowing||!this[QM])&&this[gA](),this}[Vx](){this[To]||(this[QM]=!1,this[oae]=!0,this.emit("resume"),this[Mo].length?this[cae]():this[YA]?this[gA]():this.emit("drain"))}resume(){return this[Vx]()}pause(){this[oae]=!1,this[QM]=!0}get destroyed(){return this[To]}get flowing(){return this[oae]}get paused(){return this[QM]}[hJe](e){this[VG]?this[gd]+=1:this[gd]+=e.length,this[Mo].push(e)}[ZJe](){return this[VG]?this[gd]-=1:this[gd]-=this[Mo][0].length,this[Mo].shift()}[cae](e){do;while(this[oNt](this[ZJe]())&&this[Mo].length);!e&&!this[Mo].length&&!this[YA]&&this.emit("drain")}[oNt](e){return this.emit("data",e),this.flowing}pipe(e,n){if(this[To])return;let l=this[Tv];return n=n||{},e===INt.stdout||e===INt.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,l?n.end&&e.end():(this[fg].push(n.proxyErrors?new gJe(this,e,n):new sae(this,e,n)),this[yA]?EM(()=>this[Vx]()):this[Vx]()),e}unpipe(e){let n=this[fg].find(l=>l.dest===e);n&&(this[fg].splice(this[fg].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let l=super.on(e,n);return e==="data"&&!this[fg].length&&!this.flowing?this[Vx]():e==="readable"&&this[gd]!==0?super.emit("readable"):e6n(e)&&this[Tv]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[HM]&&(this[yA]?EM(()=>n.call(this,this[HM])):n.call(this,this[HM])),l}get emittedEnd(){return this[Tv]}[gA](){!this[aae]&&!this[Tv]&&!this[To]&&this[Mo].length===0&&this[YA]&&(this[aae]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[rae]&&this.emit("close"),this[aae]=!1)}emit(e,n,...l){if(e!=="error"&&e!=="close"&&e!==To&&this[To])return;if(e==="data")return!this[VG]&&!n?!1:this[yA]?EM(()=>this[NJe](n)):this[NJe](n);if(e==="end")return this[iNt]();if(e==="close"){if(this[rae]=!0,!this[Tv]&&!this[To])return;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[HM]=n,super.emit(WJe,n);let a=!this[mE]||this.listeners("error").length?super.emit("error",n):!1;return this[gA](),a}else if(e==="resume"){let a=super.emit("resume");return this[gA](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let I=super.emit(e,n,...l);return this[gA](),I}[NJe](e){for(let l of this[fg])l.dest.write(e)===!1&&this.pause();let n=super.emit("data",e);return this[gA](),n}[iNt](){this[Tv]||(this[Tv]=!0,this.readable=!1,this[yA]?EM(()=>this[VJe]()):this[VJe]())}[VJe](){if(this[RA]){let n=this[RA].end();if(n){for(let l of this[fg])l.dest.write(n);super.emit("data",n)}}for(let n of this[fg])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[VG]||(e.dataLength=0);let n=this.promise();return this.on("data",l=>{e.push(l),this[VG]||(e.dataLength+=l.length)}),n.then(()=>e)}concat(){return this[VG]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[VG]?Promise.reject(new Error("cannot concat in objectMode")):this[sp]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,n)=>{this.on(To,()=>n(new Error("stream destroyed"))),this.on("error",l=>n(l)),this.on("end",()=>e())})}[sNt](){let e=!1,n=()=>(this.pause(),e=!0,Promise.resolve({done:!0}));return{next:()=>{if(e)return n();let I=this.read();if(I!==null)return Promise.resolve({done:!1,value:I});if(this[YA])return n();let a=null,c=null,i=o=>{this.removeListener("data",s),this.removeListener("end",r),this.removeListener(To,u),n(),c(o)},s=o=>{this.removeListener("error",i),this.removeListener("end",r),this.removeListener(To,u),this.pause(),a({value:o,done:!!this[YA]})},r=()=>{this.removeListener("error",i),this.removeListener("data",s),this.removeListener(To,u),n(),a({done:!0})},u=()=>i(new Error("stream destroyed"));return new Promise((o,d)=>{c=d,a=o,this.once(To,u),this.once("error",i),this.once("end",r),this.once("data",s)})},throw:n,return:n,[sNt](){return this}}}[uNt](){let e=!1,n=()=>(this.pause(),this.removeListener(WJe,n),this.removeListener(To,n),this.removeListener("end",n),e=!0,{done:!0}),l=()=>{if(e)return n();let I=this.read();return I===null?n():{value:I}};return this.once("end",n),this.once(WJe,n),this.once(To,n),{next:l,throw:n,return:n,[uNt](){return this}}}destroy(e){return this[To]?(e?this.emit("error",e):this.emit(To),this):(this[To]=!0,this[Mo].length=0,this[gd]=0,typeof this.close=="function"&&!this[rae]&&this.close(),e?this.emit("error",e):this.emit(To),this)}static isStream(e){return!!e&&(e instanceof t||e instanceof aNt||e instanceof qPn&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}};GNt.Minipass=RJe});var mNt=f((x0a,bNt)=>{var l6n=require("zlib").constants||{ZLIB_VERNUM:4736};bNt.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},l6n))});var XJe=f((j0a,RNt)=>{"use strict";var pNt=typeof process=="object"&&process?process:{stdout:null,stderr:null},I6n=require("events"),hNt=require("stream"),ZNt=require("string_decoder").StringDecoder,AA=Symbol("EOF"),FA=Symbol("maybeEmitEnd"),Dv=Symbol("emittedEnd"),dae=Symbol("emittingEnd"),JM=Symbol("emittedError"),Gae=Symbol("closed"),WNt=Symbol("read"),bae=Symbol("flush"),NNt=Symbol("flushChunk"),up=Symbol("encoding"),vA=Symbol("decoder"),mae=Symbol("flowing"),CM=Symbol("paused"),Yx=Symbol("resume"),Rd=Symbol("bufferLength"),yJe=Symbol("bufferPush"),AJe=Symbol("bufferShift"),bb=Symbol("objectMode"),mb=Symbol("destroyed"),FJe=Symbol("emitData"),VNt=Symbol("emitEnd"),vJe=Symbol("emitEnd2"),fA=Symbol("async"),LM=t=>Promise.resolve().then(t),YNt=global._MP_NO_ITERATOR_SYMBOLS_!=="1",a6n=YNt&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),r6n=YNt&&Symbol.iterator||Symbol("iterator not implemented"),c6n=t=>t==="end"||t==="finish"||t==="prefinish",o6n=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,i6n=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),pae=class{constructor(e,n,l){this.src=e,this.dest=n,this.opts=l,this.ondrain=()=>e[Yx](),n.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},fJe=class extends pae{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,l){super(e,n,l),this.proxyErrors=I=>n.emit("error",I),e.on("error",this.proxyErrors)}};RNt.exports=class gNt extends hNt{constructor(e){super(),this[mae]=!1,this[CM]=!1,this.pipes=[],this.buffer=[],this[bb]=e&&e.objectMode||!1,this[bb]?this[up]=null:this[up]=e&&e.encoding||null,this[up]==="buffer"&&(this[up]=null),this[fA]=e&&!!e.async||!1,this[vA]=this[up]?new ZNt(this[up]):null,this[AA]=!1,this[Dv]=!1,this[dae]=!1,this[Gae]=!1,this[JM]=null,this.writable=!0,this.readable=!0,this[Rd]=0,this[mb]=!1}get bufferLength(){return this[Rd]}get encoding(){return this[up]}set encoding(e){if(this[bb])throw new Error("cannot set encoding in objectMode");if(this[up]&&e!==this[up]&&(this[vA]&&this[vA].lastNeed||this[Rd]))throw new Error("cannot change encoding");this[up]!==e&&(this[vA]=e?new ZNt(e):null,this.buffer.length&&(this.buffer=this.buffer.map(n=>this[vA].write(n)))),this[up]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[bb]}set objectMode(e){this[bb]=this[bb]||!!e}get async(){return this[fA]}set async(e){this[fA]=this[fA]||!!e}write(e,n,l){if(this[AA])throw new Error("write after end");if(this[mb])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(l=n,n="utf8"),n||(n="utf8");let I=this[fA]?LM:a=>a();return!this[bb]&&!Buffer.isBuffer(e)&&(i6n(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):o6n(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[bb]?(this.flowing&&this[Rd]!==0&&this[bae](!0),this.flowing?this.emit("data",e):this[yJe](e),this[Rd]!==0&&this.emit("readable"),l&&I(l),this.flowing):e.length?(typeof e=="string"&&!(n===this[up]&&!this[vA].lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[up]&&(e=this[vA].write(e)),this.flowing&&this[Rd]!==0&&this[bae](!0),this.flowing?this.emit("data",e):this[yJe](e),this[Rd]!==0&&this.emit("readable"),l&&I(l),this.flowing):(this[Rd]!==0&&this.emit("readable"),l&&I(l),this.flowing)}read(e){if(this[mb])return null;if(this[Rd]===0||e===0||e>this[Rd])return this[FA](),null;this[bb]&&(e=null),this.buffer.length>1&&!this[bb]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Rd])]);let n=this[WNt](e||null,this.buffer[0]);return this[FA](),n}[WNt](e,n){return e===n.length||e===null?this[AJe]():(this.buffer[0]=n.slice(e),n=n.slice(0,e),this[Rd]-=e),this.emit("data",n),!this.buffer.length&&!this[AA]&&this.emit("drain"),n}end(e,n,l){return typeof e=="function"&&(l=e,e=null),typeof n=="function"&&(l=n,n="utf8"),e&&this.write(e,n),l&&this.once("end",l),this[AA]=!0,this.writable=!1,(this.flowing||!this[CM])&&this[FA](),this}[Yx](){this[mb]||(this[CM]=!1,this[mae]=!0,this.emit("resume"),this.buffer.length?this[bae]():this[AA]?this[FA]():this.emit("drain"))}resume(){return this[Yx]()}pause(){this[mae]=!1,this[CM]=!0}get destroyed(){return this[mb]}get flowing(){return this[mae]}get paused(){return this[CM]}[yJe](e){this[bb]?this[Rd]+=1:this[Rd]+=e.length,this.buffer.push(e)}[AJe](){return this.buffer.length&&(this[bb]?this[Rd]-=1:this[Rd]-=this.buffer[0].length),this.buffer.shift()}[bae](e){do;while(this[NNt](this[AJe]()));!e&&!this.buffer.length&&!this[AA]&&this.emit("drain")}[NNt](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,n){if(this[mb])return;let l=this[Dv];return n=n||{},e===pNt.stdout||e===pNt.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,l?n.end&&e.end():(this.pipes.push(n.proxyErrors?new fJe(this,e,n):new pae(this,e,n)),this[fA]?LM(()=>this[Yx]()):this[Yx]()),e}unpipe(e){let n=this.pipes.find(l=>l.dest===e);n&&(this.pipes.splice(this.pipes.indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let l=super.on(e,n);return e==="data"&&!this.pipes.length&&!this.flowing?this[Yx]():e==="readable"&&this[Rd]!==0?super.emit("readable"):c6n(e)&&this[Dv]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[JM]&&(this[fA]?LM(()=>n.call(this,this[JM])):n.call(this,this[JM])),l}get emittedEnd(){return this[Dv]}[FA](){!this[dae]&&!this[Dv]&&!this[mb]&&this.buffer.length===0&&this[AA]&&(this[dae]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Gae]&&this.emit("close"),this[dae]=!1)}emit(e,n,...l){if(e!=="error"&&e!=="close"&&e!==mb&&this[mb])return;if(e==="data")return n?this[fA]?LM(()=>this[FJe](n)):this[FJe](n):!1;if(e==="end")return this[VNt]();if(e==="close"){if(this[Gae]=!0,!this[Dv]&&!this[mb])return;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[JM]=n;let a=super.emit("error",n);return this[FA](),a}else if(e==="resume"){let a=super.emit("resume");return this[FA](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let I=super.emit(e,n,...l);return this[FA](),I}[FJe](e){for(let l of this.pipes)l.dest.write(e)===!1&&this.pause();let n=super.emit("data",e);return this[FA](),n}[VNt](){this[Dv]||(this[Dv]=!0,this.readable=!1,this[fA]?LM(()=>this[vJe]()):this[vJe]())}[vJe](){if(this[vA]){let n=this[vA].end();if(n){for(let l of this.pipes)l.dest.write(n);super.emit("data",n)}}for(let n of this.pipes)n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[bb]||(e.dataLength=0);let n=this.promise();return this.on("data",l=>{e.push(l),this[bb]||(e.dataLength+=l.length)}),n.then(()=>e)}concat(){return this[bb]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[bb]?Promise.reject(new Error("cannot concat in objectMode")):this[up]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,n)=>{this.on(mb,()=>n(new Error("stream destroyed"))),this.on("error",l=>n(l)),this.on("end",()=>e())})}[a6n](){return{next:()=>{let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[AA])return Promise.resolve({done:!0});let l=null,I=null,a=r=>{this.removeListener("data",c),this.removeListener("end",i),I(r)},c=r=>{this.removeListener("error",a),this.removeListener("end",i),this.pause(),l({value:r,done:!!this[AA]})},i=()=>{this.removeListener("error",a),this.removeListener("data",c),l({done:!0})},s=()=>a(new Error("stream destroyed"));return new Promise((r,u)=>{I=u,l=r,this.once(mb,s),this.once("error",a),this.once("end",i),this.once("data",c)})}}}[r6n](){return{next:()=>{let n=this.read();return{value:n,done:n===null}}}}destroy(e){return this[mb]?(e?this.emit("error",e):this.emit(mb),this):(this[mb]=!0,this.buffer.length=0,this[Rd]=0,typeof this.close=="function"&&!this[Gae]&&this.close(),e?this.emit("error",e):this.emit(mb),this)}static isStream(e){return!!e&&(e instanceof gNt||e instanceof hNt||e instanceof I6n&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var MJe=f(xh=>{"use strict";var JJe=require("assert"),Kv=require("buffer").Buffer,FNt=require("zlib"),pE=xh.constants=mNt(),s6n=XJe(),yNt=Kv.concat,hE=Symbol("_superWrite"),Rx=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},u6n=Symbol("opts"),kM=Symbol("flushFlag"),ANt=Symbol("finishFlushFlag"),SJe=Symbol("fullFlushFlag"),sc=Symbol("handle"),hae=Symbol("onError"),gx=Symbol("sawError"),wJe=Symbol("level"),HJe=Symbol("strategy"),QJe=Symbol("ended"),O0a=Symbol("_defaultFullFlush"),Zae=class extends s6n{constructor(e,n){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[gx]=!1,this[QJe]=!1,this[u6n]=e,this[kM]=e.flush,this[ANt]=e.finishFlush;try{this[sc]=new FNt[n](e)}catch(l){throw new Rx(l)}this[hae]=l=>{this[gx]||(this[gx]=!0,this.close(),this.emit("error",l))},this[sc].on("error",l=>this[hae](new Rx(l))),this.once("end",()=>this.close)}close(){this[sc]&&(this[sc].close(),this[sc]=null,this.emit("close"))}reset(){if(!this[gx])return JJe(this[sc],"zlib binding closed"),this[sc].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[SJe]),this.write(Object.assign(Kv.alloc(0),{[kM]:e})))}end(e,n,l){return e&&this.write(e,n),this.flush(this[ANt]),this[QJe]=!0,super.end(null,null,l)}get ended(){return this[QJe]}write(e,n,l){if(typeof n=="function"&&(l=n,n="utf8"),typeof e=="string"&&(e=Kv.from(e,n)),this[gx])return;JJe(this[sc],"zlib binding closed");let I=this[sc]._handle,a=I.close;I.close=()=>{};let c=this[sc].close;this[sc].close=()=>{},Kv.concat=r=>r;let i;try{let r=typeof e[kM]=="number"?e[kM]:this[kM];i=this[sc]._processChunk(e,r),Kv.concat=yNt}catch(r){Kv.concat=yNt,this[hae](new Rx(r))}finally{this[sc]&&(this[sc]._handle=I,I.close=a,this[sc].close=c,this[sc].removeAllListeners("error"))}this[sc]&&this[sc].on("error",r=>this[hae](new Rx(r)));let s;if(i)if(Array.isArray(i)&&i.length>0){s=this[hE](Kv.from(i[0]));for(let r=1;r{this.flush(I),a()};try{this[sc].params(e,n)}finally{this[sc].flush=l}this[sc]&&(this[wJe]=e,this[HJe]=n)}}}},CJe=class extends XA{constructor(e){super(e,"Deflate")}},LJe=class extends XA{constructor(e){super(e,"Inflate")}},EJe=Symbol("_portable"),kJe=class extends XA{constructor(e){super(e,"Gzip"),this[EJe]=e&&!!e.portable}[hE](e){return this[EJe]?(this[EJe]=!1,e[9]=255,super[hE](e)):super[hE](e)}},xJe=class extends XA{constructor(e){super(e,"Gunzip")}},jJe=class extends XA{constructor(e){super(e,"DeflateRaw")}},OJe=class extends XA{constructor(e){super(e,"InflateRaw")}},UJe=class extends XA{constructor(e){super(e,"Unzip")}},Wae=class extends Zae{constructor(e,n){e=e||{},e.flush=e.flush||pE.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||pE.BROTLI_OPERATION_FINISH,super(e,n),this[SJe]=pE.BROTLI_OPERATION_FLUSH}},zJe=class extends Wae{constructor(e){super(e,"BrotliCompress")}},BJe=class extends Wae{constructor(e){super(e,"BrotliDecompress")}};xh.Deflate=CJe;xh.Inflate=LJe;xh.Gzip=kJe;xh.Gunzip=xJe;xh.DeflateRaw=jJe;xh.InflateRaw=OJe;xh.Unzip=UJe;typeof FNt.BrotliCompress=="function"?(xh.BrotliCompress=zJe,xh.BrotliDecompress=BJe):xh.BrotliCompress=xh.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var yx=f((B0a,vNt)=>{var d6n=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;vNt.exports=d6n!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")});var Nae=f((M0a,fNt)=>{"use strict";var{Minipass:G6n}=uae(),TJe=yx(),DJe=Symbol("slurp");fNt.exports=class extends G6n{constructor(e,n,l){switch(super(),this.pause(),this.extended=n,this.globalExtended=l,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=TJe(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=TJe(e.linkpath),this.uname=e.uname,this.gname=e.gname,n&&this[DJe](n),l&&this[DJe](l,!0)}write(e){let n=e.length;if(n>this.blockRemain)throw new Error("writing more to entry than is appropriate");let l=this.remain,I=this.blockRemain;return this.remain=Math.max(0,l-n),this.blockRemain=Math.max(0,I-n),this.ignore?!0:l>=n?super.write(e):super.write(e.slice(0,l))}[DJe](e,n){for(let l in e)e[l]!==null&&e[l]!==void 0&&!(n&&l==="path")&&(this[l]=l==="path"||l==="linkpath"?TJe(e[l]):e[l])}}});var KJe=f(Vae=>{"use strict";Vae.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);Vae.code=new Map(Array.from(Vae.name).map(t=>[t[1],t[0]]))});var QNt=f((D0a,HNt)=>{"use strict";var b6n=(t,e)=>{if(Number.isSafeInteger(t))t<0?p6n(t,e):m6n(t,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},m6n=(t,e)=>{e[0]=128;for(var n=e.length;n>1;n--)e[n-1]=t&255,t=Math.floor(t/256)},p6n=(t,e)=>{e[0]=255;var n=!1;t=t*-1;for(var l=e.length;l>1;l--){var I=t&255;t=Math.floor(t/256),n?e[l-1]=XNt(I):I===0?e[l-1]=0:(n=!0,e[l-1]=wNt(I))}},h6n=t=>{let e=t[0],n=e===128?W6n(t.slice(1,t.length)):e===255?Z6n(t):null;if(n===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(n))throw Error("parsed number outside of javascript safe integer range");return n},Z6n=t=>{for(var e=t.length,n=0,l=!1,I=e-1;I>-1;I--){var a=t[I],c;l?c=XNt(a):a===0?c=a:(l=!0,c=wNt(a)),c!==0&&(n-=c*Math.pow(256,e-I-1))}return n},W6n=t=>{for(var e=t.length,n=0,l=e-1;l>-1;l--){var I=t[l];I!==0&&(n+=I*Math.pow(256,e-l-1))}return n},XNt=t=>(255^t)&255,wNt=t=>(255^t)+1&255;HNt.exports={encode:b6n,parse:h6n}});var Fx=f((K0a,JNt)=>{"use strict";var _Je=KJe(),Ax=Ca().posix,ENt=QNt(),PJe=Symbol("slurp"),jh=Symbol("type"),eCe=class{constructor(e,n,l,I){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[jh]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,n||0,l,I):e&&this.set(e)}decode(e,n,l,I){if(n||(n=0),!e||!(e.length>=n+512))throw new Error("need 512 bytes for header");if(this.path=ZE(e,n,100),this.mode=_v(e,n+100,8),this.uid=_v(e,n+108,8),this.gid=_v(e,n+116,8),this.size=_v(e,n+124,12),this.mtime=qJe(e,n+136,12),this.cksum=_v(e,n+148,12),this[PJe](l),this[PJe](I,!0),this[jh]=ZE(e,n+156,1),this[jh]===""&&(this[jh]="0"),this[jh]==="0"&&this.path.slice(-1)==="/"&&(this[jh]="5"),this[jh]==="5"&&(this.size=0),this.linkpath=ZE(e,n+157,100),e.slice(n+257,n+265).toString()==="ustar\x0000")if(this.uname=ZE(e,n+265,32),this.gname=ZE(e,n+297,32),this.devmaj=_v(e,n+329,8),this.devmin=_v(e,n+337,8),e[n+475]!==0){let c=ZE(e,n+345,155);this.path=c+"/"+this.path}else{let c=ZE(e,n+345,130);c&&(this.path=c+"/"+this.path),this.atime=qJe(e,n+476,12),this.ctime=qJe(e,n+488,12)}let a=8*32;for(let c=n;c=n+512))throw new Error("need 512 bytes for header");let l=this.ctime||this.atime?130:155,I=N6n(this.path||"",l),a=I[0],c=I[1];this.needPax=I[2],this.needPax=WE(e,n,100,a)||this.needPax,this.needPax=Pv(e,n+100,8,this.mode)||this.needPax,this.needPax=Pv(e,n+108,8,this.uid)||this.needPax,this.needPax=Pv(e,n+116,8,this.gid)||this.needPax,this.needPax=Pv(e,n+124,12,this.size)||this.needPax,this.needPax=$Je(e,n+136,12,this.mtime)||this.needPax,e[n+156]=this[jh].charCodeAt(0),this.needPax=WE(e,n+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",n+257,8),this.needPax=WE(e,n+265,32,this.uname)||this.needPax,this.needPax=WE(e,n+297,32,this.gname)||this.needPax,this.needPax=Pv(e,n+329,8,this.devmaj)||this.needPax,this.needPax=Pv(e,n+337,8,this.devmin)||this.needPax,this.needPax=WE(e,n+345,l,c)||this.needPax,e[n+475]!==0?this.needPax=WE(e,n+345,155,c)||this.needPax:(this.needPax=WE(e,n+345,130,c)||this.needPax,this.needPax=$Je(e,n+476,12,this.atime)||this.needPax,this.needPax=$Je(e,n+488,12,this.ctime)||this.needPax);let i=8*32;for(let s=n;s{let l=t,I="",a,c=Ax.parse(t).root||".";if(Buffer.byteLength(l)<100)a=[l,I,!1];else{I=Ax.dirname(l),l=Ax.basename(l);do Buffer.byteLength(l)<=100&&Buffer.byteLength(I)<=e?a=[l,I,!1]:Buffer.byteLength(l)>100&&Buffer.byteLength(I)<=e?a=[l.slice(0,99),I,!0]:(l=Ax.join(Ax.basename(I),l),I=Ax.dirname(I));while(I!==c&&!a);a||(a=[t.slice(0,99),"",!0])}return a},ZE=(t,e,n)=>t.slice(e,e+n).toString("utf8").replace(/\0.*/,""),qJe=(t,e,n)=>V6n(_v(t,e,n)),V6n=t=>t===null?null:new Date(t*1e3),_v=(t,e,n)=>t[e]&128?ENt.parse(t.slice(e,e+n)):g6n(t,e,n),Y6n=t=>isNaN(t)?null:t,g6n=(t,e,n)=>Y6n(parseInt(t.slice(e,e+n).toString("utf8").replace(/\0.*$/,"").trim(),8)),R6n={12:8589934591,8:2097151},Pv=(t,e,n,l)=>l===null?!1:l>R6n[n]||l<0?(ENt.encode(l,t.slice(e,e+n)),!0):(y6n(t,e,n,l),!1),y6n=(t,e,n,l)=>t.write(A6n(l,n),e,n,"ascii"),A6n=(t,e)=>F6n(Math.floor(t).toString(8),e),F6n=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",$Je=(t,e,n,l)=>l===null?!1:Pv(t,e,n,l.getTime()/1e3),v6n=new Array(156).join("\0"),WE=(t,e,n,l)=>l===null?!1:(t.write(l+v6n,e,n,"utf8"),l.length!==Buffer.byteLength(l)||l.length>n);JNt.exports=eCe});var Yae=f((_0a,CNt)=>{"use strict";var f6n=Fx(),X6n=Ca(),xM=class{constructor(e,n){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=n||!1}encode(){let e=this.encodeBody();if(e==="")return null;let n=Buffer.byteLength(e),l=512*Math.ceil(1+n/512),I=Buffer.allocUnsafe(l);for(let a=0;a<512;a++)I[a]=0;new f6n({path:("PaxHeader/"+X6n.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:n,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(I),I.write(e,512,n,"utf8");for(let a=n+512;a=Math.pow(10,a)&&(a+=1),a+I+l}};xM.parse=(t,e,n)=>new xM(w6n(H6n(t),e),n);var w6n=(t,e)=>e?Object.keys(t).reduce((n,l)=>(n[l]=t[l],n),e):t,H6n=t=>t.replace(/\n$/,"").split(` +`).reduce(Q6n,Object.create(null)),Q6n=(t,e)=>{let n=parseInt(e,10);if(n!==Buffer.byteLength(e)+1)return t;e=e.slice((n+" ").length);let l=e.split("="),I=l.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!I)return t;let a=l.join("=");return t[I]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(I)?new Date(a*1e3):/^[0-9]+$/.test(a)?+a:a,t};CNt.exports=xM});var vx=f((P0a,LNt)=>{LNt.exports=t=>{let e=t.length-1,n=-1;for(;e>-1&&t.charAt(e)==="/";)n=e,e--;return n===-1?t:t.slice(0,n)}});var gae=f((q0a,kNt)=>{"use strict";kNt.exports=t=>class extends t{warn(e,n,l={}){this.file&&(l.file=this.file),this.cwd&&(l.cwd=this.cwd),l.code=n instanceof Error&&n.code||e,l.tarCode=e,!this.strict&&l.recoverable!==!1?(n instanceof Error&&(l=Object.assign(n,l),n=n.message),this.emit("warn",l.tarCode,n,l)):n instanceof Error?this.emit("error",Object.assign(n,l)):this.emit("error",Object.assign(new Error(`${e}: ${n}`),l))}}});var nCe=f((eFa,xNt)=>{"use strict";var Rae=["|","<",">","?",":"],tCe=Rae.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),E6n=new Map(Rae.map((t,e)=>[t,tCe[e]])),J6n=new Map(tCe.map((t,e)=>[t,Rae[e]]));xNt.exports={encode:t=>Rae.reduce((e,n)=>e.split(n).join(E6n.get(n)),t),decode:t=>tCe.reduce((e,n)=>e.split(n).join(J6n.get(n)),t)}});var lCe=f((tFa,ONt)=>{var{isAbsolute:C6n,parse:jNt}=Ca().win32;ONt.exports=t=>{let e="",n=jNt(t);for(;C6n(t)||n.root;){let l=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":n.root;t=t.slice(l.length),e+=l,n=jNt(t)}return[e,t]}});var zNt=f((nFa,UNt)=>{"use strict";UNt.exports=(t,e,n)=>(t&=4095,n&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var GCe=f((aFa,lVt)=>{"use strict";var{Minipass:_Nt}=uae(),PNt=Yae(),qNt=Fx(),wg=co(),BNt=Ca(),Xg=yx(),L6n=vx(),$Nt=(t,e)=>e?(t=Xg(t).replace(/^\.(\/|$)/,""),L6n(e)+"/"+t):Xg(t),k6n=16*1024*1024,SNt=Symbol("process"),MNt=Symbol("file"),TNt=Symbol("directory"),aCe=Symbol("symlink"),DNt=Symbol("hardlink"),jM=Symbol("header"),yae=Symbol("read"),rCe=Symbol("lstat"),Aae=Symbol("onlstat"),cCe=Symbol("onread"),oCe=Symbol("onreadlink"),iCe=Symbol("openfile"),sCe=Symbol("onopenfile"),qv=Symbol("close"),Fae=Symbol("mode"),uCe=Symbol("awaitDrain"),ICe=Symbol("ondrain"),Hg=Symbol("prefix"),KNt=Symbol("hadError"),eVt=gae(),x6n=nCe(),tVt=lCe(),nVt=zNt(),vae=eVt(class extends _Nt{constructor(e,n){if(n=n||{},super(n),typeof e!="string")throw new TypeError("path is required");this.path=Xg(e),this.portable=!!n.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=n.maxReadSize||k6n,this.linkCache=n.linkCache||new Map,this.statCache=n.statCache||new Map,this.preservePaths=!!n.preservePaths,this.cwd=Xg(n.cwd||process.cwd()),this.strict=!!n.strict,this.noPax=!!n.noPax,this.noMtime=!!n.noMtime,this.mtime=n.mtime||null,this.prefix=n.prefix?Xg(n.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof n.onwarn=="function"&&this.on("warn",n.onwarn);let l=!1;if(!this.preservePaths){let[I,a]=tVt(this.path);I&&(this.path=a,l=I)}this.win32=!!n.win32||process.platform==="win32",this.win32&&(this.path=x6n.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Xg(n.absolute||BNt.resolve(this.cwd,e)),this.path===""&&(this.path="./"),l&&this.warn("TAR_ENTRY_INFO",`stripping ${l} from absolute path`,{entry:this,path:l+this.path}),this.statCache.has(this.absolute)?this[Aae](this.statCache.get(this.absolute)):this[rCe]()}emit(e,...n){return e==="error"&&(this[KNt]=!0),super.emit(e,...n)}[rCe](){wg.lstat(this.absolute,(e,n)=>{if(e)return this.emit("error",e);this[Aae](n)})}[Aae](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=O6n(e),this.emit("stat",e),this[SNt]()}[SNt](){switch(this.type){case"File":return this[MNt]();case"Directory":return this[TNt]();case"SymbolicLink":return this[aCe]();default:return this.end()}}[Fae](e){return nVt(e,this.type==="Directory",this.portable)}[Hg](e){return $Nt(e,this.prefix)}[jM](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new qNt({path:this[Hg](this.path),linkpath:this.type==="Link"?this[Hg](this.linkpath):this.linkpath,mode:this[Fae](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new PNt({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[Hg](this.path),linkpath:this.type==="Link"?this[Hg](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[TNt](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[jM](),this.end()}[aCe](){wg.readlink(this.absolute,(e,n)=>{if(e)return this.emit("error",e);this[oCe](n)})}[oCe](e){this.linkpath=Xg(e),this[jM](),this.end()}[DNt](e){this.type="Link",this.linkpath=Xg(BNt.relative(this.cwd,e)),this.stat.size=0,this[jM](),this.end()}[MNt](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let n=this.linkCache.get(e);if(n.indexOf(this.cwd)===0)return this[DNt](n)}this.linkCache.set(e,this.absolute)}if(this[jM](),this.stat.size===0)return this.end();this[iCe]()}[iCe](){wg.open(this.absolute,"r",(e,n)=>{if(e)return this.emit("error",e);this[sCe](n)})}[sCe](e){if(this.fd=e,this[KNt])return this[qv]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let n=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(n),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[yae]()}[yae](){let{fd:e,buf:n,offset:l,length:I,pos:a}=this;wg.read(e,n,l,I,a,(c,i)=>{if(c)return this[qv](()=>this.emit("error",c));this[cCe](i)})}[qv](e){wg.close(this.fd,e)}[cCe](e){if(e<=0&&this.remain>0){let I=new Error("encountered unexpected EOF");return I.path=this.absolute,I.syscall="read",I.code="EOF",this[qv](()=>this.emit("error",I))}if(e>this.remain){let I=new Error("did not encounter expected EOF");return I.path=this.absolute,I.syscall="read",I.code="EOF",this[qv](()=>this.emit("error",I))}if(e===this.remain)for(let I=e;Ithis[ICe]())}[uCe](e){this.once("drain",e)}write(e){if(this.blockRemaine?this.emit("error",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[yae]()}}),dCe=class extends vae{[rCe](){this[Aae](wg.lstatSync(this.absolute))}[aCe](){this[oCe](wg.readlinkSync(this.absolute))}[iCe](){this[sCe](wg.openSync(this.absolute,"r"))}[yae](){let e=!0;try{let{fd:n,buf:l,offset:I,length:a,pos:c}=this,i=wg.readSync(n,l,I,a,c);this[cCe](i),e=!1}finally{if(e)try{this[qv](()=>{})}catch{}}}[uCe](e){e()}[qv](e){wg.closeSync(this.fd),e()}},j6n=eVt(class extends _Nt{constructor(e,n){n=n||{},super(n),this.preservePaths=!!n.preservePaths,this.portable=!!n.portable,this.strict=!!n.strict,this.noPax=!!n.noPax,this.noMtime=!!n.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=n.prefix||null,this.path=Xg(e.path),this.mode=this[Fae](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:n.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=Xg(e.linkpath),typeof n.onwarn=="function"&&this.on("warn",n.onwarn);let l=!1;if(!this.preservePaths){let[I,a]=tVt(this.path);I&&(this.path=a,l=I)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new qNt({path:this[Hg](this.path),linkpath:this.type==="Link"?this[Hg](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),l&&this.warn("TAR_ENTRY_INFO",`stripping ${l} from absolute path`,{entry:this,path:l+this.path}),this.header.encode()&&!this.noPax&&super.write(new PNt({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[Hg](this.path),linkpath:this.type==="Link"?this[Hg](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[Hg](e){return $Nt(e,this.prefix)}[Fae](e){return nVt(e,this.type==="Directory",this.portable)}write(e){let n=e.length;if(n>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=n,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});vae.Sync=dCe;vae.Tar=j6n;var O6n=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";lVt.exports=vae});var aVt=f((rFa,IVt)=>{"use strict";IVt.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var bCe=f((cFa,rVt)=>{"use strict";rVt.exports=La;La.Node=NE;La.create=La;function La(t){var e=this;if(e instanceof La||(e=new La),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(I){e.push(I)});else if(arguments.length>0)for(var n=0,l=arguments.length;n1)n=e;else if(this.head)l=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var I=0;l!==null;I++)n=t(n,l.value,I),l=l.next;return n};La.prototype.reduceReverse=function(t,e){var n,l=this.tail;if(arguments.length>1)n=e;else if(this.tail)l=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var I=this.length-1;l!==null;I--)n=t(n,l.value,I),l=l.prev;return n};La.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};La.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};La.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new La;if(ethis.length&&(e=this.length);for(var l=0,I=this.head;I!==null&&lthis.length&&(e=this.length);for(var l=this.length,I=this.tail;I!==null&&l>e;l--)I=I.prev;for(;I!==null&&l>t;l--,I=I.prev)n.push(I.value);return n};La.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var l=0,I=this.head;I!==null&&l{"use strict";var Jae=class{constructor(e,n){this.path=e||"./",this.absolute=n,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},{Minipass:S6n}=uae(),cVt=MJe(),M6n=Nae(),gCe=GCe(),T6n=gCe.Sync,D6n=gCe.Tar,K6n=bCe(),oVt=Buffer.alloc(1024),wae=Symbol("onStat"),fae=Symbol("ended"),Qg=Symbol("queue"),fx=Symbol("current"),VE=Symbol("process"),Xae=Symbol("processing"),iVt=Symbol("processJob"),Eg=Symbol("jobs"),mCe=Symbol("jobDone"),Hae=Symbol("addFSEntry"),sVt=Symbol("addTarEntry"),WCe=Symbol("stat"),NCe=Symbol("readdir"),Qae=Symbol("onreaddir"),Eae=Symbol("pipe"),uVt=Symbol("entry"),pCe=Symbol("entryOpt"),VCe=Symbol("writeEntryClass"),GVt=Symbol("write"),hCe=Symbol("ondrain"),Cae=co(),dVt=Ca(),_6n=gae(),ZCe=yx(),RCe=_6n(class extends S6n{constructor(e){if(super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=ZCe(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[VCe]=gCe,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip||e.brotli){if(e.gzip&&e.brotli)throw new TypeError("gzip and brotli are mutually exclusive");e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new cVt.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new cVt.BrotliCompress(e.brotli)),this.zip.on("data",n=>super.write(n)),this.zip.on("end",n=>super.end()),this.zip.on("drain",n=>this[hCe]()),this.on("resume",n=>this.zip.resume())}else this.on("drain",this[hCe]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:n=>!0,this[Qg]=new K6n,this[Eg]=0,this.jobs=+e.jobs||4,this[Xae]=!1,this[fae]=!1}[GVt](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[fae]=!0,this[VE](),this}write(e){if(this[fae])throw new Error("write after end");return e instanceof M6n?this[sVt](e):this[Hae](e),this.flowing}[sVt](e){let n=ZCe(dVt.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let l=new Jae(e.path,n,!1);l.entry=new D6n(e,this[pCe](l)),l.entry.on("end",I=>this[mCe](l)),this[Eg]+=1,this[Qg].push(l)}this[VE]()}[Hae](e){let n=ZCe(dVt.resolve(this.cwd,e));this[Qg].push(new Jae(e,n)),this[VE]()}[WCe](e){e.pending=!0,this[Eg]+=1;let n=this.follow?"stat":"lstat";Cae[n](e.absolute,(l,I)=>{e.pending=!1,this[Eg]-=1,l?this.emit("error",l):this[wae](e,I)})}[wae](e,n){this.statCache.set(e.absolute,n),e.stat=n,this.filter(e.path,n)||(e.ignore=!0),this[VE]()}[NCe](e){e.pending=!0,this[Eg]+=1,Cae.readdir(e.absolute,(n,l)=>{if(e.pending=!1,this[Eg]-=1,n)return this.emit("error",n);this[Qae](e,l)})}[Qae](e,n){this.readdirCache.set(e.absolute,n),e.readdir=n,this[VE]()}[VE](){if(!this[Xae]){this[Xae]=!0;for(let e=this[Qg].head;e!==null&&this[Eg]this.warn(n,l,I),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[uVt](e){this[Eg]+=1;try{return new this[VCe](e.path,this[pCe](e)).on("end",()=>this[mCe](e)).on("error",n=>this.emit("error",n))}catch(n){this.emit("error",n)}}[hCe](){this[fx]&&this[fx].entry&&this[fx].entry.resume()}[Eae](e){e.piped=!0,e.readdir&&e.readdir.forEach(I=>{let a=e.path,c=a==="./"?"":a.replace(/\/*$/,"/");this[Hae](c+I)});let n=e.entry,l=this.zip;l?n.on("data",I=>{l.write(I)||n.pause()}):n.on("data",I=>{super.write(I)||n.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),YCe=class extends RCe{constructor(e){super(e),this[VCe]=T6n}pause(){}resume(){}[WCe](e){let n=this.follow?"statSync":"lstatSync";this[wae](e,Cae[n](e.absolute))}[NCe](e,n){this[Qae](e,Cae.readdirSync(e.absolute))}[Eae](e){let n=e.entry,l=this.zip;e.readdir&&e.readdir.forEach(I=>{let a=e.path,c=a==="./"?"":a.replace(/\/*$/,"/");this[Hae](c+I)}),l?n.on("data",I=>{l.write(I)}):n.on("data",I=>{super[GVt](I)})}};RCe.Sync=YCe;bVt.exports=RCe});var Lx=f(UM=>{"use strict";var P6n=XJe(),q6n=require("events").EventEmitter,dp=co(),FCe=dp.writev;if(!FCe){let t=process.binding("fs"),e=t.FSReqWrap||t.FSReqCallback;FCe=(n,l,I,a)=>{let c=(s,r)=>a(s,r,l),i=new e;i.oncomplete=c,t.writeBuffers(n,l,I,i)}}var Jx=Symbol("_autoClose"),GV=Symbol("_close"),OM=Symbol("_ended"),jr=Symbol("_fd"),mVt=Symbol("_finished"),ef=Symbol("_flags"),yCe=Symbol("_flush"),vCe=Symbol("_handleChunk"),fCe=Symbol("_makeBuf"),Uae=Symbol("_mode"),kae=Symbol("_needDrain"),Qx=Symbol("_onerror"),Cx=Symbol("_onopen"),ACe=Symbol("_onread"),wx=Symbol("_onwrite"),tf=Symbol("_open"),wA=Symbol("_path"),YE=Symbol("_pos"),Jg=Symbol("_queue"),Hx=Symbol("_read"),pVt=Symbol("_readSize"),$v=Symbol("_reading"),xae=Symbol("_remain"),hVt=Symbol("_size"),jae=Symbol("_write"),Xx=Symbol("_writing"),Oae=Symbol("_defaultFlag"),Ex=Symbol("_errored"),zae=class extends P6n{constructor(e,n){if(n=n||{},super(n),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Ex]=!1,this[jr]=typeof n.fd=="number"?n.fd:null,this[wA]=e,this[pVt]=n.readSize||16*1024*1024,this[$v]=!1,this[hVt]=typeof n.size=="number"?n.size:1/0,this[xae]=this[hVt],this[Jx]=typeof n.autoClose=="boolean"?n.autoClose:!0,typeof this[jr]=="number"?this[Hx]():this[tf]()}get fd(){return this[jr]}get path(){return this[wA]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[tf](){dp.open(this[wA],"r",(e,n)=>this[Cx](e,n))}[Cx](e,n){e?this[Qx](e):(this[jr]=n,this.emit("open",n),this[Hx]())}[fCe](){return Buffer.allocUnsafe(Math.min(this[pVt],this[xae]))}[Hx](){if(!this[$v]){this[$v]=!0;let e=this[fCe]();if(e.length===0)return process.nextTick(()=>this[ACe](null,0,e));dp.read(this[jr],e,0,e.length,null,(n,l,I)=>this[ACe](n,l,I))}}[ACe](e,n,l){this[$v]=!1,e?this[Qx](e):this[vCe](n,l)&&this[Hx]()}[GV](){if(this[Jx]&&typeof this[jr]=="number"){let e=this[jr];this[jr]=null,dp.close(e,n=>n?this.emit("error",n):this.emit("close"))}}[Qx](e){this[$v]=!0,this[GV](),this.emit("error",e)}[vCe](e,n){let l=!1;return this[xae]-=e,e>0&&(l=super.write(ethis[Cx](e,n))}[Cx](e,n){this[Oae]&&this[ef]==="r+"&&e&&e.code==="ENOENT"?(this[ef]="w",this[tf]()):e?this[Qx](e):(this[jr]=n,this.emit("open",n),this[yCe]())}end(e,n){return e&&this.write(e,n),this[OM]=!0,!this[Xx]&&!this[Jg].length&&typeof this[jr]=="number"&&this[wx](null,0),this}write(e,n){return typeof e=="string"&&(e=Buffer.from(e,n)),this[OM]?(this.emit("error",new Error("write() after end()")),!1):this[jr]===null||this[Xx]||this[Jg].length?(this[Jg].push(e),this[kae]=!0,!1):(this[Xx]=!0,this[jae](e),!0)}[jae](e){dp.write(this[jr],e,0,e.length,this[YE],(n,l)=>this[wx](n,l))}[wx](e,n){e?this[Qx](e):(this[YE]!==null&&(this[YE]+=n),this[Jg].length?this[yCe]():(this[Xx]=!1,this[OM]&&!this[mVt]?(this[mVt]=!0,this[GV](),this.emit("finish")):this[kae]&&(this[kae]=!1,this.emit("drain"))))}[yCe](){if(this[Jg].length===0)this[OM]&&this[wx](null,0);else if(this[Jg].length===1)this[jae](this[Jg].pop());else{let e=this[Jg];this[Jg]=[],FCe(this[jr],e,this[YE],(n,l)=>this[wx](n,l))}}[GV](){if(this[Jx]&&typeof this[jr]=="number"){let e=this[jr];this[jr]=null,dp.close(e,n=>n?this.emit("error",n):this.emit("close"))}}},wCe=class extends Bae{[tf](){let e;if(this[Oae]&&this[ef]==="r+")try{e=dp.openSync(this[wA],this[ef],this[Uae])}catch(n){if(n.code==="ENOENT")return this[ef]="w",this[tf]();throw n}else e=dp.openSync(this[wA],this[ef],this[Uae]);this[Cx](null,e)}[GV](){if(this[Jx]&&typeof this[jr]=="number"){let e=this[jr];this[jr]=null,dp.closeSync(e),this.emit("close")}}[jae](e){let n=!0;try{this[wx](null,dp.writeSync(this[jr],e,0,e.length,this[YE])),n=!1}finally{if(n)try{this[GV]()}catch{}}}};UM.ReadStream=zae;UM.ReadStreamSync=XCe;UM.WriteStream=Bae;UM.WriteStreamSync=wCe});var Pae=f((dFa,FVt)=>{"use strict";var $6n=gae(),ZVt=Fx(),eqn=require("events"),tqn=bCe(),nqn=1024*1024,lqn=Nae(),WVt=Yae(),NVt=MJe(),{nextTick:Iqn}=d8(),HCe=Buffer.from([31,139]),eW=Symbol("state"),gE=Symbol("writeEntry"),HA=Symbol("readEntry"),QCe=Symbol("nextEntry"),VVt=Symbol("processEntry"),tW=Symbol("extendedHeader"),zM=Symbol("globalExtendedHeader"),nf=Symbol("meta"),YVt=Symbol("emitMeta"),uc=Symbol("buffer"),QA=Symbol("queue"),lf=Symbol("ended"),gVt=Symbol("emittedEnd"),RE=Symbol("emit"),yd=Symbol("unzip"),Sae=Symbol("consumeChunk"),Mae=Symbol("consumeChunkSub"),ECe=Symbol("consumeBody"),RVt=Symbol("consumeMeta"),yVt=Symbol("consumeHeader"),Tae=Symbol("consuming"),JCe=Symbol("bufferConcat"),CCe=Symbol("maybeEnd"),BM=Symbol("writing"),If=Symbol("aborted"),Dae=Symbol("onDone"),yE=Symbol("sawValidEntry"),Kae=Symbol("sawNullBlock"),_ae=Symbol("sawEOF"),AVt=Symbol("closeStream"),aqn=t=>!0;FVt.exports=$6n(class extends eqn{constructor(e){e=e||{},super(e),this.file=e.file||"",this[yE]=null,this.on(Dae,l=>{(this[eW]==="begin"||this[yE]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Dae,e.ondone):this.on(Dae,l=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||nqn,this.filter=typeof e.filter=="function"?e.filter:aqn;let n=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!e.gzip&&e.brotli!==void 0?e.brotli:n?void 0:!1,this.writable=!0,this.readable=!1,this[QA]=new tqn,this[uc]=null,this[HA]=null,this[gE]=null,this[eW]="begin",this[nf]="",this[tW]=null,this[zM]=null,this[lf]=!1,this[yd]=null,this[If]=!1,this[Kae]=!1,this[_ae]=!1,this.on("end",()=>this[AVt]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[yVt](e,n){this[yE]===null&&(this[yE]=!1);let l;try{l=new ZVt(e,n,this[tW],this[zM])}catch(I){return this.warn("TAR_ENTRY_INVALID",I)}if(l.nullBlock)this[Kae]?(this[_ae]=!0,this[eW]==="begin"&&(this[eW]="header"),this[RE]("eof")):(this[Kae]=!0,this[RE]("nullBlock"));else if(this[Kae]=!1,!l.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:l});else if(!l.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:l});else{let I=l.type;if(/^(Symbolic)?Link$/.test(I)&&!l.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:l});else if(!/^(Symbolic)?Link$/.test(I)&&l.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:l});else{let a=this[gE]=new lqn(l,this[tW],this[zM]);if(!this[yE])if(a.remain){let c=()=>{a.invalid||(this[yE]=!0)};a.on("end",c)}else this[yE]=!0;a.meta?a.size>this.maxMetaEntrySize?(a.ignore=!0,this[RE]("ignoredEntry",a),this[eW]="ignore",a.resume()):a.size>0&&(this[nf]="",a.on("data",c=>this[nf]+=c),this[eW]="meta"):(this[tW]=null,a.ignore=a.ignore||!this.filter(a.path,a),a.ignore?(this[RE]("ignoredEntry",a),this[eW]=a.remain?"ignore":"header",a.resume()):(a.remain?this[eW]="body":(this[eW]="header",a.end()),this[HA]?this[QA].push(a):(this[QA].push(a),this[QCe]())))}}}[AVt](){Iqn(()=>this.emit("close"))}[VVt](e){let n=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[HA]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",l=>this[QCe]()),n=!1)):(this[HA]=null,n=!1),n}[QCe](){do;while(this[VVt](this[QA].shift()));if(!this[QA].length){let e=this[HA];!e||e.flowing||e.size===e.remain?this[BM]||this.emit("drain"):e.once("drain",l=>this.emit("drain"))}}[ECe](e,n){let l=this[gE],I=l.blockRemain,a=I>=e.length&&n===0?e:e.slice(n,n+I);return l.write(a),l.blockRemain||(this[eW]="header",this[gE]=null,l.end()),a.length}[RVt](e,n){let l=this[gE],I=this[ECe](e,n);return this[gE]||this[YVt](l),I}[RE](e,n,l){!this[QA].length&&!this[HA]?this.emit(e,n,l):this[QA].push([e,n,l])}[YVt](e){switch(this[RE]("meta",this[nf]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[tW]=WVt.parse(this[nf],this[tW],!1);break;case"GlobalExtendedHeader":this[zM]=WVt.parse(this[nf],this[zM],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[tW]=this[tW]||Object.create(null),this[tW].path=this[nf].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[tW]=this[tW]||Object.create(null),this[tW].linkpath=this[nf].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[If]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[If])return;if((this[yd]===null||this.brotli===void 0&&this[yd]===!1)&&e){if(this[uc]&&(e=Buffer.concat([this[uc],e]),this[uc]=null),e.lengththis[Sae](i)),this[yd].on("error",i=>this.abort(i)),this[yd].on("end",i=>{this[lf]=!0,this[Sae]()}),this[BM]=!0;let c=this[yd][a?"end":"write"](e);return this[BM]=!1,c}}this[BM]=!0,this[yd]?this[yd].write(e):this[Sae](e),this[BM]=!1;let l=this[QA].length?!1:this[HA]?this[HA].flowing:!0;return!l&&!this[QA].length&&this[HA].once("drain",I=>this.emit("drain")),l}[JCe](e){e&&!this[If]&&(this[uc]=this[uc]?Buffer.concat([this[uc],e]):e)}[CCe](){if(this[lf]&&!this[gVt]&&!this[If]&&!this[Tae]){this[gVt]=!0;let e=this[gE];if(e&&e.blockRemain){let n=this[uc]?this[uc].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${n} available)`,{entry:e}),this[uc]&&e.write(this[uc]),e.end()}this[RE](Dae)}}[Sae](e){if(this[Tae])this[JCe](e);else if(!e&&!this[uc])this[CCe]();else{if(this[Tae]=!0,this[uc]){this[JCe](e);let n=this[uc];this[uc]=null,this[Mae](n)}else this[Mae](e);for(;this[uc]&&this[uc].length>=512&&!this[If]&&!this[_ae];){let n=this[uc];this[uc]=null,this[Mae](n)}this[Tae]=!1}(!this[uc]||this[lf])&&this[CCe]()}[Mae](e){let n=0,l=e.length;for(;n+512<=l&&!this[If]&&!this[_ae];)switch(this[eW]){case"begin":case"header":this[yVt](e,n),n+=512;break;case"ignore":case"body":n+=this[ECe](e,n);break;case"meta":n+=this[RVt](e,n);break;default:throw new Error("invalid state: "+this[eW])}n{"use strict";var rqn=Nx(),fVt=Pae(),kx=co(),cqn=Lx(),vVt=Ca(),LCe=vx();wVt.exports=(t,e,n)=>{typeof t=="function"?(n=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(n=e,e=null),e?e=Array.from(e):e=[];let l=rqn(t);if(l.sync&&typeof n=="function")throw new TypeError("callback not supported for sync tar functions");if(!l.file&&typeof n=="function")throw new TypeError("callback only supported with file option");return e.length&&iqn(l,e),l.noResume||oqn(l),l.file&&l.sync?sqn(l):l.file?uqn(l,n):XVt(l)};var oqn=t=>{let e=t.onentry;t.onentry=e?n=>{e(n),n.resume()}:n=>n.resume()},iqn=(t,e)=>{let n=new Map(e.map(a=>[LCe(a),!0])),l=t.filter,I=(a,c)=>{let i=c||vVt.parse(a).root||".",s=a===i?!1:n.has(a)?n.get(a):I(vVt.dirname(a),i);return n.set(a,s),s};t.filter=l?(a,c)=>l(a,c)&&I(LCe(a)):a=>I(LCe(a))},sqn=t=>{let e=XVt(t),n=t.file,l=!0,I;try{let a=kx.statSync(n),c=t.maxReadSize||16*1024*1024;if(a.size{let n=new fVt(t),l=t.maxReadSize||16*1024*1024,I=t.file,a=new Promise((c,i)=>{n.on("error",i),n.on("end",c),kx.stat(I,(s,r)=>{if(s)i(s);else{let u=new cqn.ReadStream(I,{readSize:l,size:r.size});u.on("error",i),u.pipe(n)}})});return e?a.then(e,e):a},XVt=t=>new fVt(t)});var LVt=f((bFa,CVt)=>{"use strict";var dqn=Nx(),$ae=Lae(),HVt=Lx(),QVt=qae(),EVt=Ca();CVt.exports=(t,e,n)=>{if(typeof e=="function"&&(n=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let l=dqn(t);if(l.sync&&typeof n=="function")throw new TypeError("callback not supported for sync tar functions");if(!l.file&&typeof n=="function")throw new TypeError("callback only supported with file option");return l.file&&l.sync?Gqn(l,e):l.file?bqn(l,e,n):l.sync?mqn(l,e):pqn(l,e)};var Gqn=(t,e)=>{let n=new $ae.Sync(t),l=new HVt.WriteStreamSync(t.file,{mode:t.mode||438});n.pipe(l),JVt(n,e)},bqn=(t,e,n)=>{let l=new $ae(t),I=new HVt.WriteStream(t.file,{mode:t.mode||438});l.pipe(I);let a=new Promise((c,i)=>{I.on("error",i),I.on("close",c),l.on("error",i)});return kCe(l,e),n?a.then(n,n):a},JVt=(t,e)=>{e.forEach(n=>{n.charAt(0)==="@"?QVt({file:EVt.resolve(t.cwd,n.slice(1)),sync:!0,noResume:!0,onentry:l=>t.add(l)}):t.add(n)}),t.end()},kCe=(t,e)=>{for(;e.length;){let n=e.shift();if(n.charAt(0)==="@")return QVt({file:EVt.resolve(t.cwd,n.slice(1)),noResume:!0,onentry:l=>t.add(l)}).then(l=>kCe(t,e));t.add(n)}t.end()},mqn=(t,e)=>{let n=new $ae.Sync(t);return JVt(n,e),n},pqn=(t,e)=>{let n=new $ae(t);return kCe(n,e),n}});var xCe=f((mFa,BVt)=>{"use strict";var hqn=Nx(),kVt=Lae(),Oh=co(),xVt=Lx(),jVt=qae(),OVt=Ca(),UVt=Fx();BVt.exports=(t,e,n)=>{let l=hqn(t);if(!l.file)throw new TypeError("file is required");if(l.gzip||l.brotli||l.file.endsWith(".br")||l.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),l.sync?Zqn(l,e):Nqn(l,e,n)};var Zqn=(t,e)=>{let n=new kVt.Sync(t),l=!0,I,a;try{try{I=Oh.openSync(t.file,"r+")}catch(s){if(s.code==="ENOENT")I=Oh.openSync(t.file,"w+");else throw s}let c=Oh.fstatSync(I),i=Buffer.alloc(512);e:for(a=0;ac.size)break;a+=r,t.mtimeCache&&t.mtimeCache.set(s.path,s.mtime)}l=!1,Wqn(t,n,a,I,e)}finally{if(l)try{Oh.closeSync(I)}catch{}}},Wqn=(t,e,n,l,I)=>{let a=new xVt.WriteStreamSync(t.file,{fd:l,start:n});e.pipe(a),Vqn(e,I)},Nqn=(t,e,n)=>{e=Array.from(e);let l=new kVt(t),I=(c,i,s)=>{let r=(h,Z)=>{h?Oh.close(c,N=>s(h)):s(null,Z)},u=0;if(i===0)return r(null,0);let o=0,d=Buffer.alloc(512),b=(h,Z)=>{if(h)return r(h);if(o+=Z,o<512&&Z)return Oh.read(c,d,o,d.length-o,u+o,b);if(u===0&&d[0]===31&&d[1]===139)return r(new Error("cannot append to compressed archives"));if(o<512)return r(null,u);let N=new UVt(d);if(!N.cksumValid)return r(null,u);let g=512*Math.ceil(N.size/512);if(u+g+512>i||(u+=g+512,u>=i))return r(null,u);t.mtimeCache&&t.mtimeCache.set(N.path,N.mtime),o=0,Oh.read(c,d,0,512,u,b)};Oh.read(c,d,0,512,u,b)},a=new Promise((c,i)=>{l.on("error",i);let s="r+",r=(u,o)=>{if(u&&u.code==="ENOENT"&&s==="r+")return s="w+",Oh.open(t.file,s,r);if(u)return i(u);Oh.fstat(o,(d,b)=>{if(d)return Oh.close(o,()=>i(d));I(o,b.size,(h,Z)=>{if(h)return i(h);let N=new xVt.WriteStream(t.file,{fd:o,start:Z});l.pipe(N),N.on("error",i),N.on("close",c),zVt(l,e)})})};Oh.open(t.file,s,r)});return n?a.then(n,n):a},Vqn=(t,e)=>{e.forEach(n=>{n.charAt(0)==="@"?jVt({file:OVt.resolve(t.cwd,n.slice(1)),sync:!0,noResume:!0,onentry:l=>t.add(l)}):t.add(n)}),t.end()},zVt=(t,e)=>{for(;e.length;){let n=e.shift();if(n.charAt(0)==="@")return jVt({file:OVt.resolve(t.cwd,n.slice(1)),noResume:!0,onentry:l=>t.add(l)}).then(l=>zVt(t,e));t.add(n)}t.end()}});var MVt=f((pFa,SVt)=>{"use strict";var Yqn=Nx(),gqn=xCe();SVt.exports=(t,e,n)=>{let l=Yqn(t);if(!l.file)throw new TypeError("file is required");if(l.gzip||l.brotli||l.file.endsWith(".br")||l.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),Rqn(l),gqn(l,e,n)};var Rqn=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(n,l)=>e(n,l)&&!(t.mtimeCache.get(n)>l.mtime):(n,l)=>!(t.mtimeCache.get(n)>l.mtime)}});var KVt=f((hFa,DVt)=>{var{promisify:TVt}=require("util"),af=co(),yqn=t=>{if(!t)t={mode:511,fs:af};else if(typeof t=="object")t={mode:511,fs:af,...t};else if(typeof t=="number")t={mode:t,fs:af};else if(typeof t=="string")t={mode:parseInt(t,8),fs:af};else throw new TypeError("invalid options argument");return t.mkdir=t.mkdir||t.fs.mkdir||af.mkdir,t.mkdirAsync=TVt(t.mkdir),t.stat=t.stat||t.fs.stat||af.stat,t.statAsync=TVt(t.stat),t.statSync=t.statSync||t.fs.statSync||af.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||af.mkdirSync,t};DVt.exports=yqn});var PVt=f((ZFa,_Vt)=>{var Aqn=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Fqn,parse:vqn}=Ca(),fqn=t=>{if(/\0/.test(t))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"});if(t=Fqn(t),Aqn==="win32"){let e=/[*|"<>?:]/,{root:n}=vqn(t);if(e.test(t.substr(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t};_Vt.exports=fqn});var nYt=f((WFa,tYt)=>{var{dirname:qVt}=Ca(),$Vt=(t,e,n=void 0)=>n===e?Promise.resolve():t.statAsync(e).then(l=>l.isDirectory()?n:void 0,l=>l.code==="ENOENT"?$Vt(t,qVt(e),e):void 0),eYt=(t,e,n=void 0)=>{if(n!==e)try{return t.statSync(e).isDirectory()?n:void 0}catch(l){return l.code==="ENOENT"?eYt(t,qVt(e),e):void 0}};tYt.exports={findMade:$Vt,findMadeSync:eYt}});var UCe=f((NFa,IYt)=>{var{dirname:lYt}=Ca(),jCe=(t,e,n)=>{e.recursive=!1;let l=lYt(t);return l===t?e.mkdirAsync(t,e).catch(I=>{if(I.code!=="EISDIR")throw I}):e.mkdirAsync(t,e).then(()=>n||t,I=>{if(I.code==="ENOENT")return jCe(l,e).then(a=>jCe(t,e,a));if(I.code!=="EEXIST"&&I.code!=="EROFS")throw I;return e.statAsync(t).then(a=>{if(a.isDirectory())return n;throw I},()=>{throw I})})},OCe=(t,e,n)=>{let l=lYt(t);if(e.recursive=!1,l===t)try{return e.mkdirSync(t,e)}catch(I){if(I.code!=="EISDIR")throw I;return}try{return e.mkdirSync(t,e),n||t}catch(I){if(I.code==="ENOENT")return OCe(t,e,OCe(l,e,n));if(I.code!=="EEXIST"&&I.code!=="EROFS")throw I;try{if(!e.statSync(t).isDirectory())throw I}catch{throw I}}};IYt.exports={mkdirpManual:jCe,mkdirpManualSync:OCe}});var cYt=f((VFa,rYt)=>{var{dirname:aYt}=Ca(),{findMade:Xqn,findMadeSync:wqn}=nYt(),{mkdirpManual:Hqn,mkdirpManualSync:Qqn}=UCe(),Eqn=(t,e)=>(e.recursive=!0,aYt(t)===t?e.mkdirAsync(t,e):Xqn(e,t).then(l=>e.mkdirAsync(t,e).then(()=>l).catch(I=>{if(I.code==="ENOENT")return Hqn(t,e);throw I}))),Jqn=(t,e)=>{if(e.recursive=!0,aYt(t)===t)return e.mkdirSync(t,e);let l=wqn(e,t);try{return e.mkdirSync(t,e),l}catch(I){if(I.code==="ENOENT")return Qqn(t,e);throw I}};rYt.exports={mkdirpNative:Eqn,mkdirpNativeSync:Jqn}});var uYt=f((YFa,sYt)=>{var oYt=co(),Cqn=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,zCe=Cqn.replace(/^v/,"").split("."),iYt=+zCe[0]>10||+zCe[0]==10&&+zCe[1]>=12,Lqn=iYt?t=>t.mkdir===oYt.mkdir:()=>!1,kqn=iYt?t=>t.mkdirSync===oYt.mkdirSync:()=>!1;sYt.exports={useNative:Lqn,useNativeSync:kqn}});var hYt=f((gFa,pYt)=>{var xx=KVt(),jx=PVt(),{mkdirpNative:dYt,mkdirpNativeSync:GYt}=cYt(),{mkdirpManual:bYt,mkdirpManualSync:mYt}=UCe(),{useNative:xqn,useNativeSync:jqn}=uYt(),Ox=(t,e)=>(t=jx(t),e=xx(e),xqn(e)?dYt(t,e):bYt(t,e)),Oqn=(t,e)=>(t=jx(t),e=xx(e),jqn(e)?GYt(t,e):mYt(t,e));Ox.sync=Oqn;Ox.native=(t,e)=>dYt(jx(t),xx(e));Ox.manual=(t,e)=>bYt(jx(t),xx(e));Ox.nativeSync=(t,e)=>GYt(jx(t),xx(e));Ox.manualSync=(t,e)=>mYt(jx(t),xx(e));pYt.exports=Ox});var RYt=f((RFa,gYt)=>{"use strict";var nW=co(),AE=Ca(),Uqn=nW.lchown?"lchown":"chown",zqn=nW.lchownSync?"lchownSync":"chownSync",WYt=nW.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),ZYt=(t,e,n)=>{try{return nW[zqn](t,e,n)}catch(l){if(l.code!=="ENOENT")throw l}},Bqn=(t,e,n)=>{try{return nW.chownSync(t,e,n)}catch(l){if(l.code!=="ENOENT")throw l}},Sqn=WYt?(t,e,n,l)=>I=>{!I||I.code!=="EISDIR"?l(I):nW.chown(t,e,n,l)}:(t,e,n,l)=>l,BCe=WYt?(t,e,n)=>{try{return ZYt(t,e,n)}catch(l){if(l.code!=="EISDIR")throw l;Bqn(t,e,n)}}:(t,e,n)=>ZYt(t,e,n),Mqn=process.version,NYt=(t,e,n)=>nW.readdir(t,e,n),Tqn=(t,e)=>nW.readdirSync(t,e);/^v4\./.test(Mqn)&&(NYt=(t,e,n)=>nW.readdir(t,n));var ere=(t,e,n,l)=>{nW[Uqn](t,e,n,Sqn(t,e,n,I=>{l(I&&I.code!=="ENOENT"?I:null)}))},VYt=(t,e,n,l,I)=>{if(typeof e=="string")return nW.lstat(AE.resolve(t,e),(a,c)=>{if(a)return I(a.code!=="ENOENT"?a:null);c.name=e,VYt(t,c,n,l,I)});if(e.isDirectory())SCe(AE.resolve(t,e.name),n,l,a=>{if(a)return I(a);let c=AE.resolve(t,e.name);ere(c,n,l,I)});else{let a=AE.resolve(t,e.name);ere(a,n,l,I)}},SCe=(t,e,n,l)=>{NYt(t,{withFileTypes:!0},(I,a)=>{if(I){if(I.code==="ENOENT")return l();if(I.code!=="ENOTDIR"&&I.code!=="ENOTSUP")return l(I)}if(I||!a.length)return ere(t,e,n,l);let c=a.length,i=null,s=r=>{if(!i){if(r)return l(i=r);if(--c===0)return ere(t,e,n,l)}};a.forEach(r=>VYt(t,r,e,n,s))})},Dqn=(t,e,n,l)=>{if(typeof e=="string")try{let I=nW.lstatSync(AE.resolve(t,e));I.name=e,e=I}catch(I){if(I.code==="ENOENT")return;throw I}e.isDirectory()&&YYt(AE.resolve(t,e.name),n,l),BCe(AE.resolve(t,e.name),n,l)},YYt=(t,e,n)=>{let l;try{l=Tqn(t,{withFileTypes:!0})}catch(I){if(I.code==="ENOENT")return;if(I.code==="ENOTDIR"||I.code==="ENOTSUP")return BCe(t,e,n);throw I}return l&&l.length&&l.forEach(I=>Dqn(t,I,e,n)),BCe(t,e,n)};gYt.exports=SCe;SCe.sync=YYt});var vYt=f((yFa,MCe)=>{"use strict";var yYt=hYt(),lW=co(),tre=Ca(),AYt=RYt(),bV=yx(),nre=class extends Error{constructor(e,n){super("Cannot extract through symbolic link"),this.path=n,this.symlink=e}get name(){return"SylinkError"}},lre=class extends Error{constructor(e,n){super(n+": Cannot cd into '"+e+"'"),this.path=e,this.code=n}get name(){return"CwdError"}},Ire=(t,e)=>t.get(bV(e)),SM=(t,e,n)=>t.set(bV(e),n),Kqn=(t,e)=>{lW.stat(t,(n,l)=>{(n||!l.isDirectory())&&(n=new lre(t,n&&n.code||"ENOTDIR")),e(n)})};MCe.exports=(t,e,n)=>{t=bV(t);let l=e.umask,I=e.mode|448,a=(I&l)!==0,c=e.uid,i=e.gid,s=typeof c=="number"&&typeof i=="number"&&(c!==e.processUid||i!==e.processGid),r=e.preserve,u=e.unlink,o=e.cache,d=bV(e.cwd),b=(N,g)=>{N?n(N):(SM(o,t,!0),g&&s?AYt(g,c,i,y=>b(y)):a?lW.chmod(t,I,n):n())};if(o&&Ire(o,t)===!0)return b();if(t===d)return Kqn(t,b);if(r)return yYt(t,{mode:I}).then(N=>b(null,N),b);let Z=bV(tre.relative(d,t)).split("/");are(d,Z,I,o,u,d,null,b)};var are=(t,e,n,l,I,a,c,i)=>{if(!e.length)return i(null,c);let s=e.shift(),r=bV(tre.resolve(t+"/"+s));if(Ire(l,r))return are(r,e,n,l,I,a,c,i);lW.mkdir(r,n,FYt(r,e,n,l,I,a,c,i))},FYt=(t,e,n,l,I,a,c,i)=>s=>{s?lW.lstat(t,(r,u)=>{if(r)r.path=r.path&&bV(r.path),i(r);else if(u.isDirectory())are(t,e,n,l,I,a,c,i);else if(I)lW.unlink(t,o=>{if(o)return i(o);lW.mkdir(t,n,FYt(t,e,n,l,I,a,c,i))});else{if(u.isSymbolicLink())return i(new nre(t,t+"/"+e.join("/")));i(s)}}):(c=c||t,are(t,e,n,l,I,a,c,i))},_qn=t=>{let e=!1,n="ENOTDIR";try{e=lW.statSync(t).isDirectory()}catch(l){n=l.code}finally{if(!e)throw new lre(t,n)}};MCe.exports.sync=(t,e)=>{t=bV(t);let n=e.umask,l=e.mode|448,I=(l&n)!==0,a=e.uid,c=e.gid,i=typeof a=="number"&&typeof c=="number"&&(a!==e.processUid||c!==e.processGid),s=e.preserve,r=e.unlink,u=e.cache,o=bV(e.cwd),d=N=>{SM(u,t,!0),N&&i&&AYt.sync(N,a,c),I&&lW.chmodSync(t,l)};if(u&&Ire(u,t)===!0)return d();if(t===o)return _qn(o),d();if(s)return d(yYt.sync(t,l));let h=bV(tre.relative(o,t)).split("/"),Z=null;for(let N=h.shift(),g=o;N&&(g+="/"+N);N=h.shift())if(g=bV(tre.resolve(g)),!Ire(u,g))try{lW.mkdirSync(g,l),Z=Z||g,SM(u,g,!0)}catch{let X=lW.lstatSync(g);if(X.isDirectory()){SM(u,g,!0);continue}else if(r){lW.unlinkSync(g),lW.mkdirSync(g,l),Z=Z||g,SM(u,g,!0);continue}else if(X.isSymbolicLink())return new nre(g,g+"/"+h.join("/"))}return d(Z)}});var DCe=f((AFa,fYt)=>{var TCe=Object.create(null),{hasOwnProperty:Pqn}=Object.prototype;fYt.exports=t=>(Pqn.call(TCe,t)||(TCe[t]=t.normalize("NFD")),TCe[t])});var QYt=f((FFa,HYt)=>{var XYt=require("assert"),qqn=DCe(),$qn=vx(),{join:wYt}=Ca(),e7n=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,t7n=e7n==="win32";HYt.exports=()=>{let t=new Map,e=new Map,n=r=>r.split("/").slice(0,-1).reduce((o,d)=>(o.length&&(d=wYt(o[o.length-1],d)),o.push(d||"/"),o),[]),l=new Set,I=r=>{let u=e.get(r);if(!u)throw new Error("function does not have any path reservations");return{paths:u.paths.map(o=>t.get(o)),dirs:[...u.dirs].map(o=>t.get(o))}},a=r=>{let{paths:u,dirs:o}=I(r);return u.every(d=>d[0]===r)&&o.every(d=>d[0]instanceof Set&&d[0].has(r))},c=r=>l.has(r)||!a(r)?!1:(l.add(r),r(()=>i(r)),!0),i=r=>{if(!l.has(r))return!1;let{paths:u,dirs:o}=e.get(r),d=new Set;return u.forEach(b=>{let h=t.get(b);XYt.equal(h[0],r),h.length===1?t.delete(b):(h.shift(),typeof h[0]=="function"?d.add(h[0]):h[0].forEach(Z=>d.add(Z)))}),o.forEach(b=>{let h=t.get(b);XYt(h[0]instanceof Set),h[0].size===1&&h.length===1?t.delete(b):h[0].size===1?(h.shift(),d.add(h[0])):h[0].delete(r)}),l.delete(r),d.forEach(b=>c(b)),!0};return{check:a,reserve:(r,u)=>{r=t7n?["win32 parallelization disabled"]:r.map(d=>$qn(wYt(qqn(d))).toLowerCase());let o=new Set(r.map(d=>n(d)).reduce((d,b)=>d.concat(b)));return e.set(u,{dirs:o,paths:r}),r.forEach(d=>{let b=t.get(d);b?b.push(u):t.set(d,[u])}),o.forEach(d=>{let b=t.get(d);b?b[b.length-1]instanceof Set?b[b.length-1].add(u):b.push(new Set([u])):t.set(d,[new Set([u])])}),c(u)}}}});var CYt=f((vFa,JYt)=>{var n7n=process.env.__FAKE_PLATFORM__||process.platform,l7n=n7n==="win32",I7n=global.__FAKE_TESTING_FS__||co(),{O_CREAT:a7n,O_TRUNC:r7n,O_WRONLY:c7n,UV_FS_O_FILEMAP:EYt=0}=I7n.constants,o7n=l7n&&!!EYt,i7n=512*1024,s7n=EYt|r7n|a7n|c7n;JYt.exports=o7n?t=>t"w"});var l5e=f((fFa,_Yt)=>{"use strict";var u7n=require("assert"),d7n=Pae(),ka=co(),G7n=Lx(),EA=Ca(),TYt=vYt(),LYt=nCe(),b7n=QYt(),m7n=lCe(),IW=yx(),p7n=vx(),h7n=DCe(),kYt=Symbol("onEntry"),PCe=Symbol("checkFs"),xYt=Symbol("checkFs2"),ore=Symbol("pruneCache"),qCe=Symbol("isReusable"),aW=Symbol("makeFs"),$Ce=Symbol("file"),e5e=Symbol("directory"),ire=Symbol("link"),jYt=Symbol("symlink"),OYt=Symbol("hardlink"),UYt=Symbol("unsupported"),zYt=Symbol("checkPath"),rf=Symbol("mkdir"),pb=Symbol("onError"),rre=Symbol("pending"),BYt=Symbol("pend"),Ux=Symbol("unpend"),KCe=Symbol("ended"),_Ce=Symbol("maybeClose"),t5e=Symbol("skip"),MM=Symbol("doChown"),TM=Symbol("uid"),DM=Symbol("gid"),KM=Symbol("checkedCwd"),DYt=require("crypto"),KYt=CYt(),Z7n=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,_M=Z7n==="win32",W7n=1024,N7n=(t,e)=>{if(!_M)return ka.unlink(t,e);let n=t+".DELETE."+DYt.randomBytes(16).toString("hex");ka.rename(t,n,l=>{if(l)return e(l);ka.unlink(n,e)})},V7n=t=>{if(!_M)return ka.unlinkSync(t);let e=t+".DELETE."+DYt.randomBytes(16).toString("hex");ka.renameSync(t,e),ka.unlinkSync(e)},SYt=(t,e,n)=>t===t>>>0?t:e===e>>>0?e:n,MYt=t=>p7n(IW(h7n(t))).toLowerCase(),Y7n=(t,e)=>{e=MYt(e);for(let n of t.keys()){let l=MYt(n);(l===e||l.indexOf(e+"/")===0)&&t.delete(n)}},g7n=t=>{for(let e of t.keys())t.delete(e)},PM=class extends d7n{constructor(e){if(e||(e={}),e.ondone=n=>{this[KCe]=!0,this[_Ce]()},super(e),this[KM]=!1,this.reservations=b7n(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[rre]=0,this[KCe]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:W7n,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||_M,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=IW(EA.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",n=>this[kYt](n))}warn(e,n,l={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(l.recoverable=!1),super.warn(e,n,l)}[_Ce](){this[KCe]&&this[rre]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[zYt](e){let n=IW(e.path),l=n.split("/");if(this.strip){if(l.length=this.strip)e.linkpath=I.slice(this.strip).join("/");else return!1}l.splice(0,this.strip),e.path=l.join("/")}if(isFinite(this.maxDepth)&&l.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:n,depth:l.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(l.includes("..")||_M&&/^[a-z]:\.\.$/i.test(l[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:n}),!1;let[I,a]=m7n(n);I&&(e.path=a,this.warn("TAR_ENTRY_INFO",`stripping ${I} from absolute path`,{entry:e,path:n}))}if(EA.isAbsolute(e.path)?e.absolute=IW(EA.resolve(e.path)):e.absolute=IW(EA.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:IW(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:I}=EA.win32.parse(e.absolute);e.absolute=I+LYt.encode(e.absolute.slice(I.length));let{root:a}=EA.win32.parse(e.path);e.path=a+LYt.encode(e.path.slice(a.length))}return!0}[kYt](e){if(!this[zYt](e))return e.resume();switch(u7n.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[PCe](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[UYt](e)}}[pb](e,n){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:n}),this[Ux](),n.resume())}[rf](e,n,l){TYt(IW(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:n,noChmod:this.noChmod},l)}[MM](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[TM](e){return SYt(this.uid,e.uid,this.processUid)}[DM](e){return SYt(this.gid,e.gid,this.processGid)}[$Ce](e,n){let l=e.mode&4095||this.fmode,I=new G7n.WriteStream(e.absolute,{flags:KYt(e.size),mode:l,autoClose:!1});I.on("error",s=>{I.fd&&ka.close(I.fd,()=>{}),I.write=()=>!0,this[pb](s,e),n()});let a=1,c=s=>{if(s){I.fd&&ka.close(I.fd,()=>{}),this[pb](s,e),n();return}--a===0&&ka.close(I.fd,r=>{r?this[pb](r,e):this[Ux](),n()})};I.on("finish",s=>{let r=e.absolute,u=I.fd;if(e.mtime&&!this.noMtime){a++;let o=e.atime||new Date,d=e.mtime;ka.futimes(u,o,d,b=>b?ka.utimes(r,o,d,h=>c(h&&b)):c())}if(this[MM](e)){a++;let o=this[TM](e),d=this[DM](e);ka.fchown(u,o,d,b=>b?ka.chown(r,o,d,h=>c(h&&b)):c())}c()});let i=this.transform&&this.transform(e)||e;i!==e&&(i.on("error",s=>{this[pb](s,e),n()}),e.pipe(i)),i.pipe(I)}[e5e](e,n){let l=e.mode&4095||this.dmode;this[rf](e.absolute,l,I=>{if(I){this[pb](I,e),n();return}let a=1,c=i=>{--a===0&&(n(),this[Ux](),e.resume())};e.mtime&&!this.noMtime&&(a++,ka.utimes(e.absolute,e.atime||new Date,e.mtime,c)),this[MM](e)&&(a++,ka.chown(e.absolute,this[TM](e),this[DM](e),c)),c()})}[UYt](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[jYt](e,n){this[ire](e,e.linkpath,"symlink",n)}[OYt](e,n){let l=IW(EA.resolve(this.cwd,e.linkpath));this[ire](e,l,"link",n)}[BYt](){this[rre]++}[Ux](){this[rre]--,this[_Ce]()}[t5e](e){this[Ux](),e.resume()}[qCe](e,n){return e.type==="File"&&!this.unlink&&n.isFile()&&n.nlink<=1&&!_M}[PCe](e){this[BYt]();let n=[e.path];e.linkpath&&n.push(e.linkpath),this.reservations.reserve(n,l=>this[xYt](e,l))}[ore](e){e.type==="SymbolicLink"?g7n(this.dirCache):e.type!=="Directory"&&Y7n(this.dirCache,e.absolute)}[xYt](e,n){this[ore](e);let l=i=>{this[ore](e),n(i)},I=()=>{this[rf](this.cwd,this.dmode,i=>{if(i){this[pb](i,e),l();return}this[KM]=!0,a()})},a=()=>{if(e.absolute!==this.cwd){let i=IW(EA.dirname(e.absolute));if(i!==this.cwd)return this[rf](i,this.dmode,s=>{if(s){this[pb](s,e),l();return}c()})}c()},c=()=>{ka.lstat(e.absolute,(i,s)=>{if(s&&(this.keep||this.newer&&s.mtime>e.mtime)){this[t5e](e),l();return}if(i||this[qCe](e,s))return this[aW](null,e,l);if(s.isDirectory()){if(e.type==="Directory"){let r=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,u=o=>this[aW](o,e,l);return r?ka.chmod(e.absolute,e.mode,u):u()}if(e.absolute!==this.cwd)return ka.rmdir(e.absolute,r=>this[aW](r,e,l))}if(e.absolute===this.cwd)return this[aW](null,e,l);N7n(e.absolute,r=>this[aW](r,e,l))})};this[KM]?a():I()}[aW](e,n,l){if(e){this[pb](e,n),l();return}switch(n.type){case"File":case"OldFile":case"ContiguousFile":return this[$Ce](n,l);case"Link":return this[OYt](n,l);case"SymbolicLink":return this[jYt](n,l);case"Directory":case"GNUDumpDir":return this[e5e](n,l)}}[ire](e,n,l,I){ka[l](n,e.absolute,a=>{a?this[pb](a,e):(this[Ux](),e.resume()),I()})}},cre=t=>{try{return[null,t()]}catch(e){return[e,null]}},n5e=class extends PM{[aW](e,n){return super[aW](e,n,()=>{})}[PCe](e){if(this[ore](e),!this[KM]){let a=this[rf](this.cwd,this.dmode);if(a)return this[pb](a,e);this[KM]=!0}if(e.absolute!==this.cwd){let a=IW(EA.dirname(e.absolute));if(a!==this.cwd){let c=this[rf](a,this.dmode);if(c)return this[pb](c,e)}}let[n,l]=cre(()=>ka.lstatSync(e.absolute));if(l&&(this.keep||this.newer&&l.mtime>e.mtime))return this[t5e](e);if(n||this[qCe](e,l))return this[aW](null,e);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,[i]=c?cre(()=>{ka.chmodSync(e.absolute,e.mode)}):[];return this[aW](i,e)}let[a]=cre(()=>ka.rmdirSync(e.absolute));this[aW](a,e)}let[I]=e.absolute===this.cwd?[]:cre(()=>V7n(e.absolute));this[aW](I,e)}[$Ce](e,n){let l=e.mode&4095||this.fmode,I=i=>{let s;try{ka.closeSync(a)}catch(r){s=r}(i||s)&&this[pb](i||s,e),n()},a;try{a=ka.openSync(e.absolute,KYt(e.size),l)}catch(i){return I(i)}let c=this.transform&&this.transform(e)||e;c!==e&&(c.on("error",i=>this[pb](i,e)),e.pipe(c)),c.on("data",i=>{try{ka.writeSync(a,i,0,i.length)}catch(s){I(s)}}),c.on("end",i=>{let s=null;if(e.mtime&&!this.noMtime){let r=e.atime||new Date,u=e.mtime;try{ka.futimesSync(a,r,u)}catch(o){try{ka.utimesSync(e.absolute,r,u)}catch{s=o}}}if(this[MM](e)){let r=this[TM](e),u=this[DM](e);try{ka.fchownSync(a,r,u)}catch(o){try{ka.chownSync(e.absolute,r,u)}catch{s=s||o}}}I(s)})}[e5e](e,n){let l=e.mode&4095||this.dmode,I=this[rf](e.absolute,l);if(I){this[pb](I,e),n();return}if(e.mtime&&!this.noMtime)try{ka.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[MM](e))try{ka.chownSync(e.absolute,this[TM](e),this[DM](e))}catch{}n(),e.resume()}[rf](e,n){try{return TYt.sync(IW(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:n})}catch(l){return l}}[ire](e,n,l,I){try{ka[l+"Sync"](n,e.absolute),I(),e.resume()}catch(a){return this[pb](a,e)}}};PM.Sync=n5e;_Yt.exports=PM});var tgt=f((XFa,egt)=>{"use strict";var R7n=Nx(),sre=l5e(),qYt=co(),$Yt=Lx(),PYt=Ca(),I5e=vx();egt.exports=(t,e,n)=>{typeof t=="function"?(n=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(n=e,e=null),e?e=Array.from(e):e=[];let l=R7n(t);if(l.sync&&typeof n=="function")throw new TypeError("callback not supported for sync tar functions");if(!l.file&&typeof n=="function")throw new TypeError("callback only supported with file option");return e.length&&y7n(l,e),l.file&&l.sync?A7n(l):l.file?F7n(l,n):l.sync?v7n(l):f7n(l)};var y7n=(t,e)=>{let n=new Map(e.map(a=>[I5e(a),!0])),l=t.filter,I=(a,c)=>{let i=c||PYt.parse(a).root||".",s=a===i?!1:n.has(a)?n.get(a):I(PYt.dirname(a),i);return n.set(a,s),s};t.filter=l?(a,c)=>l(a,c)&&I(I5e(a)):a=>I(I5e(a))},A7n=t=>{let e=new sre.Sync(t),n=t.file,l=qYt.statSync(n),I=t.maxReadSize||16*1024*1024;new $Yt.ReadStreamSync(n,{readSize:I,size:l.size}).pipe(e)},F7n=(t,e)=>{let n=new sre(t),l=t.maxReadSize||16*1024*1024,I=t.file,a=new Promise((c,i)=>{n.on("error",i),n.on("close",c),qYt.stat(I,(s,r)=>{if(s)i(s);else{let u=new $Yt.ReadStream(I,{readSize:l,size:r.size});u.on("error",i),u.pipe(n)}})});return e?a.then(e,e):a},v7n=t=>new sre.Sync(t),f7n=t=>new sre(t)});var ngt=f(ad=>{"use strict";ad.c=ad.create=LVt();ad.r=ad.replace=xCe();ad.t=ad.list=qae();ad.u=ad.update=MVt();ad.x=ad.extract=tgt();ad.Pack=Lae();ad.Unpack=l5e();ad.Parse=Pae();ad.ReadEntry=Nae();ad.WriteEntry=GCe();ad.Header=Fx();ad.Pax=Yae();ad.types=KJe()});var Zgt=f((TFa,pre)=>{pre.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&pre.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&pre.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var ggt=f((DFa,Kx)=>{var Mc=global.process,FE=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};FE(Mc)?(Wgt=require("assert"),Tx=Zgt(),Ngt=/^win/i.test(Mc.platform),qM=require("events"),typeof qM!="function"&&(qM=qM.EventEmitter),Mc.__signal_exit_emitter__?Ad=Mc.__signal_exit_emitter__:(Ad=Mc.__signal_exit_emitter__=new qM,Ad.count=0,Ad.emitted={}),Ad.infinite||(Ad.setMaxListeners(1/0),Ad.infinite=!0),Kx.exports=function(t,e){if(!FE(global.process))return function(){};Wgt.equal(typeof t,"function","a callback must be provided for exit handler"),Dx===!1&&a5e();var n="exit";e&&e.alwaysLast&&(n="afterexit");var l=function(){Ad.removeListener(n,t),Ad.listeners("exit").length===0&&Ad.listeners("afterexit").length===0&&hre()};return Ad.on(n,t),l},hre=function(){!Dx||!FE(global.process)||(Dx=!1,Tx.forEach(function(e){try{Mc.removeListener(e,Zre[e])}catch{}}),Mc.emit=Wre,Mc.reallyExit=r5e,Ad.count-=1)},Kx.exports.unload=hre,vE=function(e,n,l){Ad.emitted[e]||(Ad.emitted[e]=!0,Ad.emit(e,n,l))},Zre={},Tx.forEach(function(t){Zre[t]=function(){if(FE(global.process)){var n=Mc.listeners(t);n.length===Ad.count&&(hre(),vE("exit",null,t),vE("afterexit",null,t),Ngt&&t==="SIGHUP"&&(t="SIGINT"),Mc.kill(Mc.pid,t))}}}),Kx.exports.signals=function(){return Tx},Dx=!1,a5e=function(){Dx||!FE(global.process)||(Dx=!0,Ad.count+=1,Tx=Tx.filter(function(e){try{return Mc.on(e,Zre[e]),!0}catch{return!1}}),Mc.emit=Ygt,Mc.reallyExit=Vgt)},Kx.exports.load=a5e,r5e=Mc.reallyExit,Vgt=function(e){FE(global.process)&&(Mc.exitCode=e||0,vE("exit",Mc.exitCode,null),vE("afterexit",Mc.exitCode,null),r5e.call(Mc,Mc.exitCode))},Wre=Mc.emit,Ygt=function(e,n){if(e==="exit"&&FE(global.process)){n!==void 0&&(Mc.exitCode=n);var l=Wre.apply(this,arguments);return vE("exit",Mc.exitCode,null),vE("afterexit",Mc.exitCode,null),l}else return Wre.apply(this,arguments)}):Kx.exports=function(){return function(){}};var Wgt,Tx,Ngt,qM,Ad,hre,vE,Zre,Dx,a5e,r5e,Vgt,Wre,Ygt});var o5e=f(oo=>{var rd=co(),c5e="wx";process.version.match(/^v0\.[0-6]/)&&($M=require("constants"),c5e=$M.O_TRUNC|$M.O_CREAT|$M.O_WRONLY|$M.O_EXCL);var $M,x7n=require("os");oo.filetime="ctime";x7n.platform()=="win32"&&(oo.filetime="mtime");var xa,Nre=require("util");Nre.debuglog?xa=Nre.debuglog("LOCKFILE"):/\blockfile\b/i.test(process.env.NODE_DEBUG)?xa=function(){var t=Nre.format.apply(Nre,arguments);console.error("LOCKFILE %d %s",process.pid,t)}:xa=function(){};var _x={},j7n=ggt();j7n(function(){xa("exit listener"),Object.keys(_x).forEach(oo.unlockSync)});/^v0\.[0-8]\./.test(process.version)&&(xa("uncaughtException, version = %s",process.version),process.on("uncaughtException",function t(e){xa("uncaughtException");var n=process.listeners("uncaughtException").filter(function(l){return l!==t});if(!n.length){try{Object.keys(_x).forEach(oo.unlockSync)}catch{}throw process.removeListener("uncaughtException",t),e}}));oo.unlock=function(t,e){xa("unlock",t),delete _x[t],rd.unlink(t,function(n){e&&e()})};oo.unlockSync=function(t){xa("unlockSync",t);try{rd.unlinkSync(t)}catch{}delete _x[t]};oo.check=function(t,e,n){typeof e=="function"&&(n=e,e={}),xa("check",t,e),rd.open(t,"r",function(l,I){if(l)return l.code!=="ENOENT"?n(l):n(null,!1);if(!e.stale)return rd.close(I,function(a){return n(a,!0)});rd.fstat(I,function(a,c){if(a)return rd.close(I,function(i){return n(a)});rd.close(I,function(i){var s=Date.now()-c[oo.filetime].getTime();return n(i,s<=e.stale)})})})};oo.checkSync=function(t,e){if(e=e||{},xa("checkSync",t,e),e.wait)throw new Error("opts.wait not supported sync for obvious reasons");try{var n=rd.openSync(t,"r")}catch(a){if(a.code!=="ENOENT")throw a;return!1}if(!e.stale){try{rd.closeSync(n)}catch{}return!0}if(e.stale){try{var l=rd.fstatSync(n)}finally{rd.closeSync(n)}var I=Date.now()-l[oo.filetime].getTime();return I<=e.stale}};var ygt=1;oo.lock=function(t,e,n){if(typeof e=="function"&&(n=e,e={}),e.req=e.req||ygt++,xa("lock",t,e),e.start=e.start||Date.now(),typeof e.retries=="number"&&e.retries>0){xa("has retries",e.retries);var l=e.retries;e.retries=0,n=function(I){return function a(c,i){if(xa("retry-mutated callback"),l-=1,!c||l<0)return I(c,i);xa("lock retry",t,e),e.retryWait?setTimeout(s,e.retryWait):s();function s(){e.start=Date.now(),xa("retrying",e.start),oo.lock(t,e,a)}}}(n)}rd.open(t,c5e,function(I,a){return I?(xa("failed to acquire lock",I),I.code!=="EEXIST"?(xa("not EEXIST error",I),n(I)):e.stale?Agt(I,t,e,!1,n):Fgt(I,t,e,n)):(xa("locked",t,a),_x[t]=a,rd.close(a,function(){return n()}))}),xa("lock return")};function Agt(t,e,n,l,I){rd.stat(e,function(a,c){if(a){if(a.code==="ENOENT"){n.stale=!1,xa("lock stale enoent retry",e,n),oo.lock(e,n,I);return}return I(a)}var i=Date.now()-c[oo.filetime].getTime();if(i<=n.stale)return Fgt(t,e,n,I);xa("lock stale",e,n),l?oo.unlock(e,function(s){if(s)return I(s);xa("lock stale retry",e,n),rd.link(e+".STALE",e,function(r){rd.unlink(e+".STALE",function(){I(r)})})}):(xa("acquire .STALE file lock",n),oo.lock(e+".STALE",n,function(s){if(s)return I(s);Agt(t,e,n,!0,I)}))})}function Fgt(t,e,n,l){if(xa("notStale",e,n),typeof n.wait!="number"||n.wait<=0)return xa("notStale, wait is not a number"),l(t);var I=Date.now(),a=n.start||I,c=a+n.wait;if(c<=I)return l(t);xa("now=%d, wait until %d (delta=%d)",a,c,c-a);var i=Math.min(c-a,n.pollPeriod||100),s=setTimeout(r,i);function r(){xa("notStale, polling",e,n),oo.lock(e,n,l)}}oo.lockSync=function(t,e){if(e=e||{},e.req=e.req||ygt++,xa("lockSync",t,e),e.wait||e.retryWait)throw new Error("opts.wait not supported sync for obvious reasons");try{var n=rd.openSync(t,c5e);_x[t]=n;try{rd.closeSync(n)}catch{}xa("locked sync!",t,n);return}catch(c){if(c.code!=="EEXIST")return Rgt(t,e,c);if(e.stale){var l=rd.statSync(t),I=l[oo.filetime].getTime();!(I%1e3)&&e.stale%1e3&&(e.stale=1e3*Math.ceil(e.stale/1e3));var a=Date.now()-I;if(a>e.stale)return xa("lockSync stale",t,e,a),oo.unlockSync(t),oo.lockSync(t,e)}return xa("failed to lock",t,e,c),Rgt(t,e,c)}};function Rgt(t,e,n){if(typeof e.retries=="number"&&e.retries>0){var l=e.retries-1;return xa("retryThrow",t,e,l),e.retries=l,oo.lockSync(t,e)}throw n}});var oRt=f(Gc=>{"use strict";function V5e(t,e){var n=t.length;t.push(e);e:for(;0>>1,I=t[l];if(0>>1;lFre(i,n))sFre(r,i)?(t[l]=r,t[s]=n,l=s):(t[l]=i,t[c]=n,l=c);else if(sFre(r,n))t[l]=r,t[s]=n,l=s;else break e}}return e}function Fre(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}typeof performance=="object"&&typeof performance.now=="function"?($gt=performance,Gc.unstable_now=function(){return $gt.now()}):(Z5e=Date,eRt=Z5e.now(),Gc.unstable_now=function(){return Z5e.now()-eRt});var $gt,Z5e,eRt,Cg=[],sf=[],K7n=1,cW=null,Wb=3,Xre=!1,wE=!1,rT=!1,lRt=typeof setTimeout=="function"?setTimeout:null,IRt=typeof clearTimeout=="function"?clearTimeout:null,tRt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Y5e(t){for(var e=mV(sf);e!==null;){if(e.callback===null)fre(sf);else if(e.startTime<=t)fre(sf),e.sortIndex=e.expirationTime,V5e(Cg,e);else break;e=mV(sf)}}function g5e(t){if(rT=!1,Y5e(t),!wE)if(mV(Cg)!==null)wE=!0,y5e(R5e);else{var e=mV(sf);e!==null&&A5e(g5e,e.startTime-t)}}function R5e(t,e){wE=!1,rT&&(rT=!1,IRt(cT),cT=-1),Xre=!0;var n=Wb;try{for(Y5e(e),cW=mV(Cg);cW!==null&&(!(cW.expirationTime>e)||t&&!cRt());){var l=cW.callback;if(typeof l=="function"){cW.callback=null,Wb=cW.priorityLevel;var I=l(cW.expirationTime<=e);e=Gc.unstable_now(),typeof I=="function"?cW.callback=I:cW===mV(Cg)&&fre(Cg),Y5e(e)}else fre(Cg);cW=mV(Cg)}if(cW!==null)var a=!0;else{var c=mV(sf);c!==null&&A5e(g5e,c.startTime-e),a=!1}return a}finally{cW=null,Wb=n,Xre=!1}}var wre=!1,vre=null,cT=-1,aRt=5,rRt=-1;function cRt(){return!(Gc.unstable_now()-rRtt||125l?(t.sortIndex=n,V5e(sf,t),mV(Cg)===null&&t===mV(sf)&&(rT?(IRt(cT),cT=-1):rT=!0,A5e(g5e,n-l))):(t.sortIndex=I,V5e(Cg,t),wE||Xre||(wE=!0,y5e(R5e))),t};Gc.unstable_shouldYield=cRt;Gc.unstable_wrapCallback=function(t){var e=Wb;return function(){var n=Wb;Wb=e;try{return t.apply(this,arguments)}finally{Wb=n}}}});var sRt=f((E2a,iRt)=>{"use strict";iRt.exports=oRt()});var b0t=f(Th=>{"use strict";var _7n=Ae(),Sh=sRt();function Ke(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),K5e=Object.prototype.hasOwnProperty,P7n=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,uRt={},dRt={};function q7n(t){return K5e.call(dRt,t)?!0:K5e.call(uRt,t)?!1:P7n.test(t)?dRt[t]=!0:(uRt[t]=!0,!1)}function $7n(t,e,n,l){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function e8n(t,e,n,l){if(e===null||typeof e>"u"||$7n(t,e,n,l))return!0;if(l)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Zm(t,e,n,l,I,a,c){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=l,this.attributeNamespace=I,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=c}var RG={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){RG[t]=new Zm(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];RG[e]=new Zm(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){RG[t]=new Zm(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){RG[t]=new Zm(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){RG[t]=new Zm(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){RG[t]=new Zm(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){RG[t]=new Zm(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){RG[t]=new Zm(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){RG[t]=new Zm(t,5,!1,t.toLowerCase(),null,!1,!1)});var OLe=/[\-:]([a-z])/g;function ULe(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(OLe,ULe);RG[e]=new Zm(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(OLe,ULe);RG[e]=new Zm(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(OLe,ULe);RG[e]=new Zm(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){RG[t]=new Zm(t,1,!1,t.toLowerCase(),null,!1,!1)});RG.xlinkHref=new Zm("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){RG[t]=new Zm(t,1,!1,t.toLowerCase(),null,!0,!0)});function zLe(t,e,n,l){var I=RG.hasOwnProperty(e)?RG[e]:null;(I!==null?I.type!==0:l||!(2i||I[c]!==a[i]){var s=` +`+I[c].replace(" at new "," at ");return t.displayName&&s.includes("")&&(s=s.replace("",t.displayName)),s}while(1<=c&&0<=i);break}}}finally{v5e=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?pT(t):""}function t8n(t){switch(t.tag){case 5:return pT(t.type);case 16:return pT("Lazy");case 13:return pT("Suspense");case 19:return pT("SuspenseList");case 0:case 2:case 15:return t=f5e(t.type,!1),t;case 11:return t=f5e(t.type.render,!1),t;case 1:return t=f5e(t.type,!0),t;default:return""}}function $5e(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case a3:return"Fragment";case I3:return"Portal";case _5e:return"Profiler";case BLe:return"StrictMode";case P5e:return"Suspense";case q5e:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Wyt:return(t.displayName||"Context")+".Consumer";case Zyt:return(t._context.displayName||"Context")+".Provider";case SLe:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case MLe:return e=t.displayName||null,e!==null?e:$5e(t.type)||"Memo";case df:e=t._payload,t=t._init;try{return $5e(t(e))}catch{}}return null}function n8n(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $5e(e);case 8:return e===BLe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Af(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Vyt(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function l8n(t){var e=Vyt(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),l=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var I=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return I.call(this)},set:function(c){l=""+c,a.call(this,c)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Qre(t){t._valueTracker||(t._valueTracker=l8n(t))}function Yyt(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),l="";return t&&(l=Vyt(t)?t.checked?"true":"false":t.value),t=l,t!==n?(e.setValue(t),!0):!1}function cce(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function eLe(t,e){var n=e.checked;return uo({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function bRt(t,e){var n=e.defaultValue==null?"":e.defaultValue,l=e.checked!=null?e.checked:e.defaultChecked;n=Af(e.value!=null?e.value:n),t._wrapperState={initialChecked:l,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function gyt(t,e){e=e.checked,e!=null&&zLe(t,"checked",e,!1)}function tLe(t,e){gyt(t,e);var n=Af(e.value),l=e.type;if(n!=null)l==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(l==="submit"||l==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?nLe(t,e.type,n):e.hasOwnProperty("defaultValue")&&nLe(t,e.type,Af(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function mRt(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var l=e.type;if(!(l!=="submit"&&l!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function nLe(t,e,n){(e!=="number"||cce(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var hT=Array.isArray;function p3(t,e,n,l){if(t=t.options,e){e={};for(var I=0;I"+e.valueOf().toString()+"",e=Ere.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function XT(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var NT={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},I8n=["Webkit","ms","Moz","O"];Object.keys(NT).forEach(function(t){I8n.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),NT[e]=NT[t]})});function Fyt(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||NT.hasOwnProperty(t)&&NT[t]?(""+e).trim():e+"px"}function vyt(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var l=n.indexOf("--")===0,I=Fyt(n,e[n],l);n==="float"&&(n="cssFloat"),l?t.setProperty(n,I):t[n]=I}}var a8n=uo({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function aLe(t,e){if(e){if(a8n[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ke(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ke(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ke(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ke(62))}}function rLe(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cLe=null;function TLe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var oLe=null,h3=null,Z3=null;function ZRt(t){if(t=DT(t)){if(typeof oLe!="function")throw Error(Ke(280));var e=t.stateNode;e&&(e=Jce(e),oLe(t.stateNode,t.type,e))}}function fyt(t){h3?Z3?Z3.push(t):Z3=[t]:h3=t}function Xyt(){if(h3){var t=h3,e=Z3;if(Z3=h3=null,ZRt(t),e)for(t=0;t>>=0,t===0?32:31-(p8n(t)/h8n|0)|0}var Jre=64,Cre=4194304;function ZT(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function uce(t,e){var n=t.pendingLanes;if(n===0)return 0;var l=0,I=t.suspendedLanes,a=t.pingedLanes,c=n&268435455;if(c!==0){var i=c&~I;i!==0?l=ZT(i):(a&=c,a!==0&&(l=ZT(a)))}else c=n&~I,c!==0?l=ZT(c):a!==0&&(l=ZT(a));if(l===0)return 0;if(e!==0&&e!==l&&!(e&I)&&(I=l&-l,a=e&-e,I>=a||I===16&&(a&4194240)!==0))return e;if(l&4&&(l|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=l;0n;n++)e.push(t);return e}function MT(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-NV(e),t[e]=n}function V8n(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var l=t.eventTimes;for(t=t.expirationTimes;0=YT),FRt=" ",vRt=!1;function _yt(t,e){switch(t){case"keyup":return K8n.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pyt(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var r3=!1;function P8n(t,e){switch(t){case"compositionend":return Pyt(e);case"keypress":return e.which!==32?null:(vRt=!0,FRt);case"textInput":return t=e.data,t===FRt&&vRt?null:t;default:return null}}function q8n(t,e){if(r3)return t==="compositionend"||!tke&&_yt(t,e)?(t=Dyt(),qre=qLe=pf=null,r3=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wRt(n)}}function tAt(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?tAt(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function nAt(){for(var t=window,e=cce();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=cce(t.document)}return e}function nke(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function c$n(t){var e=nAt(),n=t.focusedElem,l=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&tAt(n.ownerDocument.documentElement,n)){if(l!==null&&nke(n)){if(e=l.start,t=l.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var I=n.textContent.length,a=Math.min(l.start,I);l=l.end===void 0?a:Math.min(l.end,I),!t.extend&&a>l&&(I=l,l=a,a=I),I=HRt(n,a);var c=HRt(n,l);I&&c&&(t.rangeCount!==1||t.anchorNode!==I.node||t.anchorOffset!==I.offset||t.focusNode!==c.node||t.focusOffset!==c.offset)&&(e=e.createRange(),e.setStart(I.node,I.offset),t.removeAllRanges(),a>l?(t.addRange(e),t.extend(c.node,c.offset)):(e.setEnd(c.node,c.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,c3=null,bLe=null,RT=null,mLe=!1;function QRt(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mLe||c3==null||c3!==cce(l)||(l=c3,"selectionStart"in l&&nke(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),RT&&CT(RT,l)||(RT=l,l=bce(bLe,"onSelect"),0s3||(t.current=VLe[s3],VLe[s3]=null,s3--)}function bc(t,e){s3++,VLe[s3]=t.current,t.current=e}var Ff={},gb=ff(Ff),pp=ff(!1),xE=Ff;function g3(t,e){var n=t.type.contextTypes;if(!n)return Ff;var l=t.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===e)return l.__reactInternalMemoizedMaskedChildContext;var I={},a;for(a in n)I[a]=e[a];return l&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=I),I}function hp(t){return t=t.childContextTypes,t!=null}function pce(){fc(pp),fc(gb)}function URt(t,e,n){if(gb.current!==Ff)throw Error(Ke(168));bc(gb,e),bc(pp,n)}function uAt(t,e,n){var l=t.stateNode;if(e=e.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var I in l)if(!(I in e))throw Error(Ke(108,n8n(t)||"Unknown",I));return uo({},n,l)}function hce(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ff,xE=gb.current,bc(gb,t),bc(pp,pp.current),!0}function zRt(t,e,n){var l=t.stateNode;if(!l)throw Error(Ke(169));n?(t=uAt(t,e,xE),l.__reactInternalMemoizedMergedChildContext=t,fc(pp),fc(gb),bc(gb,t)):fc(pp),bc(pp,n)}var kA=null,Cce=!1,j5e=!1;function dAt(t){kA===null?kA=[t]:kA.push(t)}function h$n(t){Cce=!0,dAt(t)}function Xf(){if(!j5e&&kA!==null){j5e=!0;var t=0,e=Qr;try{var n=kA;for(Qr=1;t>=c,I-=c,xA=1<<32-NV(e)+I|n<J?(O=L,L=null):O=L.sibling;var U=d(g,L,X[J],v);if(U===null){L===null&&(L=O);break}t&&L&&U.alternate===null&&e(g,L),y=a(U,y,J),Q===null?H=U:Q.sibling=U,Q=U,L=O}if(J===X.length)return n(g,L),Tc&&HE(g,J),H;if(L===null){for(;JJ?(O=L,L=null):O=L.sibling;var K=d(g,L,U.value,v);if(K===null){L===null&&(L=O);break}t&&L&&K.alternate===null&&e(g,L),y=a(K,y,J),Q===null?H=K:Q.sibling=K,Q=K,L=O}if(U.done)return n(g,L),Tc&&HE(g,J),H;if(L===null){for(;!U.done;J++,U=X.next())U=o(g,U.value,v),U!==null&&(y=a(U,y,J),Q===null?H=U:Q.sibling=U,Q=U);return Tc&&HE(g,J),H}for(L=l(g,L);!U.done;J++,U=X.next())U=b(L,g,J,U.value,v),U!==null&&(t&&U.alternate!==null&&L.delete(U.key===null?J:U.key),y=a(U,y,J),Q===null?H=U:Q.sibling=U,Q=U);return t&&L.forEach(function(D){return e(g,D)}),Tc&&HE(g,J),H}function N(g,y,X,v){if(typeof X=="object"&&X!==null&&X.type===a3&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case Hre:e:{for(var H=X.key,Q=y;Q!==null;){if(Q.key===H){if(H=X.type,H===a3){if(Q.tag===7){n(g,Q.sibling),y=I(Q,X.props.children),y.return=g,g=y;break e}}else if(Q.elementType===H||typeof H=="object"&&H!==null&&H.$$typeof===df&&MRt(H)===Q.type){n(g,Q.sibling),y=I(Q,X.props),y.ref=dT(g,Q,X),y.return=g,g=y;break e}n(g,Q);break}else e(g,Q);Q=Q.sibling}X.type===a3?(y=kE(X.props.children,g.mode,v,X.key),y.return=g,g=y):(v=rce(X.type,X.key,X.props,null,g.mode,v),v.ref=dT(g,y,X),v.return=g,g=v)}return c(g);case I3:e:{for(Q=X.key;y!==null;){if(y.key===Q)if(y.tag===4&&y.stateNode.containerInfo===X.containerInfo&&y.stateNode.implementation===X.implementation){n(g,y.sibling),y=I(y,X.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else e(g,y);y=y.sibling}y=D5e(X,g.mode,v),y.return=g,g=y}return c(g);case df:return Q=X._init,N(g,y,Q(X._payload),v)}if(hT(X))return h(g,y,X,v);if(oT(X))return Z(g,y,X,v);Tre(g,X)}return typeof X=="string"&&X!==""||typeof X=="number"?(X=""+X,y!==null&&y.tag===6?(n(g,y.sibling),y=I(y,X),y.return=g,g=y):(n(g,y),y=T5e(X,g.mode,v),y.return=g,g=y),c(g)):n(g,y)}return N}var y3=pAt(!0),hAt=pAt(!1),Nce=ff(null),Vce=null,G3=null,rke=null;function cke(){rke=G3=Vce=null}function oke(t){var e=Nce.current;fc(Nce),t._currentValue=e}function RLe(t,e,n){for(;t!==null;){var l=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,l!==null&&(l.childLanes|=e)):l!==null&&(l.childLanes&e)!==e&&(l.childLanes|=e),t===n)break;t=t.return}}function N3(t,e){Vce=t,rke=G3=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(mp=!0),t.firstContext=null)}function dW(t){var e=t._currentValue;if(rke!==t)if(t={context:t,memoizedValue:e,next:null},G3===null){if(Vce===null)throw Error(Ke(308));G3=t,Vce.dependencies={lanes:0,firstContext:t}}else G3=G3.next=t;return e}var JE=null;function ike(t){JE===null?JE=[t]:JE.push(t)}function ZAt(t,e,n,l){var I=e.interleaved;return I===null?(n.next=n,ike(e)):(n.next=I.next,I.next=n),e.interleaved=n,BA(t,l)}function BA(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Gf=!1;function ske(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function WAt(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function OA(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Yf(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,ya&2){var I=l.pending;return I===null?e.next=e:(e.next=I.next,I.next=e),l.pending=e,BA(t,n)}return I=l.interleaved,I===null?(e.next=e,ike(l)):(e.next=I.next,I.next=e),l.interleaved=e,BA(t,n)}function ece(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,KLe(t,n)}}function TRt(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var I=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var c={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?I=a=c:a=a.next=c,n=n.next}while(n!==null);a===null?I=a=e:a=a.next=e}else I=a=e;n={baseState:l.baseState,firstBaseUpdate:I,lastBaseUpdate:a,shared:l.shared,effects:l.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Yce(t,e,n,l){var I=t.updateQueue;Gf=!1;var a=I.firstBaseUpdate,c=I.lastBaseUpdate,i=I.shared.pending;if(i!==null){I.shared.pending=null;var s=i,r=s.next;s.next=null,c===null?a=r:c.next=r,c=s;var u=t.alternate;u!==null&&(u=u.updateQueue,i=u.lastBaseUpdate,i!==c&&(i===null?u.firstBaseUpdate=r:i.next=r,u.lastBaseUpdate=s))}if(a!==null){var o=I.baseState;c=0,u=r=s=null,i=a;do{var d=i.lane,b=i.eventTime;if((l&d)===d){u!==null&&(u=u.next={eventTime:b,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var h=t,Z=i;switch(d=e,b=n,Z.tag){case 1:if(h=Z.payload,typeof h=="function"){o=h.call(b,o,d);break e}o=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=Z.payload,d=typeof h=="function"?h.call(b,o,d):h,d==null)break e;o=uo({},o,d);break e;case 2:Gf=!0}}i.callback!==null&&i.lane!==0&&(t.flags|=64,d=I.effects,d===null?I.effects=[i]:d.push(i))}else b={eventTime:b,lane:d,tag:i.tag,payload:i.payload,callback:i.callback,next:null},u===null?(r=u=b,s=o):u=u.next=b,c|=d;if(i=i.next,i===null){if(i=I.shared.pending,i===null)break;d=i,i=d.next,d.next=null,I.lastBaseUpdate=d,I.shared.pending=null}}while(!0);if(u===null&&(s=o),I.baseState=s,I.firstBaseUpdate=r,I.lastBaseUpdate=u,e=I.shared.interleaved,e!==null){I=e;do c|=I.lane,I=I.next;while(I!==e)}else a===null&&(I.shared.lanes=0);UE|=c,t.lanes=c,t.memoizedState=o}}function DRt(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var l=U5e.transition;U5e.transition={};try{t(!1),e()}finally{Qr=n,U5e.transition=l}}function CAt(){return GW().memoizedState}function V$n(t,e,n){var l=Rf(t);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},LAt(t))kAt(e,n);else if(n=ZAt(t,e,n,l),n!==null){var I=hm();VV(n,t,l,I),xAt(n,e,l)}}function Y$n(t,e,n){var l=Rf(t),I={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(LAt(t))kAt(e,I);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var c=e.lastRenderedState,i=a(c,n);if(I.hasEagerState=!0,I.eagerState=i,YV(i,c)){var s=e.interleaved;s===null?(I.next=I,ike(e)):(I.next=s.next,s.next=I),e.interleaved=I;return}}catch{}finally{}n=ZAt(t,e,I,l),n!==null&&(I=hm(),VV(n,t,l,I),xAt(n,e,l))}}function LAt(t){var e=t.alternate;return t===so||e!==null&&e===so}function kAt(t,e){yT=Rce=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function xAt(t,e,n){if(n&4194240){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,KLe(t,n)}}var yce={readContext:dW,useCallback:Nb,useContext:Nb,useEffect:Nb,useImperativeHandle:Nb,useInsertionEffect:Nb,useLayoutEffect:Nb,useMemo:Nb,useReducer:Nb,useRef:Nb,useState:Nb,useDebugValue:Nb,useDeferredValue:Nb,useTransition:Nb,useMutableSource:Nb,useSyncExternalStore:Nb,useId:Nb,unstable_isNewReconciler:!1},g$n={readContext:dW,useCallback:function(t,e){return kg().memoizedState=[t,e===void 0?null:e],t},useContext:dW,useEffect:_Rt,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,nce(4194308,4,wAt.bind(null,e,t),n)},useLayoutEffect:function(t,e){return nce(4194308,4,t,e)},useInsertionEffect:function(t,e){return nce(4,2,t,e)},useMemo:function(t,e){var n=kg();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var l=kg();return e=n!==void 0?n(e):e,l.memoizedState=l.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},l.queue=t,t=t.dispatch=V$n.bind(null,so,t),[l.memoizedState,t]},useRef:function(t){var e=kg();return t={current:t},e.memoizedState=t},useState:KRt,useDebugValue:Zke,useDeferredValue:function(t){return kg().memoizedState=t},useTransition:function(){var t=KRt(!1),e=t[0];return t=N$n.bind(null,t[1]),kg().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var l=so,I=kg();if(Tc){if(n===void 0)throw Error(Ke(407));n=n()}else{if(n=e(),vd===null)throw Error(Ke(349));OE&30||gAt(l,e,n)}I.memoizedState=n;var a={value:n,getSnapshot:e};return I.queue=a,_Rt(yAt.bind(null,l,a,t),[t]),l.flags|=2048,BT(9,RAt.bind(null,l,a,n,e),void 0,null),n},useId:function(){var t=kg(),e=vd.identifierPrefix;if(Tc){var n=jA,l=xA;n=(l&~(1<<32-NV(l)-1)).toString(32)+n,e=":"+e+"R"+n,n=UT++,0<\/script>",t=t.removeChild(t.firstChild)):typeof l.is=="string"?t=c.createElement(n,{is:l.is}):(t=c.createElement(n),n==="select"&&(c=t,l.multiple?c.multiple=!0:l.size&&(c.size=l.size))):t=c.createElementNS(t,n),t[xg]=e,t[xT]=l,KAt(t,e,!1,!1),e.stateNode=t;e:{switch(c=rLe(n,l),n){case"dialog":vc("cancel",t),vc("close",t),I=l;break;case"iframe":case"object":case"embed":vc("load",t),I=l;break;case"video":case"audio":for(I=0;Iv3&&(e.flags|=128,l=!0,GT(a,!1),e.lanes=4194304)}else{if(!l)if(t=gce(c),t!==null){if(e.flags|=128,l=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),GT(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!Tc)return Vb(e),null}else 2*Do()-a.renderingStartTime>v3&&n!==1073741824&&(e.flags|=128,l=!0,GT(a,!1),e.lanes=4194304);a.isBackwards?(c.sibling=e.child,e.child=c):(n=a.last,n!==null?n.sibling=c:e.child=c,a.last=c)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Do(),e.sibling=null,n=io.current,bc(io,l?n&1|2:n&1),e):(Vb(e),null);case 22:case 23:return Rke(),l=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==l&&(e.flags|=8192),l&&e.mode&1?Uh&1073741824&&(Vb(e),e.subtreeFlags&6&&(e.flags|=8192)):Vb(e),null;case 24:return null;case 25:return null}throw Error(Ke(156,e.tag))}function w$n(t,e){switch(Ike(e),e.tag){case 1:return hp(e.type)&&pce(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return A3(),fc(pp),fc(gb),Gke(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return dke(e),null;case 13:if(fc(io),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ke(340));R3()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return fc(io),null;case 4:return A3(),null;case 10:return oke(e.type._context),null;case 22:case 23:return Rke(),null;case 24:return null;default:return null}}var Kre=!1,Yb=!1,H$n=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function b3(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Eo(t,e,l)}else n.current=null}function QLe(t,e,n){try{n()}catch(l){Eo(t,e,l)}}var cyt=!1;function Q$n(t,e){if(pLe=dce,t=nAt(),nke(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var I=l.anchorOffset,a=l.focusNode;l=l.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var c=0,i=-1,s=-1,r=0,u=0,o=t,d=null;t:for(;;){for(var b;o!==n||I!==0&&o.nodeType!==3||(i=c+I),o!==a||l!==0&&o.nodeType!==3||(s=c+l),o.nodeType===3&&(c+=o.nodeValue.length),(b=o.firstChild)!==null;)d=o,o=b;for(;;){if(o===t)break t;if(d===n&&++r===I&&(i=c),d===a&&++u===l&&(s=c),(b=o.nextSibling)!==null)break;o=d,d=o.parentNode}o=b}n=i===-1||s===-1?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(hLe={focusedElem:t,selectionRange:n},dce=!1,Lt=e;Lt!==null;)if(e=Lt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Lt=t;else for(;Lt!==null;){e=Lt;try{var h=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var Z=h.memoizedProps,N=h.memoizedState,g=e.stateNode,y=g.getSnapshotBeforeUpdate(e.elementType===e.type?Z:hV(e.type,Z),N);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var X=e.stateNode.containerInfo;X.nodeType===1?X.textContent="":X.nodeType===9&&X.documentElement&&X.removeChild(X.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ke(163))}}catch(v){Eo(e,e.return,v)}if(t=e.sibling,t!==null){t.return=e.return,Lt=t;break}Lt=e.return}return h=cyt,cyt=!1,h}function AT(t,e,n){var l=e.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var I=l=l.next;do{if((I.tag&t)===t){var a=I.destroy;I.destroy=void 0,a!==void 0&&QLe(e,n,a)}I=I.next}while(I!==l)}}function xce(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var l=n.create;n.destroy=l()}n=n.next}while(n!==e)}}function ELe(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function qAt(t){var e=t.alternate;e!==null&&(t.alternate=null,qAt(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[xg],delete e[xT],delete e[NLe],delete e[m$n],delete e[p$n])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function $At(t){return t.tag===5||t.tag===3||t.tag===4}function oyt(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||$At(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function JLe(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=mce));else if(l!==4&&(t=t.child,t!==null))for(JLe(t,e,n),t=t.sibling;t!==null;)JLe(t,e,n),t=t.sibling}function CLe(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(t=t.child,t!==null))for(CLe(t,e,n),t=t.sibling;t!==null;)CLe(t,e,n),t=t.sibling}var YG=null,ZV=!1;function uf(t,e,n){for(n=n.child;n!==null;)e0t(t,e,n),n=n.sibling}function e0t(t,e,n){if(jg&&typeof jg.onCommitFiberUnmount=="function")try{jg.onCommitFiberUnmount(wce,n)}catch{}switch(n.tag){case 5:Yb||b3(n,e);case 6:var l=YG,I=ZV;YG=null,uf(t,e,n),YG=l,ZV=I,YG!==null&&(ZV?(t=YG,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):YG.removeChild(n.stateNode));break;case 18:YG!==null&&(ZV?(t=YG,n=n.stateNode,t.nodeType===8?x5e(t.parentNode,n):t.nodeType===1&&x5e(t,n),ET(t)):x5e(YG,n.stateNode));break;case 4:l=YG,I=ZV,YG=n.stateNode.containerInfo,ZV=!0,uf(t,e,n),YG=l,ZV=I;break;case 0:case 11:case 14:case 15:if(!Yb&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){I=l=l.next;do{var a=I,c=a.destroy;a=a.tag,c!==void 0&&(a&2||a&4)&&QLe(n,e,c),I=I.next}while(I!==l)}uf(t,e,n);break;case 1:if(!Yb&&(b3(n,e),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(i){Eo(n,e,i)}uf(t,e,n);break;case 21:uf(t,e,n);break;case 22:n.mode&1?(Yb=(l=Yb)||n.memoizedState!==null,uf(t,e,n),Yb=l):uf(t,e,n);break;default:uf(t,e,n)}}function iyt(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new H$n),e.forEach(function(l){var I=U$n.bind(null,t,l);n.has(l)||(n.add(l),l.then(I,I))})}}function pV(t,e){var n=e.deletions;if(n!==null)for(var l=0;lI&&(I=c),l&=~a}if(l=I,l=Do()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*J$n(l/1960))-l,10t?16:t,hf===null)var l=!1;else{if(t=hf,hf=null,vce=0,ya&6)throw Error(Ke(331));var I=ya;for(ya|=4,Lt=t.current;Lt!==null;){var a=Lt,c=a.child;if(Lt.flags&16){var i=a.deletions;if(i!==null){for(var s=0;sDo()-Yke?LE(t,0):Vke|=n),Zp(t,e)}function o0t(t,e){e===0&&(t.mode&1?(e=Cre,Cre<<=1,!(Cre&130023424)&&(Cre=4194304)):e=1);var n=hm();t=BA(t,e),t!==null&&(MT(t,e,n),Zp(t,n))}function O$n(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),o0t(t,n)}function U$n(t,e){var n=0;switch(t.tag){case 13:var l=t.stateNode,I=t.memoizedState;I!==null&&(n=I.retryLane);break;case 19:l=t.stateNode;break;default:throw Error(Ke(314))}l!==null&&l.delete(e),o0t(t,n)}var i0t;i0t=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||pp.current)mp=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return mp=!1,f$n(t,e,n);mp=!!(t.flags&131072)}else mp=!1,Tc&&e.flags&1048576&&GAt(e,Wce,e.index);switch(e.lanes=0,e.tag){case 2:var l=e.type;lce(t,e),t=e.pendingProps;var I=g3(e,gb.current);N3(e,n),I=mke(null,e,l,t,I,n);var a=pke();return e.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,hp(l)?(a=!0,hce(e)):a=!1,e.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,ske(e),I.updater=kce,e.stateNode=I,I._reactInternals=e,ALe(e,l,t,n),e=fLe(null,e,l,!0,a,n)):(e.tag=0,Tc&&a&&lke(e),pm(null,e,I,n),e=e.child),e;case 16:l=e.elementType;e:{switch(lce(t,e),t=e.pendingProps,I=l._init,l=I(l._payload),e.type=l,I=e.tag=B$n(l),t=hV(l,t),I){case 0:e=vLe(null,e,l,t,n);break e;case 1:e=Iyt(null,e,l,t,n);break e;case 11:e=nyt(null,e,l,t,n);break e;case 14:e=lyt(null,e,l,hV(l.type,t),n);break e}throw Error(Ke(306,l,""))}return e;case 0:return l=e.type,I=e.pendingProps,I=e.elementType===l?I:hV(l,I),vLe(t,e,l,I,n);case 1:return l=e.type,I=e.pendingProps,I=e.elementType===l?I:hV(l,I),Iyt(t,e,l,I,n);case 3:e:{if(MAt(e),t===null)throw Error(Ke(387));l=e.pendingProps,a=e.memoizedState,I=a.element,WAt(t,e),Yce(e,l,null,n);var c=e.memoizedState;if(l=c.element,a.isDehydrated)if(a={element:l,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){I=F3(Error(Ke(423)),e),e=ayt(t,e,l,n,I);break e}else if(l!==I){I=F3(Error(Ke(424)),e),e=ayt(t,e,l,n,I);break e}else for(zh=Vf(e.stateNode.containerInfo.firstChild),Bh=e,Tc=!0,WV=null,n=hAt(e,null,l,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(R3(),l===I){e=SA(t,e,n);break e}pm(t,e,l,n)}e=e.child}return e;case 5:return NAt(e),t===null&&gLe(e),l=e.type,I=e.pendingProps,a=t!==null?t.memoizedProps:null,c=I.children,ZLe(l,I)?c=null:a!==null&&ZLe(l,a)&&(e.flags|=32),SAt(t,e),pm(t,e,c,n),e.child;case 6:return t===null&&gLe(e),null;case 13:return TAt(t,e,n);case 4:return uke(e,e.stateNode.containerInfo),l=e.pendingProps,t===null?e.child=y3(e,null,l,n):pm(t,e,l,n),e.child;case 11:return l=e.type,I=e.pendingProps,I=e.elementType===l?I:hV(l,I),nyt(t,e,l,I,n);case 7:return pm(t,e,e.pendingProps,n),e.child;case 8:return pm(t,e,e.pendingProps.children,n),e.child;case 12:return pm(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(l=e.type._context,I=e.pendingProps,a=e.memoizedProps,c=I.value,bc(Nce,l._currentValue),l._currentValue=c,a!==null)if(YV(a.value,c)){if(a.children===I.children&&!pp.current){e=SA(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){c=a.child;for(var s=i.firstContext;s!==null;){if(s.context===l){if(a.tag===1){s=OA(-1,n&-n),s.tag=2;var r=a.updateQueue;if(r!==null){r=r.shared;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}}a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),RLe(a.return,n,e),i.lanes|=n;break}s=s.next}}else if(a.tag===10)c=a.type===e.type?null:a.child;else if(a.tag===18){if(c=a.return,c===null)throw Error(Ke(341));c.lanes|=n,i=c.alternate,i!==null&&(i.lanes|=n),RLe(c,n,e),c=a.sibling}else c=a.child;if(c!==null)c.return=a;else for(c=a;c!==null;){if(c===e){c=null;break}if(a=c.sibling,a!==null){a.return=c.return,c=a;break}c=c.return}a=c}pm(t,e,I.children,n),e=e.child}return e;case 9:return I=e.type,l=e.pendingProps.children,N3(e,n),I=dW(I),l=l(I),e.flags|=1,pm(t,e,l,n),e.child;case 14:return l=e.type,I=hV(l,e.pendingProps),I=hV(l.type,I),lyt(t,e,l,I,n);case 15:return zAt(t,e,e.type,e.pendingProps,n);case 17:return l=e.type,I=e.pendingProps,I=e.elementType===l?I:hV(l,I),lce(t,e),e.tag=1,hp(l)?(t=!0,hce(e)):t=!1,N3(e,n),jAt(e,l,I),ALe(e,l,I,n),fLe(null,e,l,!0,t,n);case 19:return DAt(t,e,n);case 22:return BAt(t,e,n)}throw Error(Ke(156,e.tag))};function s0t(t,e){return Lyt(t,e)}function z$n(t,e,n,l){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sW(t,e,n,l){return new z$n(t,e,n,l)}function Ake(t){return t=t.prototype,!(!t||!t.isReactComponent)}function B$n(t){if(typeof t=="function")return Ake(t)?1:0;if(t!=null){if(t=t.$$typeof,t===SLe)return 11;if(t===MLe)return 14}return 2}function yf(t,e){var n=t.alternate;return n===null?(n=sW(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function rce(t,e,n,l,I,a){var c=2;if(l=t,typeof t=="function")Ake(t)&&(c=1);else if(typeof t=="string")c=5;else e:switch(t){case a3:return kE(n.children,I,a,e);case BLe:c=8,I|=8;break;case _5e:return t=sW(12,n,e,I|2),t.elementType=_5e,t.lanes=a,t;case P5e:return t=sW(13,n,e,I),t.elementType=P5e,t.lanes=a,t;case q5e:return t=sW(19,n,e,I),t.elementType=q5e,t.lanes=a,t;case Nyt:return Oce(n,I,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Zyt:c=10;break e;case Wyt:c=9;break e;case SLe:c=11;break e;case MLe:c=14;break e;case df:c=16,l=null;break e}throw Error(Ke(130,t==null?t:typeof t,""))}return e=sW(c,n,e,I),e.elementType=t,e.type=l,e.lanes=a,e}function kE(t,e,n,l){return t=sW(7,t,l,e),t.lanes=n,t}function Oce(t,e,n,l){return t=sW(22,t,l,e),t.elementType=Nyt,t.lanes=n,t.stateNode={isHidden:!1},t}function T5e(t,e,n){return t=sW(6,t,null,e),t.lanes=n,t}function D5e(t,e,n){return e=sW(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function S$n(t,e,n,l,I){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=w5e(0),this.expirationTimes=w5e(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=w5e(0),this.identifierPrefix=l,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function Fke(t,e,n,l,I,a,c,i,s){return t=new S$n(t,e,n,i,s),e===1?(e=1,a===!0&&(e|=8)):e=0,a=sW(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ske(a),t}function M$n(t,e,n){var l=3{"use strict";function m0t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m0t)}catch(t){console.error(t)}}m0t(),p0t.exports=b0t()});var bW=f(wke=>{"use strict";var h0t=_T();wke.createRoot=h0t.createRoot,wke.hydrateRoot=h0t.hydrateRoot;var L2a});var g0t=f(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});qT.default=void 0;var P$n=Object.assign||function(t){for(var e=1;e{function xke(t,e,n){var l,I,a,c,i;e==null&&(e=100);function s(){var u=Date.now()-c;u=0?l=setTimeout(s,e-u):(l=null,n||(i=t.apply(a,I),a=I=null))}var r=function(){a=this,I=arguments,c=Date.now();var u=n&&!l;return l||(l=setTimeout(s,e)),u&&(i=t.apply(a,I),a=I=null),i};return r.clear=function(){l&&(clearTimeout(l),l=null)},r.flush=function(){l&&(i=t.apply(a,I),a=I=null,clearTimeout(l),l=null)},r}xke.debounce=xke;X0t.exports=xke});var J0t=f(KE=>{"use strict";function Q0t(t){return t&&typeof t=="object"&&"default"in t?t.default:t}Object.defineProperty(KE,"__esModule",{value:!0});var iel=Q0t(w0t()),sel=Q0t(require("util"));function yG(){yG=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,l=Object.defineProperty||function(D,_,P){D[_]=P.value},I=typeof Symbol=="function"?Symbol:{},a=I.iterator||"@@iterator",c=I.asyncIterator||"@@asyncIterator",i=I.toStringTag||"@@toStringTag";function s(D,_,P){return Object.defineProperty(D,_,{value:P,enumerable:!0,configurable:!0,writable:!0}),D[_]}try{s({},"")}catch{s=function(_,P,le){return _[P]=le}}function r(D,_,P,le){var q=Object.create((_&&_.prototype instanceof d?_:d).prototype),ee=new O(le||[]);return l(q,"_invoke",{value:H(D,P,ee)}),q}function u(D,_,P){try{return{type:"normal",arg:D.call(_,P)}}catch(le){return{type:"throw",arg:le}}}t.wrap=r;var o={};function d(){}function b(){}function h(){}var Z={};s(Z,a,function(){return this});var N=Object.getPrototypeOf,g=N&&N(N(U([])));g&&g!==e&&n.call(g,a)&&(Z=g);var y=h.prototype=d.prototype=Object.create(Z);function X(D){["next","throw","return"].forEach(function(_){s(D,_,function(P){return this._invoke(_,P)})})}function v(D,_){var P;l(this,"_invoke",{value:function(le,q){function ee(){return new _(function(ne,ie){(function me(Ze,Fe,ce,fe){var ke=u(D[Ze],D,Fe);if(ke.type!=="throw"){var j=ke.arg,E=j.value;return E&&typeof E=="object"&&n.call(E,"__await")?_.resolve(E.__await).then(function(S){me("next",S,ce,fe)},function(S){me("throw",S,ce,fe)}):_.resolve(E).then(function(S){j.value=S,ce(j)},function(S){return me("throw",S,ce,fe)})}fe(ke.arg)})(le,q,ne,ie)})}return P=P?P.then(ee,ee):ee()}})}function H(D,_,P){var le="suspendedStart";return function(q,ee){if(le==="executing")throw new Error("Generator is already running");if(le==="completed"){if(q==="throw")throw ee;return{value:void 0,done:!0}}for(P.method=q,P.arg=ee;;){var ne=P.delegate;if(ne){var ie=Q(ne,P);if(ie){if(ie===o)continue;return ie}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(le==="suspendedStart")throw le="completed",P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);le="executing";var me=u(D,_,P);if(me.type==="normal"){if(le=P.done?"completed":"suspendedYield",me.arg===o)continue;return{value:me.arg,done:P.done}}me.type==="throw"&&(le="completed",P.method="throw",P.arg=me.arg)}}}function Q(D,_){var P=_.method,le=D.iterator[P];if(le===void 0)return _.delegate=null,P==="throw"&&D.iterator.return&&(_.method="return",_.arg=void 0,Q(D,_),_.method==="throw")||P!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+P+"' method")),o;var q=u(le,D.iterator,_.arg);if(q.type==="throw")return _.method="throw",_.arg=q.arg,_.delegate=null,o;var ee=q.arg;return ee?ee.done?(_[D.resultName]=ee.value,_.next=D.nextLoc,_.method!=="return"&&(_.method="next",_.arg=void 0),_.delegate=null,o):ee:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,o)}function L(D){var _={tryLoc:D[0]};1 in D&&(_.catchLoc=D[1]),2 in D&&(_.finallyLoc=D[2],_.afterLoc=D[3]),this.tryEntries.push(_)}function J(D){var _=D.completion||{};_.type="normal",delete _.arg,D.completion=_}function O(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(L,this),this.reset(!0)}function U(D){if(D){var _=D[a];if(_)return _.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length)){var P=-1,le=function q(){for(;++P=0;--le){var q=this.tryEntries[le],ee=q.completion;if(q.tryLoc==="root")return P("end");if(q.tryLoc<=this.prev){var ne=n.call(q,"catchLoc"),ie=n.call(q,"finallyLoc");if(ne&&ie){if(this.prev=0;--P){var le=this.tryEntries[P];if(le.tryLoc<=this.prev&&n.call(le,"finallyLoc")&&this.prev=0;--_){var P=this.tryEntries[_];if(P.finallyLoc===D)return this.complete(P.completion,P.afterLoc),J(P),o}},catch:function(D){for(var _=this.tryEntries.length-1;_>=0;--_){var P=this.tryEntries[_];if(P.tryLoc===D){var le=P.completion;if(le.type==="throw"){var q=le.arg;J(P)}return q}}throw new Error("illegal catch attempt")},delegateYield:function(D,_,P){return this.delegate={iterator:U(D),resultName:_,nextLoc:P},this.method==="next"&&(this.arg=void 0),o}},t}function H0t(t,e,n,l,I,a,c){try{var i=t[a](c),s=i.value}catch(r){return void n(r)}i.done?e(s):Promise.resolve(s).then(l,I)}function Qf(t){return function(){var e=this,n=arguments;return new Promise(function(l,I){var a=t.apply(e,n);function c(s){H0t(a,l,I,c,i,"next",s)}function i(s){H0t(a,l,I,c,i,"throw",s)}c(void 0)})}}function jke(){return(jke=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.lifeTime&&(n={____timeOfCreation:n.____timeOfCreation})},i=function(){c();for(var s=arguments.length,r=new Array(s),u=0;u{"use strict";C0t.exports=J0t()});var x0t=f((gva,Oke)=>{function k0t(t,e=100,n={}){if(typeof t!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");let{immediate:l}=typeof n=="boolean"?{immediate:n}:n,I,a,c,i,s;function r(){let d=I,b=a;return I=void 0,a=void 0,s=t.apply(d,b),s}function u(){let d=Date.now()-i;d=0?c=setTimeout(u,e-d):(c=void 0,l||(s=r()))}let o=function(...d){if(I&&this!==I&&Object.getPrototypeOf(this)===Object.getPrototypeOf(I))throw new Error("Debounced method called with different contexts of the same prototype.");I=this,a=d,i=Date.now();let b=l&&!c;return c||(c=setTimeout(u,e)),b&&(s=r()),s};return Object.defineProperty(o,"isPending",{get(){return c!==void 0}}),o.clear=()=>{c&&(clearTimeout(c),c=void 0)},o.flush=()=>{c&&o.trigger()},o.trigger=()=>{s=r(),o.clear()},o}Oke.exports.debounce=k0t;Oke.exports=k0t});var Ixe=f((iD,Q3)=>{var Vel=200,iFt="__lodash_hash_undefined__",Yel=800,gel=16,sFt=9007199254740991,uFt="[object Arguments]",Rel="[object Array]",yel="[object AsyncFunction]",Ael="[object Boolean]",Fel="[object Date]",vel="[object Error]",dFt="[object Function]",fel="[object GeneratorFunction]",Xel="[object Map]",wel="[object Number]",Hel="[object Null]",GFt="[object Object]",Qel="[object Proxy]",Eel="[object RegExp]",Jel="[object Set]",Cel="[object String]",Lel="[object Undefined]",kel="[object WeakMap]",xel="[object ArrayBuffer]",jel="[object DataView]",Oel="[object Float32Array]",Uel="[object Float64Array]",zel="[object Int8Array]",Bel="[object Int16Array]",Sel="[object Int32Array]",Mel="[object Uint8Array]",Tel="[object Uint8ClampedArray]",Del="[object Uint16Array]",Kel="[object Uint32Array]",_el=/[\\^$.*+?()[\]{}|]/g,Pel=/^\[object .+?Constructor\]$/,qel=/^(?:0|[1-9]\d*)$/,Xc={};Xc[Oel]=Xc[Uel]=Xc[zel]=Xc[Bel]=Xc[Sel]=Xc[Mel]=Xc[Tel]=Xc[Del]=Xc[Kel]=!0;Xc[uFt]=Xc[Rel]=Xc[xel]=Xc[Ael]=Xc[jel]=Xc[Fel]=Xc[vel]=Xc[dFt]=Xc[Xel]=Xc[wel]=Xc[GFt]=Xc[Eel]=Xc[Jel]=Xc[Cel]=Xc[kel]=!1;var bFt=typeof global=="object"&&global&&global.Object===Object&&global,$el=typeof self=="object"&&self&&self.Object===Object&&self,dD=bFt||$el||Function("return this")(),mFt=typeof iD=="object"&&iD&&!iD.nodeType&&iD,sD=mFt&&typeof Q3=="object"&&Q3&&!Q3.nodeType&&Q3,pFt=sD&&sD.exports===mFt,Dke=pFt&&bFt.process,eFt=function(){try{var t=sD&&sD.require&&sD.require("util").types;return t||Dke&&Dke.binding&&Dke.binding("util")}catch{}}(),tFt=eFt&&eFt.isTypedArray;function etl(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ttl(t,e){for(var n=-1,l=Array(t);++n-1}function gtl(t,e){var n=this.__data__,l=eoe(n,t);return l<0?(++this.size,n.push([t,e])):n[l][1]=e,this}KA.prototype.clear=Wtl;KA.prototype.delete=Ntl;KA.prototype.get=Vtl;KA.prototype.has=Ytl;KA.prototype.set=gtl;function E3(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e1?n[I-1]:void 0,c=I>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(I--,a):void 0,c&&qtl(n[0],n[1],c)&&(a=I<3?void 0:a,I=1),e=Object(e);++l-1&&t%1==0&&t0){if(++e>=Yel)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function rnl(t){if(t!=null){try{return $ce.call(t)}catch{}try{return t+""}catch{}}return""}function loe(t,e){return t===e||t!==t&&e!==e}var qke=oFt(function(){return arguments}())?oFt:function(t){return GD(t)&&DA.call(t,"callee")&&!itl.call(t,"callee")},$ke=Array.isArray;function nxe(t){return t!=null&&RFt(t.length)&&!lxe(t)}function cnl(t){return GD(t)&&nxe(t)}var gFt=utl||dnl;function lxe(t){if(!$E(t))return!1;var e=toe(t);return e==dFt||e==fel||e==yel||e==Qel}function RFt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sFt}function $E(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function GD(t){return t!=null&&typeof t=="object"}function onl(t){if(!GD(t)||toe(t)!=GFt)return!1;var e=ZFt(t);if(e===null)return!0;var n=DA.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&$ce.call(n)==ctl}var yFt=tFt?ntl(tFt):ktl;function inl(t){return Ttl(t,AFt(t))}function AFt(t){return nxe(t)?Etl(t,!0):xtl(t)}var snl=Dtl(function(t,e,n){NFt(t,e,n)});function unl(t){return function(){return t}}function FFt(t){return t}function dnl(){return!1}Q3.exports=snl});var aoe=f((Sfa,JFt)=>{var pnl=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError].filter(t=>typeof t=="function");function EFt(t){for(let e of pnl)if(t instanceof e)throw t}JFt.exports=function(e,n){return e.then(l=>l instanceof Error?(EFt(l),[l]):[void 0,l]).catch(l=>(EFt(l),[l])).finally(()=>{n&&typeof n=="function"&&n()})}});var SFt=f((WXa,hnl)=>{hnl.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var TFt=f((NXa,MFt)=>{MFt.exports=SFt()});var pD=f(Wp=>{"use strict";var coe=TFt(),Znl=Ca().extname,DFt=/^\s*([^;\s]*)(?:;|\s|$)/,Wnl=/^text\//i;Wp.charset=KFt;Wp.charsets={lookup:KFt};Wp.contentType=Nnl;Wp.extension=Vnl;Wp.extensions=Object.create(null);Wp.lookup=Ynl;Wp.types=Object.create(null);gnl(Wp.extensions,Wp.types);function KFt(t){if(!t||typeof t!="string")return!1;var e=DFt.exec(t),n=e&&coe[e[1].toLowerCase()];return n&&n.charset?n.charset:e&&Wnl.test(e[1])?"UTF-8":!1}function Nnl(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Wp.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var n=Wp.charset(e);n&&(e+="; charset="+n.toLowerCase())}return e}function Vnl(t){if(!t||typeof t!="string")return!1;var e=DFt.exec(t),n=e&&Wp.extensions[e[1].toLowerCase()];return!n||!n.length?!1:n[0]}function Ynl(t){if(!t||typeof t!="string")return!1;var e=Znl("x."+t).toLowerCase().substr(1);return e&&Wp.types[e]||!1}function gnl(t,e){var n=["nginx","apache",void 0,"iana"];Object.keys(coe).forEach(function(I){var a=coe[I],c=a.extensions;if(!(!c||!c.length)){t[I]=c;for(var i=0;iu||r===u&&e[s].substr(0,12)==="application/"))continue}e[s]=I}}})}});var Dft=f((f4a,Tft)=>{function Uil(){this.__data__=[],this.size=0}Tft.exports=Uil});var r1=f((X4a,Kft)=>{function zil(t,e){return t===e||t!==t&&e!==e}Kft.exports=zil});var vD=f((w4a,_ft)=>{var Bil=r1();function Sil(t,e){for(var n=t.length;n--;)if(Bil(t[n][0],e))return n;return-1}_ft.exports=Sil});var qft=f((H4a,Pft)=>{var Mil=vD(),Til=Array.prototype,Dil=Til.splice;function Kil(t){var e=this.__data__,n=Mil(e,t);if(n<0)return!1;var l=e.length-1;return n==l?e.pop():Dil.call(e,n,1),--this.size,!0}Pft.exports=Kil});var eXt=f((Q4a,$ft)=>{var _il=vD();function Pil(t){var e=this.__data__,n=_il(e,t);return n<0?void 0:e[n][1]}$ft.exports=Pil});var nXt=f((E4a,tXt)=>{var qil=vD();function $il(t){return qil(this.__data__,t)>-1}tXt.exports=$il});var IXt=f((J4a,lXt)=>{var esl=vD();function tsl(t,e){var n=this.__data__,l=esl(n,t);return l<0?(++this.size,n.push([t,e])):n[l][1]=e,this}lXt.exports=tsl});var fD=f((C4a,aXt)=>{var nsl=Dft(),lsl=qft(),Isl=eXt(),asl=nXt(),rsl=IXt();function Z4(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e{var csl=fD();function osl(){this.__data__=new csl,this.size=0}rXt.exports=osl});var iXt=f((k4a,oXt)=>{function isl(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}oXt.exports=isl});var uXt=f((x4a,sXt)=>{function ssl(t){return this.__data__.get(t)}sXt.exports=ssl});var GXt=f((j4a,dXt)=>{function usl(t){return this.__data__.has(t)}dXt.exports=usl});var Axe=f((O4a,bXt)=>{var dsl=typeof global=="object"&&global&&global.Object===Object&&global;bXt.exports=dsl});var FV=f((U4a,mXt)=>{var Gsl=Axe(),bsl=typeof self=="object"&&self&&self.Object===Object&&self,msl=Gsl||bsl||Function("return this")();mXt.exports=msl});var c1=f((z4a,pXt)=>{var psl=FV(),hsl=psl.Symbol;pXt.exports=hsl});var NXt=f((B4a,WXt)=>{var hXt=c1(),ZXt=Object.prototype,Zsl=ZXt.hasOwnProperty,Wsl=ZXt.toString,XD=hXt?hXt.toStringTag:void 0;function Nsl(t){var e=Zsl.call(t,XD),n=t[XD];try{t[XD]=void 0;var l=!0}catch{}var I=Wsl.call(t);return l&&(e?t[XD]=n:delete t[XD]),I}WXt.exports=Nsl});var YXt=f((S4a,VXt)=>{var Vsl=Object.prototype,Ysl=Vsl.toString;function gsl(t){return Ysl.call(t)}VXt.exports=gsl});var lX=f((M4a,yXt)=>{var gXt=c1(),Rsl=NXt(),ysl=YXt(),Asl="[object Null]",Fsl="[object Undefined]",RXt=gXt?gXt.toStringTag:void 0;function vsl(t){return t==null?t===void 0?Fsl:Asl:RXt&&RXt in Object(t)?Rsl(t):ysl(t)}yXt.exports=vsl});var vV=f((T4a,AXt)=>{function fsl(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}AXt.exports=fsl});var tie=f((D4a,FXt)=>{var Xsl=lX(),wsl=vV(),Hsl="[object AsyncFunction]",Qsl="[object Function]",Esl="[object GeneratorFunction]",Jsl="[object Proxy]";function Csl(t){if(!wsl(t))return!1;var e=Xsl(t);return e==Qsl||e==Esl||e==Hsl||e==Jsl}FXt.exports=Csl});var fXt=f((K4a,vXt)=>{var Lsl=FV(),ksl=Lsl["__core-js_shared__"];vXt.exports=ksl});var HXt=f((_4a,wXt)=>{var Fxe=fXt(),XXt=function(){var t=/[^.]+$/.exec(Fxe&&Fxe.keys&&Fxe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function xsl(t){return!!XXt&&XXt in t}wXt.exports=xsl});var vxe=f((P4a,QXt)=>{var jsl=Function.prototype,Osl=jsl.toString;function Usl(t){if(t!=null){try{return Osl.call(t)}catch{}try{return t+""}catch{}}return""}QXt.exports=Usl});var JXt=f((q4a,EXt)=>{var zsl=tie(),Bsl=HXt(),Ssl=vV(),Msl=vxe(),Tsl=/[\\^$.*+?()[\]{}|]/g,Dsl=/^\[object .+?Constructor\]$/,Ksl=Function.prototype,_sl=Object.prototype,Psl=Ksl.toString,qsl=_sl.hasOwnProperty,$sl=RegExp("^"+Psl.call(qsl).replace(Tsl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function eul(t){if(!Ssl(t)||Bsl(t))return!1;var e=zsl(t)?$sl:Dsl;return e.test(Msl(t))}EXt.exports=eul});var LXt=f(($4a,CXt)=>{function tul(t,e){return t?.[e]}CXt.exports=tul});var IX=f((eja,kXt)=>{var nul=JXt(),lul=LXt();function Iul(t,e){var n=lul(t,e);return nul(n)?n:void 0}kXt.exports=Iul});var nie=f((tja,xXt)=>{var aul=IX(),rul=FV(),cul=aul(rul,"Map");xXt.exports=cul});var wD=f((nja,jXt)=>{var oul=IX(),iul=oul(Object,"create");jXt.exports=iul});var zXt=f((lja,UXt)=>{var OXt=wD();function sul(){this.__data__=OXt?OXt(null):{},this.size=0}UXt.exports=sul});var SXt=f((Ija,BXt)=>{function uul(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}BXt.exports=uul});var TXt=f((aja,MXt)=>{var dul=wD(),Gul="__lodash_hash_undefined__",bul=Object.prototype,mul=bul.hasOwnProperty;function pul(t){var e=this.__data__;if(dul){var n=e[t];return n===Gul?void 0:n}return mul.call(e,t)?e[t]:void 0}MXt.exports=pul});var KXt=f((rja,DXt)=>{var hul=wD(),Zul=Object.prototype,Wul=Zul.hasOwnProperty;function Nul(t){var e=this.__data__;return hul?e[t]!==void 0:Wul.call(e,t)}DXt.exports=Nul});var PXt=f((cja,_Xt)=>{var Vul=wD(),Yul="__lodash_hash_undefined__";function gul(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Vul&&e===void 0?Yul:e,this}_Xt.exports=gul});var $Xt=f((oja,qXt)=>{var Rul=zXt(),yul=SXt(),Aul=TXt(),Ful=KXt(),vul=PXt();function W4(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e{var ewt=$Xt(),ful=fD(),Xul=nie();function wul(){this.size=0,this.__data__={hash:new ewt,map:new(Xul||ful),string:new ewt}}twt.exports=wul});var Iwt=f((sja,lwt)=>{function Hul(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}lwt.exports=Hul});var HD=f((uja,awt)=>{var Qul=Iwt();function Eul(t,e){var n=t.__data__;return Qul(e)?n[typeof e=="string"?"string":"hash"]:n.map}awt.exports=Eul});var cwt=f((dja,rwt)=>{var Jul=HD();function Cul(t){var e=Jul(this,t).delete(t);return this.size-=e?1:0,e}rwt.exports=Cul});var iwt=f((Gja,owt)=>{var Lul=HD();function kul(t){return Lul(this,t).get(t)}owt.exports=kul});var uwt=f((bja,swt)=>{var xul=HD();function jul(t){return xul(this,t).has(t)}swt.exports=jul});var Gwt=f((mja,dwt)=>{var Oul=HD();function Uul(t,e){var n=Oul(this,t),l=n.size;return n.set(t,e),this.size+=n.size==l?0:1,this}dwt.exports=Uul});var lie=f((pja,bwt)=>{var zul=nwt(),Bul=cwt(),Sul=iwt(),Mul=uwt(),Tul=Gwt();function N4(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e{var Dul=fD(),Kul=nie(),_ul=lie(),Pul=200;function qul(t,e){var n=this.__data__;if(n instanceof Dul){var l=n.__data__;if(!Kul||l.length{var $ul=fD(),edl=cXt(),tdl=iXt(),ndl=uXt(),ldl=GXt(),Idl=pwt();function V4(t){var e=this.__data__=new $ul(t);this.size=e.size}V4.prototype.clear=edl;V4.prototype.delete=tdl;V4.prototype.get=ndl;V4.prototype.has=ldl;V4.prototype.set=Idl;hwt.exports=V4});var fxe=f((Wja,Zwt)=>{function adl(t,e){for(var n=-1,l=t==null?0:t.length;++n{var rdl=IX(),cdl=function(){try{var t=rdl(Object,"defineProperty");return t({},"",{}),t}catch{}}();Wwt.exports=cdl});var Iie=f((Vja,Vwt)=>{var Nwt=Xxe();function odl(t,e,n){e=="__proto__"&&Nwt?Nwt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}Vwt.exports=odl});var wxe=f((Yja,Ywt)=>{var idl=Iie(),sdl=r1(),udl=Object.prototype,ddl=udl.hasOwnProperty;function Gdl(t,e,n){var l=t[e];(!(ddl.call(t,e)&&sdl(l,n))||n===void 0&&!(e in t))&&idl(t,e,n)}Ywt.exports=Gdl});var Y4=f((gja,gwt)=>{var bdl=wxe(),mdl=Iie();function pdl(t,e,n,l){var I=!n;n||(n={});for(var a=-1,c=e.length;++a{function hdl(t,e){for(var n=-1,l=Array(t);++n{function Zdl(t){return t!=null&&typeof t=="object"}Awt.exports=Zdl});var vwt=f((Aja,Fwt)=>{var Wdl=lX(),Ndl=fV(),Vdl="[object Arguments]";function Ydl(t){return Ndl(t)&&Wdl(t)==Vdl}Fwt.exports=Ydl});var ED=f((Fja,wwt)=>{var fwt=vwt(),gdl=fV(),Xwt=Object.prototype,Rdl=Xwt.hasOwnProperty,ydl=Xwt.propertyIsEnumerable,Adl=fwt(function(){return arguments}())?fwt:function(t){return gdl(t)&&Rdl.call(t,"callee")&&!ydl.call(t,"callee")};wwt.exports=Adl});var gp=f((vja,Hwt)=>{var Fdl=Array.isArray;Hwt.exports=Fdl});var Ewt=f((fja,Qwt)=>{function vdl(){return!1}Qwt.exports=vdl});var CD=f((JD,g4)=>{var fdl=FV(),Xdl=Ewt(),Lwt=typeof JD=="object"&&JD&&!JD.nodeType&&JD,Jwt=Lwt&&typeof g4=="object"&&g4&&!g4.nodeType&&g4,wdl=Jwt&&Jwt.exports===Lwt,Cwt=wdl?fdl.Buffer:void 0,Hdl=Cwt?Cwt.isBuffer:void 0,Qdl=Hdl||Xdl;g4.exports=Qdl});var aie=f((Xja,kwt)=>{var Edl=9007199254740991,Jdl=/^(?:0|[1-9]\d*)$/;function Cdl(t,e){var n=typeof t;return e=e??Edl,!!e&&(n=="number"||n!="symbol"&&Jdl.test(t))&&t>-1&&t%1==0&&t{var Ldl=9007199254740991;function kdl(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ldl}xwt.exports=kdl});var Owt=f((Hja,jwt)=>{var xdl=lX(),jdl=rie(),Odl=fV(),Udl="[object Arguments]",zdl="[object Array]",Bdl="[object Boolean]",Sdl="[object Date]",Mdl="[object Error]",Tdl="[object Function]",Ddl="[object Map]",Kdl="[object Number]",_dl="[object Object]",Pdl="[object RegExp]",qdl="[object Set]",$dl="[object String]",eGl="[object WeakMap]",tGl="[object ArrayBuffer]",nGl="[object DataView]",lGl="[object Float32Array]",IGl="[object Float64Array]",aGl="[object Int8Array]",rGl="[object Int16Array]",cGl="[object Int32Array]",oGl="[object Uint8Array]",iGl="[object Uint8ClampedArray]",sGl="[object Uint16Array]",uGl="[object Uint32Array]",Hc={};Hc[lGl]=Hc[IGl]=Hc[aGl]=Hc[rGl]=Hc[cGl]=Hc[oGl]=Hc[iGl]=Hc[sGl]=Hc[uGl]=!0;Hc[Udl]=Hc[zdl]=Hc[tGl]=Hc[Bdl]=Hc[nGl]=Hc[Sdl]=Hc[Mdl]=Hc[Tdl]=Hc[Ddl]=Hc[Kdl]=Hc[_dl]=Hc[Pdl]=Hc[qdl]=Hc[$dl]=Hc[eGl]=!1;function dGl(t){return Odl(t)&&jdl(t.length)&&!!Hc[xdl(t)]}jwt.exports=dGl});var aX=f((Qja,Uwt)=>{function GGl(t){return function(e){return t(e)}}Uwt.exports=GGl});var cie=f((LD,R4)=>{var bGl=Axe(),zwt=typeof LD=="object"&&LD&&!LD.nodeType&&LD,kD=zwt&&typeof R4=="object"&&R4&&!R4.nodeType&&R4,mGl=kD&&kD.exports===zwt,Hxe=mGl&&bGl.process,pGl=function(){try{var t=kD&&kD.require&&kD.require("util").types;return t||Hxe&&Hxe.binding&&Hxe.binding("util")}catch{}}();R4.exports=pGl});var oie=f((Eja,Mwt)=>{var hGl=Owt(),ZGl=aX(),Bwt=cie(),Swt=Bwt&&Bwt.isTypedArray,WGl=Swt?ZGl(Swt):hGl;Mwt.exports=WGl});var Qxe=f((Jja,Twt)=>{var NGl=ywt(),VGl=ED(),YGl=gp(),gGl=CD(),RGl=aie(),yGl=oie(),AGl=Object.prototype,FGl=AGl.hasOwnProperty;function vGl(t,e){var n=YGl(t),l=!n&&VGl(t),I=!n&&!l&&gGl(t),a=!n&&!l&&!I&&yGl(t),c=n||l||I||a,i=c?NGl(t.length,String):[],s=i.length;for(var r in t)(e||FGl.call(t,r))&&!(c&&(r=="length"||I&&(r=="offset"||r=="parent")||a&&(r=="buffer"||r=="byteLength"||r=="byteOffset")||RGl(r,s)))&&i.push(r);return i}Twt.exports=vGl});var iie=f((Cja,Dwt)=>{var fGl=Object.prototype;function XGl(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||fGl;return t===n}Dwt.exports=XGl});var Exe=f((Lja,Kwt)=>{function wGl(t,e){return function(n){return t(e(n))}}Kwt.exports=wGl});var Pwt=f((kja,_wt)=>{var HGl=Exe(),QGl=HGl(Object.keys,Object);_wt.exports=QGl});var $wt=f((xja,qwt)=>{var EGl=iie(),JGl=Pwt(),CGl=Object.prototype,LGl=CGl.hasOwnProperty;function kGl(t){if(!EGl(t))return JGl(t);var e=[];for(var n in Object(t))LGl.call(t,n)&&n!="constructor"&&e.push(n);return e}qwt.exports=kGl});var o1=f((jja,eHt)=>{var xGl=tie(),jGl=rie();function OGl(t){return t!=null&&jGl(t.length)&&!xGl(t)}eHt.exports=OGl});var y4=f((Oja,tHt)=>{var UGl=Qxe(),zGl=$wt(),BGl=o1();function SGl(t){return BGl(t)?UGl(t):zGl(t)}tHt.exports=SGl});var lHt=f((Uja,nHt)=>{var MGl=Y4(),TGl=y4();function DGl(t,e){return t&&MGl(e,TGl(e),t)}nHt.exports=DGl});var aHt=f((zja,IHt)=>{function KGl(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}IHt.exports=KGl});var cHt=f((Bja,rHt)=>{var _Gl=vV(),PGl=iie(),qGl=aHt(),$Gl=Object.prototype,ebl=$Gl.hasOwnProperty;function tbl(t){if(!_Gl(t))return qGl(t);var e=PGl(t),n=[];for(var l in t)l=="constructor"&&(e||!ebl.call(t,l))||n.push(l);return n}rHt.exports=tbl});var i1=f((Sja,oHt)=>{var nbl=Qxe(),lbl=cHt(),Ibl=o1();function abl(t){return Ibl(t)?nbl(t,!0):lbl(t)}oHt.exports=abl});var sHt=f((Mja,iHt)=>{var rbl=Y4(),cbl=i1();function obl(t,e){return t&&rbl(e,cbl(e),t)}iHt.exports=obl});var Jxe=f((xD,A4)=>{var ibl=FV(),bHt=typeof xD=="object"&&xD&&!xD.nodeType&&xD,uHt=bHt&&typeof A4=="object"&&A4&&!A4.nodeType&&A4,sbl=uHt&&uHt.exports===bHt,dHt=sbl?ibl.Buffer:void 0,GHt=dHt?dHt.allocUnsafe:void 0;function ubl(t,e){if(e)return t.slice();var n=t.length,l=GHt?GHt(n):new t.constructor(n);return t.copy(l),l}A4.exports=ubl});var sie=f((Tja,mHt)=>{function dbl(t,e){var n=-1,l=t.length;for(e||(e=Array(l));++n{function Gbl(t,e){for(var n=-1,l=t==null?0:t.length,I=0,a=[];++n{function bbl(){return[]}ZHt.exports=bbl});var uie=f((_ja,NHt)=>{var mbl=hHt(),pbl=Cxe(),hbl=Object.prototype,Zbl=hbl.propertyIsEnumerable,WHt=Object.getOwnPropertySymbols,Wbl=WHt?function(t){return t==null?[]:(t=Object(t),mbl(WHt(t),function(e){return Zbl.call(t,e)}))}:pbl;NHt.exports=Wbl});var YHt=f((Pja,VHt)=>{var Nbl=Y4(),Vbl=uie();function Ybl(t,e){return Nbl(t,Vbl(t),e)}VHt.exports=Ybl});var die=f((qja,gHt)=>{function gbl(t,e){for(var n=-1,l=e.length,I=t.length;++n{var Rbl=Exe(),ybl=Rbl(Object.getPrototypeOf,Object);RHt.exports=ybl});var Lxe=f((eOa,yHt)=>{var Abl=die(),Fbl=Gie(),vbl=uie(),fbl=Cxe(),Xbl=Object.getOwnPropertySymbols,wbl=Xbl?function(t){for(var e=[];t;)Abl(e,vbl(t)),t=Fbl(t);return e}:fbl;yHt.exports=wbl});var FHt=f((tOa,AHt)=>{var Hbl=Y4(),Qbl=Lxe();function Ebl(t,e){return Hbl(t,Qbl(t),e)}AHt.exports=Ebl});var kxe=f((nOa,vHt)=>{var Jbl=die(),Cbl=gp();function Lbl(t,e,n){var l=e(t);return Cbl(t)?l:Jbl(l,n(t))}vHt.exports=Lbl});var xxe=f((lOa,fHt)=>{var kbl=kxe(),xbl=uie(),jbl=y4();function Obl(t){return kbl(t,jbl,xbl)}fHt.exports=Obl});var wHt=f((IOa,XHt)=>{var Ubl=kxe(),zbl=Lxe(),Bbl=i1();function Sbl(t){return Ubl(t,Bbl,zbl)}XHt.exports=Sbl});var QHt=f((aOa,HHt)=>{var Mbl=IX(),Tbl=FV(),Dbl=Mbl(Tbl,"DataView");HHt.exports=Dbl});var JHt=f((rOa,EHt)=>{var Kbl=IX(),_bl=FV(),Pbl=Kbl(_bl,"Promise");EHt.exports=Pbl});var jxe=f((cOa,CHt)=>{var qbl=IX(),$bl=FV(),eml=qbl($bl,"Set");CHt.exports=eml});var kHt=f((oOa,LHt)=>{var tml=IX(),nml=FV(),lml=tml(nml,"WeakMap");LHt.exports=lml});var jD=f((iOa,SHt)=>{var Oxe=QHt(),Uxe=nie(),zxe=JHt(),Bxe=jxe(),Sxe=kHt(),BHt=lX(),F4=vxe(),xHt="[object Map]",Iml="[object Object]",jHt="[object Promise]",OHt="[object Set]",UHt="[object WeakMap]",zHt="[object DataView]",aml=F4(Oxe),rml=F4(Uxe),cml=F4(zxe),oml=F4(Bxe),iml=F4(Sxe),s1=BHt;(Oxe&&s1(new Oxe(new ArrayBuffer(1)))!=zHt||Uxe&&s1(new Uxe)!=xHt||zxe&&s1(zxe.resolve())!=jHt||Bxe&&s1(new Bxe)!=OHt||Sxe&&s1(new Sxe)!=UHt)&&(s1=function(t){var e=BHt(t),n=e==Iml?t.constructor:void 0,l=n?F4(n):"";if(l)switch(l){case aml:return zHt;case rml:return xHt;case cml:return jHt;case oml:return OHt;case iml:return UHt}return e});SHt.exports=s1});var THt=f((sOa,MHt)=>{var sml=Object.prototype,uml=sml.hasOwnProperty;function dml(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&¨.call(t,"index")&&(n.index=t.index,n.input=t.input),n}MHt.exports=dml});var Mxe=f((uOa,DHt)=>{var Gml=FV(),bml=Gml.Uint8Array;DHt.exports=bml});var bie=f((dOa,_Ht)=>{var KHt=Mxe();function mml(t){var e=new t.constructor(t.byteLength);return new KHt(e).set(new KHt(t)),e}_Ht.exports=mml});var qHt=f((GOa,PHt)=>{var pml=bie();function hml(t,e){var n=e?pml(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}PHt.exports=hml});var eQt=f((bOa,$Ht)=>{var Zml=/\w*$/;function Wml(t){var e=new t.constructor(t.source,Zml.exec(t));return e.lastIndex=t.lastIndex,e}$Ht.exports=Wml});var aQt=f((mOa,IQt)=>{var tQt=c1(),nQt=tQt?tQt.prototype:void 0,lQt=nQt?nQt.valueOf:void 0;function Nml(t){return lQt?Object(lQt.call(t)):{}}IQt.exports=Nml});var Txe=f((pOa,rQt)=>{var Vml=bie();function Yml(t,e){var n=e?Vml(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}rQt.exports=Yml});var oQt=f((hOa,cQt)=>{var gml=bie(),Rml=qHt(),yml=eQt(),Aml=aQt(),Fml=Txe(),vml="[object Boolean]",fml="[object Date]",Xml="[object Map]",wml="[object Number]",Hml="[object RegExp]",Qml="[object Set]",Eml="[object String]",Jml="[object Symbol]",Cml="[object ArrayBuffer]",Lml="[object DataView]",kml="[object Float32Array]",xml="[object Float64Array]",jml="[object Int8Array]",Oml="[object Int16Array]",Uml="[object Int32Array]",zml="[object Uint8Array]",Bml="[object Uint8ClampedArray]",Sml="[object Uint16Array]",Mml="[object Uint32Array]";function Tml(t,e,n){var l=t.constructor;switch(e){case Cml:return gml(t);case vml:case fml:return new l(+t);case Lml:return Rml(t,n);case kml:case xml:case jml:case Oml:case Uml:case zml:case Bml:case Sml:case Mml:return Fml(t,n);case Xml:return new l;case wml:case Eml:return new l(t);case Hml:return yml(t);case Qml:return new l;case Jml:return Aml(t)}}cQt.exports=Tml});var uQt=f((ZOa,sQt)=>{var Dml=vV(),iQt=Object.create,Kml=function(){function t(){}return function(e){if(!Dml(e))return{};if(iQt)return iQt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();sQt.exports=Kml});var Dxe=f((WOa,dQt)=>{var _ml=uQt(),Pml=Gie(),qml=iie();function $ml(t){return typeof t.constructor=="function"&&!qml(t)?_ml(Pml(t)):{}}dQt.exports=$ml});var bQt=f((NOa,GQt)=>{var epl=jD(),tpl=fV(),npl="[object Map]";function lpl(t){return tpl(t)&&epl(t)==npl}GQt.exports=lpl});var ZQt=f((VOa,hQt)=>{var Ipl=bQt(),apl=aX(),mQt=cie(),pQt=mQt&&mQt.isMap,rpl=pQt?apl(pQt):Ipl;hQt.exports=rpl});var NQt=f((YOa,WQt)=>{var cpl=jD(),opl=fV(),ipl="[object Set]";function spl(t){return opl(t)&&cpl(t)==ipl}WQt.exports=spl});var RQt=f((gOa,gQt)=>{var upl=NQt(),dpl=aX(),VQt=cie(),YQt=VQt&&VQt.isSet,Gpl=YQt?dpl(YQt):upl;gQt.exports=Gpl});var fQt=f((ROa,vQt)=>{var bpl=QD(),mpl=fxe(),ppl=wxe(),hpl=lHt(),Zpl=sHt(),Wpl=Jxe(),Npl=sie(),Vpl=YHt(),Ypl=FHt(),gpl=xxe(),Rpl=wHt(),ypl=jD(),Apl=THt(),Fpl=oQt(),vpl=Dxe(),fpl=gp(),Xpl=CD(),wpl=ZQt(),Hpl=vV(),Qpl=RQt(),Epl=y4(),Jpl=i1(),Cpl=1,Lpl=2,kpl=4,yQt="[object Arguments]",xpl="[object Array]",jpl="[object Boolean]",Opl="[object Date]",Upl="[object Error]",AQt="[object Function]",zpl="[object GeneratorFunction]",Bpl="[object Map]",Spl="[object Number]",FQt="[object Object]",Mpl="[object RegExp]",Tpl="[object Set]",Dpl="[object String]",Kpl="[object Symbol]",_pl="[object WeakMap]",Ppl="[object ArrayBuffer]",qpl="[object DataView]",$pl="[object Float32Array]",ehl="[object Float64Array]",thl="[object Int8Array]",nhl="[object Int16Array]",lhl="[object Int32Array]",Ihl="[object Uint8Array]",ahl="[object Uint8ClampedArray]",rhl="[object Uint16Array]",chl="[object Uint32Array]",Zc={};Zc[yQt]=Zc[xpl]=Zc[Ppl]=Zc[qpl]=Zc[jpl]=Zc[Opl]=Zc[$pl]=Zc[ehl]=Zc[thl]=Zc[nhl]=Zc[lhl]=Zc[Bpl]=Zc[Spl]=Zc[FQt]=Zc[Mpl]=Zc[Tpl]=Zc[Dpl]=Zc[Kpl]=Zc[Ihl]=Zc[ahl]=Zc[rhl]=Zc[chl]=!0;Zc[Upl]=Zc[AQt]=Zc[_pl]=!1;function mie(t,e,n,l,I,a){var c,i=e&Cpl,s=e&Lpl,r=e&kpl;if(n&&(c=I?n(t,l,I,a):n(t)),c!==void 0)return c;if(!Hpl(t))return t;var u=fpl(t);if(u){if(c=Apl(t),!i)return Npl(t,c)}else{var o=ypl(t),d=o==AQt||o==zpl;if(Xpl(t))return Wpl(t,i);if(o==FQt||o==yQt||d&&!I){if(c=s||d?{}:vpl(t),!i)return s?Ypl(t,Zpl(c,t)):Vpl(t,hpl(c,t))}else{if(!Zc[o])return I?t:{};c=Fpl(t,o,i)}}a||(a=new bpl);var b=a.get(t);if(b)return b;a.set(t,c),Qpl(t)?t.forEach(function(N){c.add(mie(N,e,n,N,t,a))}):wpl(t)&&t.forEach(function(N,g){c.set(g,mie(N,e,n,g,t,a))});var h=r?s?Rpl:gpl:s?Jpl:Epl,Z=u?void 0:h(t);return mpl(Z||t,function(N,g){Z&&(g=N,N=t[g]),ppl(c,g,mie(N,e,n,g,t,a))}),c}vQt.exports=mie});var Kxe=f((yOa,XQt)=>{var ohl=fQt(),ihl=1,shl=4;function uhl(t){return ohl(t,ihl|shl)}XQt.exports=uhl});var HQt=f((AOa,wQt)=>{var dhl="__lodash_hash_undefined__";function Ghl(t){return this.__data__.set(t,dhl),this}wQt.exports=Ghl});var EQt=f((FOa,QQt)=>{function bhl(t){return this.__data__.has(t)}QQt.exports=bhl});var OD=f((vOa,JQt)=>{var mhl=lie(),phl=HQt(),hhl=EQt();function pie(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new mhl;++e{function Zhl(t,e){for(var n=-1,l=t==null?0:t.length;++n{function Whl(t,e){return t.has(e)}kQt.exports=Whl});var _xe=f((wOa,xQt)=>{var Nhl=OD(),Vhl=LQt(),Yhl=UD(),ghl=1,Rhl=2;function yhl(t,e,n,l,I,a){var c=n&ghl,i=t.length,s=e.length;if(i!=s&&!(c&&s>i))return!1;var r=a.get(t),u=a.get(e);if(r&&u)return r==e&&u==t;var o=-1,d=!0,b=n&Rhl?new Nhl:void 0;for(a.set(t,e),a.set(e,t);++o{function Ahl(t){var e=-1,n=Array(t.size);return t.forEach(function(l,I){n[++e]=[I,l]}),n}jQt.exports=Ahl});var hie=f((QOa,UQt)=>{function Fhl(t){var e=-1,n=Array(t.size);return t.forEach(function(l){n[++e]=l}),n}UQt.exports=Fhl});var TQt=f((EOa,MQt)=>{var zQt=c1(),BQt=Mxe(),vhl=r1(),fhl=_xe(),Xhl=OQt(),whl=hie(),Hhl=1,Qhl=2,Ehl="[object Boolean]",Jhl="[object Date]",Chl="[object Error]",Lhl="[object Map]",khl="[object Number]",xhl="[object RegExp]",jhl="[object Set]",Ohl="[object String]",Uhl="[object Symbol]",zhl="[object ArrayBuffer]",Bhl="[object DataView]",SQt=zQt?zQt.prototype:void 0,Pxe=SQt?SQt.valueOf:void 0;function Shl(t,e,n,l,I,a,c){switch(n){case Bhl:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case zhl:return!(t.byteLength!=e.byteLength||!a(new BQt(t),new BQt(e)));case Ehl:case Jhl:case khl:return vhl(+t,+e);case Chl:return t.name==e.name&&t.message==e.message;case xhl:case Ohl:return t==e+"";case Lhl:var i=Xhl;case jhl:var s=l&Hhl;if(i||(i=whl),t.size!=e.size&&!s)return!1;var r=c.get(t);if(r)return r==e;l|=Qhl,c.set(t,e);var u=fhl(i(t),i(e),l,I,a,c);return c.delete(t),u;case Uhl:if(Pxe)return Pxe.call(t)==Pxe.call(e)}return!1}MQt.exports=Shl});var _Qt=f((JOa,KQt)=>{var DQt=xxe(),Mhl=1,Thl=Object.prototype,Dhl=Thl.hasOwnProperty;function Khl(t,e,n,l,I,a){var c=n&Mhl,i=DQt(t),s=i.length,r=DQt(e),u=r.length;if(s!=u&&!c)return!1;for(var o=s;o--;){var d=i[o];if(!(c?d in e:Dhl.call(e,d)))return!1}var b=a.get(t),h=a.get(e);if(b&&h)return b==e&&h==t;var Z=!0;a.set(t,e),a.set(e,t);for(var N=c;++o{var qxe=QD(),_hl=_xe(),Phl=TQt(),qhl=_Qt(),PQt=jD(),qQt=gp(),$Qt=CD(),$hl=oie(),eZl=1,eEt="[object Arguments]",tEt="[object Array]",Zie="[object Object]",tZl=Object.prototype,nEt=tZl.hasOwnProperty;function nZl(t,e,n,l,I,a){var c=qQt(t),i=qQt(e),s=c?tEt:PQt(t),r=i?tEt:PQt(e);s=s==eEt?Zie:s,r=r==eEt?Zie:r;var u=s==Zie,o=r==Zie,d=s==r;if(d&&$Qt(t)){if(!$Qt(e))return!1;c=!0,u=!1}if(d&&!u)return a||(a=new qxe),c||$hl(t)?_hl(t,e,n,l,I,a):Phl(t,e,s,n,l,I,a);if(!(n&eZl)){var b=u&&nEt.call(t,"__wrapped__"),h=o&&nEt.call(e,"__wrapped__");if(b||h){var Z=b?t.value():t,N=h?e.value():e;return a||(a=new qxe),I(Z,N,n,l,a)}}return d?(a||(a=new qxe),qhl(t,e,n,l,I,a)):!1}lEt.exports=nZl});var Wie=f((LOa,cEt)=>{var lZl=IEt(),aEt=fV();function rEt(t,e,n,l,I){return t===e?!0:t==null||e==null||!aEt(t)&&!aEt(e)?t!==t&&e!==e:lZl(t,e,n,l,rEt,I)}cEt.exports=rEt});var $xe=f((kOa,oEt)=>{var IZl=Wie();function aZl(t,e){return IZl(t,e)}oEt.exports=aZl});var dEt=f((xOa,uEt)=>{var iEt=c1(),rZl=ED(),cZl=gp(),sEt=iEt?iEt.isConcatSpreadable:void 0;function oZl(t){return cZl(t)||rZl(t)||!!(sEt&&t&&t[sEt])}uEt.exports=oZl});var Nie=f((jOa,bEt)=>{var iZl=die(),sZl=dEt();function GEt(t,e,n,l,I){var a=-1,c=t.length;for(n||(n=sZl),I||(I=[]);++a0&&n(i)?e>1?GEt(i,e-1,n,l,I):iZl(I,i):l||(I[I.length]=i)}return I}bEt.exports=GEt});var rX=f((OOa,mEt)=>{function uZl(t,e){for(var n=-1,l=t==null?0:t.length,I=Array(l);++n{var dZl=lX(),GZl=fV(),bZl="[object Symbol]";function mZl(t){return typeof t=="symbol"||GZl(t)&&dZl(t)==bZl}pEt.exports=mZl});var Vie=f((zOa,hEt)=>{var pZl=gp(),hZl=zD(),ZZl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,WZl=/^\w*$/;function NZl(t,e){if(pZl(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||hZl(t)?!0:WZl.test(t)||!ZZl.test(t)||e!=null&&t in Object(e)}hEt.exports=NZl});var NEt=f((BOa,WEt)=>{var ZEt=lie(),VZl="Expected a function";function e3e(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(VZl);var n=function(){var l=arguments,I=e?e.apply(this,l):l[0],a=n.cache;if(a.has(I))return a.get(I);var c=t.apply(this,l);return n.cache=a.set(I,c)||a,c};return n.cache=new(e3e.Cache||ZEt),n}e3e.Cache=ZEt;WEt.exports=e3e});var YEt=f((SOa,VEt)=>{var YZl=NEt(),gZl=500;function RZl(t){var e=YZl(t,function(l){return n.size===gZl&&n.clear(),l}),n=e.cache;return e}VEt.exports=RZl});var REt=f((MOa,gEt)=>{var yZl=YEt(),AZl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,FZl=/\\(\\)?/g,vZl=yZl(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(AZl,function(n,l,I,a){e.push(I?a.replace(FZl,"$1"):l||n)}),e});gEt.exports=vZl});var XEt=f((TOa,fEt)=>{var yEt=c1(),fZl=rX(),XZl=gp(),wZl=zD(),HZl=1/0,AEt=yEt?yEt.prototype:void 0,FEt=AEt?AEt.toString:void 0;function vEt(t){if(typeof t=="string")return t;if(XZl(t))return fZl(t,vEt)+"";if(wZl(t))return FEt?FEt.call(t):"";var e=t+"";return e=="0"&&1/t==-HZl?"-0":e}fEt.exports=vEt});var HEt=f((DOa,wEt)=>{var QZl=XEt();function EZl(t){return t==null?"":QZl(t)}wEt.exports=EZl});var t3e=f((KOa,QEt)=>{var JZl=gp(),CZl=Vie(),LZl=REt(),kZl=HEt();function xZl(t,e){return JZl(t)?t:CZl(t,e)?[t]:LZl(kZl(t))}QEt.exports=xZl});var BD=f((_Oa,EEt)=>{var jZl=zD(),OZl=1/0;function UZl(t){if(typeof t=="string"||jZl(t))return t;var e=t+"";return e=="0"&&1/t==-OZl?"-0":e}EEt.exports=UZl});var Yie=f((POa,JEt)=>{var zZl=t3e(),BZl=BD();function SZl(t,e){e=zZl(e,t);for(var n=0,l=e.length;t!=null&&n{var MZl=QD(),TZl=Wie(),DZl=1,KZl=2;function _Zl(t,e,n,l){var I=n.length,a=I,c=!l;if(t==null)return!a;for(t=Object(t);I--;){var i=n[I];if(c&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++I{var PZl=vV();function qZl(t){return t===t&&!PZl(t)}kEt.exports=qZl});var jEt=f((eUa,xEt)=>{var $Zl=n3e(),eWl=y4();function tWl(t){for(var e=eWl(t),n=e.length;n--;){var l=e[n],I=t[l];e[n]=[l,I,$Zl(I)]}return e}xEt.exports=tWl});var l3e=f((tUa,OEt)=>{function nWl(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}OEt.exports=nWl});var zEt=f((nUa,UEt)=>{var lWl=LEt(),IWl=jEt(),aWl=l3e();function rWl(t){var e=IWl(t);return e.length==1&&e[0][2]?aWl(e[0][0],e[0][1]):function(n){return n===t||lWl(n,t,e)}}UEt.exports=rWl});var SEt=f((lUa,BEt)=>{var cWl=Yie();function oWl(t,e,n){var l=t==null?void 0:cWl(t,e);return l===void 0?n:l}BEt.exports=oWl});var TEt=f((IUa,MEt)=>{function iWl(t,e){return t!=null&&e in Object(t)}MEt.exports=iWl});var KEt=f((aUa,DEt)=>{var sWl=t3e(),uWl=ED(),dWl=gp(),GWl=aie(),bWl=rie(),mWl=BD();function pWl(t,e,n){e=sWl(e,t);for(var l=-1,I=e.length,a=!1;++l{var hWl=TEt(),ZWl=KEt();function WWl(t,e){return t!=null&&ZWl(t,e,hWl)}_Et.exports=WWl});var $Et=f((cUa,qEt)=>{var NWl=Wie(),VWl=SEt(),YWl=PEt(),gWl=Vie(),RWl=n3e(),yWl=l3e(),AWl=BD(),FWl=1,vWl=2;function fWl(t,e){return gWl(t)&&RWl(e)?yWl(AWl(t),e):function(n){var l=VWl(n,t);return l===void 0&&l===e?YWl(n,t):NWl(e,l,FWl|vWl)}}qEt.exports=fWl});var v4=f((oUa,e1t)=>{function XWl(t){return t}e1t.exports=XWl});var n1t=f((iUa,t1t)=>{function wWl(t){return function(e){return e?.[t]}}t1t.exports=wWl});var I1t=f((sUa,l1t)=>{var HWl=Yie();function QWl(t){return function(e){return HWl(e,t)}}l1t.exports=QWl});var r1t=f((uUa,a1t)=>{var EWl=n1t(),JWl=I1t(),CWl=Vie(),LWl=BD();function kWl(t){return CWl(t)?EWl(LWl(t)):JWl(t)}a1t.exports=kWl});var o1t=f((dUa,c1t)=>{var xWl=zEt(),jWl=$Et(),OWl=v4(),UWl=gp(),zWl=r1t();function BWl(t){return typeof t=="function"?t:t==null?OWl:typeof t=="object"?UWl(t)?jWl(t[0],t[1]):xWl(t):zWl(t)}c1t.exports=BWl});var s1t=f((GUa,i1t)=>{function SWl(t){return function(e,n,l){for(var I=-1,a=Object(e),c=l(e),i=c.length;i--;){var s=c[t?i:++I];if(n(a[s],s,a)===!1)break}return e}}i1t.exports=SWl});var I3e=f((bUa,u1t)=>{var MWl=s1t(),TWl=MWl();u1t.exports=TWl});var G1t=f((mUa,d1t)=>{var DWl=I3e(),KWl=y4();function _Wl(t,e){return t&&DWl(t,e,KWl)}d1t.exports=_Wl});var m1t=f((pUa,b1t)=>{var PWl=o1();function qWl(t,e){return function(n,l){if(n==null)return n;if(!PWl(n))return t(n,l);for(var I=n.length,a=e?I:-1,c=Object(n);(e?a--:++a{var $Wl=G1t(),eNl=m1t(),tNl=eNl($Wl);p1t.exports=tNl});var Z1t=f((ZUa,h1t)=>{var nNl=a3e(),lNl=o1();function INl(t,e){var n=-1,l=lNl(t)?Array(t.length):[];return nNl(t,function(I,a,c){l[++n]=e(I,a,c)}),l}h1t.exports=INl});var N1t=f((WUa,W1t)=>{function aNl(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}W1t.exports=aNl});var g1t=f((NUa,Y1t)=>{var V1t=zD();function rNl(t,e){if(t!==e){var n=t!==void 0,l=t===null,I=t===t,a=V1t(t),c=e!==void 0,i=e===null,s=e===e,r=V1t(e);if(!i&&!r&&!a&&t>e||a&&c&&s&&!i&&!r||l&&c&&s||!n&&s||!I)return 1;if(!l&&!a&&!r&&t{var cNl=g1t();function oNl(t,e,n){for(var l=-1,I=t.criteria,a=e.criteria,c=I.length,i=n.length;++l=i)return s;var r=n[l];return s*(r=="desc"?-1:1)}}return t.index-e.index}R1t.exports=oNl});var F1t=f((YUa,A1t)=>{var r3e=rX(),iNl=Yie(),sNl=o1t(),uNl=Z1t(),dNl=N1t(),GNl=aX(),bNl=y1t(),mNl=v4(),pNl=gp();function hNl(t,e,n){e.length?e=r3e(e,function(a){return pNl(a)?function(c){return iNl(c,a.length===1?a[0]:a)}:a}):e=[mNl];var l=-1;e=r3e(e,GNl(sNl));var I=uNl(t,function(a,c,i){var s=r3e(e,function(r){return r(a)});return{criteria:s,index:++l,value:a}});return dNl(I,function(a,c){return bNl(a,c,n)})}A1t.exports=hNl});var c3e=f((gUa,v1t)=>{function ZNl(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}v1t.exports=ZNl});var w1t=f((RUa,X1t)=>{var WNl=c3e(),f1t=Math.max;function NNl(t,e,n){return e=f1t(e===void 0?t.length-1:e,0),function(){for(var l=arguments,I=-1,a=f1t(l.length-e,0),c=Array(a);++I{function VNl(t){return function(){return t}}H1t.exports=VNl});var C1t=f((AUa,J1t)=>{var YNl=Q1t(),E1t=Xxe(),gNl=v4(),RNl=E1t?function(t,e){return E1t(t,"toString",{configurable:!0,enumerable:!1,value:YNl(e),writable:!0})}:gNl;J1t.exports=RNl});var k1t=f((FUa,L1t)=>{var yNl=800,ANl=16,FNl=Date.now;function vNl(t){var e=0,n=0;return function(){var l=FNl(),I=ANl-(l-n);if(n=l,I>0){if(++e>=yNl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}L1t.exports=vNl});var j1t=f((vUa,x1t)=>{var fNl=C1t(),XNl=k1t(),wNl=XNl(fNl);x1t.exports=wNl});var cX=f((fUa,O1t)=>{var HNl=v4(),QNl=w1t(),ENl=j1t();function JNl(t,e){return ENl(QNl(t,e,HNl),t+"")}O1t.exports=JNl});var gie=f((XUa,U1t)=>{var CNl=r1(),LNl=o1(),kNl=aie(),xNl=vV();function jNl(t,e,n){if(!xNl(n))return!1;var l=typeof e;return(l=="number"?LNl(n)&&kNl(e,n.length):l=="string"&&e in n)?CNl(n[e],t):!1}U1t.exports=jNl});var o3e=f((wUa,B1t)=>{var ONl=Nie(),UNl=F1t(),zNl=cX(),z1t=gie(),BNl=zNl(function(t,e){if(t==null)return[];var n=e.length;return n>1&&z1t(t,e[0],e[1])?e=[]:n>2&&z1t(e[0],e[1],e[2])&&(e=[e[0]]),UNl(t,ONl(e,1),[])});B1t.exports=BNl});var M1t=f((HUa,S1t)=>{function SNl(t,e,n,l){for(var I=t.length,a=n+(l?1:-1);l?a--:++a{function MNl(t){return t!==t}T1t.exports=MNl});var _1t=f((EUa,K1t)=>{function TNl(t,e,n){for(var l=n-1,I=t.length;++l{var DNl=M1t(),KNl=D1t(),_Nl=_1t();function PNl(t,e,n){return e===e?_Nl(t,e,n):DNl(t,KNl,n)}P1t.exports=PNl});var Rie=f((CUa,q1t)=>{var qNl=i3e();function $Nl(t,e){var n=t==null?0:t.length;return!!n&&qNl(t,e,0)>-1}q1t.exports=$Nl});var yie=f((LUa,$1t)=>{function eVl(t,e,n){for(var l=-1,I=t==null?0:t.length;++l{function tVl(){}eJt.exports=tVl});var lJt=f((xUa,nJt)=>{var s3e=jxe(),nVl=tJt(),lVl=hie(),IVl=1/0,aVl=s3e&&1/lVl(new s3e([,-0]))[1]==IVl?function(t){return new s3e(t)}:nVl;nJt.exports=aVl});var u3e=f((jUa,IJt)=>{var rVl=OD(),cVl=Rie(),oVl=yie(),iVl=UD(),sVl=lJt(),uVl=hie(),dVl=200;function GVl(t,e,n){var l=-1,I=cVl,a=t.length,c=!0,i=[],s=i;if(n)c=!1,I=oVl;else if(a>=dVl){var r=e?null:sVl(t);if(r)return uVl(r);c=!1,I=iVl,s=new rVl}else s=e?[]:i;e:for(;++l{var bVl=u3e();function mVl(t){return t&&t.length?bVl(t):[]}aJt.exports=mVl});var Fie=f((UUa,rJt)=>{var pVl=u3e();function hVl(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?pVl(t,void 0,e):[]}rJt.exports=hVl});var iJt=f((zUa,oJt)=>{var ZVl=cX(),WVl=r1(),NVl=gie(),VVl=i1(),cJt=Object.prototype,YVl=cJt.hasOwnProperty,gVl=ZVl(function(t,e){t=Object(t);var n=-1,l=e.length,I=l>2?e[2]:void 0;for(I&&NVl(e[0],e[1],I)&&(l=1);++n{var RVl=OD(),yVl=Rie(),AVl=yie(),FVl=rX(),vVl=aX(),sJt=UD(),fVl=Math.min;function XVl(t,e,n){for(var l=n?AVl:yVl,I=t[0].length,a=t.length,c=a,i=Array(a),s=1/0,r=[];c--;){var u=t[c];c&&e&&(u=FVl(u,vVl(e))),s=fVl(u.length,s),i[c]=!n&&(e||I>=120&&u.length>=120)?new RVl(c&&u):void 0}u=t[0];var o=-1,d=i[0];e:for(;++o{var wVl=o1(),HVl=fV();function QVl(t){return HVl(t)&&wVl(t)}dJt.exports=QVl});var G3e=f((MUa,GJt)=>{var EVl=vie();function JVl(t){return EVl(t)?t:[]}GJt.exports=JVl});var mJt=f((TUa,bJt)=>{function CVl(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}bJt.exports=CVl});var b3e=f((DUa,pJt)=>{var LVl=rX(),kVl=d3e(),xVl=cX(),jVl=G3e(),OVl=mJt(),UVl=xVl(function(t){var e=OVl(t),n=LVl(t,jVl);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?kVl(n,void 0,e):[]});pJt.exports=UVl});var oX=f((KUa,ZJt)=>{var zVl=lX(),BVl=Gie(),SVl=fV(),MVl="[object Object]",TVl=Function.prototype,DVl=Object.prototype,hJt=TVl.toString,KVl=DVl.hasOwnProperty,_Vl=hJt.call(Object);function PVl(t){if(!SVl(t)||zVl(t)!=MVl)return!1;var e=BVl(t);if(e===null)return!0;var n=KVl.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&hJt.call(n)==_Vl}ZJt.exports=PVl});var NJt=f((_Ua,WJt)=>{var qVl=lX(),$Vl=fV(),eYl="[object Boolean]";function tYl(t){return t===!0||t===!1||$Vl(t)&&qVl(t)==eYl}WJt.exports=tYl});var Qie=f((PUa,FJt)=>{var XV=$xe(),nYl=o3e(),W3e=Aie(),VJt=Fie(),lYl=iJt(),IYl=b3e(),Hie=oX(),m3e=NJt(),YJt=t=>Array.isArray(t)?t:[t],AW=t=>t===void 0,fie=t=>Hie(t)||Array.isArray(t)?Object.keys(t):[],f4=(t,e)=>t.hasOwnProperty(e),X4=t=>nYl(W3e(t)),gJt=t=>AW(t)||Array.isArray(t)&&t.length===0,aYl=(t,e,n,l)=>e&&f4(e,n)&&t&&f4(t,n)&&l(t[n],e[n]),p3e=(t,e)=>AW(t)&&e===0||AW(e)&&t===0||XV(t,e),rYl=(t,e)=>AW(t)&&e===!1||AW(e)&&t===!1||XV(t,e),RJt=t=>AW(t)||XV(t,{})||t===!0,Xie=t=>AW(t)||XV(t,{}),yJt=t=>AW(t)||Hie(t)||t===!0||t===!1;function AJt(t,e){return gJt(t)&&gJt(e)?!0:XV(X4(t),X4(e))}function cYl(t,e){return t=YJt(t),e=YJt(e),XV(X4(t),X4(e))}function wie(t,e,n,l){var I=W3e(fie(t).concat(fie(e)));return Xie(t)&&Xie(e)?!0:Xie(t)&&fie(e).length||Xie(e)&&fie(t).length?!1:I.every(function(a){var c=t[a],i=e[a];return Array.isArray(c)&&Array.isArray(i)?XV(X4(t),X4(e)):Array.isArray(c)&&!Array.isArray(i)||Array.isArray(i)&&!Array.isArray(c)?!1:aYl(t,e,a,l)})}function oYl(t,e,n,l){return Hie(t)&&Hie(e)?l(t,e):Array.isArray(t)&&Array.isArray(e)?wie(t,e,n,l):XV(t,e)}function h3e(t,e,n,l){var I=VJt(t,l),a=VJt(e,l),c=IYl(I,a,l);return c.length===Math.max(I.length,a.length)}var iYl={title:XV,uniqueItems:rYl,minLength:p3e,minItems:p3e,minProperties:p3e,required:AJt,enum:AJt,type:cYl,items:oYl,anyOf:h3e,allOf:h3e,oneOf:h3e,properties:wie,patternProperties:wie,dependencies:wie},sYl=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],uYl=["additionalProperties","additionalItems","contains","propertyNames","not"];function Z3e(t,e,n){if(n=lYl(n,{ignore:[]}),RJt(t)&&RJt(e))return!0;if(!yJt(t)||!yJt(e))throw new Error("Either of the values are not a JSON schema.");if(t===e)return!0;if(m3e(t)&&m3e(e))return t===e;if(t===void 0&&e===!1||e===void 0&&t===!1||AW(t)&&!AW(e)||!AW(t)&&AW(e))return!1;var l=W3e(Object.keys(t).concat(Object.keys(e)));if(n.ignore.length&&(l=l.filter(a=>n.ignore.indexOf(a)===-1)),!l.length)return!0;function I(a,c){return Z3e(a,c,n)}return l.every(function(a){var c=t[a],i=e[a];if(uYl.indexOf(a)!==-1)return Z3e(c,i,n);var s=iYl[a];if(s||(s=XV),XV(c,i))return!0;if(sYl.indexOf(a)===-1&&(!f4(t,a)&&f4(e,a)||f4(t,a)&&!f4(e,a)))return c===i;var r=s(c,i,a,I);if(!m3e(r))throw new Error("Comparer must return true or false");return r})}FJt.exports=Z3e});var Eie=f((qUa,vJt)=>{"use strict";function dYl(t){return Object.prototype.toString.call(t)==="[object Array]"}vJt.exports=Array.isArray||dYl});var XJt=f(($Ua,fJt)=>{"use strict";function GYl(t){return(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")&&t.valueOf()===t.valueOf()}fJt.exports=GYl});var HJt=f((e9a,wJt)=>{"use strict";var bYl=XJt();function mYl(t){return bYl(t)&&t%1===0}wJt.exports=mYl});var N3e=f((t9a,QJt)=>{"use strict";var pYl=Eie(),hYl=HJt();function ZYl(t){var e;if(!pYl(t)||(e=t.length,!e))return!1;for(var n=0;n{"use strict";function WYl(t){return typeof t=="function"}EJt.exports=WYl});var xJt=f((l9a,kJt)=>{"use strict";var NYl=Eie(),JJt=N3e(),VYl=V3e(),Jie=Math.pow(2,31)-1;function CJt(t,e){var n=1,l;if(t===0)return e;if(e===0)return t;for(;t%2===0&&e%2===0;)t=t/2,e=e/2,n=n*2;for(;t%2===0;)t=t/2;for(;e;){for(;e%2===0;)e=e/2;t>e&&(l=e,e=t,t=l),e=e-t}return n*t}function LJt(t,e){var n=0,l;if(t===0)return e;if(e===0)return t;for(;!(t&1)&&!(e&1);)t>>>=1,e>>>=1,n++;for(;!(t&1);)t>>>=1;for(;e;){for(;!(e&1);)e>>>=1;t>e&&(l=e,e=t,t=l),e=e-t}return t<1){if(l=e[0],n=e[1],!VYl(n))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+n+"`.")}else l=e[0];else throw new TypeError("gcd()::invalid input argument. Must provide an array of integers. Value: `"+e[0]+"`.");if(I=l.length,I<2)return null;if(n){for(a=new Array(I),i=0;i{"use strict";var jJt=xJt(),gYl=Eie(),OJt=N3e(),RYl=V3e();function yYl(){var t=arguments.length,e,n,l,I,a,c,i;for(e=new Array(t),i=0;i1){if(l=e[0],n=e[1],!RYl(n))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+n+"`.")}else l=e[0];else throw new TypeError("lcm()::invalid input argument. Must provide an array of integers. Value: `"+e[0]+"`.");if(I=l.length,I<2)return null;if(n){for(a=new Array(I),i=0;i{var AYl=Iie(),FYl=r1();function vYl(t,e,n){(n!==void 0&&!FYl(t[e],n)||n===void 0&&!(e in t))&&AYl(t,e,n)}BJt.exports=vYl});var g3e=f((r9a,SJt)=>{function fYl(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}SJt.exports=fYl});var TJt=f((c9a,MJt)=>{var XYl=Y4(),wYl=i1();function HYl(t){return XYl(t,wYl(t))}MJt.exports=HYl});var $Jt=f((o9a,qJt)=>{var DJt=Y3e(),QYl=Jxe(),EYl=Txe(),JYl=sie(),CYl=Dxe(),KJt=ED(),_Jt=gp(),LYl=vie(),kYl=CD(),xYl=tie(),jYl=vV(),OYl=oX(),UYl=oie(),PJt=g3e(),zYl=TJt();function BYl(t,e,n,l,I,a,c){var i=PJt(t,n),s=PJt(e,n),r=c.get(s);if(r){DJt(t,n,r);return}var u=a?a(i,s,n+"",t,e,c):void 0,o=u===void 0;if(o){var d=_Jt(s),b=!d&&kYl(s),h=!d&&!b&&UYl(s);u=s,d||b||h?_Jt(i)?u=i:LYl(i)?u=JYl(i):b?(o=!1,u=QYl(s,!0)):h?(o=!1,u=EYl(s,!0)):u=[]:OYl(s)||KJt(s)?(u=i,KJt(i)?u=zYl(i):(!jYl(i)||xYl(i))&&(u=CYl(s))):o=!1}o&&(c.set(s,u),I(u,s,l,a,c),c.delete(s)),DJt(t,n,u)}qJt.exports=BYl});var Cie=f((i9a,tCt)=>{var SYl=QD(),MYl=Y3e(),TYl=I3e(),DYl=$Jt(),KYl=vV(),_Yl=i1(),PYl=g3e();function eCt(t,e,n,l,I){t!==e&&TYl(e,function(a,c){if(I||(I=new SYl),KYl(a))DYl(t,e,c,n,eCt,l,I);else{var i=l?l(PYl(t,c),a,c+"",t,e,I):void 0;i===void 0&&(i=a),MYl(t,c,i)}},_Yl)}tCt.exports=eCt});var aCt=f((s9a,ICt)=>{var qYl=Cie(),nCt=vV();function lCt(t,e,n,l,I,a){return nCt(t)&&nCt(e)&&(a.set(e,t),qYl(t,e,void 0,lCt,a),a.delete(e)),t}ICt.exports=lCt});var R3e=f((u9a,rCt)=>{var $Yl=cX(),egl=gie();function tgl(t){return $Yl(function(e,n){var l=-1,I=n.length,a=I>1?n[I-1]:void 0,c=I>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(I--,a):void 0,c&&egl(n[0],n[1],c)&&(a=I<3?void 0:a,I=1),e=Object(e);++l{var ngl=Cie(),lgl=R3e(),Igl=lgl(function(t,e,n,l){ngl(t,e,n,l)});cCt.exports=Igl});var sCt=f((G9a,iCt)=>{var agl=c3e(),rgl=cX(),cgl=aCt(),ogl=oCt(),igl=rgl(function(t){return t.push(void 0,cgl),agl(ogl,void 0,t)});iCt.exports=igl});var y3e=f((b9a,uCt)=>{var sgl=Nie();function ugl(t){var e=t==null?0:t.length;return e?sgl(t,1):[]}uCt.exports=ugl});var A3e=f((m9a,dCt)=>{var dgl=Nie(),Ggl=1/0;function bgl(t){var e=t==null?0:t.length;return e?dgl(t,Ggl):[]}dCt.exports=bgl});var bCt=f((p9a,GCt)=>{var mgl=rX(),pgl=d3e(),hgl=cX(),Zgl=G3e(),Wgl=hgl(function(t){var e=mgl(t,Zgl);return e.length&&e[0]===t[0]?pgl(e):[]});GCt.exports=Wgl});var pCt=f((h9a,mCt)=>{function Ngl(t,e,n,l){for(var I=n-1,a=t.length;++I{var Vgl=rX(),Ygl=i3e(),ggl=pCt(),Rgl=aX(),ygl=sie(),Agl=Array.prototype,hCt=Agl.splice;function Fgl(t,e,n,l){var I=l?ggl:Ygl,a=-1,c=e.length,i=t;for(t===e&&(e=ygl(e)),n&&(i=Vgl(t,Rgl(n)));++a-1;)i!==t&&hCt.call(i,s,1),hCt.call(t,s,1);return t}ZCt.exports=Fgl});var VCt=f((W9a,NCt)=>{var vgl=WCt();function fgl(t,e){return t&&t.length&&e&&e.length?vgl(t,e):t}NCt.exports=fgl});var gCt=f((N9a,YCt)=>{var Xgl=v4();function wgl(t){return typeof t=="function"?t:Xgl}YCt.exports=wgl});var F3e=f((V9a,RCt)=>{var Hgl=fxe(),Qgl=a3e(),Egl=gCt(),Jgl=gp();function Cgl(t,e){var n=Jgl(t)?Hgl:Qgl;return n(t,Egl(e))}RCt.exports=Cgl});var ACt=f((Y9a,yCt)=>{var Lgl=OD(),kgl=Rie(),xgl=yie(),jgl=rX(),Ogl=aX(),Ugl=UD(),zgl=200;function Bgl(t,e,n,l){var I=-1,a=kgl,c=!0,i=t.length,s=[],r=e.length;if(!i)return s;n&&(e=jgl(e,Ogl(n))),l?(a=xgl,c=!1):e.length>=zgl&&(a=Ugl,c=!1,e=new Lgl(e));e:for(;++I{var Sgl=ACt(),Mgl=cX(),Tgl=vie(),Dgl=Mgl(function(t,e){return Tgl(t)?Sgl(t,e):[]});FCt.exports=Dgl});var f3e=f((R9a,HCt)=>{var Kgl=y3e(),_gl=A3e(),fCt=oX(),Pgl=Aie(),qgl=Fie(),$gl=vCt();function eRl(t){for(let e in t)XCt(t,e)&&wCt(t[e])&&delete t[e];return t}var tRl=t=>Pgl(_gl(t.map(v3e))),nRl=(t,e)=>t.map(n=>n&&n[e]),XCt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),v3e=t=>fCt(t)||Array.isArray(t)?Object.keys(t):[],lRl=t=>t!==void 0,IRl=t=>fCt(t)||t===!0||t===!1,wCt=t=>!v3e(t).length&&t!==!1&&t!==!0,aRl=(t,...e)=>$gl.apply(null,[t].concat(Kgl(e)));HCt.exports={allUniqueKeys:tRl,deleteUndefinedProps:eRl,getValues:nRl,has:XCt,isEmptySchema:wCt,isSchema:IRl,keys:v3e,notUndefined:lRl,uniqWith:qgl,withoutArr:aRl}});var CCt=f((y9a,JCt)=>{var rRl=Qie(),cRl=F3e(),{allUniqueKeys:oRl,deleteUndefinedProps:iRl,getValues:sRl,keys:SD,notUndefined:uRl,uniqWith:dRl,withoutArr:QCt}=f3e();function GRl(t){cRl(t,function(e,n){e===!1&&delete t[n]})}function ECt(t,e){return oRl(t).reduce(function(l,I){let a=sRl(t,I),c=dRl(a.filter(uRl),rRl);return l[I]=e(c,I),l},{})}JCt.exports={keywords:["properties","patternProperties","additionalProperties"],resolver(t,e,n,l){l.ignoreAdditionalProperties||(t.forEach(function(a){let c=t.filter(u=>u!==a),i=SD(a.properties),r=SD(a.patternProperties).map(u=>new RegExp(u));c.forEach(function(u){let o=SD(u.properties),d=o.filter(h=>r.some(Z=>Z.test(h)));QCt(o,i,d).forEach(function(h){u.properties[h]=n.properties([u.properties[h],a.additionalProperties],h)})})}),t.forEach(function(a){let c=t.filter(s=>s!==a),i=SD(a.patternProperties);a.additionalProperties===!1&&c.forEach(function(s){let r=SD(s.patternProperties);QCt(r,i).forEach(o=>delete s.patternProperties[o])})}));let I={additionalProperties:n.additionalProperties(t.map(a=>a.additionalProperties)),patternProperties:ECt(t.map(a=>a.patternProperties),n.patternProperties),properties:ECt(t.map(a=>a.properties),n.properties)};return I.additionalProperties===!1&&GRl(I.properties),iRl(I)}}});var jCt=f((A9a,xCt)=>{var bRl=Qie(),mRl=F3e(),{allUniqueKeys:pRl,deleteUndefinedProps:hRl,has:ZRl,isSchema:LCt,notUndefined:kCt,uniqWith:WRl}=f3e();function NRl(t){mRl(t,function(e,n){e===!1&&t.splice(n,1)})}function VRl(t,e){return t.map(function(n){if(n)if(Array.isArray(n.items)){let l=n.items[e];if(LCt(l))return l;if(ZRl(n,"additionalItems"))return n.additionalItems}else return n.items})}function YRl(t){return t.map(function(e){if(e)return Array.isArray(e.items)?e.additionalItems:e.items})}function gRl(t,e,n){return pRl(n).reduce(function(I,a){let c=VRl(t,a),i=WRl(c.filter(kCt),bRl);return I[a]=e(i,a),I},[])}xCt.exports={keywords:["items","additionalItems"],resolver(t,e,n){let l=t.map(i=>i.items),I=l.filter(kCt),a={};I.every(LCt)?a.items=n.items(l):a.items=gRl(t,n.items,l);let c;return I.every(Array.isArray)?c=t.map(i=>i.additionalItems):I.some(Array.isArray)&&(c=YRl(t)),c&&(a.additionalItems=n.additionalItems(c)),a.additionalItems===!1&&Array.isArray(a.items)&&NRl(a.items),hRl(a)}}});var $Ct=f((F9a,qCt)=>{var OCt=Kxe(),kie=Qie(),RRl=zJt(),yRl=sCt(),UCt=y3e(),H3e=A3e(),ARl=bCt(),FRl=b3e(),X3e=$xe(),H4=oX(),vRl=VCt(),zCt=o3e(),Q3e=Aie(),w4=Fie(),BCt=CCt(),SCt=jCt(),Lie=(t,e)=>t.indexOf(e)!==-1,fRl=t=>H4(t)||t===!0||t===!1,XRl=t=>t===!1,MCt=t=>t===!0,jie=(t,e,n)=>n(t),TCt=t=>zCt(Q3e(H3e(t))),xie=t=>t!==void 0,DCt=t=>Q3e(H3e(t.map(CRl))),Q4=t=>t[0],wRl=t=>TCt(t),MD=t=>Math.max.apply(Math,t),TD=t=>Math.min.apply(Math,t),HRl=t=>t.some(MCt),QRl=t=>w4(UCt(t),X3e);function ERl(t){return function(e,n){return kie({[t]:e},{[t]:n})}}function KCt(t){let{allOf:e=[],...n}=t;return n=H4(t)?n:t,[n,...e.map(KCt)]}function _Ct(t,e){return t.map(n=>n&&n[e])}function JRl(t,e){return t.map(function(n,l){try{return e(n,l)}catch{return}}).filter(xie)}function CRl(t){return H4(t)||Array.isArray(t)?Object.keys(t):[]}function w3e(t,e){if(e=e||[],!t.length)return e;let n=t.slice(0).shift(),l=t.slice(1);return e.length?w3e(l,UCt(e.map(I=>n.map(a=>[a].concat(I))))):w3e(l,n.map(I=>I))}function PCt(t,e){let n;try{n=t.map(function(l){return JSON.stringify(l,null,2)}).join(` +`)}catch{n=t.join(", ")}throw new Error('Could not resolve values for path:"'+e.join(".")+`". They are probably incompatible. Values: +`+n)}function LRl(t,e,n,l,I,a){if(t.length){let c=I.complexResolvers[e];if(!c||!c.resolver)throw new Error("No resolver found for "+e);let i=n.map(o=>t.reduce((d,b)=>(o[b]!==void 0&&(d[b]=o[b]),d),{})),s=w4(i,kie),r=c.keywords.reduce((o,d)=>({...o,[d]:(b,h=[])=>l(b,null,a.concat(d,h))}),{}),u=c.resolver(s,a.concat(e),r,I);return H4(u)||PCt(s,a.concat(e)),u}}function kRl(t){return{required:t}}var xRl=["properties","patternProperties","definitions","dependencies"],jRl=["anyOf","oneOf"],ORl=["additionalProperties","additionalItems","contains","propertyNames","not","items"],Zr={type(t){if(t.some(Array.isArray)){let e=t.map(function(l){return Array.isArray(l)?l:[l]}),n=ARl.apply(null,e);if(n.length===1)return n[0];if(n.length>1)return Q3e(n)}},dependencies(t,e,n){return DCt(t).reduce(function(I,a){let c=_Ct(t,a),i=w4(c.filter(xie),X3e),s=i.filter(Array.isArray);if(s.length){if(s.length===i.length)I[a]=TCt(i);else{let r=i.filter(fRl),u=s.map(kRl);I[a]=n(r.concat(u),a)}return I}return i=w4(i,kie),I[a]=n(i,a),I},{})},oneOf(t,e,n){let l=w3e(OCt(t)),I=JRl(l,n),a=w4(I,kie);if(a.length)return a},not(t){return{anyOf:t}},pattern(t){return t.map(e=>"(?="+e+")").join("")},multipleOf(t){let e=t.slice(0),n=1;for(;e.some(l=>!Number.isInteger(l));)e=e.map(l=>l*10),n=n*10;return RRl(e)/n},enum(t){let e=FRl.apply(null,t.concat(X3e));if(e.length)return zCt(e)}};Zr.$id=Q4;Zr.$ref=Q4;Zr.$schema=Q4;Zr.additionalItems=jie;Zr.additionalProperties=jie;Zr.anyOf=Zr.oneOf;Zr.contains=jie;Zr.default=Q4;Zr.definitions=Zr.dependencies;Zr.description=Q4;Zr.examples=QRl;Zr.exclusiveMaximum=TD;Zr.exclusiveMinimum=MD;Zr.items=SCt;Zr.maximum=TD;Zr.maxItems=TD;Zr.maxLength=TD;Zr.maxProperties=TD;Zr.minimum=MD;Zr.minItems=MD;Zr.minLength=MD;Zr.minProperties=MD;Zr.properties=BCt;Zr.propertyNames=jie;Zr.required=wRl;Zr.title=Q4;Zr.uniqueItems=HRl;var URl={properties:BCt,items:SCt};function E3e(t,e,n){n=n||[],e=yRl(e,{ignoreAdditionalProperties:!1,resolvers:Zr,complexResolvers:URl,deep:!0});let l=Object.entries(e.complexResolvers);function I(i,s,r){i=OCt(i.filter(xie)),r=r||[];let u=H4(s)?s:{};if(!i.length)return;if(i.some(XRl))return!1;if(i.every(MCt))return!0;i=i.filter(H4);let o=DCt(i);if(e.deep&&Lie(o,"allOf"))return E3e({allOf:i},e,n);let d=l.map(([b,h])=>o.filter(Z=>h.keywords.includes(Z)));return d.forEach(b=>vRl(o,b)),o.forEach(function(b){let h=_Ct(i,b),Z=w4(h.filter(xie),ERl(b));if(Z.length===1&&Lie(jRl,b))u[b]=Z[0].map(N=>I([N],N));else if(Z.length===1&&!Lie(xRl,b)&&!Lie(ORl,b))u[b]=Z[0];else{let N=e.resolvers[b]||e.resolvers.defaultResolver;if(!N)throw new Error("No resolver found for key "+b+". You can provide a resolver for this keyword in the options, or provide a default resolver.");let g=(y,X=[])=>I(y,null,r.concat(b,X));u[b]=N(Z,r.concat(b),g,e),u[b]===void 0?PCt(Z,r.concat(b)):u[b]===void 0&&delete u[b]}}),l.reduce((b,[h,Z],N)=>({...b,...LRl(d[N],h,i,I,e,r)}),u)}let a=H3e(KCt(t));return I(a)}E3e.options={resolvers:Zr};qCt.exports=E3e});var u5t=f(tse=>{"use strict";var ryl=Ae(),cyl=Symbol.for("react.element"),oyl=Symbol.for("react.fragment"),iyl=Object.prototype.hasOwnProperty,syl=ryl.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,uyl={key:!0,ref:!0,__self:!0,__source:!0};function s5t(t,e,n){var l,I={},a=null,c=null;n!==void 0&&(a=""+n),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(c=e.ref);for(l in e)iyl.call(e,l)&&!uyl.hasOwnProperty(l)&&(I[l]=e[l]);if(t&&t.defaultProps)for(l in e=t.defaultProps,e)I[l]===void 0&&(I[l]=e[l]);return{$$typeof:cyl,type:t,key:a,ref:c,props:I,_owner:syl.current}}tse.Fragment=oyl;tse.jsx=s5t;tse.jsxs=s5t});var In=f((SSa,d5t)=>{"use strict";d5t.exports=u5t()});var b5t=f(Jr=>{"use strict";var x3e=Symbol.for("react.element"),j3e=Symbol.for("react.portal"),nse=Symbol.for("react.fragment"),lse=Symbol.for("react.strict_mode"),Ise=Symbol.for("react.profiler"),ase=Symbol.for("react.provider"),rse=Symbol.for("react.context"),dyl=Symbol.for("react.server_context"),cse=Symbol.for("react.forward_ref"),ose=Symbol.for("react.suspense"),ise=Symbol.for("react.suspense_list"),sse=Symbol.for("react.memo"),use=Symbol.for("react.lazy"),Gyl=Symbol.for("react.offscreen"),G5t;G5t=Symbol.for("react.module.reference");function fW(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case x3e:switch(t=t.type,t){case nse:case Ise:case lse:case ose:case ise:return t;default:switch(t=t&&t.$$typeof,t){case dyl:case rse:case cse:case use:case sse:case ase:return t;default:return e}}case j3e:return e}}}Jr.ContextConsumer=rse;Jr.ContextProvider=ase;Jr.Element=x3e;Jr.ForwardRef=cse;Jr.Fragment=nse;Jr.Lazy=use;Jr.Memo=sse;Jr.Portal=j3e;Jr.Profiler=Ise;Jr.StrictMode=lse;Jr.Suspense=ose;Jr.SuspenseList=ise;Jr.isAsyncMode=function(){return!1};Jr.isConcurrentMode=function(){return!1};Jr.isContextConsumer=function(t){return fW(t)===rse};Jr.isContextProvider=function(t){return fW(t)===ase};Jr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===x3e};Jr.isForwardRef=function(t){return fW(t)===cse};Jr.isFragment=function(t){return fW(t)===nse};Jr.isLazy=function(t){return fW(t)===use};Jr.isMemo=function(t){return fW(t)===sse};Jr.isPortal=function(t){return fW(t)===j3e};Jr.isProfiler=function(t){return fW(t)===Ise};Jr.isStrictMode=function(t){return fW(t)===lse};Jr.isSuspense=function(t){return fW(t)===ose};Jr.isSuspenseList=function(t){return fW(t)===ise};Jr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===nse||t===Ise||t===lse||t===ose||t===ise||t===Gyl||typeof t=="object"&&t!==null&&(t.$$typeof===use||t.$$typeof===sse||t.$$typeof===ase||t.$$typeof===rse||t.$$typeof===cse||t.$$typeof===G5t||t.getModuleId!==void 0)};Jr.typeOf=fW});var p5t=f((TSa,m5t)=>{"use strict";m5t.exports=b5t()});var $D=f(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.regexpCode=Aa.getEsmExportName=Aa.getProperty=Aa.safeStringify=Aa.stringify=Aa.strConcat=Aa.addCodeArg=Aa.str=Aa._=Aa.nil=Aa._Code=Aa.Name=Aa.IDENTIFIER=Aa._CodeOrName=void 0;var PD=class{};Aa._CodeOrName=PD;Aa.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var m1=class extends PD{constructor(e){if(super(),!Aa.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Aa.Name=m1;var XW=class extends PD{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((n,l)=>`${n}${l}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,l)=>(l instanceof m1&&(n[l.str]=(n[l.str]||0)+1),n),{})}};Aa._Code=XW;Aa.nil=new XW("");function g5t(t,...e){let n=[t[0]],l=0;for(;l{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.ValueScope=Fp.ValueScopeName=Fp.Scope=Fp.varKinds=Fp.UsedValueState=void 0;var Ap=$D(),S3e=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Vse;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Vse||(Fp.UsedValueState=Vse={}));Fp.varKinds={const:new Ap.Name("const"),let:new Ap.Name("let"),var:new Ap.Name("var")};var Yse=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof Ap.Name?e:this.name(e)}name(e){return new Ap.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,l;if(!((l=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||l===void 0)&&l.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Fp.Scope=Yse;var gse=class extends Ap.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:l}){this.value=e,this.scopePath=(0,Ap._)`.${new Ap.Name(n)}[${l}]`}};Fp.ValueScopeName=gse;var Qyl=(0,Ap._)`\n`,M3e=class extends Yse{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Qyl:Ap.nil}}get(){return this._scope}name(e){return new gse(e,this._newName(e))}value(e,n){var l;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let I=this.toName(e),{prefix:a}=I,c=(l=n.key)!==null&&l!==void 0?l:n.ref,i=this._values[a];if(i){let u=i.get(c);if(u)return u}else i=this._values[a]=new Map;i.set(c,I);let s=this._scope[a]||(this._scope[a]=[]),r=s.length;return s[r]=n.ref,I.setValue(n,{property:a,itemIndex:r}),I}getValue(e,n){let l=this._values[e];if(l)return l.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,l=>{if(l.scopePath===void 0)throw new Error(`CodeGen: name "${l}" has no value`);return(0,Ap._)`${e}${l.scopePath}`})}scopeCode(e=this._values,n,l){return this._reduceValues(e,I=>{if(I.value===void 0)throw new Error(`CodeGen: name "${I}" has no value`);return I.value.code},n,l)}_reduceValues(e,n,l={},I){let a=Ap.nil;for(let c in e){let i=e[c];if(!i)continue;let s=l[c]=l[c]||new Map;i.forEach(r=>{if(s.has(r))return;s.set(r,Vse.Started);let u=n(r);if(u){let o=this.opts.es5?Fp.varKinds.var:Fp.varKinds.const;a=(0,Ap._)`${a}${o} ${r} = ${u};${this.opts._n}`}else if(u=I?.(r))a=(0,Ap._)`${a}${u}${this.opts._n}`;else throw new S3e(r);s.set(r,Vse.Completed)})}return a}};Fp.ValueScope=M3e});var Kl=f(eI=>{"use strict";Object.defineProperty(eI,"__esModule",{value:!0});eI.or=eI.and=eI.not=eI.CodeGen=eI.operators=eI.varKinds=eI.ValueScopeName=eI.ValueScope=eI.Scope=eI.Name=eI.regexpCode=eI.stringify=eI.getProperty=eI.nil=eI.strConcat=eI.str=eI._=void 0;var FI=$D(),EV=T3e(),hX=$D();Object.defineProperty(eI,"_",{enumerable:!0,get:function(){return hX._}});Object.defineProperty(eI,"str",{enumerable:!0,get:function(){return hX.str}});Object.defineProperty(eI,"strConcat",{enumerable:!0,get:function(){return hX.strConcat}});Object.defineProperty(eI,"nil",{enumerable:!0,get:function(){return hX.nil}});Object.defineProperty(eI,"getProperty",{enumerable:!0,get:function(){return hX.getProperty}});Object.defineProperty(eI,"stringify",{enumerable:!0,get:function(){return hX.stringify}});Object.defineProperty(eI,"regexpCode",{enumerable:!0,get:function(){return hX.regexpCode}});Object.defineProperty(eI,"Name",{enumerable:!0,get:function(){return hX.Name}});var Fse=T3e();Object.defineProperty(eI,"Scope",{enumerable:!0,get:function(){return Fse.Scope}});Object.defineProperty(eI,"ValueScope",{enumerable:!0,get:function(){return Fse.ValueScope}});Object.defineProperty(eI,"ValueScopeName",{enumerable:!0,get:function(){return Fse.ValueScopeName}});Object.defineProperty(eI,"varKinds",{enumerable:!0,get:function(){return Fse.varKinds}});eI.operators={GT:new FI._Code(">"),GTE:new FI._Code(">="),LT:new FI._Code("<"),LTE:new FI._Code("<="),EQ:new FI._Code("==="),NEQ:new FI._Code("!=="),NOT:new FI._Code("!"),OR:new FI._Code("||"),AND:new FI._Code("&&"),ADD:new FI._Code("+")};var e0=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},D3e=class extends e0{constructor(e,n,l){super(),this.varKind=e,this.name=n,this.rhs=l}render({es5:e,_n:n}){let l=e?EV.varKinds.var:this.varKind,I=this.rhs===void 0?"":` = ${this.rhs}`;return`${l} ${this.name}${I};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=ej(this.rhs,e,n)),this}get names(){return this.rhs instanceof FI._CodeOrName?this.rhs.names:{}}},Rse=class extends e0{constructor(e,n,l){super(),this.lhs=e,this.rhs=n,this.sideEffects=l}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof FI.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ej(this.rhs,e,n),this}get names(){let e=this.lhs instanceof FI.Name?{}:{...this.lhs.names};return Ase(e,this.rhs)}},K3e=class extends Rse{constructor(e,n,l,I){super(e,l,I),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},_3e=class extends e0{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},P3e=class extends e0{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},q3e=class extends e0{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},$3e=class extends e0{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=ej(this.code,e,n),this}get names(){return this.code instanceof FI._CodeOrName?this.code.names:{}}},eK=class extends e0{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,l)=>n+l.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let l=e[n].optimizeNodes();Array.isArray(l)?e.splice(n,1,...l):l?e[n]=l:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:l}=this,I=l.length;for(;I--;){let a=l[I];a.optimizeNames(e,n)||(Eyl(e,a.names),l.splice(I,1))}return l.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>Z1(e,n.names),{})}},t0=class extends eK{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},e4e=class extends eK{},$4=class extends t0{};$4.kind="else";var p1=class t extends t0{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let l=n.optimizeNodes();n=this.else=Array.isArray(l)?new $4(l):l}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(y5t(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var l;if(this.else=(l=this.else)===null||l===void 0?void 0:l.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=ej(this.condition,e,n),this}get names(){let e=super.names;return Ase(e,this.condition),this.else&&Z1(e,this.else.names),e}};p1.kind="if";var h1=class extends t0{};h1.kind="for";var t4e=class extends h1{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=ej(this.iteration,e,n),this}get names(){return Z1(super.names,this.iteration.names)}},n4e=class extends h1{constructor(e,n,l,I){super(),this.varKind=e,this.name=n,this.from=l,this.to=I}render(e){let n=e.es5?EV.varKinds.var:this.varKind,{name:l,from:I,to:a}=this;return`for(${n} ${l}=${I}; ${l}<${a}; ${l}++)`+super.render(e)}get names(){let e=Ase(super.names,this.from);return Ase(e,this.to)}},yse=class extends h1{constructor(e,n,l,I){super(),this.loop=e,this.varKind=n,this.name=l,this.iterable=I}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=ej(this.iterable,e,n),this}get names(){return Z1(super.names,this.iterable.names)}},tK=class extends t0{constructor(e,n,l){super(),this.name=e,this.args=n,this.async=l}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};tK.kind="func";var nK=class extends eK{render(e){return"return "+super.render(e)}};nK.kind="return";var l4e=class extends t0{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var l,I;return super.optimizeNames(e,n),(l=this.catch)===null||l===void 0||l.optimizeNames(e,n),(I=this.finally)===null||I===void 0||I.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&Z1(e,this.catch.names),this.finally&&Z1(e,this.finally.names),e}},lK=class extends t0{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};lK.kind="catch";var IK=class extends t0{render(e){return"finally"+super.render(e)}};IK.kind="finally";var I4e=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?` +`:""},this._extScope=e,this._scope=new EV.Scope({parent:e}),this._nodes=[new e4e]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let l=this._extScope.value(e,n);return(this._values[l.prefix]||(this._values[l.prefix]=new Set)).add(l),l}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,l,I){let a=this._scope.toName(n);return l!==void 0&&I&&(this._constants[a.str]=l),this._leafNode(new D3e(e,a,l)),a}const(e,n,l){return this._def(EV.varKinds.const,e,n,l)}let(e,n,l){return this._def(EV.varKinds.let,e,n,l)}var(e,n,l){return this._def(EV.varKinds.var,e,n,l)}assign(e,n,l){return this._leafNode(new Rse(e,n,l))}add(e,n){return this._leafNode(new K3e(e,eI.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==FI.nil&&this._leafNode(new $3e(e)),this}object(...e){let n=["{"];for(let[l,I]of e)n.length>1&&n.push(","),n.push(l),(l!==I||this.opts.es5)&&(n.push(":"),(0,FI.addCodeArg)(n,I));return n.push("}"),new FI._Code(n)}if(e,n,l){if(this._blockNode(new p1(e)),n&&l)this.code(n).else().code(l).endIf();else if(n)this.code(n).endIf();else if(l)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new p1(e))}else(){return this._elseNode(new $4)}endIf(){return this._endBlockNode(p1,$4)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new t4e(e),n)}forRange(e,n,l,I,a=this.opts.es5?EV.varKinds.var:EV.varKinds.let){let c=this._scope.toName(e);return this._for(new n4e(a,c,n,l),()=>I(c))}forOf(e,n,l,I=EV.varKinds.const){let a=this._scope.toName(e);if(this.opts.es5){let c=n instanceof FI.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,FI._)`${c}.length`,i=>{this.var(a,(0,FI._)`${c}[${i}]`),l(a)})}return this._for(new yse("of",I,a,n),()=>l(a))}forIn(e,n,l,I=this.opts.es5?EV.varKinds.var:EV.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,FI._)`Object.keys(${n})`,l);let a=this._scope.toName(e);return this._for(new yse("in",I,a,n),()=>l(a))}endFor(){return this._endBlockNode(h1)}label(e){return this._leafNode(new _3e(e))}break(e){return this._leafNode(new P3e(e))}return(e){let n=new nK;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(nK)}try(e,n,l){if(!n&&!l)throw new Error('CodeGen: "try" without "catch" and "finally"');let I=new l4e;if(this._blockNode(I),this.code(e),n){let a=this.name("e");this._currNode=I.catch=new lK(a),n(a)}return l&&(this._currNode=I.finally=new IK,this.code(l)),this._endBlockNode(lK,IK)}throw(e){return this._leafNode(new q3e(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let l=this._nodes.length-n;if(l<0||e!==void 0&&l!==e)throw new Error(`CodeGen: wrong number of nodes: ${l} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=FI.nil,l,I){return this._blockNode(new tK(e,n,l)),I&&this.code(I).endFunc(),this}endFunc(){return this._endBlockNode(tK)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let l=this._currNode;if(l instanceof e||n&&l instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof p1))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};eI.CodeGen=I4e;function Z1(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function Ase(t,e){return e instanceof FI._CodeOrName?Z1(t,e.names):t}function ej(t,e,n){if(t instanceof FI.Name)return l(t);if(!I(t))return t;return new FI._Code(t._items.reduce((a,c)=>(c instanceof FI.Name&&(c=l(c)),c instanceof FI._Code?a.push(...c._items):a.push(c),a),[]));function l(a){let c=n[a.str];return c===void 0||e[a.str]!==1?a:(delete e[a.str],c)}function I(a){return a instanceof FI._Code&&a._items.some(c=>c instanceof FI.Name&&e[c.str]===1&&n[c.str]!==void 0)}}function Eyl(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function y5t(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,FI._)`!${a4e(t)}`}eI.not=y5t;var Jyl=A5t(eI.operators.AND);function Cyl(...t){return t.reduce(Jyl)}eI.and=Cyl;var Lyl=A5t(eI.operators.OR);function kyl(...t){return t.reduce(Lyl)}eI.or=kyl;function A5t(t){return(e,n)=>e===FI.nil?n:n===FI.nil?e:(0,FI._)`${a4e(e)} ${t} ${a4e(n)}`}function a4e(t){return t instanceof FI.Name?t:(0,FI._)`(${t})`}});var Fa=f(aI=>{"use strict";Object.defineProperty(aI,"__esModule",{value:!0});aI.checkStrictMode=aI.getErrorPath=aI.Type=aI.useFunc=aI.setEvaluated=aI.evaluatedPropsToName=aI.mergeEvaluated=aI.eachItem=aI.unescapeJsonPointer=aI.escapeJsonPointer=aI.escapeFragment=aI.unescapeFragment=aI.schemaRefOrVal=aI.schemaHasRulesButRef=aI.schemaHasRules=aI.checkUnknownRules=aI.alwaysValidSchema=aI.toHash=void 0;var tc=Kl(),xyl=$D();function jyl(t){let e={};for(let n of t)e[n]=!0;return e}aI.toHash=jyl;function Oyl(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(f5t(t,e),!X5t(e,t.self.RULES.all))}aI.alwaysValidSchema=Oyl;function f5t(t,e=t.schema){let{opts:n,self:l}=t;if(!n.strictSchema||typeof e=="boolean")return;let I=l.RULES.keywords;for(let a in e)I[a]||Q5t(t,`unknown keyword: "${a}"`)}aI.checkUnknownRules=f5t;function X5t(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}aI.schemaHasRules=X5t;function Uyl(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}aI.schemaHasRulesButRef=Uyl;function zyl({topSchemaRef:t,schemaPath:e},n,l,I){if(!I){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,tc._)`${n}`}return(0,tc._)`${t}${e}${(0,tc.getProperty)(l)}`}aI.schemaRefOrVal=zyl;function Byl(t){return w5t(decodeURIComponent(t))}aI.unescapeFragment=Byl;function Syl(t){return encodeURIComponent(c4e(t))}aI.escapeFragment=Syl;function c4e(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}aI.escapeJsonPointer=c4e;function w5t(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}aI.unescapeJsonPointer=w5t;function Myl(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}aI.eachItem=Myl;function F5t({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:l}){return(I,a,c,i)=>{let s=c===void 0?a:c instanceof tc.Name?(a instanceof tc.Name?t(I,a,c):e(I,a,c),c):a instanceof tc.Name?(e(I,c,a),a):n(a,c);return i===tc.Name&&!(s instanceof tc.Name)?l(I,s):s}}aI.mergeEvaluated={props:F5t({mergeNames:(t,e,n)=>t.if((0,tc._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,tc._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,tc._)`${n} || {}`).code((0,tc._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,tc._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,tc._)`${n} || {}`),o4e(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:H5t}),items:F5t({mergeNames:(t,e,n)=>t.if((0,tc._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,tc._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,tc._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,tc._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function H5t(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,tc._)`{}`);return e!==void 0&&o4e(t,n,e),n}aI.evaluatedPropsToName=H5t;function o4e(t,e,n){Object.keys(n).forEach(l=>t.assign((0,tc._)`${e}${(0,tc.getProperty)(l)}`,!0))}aI.setEvaluated=o4e;var v5t={};function Tyl(t,e){return t.scopeValue("func",{ref:e,code:v5t[e.code]||(v5t[e.code]=new xyl._Code(e.code))})}aI.useFunc=Tyl;var r4e;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(r4e||(aI.Type=r4e={}));function Dyl(t,e,n){if(t instanceof tc.Name){let l=e===r4e.Num;return n?l?(0,tc._)`"[" + ${t} + "]"`:(0,tc._)`"['" + ${t} + "']"`:l?(0,tc._)`"/" + ${t}`:(0,tc._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,tc.getProperty)(t).toString():"/"+c4e(t)}aI.getErrorPath=Dyl;function Q5t(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}aI.checkStrictMode=Q5t});var n0=f(i4e=>{"use strict";Object.defineProperty(i4e,"__esModule",{value:!0});var vb=Kl(),Kyl={data:new vb.Name("data"),valCxt:new vb.Name("valCxt"),instancePath:new vb.Name("instancePath"),parentData:new vb.Name("parentData"),parentDataProperty:new vb.Name("parentDataProperty"),rootData:new vb.Name("rootData"),dynamicAnchors:new vb.Name("dynamicAnchors"),vErrors:new vb.Name("vErrors"),errors:new vb.Name("errors"),this:new vb.Name("this"),self:new vb.Name("self"),scope:new vb.Name("scope"),json:new vb.Name("json"),jsonPos:new vb.Name("jsonPos"),jsonLen:new vb.Name("jsonLen"),jsonPart:new vb.Name("jsonPart")};i4e.default=Kyl});var aK=f(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});fb.extendErrors=fb.resetErrorsCount=fb.reportExtraError=fb.reportError=fb.keyword$DataError=fb.keywordError=void 0;var EI=Kl(),vse=Fa(),Vm=n0();fb.keywordError={message:({keyword:t})=>(0,EI.str)`must pass "${t}" keyword validation`};fb.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,EI.str)`"${t}" keyword must be ${e} ($data)`:(0,EI.str)`"${t}" keyword is invalid ($data)`};function _yl(t,e=fb.keywordError,n,l){let{it:I}=t,{gen:a,compositeRule:c,allErrors:i}=I,s=C5t(t,e,n);l??(c||i)?E5t(a,s):J5t(I,(0,EI._)`[${s}]`)}fb.reportError=_yl;function Pyl(t,e=fb.keywordError,n){let{it:l}=t,{gen:I,compositeRule:a,allErrors:c}=l,i=C5t(t,e,n);E5t(I,i),a||c||J5t(l,Vm.default.vErrors)}fb.reportExtraError=Pyl;function qyl(t,e){t.assign(Vm.default.errors,e),t.if((0,EI._)`${Vm.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,EI._)`${Vm.default.vErrors}.length`,e),()=>t.assign(Vm.default.vErrors,null)))}fb.resetErrorsCount=qyl;function $yl({gen:t,keyword:e,schemaValue:n,data:l,errsCount:I,it:a}){if(I===void 0)throw new Error("ajv implementation error");let c=t.name("err");t.forRange("i",I,Vm.default.errors,i=>{t.const(c,(0,EI._)`${Vm.default.vErrors}[${i}]`),t.if((0,EI._)`${c}.instancePath === undefined`,()=>t.assign((0,EI._)`${c}.instancePath`,(0,EI.strConcat)(Vm.default.instancePath,a.errorPath))),t.assign((0,EI._)`${c}.schemaPath`,(0,EI.str)`${a.errSchemaPath}/${e}`),a.opts.verbose&&(t.assign((0,EI._)`${c}.schema`,n),t.assign((0,EI._)`${c}.data`,l))})}fb.extendErrors=$yl;function E5t(t,e){let n=t.const("err",e);t.if((0,EI._)`${Vm.default.vErrors} === null`,()=>t.assign(Vm.default.vErrors,(0,EI._)`[${n}]`),(0,EI._)`${Vm.default.vErrors}.push(${n})`),t.code((0,EI._)`${Vm.default.errors}++`)}function J5t(t,e){let{gen:n,validateName:l,schemaEnv:I}=t;I.$async?n.throw((0,EI._)`new ${t.ValidationError}(${e})`):(n.assign((0,EI._)`${l}.errors`,e),n.return(!1))}var W1={keyword:new EI.Name("keyword"),schemaPath:new EI.Name("schemaPath"),params:new EI.Name("params"),propertyName:new EI.Name("propertyName"),message:new EI.Name("message"),schema:new EI.Name("schema"),parentSchema:new EI.Name("parentSchema")};function C5t(t,e,n){let{createErrors:l}=t.it;return l===!1?(0,EI._)`{}`:eAl(t,e,n)}function eAl(t,e,n={}){let{gen:l,it:I}=t,a=[tAl(I,n),nAl(t,n)];return lAl(t,e,a),l.object(...a)}function tAl({errorPath:t},{instancePath:e}){let n=e?(0,EI.str)`${t}${(0,vse.getErrorPath)(e,vse.Type.Str)}`:t;return[Vm.default.instancePath,(0,EI.strConcat)(Vm.default.instancePath,n)]}function nAl({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:l}){let I=l?e:(0,EI.str)`${e}/${t}`;return n&&(I=(0,EI.str)`${I}${(0,vse.getErrorPath)(n,vse.Type.Str)}`),[W1.schemaPath,I]}function lAl(t,{params:e,message:n},l){let{keyword:I,data:a,schemaValue:c,it:i}=t,{opts:s,propertyName:r,topSchemaRef:u,schemaPath:o}=i;l.push([W1.keyword,I],[W1.params,typeof e=="function"?e(t):e||(0,EI._)`{}`]),s.messages&&l.push([W1.message,typeof n=="function"?n(t):n]),s.verbose&&l.push([W1.schema,c],[W1.parentSchema,(0,EI._)`${u}${o}`],[Vm.default.data,a]),r&&l.push([W1.propertyName,r])}});var k5t=f(tj=>{"use strict";Object.defineProperty(tj,"__esModule",{value:!0});tj.boolOrEmptySchema=tj.topBoolOrEmptySchema=void 0;var IAl=aK(),aAl=Kl(),rAl=n0(),cAl={message:"boolean schema is false"};function oAl(t){let{gen:e,schema:n,validateName:l}=t;n===!1?L5t(t,!1):typeof n=="object"&&n.$async===!0?e.return(rAl.default.data):(e.assign((0,aAl._)`${l}.errors`,null),e.return(!0))}tj.topBoolOrEmptySchema=oAl;function iAl(t,e){let{gen:n,schema:l}=t;l===!1?(n.var(e,!1),L5t(t)):n.var(e,!0)}tj.boolOrEmptySchema=iAl;function L5t(t,e){let{gen:n,data:l}=t,I={gen:n,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,IAl.reportError)(I,cAl,void 0,e)}});var s4e=f(nj=>{"use strict";Object.defineProperty(nj,"__esModule",{value:!0});nj.getRules=nj.isJSONType=void 0;var sAl=["string","number","integer","boolean","null","object","array"],uAl=new Set(sAl);function dAl(t){return typeof t=="string"&&uAl.has(t)}nj.isJSONType=dAl;function GAl(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}nj.getRules=GAl});var u4e=f(ZX=>{"use strict";Object.defineProperty(ZX,"__esModule",{value:!0});ZX.shouldUseRule=ZX.shouldUseGroup=ZX.schemaHasRulesForType=void 0;function bAl({schema:t,self:e},n){let l=e.RULES.types[n];return l&&l!==!0&&x5t(t,l)}ZX.schemaHasRulesForType=bAl;function x5t(t,e){return e.rules.some(n=>j5t(t,n))}ZX.shouldUseGroup=x5t;function j5t(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(l=>t[l]!==void 0))}ZX.shouldUseRule=j5t});var rK=f(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});Xb.reportTypeError=Xb.checkDataTypes=Xb.checkDataType=Xb.coerceAndCheckDataType=Xb.getJSONTypes=Xb.getSchemaTypes=Xb.DataType=void 0;var mAl=s4e(),pAl=u4e(),hAl=aK(),Bl=Kl(),O5t=Fa(),lj;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(lj||(Xb.DataType=lj={}));function ZAl(t){let e=U5t(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Xb.getSchemaTypes=ZAl;function U5t(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(mAl.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Xb.getJSONTypes=U5t;function WAl(t,e){let{gen:n,data:l,opts:I}=t,a=NAl(e,I.coerceTypes),c=e.length>0&&!(a.length===0&&e.length===1&&(0,pAl.schemaHasRulesForType)(t,e[0]));if(c){let i=G4e(e,l,I.strictNumbers,lj.Wrong);n.if(i,()=>{a.length?VAl(t,e,a):b4e(t)})}return c}Xb.coerceAndCheckDataType=WAl;var z5t=new Set(["string","number","integer","boolean","null"]);function NAl(t,e){return e?t.filter(n=>z5t.has(n)||e==="array"&&n==="array"):[]}function VAl(t,e,n){let{gen:l,data:I,opts:a}=t,c=l.let("dataType",(0,Bl._)`typeof ${I}`),i=l.let("coerced",(0,Bl._)`undefined`);a.coerceTypes==="array"&&l.if((0,Bl._)`${c} == 'object' && Array.isArray(${I}) && ${I}.length == 1`,()=>l.assign(I,(0,Bl._)`${I}[0]`).assign(c,(0,Bl._)`typeof ${I}`).if(G4e(e,I,a.strictNumbers),()=>l.assign(i,I))),l.if((0,Bl._)`${i} !== undefined`);for(let r of n)(z5t.has(r)||r==="array"&&a.coerceTypes==="array")&&s(r);l.else(),b4e(t),l.endIf(),l.if((0,Bl._)`${i} !== undefined`,()=>{l.assign(I,i),YAl(t,i)});function s(r){switch(r){case"string":l.elseIf((0,Bl._)`${c} == "number" || ${c} == "boolean"`).assign(i,(0,Bl._)`"" + ${I}`).elseIf((0,Bl._)`${I} === null`).assign(i,(0,Bl._)`""`);return;case"number":l.elseIf((0,Bl._)`${c} == "boolean" || ${I} === null + || (${c} == "string" && ${I} && ${I} == +${I})`).assign(i,(0,Bl._)`+${I}`);return;case"integer":l.elseIf((0,Bl._)`${c} === "boolean" || ${I} === null + || (${c} === "string" && ${I} && ${I} == +${I} && !(${I} % 1))`).assign(i,(0,Bl._)`+${I}`);return;case"boolean":l.elseIf((0,Bl._)`${I} === "false" || ${I} === 0 || ${I} === null`).assign(i,!1).elseIf((0,Bl._)`${I} === "true" || ${I} === 1`).assign(i,!0);return;case"null":l.elseIf((0,Bl._)`${I} === "" || ${I} === 0 || ${I} === false`),l.assign(i,null);return;case"array":l.elseIf((0,Bl._)`${c} === "string" || ${c} === "number" + || ${c} === "boolean" || ${I} === null`).assign(i,(0,Bl._)`[${I}]`)}}}function YAl({gen:t,parentData:e,parentDataProperty:n},l){t.if((0,Bl._)`${e} !== undefined`,()=>t.assign((0,Bl._)`${e}[${n}]`,l))}function d4e(t,e,n,l=lj.Correct){let I=l===lj.Correct?Bl.operators.EQ:Bl.operators.NEQ,a;switch(t){case"null":return(0,Bl._)`${e} ${I} null`;case"array":a=(0,Bl._)`Array.isArray(${e})`;break;case"object":a=(0,Bl._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":a=c((0,Bl._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":a=c();break;default:return(0,Bl._)`typeof ${e} ${I} ${t}`}return l===lj.Correct?a:(0,Bl.not)(a);function c(i=Bl.nil){return(0,Bl.and)((0,Bl._)`typeof ${e} == "number"`,i,n?(0,Bl._)`isFinite(${e})`:Bl.nil)}}Xb.checkDataType=d4e;function G4e(t,e,n,l){if(t.length===1)return d4e(t[0],e,n,l);let I,a=(0,O5t.toHash)(t);if(a.array&&a.object){let c=(0,Bl._)`typeof ${e} != "object"`;I=a.null?c:(0,Bl._)`!${e} || ${c}`,delete a.null,delete a.array,delete a.object}else I=Bl.nil;a.number&&delete a.integer;for(let c in a)I=(0,Bl.and)(I,d4e(c,e,n,l));return I}Xb.checkDataTypes=G4e;var gAl={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Bl._)`{type: ${t}}`:(0,Bl._)`{type: ${e}}`};function b4e(t){let e=RAl(t);(0,hAl.reportError)(e,gAl)}Xb.reportTypeError=b4e;function RAl(t){let{gen:e,data:n,schema:l}=t,I=(0,O5t.schemaRefOrVal)(t,l,"type");return{gen:e,keyword:"type",data:n,schema:l.type,schemaCode:I,schemaValue:I,parentSchema:l,params:{},it:t}}});var S5t=f(fse=>{"use strict";Object.defineProperty(fse,"__esModule",{value:!0});fse.assignDefaults=void 0;var Ij=Kl(),yAl=Fa();function AAl(t,e){let{properties:n,items:l}=t.schema;if(e==="object"&&n)for(let I in n)B5t(t,I,n[I].default);else e==="array"&&Array.isArray(l)&&l.forEach((I,a)=>B5t(t,a,I.default))}fse.assignDefaults=AAl;function B5t(t,e,n){let{gen:l,compositeRule:I,data:a,opts:c}=t;if(n===void 0)return;let i=(0,Ij._)`${a}${(0,Ij.getProperty)(e)}`;if(I){(0,yAl.checkStrictMode)(t,`default is ignored for: ${i}`);return}let s=(0,Ij._)`${i} === undefined`;c.useDefaults==="empty"&&(s=(0,Ij._)`${s} || ${i} === null || ${i} === ""`),l.if(s,(0,Ij._)`${i} = ${(0,Ij.stringify)(n)}`)}});var wW=f(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.validateUnion=zr.validateArray=zr.usePattern=zr.callValidateCode=zr.schemaProperties=zr.allSchemaProperties=zr.noPropertyInData=zr.propertyInData=zr.isOwnProperty=zr.hasPropFunc=zr.reportMissingProp=zr.checkMissingProp=zr.checkReportMissingProp=void 0;var Qc=Kl(),m4e=Fa(),WX=n0(),FAl=Fa();function vAl(t,e){let{gen:n,data:l,it:I}=t;n.if(h4e(n,l,e,I.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Qc._)`${e}`},!0),t.error()})}zr.checkReportMissingProp=vAl;function fAl({gen:t,data:e,it:{opts:n}},l,I){return(0,Qc.or)(...l.map(a=>(0,Qc.and)(h4e(t,e,a,n.ownProperties),(0,Qc._)`${I} = ${a}`)))}zr.checkMissingProp=fAl;function XAl(t,e){t.setParams({missingProperty:e},!0),t.error()}zr.reportMissingProp=XAl;function M5t(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Qc._)`Object.prototype.hasOwnProperty`})}zr.hasPropFunc=M5t;function p4e(t,e,n){return(0,Qc._)`${M5t(t)}.call(${e}, ${n})`}zr.isOwnProperty=p4e;function wAl(t,e,n,l){let I=(0,Qc._)`${e}${(0,Qc.getProperty)(n)} !== undefined`;return l?(0,Qc._)`${I} && ${p4e(t,e,n)}`:I}zr.propertyInData=wAl;function h4e(t,e,n,l){let I=(0,Qc._)`${e}${(0,Qc.getProperty)(n)} === undefined`;return l?(0,Qc.or)(I,(0,Qc.not)(p4e(t,e,n))):I}zr.noPropertyInData=h4e;function T5t(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}zr.allSchemaProperties=T5t;function HAl(t,e){return T5t(e).filter(n=>!(0,m4e.alwaysValidSchema)(t,e[n]))}zr.schemaProperties=HAl;function QAl({schemaCode:t,data:e,it:{gen:n,topSchemaRef:l,schemaPath:I,errorPath:a},it:c},i,s,r){let u=r?(0,Qc._)`${t}, ${e}, ${l}${I}`:e,o=[[WX.default.instancePath,(0,Qc.strConcat)(WX.default.instancePath,a)],[WX.default.parentData,c.parentData],[WX.default.parentDataProperty,c.parentDataProperty],[WX.default.rootData,WX.default.rootData]];c.opts.dynamicRef&&o.push([WX.default.dynamicAnchors,WX.default.dynamicAnchors]);let d=(0,Qc._)`${u}, ${n.object(...o)}`;return s!==Qc.nil?(0,Qc._)`${i}.call(${s}, ${d})`:(0,Qc._)`${i}(${d})`}zr.callValidateCode=QAl;var EAl=(0,Qc._)`new RegExp`;function JAl({gen:t,it:{opts:e}},n){let l=e.unicodeRegExp?"u":"",{regExp:I}=e.code,a=I(n,l);return t.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,Qc._)`${I.code==="new RegExp"?EAl:(0,FAl.useFunc)(t,I)}(${n}, ${l})`})}zr.usePattern=JAl;function CAl(t){let{gen:e,data:n,keyword:l,it:I}=t,a=e.name("valid");if(I.allErrors){let i=e.let("valid",!0);return c(()=>e.assign(i,!1)),i}return e.var(a,!0),c(()=>e.break()),a;function c(i){let s=e.const("len",(0,Qc._)`${n}.length`);e.forRange("i",0,s,r=>{t.subschema({keyword:l,dataProp:r,dataPropType:m4e.Type.Num},a),e.if((0,Qc.not)(a),i)})}}zr.validateArray=CAl;function LAl(t){let{gen:e,schema:n,keyword:l,it:I}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(s=>(0,m4e.alwaysValidSchema)(I,s))&&!I.opts.unevaluated)return;let c=e.let("valid",!1),i=e.name("_valid");e.block(()=>n.forEach((s,r)=>{let u=t.subschema({keyword:l,schemaProp:r,compositeRule:!0},i);e.assign(c,(0,Qc._)`${c} || ${i}`),t.mergeValidEvaluated(u,i)||e.if((0,Qc.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}zr.validateUnion=LAl});var _5t=f($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.validateKeywordUsage=$g.validSchemaType=$g.funcKeywordCode=$g.macroKeywordCode=void 0;var Ym=Kl(),N1=n0(),kAl=wW(),xAl=aK();function jAl(t,e){let{gen:n,keyword:l,schema:I,parentSchema:a,it:c}=t,i=e.macro.call(c.self,I,a,c),s=K5t(n,l,i);c.opts.validateSchema!==!1&&c.self.validateSchema(i,!0);let r=n.name("valid");t.subschema({schema:i,schemaPath:Ym.nil,errSchemaPath:`${c.errSchemaPath}/${l}`,topSchemaRef:s,compositeRule:!0},r),t.pass(r,()=>t.error(!0))}$g.macroKeywordCode=jAl;function OAl(t,e){var n;let{gen:l,keyword:I,schema:a,parentSchema:c,$data:i,it:s}=t;zAl(s,e);let r=!i&&e.compile?e.compile.call(s.self,a,c,s):e.validate,u=K5t(l,I,r),o=l.let("valid");t.block$data(o,d),t.ok((n=e.valid)!==null&&n!==void 0?n:o);function d(){if(e.errors===!1)Z(),e.modifying&&D5t(t),N(()=>t.error());else{let g=e.async?b():h();e.modifying&&D5t(t),N(()=>UAl(t,g))}}function b(){let g=l.let("ruleErrs",null);return l.try(()=>Z((0,Ym._)`await `),y=>l.assign(o,!1).if((0,Ym._)`${y} instanceof ${s.ValidationError}`,()=>l.assign(g,(0,Ym._)`${y}.errors`),()=>l.throw(y))),g}function h(){let g=(0,Ym._)`${u}.errors`;return l.assign(g,null),Z(Ym.nil),g}function Z(g=e.async?(0,Ym._)`await `:Ym.nil){let y=s.opts.passContext?N1.default.this:N1.default.self,X=!("compile"in e&&!i||e.schema===!1);l.assign(o,(0,Ym._)`${g}${(0,kAl.callValidateCode)(t,u,y,X)}`,e.modifying)}function N(g){var y;l.if((0,Ym.not)((y=e.valid)!==null&&y!==void 0?y:o),g)}}$g.funcKeywordCode=OAl;function D5t(t){let{gen:e,data:n,it:l}=t;e.if(l.parentData,()=>e.assign(n,(0,Ym._)`${l.parentData}[${l.parentDataProperty}]`))}function UAl(t,e){let{gen:n}=t;n.if((0,Ym._)`Array.isArray(${e})`,()=>{n.assign(N1.default.vErrors,(0,Ym._)`${N1.default.vErrors} === null ? ${e} : ${N1.default.vErrors}.concat(${e})`).assign(N1.default.errors,(0,Ym._)`${N1.default.vErrors}.length`),(0,xAl.extendErrors)(t)},()=>t.error())}function zAl({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function K5t(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Ym.stringify)(n)})}function BAl(t,e,n=!1){return!e.length||e.some(l=>l==="array"?Array.isArray(t):l==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==l||n&&typeof t>"u")}$g.validSchemaType=BAl;function SAl({schema:t,opts:e,self:n,errSchemaPath:l},I,a){if(Array.isArray(I.keyword)?!I.keyword.includes(a):I.keyword!==a)throw new Error("ajv implementation error");let c=I.dependencies;if(c?.some(i=>!Object.prototype.hasOwnProperty.call(t,i)))throw new Error(`parent schema must have dependencies of ${a}: ${c.join(",")}`);if(I.validateSchema&&!I.validateSchema(t[a])){let s=`keyword "${a}" value is invalid at path "${l}": `+n.errorsText(I.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(s);else throw new Error(s)}}$g.validateKeywordUsage=SAl});var q5t=f(NX=>{"use strict";Object.defineProperty(NX,"__esModule",{value:!0});NX.extendSubschemaMode=NX.extendSubschemaData=NX.getSubschema=void 0;var eR=Kl(),P5t=Fa();function MAl(t,{keyword:e,schemaProp:n,schema:l,schemaPath:I,errSchemaPath:a,topSchemaRef:c}){if(e!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let i=t.schema[e];return n===void 0?{schema:i,schemaPath:(0,eR._)`${t.schemaPath}${(0,eR.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:i[n],schemaPath:(0,eR._)`${t.schemaPath}${(0,eR.getProperty)(e)}${(0,eR.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,P5t.escapeFragment)(n)}`}}if(l!==void 0){if(I===void 0||a===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:I,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}NX.getSubschema=MAl;function TAl(t,e,{dataProp:n,dataPropType:l,data:I,dataTypes:a,propertyName:c}){if(I!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=e;if(n!==void 0){let{errorPath:r,dataPathArr:u,opts:o}=e,d=i.let("data",(0,eR._)`${e.data}${(0,eR.getProperty)(n)}`,!0);s(d),t.errorPath=(0,eR.str)`${r}${(0,P5t.getErrorPath)(n,l,o.jsPropertySyntax)}`,t.parentDataProperty=(0,eR._)`${n}`,t.dataPathArr=[...u,t.parentDataProperty]}if(I!==void 0){let r=I instanceof eR.Name?I:i.let("data",I,!0);s(r),c!==void 0&&(t.propertyName=c)}a&&(t.dataTypes=a);function s(r){t.data=r,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,r]}}NX.extendSubschemaData=TAl;function DAl(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:l,createErrors:I,allErrors:a}){l!==void 0&&(t.compositeRule=l),I!==void 0&&(t.createErrors=I),a!==void 0&&(t.allErrors=a),t.jtdDiscriminator=e,t.jtdMetadata=n}NX.extendSubschemaMode=DAl});var Z4e=f((PDa,$5t)=>{"use strict";$5t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var l,I,a;if(Array.isArray(e)){if(l=e.length,l!=n.length)return!1;for(I=l;I--!==0;)if(!t(e[I],n[I]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),l=a.length,l!==Object.keys(n).length)return!1;for(I=l;I--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[I]))return!1;for(I=l;I--!==0;){var c=a[I];if(!t(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}});var tLt=f((qDa,eLt)=>{"use strict";var VX=eLt.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var l=typeof n=="function"?n:n.pre||function(){},I=n.post||function(){};Xse(e,l,I,t,"",t)};VX.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};VX.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};VX.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};VX.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Xse(t,e,n,l,I,a,c,i,s,r){if(l&&typeof l=="object"&&!Array.isArray(l)){e(l,I,a,c,i,s,r);for(var u in l){var o=l[u];if(Array.isArray(o)){if(u in VX.arrayKeywords)for(var d=0;d{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.getSchemaRefs=vp.resolveUrl=vp.normalizeId=vp._getFullPath=vp.getFullPath=vp.inlineRef=void 0;var _Al=Fa(),PAl=Z4e(),qAl=tLt(),$Al=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function e0l(t,e=!0){return typeof t=="boolean"?!0:e===!0?!W4e(t):e?nLt(t)<=e:!1}vp.inlineRef=e0l;var t0l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function W4e(t){for(let e in t){if(t0l.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(W4e)||typeof n=="object"&&W4e(n))return!0}return!1}function nLt(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!$Al.has(n)&&(typeof t[n]=="object"&&(0,_Al.eachItem)(t[n],l=>e+=nLt(l)),e===1/0))return 1/0}return e}function lLt(t,e="",n){n!==!1&&(e=aj(e));let l=t.parse(e);return ILt(t,l)}vp.getFullPath=lLt;function ILt(t,e){return t.serialize(e).split("#")[0]+"#"}vp._getFullPath=ILt;var n0l=/#\/?$/;function aj(t){return t?t.replace(n0l,""):""}vp.normalizeId=aj;function l0l(t,e,n){return n=aj(n),t.resolve(e,n)}vp.resolveUrl=l0l;var I0l=/^[a-z_][-a-z0-9._]*$/i;function a0l(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:l}=this.opts,I=aj(t[n]||e),a={"":I},c=lLt(l,I,!1),i={},s=new Set;return qAl(t,{allKeys:!0},(o,d,b,h)=>{if(h===void 0)return;let Z=c+d,N=a[h];typeof o[n]=="string"&&(N=g.call(this,o[n])),y.call(this,o.$anchor),y.call(this,o.$dynamicAnchor),a[d]=N;function g(X){let v=this.opts.uriResolver.resolve;if(X=aj(N?v(N,X):X),s.has(X))throw u(X);s.add(X);let H=this.refs[X];return typeof H=="string"&&(H=this.refs[H]),typeof H=="object"?r(o,H.schema,X):X!==aj(Z)&&(X[0]==="#"?(r(o,i[X],X),i[X]=o):this.refs[X]=Z),X}function y(X){if(typeof X=="string"){if(!I0l.test(X))throw new Error(`invalid anchor "${X}"`);g.call(this,`#${X}`)}}}),i;function r(o,d,b){if(d!==void 0&&!PAl(o,d))throw u(b)}function u(o){return new Error(`reference "${o}" resolves to more than one schema`)}}vp.getSchemaRefs=a0l});var sK=f(YX=>{"use strict";Object.defineProperty(YX,"__esModule",{value:!0});YX.getData=YX.KeywordCxt=YX.validateFunctionCode=void 0;var iLt=k5t(),aLt=rK(),V4e=u4e(),wse=rK(),r0l=S5t(),iK=_5t(),N4e=q5t(),en=Kl(),tl=n0(),c0l=cK(),l0=Fa(),oK=aK();function o0l(t){if(dLt(t)&&(GLt(t),uLt(t))){u0l(t);return}sLt(t,()=>(0,iLt.topBoolOrEmptySchema)(t))}YX.validateFunctionCode=o0l;function sLt({gen:t,validateName:e,schema:n,schemaEnv:l,opts:I},a){I.code.es5?t.func(e,(0,en._)`${tl.default.data}, ${tl.default.valCxt}`,l.$async,()=>{t.code((0,en._)`"use strict"; ${rLt(n,I)}`),s0l(t,I),t.code(a)}):t.func(e,(0,en._)`${tl.default.data}, ${i0l(I)}`,l.$async,()=>t.code(rLt(n,I)).code(a))}function i0l(t){return(0,en._)`{${tl.default.instancePath}="", ${tl.default.parentData}, ${tl.default.parentDataProperty}, ${tl.default.rootData}=${tl.default.data}${t.dynamicRef?(0,en._)`, ${tl.default.dynamicAnchors}={}`:en.nil}}={}`}function s0l(t,e){t.if(tl.default.valCxt,()=>{t.var(tl.default.instancePath,(0,en._)`${tl.default.valCxt}.${tl.default.instancePath}`),t.var(tl.default.parentData,(0,en._)`${tl.default.valCxt}.${tl.default.parentData}`),t.var(tl.default.parentDataProperty,(0,en._)`${tl.default.valCxt}.${tl.default.parentDataProperty}`),t.var(tl.default.rootData,(0,en._)`${tl.default.valCxt}.${tl.default.rootData}`),e.dynamicRef&&t.var(tl.default.dynamicAnchors,(0,en._)`${tl.default.valCxt}.${tl.default.dynamicAnchors}`)},()=>{t.var(tl.default.instancePath,(0,en._)`""`),t.var(tl.default.parentData,(0,en._)`undefined`),t.var(tl.default.parentDataProperty,(0,en._)`undefined`),t.var(tl.default.rootData,tl.default.data),e.dynamicRef&&t.var(tl.default.dynamicAnchors,(0,en._)`{}`)})}function u0l(t){let{schema:e,opts:n,gen:l}=t;sLt(t,()=>{n.$comment&&e.$comment&&mLt(t),p0l(t),l.let(tl.default.vErrors,null),l.let(tl.default.errors,0),n.unevaluated&&d0l(t),bLt(t),W0l(t)})}function d0l(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,en._)`${n}.evaluated`),e.if((0,en._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,en._)`${t.evaluated}.props`,(0,en._)`undefined`)),e.if((0,en._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,en._)`${t.evaluated}.items`,(0,en._)`undefined`))}function rLt(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,en._)`/*# sourceURL=${n} */`:en.nil}function G0l(t,e){if(dLt(t)&&(GLt(t),uLt(t))){b0l(t,e);return}(0,iLt.boolOrEmptySchema)(t,e)}function uLt({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function dLt(t){return typeof t.schema!="boolean"}function b0l(t,e){let{schema:n,gen:l,opts:I}=t;I.$comment&&n.$comment&&mLt(t),h0l(t),Z0l(t);let a=l.const("_errs",tl.default.errors);bLt(t,a),l.var(e,(0,en._)`${a} === ${tl.default.errors}`)}function GLt(t){(0,l0.checkUnknownRules)(t),m0l(t)}function bLt(t,e){if(t.opts.jtd)return cLt(t,[],!1,e);let n=(0,aLt.getSchemaTypes)(t.schema),l=(0,aLt.coerceAndCheckDataType)(t,n);cLt(t,n,!l,e)}function m0l(t){let{schema:e,errSchemaPath:n,opts:l,self:I}=t;e.$ref&&l.ignoreKeywordsWithRef&&(0,l0.schemaHasRulesButRef)(e,I.RULES)&&I.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function p0l(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,l0.checkStrictMode)(t,"default is ignored in the schema root")}function h0l(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,c0l.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Z0l(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function mLt({gen:t,schemaEnv:e,schema:n,errSchemaPath:l,opts:I}){let a=n.$comment;if(I.$comment===!0)t.code((0,en._)`${tl.default.self}.logger.log(${a})`);else if(typeof I.$comment=="function"){let c=(0,en.str)`${l}/$comment`,i=t.scopeValue("root",{ref:e.root});t.code((0,en._)`${tl.default.self}.opts.$comment(${a}, ${c}, ${i}.schema)`)}}function W0l(t){let{gen:e,schemaEnv:n,validateName:l,ValidationError:I,opts:a}=t;n.$async?e.if((0,en._)`${tl.default.errors} === 0`,()=>e.return(tl.default.data),()=>e.throw((0,en._)`new ${I}(${tl.default.vErrors})`)):(e.assign((0,en._)`${l}.errors`,tl.default.vErrors),a.unevaluated&&N0l(t),e.return((0,en._)`${tl.default.errors} === 0`))}function N0l({gen:t,evaluated:e,props:n,items:l}){n instanceof en.Name&&t.assign((0,en._)`${e}.props`,n),l instanceof en.Name&&t.assign((0,en._)`${e}.items`,l)}function cLt(t,e,n,l){let{gen:I,schema:a,data:c,allErrors:i,opts:s,self:r}=t,{RULES:u}=r;if(a.$ref&&(s.ignoreKeywordsWithRef||!(0,l0.schemaHasRulesButRef)(a,u))){I.block(()=>hLt(t,"$ref",u.all.$ref.definition));return}s.jtd||V0l(t,e),I.block(()=>{for(let d of u.rules)o(d);o(u.post)});function o(d){(0,V4e.shouldUseGroup)(a,d)&&(d.type?(I.if((0,wse.checkDataType)(d.type,c,s.strictNumbers)),oLt(t,d),e.length===1&&e[0]===d.type&&n&&(I.else(),(0,wse.reportTypeError)(t)),I.endIf()):oLt(t,d),i||I.if((0,en._)`${tl.default.errors} === ${l||0}`))}}function oLt(t,e){let{gen:n,schema:l,opts:{useDefaults:I}}=t;I&&(0,r0l.assignDefaults)(t,e.type),n.block(()=>{for(let a of e.rules)(0,V4e.shouldUseRule)(l,a)&&hLt(t,a.keyword,a.definition,e.type)})}function V0l(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Y0l(t,e),t.opts.allowUnionTypes||g0l(t,e),R0l(t,t.dataTypes))}function Y0l(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{pLt(t.dataTypes,n)||Y4e(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),A0l(t,e)}}function g0l(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Y4e(t,"use allowUnionTypes to allow union type keyword")}function R0l(t,e){let n=t.self.RULES.all;for(let l in n){let I=n[l];if(typeof I=="object"&&(0,V4e.shouldUseRule)(t.schema,I)){let{type:a}=I.definition;a.length&&!a.some(c=>y0l(e,c))&&Y4e(t,`missing type "${a.join(",")}" for keyword "${l}"`)}}}function y0l(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function pLt(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function A0l(t,e){let n=[];for(let l of t.dataTypes)pLt(e,l)?n.push(l):e.includes("integer")&&l==="number"&&n.push("integer");t.dataTypes=n}function Y4e(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,l0.checkStrictMode)(t,e,t.opts.strictTypes)}var Hse=class{constructor(e,n,l){if((0,iK.validateKeywordUsage)(e,n,l),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=l,this.data=e.data,this.schema=e.schema[l],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l0.schemaRefOrVal)(e,this.schema,l,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",ZLt(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,iK.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${l} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",tl.default.errors))}result(e,n,l){this.failResult((0,en.not)(e),n,l)}failResult(e,n,l){this.gen.if(e),l?l():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,en.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:n}=this;this.fail((0,en._)`${n} !== undefined && (${(0,en.or)(this.invalid$data(),e)})`)}error(e,n,l){if(n){this.setParams(n),this._error(e,l),this.setParams({});return}this._error(e,l)}_error(e,n){(e?oK.reportExtraError:oK.reportError)(this,this.def.error,n)}$dataError(){(0,oK.reportError)(this,this.def.$dataError||oK.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,oK.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,l=en.nil){this.gen.block(()=>{this.check$data(e,l),n()})}check$data(e=en.nil,n=en.nil){if(!this.$data)return;let{gen:l,schemaCode:I,schemaType:a,def:c}=this;l.if((0,en.or)((0,en._)`${I} === undefined`,n)),e!==en.nil&&l.assign(e,!0),(a.length||c.validateSchema)&&(l.elseIf(this.invalid$data()),this.$dataError(),e!==en.nil&&l.assign(e,!1)),l.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:l,def:I,it:a}=this;return(0,en.or)(c(),i());function c(){if(l.length){if(!(n instanceof en.Name))throw new Error("ajv implementation error");let s=Array.isArray(l)?l:[l];return(0,en._)`${(0,wse.checkDataTypes)(s,n,a.opts.strictNumbers,wse.DataType.Wrong)}`}return en.nil}function i(){if(I.validateSchema){let s=e.scopeValue("validate$data",{ref:I.validateSchema});return(0,en._)`!${s}(${n})`}return en.nil}}subschema(e,n){let l=(0,N4e.getSubschema)(this.it,e);(0,N4e.extendSubschemaData)(l,this.it,e),(0,N4e.extendSubschemaMode)(l,e);let I={...this.it,...l,items:void 0,props:void 0};return G0l(I,n),I}mergeEvaluated(e,n){let{it:l,gen:I}=this;l.opts.unevaluated&&(l.props!==!0&&e.props!==void 0&&(l.props=l0.mergeEvaluated.props(I,e.props,l.props,n)),l.items!==!0&&e.items!==void 0&&(l.items=l0.mergeEvaluated.items(I,e.items,l.items,n)))}mergeValidEvaluated(e,n){let{it:l,gen:I}=this;if(l.opts.unevaluated&&(l.props!==!0||l.items!==!0))return I.if(n,()=>this.mergeEvaluated(e,en.Name)),!0}};YX.KeywordCxt=Hse;function hLt(t,e,n,l){let I=new Hse(t,n,e);"code"in n?n.code(I,l):I.$data&&n.validate?(0,iK.funcKeywordCode)(I,n):"macro"in n?(0,iK.macroKeywordCode)(I,n):(n.compile||n.validate)&&(0,iK.funcKeywordCode)(I,n)}var F0l=/^\/(?:[^~]|~0|~1)*$/,v0l=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ZLt(t,{dataLevel:e,dataNames:n,dataPathArr:l}){let I,a;if(t==="")return tl.default.rootData;if(t[0]==="/"){if(!F0l.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);I=t,a=tl.default.rootData}else{let r=v0l.exec(t);if(!r)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+r[1];if(I=r[2],I==="#"){if(u>=e)throw new Error(s("property/index",u));return l[e-u]}if(u>e)throw new Error(s("data",u));if(a=n[e-u],!I)return a}let c=a,i=I.split("/");for(let r of i)r&&(a=(0,en._)`${a}${(0,en.getProperty)((0,l0.unescapeJsonPointer)(r))}`,c=(0,en._)`${c} && ${a}`);return c;function s(r,u){return`Cannot access ${r} ${u} levels up, current level is ${e}`}}YX.getData=ZLt});var Qse=f(R4e=>{"use strict";Object.defineProperty(R4e,"__esModule",{value:!0});var g4e=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};R4e.default=g4e});var uK=f(F4e=>{"use strict";Object.defineProperty(F4e,"__esModule",{value:!0});var y4e=cK(),A4e=class extends Error{constructor(e,n,l,I){super(I||`can't resolve reference ${l} from id ${n}`),this.missingRef=(0,y4e.resolveUrl)(e,n,l),this.missingSchema=(0,y4e.normalizeId)((0,y4e.getFullPath)(e,this.missingRef))}};F4e.default=A4e});var Jse=f(HW=>{"use strict";Object.defineProperty(HW,"__esModule",{value:!0});HW.resolveSchema=HW.getCompilingSchema=HW.resolveRef=HW.compileSchema=HW.SchemaEnv=void 0;var JV=Kl(),f0l=Qse(),V1=n0(),CV=cK(),WLt=Fa(),X0l=sK(),rj=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let l;typeof e.schema=="object"&&(l=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,CV.normalizeId)(l?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=l?.$async,this.refs={}}};HW.SchemaEnv=rj;function f4e(t){let e=NLt.call(this,t);if(e)return e;let n=(0,CV.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:l,lines:I}=this.opts.code,{ownProperties:a}=this.opts,c=new JV.CodeGen(this.scope,{es5:l,lines:I,ownProperties:a}),i;t.$async&&(i=c.scopeValue("Error",{ref:f0l.default,code:(0,JV._)`require("ajv/dist/runtime/validation_error").default`}));let s=c.scopeName("validate");t.validateName=s;let r={gen:c,allErrors:this.opts.allErrors,data:V1.default.data,parentData:V1.default.parentData,parentDataProperty:V1.default.parentDataProperty,dataNames:[V1.default.data],dataPathArr:[JV.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,JV.stringify)(t.schema)}:{ref:t.schema}),validateName:s,ValidationError:i,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:JV.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,JV._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,X0l.validateFunctionCode)(r),c.optimize(this.opts.code.optimize);let o=c.toString();u=`${c.scopeRefs(V1.default.scope)}return ${o}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let b=new Function(`${V1.default.self}`,`${V1.default.scope}`,u)(this,this.scope.get());if(this.scope.value(s,{ref:b}),b.errors=null,b.schema=t.schema,b.schemaEnv=t,t.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:s,validateCode:o,scopeValues:c._values}),this.opts.unevaluated){let{props:h,items:Z}=r;b.evaluated={props:h instanceof JV.Name?void 0:h,items:Z instanceof JV.Name?void 0:Z,dynamicProps:h instanceof JV.Name,dynamicItems:Z instanceof JV.Name},b.source&&(b.source.evaluated=(0,JV.stringify)(b.evaluated))}return t.validate=b,t}catch(o){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),o}finally{this._compilations.delete(t)}}HW.compileSchema=f4e;function w0l(t,e,n){var l;n=(0,CV.resolveUrl)(this.opts.uriResolver,e,n);let I=t.refs[n];if(I)return I;let a=E0l.call(this,t,n);if(a===void 0){let c=(l=t.localRefs)===null||l===void 0?void 0:l[n],{schemaId:i}=this.opts;c&&(a=new rj({schema:c,schemaId:i,root:t,baseId:e}))}if(a!==void 0)return t.refs[n]=H0l.call(this,a)}HW.resolveRef=w0l;function H0l(t){return(0,CV.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:f4e.call(this,t)}function NLt(t){for(let e of this._compilations)if(Q0l(e,t))return e}HW.getCompilingSchema=NLt;function Q0l(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function E0l(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||Ese.call(this,t,e)}function Ese(t,e){let n=this.opts.uriResolver.parse(e),l=(0,CV._getFullPath)(this.opts.uriResolver,n),I=(0,CV.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&l===I)return v4e.call(this,n,t);let a=(0,CV.normalizeId)(l),c=this.refs[a]||this.schemas[a];if(typeof c=="string"){let i=Ese.call(this,t,c);return typeof i?.schema!="object"?void 0:v4e.call(this,n,i)}if(typeof c?.schema=="object"){if(c.validate||f4e.call(this,c),a===(0,CV.normalizeId)(e)){let{schema:i}=c,{schemaId:s}=this.opts,r=i[s];return r&&(I=(0,CV.resolveUrl)(this.opts.uriResolver,I,r)),new rj({schema:i,schemaId:s,root:t,baseId:I})}return v4e.call(this,n,c)}}HW.resolveSchema=Ese;var J0l=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v4e(t,{baseId:e,schema:n,root:l}){var I;if(((I=t.fragment)===null||I===void 0?void 0:I[0])!=="/")return;for(let i of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let s=n[(0,WLt.unescapeFragment)(i)];if(s===void 0)return;n=s;let r=typeof n=="object"&&n[this.opts.schemaId];!J0l.has(i)&&r&&(e=(0,CV.resolveUrl)(this.opts.uriResolver,e,r))}let a;if(typeof n!="boolean"&&n.$ref&&!(0,WLt.schemaHasRulesButRef)(n,this.RULES)){let i=(0,CV.resolveUrl)(this.opts.uriResolver,e,n.$ref);a=Ese.call(this,l,i)}let{schemaId:c}=this.opts;if(a=a||new rj({schema:n,schemaId:c,root:l,baseId:e}),a.schema!==a.root.schema)return a}});var VLt=f((IKa,C0l)=>{C0l.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var gLt=f((aKa,YLt)=>{"use strict";var L0l={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};YLt.exports={HEX:L0l}});var wLt=f((rKa,XLt)=>{"use strict";var{HEX:k0l}=gLt(),x0l=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function FLt(t){if(fLt(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(x0l)||[],[n]=e;return n?{host:O0l(n,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function X4e(t,e=!1){let n="",l=!0;for(let I of t){if(k0l[I]===void 0)return;I!=="0"&&l===!0&&(l=!1),l||(n+=I)}return e&&n.length===0&&(n="0"),n}function j0l(t){let e=0,n={error:!1,address:"",zone:""},l=[],I=[],a=!1,c=!1,i=!1;function s(){if(I.length){if(a===!1){let r=X4e(I);if(r!==void 0)l.push(r);else return n.error=!0,!1}I.length=0}return!0}for(let r=0;r7){n.error=!0;break}r-1>=0&&t[r-1]===":"&&(c=!0);continue}else if(u==="%"){if(!s())break;a=!0}else{I.push(u);continue}}return I.length&&(a?n.zone=I.join(""):i?l.push(I.join("")):l.push(X4e(I))),n.address=l.join(""),n}function vLt(t){if(fLt(t,":")<2)return{host:t,isIPV6:!1};let e=j0l(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,l=e.address;return e.zone&&(n+="%"+e.zone,l+="%25"+e.zone),{host:n,escapedHost:l,isIPV6:!0}}}function O0l(t,e){let n="",l=!0,I=t.length;for(let a=0;a{"use strict";var M0l=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,T0l=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function HLt(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function QLt(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ELt(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function D0l(t){return t.secure=HLt(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function K0l(t){if((t.port===(HLt(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function _0l(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(T0l);if(n){let l=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let I=`${l}:${e.nid||t.nid}`,a=w4e[I];t.path=void 0,a&&(t=a.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function P0l(t,e){let n=e.scheme||t.scheme||"urn",l=t.nid.toLowerCase(),I=`${n}:${e.nid||l}`,a=w4e[I];a&&(t=a.serialize(t,e));let c=t,i=t.nss;return c.path=`${l||e.nid}:${i}`,e.skipEscape=!0,c}function q0l(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!M0l.test(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function $0l(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var JLt={scheme:"http",domainHost:!0,parse:QLt,serialize:ELt},eFl={scheme:"https",domainHost:JLt.domainHost,parse:QLt,serialize:ELt},Cse={scheme:"ws",domainHost:!0,parse:D0l,serialize:K0l},tFl={scheme:"wss",domainHost:Cse.domainHost,parse:Cse.parse,serialize:Cse.serialize},nFl={scheme:"urn",parse:_0l,serialize:P0l,skipNormalize:!0},lFl={scheme:"urn:uuid",parse:q0l,serialize:$0l,skipNormalize:!0},w4e={http:JLt,https:eFl,ws:Cse,wss:tFl,urn:nFl,"urn:uuid":lFl};CLt.exports=w4e});var xLt=f((oKa,kse)=>{"use strict";var{normalizeIPv6:IFl,normalizeIPv4:aFl,removeDotSegments:dK,recomposeAuthority:rFl,normalizeComponentEncoding:Lse}=wLt(),H4e=LLt();function cFl(t,e){return typeof t=="string"?t=tR(I0(t,e),e):typeof t=="object"&&(t=I0(tR(t,e),e)),t}function oFl(t,e,n){let l=Object.assign({scheme:"null"},n),I=kLt(I0(t,l),I0(e,l),l,!0);return tR(I,{...l,skipEscape:!0})}function kLt(t,e,n,l){let I={};return l||(t=I0(tR(t,n),n),e=I0(tR(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(I.scheme=e.scheme,I.userinfo=e.userinfo,I.host=e.host,I.port=e.port,I.path=dK(e.path||""),I.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(I.userinfo=e.userinfo,I.host=e.host,I.port=e.port,I.path=dK(e.path||""),I.query=e.query):(e.path?(e.path.charAt(0)==="/"?I.path=dK(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?I.path="/"+e.path:t.path?I.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:I.path=e.path,I.path=dK(I.path)),I.query=e.query):(I.path=t.path,e.query!==void 0?I.query=e.query:I.query=t.query),I.userinfo=t.userinfo,I.host=t.host,I.port=t.port),I.scheme=t.scheme),I.fragment=e.fragment,I}function iFl(t,e,n){return typeof t=="string"?(t=unescape(t),t=tR(Lse(I0(t,n),!0),{...n,skipEscape:!0})):typeof t=="object"&&(t=tR(Lse(t,!0),{...n,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=tR(Lse(I0(e,n),!0),{...n,skipEscape:!0})):typeof e=="object"&&(e=tR(Lse(e,!0),{...n,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function tR(t,e){let n={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},l=Object.assign({},e),I=[],a=H4e[(l.scheme||n.scheme||"").toLowerCase()];a&&a.serialize&&a.serialize(n,l),n.path!==void 0&&(l.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),l.reference!=="suffix"&&n.scheme&&I.push(n.scheme,":");let c=rFl(n);if(c!==void 0&&(l.reference!=="suffix"&&I.push("//"),I.push(c),n.path&&n.path.charAt(0)!=="/"&&I.push("/")),n.path!==void 0){let i=n.path;!l.absolutePath&&(!a||!a.absolutePath)&&(i=dK(i)),c===void 0&&(i=i.replace(/^\/\//u,"/%2F")),I.push(i)}return n.query!==void 0&&I.push("?",n.query),n.fragment!==void 0&&I.push("#",n.fragment),I.join("")}var sFl=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function uFl(t){let e=0;for(let n=0,l=t.length;n126||sFl[e])return!0;return!1}var dFl=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I0(t,e){let n=Object.assign({},e),l={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},I=t.indexOf("%")!==-1,a=!1;n.reference==="suffix"&&(t=(n.scheme?n.scheme+":":"")+"//"+t);let c=t.match(dFl);if(c){if(l.scheme=c[1],l.userinfo=c[3],l.host=c[4],l.port=parseInt(c[5],10),l.path=c[6]||"",l.query=c[7],l.fragment=c[8],isNaN(l.port)&&(l.port=c[5]),l.host){let s=aFl(l.host);if(s.isIPV4===!1){let r=IFl(s.host);l.host=r.host.toLowerCase(),a=r.isIPV6}else l.host=s.host,a=!0}l.scheme===void 0&&l.userinfo===void 0&&l.host===void 0&&l.port===void 0&&l.query===void 0&&!l.path?l.reference="same-document":l.scheme===void 0?l.reference="relative":l.fragment===void 0?l.reference="absolute":l.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==l.reference&&(l.error=l.error||"URI is not a "+n.reference+" reference.");let i=H4e[(n.scheme||l.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!i||!i.unicodeSupport)&&l.host&&(n.domainHost||i&&i.domainHost)&&a===!1&&uFl(l.host))try{l.host=URL.domainToASCII(l.host.toLowerCase())}catch(s){l.error=l.error||"Host's domain name can not be converted to ASCII: "+s}(!i||i&&!i.skipNormalize)&&(I&&l.scheme!==void 0&&(l.scheme=unescape(l.scheme)),I&&l.host!==void 0&&(l.host=unescape(l.host)),l.path&&(l.path=escape(unescape(l.path))),l.fragment&&(l.fragment=encodeURI(decodeURIComponent(l.fragment)))),i&&i.parse&&i.parse(l,n)}else l.error=l.error||"URI can not be parsed.";return l}var Q4e={SCHEMES:H4e,normalize:cFl,resolve:oFl,resolveComponents:kLt,equal:iFl,serialize:tR,parse:I0};kse.exports=Q4e;kse.exports.default=Q4e;kse.exports.fastUri=Q4e});var OLt=f(E4e=>{"use strict";Object.defineProperty(E4e,"__esModule",{value:!0});var jLt=xLt();jLt.code='require("ajv/dist/runtime/uri").default';E4e.default=jLt});var KLt=f(wG=>{"use strict";Object.defineProperty(wG,"__esModule",{value:!0});wG.CodeGen=wG.Name=wG.nil=wG.stringify=wG.str=wG._=wG.KeywordCxt=void 0;var GFl=sK();Object.defineProperty(wG,"KeywordCxt",{enumerable:!0,get:function(){return GFl.KeywordCxt}});var cj=Kl();Object.defineProperty(wG,"_",{enumerable:!0,get:function(){return cj._}});Object.defineProperty(wG,"str",{enumerable:!0,get:function(){return cj.str}});Object.defineProperty(wG,"stringify",{enumerable:!0,get:function(){return cj.stringify}});Object.defineProperty(wG,"nil",{enumerable:!0,get:function(){return cj.nil}});Object.defineProperty(wG,"Name",{enumerable:!0,get:function(){return cj.Name}});Object.defineProperty(wG,"CodeGen",{enumerable:!0,get:function(){return cj.CodeGen}});var bFl=Qse(),MLt=uK(),mFl=s4e(),GK=Jse(),pFl=Kl(),bK=cK(),xse=rK(),C4e=Fa(),ULt=VLt(),hFl=OLt(),TLt=(t,e)=>new RegExp(t,e);TLt.code="new RegExp";var ZFl=["removeAdditional","useDefaults","coerceTypes"],WFl=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),NFl={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},VFl={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},zLt=200;function YFl(t){var e,n,l,I,a,c,i,s,r,u,o,d,b,h,Z,N,g,y,X,v,H,Q,L,J,O;let U=t.strict,K=(e=t.code)===null||e===void 0?void 0:e.optimize,D=K===!0||K===void 0?1:K||0,_=(l=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&l!==void 0?l:TLt,P=(I=t.uriResolver)!==null&&I!==void 0?I:hFl.default;return{strictSchema:(c=(a=t.strictSchema)!==null&&a!==void 0?a:U)!==null&&c!==void 0?c:!0,strictNumbers:(s=(i=t.strictNumbers)!==null&&i!==void 0?i:U)!==null&&s!==void 0?s:!0,strictTypes:(u=(r=t.strictTypes)!==null&&r!==void 0?r:U)!==null&&u!==void 0?u:"log",strictTuples:(d=(o=t.strictTuples)!==null&&o!==void 0?o:U)!==null&&d!==void 0?d:"log",strictRequired:(h=(b=t.strictRequired)!==null&&b!==void 0?b:U)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:D,regExp:_}:{optimize:D,regExp:_},loopRequired:(Z=t.loopRequired)!==null&&Z!==void 0?Z:zLt,loopEnum:(N=t.loopEnum)!==null&&N!==void 0?N:zLt,meta:(g=t.meta)!==null&&g!==void 0?g:!0,messages:(y=t.messages)!==null&&y!==void 0?y:!0,inlineRefs:(X=t.inlineRefs)!==null&&X!==void 0?X:!0,schemaId:(v=t.schemaId)!==null&&v!==void 0?v:"$id",addUsedSchema:(H=t.addUsedSchema)!==null&&H!==void 0?H:!0,validateSchema:(Q=t.validateSchema)!==null&&Q!==void 0?Q:!0,validateFormats:(L=t.validateFormats)!==null&&L!==void 0?L:!0,unicodeRegExp:(J=t.unicodeRegExp)!==null&&J!==void 0?J:!0,int32range:(O=t.int32range)!==null&&O!==void 0?O:!0,uriResolver:P}}var mK=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...YFl(e)};let{es5:n,lines:l}=this.opts.code;this.scope=new pFl.ValueScope({scope:{},prefixes:WFl,es5:n,lines:l}),this.logger=vFl(e.logger);let I=e.validateFormats;e.validateFormats=!1,this.RULES=(0,mFl.getRules)(),BLt.call(this,NFl,e,"NOT SUPPORTED"),BLt.call(this,VFl,e,"DEPRECATED","warn"),this._metaOpts=AFl.call(this),e.formats&&RFl.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&yFl.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),gFl.call(this),e.validateFormats=I}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:l}=this.opts,I=ULt;l==="id"&&(I={...ULt},I.id=I.$id,delete I.$id),n&&e&&this.addMetaSchema(I,I[l],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let l;if(typeof e=="string"){if(l=this.getSchema(e),!l)throw new Error(`no schema with key or ref "${e}"`)}else l=this.compile(e);let I=l(n);return"$async"in l||(this.errors=l.errors),I}compile(e,n){let l=this._addSchema(e,n);return l.validate||this._compileSchemaEnv(l)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:l}=this.opts;return I.call(this,e,n);async function I(u,o){await a.call(this,u.$schema);let d=this._addSchema(u,o);return d.validate||c.call(this,d)}async function a(u){u&&!this.getSchema(u)&&await I.call(this,{$ref:u},!0)}async function c(u){try{return this._compileSchemaEnv(u)}catch(o){if(!(o instanceof MLt.default))throw o;return i.call(this,o),await s.call(this,o.missingSchema),c.call(this,u)}}function i({missingSchema:u,missingRef:o}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${o} cannot be resolved`)}async function s(u){let o=await r.call(this,u);this.refs[u]||await a.call(this,o.$schema),this.refs[u]||this.addSchema(o,u,n)}async function r(u){let o=this._loading[u];if(o)return o;try{return await(this._loading[u]=l(u))}finally{delete this._loading[u]}}}addSchema(e,n,l,I=this.opts.validateSchema){if(Array.isArray(e)){for(let c of e)this.addSchema(c,void 0,l,I);return this}let a;if(typeof e=="object"){let{schemaId:c}=this.opts;if(a=e[c],a!==void 0&&typeof a!="string")throw new Error(`schema ${c} must be string`)}return n=(0,bK.normalizeId)(n||a),this._checkUnique(n),this.schemas[n]=this._addSchema(e,l,n,I,!0),this}addMetaSchema(e,n,l=this.opts.validateSchema){return this.addSchema(e,n,!0,l),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let l;if(l=e.$schema,l!==void 0&&typeof l!="string")throw new Error("$schema must be a string");if(l=l||this.opts.defaultMeta||this.defaultMeta(),!l)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let I=this.validate(l,e);if(!I&&n){let a="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(a);else throw new Error(a)}return I}getSchema(e){let n;for(;typeof(n=SLt.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:l}=this.opts,I=new GK.SchemaEnv({schema:{},schemaId:l});if(n=GK.resolveSchema.call(this,I,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=SLt.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let l=e[this.opts.schemaId];return l&&(l=(0,bK.normalizeId)(l),delete this.schemas[l],delete this.refs[l]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let l;if(typeof e=="string")l=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=l);else if(typeof e=="object"&&n===void 0){if(n=e,l=n.keyword,Array.isArray(l)&&!l.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(XFl.call(this,l,n),!n)return(0,C4e.eachItem)(l,a=>J4e.call(this,a)),this;HFl.call(this,n);let I={...n,type:(0,xse.getJSONTypes)(n.type),schemaType:(0,xse.getJSONTypes)(n.schemaType)};return(0,C4e.eachItem)(l,I.type.length===0?a=>J4e.call(this,a,I):a=>I.type.forEach(c=>J4e.call(this,a,I,c))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let l of n.rules){let I=l.rules.findIndex(a=>a.keyword===e);I>=0&&l.rules.splice(I,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:l="data"}={}){return!e||e.length===0?"No errors":e.map(I=>`${l}${I.instancePath} ${I.message}`).reduce((I,a)=>I+n+a)}$dataMetaSchema(e,n){let l=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let I of n){let a=I.split("/").slice(1),c=e;for(let i of a)c=c[i];for(let i in l){let s=l[i];if(typeof s!="object")continue;let{$data:r}=s.definition,u=c[i];r&&u&&(c[i]=DLt(u))}}return e}_removeAllSchemas(e,n){for(let l in e){let I=e[l];(!n||n.test(l))&&(typeof I=="string"?delete e[l]:I&&!I.meta&&(this._cache.delete(I.schema),delete e[l]))}}_addSchema(e,n,l,I=this.opts.validateSchema,a=this.opts.addUsedSchema){let c,{schemaId:i}=this.opts;if(typeof e=="object")c=e[i];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let s=this._cache.get(e);if(s!==void 0)return s;l=(0,bK.normalizeId)(c||l);let r=bK.getSchemaRefs.call(this,e,l);return s=new GK.SchemaEnv({schema:e,schemaId:i,meta:n,baseId:l,localRefs:r}),this._cache.set(s.schema,s),a&&!l.startsWith("#")&&(l&&this._checkUnique(l),this.refs[l]=s),I&&this.validateSchema(e,!0),s}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):GK.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{GK.compileSchema.call(this,e)}finally{this.opts=n}}};mK.ValidationError=bFl.default;mK.MissingRefError=MLt.default;wG.default=mK;function BLt(t,e,n,l="error"){for(let I in t){let a=I;a in e&&this.logger[l](`${n}: option ${I}. ${t[a]}`)}}function SLt(t){return t=(0,bK.normalizeId)(t),this.schemas[t]||this.refs[t]}function gFl(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function RFl(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function yFl(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function AFl(){let t={...this.opts};for(let e of ZFl)delete t[e];return t}var FFl={log(){},warn(){},error(){}};function vFl(t){if(t===!1)return FFl;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var fFl=/^[a-z_$][a-z0-9_$:-]*$/i;function XFl(t,e){let{RULES:n}=this;if((0,C4e.eachItem)(t,l=>{if(n.keywords[l])throw new Error(`Keyword ${l} is already defined`);if(!fFl.test(l))throw new Error(`Keyword ${l} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function J4e(t,e,n){var l;let I=e?.post;if(n&&I)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,c=I?a.post:a.rules.find(({type:s})=>s===n);if(c||(c={type:n,rules:[]},a.rules.push(c)),a.keywords[t]=!0,!e)return;let i={keyword:t,definition:{...e,type:(0,xse.getJSONTypes)(e.type),schemaType:(0,xse.getJSONTypes)(e.schemaType)}};e.before?wFl.call(this,c,i,e.before):c.rules.push(i),a.all[t]=i,(l=e.implements)===null||l===void 0||l.forEach(s=>this.addKeyword(s))}function wFl(t,e,n){let l=t.rules.findIndex(I=>I.keyword===n);l>=0?t.rules.splice(l,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function HFl(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=DLt(e)),t.validateSchema=this.compile(e,!0))}var QFl={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function DLt(t){return{anyOf:[t,QFl]}}});var _Lt=f(L4e=>{"use strict";Object.defineProperty(L4e,"__esModule",{value:!0});var EFl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};L4e.default=EFl});var ekt=f(Y1=>{"use strict";Object.defineProperty(Y1,"__esModule",{value:!0});Y1.callRef=Y1.getValidate=void 0;var JFl=uK(),PLt=wW(),fp=Kl(),oj=n0(),qLt=Jse(),jse=Fa(),CFl={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:l}=t,{baseId:I,schemaEnv:a,validateName:c,opts:i,self:s}=l,{root:r}=a;if((n==="#"||n==="#/")&&I===r.baseId)return o();let u=qLt.resolveRef.call(s,r,I,n);if(u===void 0)throw new JFl.default(l.opts.uriResolver,I,n);if(u instanceof qLt.SchemaEnv)return d(u);return b(u);function o(){if(a===r)return Ose(t,c,a,a.$async);let h=e.scopeValue("root",{ref:r});return Ose(t,(0,fp._)`${h}.validate`,r,r.$async)}function d(h){let Z=$Lt(t,h);Ose(t,Z,h,h.$async)}function b(h){let Z=e.scopeValue("schema",i.code.source===!0?{ref:h,code:(0,fp.stringify)(h)}:{ref:h}),N=e.name("valid"),g=t.subschema({schema:h,dataTypes:[],schemaPath:fp.nil,topSchemaRef:Z,errSchemaPath:n},N);t.mergeEvaluated(g),t.ok(N)}}};function $Lt(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,fp._)`${n.scopeValue("wrapper",{ref:e})}.validate`}Y1.getValidate=$Lt;function Ose(t,e,n,l){let{gen:I,it:a}=t,{allErrors:c,schemaEnv:i,opts:s}=a,r=s.passContext?oj.default.this:fp.nil;l?u():o();function u(){if(!i.$async)throw new Error("async schema referenced by sync schema");let h=I.let("valid");I.try(()=>{I.code((0,fp._)`await ${(0,PLt.callValidateCode)(t,e,r)}`),b(e),c||I.assign(h,!0)},Z=>{I.if((0,fp._)`!(${Z} instanceof ${a.ValidationError})`,()=>I.throw(Z)),d(Z),c||I.assign(h,!1)}),t.ok(h)}function o(){t.result((0,PLt.callValidateCode)(t,e,r),()=>b(e),()=>d(e))}function d(h){let Z=(0,fp._)`${h}.errors`;I.assign(oj.default.vErrors,(0,fp._)`${oj.default.vErrors} === null ? ${Z} : ${oj.default.vErrors}.concat(${Z})`),I.assign(oj.default.errors,(0,fp._)`${oj.default.vErrors}.length`)}function b(h){var Z;if(!a.opts.unevaluated)return;let N=(Z=n?.validate)===null||Z===void 0?void 0:Z.evaluated;if(a.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(a.props=jse.mergeEvaluated.props(I,N.props,a.props));else{let g=I.var("props",(0,fp._)`${h}.evaluated.props`);a.props=jse.mergeEvaluated.props(I,g,a.props,fp.Name)}if(a.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(a.items=jse.mergeEvaluated.items(I,N.items,a.items));else{let g=I.var("items",(0,fp._)`${h}.evaluated.items`);a.items=jse.mergeEvaluated.items(I,g,a.items,fp.Name)}}}Y1.callRef=Ose;Y1.default=CFl});var tkt=f(k4e=>{"use strict";Object.defineProperty(k4e,"__esModule",{value:!0});var LFl=_Lt(),kFl=ekt(),xFl=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",LFl.default,kFl.default];k4e.default=xFl});var nkt=f(x4e=>{"use strict";Object.defineProperty(x4e,"__esModule",{value:!0});var Use=Kl(),gX=Use.operators,zse={maximum:{okStr:"<=",ok:gX.LTE,fail:gX.GT},minimum:{okStr:">=",ok:gX.GTE,fail:gX.LT},exclusiveMaximum:{okStr:"<",ok:gX.LT,fail:gX.GTE},exclusiveMinimum:{okStr:">",ok:gX.GT,fail:gX.LTE}},jFl={message:({keyword:t,schemaCode:e})=>(0,Use.str)`must be ${zse[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Use._)`{comparison: ${zse[t].okStr}, limit: ${e}}`},OFl={keyword:Object.keys(zse),type:"number",schemaType:"number",$data:!0,error:jFl,code(t){let{keyword:e,data:n,schemaCode:l}=t;t.fail$data((0,Use._)`${n} ${zse[e].fail} ${l} || isNaN(${n})`)}};x4e.default=OFl});var lkt=f(j4e=>{"use strict";Object.defineProperty(j4e,"__esModule",{value:!0});var pK=Kl(),UFl={message:({schemaCode:t})=>(0,pK.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,pK._)`{multipleOf: ${t}}`},zFl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:UFl,code(t){let{gen:e,data:n,schemaCode:l,it:I}=t,a=I.opts.multipleOfPrecision,c=e.let("res"),i=a?(0,pK._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${a}`:(0,pK._)`${c} !== parseInt(${c})`;t.fail$data((0,pK._)`(${l} === 0 || (${c} = ${n}/${l}, ${i}))`)}};j4e.default=zFl});var akt=f(O4e=>{"use strict";Object.defineProperty(O4e,"__esModule",{value:!0});function Ikt(t){let e=t.length,n=0,l=0,I;for(;l=55296&&I<=56319&&l{"use strict";Object.defineProperty(U4e,"__esModule",{value:!0});var g1=Kl(),BFl=Fa(),SFl=akt(),MFl={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,g1.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,g1._)`{limit: ${t}}`},TFl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:MFl,code(t){let{keyword:e,data:n,schemaCode:l,it:I}=t,a=e==="maxLength"?g1.operators.GT:g1.operators.LT,c=I.opts.unicode===!1?(0,g1._)`${n}.length`:(0,g1._)`${(0,BFl.useFunc)(t.gen,SFl.default)}(${n})`;t.fail$data((0,g1._)`${c} ${a} ${l}`)}};U4e.default=TFl});var ckt=f(z4e=>{"use strict";Object.defineProperty(z4e,"__esModule",{value:!0});var DFl=wW(),Bse=Kl(),KFl={message:({schemaCode:t})=>(0,Bse.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Bse._)`{pattern: ${t}}`},_Fl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:KFl,code(t){let{data:e,$data:n,schema:l,schemaCode:I,it:a}=t,c=a.opts.unicodeRegExp?"u":"",i=n?(0,Bse._)`(new RegExp(${I}, ${c}))`:(0,DFl.usePattern)(t,l);t.fail$data((0,Bse._)`!${i}.test(${e})`)}};z4e.default=_Fl});var okt=f(B4e=>{"use strict";Object.defineProperty(B4e,"__esModule",{value:!0});var hK=Kl(),PFl={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,hK.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,hK._)`{limit: ${t}}`},qFl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:PFl,code(t){let{keyword:e,data:n,schemaCode:l}=t,I=e==="maxProperties"?hK.operators.GT:hK.operators.LT;t.fail$data((0,hK._)`Object.keys(${n}).length ${I} ${l}`)}};B4e.default=qFl});var ikt=f(S4e=>{"use strict";Object.defineProperty(S4e,"__esModule",{value:!0});var ZK=wW(),WK=Kl(),$Fl=Fa(),e2l={message:({params:{missingProperty:t}})=>(0,WK.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,WK._)`{missingProperty: ${t}}`},t2l={keyword:"required",type:"object",schemaType:"array",$data:!0,error:e2l,code(t){let{gen:e,schema:n,schemaCode:l,data:I,$data:a,it:c}=t,{opts:i}=c;if(!a&&n.length===0)return;let s=n.length>=i.loopRequired;if(c.allErrors?r():u(),i.strictRequired){let b=t.parentSchema.properties,{definedProperties:h}=t.it;for(let Z of n)if(b?.[Z]===void 0&&!h.has(Z)){let N=c.schemaEnv.baseId+c.errSchemaPath,g=`required property "${Z}" is not defined at "${N}" (strictRequired)`;(0,$Fl.checkStrictMode)(c,g,c.opts.strictRequired)}}function r(){if(s||a)t.block$data(WK.nil,o);else for(let b of n)(0,ZK.checkReportMissingProp)(t,b)}function u(){let b=e.let("missing");if(s||a){let h=e.let("valid",!0);t.block$data(h,()=>d(b,h)),t.ok(h)}else e.if((0,ZK.checkMissingProp)(t,n,b)),(0,ZK.reportMissingProp)(t,b),e.else()}function o(){e.forOf("prop",l,b=>{t.setParams({missingProperty:b}),e.if((0,ZK.noPropertyInData)(e,I,b,i.ownProperties),()=>t.error())})}function d(b,h){t.setParams({missingProperty:b}),e.forOf(b,l,()=>{e.assign(h,(0,ZK.propertyInData)(e,I,b,i.ownProperties)),e.if((0,WK.not)(h),()=>{t.error(),e.break()})},WK.nil)}}};S4e.default=t2l});var skt=f(M4e=>{"use strict";Object.defineProperty(M4e,"__esModule",{value:!0});var NK=Kl(),n2l={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,NK.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,NK._)`{limit: ${t}}`},l2l={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:n2l,code(t){let{keyword:e,data:n,schemaCode:l}=t,I=e==="maxItems"?NK.operators.GT:NK.operators.LT;t.fail$data((0,NK._)`${n}.length ${I} ${l}`)}};M4e.default=l2l});var Sse=f(T4e=>{"use strict";Object.defineProperty(T4e,"__esModule",{value:!0});var ukt=Z4e();ukt.code='require("ajv/dist/runtime/equal").default';T4e.default=ukt});var dkt=f(K4e=>{"use strict";Object.defineProperty(K4e,"__esModule",{value:!0});var D4e=rK(),HG=Kl(),I2l=Fa(),a2l=Sse(),r2l={message:({params:{i:t,j:e}})=>(0,HG.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,HG._)`{i: ${t}, j: ${e}}`},c2l={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:r2l,code(t){let{gen:e,data:n,$data:l,schema:I,parentSchema:a,schemaCode:c,it:i}=t;if(!l&&!I)return;let s=e.let("valid"),r=a.items?(0,D4e.getSchemaTypes)(a.items):[];t.block$data(s,u,(0,HG._)`${c} === false`),t.ok(s);function u(){let h=e.let("i",(0,HG._)`${n}.length`),Z=e.let("j");t.setParams({i:h,j:Z}),e.assign(s,!0),e.if((0,HG._)`${h} > 1`,()=>(o()?d:b)(h,Z))}function o(){return r.length>0&&!r.some(h=>h==="object"||h==="array")}function d(h,Z){let N=e.name("item"),g=(0,D4e.checkDataTypes)(r,N,i.opts.strictNumbers,D4e.DataType.Wrong),y=e.const("indices",(0,HG._)`{}`);e.for((0,HG._)`;${h}--;`,()=>{e.let(N,(0,HG._)`${n}[${h}]`),e.if(g,(0,HG._)`continue`),r.length>1&&e.if((0,HG._)`typeof ${N} == "string"`,(0,HG._)`${N} += "_"`),e.if((0,HG._)`typeof ${y}[${N}] == "number"`,()=>{e.assign(Z,(0,HG._)`${y}[${N}]`),t.error(),e.assign(s,!1).break()}).code((0,HG._)`${y}[${N}] = ${h}`)})}function b(h,Z){let N=(0,I2l.useFunc)(e,a2l.default),g=e.name("outer");e.label(g).for((0,HG._)`;${h}--;`,()=>e.for((0,HG._)`${Z} = ${h}; ${Z}--;`,()=>e.if((0,HG._)`${N}(${n}[${h}], ${n}[${Z}])`,()=>{t.error(),e.assign(s,!1).break(g)})))}}};K4e.default=c2l});var Gkt=f(P4e=>{"use strict";Object.defineProperty(P4e,"__esModule",{value:!0});var _4e=Kl(),o2l=Fa(),i2l=Sse(),s2l={message:"must be equal to constant",params:({schemaCode:t})=>(0,_4e._)`{allowedValue: ${t}}`},u2l={keyword:"const",$data:!0,error:s2l,code(t){let{gen:e,data:n,$data:l,schemaCode:I,schema:a}=t;l||a&&typeof a=="object"?t.fail$data((0,_4e._)`!${(0,o2l.useFunc)(e,i2l.default)}(${n}, ${I})`):t.fail((0,_4e._)`${a} !== ${n}`)}};P4e.default=u2l});var bkt=f(q4e=>{"use strict";Object.defineProperty(q4e,"__esModule",{value:!0});var VK=Kl(),d2l=Fa(),G2l=Sse(),b2l={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,VK._)`{allowedValues: ${t}}`},m2l={keyword:"enum",schemaType:"array",$data:!0,error:b2l,code(t){let{gen:e,data:n,$data:l,schema:I,schemaCode:a,it:c}=t;if(!l&&I.length===0)throw new Error("enum must have non-empty array");let i=I.length>=c.opts.loopEnum,s,r=()=>s??(s=(0,d2l.useFunc)(e,G2l.default)),u;if(i||l)u=e.let("valid"),t.block$data(u,o);else{if(!Array.isArray(I))throw new Error("ajv implementation error");let b=e.const("vSchema",a);u=(0,VK.or)(...I.map((h,Z)=>d(b,Z)))}t.pass(u);function o(){e.assign(u,!1),e.forOf("v",a,b=>e.if((0,VK._)`${r()}(${n}, ${b})`,()=>e.assign(u,!0).break()))}function d(b,h){let Z=I[h];return typeof Z=="object"&&Z!==null?(0,VK._)`${r()}(${n}, ${b}[${h}])`:(0,VK._)`${n} === ${Z}`}}};q4e.default=m2l});var mkt=f($4e=>{"use strict";Object.defineProperty($4e,"__esModule",{value:!0});var p2l=nkt(),h2l=lkt(),Z2l=rkt(),W2l=ckt(),N2l=okt(),V2l=ikt(),Y2l=skt(),g2l=dkt(),R2l=Gkt(),y2l=bkt(),A2l=[p2l.default,h2l.default,Z2l.default,W2l.default,N2l.default,V2l.default,Y2l.default,g2l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},R2l.default,y2l.default];$4e.default=A2l});var tje=f(YK=>{"use strict";Object.defineProperty(YK,"__esModule",{value:!0});YK.validateAdditionalItems=void 0;var R1=Kl(),eje=Fa(),F2l={message:({params:{len:t}})=>(0,R1.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,R1._)`{limit: ${t}}`},v2l={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:F2l,code(t){let{parentSchema:e,it:n}=t,{items:l}=e;if(!Array.isArray(l)){(0,eje.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}pkt(t,l)}};function pkt(t,e){let{gen:n,schema:l,data:I,keyword:a,it:c}=t;c.items=!0;let i=n.const("len",(0,R1._)`${I}.length`);if(l===!1)t.setParams({len:e.length}),t.pass((0,R1._)`${i} <= ${e.length}`);else if(typeof l=="object"&&!(0,eje.alwaysValidSchema)(c,l)){let r=n.var("valid",(0,R1._)`${i} <= ${e.length}`);n.if((0,R1.not)(r),()=>s(r)),t.ok(r)}function s(r){n.forRange("i",e.length,i,u=>{t.subschema({keyword:a,dataProp:u,dataPropType:eje.Type.Num},r),c.allErrors||n.if((0,R1.not)(r),()=>n.break())})}}YK.validateAdditionalItems=pkt;YK.default=v2l});var nje=f(gK=>{"use strict";Object.defineProperty(gK,"__esModule",{value:!0});gK.validateTuple=void 0;var hkt=Kl(),Mse=Fa(),f2l=wW(),X2l={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return Zkt(t,"additionalItems",e);n.items=!0,!(0,Mse.alwaysValidSchema)(n,e)&&t.ok((0,f2l.validateArray)(t))}};function Zkt(t,e,n=t.schema){let{gen:l,parentSchema:I,data:a,keyword:c,it:i}=t;u(I),i.opts.unevaluated&&n.length&&i.items!==!0&&(i.items=Mse.mergeEvaluated.items(l,n.length,i.items));let s=l.name("valid"),r=l.const("len",(0,hkt._)`${a}.length`);n.forEach((o,d)=>{(0,Mse.alwaysValidSchema)(i,o)||(l.if((0,hkt._)`${r} > ${d}`,()=>t.subschema({keyword:c,schemaProp:d,dataProp:d},s)),t.ok(s))});function u(o){let{opts:d,errSchemaPath:b}=i,h=n.length,Z=h===o.minItems&&(h===o.maxItems||o[e]===!1);if(d.strictTuples&&!Z){let N=`"${c}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${b}"`;(0,Mse.checkStrictMode)(i,N,d.strictTuples)}}}gK.validateTuple=Zkt;gK.default=X2l});var Wkt=f(lje=>{"use strict";Object.defineProperty(lje,"__esModule",{value:!0});var w2l=nje(),H2l={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,w2l.validateTuple)(t,"items")};lje.default=H2l});var Vkt=f(Ije=>{"use strict";Object.defineProperty(Ije,"__esModule",{value:!0});var Nkt=Kl(),Q2l=Fa(),E2l=wW(),J2l=tje(),C2l={message:({params:{len:t}})=>(0,Nkt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Nkt._)`{limit: ${t}}`},L2l={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:C2l,code(t){let{schema:e,parentSchema:n,it:l}=t,{prefixItems:I}=n;l.items=!0,!(0,Q2l.alwaysValidSchema)(l,e)&&(I?(0,J2l.validateAdditionalItems)(t,I):t.ok((0,E2l.validateArray)(t)))}};Ije.default=L2l});var Ykt=f(aje=>{"use strict";Object.defineProperty(aje,"__esModule",{value:!0});var QW=Kl(),Tse=Fa(),k2l={message:({params:{min:t,max:e}})=>e===void 0?(0,QW.str)`must contain at least ${t} valid item(s)`:(0,QW.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,QW._)`{minContains: ${t}}`:(0,QW._)`{minContains: ${t}, maxContains: ${e}}`},x2l={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:k2l,code(t){let{gen:e,schema:n,parentSchema:l,data:I,it:a}=t,c,i,{minContains:s,maxContains:r}=l;a.opts.next?(c=s===void 0?1:s,i=r):c=1;let u=e.const("len",(0,QW._)`${I}.length`);if(t.setParams({min:c,max:i}),i===void 0&&c===0){(0,Tse.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&c>i){(0,Tse.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Tse.alwaysValidSchema)(a,n)){let Z=(0,QW._)`${u} >= ${c}`;i!==void 0&&(Z=(0,QW._)`${Z} && ${u} <= ${i}`),t.pass(Z);return}a.items=!0;let o=e.name("valid");i===void 0&&c===1?b(o,()=>e.if(o,()=>e.break())):c===0?(e.let(o,!0),i!==void 0&&e.if((0,QW._)`${I}.length > 0`,d)):(e.let(o,!1),d()),t.result(o,()=>t.reset());function d(){let Z=e.name("_valid"),N=e.let("count",0);b(Z,()=>e.if(Z,()=>h(N)))}function b(Z,N){e.forRange("i",0,u,g=>{t.subschema({keyword:"contains",dataProp:g,dataPropType:Tse.Type.Num,compositeRule:!0},Z),N()})}function h(Z){e.code((0,QW._)`${Z}++`),i===void 0?e.if((0,QW._)`${Z} >= ${c}`,()=>e.assign(o,!0).break()):(e.if((0,QW._)`${Z} > ${i}`,()=>e.assign(o,!1).break()),c===1?e.assign(o,!0):e.if((0,QW._)`${Z} >= ${c}`,()=>e.assign(o,!0)))}}};aje.default=x2l});var ykt=f(nR=>{"use strict";Object.defineProperty(nR,"__esModule",{value:!0});nR.validateSchemaDeps=nR.validatePropertyDeps=nR.error=void 0;var rje=Kl(),j2l=Fa(),RK=wW();nR.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let l=e===1?"property":"properties";return(0,rje.str)`must have ${l} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:l}})=>(0,rje._)`{property: ${t}, + missingProperty: ${l}, + depsCount: ${e}, + deps: ${n}}`};var O2l={keyword:"dependencies",type:"object",schemaType:"object",error:nR.error,code(t){let[e,n]=U2l(t);gkt(t,e),Rkt(t,n)}};function U2l({schema:t}){let e={},n={};for(let l in t){if(l==="__proto__")continue;let I=Array.isArray(t[l])?e:n;I[l]=t[l]}return[e,n]}function gkt(t,e=t.schema){let{gen:n,data:l,it:I}=t;if(Object.keys(e).length===0)return;let a=n.let("missing");for(let c in e){let i=e[c];if(i.length===0)continue;let s=(0,RK.propertyInData)(n,l,c,I.opts.ownProperties);t.setParams({property:c,depsCount:i.length,deps:i.join(", ")}),I.allErrors?n.if(s,()=>{for(let r of i)(0,RK.checkReportMissingProp)(t,r)}):(n.if((0,rje._)`${s} && (${(0,RK.checkMissingProp)(t,i,a)})`),(0,RK.reportMissingProp)(t,a),n.else())}}nR.validatePropertyDeps=gkt;function Rkt(t,e=t.schema){let{gen:n,data:l,keyword:I,it:a}=t,c=n.name("valid");for(let i in e)(0,j2l.alwaysValidSchema)(a,e[i])||(n.if((0,RK.propertyInData)(n,l,i,a.opts.ownProperties),()=>{let s=t.subschema({keyword:I,schemaProp:i},c);t.mergeValidEvaluated(s,c)},()=>n.var(c,!0)),t.ok(c))}nR.validateSchemaDeps=Rkt;nR.default=O2l});var Fkt=f(cje=>{"use strict";Object.defineProperty(cje,"__esModule",{value:!0});var Akt=Kl(),z2l=Fa(),B2l={message:"property name must be valid",params:({params:t})=>(0,Akt._)`{propertyName: ${t.propertyName}}`},S2l={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:B2l,code(t){let{gen:e,schema:n,data:l,it:I}=t;if((0,z2l.alwaysValidSchema)(I,n))return;let a=e.name("valid");e.forIn("key",l,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},a),e.if((0,Akt.not)(a),()=>{t.error(!0),I.allErrors||e.break()})}),t.ok(a)}};cje.default=S2l});var ije=f(oje=>{"use strict";Object.defineProperty(oje,"__esModule",{value:!0});var Dse=wW(),LV=Kl(),M2l=n0(),Kse=Fa(),T2l={message:"must NOT have additional properties",params:({params:t})=>(0,LV._)`{additionalProperty: ${t.additionalProperty}}`},D2l={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T2l,code(t){let{gen:e,schema:n,parentSchema:l,data:I,errsCount:a,it:c}=t;if(!a)throw new Error("ajv implementation error");let{allErrors:i,opts:s}=c;if(c.props=!0,s.removeAdditional!=="all"&&(0,Kse.alwaysValidSchema)(c,n))return;let r=(0,Dse.allSchemaProperties)(l.properties),u=(0,Dse.allSchemaProperties)(l.patternProperties);o(),t.ok((0,LV._)`${a} === ${M2l.default.errors}`);function o(){e.forIn("key",I,N=>{!r.length&&!u.length?h(N):e.if(d(N),()=>h(N))})}function d(N){let g;if(r.length>8){let y=(0,Kse.schemaRefOrVal)(c,l.properties,"properties");g=(0,Dse.isOwnProperty)(e,y,N)}else r.length?g=(0,LV.or)(...r.map(y=>(0,LV._)`${N} === ${y}`)):g=LV.nil;return u.length&&(g=(0,LV.or)(g,...u.map(y=>(0,LV._)`${(0,Dse.usePattern)(t,y)}.test(${N})`))),(0,LV.not)(g)}function b(N){e.code((0,LV._)`delete ${I}[${N}]`)}function h(N){if(s.removeAdditional==="all"||s.removeAdditional&&n===!1){b(N);return}if(n===!1){t.setParams({additionalProperty:N}),t.error(),i||e.break();return}if(typeof n=="object"&&!(0,Kse.alwaysValidSchema)(c,n)){let g=e.name("valid");s.removeAdditional==="failing"?(Z(N,g,!1),e.if((0,LV.not)(g),()=>{t.reset(),b(N)})):(Z(N,g),i||e.if((0,LV.not)(g),()=>e.break()))}}function Z(N,g,y){let X={keyword:"additionalProperties",dataProp:N,dataPropType:Kse.Type.Str};y===!1&&Object.assign(X,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(X,g)}}};oje.default=D2l});var Xkt=f(uje=>{"use strict";Object.defineProperty(uje,"__esModule",{value:!0});var K2l=sK(),vkt=wW(),sje=Fa(),fkt=ije(),_2l={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:l,data:I,it:a}=t;a.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&fkt.default.code(new K2l.KeywordCxt(a,fkt.default,"additionalProperties"));let c=(0,vkt.allSchemaProperties)(n);for(let o of c)a.definedProperties.add(o);a.opts.unevaluated&&c.length&&a.props!==!0&&(a.props=sje.mergeEvaluated.props(e,(0,sje.toHash)(c),a.props));let i=c.filter(o=>!(0,sje.alwaysValidSchema)(a,n[o]));if(i.length===0)return;let s=e.name("valid");for(let o of i)r(o)?u(o):(e.if((0,vkt.propertyInData)(e,I,o,a.opts.ownProperties)),u(o),a.allErrors||e.else().var(s,!0),e.endIf()),t.it.definedProperties.add(o),t.ok(s);function r(o){return a.opts.useDefaults&&!a.compositeRule&&n[o].default!==void 0}function u(o){t.subschema({keyword:"properties",schemaProp:o,dataProp:o},s)}}};uje.default=_2l});var Ekt=f(dje=>{"use strict";Object.defineProperty(dje,"__esModule",{value:!0});var wkt=wW(),_se=Kl(),Hkt=Fa(),Qkt=Fa(),P2l={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:l,parentSchema:I,it:a}=t,{opts:c}=a,i=(0,wkt.allSchemaProperties)(n),s=i.filter(Z=>(0,Hkt.alwaysValidSchema)(a,n[Z]));if(i.length===0||s.length===i.length&&(!a.opts.unevaluated||a.props===!0))return;let r=c.strictSchema&&!c.allowMatchingProperties&&I.properties,u=e.name("valid");a.props!==!0&&!(a.props instanceof _se.Name)&&(a.props=(0,Qkt.evaluatedPropsToName)(e,a.props));let{props:o}=a;d();function d(){for(let Z of i)r&&b(Z),a.allErrors?h(Z):(e.var(u,!0),h(Z),e.if(u))}function b(Z){for(let N in r)new RegExp(Z).test(N)&&(0,Hkt.checkStrictMode)(a,`property ${N} matches pattern ${Z} (use allowMatchingProperties)`)}function h(Z){e.forIn("key",l,N=>{e.if((0,_se._)`${(0,wkt.usePattern)(t,Z)}.test(${N})`,()=>{let g=s.includes(Z);g||t.subschema({keyword:"patternProperties",schemaProp:Z,dataProp:N,dataPropType:Qkt.Type.Str},u),a.opts.unevaluated&&o!==!0?e.assign((0,_se._)`${o}[${N}]`,!0):!g&&!a.allErrors&&e.if((0,_se.not)(u),()=>e.break())})})}}};dje.default=P2l});var Jkt=f(Gje=>{"use strict";Object.defineProperty(Gje,"__esModule",{value:!0});var q2l=Fa(),$2l={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:l}=t;if((0,q2l.alwaysValidSchema)(l,n)){t.fail();return}let I=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},I),t.failResult(I,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Gje.default=$2l});var Ckt=f(bje=>{"use strict";Object.defineProperty(bje,"__esModule",{value:!0});var evl=wW(),tvl={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:evl.validateUnion,error:{message:"must match a schema in anyOf"}};bje.default=tvl});var Lkt=f(mje=>{"use strict";Object.defineProperty(mje,"__esModule",{value:!0});var Pse=Kl(),nvl=Fa(),lvl={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Pse._)`{passingSchemas: ${t.passing}}`},Ivl={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:lvl,code(t){let{gen:e,schema:n,parentSchema:l,it:I}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(I.opts.discriminator&&l.discriminator)return;let a=n,c=e.let("valid",!1),i=e.let("passing",null),s=e.name("_valid");t.setParams({passing:i}),e.block(r),t.result(c,()=>t.reset(),()=>t.error(!0));function r(){a.forEach((u,o)=>{let d;(0,nvl.alwaysValidSchema)(I,u)?e.var(s,!0):d=t.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},s),o>0&&e.if((0,Pse._)`${s} && ${c}`).assign(c,!1).assign(i,(0,Pse._)`[${i}, ${o}]`).else(),e.if(s,()=>{e.assign(c,!0),e.assign(i,o),d&&t.mergeEvaluated(d,Pse.Name)})})}}};mje.default=Ivl});var kkt=f(pje=>{"use strict";Object.defineProperty(pje,"__esModule",{value:!0});var avl=Fa(),rvl={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:l}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let I=e.name("valid");n.forEach((a,c)=>{if((0,avl.alwaysValidSchema)(l,a))return;let i=t.subschema({keyword:"allOf",schemaProp:c},I);t.ok(I),t.mergeEvaluated(i)})}};pje.default=rvl});var Okt=f(hje=>{"use strict";Object.defineProperty(hje,"__esModule",{value:!0});var qse=Kl(),jkt=Fa(),cvl={message:({params:t})=>(0,qse.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,qse._)`{failingKeyword: ${t.ifClause}}`},ovl={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:cvl,code(t){let{gen:e,parentSchema:n,it:l}=t;n.then===void 0&&n.else===void 0&&(0,jkt.checkStrictMode)(l,'"if" without "then" and "else" is ignored');let I=xkt(l,"then"),a=xkt(l,"else");if(!I&&!a)return;let c=e.let("valid",!0),i=e.name("_valid");if(s(),t.reset(),I&&a){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(i,r("then",u),r("else",u))}else I?e.if(i,r("then")):e.if((0,qse.not)(i),r("else"));t.pass(c,()=>t.error(!0));function s(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);t.mergeEvaluated(u)}function r(u,o){return()=>{let d=t.subschema({keyword:u},i);e.assign(c,i),t.mergeValidEvaluated(d,c),o?e.assign(o,(0,qse._)`${u}`):t.setParams({ifClause:u})}}}};function xkt(t,e){let n=t.schema[e];return n!==void 0&&!(0,jkt.alwaysValidSchema)(t,n)}hje.default=ovl});var Ukt=f(Zje=>{"use strict";Object.defineProperty(Zje,"__esModule",{value:!0});var ivl=Fa(),svl={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,ivl.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};Zje.default=svl});var zkt=f(Wje=>{"use strict";Object.defineProperty(Wje,"__esModule",{value:!0});var uvl=tje(),dvl=Wkt(),Gvl=nje(),bvl=Vkt(),mvl=Ykt(),pvl=ykt(),hvl=Fkt(),Zvl=ije(),Wvl=Xkt(),Nvl=Ekt(),Vvl=Jkt(),Yvl=Ckt(),gvl=Lkt(),Rvl=kkt(),yvl=Okt(),Avl=Ukt();function Fvl(t=!1){let e=[Vvl.default,Yvl.default,gvl.default,Rvl.default,yvl.default,Avl.default,hvl.default,Zvl.default,pvl.default,Wvl.default,Nvl.default];return t?e.push(dvl.default,bvl.default):e.push(uvl.default,Gvl.default),e.push(mvl.default),e}Wje.default=Fvl});var Bkt=f(Nje=>{"use strict";Object.defineProperty(Nje,"__esModule",{value:!0});var _o=Kl(),vvl={message:({schemaCode:t})=>(0,_o.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,_o._)`{format: ${t}}`},fvl={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:vvl,code(t,e){let{gen:n,data:l,$data:I,schema:a,schemaCode:c,it:i}=t,{opts:s,errSchemaPath:r,schemaEnv:u,self:o}=i;if(!s.validateFormats)return;I?d():b();function d(){let h=n.scopeValue("formats",{ref:o.formats,code:s.code.formats}),Z=n.const("fDef",(0,_o._)`${h}[${c}]`),N=n.let("fType"),g=n.let("format");n.if((0,_o._)`typeof ${Z} == "object" && !(${Z} instanceof RegExp)`,()=>n.assign(N,(0,_o._)`${Z}.type || "string"`).assign(g,(0,_o._)`${Z}.validate`),()=>n.assign(N,(0,_o._)`"string"`).assign(g,Z)),t.fail$data((0,_o.or)(y(),X()));function y(){return s.strictSchema===!1?_o.nil:(0,_o._)`${c} && !${g}`}function X(){let v=u.$async?(0,_o._)`(${Z}.async ? await ${g}(${l}) : ${g}(${l}))`:(0,_o._)`${g}(${l})`,H=(0,_o._)`(typeof ${g} == "function" ? ${v} : ${g}.test(${l}))`;return(0,_o._)`${g} && ${g} !== true && ${N} === ${e} && !${H}`}}function b(){let h=o.formats[a];if(!h){y();return}if(h===!0)return;let[Z,N,g]=X(h);Z===e&&t.pass(v());function y(){if(s.strictSchema===!1){o.logger.warn(H());return}throw new Error(H());function H(){return`unknown format "${a}" ignored in schema at path "${r}"`}}function X(H){let Q=H instanceof RegExp?(0,_o.regexpCode)(H):s.code.formats?(0,_o._)`${s.code.formats}${(0,_o.getProperty)(a)}`:void 0,L=n.scopeValue("formats",{key:a,ref:H,code:Q});return typeof H=="object"&&!(H instanceof RegExp)?[H.type||"string",H.validate,(0,_o._)`${L}.validate`]:["string",H,L]}function v(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error("async format in sync schema");return(0,_o._)`await ${g}(${l})`}return typeof N=="function"?(0,_o._)`${g}(${l})`:(0,_o._)`${g}.test(${l})`}}}};Nje.default=fvl});var Skt=f(Vje=>{"use strict";Object.defineProperty(Vje,"__esModule",{value:!0});var Xvl=Bkt(),wvl=[Xvl.default];Vje.default=wvl});var Mkt=f(ij=>{"use strict";Object.defineProperty(ij,"__esModule",{value:!0});ij.contentVocabulary=ij.metadataVocabulary=void 0;ij.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ij.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Dkt=f(Yje=>{"use strict";Object.defineProperty(Yje,"__esModule",{value:!0});var Hvl=tkt(),Qvl=mkt(),Evl=zkt(),Jvl=Skt(),Tkt=Mkt(),Cvl=[Hvl.default,Qvl.default,(0,Evl.default)(),Jvl.default,Tkt.metadataVocabulary,Tkt.contentVocabulary];Yje.default=Cvl});var _kt=f($se=>{"use strict";Object.defineProperty($se,"__esModule",{value:!0});$se.DiscrError=void 0;var Kkt;(function(t){t.Tag="tag",t.Mapping="mapping"})(Kkt||($se.DiscrError=Kkt={}))});var qkt=f(Rje=>{"use strict";Object.defineProperty(Rje,"__esModule",{value:!0});var sj=Kl(),gje=_kt(),Pkt=Jse(),Lvl=uK(),kvl=Fa(),xvl={message:({params:{discrError:t,tagName:e}})=>t===gje.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,sj._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},jvl={keyword:"discriminator",type:"object",schemaType:"object",error:xvl,code(t){let{gen:e,data:n,schema:l,parentSchema:I,it:a}=t,{oneOf:c}=I;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");let i=l.propertyName;if(typeof i!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");let s=e.let("valid",!1),r=e.const("tag",(0,sj._)`${n}${(0,sj.getProperty)(i)}`);e.if((0,sj._)`typeof ${r} == "string"`,()=>u(),()=>t.error(!1,{discrError:gje.DiscrError.Tag,tag:r,tagName:i})),t.ok(s);function u(){let b=d();e.if(!1);for(let h in b)e.elseIf((0,sj._)`${r} === ${h}`),e.assign(s,o(b[h]));e.else(),t.error(!1,{discrError:gje.DiscrError.Mapping,tag:r,tagName:i}),e.endIf()}function o(b){let h=e.name("valid"),Z=t.subschema({keyword:"oneOf",schemaProp:b},h);return t.mergeEvaluated(Z,sj.Name),h}function d(){var b;let h={},Z=g(I),N=!0;for(let v=0;v{Ovl.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Aje=f((Ec,yje)=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.MissingRefError=Ec.ValidationError=Ec.CodeGen=Ec.Name=Ec.nil=Ec.stringify=Ec.str=Ec._=Ec.KeywordCxt=Ec.Ajv=void 0;var Uvl=KLt(),zvl=Dkt(),Bvl=qkt(),ext=$kt(),Svl=["/properties"],eue="http://json-schema.org/draft-07/schema",uj=class extends Uvl.default{_addVocabularies(){super._addVocabularies(),zvl.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Bvl.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ext,Svl):ext;this.addMetaSchema(e,eue,!1),this.refs["http://json-schema.org/schema"]=eue}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(eue)?eue:void 0)}};Ec.Ajv=uj;yje.exports=Ec=uj;yje.exports.Ajv=uj;Object.defineProperty(Ec,"__esModule",{value:!0});Ec.default=uj;var Mvl=sK();Object.defineProperty(Ec,"KeywordCxt",{enumerable:!0,get:function(){return Mvl.KeywordCxt}});var dj=Kl();Object.defineProperty(Ec,"_",{enumerable:!0,get:function(){return dj._}});Object.defineProperty(Ec,"str",{enumerable:!0,get:function(){return dj.str}});Object.defineProperty(Ec,"stringify",{enumerable:!0,get:function(){return dj.stringify}});Object.defineProperty(Ec,"nil",{enumerable:!0,get:function(){return dj.nil}});Object.defineProperty(Ec,"Name",{enumerable:!0,get:function(){return dj.Name}});Object.defineProperty(Ec,"CodeGen",{enumerable:!0,get:function(){return dj.CodeGen}});var Tvl=Qse();Object.defineProperty(Ec,"ValidationError",{enumerable:!0,get:function(){return Tvl.default}});var Dvl=uK();Object.defineProperty(Ec,"MissingRefError",{enumerable:!0,get:function(){return Dvl.default}})});var rxt=f(lR=>{"use strict";Object.defineProperty(lR,"__esModule",{value:!0});lR.formatNames=lR.fastFormats=lR.fullFormats=void 0;function Gj(t,e){return{validate:t,compare:e}}lR.fullFormats={date:Gj(lxt,fje),time:Gj(Ixt,Xje),"date-time":Gj(qvl,axt),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:tfl,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ofl,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:nfl,int32:{type:"number",validate:afl},int64:{type:"number",validate:rfl},float:{type:"number",validate:nxt},double:{type:"number",validate:nxt},password:!0,binary:!0};lR.fastFormats={...lR.fullFormats,date:Gj(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,fje),time:Gj(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Xje),"date-time":Gj(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,axt),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};lR.formatNames=Object.keys(lR.fullFormats);function Kvl(t){return t%4===0&&(t%100!==0||t%400===0)}var _vl=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Pvl=[0,31,28,31,30,31,30,31,31,30,31,30,31];function lxt(t){let e=_vl.exec(t);if(!e)return!1;let n=+e[1],l=+e[2],I=+e[3];return l>=1&&l<=12&&I>=1&&I<=(l===2&&Kvl(n)?29:Pvl[l])}function fje(t,e){if(t&&e)return t>e?1:te?1:t=lfl}function rfl(t){return Number.isInteger(t)}function nxt(){return!0}var cfl=/[^\\]\\Z/;function ofl(t){if(cfl.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var cxt=f(bj=>{"use strict";Object.defineProperty(bj,"__esModule",{value:!0});bj.formatLimitDefinition=void 0;var ifl=Aje(),kV=Kl(),RX=kV.operators,tue={formatMaximum:{okStr:"<=",ok:RX.LTE,fail:RX.GT},formatMinimum:{okStr:">=",ok:RX.GTE,fail:RX.LT},formatExclusiveMaximum:{okStr:"<",ok:RX.LT,fail:RX.GTE},formatExclusiveMinimum:{okStr:">",ok:RX.GT,fail:RX.LTE}},sfl={message:({keyword:t,schemaCode:e})=>kV.str`should be ${tue[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>kV._`{comparison: ${tue[t].okStr}, limit: ${e}}`};bj.formatLimitDefinition={keyword:Object.keys(tue),type:"string",schemaType:"string",$data:!0,error:sfl,code(t){let{gen:e,data:n,schemaCode:l,keyword:I,it:a}=t,{opts:c,self:i}=a;if(!c.validateFormats)return;let s=new ifl.KeywordCxt(a,i.RULES.all.format.definition,"format");s.$data?r():u();function r(){let d=e.scopeValue("formats",{ref:i.formats,code:c.code.formats}),b=e.const("fmt",kV._`${d}[${s.schemaCode}]`);t.fail$data(kV.or(kV._`typeof ${b} != "object"`,kV._`${b} instanceof RegExp`,kV._`typeof ${b}.compare != "function"`,o(b)))}function u(){let d=s.schema,b=i.formats[d];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${I}": format "${d}" does not define "compare" function`);let h=e.scopeValue("formats",{key:d,ref:b,code:c.code.formats?kV._`${c.code.formats}${kV.getProperty(d)}`:void 0});t.fail$data(o(h))}function o(d){return kV._`${d}.compare(${n}, ${l}) ${tue[I].fail} 0`}},dependencies:["format"]};var ufl=t=>(t.addKeyword(bj.formatLimitDefinition),t);bj.default=ufl});var uxt=f((yK,sxt)=>{"use strict";Object.defineProperty(yK,"__esModule",{value:!0});var mj=rxt(),dfl=cxt(),wje=Kl(),oxt=new wje.Name("fullFormats"),Gfl=new wje.Name("fastFormats"),Hje=(t,e={keywords:!0})=>{if(Array.isArray(e))return ixt(t,e,mj.fullFormats,oxt),t;let[n,l]=e.mode==="fast"?[mj.fastFormats,Gfl]:[mj.fullFormats,oxt],I=e.formats||mj.formatNames;return ixt(t,I,n,l),e.keywords&&dfl.default(t),t};Hje.get=(t,e="full")=>{let l=(e==="fast"?mj.fastFormats:mj.fullFormats)[t];if(!l)throw new Error(`Unknown format "${t}"`);return l};function ixt(t,e,n,l){var I,a;(I=(a=t.opts.code).formats)!==null&&I!==void 0||(a.formats=wje._`require("ajv-formats/dist/formats").${l}`);for(let c of e)t.addFormat(c,n[c])}sxt.exports=yK=Hje;Object.defineProperty(yK,"__esModule",{value:!0});yK.default=Hje});var k3t=f((Kqa,L3t)=>{L3t.exports.IconsManifest=[{id:"fa",name:"Font Awesome",projectUrl:"https://fontawesome.com/",license:"CC BY 4.0 License",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"},{id:"io",name:"Ionicons 4",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"io5",name:"Ionicons 5",projectUrl:"https://ionicons.com/",license:"MIT",licenseUrl:"https://github.com/ionic-team/ionicons/blob/master/LICENSE"},{id:"md",name:"Material Design icons",projectUrl:"http://google.github.io/material-design-icons/",license:"Apache License Version 2.0",licenseUrl:"https://github.com/google/material-design-icons/blob/master/LICENSE"},{id:"ti",name:"Typicons",projectUrl:"http://s-ings.com/typicons/",license:"CC BY-SA 3.0",licenseUrl:"https://creativecommons.org/licenses/by-sa/3.0/"},{id:"go",name:"Github Octicons icons",projectUrl:"https://octicons.github.com/",license:"MIT",licenseUrl:"https://github.com/primer/octicons/blob/master/LICENSE"},{id:"fi",name:"Feather",projectUrl:"https://feathericons.com/",license:"MIT",licenseUrl:"https://github.com/feathericons/feather/blob/master/LICENSE"},{id:"gi",name:"Game Icons",projectUrl:"https://game-icons.net/",license:"CC BY 3.0",licenseUrl:"https://creativecommons.org/licenses/by/3.0/"},{id:"wi",name:"Weather Icons",projectUrl:"https://erikflowers.github.io/weather-icons/",license:"SIL OFL 1.1",licenseUrl:"http://scripts.sil.org/OFL"},{id:"di",name:"Devicons",projectUrl:"https://vorillaz.github.io/devicons/",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ai",name:"Ant Design Icons",projectUrl:"https://github.com/ant-design/ant-design-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"bs",name:"Bootstrap Icons",projectUrl:"https://github.com/twbs/icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"ri",name:"Remix Icon",projectUrl:"https://github.com/Remix-Design/RemixIcon",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"fc",name:"Flat Color Icons",projectUrl:"https://github.com/icons8/flat-color-icons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"gr",name:"Grommet-Icons",projectUrl:"https://github.com/grommet/grommet-icons",license:"Apache License Version 2.0",licenseUrl:"http://www.apache.org/licenses/"},{id:"hi",name:"Heroicons",projectUrl:"https://github.com/refactoringui/heroicons",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"si",name:"Simple Icons",projectUrl:"https://simpleicons.org/",license:"CC0 1.0 Universal",licenseUrl:"https://creativecommons.org/publicdomain/zero/1.0/"},{id:"im",name:"IcoMoon Free",projectUrl:"https://github.com/Keyamoon/IcoMoon-Free",license:"CC BY 4.0 License"},{id:"bi",name:"BoxIcons",projectUrl:"https://github.com/atisawd/boxicons",license:"CC BY 4.0 License"},{id:"cg",name:"css.gg",projectUrl:"https://github.com/astrit/css.gg",license:"MIT",licenseUrl:"https://opensource.org/licenses/MIT"},{id:"vsc",name:"VS Code Icons",projectUrl:"https://github.com/microsoft/vscode-codicons",license:"CC BY 4.0",licenseUrl:"https://creativecommons.org/licenses/by/4.0/"}]});var fOe=f(X1=>{"use strict";Object.defineProperty(X1,"__esModule",{value:!0});X1.IconContext=X1.DefaultContext=void 0;var x3t=Ae();X1.DefaultContext={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0};X1.IconContext=x3t.createContext&&x3t.createContext(X1.DefaultContext)});var U3t=f(oR=>{"use strict";var HX=oR&&oR.__assign||function(){return HX=Object.assign||function(t){for(var e,n=1,l=arguments.length;n{"use strict";var cwl=o0&&o0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n),Object.defineProperty(t,l,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),wOe=o0&&o0.__exportStar||function(t,e){for(var n in t)n!=="default"&&!e.hasOwnProperty(n)&&cwl(e,t,n)};Object.defineProperty(o0,"__esModule",{value:!0});wOe(k3t(),o0);wOe(U3t(),o0);wOe(fOe(),o0)});var B3t=f(($qa,z3t)=>{var owl=Yj().GenIcon;z3t.exports.BsPlus=function(e){return owl({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 3.5a.5.5 0 01.5.5v4a.5.5 0 01-.5.5H4a.5.5 0 010-1h3.5V4a.5.5 0 01.5-.5z",clipRule:"evenodd"}},{tag:"path",attr:{fillRule:"evenodd",d:"M7.5 8a.5.5 0 01.5-.5h4a.5.5 0 010 1H8.5V12a.5.5 0 01-1 0V8z",clipRule:"evenodd"}}]})(e)}});var T3t=f((S7a,M3t)=>{var iwl=Yj().GenIcon;M3t.exports.AiOutlineArrowDown=function(e){return iwl({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0 0 48.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]})(e)}});var K3t=f((M7a,D3t)=>{var swl=Yj().GenIcon;D3t.exports.AiOutlineArrowUp=function(e){return swl({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M868 545.5L536.1 163a31.96 31.96 0 0 0-48.3 0L156 545.5a7.97 7.97 0 0 0 6 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]})(e)}});var P3t=f((T7a,_3t)=>{var uwl=Yj().GenIcon;_3t.exports.IoIosCopy=function(e){return uwl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352 115h90c3.3 0 6-2.7 6-6 0-8.2-3.7-16-10-21.3l-77.1-64.2c-4.9-4.1-14.2-7.4-20.6-7.4-4.1 0-7.4 3.3-7.4 7.4V96c.1 10.5 8.6 19 19.1 19z"}},{tag:"path",attr:{d:"M307 96V16H176c-17.6 0-32 14.4-32 32v336c0 17.6 14.4 32 32 32h240c17.6 0 32-14.4 32-32V141h-96c-24.8 0-45-20.2-45-45z"}},{tag:"path",attr:{d:"M116 412V80H96c-17.6 0-32 14.4-32 32v352c0 17.6 14.4 32 32 32h256c17.6 0 32-14.4 32-32v-20H148c-17.6 0-32-14.4-32-32z"}}]})(e)}});var $3t=f((D7a,q3t)=>{var dwl=Yj().GenIcon;q3t.exports.IoIosRemove=function(e){return dwl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M368.5 240h-225c-8.8 0-16 7.2-16 16 0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7h225c8.8 0 16-7.2 16-16s-7.2-16-16-16z"}}]})(e)}});var wt=f(MOe=>{"use strict";Object.defineProperty(MOe,"__esModule",{value:!0});MOe.pathToFunc=Wwl;var Zwl=Object.prototype.hasOwnProperty;function Wwl(t,e){let n=/\{([a-zA-Z0-9_]+?)\}/g;return function(I={}){return t.replace(n,function(a,c){if(!Zwl.call(I,c))throw new Error(`Parameter '${c}' is required`);let i=I[c];if(typeof i!="string"&&typeof i!="number")throw new Error(`Parameter '${c}' must be a string or number`);return e?.charEncoding==="percent"?encodeURIComponent(`${i}`):`${i}`})}}});var kue=f(JW=>{"use strict";Object.defineProperty(JW,"__esModule",{value:!0});JW.SDK_METADATA=JW.ServerList=JW.ServerEu=void 0;JW.serverURLFromOptions=Vwl;var Nwl=wt();JW.ServerEu="eu";JW.ServerList={[JW.ServerEu]:"https://api.mistral.ai"};function Vwl(t){let e=t.serverURL,n={};if(!e){let I=t.server??JW.ServerEu;e=JW.ServerList[I]||""}let l=(0,Nwl.pathToFunc)(e)(n);return new URL(l)}JW.SDK_METADATA={language:"typescript",openapiDocVersion:"1.0.0",sdkVersion:"1.7.4",genVersion:"2.548.6",userAgent:"speakeasy-sdk/typescript 1.7.4 2.548.6 1.0.0 @mistralai/mistralai"}});var xue=f(TOe=>{"use strict";Object.defineProperty(TOe,"__esModule",{value:!0});TOe.readableStreamToArrayBuffer=Ywl;async function Ywl(t){let e=t.getReader(),n=[],l=0,I=!1;for(;!I;){let{value:i,done:s}=await e.read();s?I=!0:(n.push(i),l+=i.length)}let a=new Uint8Array(l),c=0;for(let i of n)a.set(i,c),c+=i.length;return a.buffer}});var V4t=f(jue=>{"use strict";Object.defineProperty(jue,"__esModule",{value:!0});jue.CustomUserAgentHook=void 0;var gwl=kue(),DOe=class{beforeRequest(e,n){let I=`mistral-client-typescript/${gwl.SDK_METADATA.sdkVersion}`;return n.headers.set("user-agent",I),n.headers.get("user-agent")||n.headers.set("x-mistral-user-agent",I),n}};jue.CustomUserAgentHook=DOe});var g4t=f(Oue=>{"use strict";Object.defineProperty(Oue,"__esModule",{value:!0});Oue.DeprecationWarningHook=void 0;var Y4t="x-model-deprecation-timestamp",KOe=class{afterSuccess(e,n){return n.headers.has(Y4t)&&n.clone().json().then(l=>{let I=l.model;console.warn(`WARNING: The model ${I} is deprecated and will be removed on ${n.headers.get(Y4t)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}),n}};Oue.DeprecationWarningHook=KOe});var R4t=f(_Oe=>{"use strict";Object.defineProperty(_Oe,"__esModule",{value:!0});_Oe.initHooks=Awl;var Rwl=V4t(),ywl=g4t();function Awl(t){let e=new Rwl.CustomUserAgentHook;t.registerBeforeRequestHook(e);let n=new ywl.DeprecationWarningHook;t.registerAfterSuccessHook(n)}});var y4t=f(Uue=>{"use strict";Object.defineProperty(Uue,"__esModule",{value:!0});Uue.SDKHooks=void 0;var Fwl=R4t(),POe=class{constructor(){this.sdkInitHooks=[],this.beforeCreateRequestHooks=[],this.beforeRequestHooks=[],this.afterSuccessHooks=[],this.afterErrorHooks=[];let e=[];for(let n of e)"sdkInit"in n&&this.registerSDKInitHook(n),"beforeCreateRequest"in n&&this.registerBeforeCreateRequestHook(n),"beforeRequest"in n&&this.registerBeforeRequestHook(n),"afterSuccess"in n&&this.registerAfterSuccessHook(n),"afterError"in n&&this.registerAfterErrorHook(n);(0,Fwl.initHooks)(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((n,l)=>l.sdkInit(n),e)}beforeCreateRequest(e,n){let l=n;for(let I of this.beforeCreateRequestHooks)l=I.beforeCreateRequest(e,l);return l}async beforeRequest(e,n){let l=n;for(let I of this.beforeRequestHooks)l=await I.beforeRequest(e,l);return l}async afterSuccess(e,n){let l=n;for(let I of this.afterSuccessHooks)l=await I.afterSuccess(e,l);return l}async afterError(e,n,l){let I=n,a=l;for(let c of this.afterErrorHooks){let i=await c.afterError(e,I,a);I=i.response,a=i.error}return{response:I,error:a}}};Uue.SDKHooks=POe});var lUe=f(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.ConnectionError=wp.RequestTimeoutError=wp.RequestAbortedError=wp.InvalidRequestError=wp.UnexpectedClientError=wp.HTTPClientError=void 0;var CX=class extends Error{constructor(e,n){let l=e;n?.cause&&(l+=`: ${n.cause}`),super(l,n),this.name="HTTPClientError",typeof this.cause>"u"&&(this.cause=n?.cause)}};wp.HTTPClientError=CX;var qOe=class extends CX{constructor(){super(...arguments),this.name="UnexpectedClientError"}};wp.UnexpectedClientError=qOe;var $Oe=class extends CX{constructor(){super(...arguments),this.name="InvalidRequestError"}};wp.InvalidRequestError=$Oe;var eUe=class extends CX{constructor(){super(...arguments),this.name="RequestAbortedError"}};wp.RequestAbortedError=eUe;var tUe=class extends CX{constructor(){super(...arguments),this.name="RequestTimeoutError"}};wp.RequestTimeoutError=tUe;var nUe=class extends CX{constructor(){super(...arguments),this.name="ConnectionError"}};wp.ConnectionError=nUe});var Hd=f(vj=>{"use strict";Object.defineProperty(vj,"__esModule",{value:!0});vj.OK=vwl;vj.ERR=fwl;vj.unwrap=Xwl;vj.unwrapAsync=wwl;function vwl(t){return{ok:!0,value:t}}function fwl(t){return{ok:!1,error:t}}function Xwl(t){if(!t.ok)throw t.error;return t.value}async function wwl(t){let e=await t;if(!e.ok)throw e.error;return e.value}});var TK=f(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.getParsedType=Wc.ZodParsedType=Wc.objectUtil=Wc.util=void 0;var IUe;(function(t){t.assertEqual=I=>{};function e(I){}t.assertIs=e;function n(I){throw new Error}t.assertNever=n,t.arrayToEnum=I=>{let a={};for(let c of I)a[c]=c;return a},t.getValidEnumValues=I=>{let a=t.objectKeys(I).filter(i=>typeof I[I[i]]!="number"),c={};for(let i of a)c[i]=I[i];return t.objectValues(c)},t.objectValues=I=>t.objectKeys(I).map(function(a){return I[a]}),t.objectKeys=typeof Object.keys=="function"?I=>Object.keys(I):I=>{let a=[];for(let c in I)Object.prototype.hasOwnProperty.call(I,c)&&a.push(c);return a},t.find=(I,a)=>{for(let c of I)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?I=>Number.isInteger(I):I=>typeof I=="number"&&Number.isFinite(I)&&Math.floor(I)===I;function l(I,a=" | "){return I.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}t.joinValues=l,t.jsonStringifyReplacer=(I,a)=>typeof a=="bigint"?a.toString():a})(IUe||(Wc.util=IUe={}));var A4t;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(A4t||(Wc.objectUtil=A4t={}));Wc.ZodParsedType=IUe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var Hwl=t=>{switch(typeof t){case"undefined":return Wc.ZodParsedType.undefined;case"string":return Wc.ZodParsedType.string;case"number":return Number.isNaN(t)?Wc.ZodParsedType.nan:Wc.ZodParsedType.number;case"boolean":return Wc.ZodParsedType.boolean;case"function":return Wc.ZodParsedType.function;case"bigint":return Wc.ZodParsedType.bigint;case"symbol":return Wc.ZodParsedType.symbol;case"object":return Array.isArray(t)?Wc.ZodParsedType.array:t===null?Wc.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Wc.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?Wc.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?Wc.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?Wc.ZodParsedType.date:Wc.ZodParsedType.object;default:return Wc.ZodParsedType.unknown}};Wc.getParsedType=Hwl});var zue=f(LX=>{"use strict";Object.defineProperty(LX,"__esModule",{value:!0});LX.ZodError=LX.quotelessJson=LX.ZodIssueCode=void 0;var F4t=TK();LX.ZodIssueCode=F4t.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Qwl=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");LX.quotelessJson=Qwl;var DK=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(a){return a.message},l={_errors:[]},I=a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(I);else if(c.code==="invalid_return_type")I(c.returnTypeError);else if(c.code==="invalid_arguments")I(c.argumentsError);else if(c.path.length===0)l._errors.push(n(c));else{let i=l,s=0;for(;sn.message){let n={},l=[];for(let I of this.issues)if(I.path.length>0){let a=I.path[0];n[a]=n[a]||[],n[a].push(e(I))}else l.push(e(I));return{formErrors:l,fieldErrors:n}}get formErrors(){return this.flatten()}};LX.ZodError=DK;DK.create=t=>new DK(t)});var rUe=f(aUe=>{"use strict";Object.defineProperty(aUe,"__esModule",{value:!0});var wb=zue(),E1=TK(),Ewl=(t,e)=>{let n;switch(t.code){case wb.ZodIssueCode.invalid_type:t.received===E1.ZodParsedType.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case wb.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,E1.util.jsonStringifyReplacer)}`;break;case wb.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${E1.util.joinValues(t.keys,", ")}`;break;case wb.ZodIssueCode.invalid_union:n="Invalid input";break;case wb.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${E1.util.joinValues(t.options)}`;break;case wb.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${E1.util.joinValues(t.options)}, received '${t.received}'`;break;case wb.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case wb.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case wb.ZodIssueCode.invalid_date:n="Invalid date";break;case wb.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:E1.util.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case wb.ZodIssueCode.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case wb.ZodIssueCode.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case wb.ZodIssueCode.custom:n="Invalid input";break;case wb.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case wb.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case wb.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=e.defaultError,E1.util.assertNever(t)}return{message:n}};aUe.default=Ewl});var Bue=f(kX=>{"use strict";var Jwl=kX&&kX.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kX,"__esModule",{value:!0});kX.defaultErrorMap=void 0;kX.setErrorMap=Cwl;kX.getErrorMap=Lwl;var v4t=Jwl(rUe());kX.defaultErrorMap=v4t.default;var f4t=v4t.default;function Cwl(t){f4t=t}function Lwl(){return f4t}});var oUe=f(Cr=>{"use strict";var kwl=Cr&&Cr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.isAsync=Cr.isValid=Cr.isDirty=Cr.isAborted=Cr.OK=Cr.DIRTY=Cr.INVALID=Cr.ParseStatus=Cr.EMPTY_PATH=Cr.makeIssue=void 0;Cr.addIssueToContext=Owl;var xwl=Bue(),X4t=kwl(rUe()),jwl=t=>{let{data:e,path:n,errorMaps:l,issueData:I}=t,a=[...n,...I.path||[]],c={...I,path:a};if(I.message!==void 0)return{...I,path:a,message:I.message};let i="",s=l.filter(r=>!!r).slice().reverse();for(let r of s)i=r(c,{data:e,defaultError:i}).message;return{...I,path:a,message:i}};Cr.makeIssue=jwl;Cr.EMPTY_PATH=[];function Owl(t,e){let n=(0,xwl.getErrorMap)(),l=(0,Cr.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===X4t.default?void 0:X4t.default].filter(I=>!!I)});t.common.issues.push(l)}var cUe=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let l=[];for(let I of n){if(I.status==="aborted")return Cr.INVALID;I.status==="dirty"&&e.dirty(),l.push(I.value)}return{status:e.value,value:l}}static async mergeObjectAsync(e,n){let l=[];for(let I of n){let a=await I.key,c=await I.value;l.push({key:a,value:c})}return t.mergeObjectSync(e,l)}static mergeObjectSync(e,n){let l={};for(let I of n){let{key:a,value:c}=I;if(a.status==="aborted"||c.status==="aborted")return Cr.INVALID;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||I.alwaysSet)&&(l[a.value]=c.value)}return{status:e.value,value:l}}};Cr.ParseStatus=cUe;Cr.INVALID=Object.freeze({status:"aborted"});var Uwl=t=>({status:"dirty",value:t});Cr.DIRTY=Uwl;var zwl=t=>({status:"valid",value:t});Cr.OK=zwl;var Bwl=t=>t.status==="aborted";Cr.isAborted=Bwl;var Swl=t=>t.status==="dirty";Cr.isDirty=Swl;var Mwl=t=>t.status==="valid";Cr.isValid=Mwl;var Twl=t=>typeof Promise<"u"&&t instanceof Promise;Cr.isAsync=Twl});var H4t=f(w4t=>{"use strict";Object.defineProperty(w4t,"__esModule",{value:!0})});var E4t=f(Sue=>{"use strict";Object.defineProperty(Sue,"__esModule",{value:!0});Sue.errorUtil=void 0;var Q4t;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q4t||(Sue.errorUtil=Q4t={}))});var M4t=f(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.discriminatedUnion=Ve.date=Ve.boolean=Ve.bigint=Ve.array=Ve.any=Ve.coerce=Ve.ZodFirstPartyTypeKind=Ve.late=Ve.ZodSchema=Ve.Schema=Ve.ZodReadonly=Ve.ZodPipeline=Ve.ZodBranded=Ve.BRAND=Ve.ZodNaN=Ve.ZodCatch=Ve.ZodDefault=Ve.ZodNullable=Ve.ZodOptional=Ve.ZodTransformer=Ve.ZodEffects=Ve.ZodPromise=Ve.ZodNativeEnum=Ve.ZodEnum=Ve.ZodLiteral=Ve.ZodLazy=Ve.ZodFunction=Ve.ZodSet=Ve.ZodMap=Ve.ZodRecord=Ve.ZodTuple=Ve.ZodIntersection=Ve.ZodDiscriminatedUnion=Ve.ZodUnion=Ve.ZodObject=Ve.ZodArray=Ve.ZodVoid=Ve.ZodNever=Ve.ZodUnknown=Ve.ZodAny=Ve.ZodNull=Ve.ZodUndefined=Ve.ZodSymbol=Ve.ZodDate=Ve.ZodBoolean=Ve.ZodBigInt=Ve.ZodNumber=Ve.ZodString=Ve.ZodType=void 0;Ve.NEVER=Ve.void=Ve.unknown=Ve.union=Ve.undefined=Ve.tuple=Ve.transformer=Ve.symbol=Ve.string=Ve.strictObject=Ve.set=Ve.record=Ve.promise=Ve.preprocess=Ve.pipeline=Ve.ostring=Ve.optional=Ve.onumber=Ve.oboolean=Ve.object=Ve.number=Ve.nullable=Ve.null=Ve.never=Ve.nativeEnum=Ve.nan=Ve.map=Ve.literal=Ve.lazy=Ve.intersection=Ve.instanceof=Ve.function=Ve.enum=Ve.effect=void 0;Ve.datetimeRegex=x4t;Ve.custom=O4t;var It=zue(),Mue=Bue(),tn=E4t(),Ye=oUe(),st=TK(),LW=class{constructor(e,n,l,I){this._cachedPath=[],this.parent=e,this.data=n,this._path=l,this._key=I}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},J4t=(t,e)=>{if((0,Ye.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new It.ZodError(t.common.issues);return this._error=n,this._error}}};function xl(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:l,description:I}=t;if(e&&(n||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:I}:{errorMap:(c,i)=>{let{message:s}=t;return c.code==="invalid_enum_value"?{message:s??i.defaultError}:typeof i.data>"u"?{message:s??l??i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:s??n??i.defaultError}},description:I}}var jl=class{get description(){return this._def.description}_getType(e){return(0,st.getParsedType)(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:(0,st.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ye.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,st.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if((0,Ye.isAsync)(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let l=this.safeParse(e,n);if(l.success)return l.data;throw l.error}safeParse(e,n){let l={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,st.getParsedType)(e)},I=this._parseSync({data:e,path:l.path,parent:l});return J4t(l,I)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,st.getParsedType)(e)};if(!this["~standard"].async)try{let l=this._parseSync({data:e,path:[],parent:n});return(0,Ye.isValid)(l)?{value:l.value}:{issues:n.common.issues}}catch(l){l?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(l=>(0,Ye.isValid)(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(e,n){let l=await this.safeParseAsync(e,n);if(l.success)return l.data;throw l.error}async safeParseAsync(e,n){let l={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,st.getParsedType)(e)},I=this._parse({data:e,path:l.path,parent:l}),a=await((0,Ye.isAsync)(I)?I:Promise.resolve(I));return J4t(l,a)}refine(e,n){let l=I=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(I):n;return this._refinement((I,a)=>{let c=e(I),i=()=>a.addIssue({code:It.ZodIssueCode.custom,...l(I)});return typeof Promise<"u"&&c instanceof Promise?c.then(s=>s?!0:(i(),!1)):c?!0:(i(),!1)})}refinement(e,n){return this._refinement((l,I)=>e(l)?!0:(I.addIssue(typeof n=="function"?n(l,I):n),!1))}_refinement(e){return new eZ({schema:this,typeName:jn.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return CW.create(this,this._def)}nullable(){return uR.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return d0.create(this)}promise(){return OX.create(this,this._def)}or(e){return O1.create([this,e],this._def)}and(e){return U1.create(this,e,this._def)}transform(e){return new eZ({...xl(this._def),schema:this,typeName:jn.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new T1({...xl(this._def),innerType:this,defaultValue:n,typeName:jn.ZodDefault})}brand(){return new KK({typeName:jn.ZodBranded,type:this,...xl(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new D1({...xl(this._def),innerType:this,catchValue:n,typeName:jn.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return _K.create(this,e)}readonly(){return K1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};Ve.ZodType=jl;Ve.Schema=jl;Ve.ZodSchema=jl;var Dwl=/^c[^\s-]{8,}$/i,Kwl=/^[0-9a-z]+$/,_wl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Pwl=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qwl=/^[a-z0-9_-]{21}$/i,$wl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,eHl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tHl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nHl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",iUe,lHl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,IHl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,aHl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,rHl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cHl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,oHl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L4t="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",iHl=new RegExp(`^${L4t}$`);function k4t(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function sHl(t){return new RegExp(`^${k4t(t)}$`)}function x4t(t){let e=`${L4t}T${k4t(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function uHl(t,e){return!!((e==="v4"||!e)&&lHl.test(t)||(e==="v6"||!e)&&aHl.test(t))}function dHl(t,e){if(!$wl.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let l=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),I=JSON.parse(atob(l));return!(typeof I!="object"||I===null||"typ"in I&&I?.typ!=="JWT"||!I.alg||e&&I.alg!==e)}catch{return!1}}function GHl(t,e){return!!((e==="v4"||!e)&&IHl.test(t)||(e==="v6"||!e)&&rHl.test(t))}var xX=class t extends jl{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==st.ZodParsedType.string){let a=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(a,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.string,received:a.parsedType}),Ye.INVALID}let l=new Ye.ParseStatus,I;for(let a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(I=this._getOrReturnCtx(e,I),(0,Ye.addIssueToContext)(I,{code:It.ZodIssueCode.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),l.dirty());else if(a.kind==="length"){let c=e.data.length>a.value,i=e.data.lengthe.test(I),{validation:n,code:It.ZodIssueCode.invalid_string,...tn.errorUtil.errToObj(l)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...tn.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...tn.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...tn.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...tn.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...tn.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...tn.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...tn.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...tn.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...tn.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...tn.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...tn.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...tn.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...tn.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...tn.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...tn.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...tn.errorUtil.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...tn.errorUtil.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...tn.errorUtil.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...tn.errorUtil.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...tn.errorUtil.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...tn.errorUtil.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...tn.errorUtil.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...tn.errorUtil.errToObj(n)})}nonempty(e){return this.min(1,tn.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew xX({checks:[],typeName:jn.ZodString,coerce:t?.coerce??!1,...xl(t)});function bHl(t,e){let n=(t.toString().split(".")[1]||"").length,l=(e.toString().split(".")[1]||"").length,I=n>l?n:l,a=Number.parseInt(t.toFixed(I).replace(".","")),c=Number.parseInt(e.toFixed(I).replace(".",""));return a%c/10**I}var J1=class t extends jl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==st.ZodParsedType.number){let a=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(a,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.number,received:a.parsedType}),Ye.INVALID}let l,I=new Ye.ParseStatus;for(let a of this._def.checks)a.kind==="int"?st.util.isInteger(e.data)||(l=this._getOrReturnCtx(e,l),(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:a.message}),I.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(l=this._getOrReturnCtx(e,l),(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),I.dirty()):a.kind==="multipleOf"?bHl(e.data,a.value)!==0&&(l=this._getOrReturnCtx(e,l),(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),I.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(l=this._getOrReturnCtx(e,l),(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.not_finite,message:a.message}),I.dirty()):st.util.assertNever(a);return{status:I.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,tn.errorUtil.toString(n))}gt(e,n){return this.setLimit("min",e,!1,tn.errorUtil.toString(n))}lte(e,n){return this.setLimit("max",e,!0,tn.errorUtil.toString(n))}lt(e,n){return this.setLimit("max",e,!1,tn.errorUtil.toString(n))}setLimit(e,n,l,I){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:l,message:tn.errorUtil.toString(I)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:tn.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tn.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tn.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tn.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tn.errorUtil.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:tn.errorUtil.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:tn.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tn.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tn.errorUtil.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&st.util.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(n===null||l.value>n)&&(n=l.value):l.kind==="max"&&(e===null||l.valuenew J1({checks:[],typeName:jn.ZodNumber,coerce:t?.coerce||!1,...xl(t)});var C1=class t extends jl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==st.ZodParsedType.bigint)return this._getInvalidInput(e);let l,I=new Ye.ParseStatus;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(l=this._getOrReturnCtx(e,l),(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),I.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(l=this._getOrReturnCtx(e,l),(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),I.dirty()):st.util.assertNever(a);return{status:I.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.bigint,received:n.parsedType}),Ye.INVALID}gte(e,n){return this.setLimit("min",e,!0,tn.errorUtil.toString(n))}gt(e,n){return this.setLimit("min",e,!1,tn.errorUtil.toString(n))}lte(e,n){return this.setLimit("max",e,!0,tn.errorUtil.toString(n))}lt(e,n){return this.setLimit("max",e,!1,tn.errorUtil.toString(n))}setLimit(e,n,l,I){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:l,message:tn.errorUtil.toString(I)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tn.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tn.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tn.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tn.errorUtil.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:tn.errorUtil.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew C1({checks:[],typeName:jn.ZodBigInt,coerce:t?.coerce??!1,...xl(t)});var L1=class extends jl{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==st.ZodParsedType.boolean){let l=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.boolean,received:l.parsedType}),Ye.INVALID}return(0,Ye.OK)(e.data)}};Ve.ZodBoolean=L1;L1.create=t=>new L1({typeName:jn.ZodBoolean,coerce:t?.coerce||!1,...xl(t)});var k1=class t extends jl{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==st.ZodParsedType.date){let a=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(a,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.date,received:a.parsedType}),Ye.INVALID}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(a,{code:It.ZodIssueCode.invalid_date}),Ye.INVALID}let l=new Ye.ParseStatus,I;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(I=this._getOrReturnCtx(e,I),(0,Ye.addIssueToContext)(I,{code:It.ZodIssueCode.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),l.dirty()):st.util.assertNever(a);return{status:l.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:tn.errorUtil.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:tn.errorUtil.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew k1({checks:[],coerce:t?.coerce||!1,typeName:jn.ZodDate,...xl(t)});var Xj=class extends jl{_parse(e){if(this._getType(e)!==st.ZodParsedType.symbol){let l=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.symbol,received:l.parsedType}),Ye.INVALID}return(0,Ye.OK)(e.data)}};Ve.ZodSymbol=Xj;Xj.create=t=>new Xj({typeName:jn.ZodSymbol,...xl(t)});var x1=class extends jl{_parse(e){if(this._getType(e)!==st.ZodParsedType.undefined){let l=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.undefined,received:l.parsedType}),Ye.INVALID}return(0,Ye.OK)(e.data)}};Ve.ZodUndefined=x1;x1.create=t=>new x1({typeName:jn.ZodUndefined,...xl(t)});var j1=class extends jl{_parse(e){if(this._getType(e)!==st.ZodParsedType.null){let l=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.null,received:l.parsedType}),Ye.INVALID}return(0,Ye.OK)(e.data)}};Ve.ZodNull=j1;j1.create=t=>new j1({typeName:jn.ZodNull,...xl(t)});var jX=class extends jl{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,Ye.OK)(e.data)}};Ve.ZodAny=jX;jX.create=t=>new jX({typeName:jn.ZodAny,...xl(t)});var u0=class extends jl{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,Ye.OK)(e.data)}};Ve.ZodUnknown=u0;u0.create=t=>new u0({typeName:jn.ZodUnknown,...xl(t)});var jV=class extends jl{_parse(e){let n=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.never,received:n.parsedType}),Ye.INVALID}};Ve.ZodNever=jV;jV.create=t=>new jV({typeName:jn.ZodNever,...xl(t)});var wj=class extends jl{_parse(e){if(this._getType(e)!==st.ZodParsedType.undefined){let l=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.void,received:l.parsedType}),Ye.INVALID}return(0,Ye.OK)(e.data)}};Ve.ZodVoid=wj;wj.create=t=>new wj({typeName:jn.ZodVoid,...xl(t)});var d0=class t extends jl{_parse(e){let{ctx:n,status:l}=this._processInputParams(e),I=this._def;if(n.parsedType!==st.ZodParsedType.array)return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.array,received:n.parsedType}),Ye.INVALID;if(I.exactLength!==null){let c=n.data.length>I.exactLength.value,i=n.data.lengthI.maxLength.value&&((0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.too_big,maximum:I.maxLength.value,type:"array",inclusive:!0,exact:!1,message:I.maxLength.message}),l.dirty()),n.common.async)return Promise.all([...n.data].map((c,i)=>I.type._parseAsync(new LW(n,c,n.path,i)))).then(c=>Ye.ParseStatus.mergeArray(l,c));let a=[...n.data].map((c,i)=>I.type._parseSync(new LW(n,c,n.path,i)));return Ye.ParseStatus.mergeArray(l,a)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:tn.errorUtil.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:tn.errorUtil.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:tn.errorUtil.toString(n)}})}nonempty(e){return this.min(1,e)}};Ve.ZodArray=d0;d0.create=(t,e)=>new d0({type:t,minLength:null,maxLength:null,exactLength:null,typeName:jn.ZodArray,...xl(e)});function fj(t){if(t instanceof Hp){let e={};for(let n in t.shape){let l=t.shape[n];e[n]=CW.create(fj(l))}return new Hp({...t._def,shape:()=>e})}else return t instanceof d0?new d0({...t._def,type:fj(t.element)}):t instanceof CW?CW.create(fj(t.unwrap())):t instanceof uR?uR.create(fj(t.unwrap())):t instanceof sR?sR.create(t.items.map(e=>fj(e))):t}var Hp=class t extends jl{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=st.util.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==st.ZodParsedType.object){let r=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(r,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.object,received:r.parsedType}),Ye.INVALID}let{status:l,ctx:I}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof jV&&this._def.unknownKeys==="strip"))for(let r in I.data)c.includes(r)||i.push(r);let s=[];for(let r of c){let u=a[r],o=I.data[r];s.push({key:{status:"valid",value:r},value:u._parse(new LW(I,o,I.path,r)),alwaysSet:r in I.data})}if(this._def.catchall instanceof jV){let r=this._def.unknownKeys;if(r==="passthrough")for(let u of i)s.push({key:{status:"valid",value:u},value:{status:"valid",value:I.data[u]}});else if(r==="strict")i.length>0&&((0,Ye.addIssueToContext)(I,{code:It.ZodIssueCode.unrecognized_keys,keys:i}),l.dirty());else if(r!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let r=this._def.catchall;for(let u of i){let o=I.data[u];s.push({key:{status:"valid",value:u},value:r._parse(new LW(I,o,I.path,u)),alwaysSet:u in I.data})}}return I.common.async?Promise.resolve().then(async()=>{let r=[];for(let u of s){let o=await u.key,d=await u.value;r.push({key:o,value:d,alwaysSet:u.alwaysSet})}return r}).then(r=>Ye.ParseStatus.mergeObjectSync(l,r)):Ye.ParseStatus.mergeObjectSync(l,s)}get shape(){return this._def.shape()}strict(e){return tn.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,l)=>{let I=this._def.errorMap?.(n,l).message??l.defaultError;return n.code==="unrecognized_keys"?{message:tn.errorUtil.errToObj(e).message??I}:{message:I}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:jn.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let l of st.util.objectKeys(e))e[l]&&this.shape[l]&&(n[l]=this.shape[l]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let l of st.util.objectKeys(this.shape))e[l]||(n[l]=this.shape[l]);return new t({...this._def,shape:()=>n})}deepPartial(){return fj(this)}partial(e){let n={};for(let l of st.util.objectKeys(this.shape)){let I=this.shape[l];e&&!e[l]?n[l]=I:n[l]=I.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let l of st.util.objectKeys(this.shape))if(e&&!e[l])n[l]=this.shape[l];else{let a=this.shape[l];for(;a instanceof CW;)a=a._def.innerType;n[l]=a}return new t({...this._def,shape:()=>n})}keyof(){return j4t(st.util.objectKeys(this.shape))}};Ve.ZodObject=Hp;Hp.create=(t,e)=>new Hp({shape:()=>t,unknownKeys:"strip",catchall:jV.create(),typeName:jn.ZodObject,...xl(e)});Hp.strictCreate=(t,e)=>new Hp({shape:()=>t,unknownKeys:"strict",catchall:jV.create(),typeName:jn.ZodObject,...xl(e)});Hp.lazycreate=(t,e)=>new Hp({shape:t,unknownKeys:"strip",catchall:jV.create(),typeName:jn.ZodObject,...xl(e)});var O1=class extends jl{_parse(e){let{ctx:n}=this._processInputParams(e),l=this._def.options;function I(a){for(let i of a)if(i.result.status==="valid")return i.result;for(let i of a)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;let c=a.map(i=>new It.ZodError(i.ctx.common.issues));return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_union,unionErrors:c}),Ye.INVALID}if(n.common.async)return Promise.all(l.map(async a=>{let c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(I);{let a,c=[];for(let s of l){let r={...n,common:{...n.common,issues:[]},parent:null},u=s._parseSync({data:n.data,path:n.path,parent:r});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:r}),r.common.issues.length&&c.push(r.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let i=c.map(s=>new It.ZodError(s));return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_union,unionErrors:i}),Ye.INVALID}}get options(){return this._def.options}};Ve.ZodUnion=O1;O1.create=(t,e)=>new O1({options:t,typeName:jn.ZodUnion,...xl(e)});var s0=t=>t instanceof z1?s0(t.schema):t instanceof eZ?s0(t.innerType()):t instanceof B1?[t.value]:t instanceof S1?t.options:t instanceof M1?st.util.objectValues(t.enum):t instanceof T1?s0(t._def.innerType):t instanceof x1?[void 0]:t instanceof j1?[null]:t instanceof CW?[void 0,...s0(t.unwrap())]:t instanceof uR?[null,...s0(t.unwrap())]:t instanceof KK||t instanceof K1?s0(t.unwrap()):t instanceof D1?s0(t._def.innerType):[],Tue=class t extends jl{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==st.ZodParsedType.object)return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.object,received:n.parsedType}),Ye.INVALID;let l=this.discriminator,I=n.data[l],a=this.optionsMap.get(I);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):((0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),Ye.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,l){let I=new Map;for(let a of n){let c=s0(a.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of c){if(I.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);I.set(i,a)}}return new t({typeName:jn.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:I,...xl(l)})}};Ve.ZodDiscriminatedUnion=Tue;function sUe(t,e){let n=(0,st.getParsedType)(t),l=(0,st.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(n===st.ZodParsedType.object&&l===st.ZodParsedType.object){let I=st.util.objectKeys(e),a=st.util.objectKeys(t).filter(i=>I.indexOf(i)!==-1),c={...t,...e};for(let i of a){let s=sUe(t[i],e[i]);if(!s.valid)return{valid:!1};c[i]=s.data}return{valid:!0,data:c}}else if(n===st.ZodParsedType.array&&l===st.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let I=[];for(let a=0;a{if((0,Ye.isAborted)(a)||(0,Ye.isAborted)(c))return Ye.INVALID;let i=sUe(a.value,c.value);return i.valid?(((0,Ye.isDirty)(a)||(0,Ye.isDirty)(c))&&n.dirty(),{status:n.value,value:i.data}):((0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_intersection_types}),Ye.INVALID)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([a,c])=>I(a,c)):I(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}};Ve.ZodIntersection=U1;U1.create=(t,e,n)=>new U1({left:t,right:e,typeName:jn.ZodIntersection,...xl(n)});var sR=class t extends jl{_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==st.ZodParsedType.array)return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.array,received:l.parsedType}),Ye.INVALID;if(l.data.lengththis._def.items.length&&((0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...l.data].map((c,i)=>{let s=this._def.items[i]||this._def.rest;return s?s._parse(new LW(l,c,l.path,i)):null}).filter(c=>!!c);return l.common.async?Promise.all(a).then(c=>Ye.ParseStatus.mergeArray(n,c)):Ye.ParseStatus.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ve.ZodTuple=sR;sR.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sR({items:t,typeName:jn.ZodTuple,rest:null,...xl(e)})};var Due=class t extends jl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==st.ZodParsedType.object)return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.object,received:l.parsedType}),Ye.INVALID;let I=[],a=this._def.keyType,c=this._def.valueType;for(let i in l.data)I.push({key:a._parse(new LW(l,i,l.path,i)),value:c._parse(new LW(l,l.data[i],l.path,i)),alwaysSet:i in l.data});return l.common.async?Ye.ParseStatus.mergeObjectAsync(n,I):Ye.ParseStatus.mergeObjectSync(n,I)}get element(){return this._def.valueType}static create(e,n,l){return n instanceof jl?new t({keyType:e,valueType:n,typeName:jn.ZodRecord,...xl(l)}):new t({keyType:xX.create(),valueType:e,typeName:jn.ZodRecord,...xl(n)})}};Ve.ZodRecord=Due;var Hj=class extends jl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==st.ZodParsedType.map)return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.map,received:l.parsedType}),Ye.INVALID;let I=this._def.keyType,a=this._def.valueType,c=[...l.data.entries()].map(([i,s],r)=>({key:I._parse(new LW(l,i,l.path,[r,"key"])),value:a._parse(new LW(l,s,l.path,[r,"value"]))}));if(l.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let s of c){let r=await s.key,u=await s.value;if(r.status==="aborted"||u.status==="aborted")return Ye.INVALID;(r.status==="dirty"||u.status==="dirty")&&n.dirty(),i.set(r.value,u.value)}return{status:n.value,value:i}})}else{let i=new Map;for(let s of c){let r=s.key,u=s.value;if(r.status==="aborted"||u.status==="aborted")return Ye.INVALID;(r.status==="dirty"||u.status==="dirty")&&n.dirty(),i.set(r.value,u.value)}return{status:n.value,value:i}}}};Ve.ZodMap=Hj;Hj.create=(t,e,n)=>new Hj({valueType:e,keyType:t,typeName:jn.ZodMap,...xl(n)});var Qj=class t extends jl{_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.parsedType!==st.ZodParsedType.set)return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.set,received:l.parsedType}),Ye.INVALID;let I=this._def;I.minSize!==null&&l.data.sizeI.maxSize.value&&((0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.too_big,maximum:I.maxSize.value,type:"set",inclusive:!0,exact:!1,message:I.maxSize.message}),n.dirty());let a=this._def.valueType;function c(s){let r=new Set;for(let u of s){if(u.status==="aborted")return Ye.INVALID;u.status==="dirty"&&n.dirty(),r.add(u.value)}return{status:n.value,value:r}}let i=[...l.data.values()].map((s,r)=>a._parse(new LW(l,s,l.path,r)));return l.common.async?Promise.all(i).then(s=>c(s)):c(i)}min(e,n){return new t({...this._def,minSize:{value:e,message:tn.errorUtil.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:tn.errorUtil.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ve.ZodSet=Qj;Qj.create=(t,e)=>new Qj({valueType:t,minSize:null,maxSize:null,typeName:jn.ZodSet,...xl(e)});var Kue=class t extends jl{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==st.ZodParsedType.function)return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.function,received:n.parsedType}),Ye.INVALID;function l(i,s){return(0,Ye.makeIssue)({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,(0,Mue.getErrorMap)(),Mue.defaultErrorMap].filter(r=>!!r),issueData:{code:It.ZodIssueCode.invalid_arguments,argumentsError:s}})}function I(i,s){return(0,Ye.makeIssue)({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,(0,Mue.getErrorMap)(),Mue.defaultErrorMap].filter(r=>!!r),issueData:{code:It.ZodIssueCode.invalid_return_type,returnTypeError:s}})}let a={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof OX){let i=this;return(0,Ye.OK)(async function(...s){let r=new It.ZodError([]),u=await i._def.args.parseAsync(s,a).catch(b=>{throw r.addIssue(l(s,b)),r}),o=await Reflect.apply(c,this,u);return await i._def.returns._def.type.parseAsync(o,a).catch(b=>{throw r.addIssue(I(o,b)),r})})}else{let i=this;return(0,Ye.OK)(function(...s){let r=i._def.args.safeParse(s,a);if(!r.success)throw new It.ZodError([l(s,r.error)]);let u=Reflect.apply(c,this,r.data),o=i._def.returns.safeParse(u,a);if(!o.success)throw new It.ZodError([I(u,o.error)]);return o.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:sR.create(e).rest(u0.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,l){return new t({args:e||sR.create([]).rest(u0.create()),returns:n||u0.create(),typeName:jn.ZodFunction,...xl(l)})}};Ve.ZodFunction=Kue;var z1=class extends jl{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ve.ZodLazy=z1;z1.create=(t,e)=>new z1({getter:t,typeName:jn.ZodLazy,...xl(e)});var B1=class extends jl{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(n,{received:n.data,code:It.ZodIssueCode.invalid_literal,expected:this._def.value}),Ye.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ve.ZodLiteral=B1;B1.create=(t,e)=>new B1({value:t,typeName:jn.ZodLiteral,...xl(e)});function j4t(t,e){return new S1({values:t,typeName:jn.ZodEnum,...xl(e)})}var S1=class t extends jl{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),l=this._def.values;return(0,Ye.addIssueToContext)(n,{expected:st.util.joinValues(l),received:n.parsedType,code:It.ZodIssueCode.invalid_type}),Ye.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),l=this._def.values;return(0,Ye.addIssueToContext)(n,{received:n.data,code:It.ZodIssueCode.invalid_enum_value,options:l}),Ye.INVALID}return(0,Ye.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(l=>!e.includes(l)),{...this._def,...n})}};Ve.ZodEnum=S1;S1.create=j4t;var M1=class extends jl{_parse(e){let n=st.util.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(e);if(l.parsedType!==st.ZodParsedType.string&&l.parsedType!==st.ZodParsedType.number){let I=st.util.objectValues(n);return(0,Ye.addIssueToContext)(l,{expected:st.util.joinValues(I),received:l.parsedType,code:It.ZodIssueCode.invalid_type}),Ye.INVALID}if(this._cache||(this._cache=new Set(st.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let I=st.util.objectValues(n);return(0,Ye.addIssueToContext)(l,{received:l.data,code:It.ZodIssueCode.invalid_enum_value,options:I}),Ye.INVALID}return(0,Ye.OK)(e.data)}get enum(){return this._def.values}};Ve.ZodNativeEnum=M1;M1.create=(t,e)=>new M1({values:t,typeName:jn.ZodNativeEnum,...xl(e)});var OX=class extends jl{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==st.ZodParsedType.promise&&n.common.async===!1)return(0,Ye.addIssueToContext)(n,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.promise,received:n.parsedType}),Ye.INVALID;let l=n.parsedType===st.ZodParsedType.promise?n.data:Promise.resolve(n.data);return(0,Ye.OK)(l.then(I=>this._def.type.parseAsync(I,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Ve.ZodPromise=OX;OX.create=(t,e)=>new OX({type:t,typeName:jn.ZodPromise,...xl(e)});var eZ=class extends jl{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===jn.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:l}=this._processInputParams(e),I=this._def.effect||null,a={addIssue:c=>{(0,Ye.addIssueToContext)(l,c),c.fatal?n.abort():n.dirty()},get path(){return l.path}};if(a.addIssue=a.addIssue.bind(a),I.type==="preprocess"){let c=I.transform(l.data,a);if(l.common.async)return Promise.resolve(c).then(async i=>{if(n.value==="aborted")return Ye.INVALID;let s=await this._def.schema._parseAsync({data:i,path:l.path,parent:l});return s.status==="aborted"?Ye.INVALID:s.status==="dirty"||n.value==="dirty"?(0,Ye.DIRTY)(s.value):s});{if(n.value==="aborted")return Ye.INVALID;let i=this._def.schema._parseSync({data:c,path:l.path,parent:l});return i.status==="aborted"?Ye.INVALID:i.status==="dirty"||n.value==="dirty"?(0,Ye.DIRTY)(i.value):i}}if(I.type==="refinement"){let c=i=>{let s=I.refinement(i,a);if(l.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(l.common.async===!1){let i=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return i.status==="aborted"?Ye.INVALID:(i.status==="dirty"&&n.dirty(),c(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(i=>i.status==="aborted"?Ye.INVALID:(i.status==="dirty"&&n.dirty(),c(i.value).then(()=>({status:n.value,value:i.value}))))}if(I.type==="transform")if(l.common.async===!1){let c=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!(0,Ye.isValid)(c))return Ye.INVALID;let i=I.transform(c.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:i}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(c=>(0,Ye.isValid)(c)?Promise.resolve(I.transform(c.value,a)).then(i=>({status:n.value,value:i})):Ye.INVALID);st.util.assertNever(I)}};Ve.ZodEffects=eZ;Ve.ZodTransformer=eZ;eZ.create=(t,e,n)=>new eZ({schema:t,typeName:jn.ZodEffects,effect:e,...xl(n)});eZ.createWithPreprocess=(t,e,n)=>new eZ({schema:e,effect:{type:"preprocess",transform:t},typeName:jn.ZodEffects,...xl(n)});var CW=class extends jl{_parse(e){return this._getType(e)===st.ZodParsedType.undefined?(0,Ye.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ve.ZodOptional=CW;CW.create=(t,e)=>new CW({innerType:t,typeName:jn.ZodOptional,...xl(e)});var uR=class extends jl{_parse(e){return this._getType(e)===st.ZodParsedType.null?(0,Ye.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ve.ZodNullable=uR;uR.create=(t,e)=>new uR({innerType:t,typeName:jn.ZodNullable,...xl(e)});var T1=class extends jl{_parse(e){let{ctx:n}=this._processInputParams(e),l=n.data;return n.parsedType===st.ZodParsedType.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ve.ZodDefault=T1;T1.create=(t,e)=>new T1({innerType:t,typeName:jn.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...xl(e)});var D1=class extends jl{_parse(e){let{ctx:n}=this._processInputParams(e),l={...n,common:{...n.common,issues:[]}},I=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return(0,Ye.isAsync)(I)?I.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new It.ZodError(l.common.issues)},input:l.data})})):{status:"valid",value:I.status==="valid"?I.value:this._def.catchValue({get error(){return new It.ZodError(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}};Ve.ZodCatch=D1;D1.create=(t,e)=>new D1({innerType:t,typeName:jn.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...xl(e)});var Ej=class extends jl{_parse(e){if(this._getType(e)!==st.ZodParsedType.nan){let l=this._getOrReturnCtx(e);return(0,Ye.addIssueToContext)(l,{code:It.ZodIssueCode.invalid_type,expected:st.ZodParsedType.nan,received:l.parsedType}),Ye.INVALID}return{status:"valid",value:e.data}}};Ve.ZodNaN=Ej;Ej.create=t=>new Ej({typeName:jn.ZodNaN,...xl(t)});Ve.BRAND=Symbol("zod_brand");var KK=class extends jl{_parse(e){let{ctx:n}=this._processInputParams(e),l=n.data;return this._def.type._parse({data:l,path:n.path,parent:n})}unwrap(){return this._def.type}};Ve.ZodBranded=KK;var _K=class t extends jl{_parse(e){let{status:n,ctx:l}=this._processInputParams(e);if(l.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return a.status==="aborted"?Ye.INVALID:a.status==="dirty"?(n.dirty(),(0,Ye.DIRTY)(a.value)):this._def.out._parseAsync({data:a.value,path:l.path,parent:l})})();{let I=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return I.status==="aborted"?Ye.INVALID:I.status==="dirty"?(n.dirty(),{status:"dirty",value:I.value}):this._def.out._parseSync({data:I.value,path:l.path,parent:l})}}static create(e,n){return new t({in:e,out:n,typeName:jn.ZodPipeline})}};Ve.ZodPipeline=_K;var K1=class extends jl{_parse(e){let n=this._def.innerType._parse(e),l=I=>((0,Ye.isValid)(I)&&(I.value=Object.freeze(I.value)),I);return(0,Ye.isAsync)(n)?n.then(I=>l(I)):l(n)}unwrap(){return this._def.innerType}};Ve.ZodReadonly=K1;K1.create=(t,e)=>new K1({innerType:t,typeName:jn.ZodReadonly,...xl(e)});function C4t(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function O4t(t,e={},n){return t?jX.create().superRefine((l,I)=>{let a=t(l);if(a instanceof Promise)return a.then(c=>{if(!c){let i=C4t(e,l),s=i.fatal??n??!0;I.addIssue({code:"custom",...i,fatal:s})}});if(!a){let c=C4t(e,l),i=c.fatal??n??!0;I.addIssue({code:"custom",...c,fatal:i})}}):jX.create()}Ve.late={object:Hp.lazycreate};var jn;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(jn||(Ve.ZodFirstPartyTypeKind=jn={}));var mHl=(t,e={message:`Input not instance of ${t.name}`})=>O4t(n=>n instanceof t,e);Ve.instanceof=mHl;var U4t=xX.create;Ve.string=U4t;var z4t=J1.create;Ve.number=z4t;var pHl=Ej.create;Ve.nan=pHl;var hHl=C1.create;Ve.bigint=hHl;var B4t=L1.create;Ve.boolean=B4t;var ZHl=k1.create;Ve.date=ZHl;var WHl=Xj.create;Ve.symbol=WHl;var NHl=x1.create;Ve.undefined=NHl;var VHl=j1.create;Ve.null=VHl;var YHl=jX.create;Ve.any=YHl;var gHl=u0.create;Ve.unknown=gHl;var RHl=jV.create;Ve.never=RHl;var yHl=wj.create;Ve.void=yHl;var AHl=d0.create;Ve.array=AHl;var FHl=Hp.create;Ve.object=FHl;var vHl=Hp.strictCreate;Ve.strictObject=vHl;var fHl=O1.create;Ve.union=fHl;var XHl=Tue.create;Ve.discriminatedUnion=XHl;var wHl=U1.create;Ve.intersection=wHl;var HHl=sR.create;Ve.tuple=HHl;var QHl=Due.create;Ve.record=QHl;var EHl=Hj.create;Ve.map=EHl;var JHl=Qj.create;Ve.set=JHl;var CHl=Kue.create;Ve.function=CHl;var LHl=z1.create;Ve.lazy=LHl;var kHl=B1.create;Ve.literal=kHl;var xHl=S1.create;Ve.enum=xHl;var jHl=M1.create;Ve.nativeEnum=jHl;var OHl=OX.create;Ve.promise=OHl;var S4t=eZ.create;Ve.effect=S4t;Ve.transformer=S4t;var UHl=CW.create;Ve.optional=UHl;var zHl=uR.create;Ve.nullable=zHl;var BHl=eZ.createWithPreprocess;Ve.preprocess=BHl;var SHl=_K.create;Ve.pipeline=SHl;var MHl=()=>U4t().optional();Ve.ostring=MHl;var THl=()=>z4t().optional();Ve.onumber=THl;var DHl=()=>B4t().optional();Ve.oboolean=DHl;Ve.coerce={string:t=>xX.create({...t,coerce:!0}),number:t=>J1.create({...t,coerce:!0}),boolean:t=>L1.create({...t,coerce:!0}),bigint:t=>C1.create({...t,coerce:!0}),date:t=>k1.create({...t,coerce:!0})};Ve.NEVER=Ye.INVALID});var uUe=f(kW=>{"use strict";var KHl=kW&&kW.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Jj=kW&&kW.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&KHl(e,t,n)};Object.defineProperty(kW,"__esModule",{value:!0});Jj(Bue(),kW);Jj(oUe(),kW);Jj(H4t(),kW);Jj(TK(),kW);Jj(M4t(),kW);Jj(zue(),kW)});var se=f(Qp=>{"use strict";var T4t=Qp&&Qp.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),_Hl=Qp&&Qp.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),PHl=Qp&&Qp.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&T4t(e,t,n);return _Hl(e,t),e},qHl=Qp&&Qp.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&T4t(e,t,n)};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.z=void 0;var D4t=PHl(uUe());Qp.z=D4t;qHl(uUe(),Qp);Qp.default=D4t});var bUe=f(Qd=>{"use strict";var $Hl=Qd&&Qd.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),eQl=Qd&&Qd.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tQl=Qd&&Qd.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&$Hl(e,t,n);return eQl(e,t),e};Object.defineProperty(Qd,"__esModule",{value:!0});Qd.zodInbound=Qd.zodOutbound=void 0;Qd.bytesToBase64=K4t;Qd.bytesFromBase64=dUe;Qd.stringToBytes=GUe;Qd.stringFromBytes=_4t;Qd.stringToBase64=nQl;Qd.stringFromBase64=lQl;var _ue=tQl(se());function K4t(t){return btoa(String.fromCodePoint(...t))}function dUe(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}function GUe(t){return new TextEncoder().encode(t)}function _4t(t){return new TextDecoder().decode(t)}function nQl(t){return K4t(GUe(t))}function lQl(t){return _4t(dUe(t))}Qd.zodOutbound=_ue.instanceof(Uint8Array).or(_ue.string().transform(GUe));Qd.zodInbound=_ue.instanceof(Uint8Array).or(_ue.string().transform(dUe))});var pUe=f(mUe=>{"use strict";Object.defineProperty(mUe,"__esModule",{value:!0});mUe.isPlainObject=IQl;function IQl(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}});var kt=f(JI=>{"use strict";Object.defineProperty(JI,"__esModule",{value:!0});JI.encodeDeepObjectQuery=JI.encodePipeDelimitedQuery=JI.encodeSpaceDelimitedQuery=JI.encodeFormQuery=JI.encodeJSONQuery=JI.encodeSimple=JI.encodePipeDelimited=JI.encodeSpaceDelimited=JI.encodeForm=JI.EncodingError=void 0;JI.encodeMatrix=aQl;JI.encodeLabel=rQl;JI.encodeBodyForm=cQl;JI.encodeDeepObject=q4t;JI.encodeDeepObjectObject=ZUe;JI.encodeJSON=$4t;JI.queryJoin=ejt;JI.queryEncoder=Lj;JI.appendForm=iQl;var P4t=bUe(),OV=pUe(),PK=class extends Error{constructor(e){super(e),this.name="EncodingError"}};JI.EncodingError=PK;function aQl(t,e,n){let l="",I=n?.explode?qK(t,e):[[t,e]];if(I.every(([i,s])=>s==null))return;let a=i=>n?.charEncoding==="percent"?encodeURIComponent(i):i,c=i=>a(Cj(i));return I.forEach(([i,s])=>{let r="",u=null;if(s==null||(Array.isArray(s)?u=$K(s,d=>`${c(d)}`)?.join(","):(0,OV.isPlainObject)(s)?u=que(Object.entries(s),([b,h])=>`,${a(b)},${c(h)}`)?.join("").slice(1):u=`${c(s)}`,u==null))return;let o=a(i);r=`${o}=${u}`,r===`${o}=`&&(r=r.slice(0,-1)),r&&(l+=`;${r}`)}),l}function rQl(t,e,n){let l="",I=n?.explode?qK(t,e):[[t,e]];if(I.every(([i,s])=>s==null))return;let a=i=>n?.charEncoding==="percent"?encodeURIComponent(i):i,c=i=>a(Cj(i));return I.forEach(([i,s])=>{let r="";s!=null&&(Array.isArray(s)?r=$K(s,u=>`${c(u)}`)?.join("."):(0,OV.isPlainObject)(s)?r=que(Object.entries(s),([o,d])=>`.${a(o)}.${c(d)}`)?.join("").slice(1):r=`${n?.explode&&(0,OV.isPlainObject)(e)?`${a(i)}=`:""}${c(s)}`,l+=r==null?"":`.${r}`)}),l}function hUe(t){return(e,n,l)=>{let I="",a=l?.explode?qK(e,n):[[e,n]];if(a.every(([r,u])=>u==null))return;let c=r=>l?.charEncoding==="percent"?encodeURIComponent(r):r,i=r=>c(Cj(r)),s=c(t);return a.forEach(([r,u])=>{let o="",d=null;u!=null&&(Array.isArray(u)?d=$K(u,b=>`${i(b)}`)?.join(s):(0,OV.isPlainObject)(u)?d=que(Object.entries(u),([b,h])=>`${c(b)}${s}${i(h)}`)?.join(s):d=`${i(u)}`,d!=null&&(o=`${c(r)}=${d}`,!(!o||o==="=")&&(I+=`&${o}`)))}),I.slice(1)}}JI.encodeForm=hUe(",");JI.encodeSpaceDelimited=hUe(" ");JI.encodePipeDelimited=hUe("|");function cQl(t,e,n){let l="",I=n?.explode?qK(t,e):[[t,e]],a=i=>n?.charEncoding==="percent"?encodeURIComponent(i):i,c=i=>a(Cj(i));return I.forEach(([i,s])=>{let r="",u="";s!=null&&(Array.isArray(s)||(0,OV.isPlainObject)(s)?u=JSON.stringify(s,Pue):u=`${c(s)}`,r=`${a(i)}=${u}`,!(!r||r==="=")&&(l+=`&${r}`))}),l.slice(1)}function q4t(t,e,n){if(e!=null){if(!(0,OV.isPlainObject)(e))throw new PK(`Value of parameter '${t}' which uses deepObject encoding must be an object or null`);return ZUe(t,e,n)}}function ZUe(t,e,n){if(e==null)return;let l="",I=a=>n?.charEncoding==="percent"?encodeURIComponent(a):a;if(!(0,OV.isPlainObject)(e))throw new PK(`Expected parameter '${t}' to be an object.`);return Object.entries(e).forEach(([a,c])=>{if(c==null)return;let i=`${t}[${a}]`;if((0,OV.isPlainObject)(c)){let u=ZUe(i,c,n);l+=u==null?"":`&${u}`;return}let s=Array.isArray(c)?c:[c],r=$K(s,u=>`${I(i)}=${I(Cj(u))}`)?.join("&");l+=r==null?"":`&${r}`}),l.slice(1)}function $4t(t,e,n){if(typeof e>"u")return;let l=a=>n?.charEncoding==="percent"?encodeURIComponent(a):a,I=l(JSON.stringify(e,Pue));return n?.explode?I:`${l(t)}=${I}`}var oQl=(t,e,n)=>{let l="",I=n?.explode?qK(t,e):[[t,e]];if(I.every(([i,s])=>s==null))return;let a=i=>n?.charEncoding==="percent"?encodeURIComponent(i):i,c=i=>a(Cj(i));return I.forEach(([i,s])=>{let r="";s!=null&&(Array.isArray(s)?r=$K(s,u=>`${c(u)}`)?.join(","):(0,OV.isPlainObject)(s)?r=que(Object.entries(s),([o,d])=>`,${a(o)},${c(d)}`)?.join("").slice(1):r=`${n?.explode&&(0,OV.isPlainObject)(e)?`${i}=`:""}${c(s)}`,l+=r?`,${r}`:"")}),l.slice(1)};JI.encodeSimple=oQl;function qK(t,e){return Array.isArray(e)?e.map(n=>[t,n]):(0,OV.isPlainObject)(e)?Object.entries(e??{}).map(([l,I])=>[l,I]):[[t,e]]}function Cj(t){return t==null?"":t instanceof Date?t.toISOString():t instanceof Uint8Array?(0,P4t.bytesToBase64)(t):typeof t=="object"?JSON.stringify(t,Pue):`${t}`}function Pue(t,e){return e instanceof Uint8Array?(0,P4t.bytesToBase64)(e):e}function $K(t,e){let n=t.reduce((l,I)=>{if(I==null)return l;let a=e(I);return a==null||l.push(a),l},[]);return n.length?n:null}function que(t,e){let n=[];for(let[l,I]of t){if(I==null)continue;let a=e([l,I]);a!=null&&n.push(a)}return n.length?n:null}function ejt(...t){return t.filter(Boolean).join("&")}function Lj(t){return function(n,l){let I={...l,explode:l?.explode??!0,charEncoding:l?.charEncoding??"percent"},a=Object.entries(n).map(([c,i])=>t(c,i,I));return ejt(...a)}}JI.encodeJSONQuery=Lj($4t);JI.encodeFormQuery=Lj(JI.encodeForm);JI.encodeSpaceDelimitedQuery=Lj(JI.encodeSpaceDelimited);JI.encodePipeDelimitedQuery=Lj(JI.encodePipeDelimited);JI.encodeDeepObjectQuery=Lj(q4t);function iQl(t,e,n,l){n!=null&&(n instanceof Blob&&l?t.append(e,n,l):n instanceof Blob?t.append(e,n):t.append(e,String(n)))}});var tjt=f(WUe=>{"use strict";Object.defineProperty(WUe,"__esModule",{value:!0});WUe.dlv=sQl;function sQl(t,e,n,l,I){for(e=Array.isArray(e)?e:e.split("."),l=0;l{"use strict";var uQl=tZ&&tZ.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),dQl=tZ&&tZ.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),GQl=tZ&&tZ.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&uQl(e,t,n);return dQl(e,t),e};Object.defineProperty(tZ,"__esModule",{value:!0});tZ.envSchema=void 0;tZ.env=bQl;tZ.resetEnv=mQl;var njt=tjt(),NUe=GQl(se());tZ.envSchema=NUe.object({MISTRAL_API_KEY:NUe.string().optional(),MISTRAL_DEBUG:NUe.coerce.boolean().optional()});var e_;function bQl(){return e_||(e_=tZ.envSchema.parse((0,njt.dlv)(globalThis,"process.env")??(0,njt.dlv)(globalThis,"Deno.env")??{}),e_)}function mQl(){e_=void 0}});var _1=f(dR=>{"use strict";Object.defineProperty(dR,"__esModule",{value:!0});dR.HTTPClient=void 0;dR.matchContentType=Ijt;dR.matchStatusCode=ajt;dR.matchResponse=ZQl;dR.isConnectionError=WQl;dR.isTimeoutError=NQl;dR.isAbortError=VQl;var pQl=(t,e)=>e==null?fetch(t):fetch(t,e),YUe=class t{constructor(e={}){this.options=e,this.requestHooks=[],this.requestErrorHooks=[],this.responseHooks=[],this.fetcher=e.fetcher||pQl}async request(e){let n=e;for(let l of this.requestHooks){let I=await l(n);I&&(n=I)}try{let l=await this.fetcher(n);for(let I of this.responseHooks)await I(l,n);return l}catch(l){for(let I of this.requestErrorHooks)await I(l,n);throw l}}addHook(...e){if(e[0]==="beforeRequest")this.requestHooks.push(e[1]);else if(e[0]==="requestError")this.requestErrorHooks.push(e[1]);else if(e[0]==="response")this.responseHooks.push(e[1]);else throw new Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let n;if(e[0]==="beforeRequest")n=this.requestHooks;else if(e[0]==="requestError")n=this.requestErrorHooks;else if(e[0]==="response")n=this.responseHooks;else throw new Error(`Invalid hook type: ${e[0]}`);let l=n.findIndex(I=>I===e[1]);return l>=0&&n.splice(l,1),this}clone(){let e=new t(this.options);return e.requestHooks=this.requestHooks.slice(),e.requestErrorHooks=this.requestErrorHooks.slice(),e.responseHooks=this.responseHooks.slice(),e}};dR.HTTPClient=YUe;var ljt=/\s*;\s*/g;function Ijt(t,e){if(e==="*")return!0;let n=t.headers.get("content-type")?.trim()||"application/octet-stream";n=n.toLowerCase();let l=e.toLowerCase().trim().split(ljt),[I="",...a]=l;if(I.split("/").length!==2)return!1;let c=n.split(ljt),[i="",...s]=c,[r="",u=""]=i.split("/");if(!r||!u||I!=="*/*"&&i!==I&&`${r}/*`!==I&&`*/${u}`!==I||s.length{let a=`${I}`;if(a==="default")return!0;if(!hQl.test(`${a}`))return a===n;let c=a.charAt(0);if(!c)throw new Error("Invalid status code range");let i=n.charAt(0);if(!i)throw new Error(`Invalid response status code: ${n}`);return i===c}):!1}function ZQl(t,e,n){return ajt(t,e)&&Ijt(t,n)}function WQl(t){if(typeof t!="object"||t==null)return!1;let e=t instanceof TypeError&&t.message.toLowerCase().startsWith("failed to fetch"),n=t instanceof TypeError&&t.message.toLowerCase().startsWith("fetch failed"),l="name"in t&&t.name==="ConnectionError",I="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnreset";return e||n||I||l}function NQl(t){if(typeof t!="object"||t==null)return!1;let e="name"in t&&t.name==="TimeoutError",n="code"in t&&t.code===23,l="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnaborted";return e||n||l}function VQl(t){if(typeof t!="object"||t==null)return!1;let e="name"in t&&t.name==="AbortError",n="code"in t&&t.code===20,l="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnaborted";return e||n||l}});var cjt=f(q1=>{"use strict";Object.defineProperty(q1,"__esModule",{value:!0});q1.TemporaryError=q1.PermanentError=void 0;q1.retry=gQl;var rjt=_1(),YQl={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5},t_=class t extends Error{constructor(e,n){let l=e;n?.cause&&(l+=`: ${n.cause}`),super(l,n),this.name="PermanentError",typeof this.cause>"u"&&(this.cause=n?.cause),Object.setPrototypeOf(this,t.prototype)}};q1.PermanentError=t_;var P1=class t extends Error{constructor(e,n){super(e),this.response=n,this.name="TemporaryError",Object.setPrototypeOf(this,t.prototype)}};q1.TemporaryError=P1;async function gQl(t,e){switch(e.config.strategy){case"backoff":return FQl(RQl(t,{statusCodes:e.statusCodes,retryConnectionErrors:!!e.config.retryConnectionErrors}),e.config.backoff??YQl);default:return await t()}}function RQl(t,e){return async()=>{try{let n=await t();if(AQl(n,e.statusCodes))throw new P1("Response failed with retryable status code",n);return n}catch(n){throw n instanceof P1||e.retryConnectionErrors&&((0,rjt.isTimeoutError)(n)||(0,rjt.isConnectionError)(n))?n:new t_("Permanent error",{cause:n})}}}var yQl=new RegExp("^[0-9]xx$","i");function AQl(t,e){let n=`${t.status}`;return e.some(l=>{if(!yQl.test(l))return l===n;let I=l.charAt(0);if(!I)throw new Error("Invalid status code range");let a=n.charAt(0);if(!a)throw new Error(`Invalid response status code: ${n}`);return a===I})}async function FQl(t,e){let{maxElapsedTime:n,initialInterval:l,exponent:I,maxInterval:a}=e,c=Date.now(),i=0;for(;;)try{return await t()}catch(s){if(s instanceof t_)throw s.cause;if(Date.now()-c>n){if(s instanceof P1)return s.response;throw s}let u=0;s instanceof P1&&(u=vQl(s.response)),u<=0&&(u=l*Math.pow(i,I)+Math.random()*1e3);let o=Math.min(u,a);await fQl(o),i++}}function vQl(t){let e=t.headers.get("retry-after")||"";if(!e)return 0;let n=Number(e);if(Number.isInteger(n))return n*1e3;let l=Date.parse(e);if(Number.isInteger(l)){let I=l-Date.now();return I>0?Math.ceil(I):0}return 0}async function fQl(t){return new Promise(e=>setTimeout(e,t))}});var di=f(zX=>{"use strict";var n_=zX&&zX.__classPrivateFieldSet||function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},xW=zX&&zX.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},ede,GR,G0;Object.defineProperty(zX,"__esModule",{value:!0});zX.ClientSDK=void 0;var ojt=y4t(),kj=lUe(),UX=Hd(),XQl=bUe(),ijt=kue(),wQl=kt(),HQl=VUe(),b0=_1(),QQl=cjt(),$ue=typeof globalThis>"u"?null:globalThis,EQl=typeof $ue=="object"&&$ue!=null&&"importScripts"in $ue&&typeof $ue.importScripts=="function",JQl=EQl||typeof navigator<"u"&&"serviceWorker"in navigator||typeof window=="object"&&typeof window.document<"u",gUe=class{constructor(e={}){ede.set(this,void 0),GR.set(this,void 0),G0.set(this,void 0);let n=e;typeof n=="object"&&n!=null&&"hooks"in n&&n.hooks instanceof ojt.SDKHooks?n_(this,GR,n.hooks,"f"):n_(this,GR,new ojt.SDKHooks,"f"),this._options={...e,hooks:xW(this,GR,"f")};let l=(0,ijt.serverURLFromOptions)(e);l&&(l.pathname=l.pathname.replace(/\/+$/,"")+"/");let{baseURL:I,client:a}=xW(this,GR,"f").sdkInit({baseURL:l,client:e.httpClient||new b0.HTTPClient});this._baseURL=I,n_(this,ede,a,"f"),n_(this,G0,e.debugLogger,"f"),!xW(this,G0,"f")&&(0,HQl.env)().MISTRAL_DEBUG&&n_(this,G0,console,"f")}_createRequest(e,n,l){let{method:I,path:a,query:c,headers:i,security:s}=n,r=n.baseURL??this._baseURL;if(!r)return(0,UX.ERR)(new kj.InvalidRequestError("No base URL provided for operation"));let u=new URL(r),o=new URL(a,u);a&&(u.pathname+=u.pathname.endsWith("/")?"":"/",u.pathname+=o.pathname.replace(/^\/+/,""));let d=c||"",b=[];for(let[Q,L]of Object.entries(s?.queryParams||{})){let J=(0,wQl.encodeForm)(Q,L,{charEncoding:"percent"});typeof J<"u"&&b.push(J)}if(b.length&&(d+=`&${b.join("&")}`),d){let Q=d.startsWith("&")?d.slice(1):d;u.search=`?${Q}`}let h=new Headers(i),Z=s?.basic.username,N=s?.basic.password;if(Z!=null||N!=null){let Q=(0,XQl.stringToBase64)([Z||"",N||""].join(":"));h.set("Authorization",`Basic ${Q}`)}let g=new Headers(s?.headers||{});for(let[Q,L]of g)h.set(Q,L);let y=h.get("cookie")||"";for(let[Q,L]of Object.entries(s?.cookies||{}))y+=`; ${Q}=${L}`;y=y.startsWith("; ")?y.slice(2):y,h.set("cookie",y);let X=new Headers(l?.fetchOptions?.headers);for(let[Q,L]of X)h.set(Q,L);JQl||h.set(n.uaHeader??"user-agent",ijt.SDK_METADATA.userAgent);let v=l?.fetchOptions;if(!v?.signal&&n.timeoutMs&&n.timeoutMs>0){let Q=AbortSignal.timeout(n.timeoutMs);v?v.signal=Q:v={signal:Q}}n.body instanceof ReadableStream&&(v||(v={}),Object.assign(v,{duplex:"half"}));let H;try{H=xW(this,GR,"f").beforeCreateRequest(e,{url:u,options:{...v,body:n.body??null,headers:h,method:I}})}catch(Q){return(0,UX.ERR)(new kj.UnexpectedClientError("Create request hook failed to execute",{cause:Q}))}return(0,UX.OK)(new Request(H.url,H.options))}async _do(e,n){let{context:l,errorCodes:I}=n;return(0,QQl.retry)(async()=>{let a=await xW(this,GR,"f").beforeRequest(l,e.clone());await CQl(xW(this,G0,"f"),a).catch(i=>xW(this,G0,"f")?.log("Failed to log request:",i));let c=await xW(this,ede,"f").request(a);try{if((0,b0.matchStatusCode)(c,I)){let i=await xW(this,GR,"f").afterError(l,c,null);if(i.error)throw i.error;c=i.response||c}else c=await xW(this,GR,"f").afterSuccess(l,c)}finally{await LQl(xW(this,G0,"f"),c,a).catch(i=>xW(this,G0,"f")?.log("Failed to log response:",i))}return c},{config:n.retryConfig,statusCodes:n.retryCodes}).then(a=>(0,UX.OK)(a),a=>{switch(!0){case(0,b0.isAbortError)(a):return(0,UX.ERR)(new kj.RequestAbortedError("Request aborted by client",{cause:a}));case(0,b0.isTimeoutError)(a):return(0,UX.ERR)(new kj.RequestTimeoutError("Request timed out",{cause:a}));case(0,b0.isConnectionError)(a):return(0,UX.ERR)(new kj.ConnectionError("Unable to make request",{cause:a}));default:return(0,UX.ERR)(new kj.UnexpectedClientError("Unexpected HTTP client error",{cause:a}))}})}};zX.ClientSDK=gUe;ede=new WeakMap,GR=new WeakMap,G0=new WeakMap;var sjt=/^application\/(?:.{0,100}\+)?json/;async function CQl(t,e){if(!t)return;let n=e.headers.get("content-type"),l=n?.split(";")[0]||"";t.group(`> Request: ${e.method} ${e.url}`),t.group("Headers:");for(let[I,a]of e.headers.entries())t.log(`${I}: ${a}`);switch(t.groupEnd(),t.group("Body:"),!0){case sjt.test(l):t.log(await e.clone().json());break;case l.startsWith("text/"):t.log(await e.clone().text());break;case l==="multipart/form-data":{let I=await e.clone().formData();for(let[a,c]of I){let i=c instanceof Blob?"":c;t.log(`${a}: ${i}`)}break}default:t.log(`<${n}>`);break}t.groupEnd(),t.groupEnd()}async function LQl(t,e,n){if(!t)return;let l=e.headers.get("content-type"),I=l?.split(";")[0]||"";t.group(`< Response: ${n.method} ${n.url}`),t.log("Status Code:",e.status,e.statusText),t.group("Headers:");for(let[a,c]of e.headers.entries())t.log(`${a}: ${c}`);switch(t.groupEnd(),t.group("Body:"),!0){case((0,b0.matchContentType)(e,"application/json")||sjt.test(I)):t.log(await e.clone().json());break;case(0,b0.matchContentType)(e,"text/event-stream"):t.log(`<${l}>`);break;case(0,b0.matchContentType)(e,"text/*"):t.log(await e.clone().text());break;case(0,b0.matchContentType)(e,"multipart/form-data"):{let a=await e.clone().formData();for(let[c,i]of a){let s=i instanceof Blob?"":i;t.log(`${c}: ${s}`)}break}default:t.log(`<${l}>`);break}t.groupEnd(),t.groupEnd()}});var yUe=f(tde=>{"use strict";Object.defineProperty(tde,"__esModule",{value:!0});tde.SDKError=void 0;var RUe=class extends Error{constructor(e,n,l=""){let I=n.status,a=n.headers.get("content-type")||"",c=l.length>0?` +${l}`:"";super(`${e}: Status ${I} Content-Type ${a} Body ${c}`),this.rawResponse=n,this.body=l,this.statusCode=I,this.contentType=a,this.name="SDKError"}};tde.SDKError=RUe});var BX=f(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});a_.EventStream=void 0;a_.discardSentinel=jQl;var l_=10,I_=13,ujt=new Set([l_,I_]),kQl=[new Uint8Array([I_,l_,I_,l_]),new Uint8Array([I_,I_]),new Uint8Array([l_,l_])],AUe=class{constructor(e){this.stream=e.stream,this.decoder=e.decoder}async*[Symbol.asyncIterator](){let e=this.stream.getReader(),n=new Uint8Array([]),l=0;try{for(;;){let{done:I,value:a}=await e.read();if(I)break;let c=new Uint8Array(n.length+a.length);c.set(n),c.set(a,n.length),n=c;for(let i=l;i0&&(n=n.slice(l),l=0)}if(n.length>0){let I=FUe(n,this.decoder);I!=null&&(yield I)}}catch(I){if(I instanceof Error&&I.name==="AbortError")return;throw I}finally{e.releaseLock()}}};a_.EventStream=AUe;function djt(t,e){let n=t[e],l=t[e+1];if(n==null||l==null||!ujt.has(n)||!ujt.has(l))return null;for(let I of kQl){let a=xQl(e,t,I);if(a!=null)return a}return null}function xQl(t,e,n){if(n.length>e.length-t)return null;for(let l=0;l0?i.substring(0,s):"",u=s>0?i.substring(s+1):"";switch(u.charAt(0)===" "&&(u=u.substring(1)),r){case"event":{a=!0,c.event=u;break}case"data":{a=!0,c.data??(c.data=""),c.data+=u+` +`;break}case"id":{a=!0,c.id=u;break}case"retry":{let o=parseInt(u,10);Number.isNaN(o)||(a=!0,c.retry=o);break}}}return a?(c.data!=null&&(c.data=c.data.slice(0,-1)),e(c)):null}function jQl(t,e){return new ReadableStream({async start(n){let l=new Uint8Array([]),I=0,a=!1,c=!1,i=t.getReader();try{for(;!a;){let s=await i.read(),r=s.value;if(a=a||s.done,c||typeof r>"u")continue;let u=new Uint8Array(l.length+r.length);u.set(l),u.set(r,l.length),l=u;for(let o=I;o{"use strict";var UQl=UV&&UV.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),zQl=UV&&UV.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BQl=UV&&UV.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&UQl(e,t,n);return zQl(e,t),e};Object.defineProperty(UV,"__esModule",{value:!0});UV.SDKValidationError=void 0;UV.formatZodError=fUe;var SQl=BQl(se()),vUe=class extends Error{constructor(e,n,l){super(`${e}: ${n}`),this.name="SDKValidationError",this.cause=n,this.rawValue=l,this.rawMessage=e}pretty(){return this.cause instanceof SQl.ZodError?`${this.rawMessage} +${fUe(this.cause)}`:this.toString()}};UV.SDKValidationError=vUe;function fUe(t,e=0){let n=" ".repeat(e);n=e>0?`\u2502${n}`:n,n+=" ".repeat(e);let l="",I=i=>l+=` +${n}${i}`,a=t.issues.length,c=a===1?`${a} issue found`:`${a} issues found`;a&&I(`\u250C ${c}:`);for(let i of t.issues){let s=i.path.join(".");switch(s=s?`.${s}`:"",I(`\u2502 \u2022 [${s}]: ${i.message} (${i.code})`),i.code){case"invalid_literal":case"invalid_type":{I(`\u2502 Want: ${i.expected}`),I(`\u2502 Got: ${i.received}`);break}case"unrecognized_keys":{I(`\u2502 Keys: ${i.keys.join(", ")}`);break}case"invalid_enum_value":{I(`\u2502 Allowed: ${i.options.join(", ")}`),I(`\u2502 Got: ${i.received}`);break}case"invalid_union_discriminator":{I(`\u2502 Allowed: ${i.options.join(", ")}`);break}case"invalid_union":{let r=i.unionErrors.length;I(`\u2502 \u2716\uFE0E Attemped to deserialize into one of ${r} union members:`),i.unionErrors.forEach((u,o)=>{I(`\u2502 \u2716\uFE0E Member ${o+1} of ${r}`),I(`${fUe(u,e+1)}`)})}}}return t.issues.length&&I("\u2514\u2500*"),l.slice(1)}});var oe=f(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.parse=TQl;r_.safeParse=DQl;r_.collectExtraKeys=KQl;var MQl=se(),bjt=XUe(),Gjt=Hd();function TQl(t,e,n){try{return e(t)}catch(l){throw l instanceof MQl.ZodError?new bjt.SDKValidationError(n,l,t):l}}function DQl(t,e,n){try{return(0,Gjt.OK)(e(t))}catch(l){return(0,Gjt.ERR)(new bjt.SDKValidationError(n,l,t))}}function KQl(t,e,n){return t.transform(l=>{let I={},{shape:a}=t;for(let[c]of Object.entries(l)){if(c in a)continue;let i=l[c];typeof i>"u"||(I[c]=i,delete l[c])}return n&&Object.keys(I).length===0?l:{...l,[e]:I}})}});var Qt=f(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.jsonErr=qQl;Ed.json=$Ql;Ed.textErr=eEl;Ed.text=tEl;Ed.bytesErr=nEl;Ed.bytes=lEl;Ed.streamErr=IEl;Ed.stream=aEl;Ed.sseErr=rEl;Ed.sse=cEl;Ed.nilErr=oEl;Ed.nil=iEl;Ed.fail=sEl;Ed.match=uEl;Ed.unpackHeaders=nde;Ed.discardResponseBody=Wjt;var mjt=yUe(),_Ql=BX(),pjt=_1(),hjt=pUe(),Zjt=oe(),PQl={json:"application/json",text:"text/plain",bytes:"application/octet-stream",stream:"application/octet-stream",sse:"text/event-stream",nil:"*",fail:"*"};function qQl(t,e,n){return{...n,err:!0,enc:"json",codes:t,schema:e}}function $Ql(t,e,n){return{...n,enc:"json",codes:t,schema:e}}function eEl(t,e,n){return{...n,err:!0,enc:"text",codes:t,schema:e}}function tEl(t,e,n){return{...n,enc:"text",codes:t,schema:e}}function nEl(t,e,n){return{...n,err:!0,enc:"bytes",codes:t,schema:e}}function lEl(t,e,n){return{...n,enc:"bytes",codes:t,schema:e}}function IEl(t,e,n){return{...n,err:!0,enc:"stream",codes:t,schema:e}}function aEl(t,e,n){return{...n,enc:"stream",codes:t,schema:e}}function rEl(t,e,n){return{...n,err:!0,enc:"sse",codes:t,schema:e}}function cEl(t,e,n){return{...n,enc:"sse",codes:t,schema:e}}function oEl(t,e,n){return{...n,err:!0,enc:"nil",codes:t,schema:e}}function iEl(t,e,n){return{...n,enc:"nil",codes:t,schema:e}}function sEl(t){return{enc:"fail",codes:t}}function uEl(...t){return async function(n,l){let I,a;for(let r of t){let{codes:u}=r,o="ctype"in r?r.ctype:PQl[r.enc];if(o&&(0,pjt.matchResponse)(n,u,o)){a=r;break}else if(!o&&(0,pjt.matchStatusCode)(n,u)){a=r;break}}if(!a){let r=await n.text();return[{ok:!1,error:new mjt.SDKError("Unexpected API response status or content-type",n,r)},r]}let c=a.enc;switch(c){case"json":I=await n.json();break;case"bytes":I=new Uint8Array(await n.arrayBuffer());break;case"stream":I=n.body;break;case"text":I=await n.text();break;case"sse":I=n.body&&a.sseSentinel?(0,_Ql.discardSentinel)(n.body,a.sseSentinel):n.body;break;case"nil":I=await Wjt(n);break;case"fail":I=await n.text();break;default:throw new Error(`Unsupported response type: ${c}`)}if(a.enc==="fail")return[{ok:!1,error:new mjt.SDKError("API error occurred",n,typeof I=="string"?I:"")},I];let i=a.key||l?.resultKey,s;if("err"in a?s={...l?.extraFields,...a.hdrs?{Headers:nde(n.headers)}:null,...(0,hjt.isPlainObject)(I)?I:null}:i?s={...l?.extraFields,...a.hdrs?{Headers:nde(n.headers)}:null,[i]:I}:a.hdrs?s={...l?.extraFields,...a.hdrs?{Headers:nde(n.headers)}:null,...(0,hjt.isPlainObject)(I)?I:null}:s=I,"err"in a){let r=(0,Zjt.safeParse)(s,u=>a.schema.parse(u),"Response validation failed");return[r.ok?{ok:!1,error:r.value}:r,I]}else return[(0,Zjt.safeParse)(s,r=>a.schema.parse(r),"Response validation failed"),I]}}var dEl=/, */;function nde(t){let e={};for(let[n,l]of t.entries())e[n]=l.split(dEl);return e}async function Wjt(t){let e=t.body?.getReader();if(e!=null)try{let n=!1;for(;!n;)n=(await e.read()).done}finally{e.releaseLock()}}});var be=f(SX=>{"use strict";Object.defineProperty(SX,"__esModule",{value:!0});SX.invariant=GEl;SX.remap=bEl;SX.combineSignals=mEl;SX.abortSignalAny=Njt;SX.compactMap=pEl;SX.allRequired=hEl;var wUe=class extends Error{constructor(e){super(e),this.name="InvariantError"}};function GEl(t,e){if(!t)throw new wUe(e)}function bEl(t,e){let n={};if(!Object.keys(e).length)return n=t,n;for(let[l,I]of Object.entries(t)){let a=e[l];a!==null&&(n[a??l]=I)}return n}function mEl(...t){let e=[];for(let n of t)n&&e.push(n);switch(e.length){case 0:case 1:return e[0]||null;default:return"any"in AbortSignal&&typeof AbortSignal.any=="function"?AbortSignal.any(e):Njt(e)}}function Njt(t){let e=new AbortController,n=e.signal;if(!t.length)return e.signal;if(t.length===1)return t[0]||e.signal;for(let c of t)if(c.aborted)return c;function l(){e.abort(this.reason),a()}let I=[];function a(){for(let c of I){let i=c.deref();i&&i.removeEventListener("abort",l)}}for(let c of t)I.push(new WeakRef(c)),c.addEventListener("abort",l);return n}function pEl(t){let e={};for(let[n,l]of Object.entries(t))typeof l<"u"&&(e[n]=l);return e}function hEl(t){if(!Object.values(t).every(e=>e==null))return t}});var Et=f(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});m0.SecurityError=m0.SecurityErrorCode=void 0;m0.resolveSecurity=Vjt;m0.resolveGlobalSecurity=NEl;m0.extractSecurity=VEl;var ZEl=VUe(),Ide;(function(t){t.Incomplete="incomplete",t.UnrecognisedSecurityType="unrecognized_security_type"})(Ide||(m0.SecurityErrorCode=Ide={}));var ade=class t extends Error{constructor(e,n){super(n),this.code=e,this.name="SecurityError"}static incomplete(){return new t(Ide.Incomplete,"Security requirements not met in order to perform the operation")}static unrecognizedType(e){return new t(Ide.UnrecognisedSecurityType,`Unrecognised security type: ${e}`)}};m0.SecurityError=ade;function Vjt(...t){let e={basic:{},headers:{},queryParams:{},cookies:{},oauth2:{type:"none"}},n=t.find(l=>l.every(I=>{if(I.value==null)return!1;if(I.type==="http:basic")return I.value.username!=null||I.value.password!=null;if(I.type==="http:custom")return null;if(I.type==="oauth2:password")return typeof I.value=="string"&&!!I.value;if(I.type==="oauth2:client_credentials")return I.value.clientID!=null||I.value.clientSecret!=null;if(typeof I.value=="string")return!!I.value;throw new Error(`Unrecognized security type: ${I.type} (value type: ${typeof I.value})`)}));return n==null?null:(n.forEach(l=>{if(l.value==null)return;let{type:I}=l;switch(I){case"apiKey:header":e.headers[l.fieldName]=l.value;break;case"apiKey:query":e.queryParams[l.fieldName]=l.value;break;case"apiKey:cookie":e.cookies[l.fieldName]=l.value;break;case"http:basic":WEl(e,l);break;case"http:custom":break;case"http:bearer":lde(e,l);break;case"oauth2":lde(e,l);break;case"oauth2:password":lde(e,l);break;case"oauth2:client_credentials":break;case"openIdConnect":lde(e,l);break;default:throw ade.unrecognizedType(I)}}),e)}function WEl(t,e){e.value!=null&&(t.basic=e.value)}function lde(t,e){if(typeof e.value!="string"||!e.value)return;let n=e.value;n.slice(0,7).toLowerCase()!=="bearer "&&(n=`Bearer ${n}`),t.headers[e.fieldName]=n}function NEl(t){return Vjt([{fieldName:"Authorization",type:"http:bearer",value:t?.apiKey??(0,ZEl.env)().MISTRAL_API_KEY}])}async function VEl(t){if(t!=null)return typeof t=="function"?t():t}});var MX=f(CI=>{"use strict";var YEl=CI&&CI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),gEl=CI&&CI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),REl=CI&&CI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&YEl(e,t,n);return gEl(e,t),e};Object.defineProperty(CI,"__esModule",{value:!0});CI.CodeInterpreterTool$=CI.CodeInterpreterTool$outboundSchema=CI.CodeInterpreterTool$inboundSchema=CI.CodeInterpreterToolType$=CI.CodeInterpreterToolType$outboundSchema=CI.CodeInterpreterToolType$inboundSchema=CI.CodeInterpreterToolType=void 0;CI.codeInterpreterToolToJSON=AEl;CI.codeInterpreterToolFromJSON=FEl;var HUe=REl(se()),yEl=oe();CI.CodeInterpreterToolType={CodeInterpreter:"code_interpreter"};CI.CodeInterpreterToolType$inboundSchema=HUe.nativeEnum(CI.CodeInterpreterToolType);CI.CodeInterpreterToolType$outboundSchema=CI.CodeInterpreterToolType$inboundSchema;var Yjt;(function(t){t.inboundSchema=CI.CodeInterpreterToolType$inboundSchema,t.outboundSchema=CI.CodeInterpreterToolType$outboundSchema})(Yjt||(CI.CodeInterpreterToolType$=Yjt={}));CI.CodeInterpreterTool$inboundSchema=HUe.object({type:CI.CodeInterpreterToolType$inboundSchema.default("code_interpreter")});CI.CodeInterpreterTool$outboundSchema=HUe.object({type:CI.CodeInterpreterToolType$outboundSchema.default("code_interpreter")});var gjt;(function(t){t.inboundSchema=CI.CodeInterpreterTool$inboundSchema,t.outboundSchema=CI.CodeInterpreterTool$outboundSchema})(gjt||(CI.CodeInterpreterTool$=gjt={}));function AEl(t){return JSON.stringify(CI.CodeInterpreterTool$outboundSchema.parse(t))}function FEl(t){return(0,yEl.safeParse)(t,e=>CI.CodeInterpreterTool$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CodeInterpreterTool' from JSON")}});var QUe=f(Gi=>{"use strict";var vEl=Gi&&Gi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),fEl=Gi&&Gi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XEl=Gi&&Gi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&vEl(e,t,n);return fEl(e,t),e};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.CompletionArgsStop$=Gi.CompletionArgsStop$outboundSchema=Gi.CompletionArgsStop$inboundSchema=void 0;Gi.completionArgsStopToJSON=HEl;Gi.completionArgsStopFromJSON=QEl;var TX=XEl(se()),wEl=oe();Gi.CompletionArgsStop$inboundSchema=TX.union([TX.string(),TX.array(TX.string())]);Gi.CompletionArgsStop$outboundSchema=TX.union([TX.string(),TX.array(TX.string())]);var Rjt;(function(t){t.inboundSchema=Gi.CompletionArgsStop$inboundSchema,t.outboundSchema=Gi.CompletionArgsStop$outboundSchema})(Rjt||(Gi.CompletionArgsStop$=Rjt={}));function HEl(t){return JSON.stringify(Gi.CompletionArgsStop$outboundSchema.parse(t))}function QEl(t){return(0,wEl.safeParse)(t,e=>Gi.CompletionArgsStop$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionArgsStop' from JSON")}});var $1=f(bi=>{"use strict";var EEl=bi&&bi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),JEl=bi&&bi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),CEl=bi&&bi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&EEl(e,t,n);return JEl(e,t),e};Object.defineProperty(bi,"__esModule",{value:!0});bi.Prediction$=bi.Prediction$outboundSchema=bi.Prediction$inboundSchema=void 0;bi.predictionToJSON=kEl;bi.predictionFromJSON=xEl;var xj=CEl(se()),LEl=oe();bi.Prediction$inboundSchema=xj.object({type:xj.literal("content").default("content"),content:xj.string().default("")});bi.Prediction$outboundSchema=xj.object({type:xj.literal("content").default("content"),content:xj.string().default("")});var yjt;(function(t){t.inboundSchema=bi.Prediction$inboundSchema,t.outboundSchema=bi.Prediction$outboundSchema})(yjt||(bi.Prediction$=yjt={}));function kEl(t){return JSON.stringify(bi.Prediction$outboundSchema.parse(t))}function xEl(t){return(0,LEl.safeParse)(t,e=>bi.Prediction$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Prediction' from JSON")}});var EUe=f(mi=>{"use strict";var jEl=mi&&mi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),OEl=mi&&mi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),UEl=mi&&mi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&jEl(e,t,n);return OEl(e,t),e};Object.defineProperty(mi,"__esModule",{value:!0});mi.JsonSchema$=mi.JsonSchema$outboundSchema=mi.JsonSchema$inboundSchema=void 0;mi.jsonSchemaToJSON=BEl;mi.jsonSchemaFromJSON=SEl;var Ep=UEl(se()),Fjt=be(),zEl=oe();mi.JsonSchema$inboundSchema=Ep.object({name:Ep.string(),description:Ep.nullable(Ep.string()).optional(),schema:Ep.record(Ep.any()),strict:Ep.boolean().optional()}).transform(t=>(0,Fjt.remap)(t,{schema:"schemaDefinition"}));mi.JsonSchema$outboundSchema=Ep.object({name:Ep.string(),description:Ep.nullable(Ep.string()).optional(),schemaDefinition:Ep.record(Ep.any()),strict:Ep.boolean().optional()}).transform(t=>(0,Fjt.remap)(t,{schemaDefinition:"schema"}));var Ajt;(function(t){t.inboundSchema=mi.JsonSchema$inboundSchema,t.outboundSchema=mi.JsonSchema$outboundSchema})(Ajt||(mi.JsonSchema$=Ajt={}));function BEl(t){return JSON.stringify(mi.JsonSchema$outboundSchema.parse(t))}function SEl(t){return(0,zEl.safeParse)(t,e=>mi.JsonSchema$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JsonSchema' from JSON")}});var JUe=f(pi=>{"use strict";var MEl=pi&&pi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),TEl=pi&&pi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),DEl=pi&&pi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&MEl(e,t,n);return TEl(e,t),e};Object.defineProperty(pi,"__esModule",{value:!0});pi.ResponseFormats$=pi.ResponseFormats$outboundSchema=pi.ResponseFormats$inboundSchema=pi.ResponseFormats=void 0;var KEl=DEl(se());pi.ResponseFormats={Text:"text",JsonObject:"json_object",JsonSchema:"json_schema"};pi.ResponseFormats$inboundSchema=KEl.nativeEnum(pi.ResponseFormats);pi.ResponseFormats$outboundSchema=pi.ResponseFormats$inboundSchema;var vjt;(function(t){t.inboundSchema=pi.ResponseFormats$inboundSchema,t.outboundSchema=pi.ResponseFormats$outboundSchema})(vjt||(pi.ResponseFormats$=vjt={}))});var DX=f(hi=>{"use strict";var _El=hi&&hi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),PEl=hi&&hi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qEl=hi&&hi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_El(e,t,n);return PEl(e,t),e};Object.defineProperty(hi,"__esModule",{value:!0});hi.ResponseFormat$=hi.ResponseFormat$outboundSchema=hi.ResponseFormat$inboundSchema=void 0;hi.responseFormatToJSON=e1l;hi.responseFormatFromJSON=t1l;var rde=qEl(se()),Xjt=be(),$El=oe(),wjt=EUe(),Hjt=JUe();hi.ResponseFormat$inboundSchema=rde.object({type:Hjt.ResponseFormats$inboundSchema.optional(),json_schema:rde.nullable(wjt.JsonSchema$inboundSchema).optional()}).transform(t=>(0,Xjt.remap)(t,{json_schema:"jsonSchema"}));hi.ResponseFormat$outboundSchema=rde.object({type:Hjt.ResponseFormats$outboundSchema.optional(),jsonSchema:rde.nullable(wjt.JsonSchema$outboundSchema).optional()}).transform(t=>(0,Xjt.remap)(t,{jsonSchema:"json_schema"}));var fjt;(function(t){t.inboundSchema=hi.ResponseFormat$inboundSchema,t.outboundSchema=hi.ResponseFormat$outboundSchema})(fjt||(hi.ResponseFormat$=fjt={}));function e1l(t){return JSON.stringify(hi.ResponseFormat$outboundSchema.parse(t))}function t1l(t){return(0,$El.safeParse)(t,e=>hi.ResponseFormat$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ResponseFormat' from JSON")}});var eJ=f(Zi=>{"use strict";var n1l=Zi&&Zi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),l1l=Zi&&Zi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),I1l=Zi&&Zi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&n1l(e,t,n);return l1l(e,t),e};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ToolChoiceEnum$=Zi.ToolChoiceEnum$outboundSchema=Zi.ToolChoiceEnum$inboundSchema=Zi.ToolChoiceEnum=void 0;var a1l=I1l(se());Zi.ToolChoiceEnum={Auto:"auto",None:"none",Any:"any",Required:"required"};Zi.ToolChoiceEnum$inboundSchema=a1l.nativeEnum(Zi.ToolChoiceEnum);Zi.ToolChoiceEnum$outboundSchema=Zi.ToolChoiceEnum$inboundSchema;var Qjt;(function(t){t.inboundSchema=Zi.ToolChoiceEnum$inboundSchema,t.outboundSchema=Zi.ToolChoiceEnum$outboundSchema})(Qjt||(Zi.ToolChoiceEnum$=Qjt={}))});var jW=f(Wi=>{"use strict";var r1l=Wi&&Wi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),c1l=Wi&&Wi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o1l=Wi&&Wi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&r1l(e,t,n);return c1l(e,t),e};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.CompletionArgs$=Wi.CompletionArgs$outboundSchema=Wi.CompletionArgs$inboundSchema=void 0;Wi.completionArgsToJSON=s1l;Wi.completionArgsFromJSON=u1l;var gr=o1l(se()),Jjt=be(),i1l=oe(),Cjt=QUe(),Ljt=$1(),kjt=DX(),xjt=eJ();Wi.CompletionArgs$inboundSchema=gr.object({stop:gr.nullable(Cjt.CompletionArgsStop$inboundSchema).optional(),presence_penalty:gr.nullable(gr.number()).optional(),frequency_penalty:gr.nullable(gr.number()).optional(),temperature:gr.number().default(.3),top_p:gr.nullable(gr.number()).optional(),max_tokens:gr.nullable(gr.number().int()).optional(),random_seed:gr.nullable(gr.number().int()).optional(),prediction:gr.nullable(Ljt.Prediction$inboundSchema).optional(),response_format:gr.nullable(kjt.ResponseFormat$inboundSchema).optional(),tool_choice:xjt.ToolChoiceEnum$inboundSchema.optional()}).transform(t=>(0,Jjt.remap)(t,{presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice"}));Wi.CompletionArgs$outboundSchema=gr.object({stop:gr.nullable(Cjt.CompletionArgsStop$outboundSchema).optional(),presencePenalty:gr.nullable(gr.number()).optional(),frequencyPenalty:gr.nullable(gr.number()).optional(),temperature:gr.number().default(.3),topP:gr.nullable(gr.number()).optional(),maxTokens:gr.nullable(gr.number().int()).optional(),randomSeed:gr.nullable(gr.number().int()).optional(),prediction:gr.nullable(Ljt.Prediction$outboundSchema).optional(),responseFormat:gr.nullable(kjt.ResponseFormat$outboundSchema).optional(),toolChoice:xjt.ToolChoiceEnum$outboundSchema.optional()}).transform(t=>(0,Jjt.remap)(t,{presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice"}));var Ejt;(function(t){t.inboundSchema=Wi.CompletionArgs$inboundSchema,t.outboundSchema=Wi.CompletionArgs$outboundSchema})(Ejt||(Wi.CompletionArgs$=Ejt={}));function s1l(t){return JSON.stringify(Wi.CompletionArgs$outboundSchema.parse(t))}function u1l(t){return(0,i1l.safeParse)(t,e=>Wi.CompletionArgs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionArgs' from JSON")}});var KX=f(LI=>{"use strict";var d1l=LI&&LI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),G1l=LI&&LI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b1l=LI&&LI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&d1l(e,t,n);return G1l(e,t),e};Object.defineProperty(LI,"__esModule",{value:!0});LI.DocumentLibraryTool$=LI.DocumentLibraryTool$outboundSchema=LI.DocumentLibraryTool$inboundSchema=LI.DocumentLibraryToolType$=LI.DocumentLibraryToolType$outboundSchema=LI.DocumentLibraryToolType$inboundSchema=LI.DocumentLibraryToolType=void 0;LI.documentLibraryToolToJSON=p1l;LI.documentLibraryToolFromJSON=h1l;var tJ=b1l(se()),Ujt=be(),m1l=oe();LI.DocumentLibraryToolType={DocumentLibrary:"document_library"};LI.DocumentLibraryToolType$inboundSchema=tJ.nativeEnum(LI.DocumentLibraryToolType);LI.DocumentLibraryToolType$outboundSchema=LI.DocumentLibraryToolType$inboundSchema;var jjt;(function(t){t.inboundSchema=LI.DocumentLibraryToolType$inboundSchema,t.outboundSchema=LI.DocumentLibraryToolType$outboundSchema})(jjt||(LI.DocumentLibraryToolType$=jjt={}));LI.DocumentLibraryTool$inboundSchema=tJ.object({type:LI.DocumentLibraryToolType$inboundSchema.default("document_library"),library_ids:tJ.array(tJ.string())}).transform(t=>(0,Ujt.remap)(t,{library_ids:"libraryIds"}));LI.DocumentLibraryTool$outboundSchema=tJ.object({type:LI.DocumentLibraryToolType$outboundSchema.default("document_library"),libraryIds:tJ.array(tJ.string())}).transform(t=>(0,Ujt.remap)(t,{libraryIds:"library_ids"}));var Ojt;(function(t){t.inboundSchema=LI.DocumentLibraryTool$inboundSchema,t.outboundSchema=LI.DocumentLibraryTool$outboundSchema})(Ojt||(LI.DocumentLibraryTool$=Ojt={}));function p1l(t){return JSON.stringify(LI.DocumentLibraryTool$outboundSchema.parse(t))}function h1l(t){return(0,m1l.safeParse)(t,e=>LI.DocumentLibraryTool$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DocumentLibraryTool' from JSON")}});var cde=f(Ni=>{"use strict";var Z1l=Ni&&Ni.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),W1l=Ni&&Ni.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),N1l=Ni&&Ni.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Z1l(e,t,n);return W1l(e,t),e};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.FunctionT$=Ni.FunctionT$outboundSchema=Ni.FunctionT$inboundSchema=void 0;Ni.functionToJSON=Y1l;Ni.functionFromJSON=g1l;var OW=N1l(se()),V1l=oe();Ni.FunctionT$inboundSchema=OW.object({name:OW.string(),description:OW.string().optional(),strict:OW.boolean().optional(),parameters:OW.record(OW.any())});Ni.FunctionT$outboundSchema=OW.object({name:OW.string(),description:OW.string().optional(),strict:OW.boolean().optional(),parameters:OW.record(OW.any())});var zjt;(function(t){t.inboundSchema=Ni.FunctionT$inboundSchema,t.outboundSchema=Ni.FunctionT$outboundSchema})(zjt||(Ni.FunctionT$=zjt={}));function Y1l(t){return JSON.stringify(Ni.FunctionT$outboundSchema.parse(t))}function g1l(t){return(0,V1l.safeParse)(t,e=>Ni.FunctionT$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionT' from JSON")}});var _X=f(kI=>{"use strict";var R1l=kI&&kI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),y1l=kI&&kI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),A1l=kI&&kI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&R1l(e,t,n);return y1l(e,t),e};Object.defineProperty(kI,"__esModule",{value:!0});kI.FunctionTool$=kI.FunctionTool$outboundSchema=kI.FunctionTool$inboundSchema=kI.FunctionToolType$=kI.FunctionToolType$outboundSchema=kI.FunctionToolType$inboundSchema=kI.FunctionToolType=void 0;kI.functionToolToJSON=v1l;kI.functionToolFromJSON=f1l;var CUe=A1l(se()),F1l=oe(),Mjt=cde();kI.FunctionToolType={Function:"function"};kI.FunctionToolType$inboundSchema=CUe.nativeEnum(kI.FunctionToolType);kI.FunctionToolType$outboundSchema=kI.FunctionToolType$inboundSchema;var Bjt;(function(t){t.inboundSchema=kI.FunctionToolType$inboundSchema,t.outboundSchema=kI.FunctionToolType$outboundSchema})(Bjt||(kI.FunctionToolType$=Bjt={}));kI.FunctionTool$inboundSchema=CUe.object({type:kI.FunctionToolType$inboundSchema.default("function"),function:Mjt.FunctionT$inboundSchema});kI.FunctionTool$outboundSchema=CUe.object({type:kI.FunctionToolType$outboundSchema.default("function"),function:Mjt.FunctionT$outboundSchema});var Sjt;(function(t){t.inboundSchema=kI.FunctionTool$inboundSchema,t.outboundSchema=kI.FunctionTool$outboundSchema})(Sjt||(kI.FunctionTool$=Sjt={}));function v1l(t){return JSON.stringify(kI.FunctionTool$outboundSchema.parse(t))}function f1l(t){return(0,F1l.safeParse)(t,e=>kI.FunctionTool$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionTool' from JSON")}});var PX=f(xI=>{"use strict";var X1l=xI&&xI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),w1l=xI&&xI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),H1l=xI&&xI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&X1l(e,t,n);return w1l(e,t),e};Object.defineProperty(xI,"__esModule",{value:!0});xI.ImageGenerationTool$=xI.ImageGenerationTool$outboundSchema=xI.ImageGenerationTool$inboundSchema=xI.ImageGenerationToolType$=xI.ImageGenerationToolType$outboundSchema=xI.ImageGenerationToolType$inboundSchema=xI.ImageGenerationToolType=void 0;xI.imageGenerationToolToJSON=E1l;xI.imageGenerationToolFromJSON=J1l;var LUe=H1l(se()),Q1l=oe();xI.ImageGenerationToolType={ImageGeneration:"image_generation"};xI.ImageGenerationToolType$inboundSchema=LUe.nativeEnum(xI.ImageGenerationToolType);xI.ImageGenerationToolType$outboundSchema=xI.ImageGenerationToolType$inboundSchema;var Tjt;(function(t){t.inboundSchema=xI.ImageGenerationToolType$inboundSchema,t.outboundSchema=xI.ImageGenerationToolType$outboundSchema})(Tjt||(xI.ImageGenerationToolType$=Tjt={}));xI.ImageGenerationTool$inboundSchema=LUe.object({type:xI.ImageGenerationToolType$inboundSchema.default("image_generation")});xI.ImageGenerationTool$outboundSchema=LUe.object({type:xI.ImageGenerationToolType$outboundSchema.default("image_generation")});var Djt;(function(t){t.inboundSchema=xI.ImageGenerationTool$inboundSchema,t.outboundSchema=xI.ImageGenerationTool$outboundSchema})(Djt||(xI.ImageGenerationTool$=Djt={}));function E1l(t){return JSON.stringify(xI.ImageGenerationTool$outboundSchema.parse(t))}function J1l(t){return(0,Q1l.safeParse)(t,e=>xI.ImageGenerationTool$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ImageGenerationTool' from JSON")}});var qX=f(jI=>{"use strict";var C1l=jI&&jI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),L1l=jI&&jI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),k1l=jI&&jI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&C1l(e,t,n);return L1l(e,t),e};Object.defineProperty(jI,"__esModule",{value:!0});jI.WebSearchPremiumTool$=jI.WebSearchPremiumTool$outboundSchema=jI.WebSearchPremiumTool$inboundSchema=jI.WebSearchPremiumToolType$=jI.WebSearchPremiumToolType$outboundSchema=jI.WebSearchPremiumToolType$inboundSchema=jI.WebSearchPremiumToolType=void 0;jI.webSearchPremiumToolToJSON=j1l;jI.webSearchPremiumToolFromJSON=O1l;var kUe=k1l(se()),x1l=oe();jI.WebSearchPremiumToolType={WebSearchPremium:"web_search_premium"};jI.WebSearchPremiumToolType$inboundSchema=kUe.nativeEnum(jI.WebSearchPremiumToolType);jI.WebSearchPremiumToolType$outboundSchema=jI.WebSearchPremiumToolType$inboundSchema;var Kjt;(function(t){t.inboundSchema=jI.WebSearchPremiumToolType$inboundSchema,t.outboundSchema=jI.WebSearchPremiumToolType$outboundSchema})(Kjt||(jI.WebSearchPremiumToolType$=Kjt={}));jI.WebSearchPremiumTool$inboundSchema=kUe.object({type:jI.WebSearchPremiumToolType$inboundSchema.default("web_search_premium")});jI.WebSearchPremiumTool$outboundSchema=kUe.object({type:jI.WebSearchPremiumToolType$outboundSchema.default("web_search_premium")});var _jt;(function(t){t.inboundSchema=jI.WebSearchPremiumTool$inboundSchema,t.outboundSchema=jI.WebSearchPremiumTool$outboundSchema})(_jt||(jI.WebSearchPremiumTool$=_jt={}));function j1l(t){return JSON.stringify(jI.WebSearchPremiumTool$outboundSchema.parse(t))}function O1l(t){return(0,x1l.safeParse)(t,e=>jI.WebSearchPremiumTool$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'WebSearchPremiumTool' from JSON")}});var $X=f(OI=>{"use strict";var U1l=OI&&OI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),z1l=OI&&OI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),B1l=OI&&OI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&U1l(e,t,n);return z1l(e,t),e};Object.defineProperty(OI,"__esModule",{value:!0});OI.WebSearchTool$=OI.WebSearchTool$outboundSchema=OI.WebSearchTool$inboundSchema=OI.WebSearchToolType$=OI.WebSearchToolType$outboundSchema=OI.WebSearchToolType$inboundSchema=OI.WebSearchToolType=void 0;OI.webSearchToolToJSON=M1l;OI.webSearchToolFromJSON=T1l;var xUe=B1l(se()),S1l=oe();OI.WebSearchToolType={WebSearch:"web_search"};OI.WebSearchToolType$inboundSchema=xUe.nativeEnum(OI.WebSearchToolType);OI.WebSearchToolType$outboundSchema=OI.WebSearchToolType$inboundSchema;var Pjt;(function(t){t.inboundSchema=OI.WebSearchToolType$inboundSchema,t.outboundSchema=OI.WebSearchToolType$outboundSchema})(Pjt||(OI.WebSearchToolType$=Pjt={}));OI.WebSearchTool$inboundSchema=xUe.object({type:OI.WebSearchToolType$inboundSchema.default("web_search")});OI.WebSearchTool$outboundSchema=xUe.object({type:OI.WebSearchToolType$outboundSchema.default("web_search")});var qjt;(function(t){t.inboundSchema=OI.WebSearchTool$inboundSchema,t.outboundSchema=OI.WebSearchTool$outboundSchema})(qjt||(OI.WebSearchTool$=qjt={}));function M1l(t){return JSON.stringify(OI.WebSearchTool$outboundSchema.parse(t))}function T1l(t){return(0,S1l.safeParse)(t,e=>OI.WebSearchTool$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'WebSearchTool' from JSON")}});var aOt=f(nl=>{"use strict";var D1l=nl&&nl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),K1l=nl&&nl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_1l=nl&&nl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&D1l(e,t,n);return K1l(e,t),e};Object.defineProperty(nl,"__esModule",{value:!0});nl.Agent$=nl.Agent$outboundSchema=nl.Agent$inboundSchema=nl.AgentObject$=nl.AgentObject$outboundSchema=nl.AgentObject$inboundSchema=nl.AgentTools$=nl.AgentTools$outboundSchema=nl.AgentTools$inboundSchema=nl.AgentObject=void 0;nl.agentToolsToJSON=P1l;nl.agentToolsFromJSON=q1l;nl.agentToJSON=$1l;nl.agentFromJSON=eJl;var ot=_1l(se()),nOt=be(),lOt=oe(),ode=MX(),IOt=jW(),ide=KX(),sde=_X(),ude=PX(),dde=qX(),Gde=$X();nl.AgentObject={Agent:"agent"};nl.AgentTools$inboundSchema=ot.union([ode.CodeInterpreterTool$inboundSchema.and(ot.object({type:ot.literal("code_interpreter")}).transform(t=>({type:t.type}))),ude.ImageGenerationTool$inboundSchema.and(ot.object({type:ot.literal("image_generation")}).transform(t=>({type:t.type}))),Gde.WebSearchTool$inboundSchema.and(ot.object({type:ot.literal("web_search")}).transform(t=>({type:t.type}))),dde.WebSearchPremiumTool$inboundSchema.and(ot.object({type:ot.literal("web_search_premium")}).transform(t=>({type:t.type}))),ide.DocumentLibraryTool$inboundSchema.and(ot.object({type:ot.literal("document_library")}).transform(t=>({type:t.type}))),sde.FunctionTool$inboundSchema.and(ot.object({type:ot.literal("function")}).transform(t=>({type:t.type})))]);nl.AgentTools$outboundSchema=ot.union([ode.CodeInterpreterTool$outboundSchema.and(ot.object({type:ot.literal("code_interpreter")}).transform(t=>({type:t.type}))),ude.ImageGenerationTool$outboundSchema.and(ot.object({type:ot.literal("image_generation")}).transform(t=>({type:t.type}))),Gde.WebSearchTool$outboundSchema.and(ot.object({type:ot.literal("web_search")}).transform(t=>({type:t.type}))),dde.WebSearchPremiumTool$outboundSchema.and(ot.object({type:ot.literal("web_search_premium")}).transform(t=>({type:t.type}))),ide.DocumentLibraryTool$outboundSchema.and(ot.object({type:ot.literal("document_library")}).transform(t=>({type:t.type}))),sde.FunctionTool$outboundSchema.and(ot.object({type:ot.literal("function")}).transform(t=>({type:t.type})))]);var $jt;(function(t){t.inboundSchema=nl.AgentTools$inboundSchema,t.outboundSchema=nl.AgentTools$outboundSchema})($jt||(nl.AgentTools$=$jt={}));function P1l(t){return JSON.stringify(nl.AgentTools$outboundSchema.parse(t))}function q1l(t){return(0,lOt.safeParse)(t,e=>nl.AgentTools$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentTools' from JSON")}nl.AgentObject$inboundSchema=ot.nativeEnum(nl.AgentObject);nl.AgentObject$outboundSchema=nl.AgentObject$inboundSchema;var eOt;(function(t){t.inboundSchema=nl.AgentObject$inboundSchema,t.outboundSchema=nl.AgentObject$outboundSchema})(eOt||(nl.AgentObject$=eOt={}));nl.Agent$inboundSchema=ot.object({instructions:ot.nullable(ot.string()).optional(),tools:ot.array(ot.union([ode.CodeInterpreterTool$inboundSchema.and(ot.object({type:ot.literal("code_interpreter")}).transform(t=>({type:t.type}))),ude.ImageGenerationTool$inboundSchema.and(ot.object({type:ot.literal("image_generation")}).transform(t=>({type:t.type}))),Gde.WebSearchTool$inboundSchema.and(ot.object({type:ot.literal("web_search")}).transform(t=>({type:t.type}))),dde.WebSearchPremiumTool$inboundSchema.and(ot.object({type:ot.literal("web_search_premium")}).transform(t=>({type:t.type}))),ide.DocumentLibraryTool$inboundSchema.and(ot.object({type:ot.literal("document_library")}).transform(t=>({type:t.type}))),sde.FunctionTool$inboundSchema.and(ot.object({type:ot.literal("function")}).transform(t=>({type:t.type})))])).optional(),completion_args:IOt.CompletionArgs$inboundSchema.optional(),model:ot.string(),name:ot.string(),description:ot.nullable(ot.string()).optional(),handoffs:ot.nullable(ot.array(ot.string())).optional(),object:nl.AgentObject$inboundSchema.default("agent"),id:ot.string(),version:ot.number().int(),created_at:ot.string().datetime({offset:!0}).transform(t=>new Date(t)),updated_at:ot.string().datetime({offset:!0}).transform(t=>new Date(t))}).transform(t=>(0,nOt.remap)(t,{completion_args:"completionArgs",created_at:"createdAt",updated_at:"updatedAt"}));nl.Agent$outboundSchema=ot.object({instructions:ot.nullable(ot.string()).optional(),tools:ot.array(ot.union([ode.CodeInterpreterTool$outboundSchema.and(ot.object({type:ot.literal("code_interpreter")}).transform(t=>({type:t.type}))),ude.ImageGenerationTool$outboundSchema.and(ot.object({type:ot.literal("image_generation")}).transform(t=>({type:t.type}))),Gde.WebSearchTool$outboundSchema.and(ot.object({type:ot.literal("web_search")}).transform(t=>({type:t.type}))),dde.WebSearchPremiumTool$outboundSchema.and(ot.object({type:ot.literal("web_search_premium")}).transform(t=>({type:t.type}))),ide.DocumentLibraryTool$outboundSchema.and(ot.object({type:ot.literal("document_library")}).transform(t=>({type:t.type}))),sde.FunctionTool$outboundSchema.and(ot.object({type:ot.literal("function")}).transform(t=>({type:t.type})))])).optional(),completionArgs:IOt.CompletionArgs$outboundSchema.optional(),model:ot.string(),name:ot.string(),description:ot.nullable(ot.string()).optional(),handoffs:ot.nullable(ot.array(ot.string())).optional(),object:nl.AgentObject$outboundSchema.default("agent"),id:ot.string(),version:ot.number().int(),createdAt:ot.date().transform(t=>t.toISOString()),updatedAt:ot.date().transform(t=>t.toISOString())}).transform(t=>(0,nOt.remap)(t,{completionArgs:"completion_args",createdAt:"created_at",updatedAt:"updated_at"}));var tOt;(function(t){t.inboundSchema=nl.Agent$inboundSchema,t.outboundSchema=nl.Agent$outboundSchema})(tOt||(nl.Agent$=tOt={}));function $1l(t){return JSON.stringify(nl.Agent$outboundSchema.parse(t))}function eJl(t){return(0,lOt.safeParse)(t,e=>nl.Agent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Agent' from JSON")}});var iOt=f(UI=>{"use strict";var tJl=UI&&UI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),nJl=UI&&UI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lJl=UI&&UI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&tJl(e,t,n);return nJl(e,t),e};Object.defineProperty(UI,"__esModule",{value:!0});UI.AgentConversation$=UI.AgentConversation$outboundSchema=UI.AgentConversation$inboundSchema=UI.AgentConversationObject$=UI.AgentConversationObject$outboundSchema=UI.AgentConversationObject$inboundSchema=UI.AgentConversationObject=void 0;UI.agentConversationToJSON=aJl;UI.agentConversationFromJSON=rJl;var dd=lJl(se()),oOt=be(),IJl=oe();UI.AgentConversationObject={Conversation:"conversation"};UI.AgentConversationObject$inboundSchema=dd.nativeEnum(UI.AgentConversationObject);UI.AgentConversationObject$outboundSchema=UI.AgentConversationObject$inboundSchema;var rOt;(function(t){t.inboundSchema=UI.AgentConversationObject$inboundSchema,t.outboundSchema=UI.AgentConversationObject$outboundSchema})(rOt||(UI.AgentConversationObject$=rOt={}));UI.AgentConversation$inboundSchema=dd.object({name:dd.nullable(dd.string()).optional(),description:dd.nullable(dd.string()).optional(),object:UI.AgentConversationObject$inboundSchema.default("conversation"),id:dd.string(),created_at:dd.string().datetime({offset:!0}).transform(t=>new Date(t)),updated_at:dd.string().datetime({offset:!0}).transform(t=>new Date(t)),agent_id:dd.string()}).transform(t=>(0,oOt.remap)(t,{created_at:"createdAt",updated_at:"updatedAt",agent_id:"agentId"}));UI.AgentConversation$outboundSchema=dd.object({name:dd.nullable(dd.string()).optional(),description:dd.nullable(dd.string()).optional(),object:UI.AgentConversationObject$outboundSchema.default("conversation"),id:dd.string(),createdAt:dd.date().transform(t=>t.toISOString()),updatedAt:dd.date().transform(t=>t.toISOString()),agentId:dd.string()}).transform(t=>(0,oOt.remap)(t,{createdAt:"created_at",updatedAt:"updated_at",agentId:"agent_id"}));var cOt;(function(t){t.inboundSchema=UI.AgentConversation$inboundSchema,t.outboundSchema=UI.AgentConversation$outboundSchema})(cOt||(UI.AgentConversation$=cOt={}));function aJl(t){return JSON.stringify(UI.AgentConversation$outboundSchema.parse(t))}function rJl(t){return(0,IJl.safeParse)(t,e=>UI.AgentConversation$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentConversation' from JSON")}});var mOt=f(Ua=>{"use strict";var cJl=Ua&&Ua.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),oJl=Ua&&Ua.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iJl=Ua&&Ua.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&cJl(e,t,n);return oJl(e,t),e};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.AgentCreationRequest$=Ua.AgentCreationRequest$outboundSchema=Ua.AgentCreationRequest$inboundSchema=Ua.AgentCreationRequestTools$=Ua.AgentCreationRequestTools$outboundSchema=Ua.AgentCreationRequestTools$inboundSchema=void 0;Ua.agentCreationRequestToolsToJSON=sJl;Ua.agentCreationRequestToolsFromJSON=uJl;Ua.agentCreationRequestToJSON=dJl;Ua.agentCreationRequestFromJSON=GJl;var Zt=iJl(se()),dOt=be(),GOt=oe(),bde=MX(),bOt=jW(),mde=KX(),pde=_X(),hde=PX(),Zde=qX(),Wde=$X();Ua.AgentCreationRequestTools$inboundSchema=Zt.union([bde.CodeInterpreterTool$inboundSchema.and(Zt.object({type:Zt.literal("code_interpreter")}).transform(t=>({type:t.type}))),hde.ImageGenerationTool$inboundSchema.and(Zt.object({type:Zt.literal("image_generation")}).transform(t=>({type:t.type}))),Wde.WebSearchTool$inboundSchema.and(Zt.object({type:Zt.literal("web_search")}).transform(t=>({type:t.type}))),Zde.WebSearchPremiumTool$inboundSchema.and(Zt.object({type:Zt.literal("web_search_premium")}).transform(t=>({type:t.type}))),mde.DocumentLibraryTool$inboundSchema.and(Zt.object({type:Zt.literal("document_library")}).transform(t=>({type:t.type}))),pde.FunctionTool$inboundSchema.and(Zt.object({type:Zt.literal("function")}).transform(t=>({type:t.type})))]);Ua.AgentCreationRequestTools$outboundSchema=Zt.union([bde.CodeInterpreterTool$outboundSchema.and(Zt.object({type:Zt.literal("code_interpreter")}).transform(t=>({type:t.type}))),hde.ImageGenerationTool$outboundSchema.and(Zt.object({type:Zt.literal("image_generation")}).transform(t=>({type:t.type}))),Wde.WebSearchTool$outboundSchema.and(Zt.object({type:Zt.literal("web_search")}).transform(t=>({type:t.type}))),Zde.WebSearchPremiumTool$outboundSchema.and(Zt.object({type:Zt.literal("web_search_premium")}).transform(t=>({type:t.type}))),mde.DocumentLibraryTool$outboundSchema.and(Zt.object({type:Zt.literal("document_library")}).transform(t=>({type:t.type}))),pde.FunctionTool$outboundSchema.and(Zt.object({type:Zt.literal("function")}).transform(t=>({type:t.type})))]);var sOt;(function(t){t.inboundSchema=Ua.AgentCreationRequestTools$inboundSchema,t.outboundSchema=Ua.AgentCreationRequestTools$outboundSchema})(sOt||(Ua.AgentCreationRequestTools$=sOt={}));function sJl(t){return JSON.stringify(Ua.AgentCreationRequestTools$outboundSchema.parse(t))}function uJl(t){return(0,GOt.safeParse)(t,e=>Ua.AgentCreationRequestTools$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentCreationRequestTools' from JSON")}Ua.AgentCreationRequest$inboundSchema=Zt.object({instructions:Zt.nullable(Zt.string()).optional(),tools:Zt.array(Zt.union([bde.CodeInterpreterTool$inboundSchema.and(Zt.object({type:Zt.literal("code_interpreter")}).transform(t=>({type:t.type}))),hde.ImageGenerationTool$inboundSchema.and(Zt.object({type:Zt.literal("image_generation")}).transform(t=>({type:t.type}))),Wde.WebSearchTool$inboundSchema.and(Zt.object({type:Zt.literal("web_search")}).transform(t=>({type:t.type}))),Zde.WebSearchPremiumTool$inboundSchema.and(Zt.object({type:Zt.literal("web_search_premium")}).transform(t=>({type:t.type}))),mde.DocumentLibraryTool$inboundSchema.and(Zt.object({type:Zt.literal("document_library")}).transform(t=>({type:t.type}))),pde.FunctionTool$inboundSchema.and(Zt.object({type:Zt.literal("function")}).transform(t=>({type:t.type})))])).optional(),completion_args:bOt.CompletionArgs$inboundSchema.optional(),model:Zt.string(),name:Zt.string(),description:Zt.nullable(Zt.string()).optional(),handoffs:Zt.nullable(Zt.array(Zt.string())).optional()}).transform(t=>(0,dOt.remap)(t,{completion_args:"completionArgs"}));Ua.AgentCreationRequest$outboundSchema=Zt.object({instructions:Zt.nullable(Zt.string()).optional(),tools:Zt.array(Zt.union([bde.CodeInterpreterTool$outboundSchema.and(Zt.object({type:Zt.literal("code_interpreter")}).transform(t=>({type:t.type}))),hde.ImageGenerationTool$outboundSchema.and(Zt.object({type:Zt.literal("image_generation")}).transform(t=>({type:t.type}))),Wde.WebSearchTool$outboundSchema.and(Zt.object({type:Zt.literal("web_search")}).transform(t=>({type:t.type}))),Zde.WebSearchPremiumTool$outboundSchema.and(Zt.object({type:Zt.literal("web_search_premium")}).transform(t=>({type:t.type}))),mde.DocumentLibraryTool$outboundSchema.and(Zt.object({type:Zt.literal("document_library")}).transform(t=>({type:t.type}))),pde.FunctionTool$outboundSchema.and(Zt.object({type:Zt.literal("function")}).transform(t=>({type:t.type})))])).optional(),completionArgs:bOt.CompletionArgs$outboundSchema.optional(),model:Zt.string(),name:Zt.string(),description:Zt.nullable(Zt.string()).optional(),handoffs:Zt.nullable(Zt.array(Zt.string())).optional()}).transform(t=>(0,dOt.remap)(t,{completionArgs:"completion_args"}));var uOt;(function(t){t.inboundSchema=Ua.AgentCreationRequest$inboundSchema,t.outboundSchema=Ua.AgentCreationRequest$outboundSchema})(uOt||(Ua.AgentCreationRequest$=uOt={}));function dJl(t){return JSON.stringify(Ua.AgentCreationRequest$outboundSchema.parse(t))}function GJl(t){return(0,GOt.safeParse)(t,e=>Ua.AgentCreationRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentCreationRequest' from JSON")}});var jUe=f(zI=>{"use strict";var bJl=zI&&zI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),mJl=zI&&zI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pJl=zI&&zI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&bJl(e,t,n);return mJl(e,t),e};Object.defineProperty(zI,"__esModule",{value:!0});zI.AgentHandoffDoneEvent$=zI.AgentHandoffDoneEvent$outboundSchema=zI.AgentHandoffDoneEvent$inboundSchema=zI.AgentHandoffDoneEventType$=zI.AgentHandoffDoneEventType$outboundSchema=zI.AgentHandoffDoneEventType$inboundSchema=zI.AgentHandoffDoneEventType=void 0;zI.agentHandoffDoneEventToJSON=ZJl;zI.agentHandoffDoneEventFromJSON=WJl;var nZ=pJl(se()),ZOt=be(),hJl=oe();zI.AgentHandoffDoneEventType={AgentHandoffDone:"agent.handoff.done"};zI.AgentHandoffDoneEventType$inboundSchema=nZ.nativeEnum(zI.AgentHandoffDoneEventType);zI.AgentHandoffDoneEventType$outboundSchema=zI.AgentHandoffDoneEventType$inboundSchema;var pOt;(function(t){t.inboundSchema=zI.AgentHandoffDoneEventType$inboundSchema,t.outboundSchema=zI.AgentHandoffDoneEventType$outboundSchema})(pOt||(zI.AgentHandoffDoneEventType$=pOt={}));zI.AgentHandoffDoneEvent$inboundSchema=nZ.object({type:zI.AgentHandoffDoneEventType$inboundSchema.default("agent.handoff.done"),created_at:nZ.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),output_index:nZ.number().int().default(0),id:nZ.string(),next_agent_id:nZ.string(),next_agent_name:nZ.string()}).transform(t=>(0,ZOt.remap)(t,{created_at:"createdAt",output_index:"outputIndex",next_agent_id:"nextAgentId",next_agent_name:"nextAgentName"}));zI.AgentHandoffDoneEvent$outboundSchema=nZ.object({type:zI.AgentHandoffDoneEventType$outboundSchema.default("agent.handoff.done"),createdAt:nZ.date().transform(t=>t.toISOString()).optional(),outputIndex:nZ.number().int().default(0),id:nZ.string(),nextAgentId:nZ.string(),nextAgentName:nZ.string()}).transform(t=>(0,ZOt.remap)(t,{createdAt:"created_at",outputIndex:"output_index",nextAgentId:"next_agent_id",nextAgentName:"next_agent_name"}));var hOt;(function(t){t.inboundSchema=zI.AgentHandoffDoneEvent$inboundSchema,t.outboundSchema=zI.AgentHandoffDoneEvent$outboundSchema})(hOt||(zI.AgentHandoffDoneEvent$=hOt={}));function ZJl(t){return JSON.stringify(zI.AgentHandoffDoneEvent$outboundSchema.parse(t))}function WJl(t){return(0,hJl.safeParse)(t,e=>zI.AgentHandoffDoneEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentHandoffDoneEvent' from JSON")}});var c_=f(On=>{"use strict";var NJl=On&&On.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),VJl=On&&On.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),YJl=On&&On.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&NJl(e,t,n);return VJl(e,t),e};Object.defineProperty(On,"__esModule",{value:!0});On.AgentHandoffEntry$=On.AgentHandoffEntry$outboundSchema=On.AgentHandoffEntry$inboundSchema=On.AgentHandoffEntryType$=On.AgentHandoffEntryType$outboundSchema=On.AgentHandoffEntryType$inboundSchema=On.AgentHandoffEntryObject$=On.AgentHandoffEntryObject$outboundSchema=On.AgentHandoffEntryObject$inboundSchema=On.AgentHandoffEntryType=On.AgentHandoffEntryObject=void 0;On.agentHandoffEntryToJSON=RJl;On.agentHandoffEntryFromJSON=yJl;var Vi=YJl(se()),YOt=be(),gJl=oe();On.AgentHandoffEntryObject={Entry:"entry"};On.AgentHandoffEntryType={AgentHandoff:"agent.handoff"};On.AgentHandoffEntryObject$inboundSchema=Vi.nativeEnum(On.AgentHandoffEntryObject);On.AgentHandoffEntryObject$outboundSchema=On.AgentHandoffEntryObject$inboundSchema;var WOt;(function(t){t.inboundSchema=On.AgentHandoffEntryObject$inboundSchema,t.outboundSchema=On.AgentHandoffEntryObject$outboundSchema})(WOt||(On.AgentHandoffEntryObject$=WOt={}));On.AgentHandoffEntryType$inboundSchema=Vi.nativeEnum(On.AgentHandoffEntryType);On.AgentHandoffEntryType$outboundSchema=On.AgentHandoffEntryType$inboundSchema;var NOt;(function(t){t.inboundSchema=On.AgentHandoffEntryType$inboundSchema,t.outboundSchema=On.AgentHandoffEntryType$outboundSchema})(NOt||(On.AgentHandoffEntryType$=NOt={}));On.AgentHandoffEntry$inboundSchema=Vi.object({object:On.AgentHandoffEntryObject$inboundSchema.default("entry"),type:On.AgentHandoffEntryType$inboundSchema.default("agent.handoff"),created_at:Vi.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),completed_at:Vi.nullable(Vi.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),id:Vi.string().optional(),previous_agent_id:Vi.string(),previous_agent_name:Vi.string(),next_agent_id:Vi.string(),next_agent_name:Vi.string()}).transform(t=>(0,YOt.remap)(t,{created_at:"createdAt",completed_at:"completedAt",previous_agent_id:"previousAgentId",previous_agent_name:"previousAgentName",next_agent_id:"nextAgentId",next_agent_name:"nextAgentName"}));On.AgentHandoffEntry$outboundSchema=Vi.object({object:On.AgentHandoffEntryObject$outboundSchema.default("entry"),type:On.AgentHandoffEntryType$outboundSchema.default("agent.handoff"),createdAt:Vi.date().transform(t=>t.toISOString()).optional(),completedAt:Vi.nullable(Vi.date().transform(t=>t.toISOString())).optional(),id:Vi.string().optional(),previousAgentId:Vi.string(),previousAgentName:Vi.string(),nextAgentId:Vi.string(),nextAgentName:Vi.string()}).transform(t=>(0,YOt.remap)(t,{createdAt:"created_at",completedAt:"completed_at",previousAgentId:"previous_agent_id",previousAgentName:"previous_agent_name",nextAgentId:"next_agent_id",nextAgentName:"next_agent_name"}));var VOt;(function(t){t.inboundSchema=On.AgentHandoffEntry$inboundSchema,t.outboundSchema=On.AgentHandoffEntry$outboundSchema})(VOt||(On.AgentHandoffEntry$=VOt={}));function RJl(t){return JSON.stringify(On.AgentHandoffEntry$outboundSchema.parse(t))}function yJl(t){return(0,gJl.safeParse)(t,e=>On.AgentHandoffEntry$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentHandoffEntry' from JSON")}});var OUe=f(BI=>{"use strict";var AJl=BI&&BI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),FJl=BI&&BI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vJl=BI&&BI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&AJl(e,t,n);return FJl(e,t),e};Object.defineProperty(BI,"__esModule",{value:!0});BI.AgentHandoffStartedEvent$=BI.AgentHandoffStartedEvent$outboundSchema=BI.AgentHandoffStartedEvent$inboundSchema=BI.AgentHandoffStartedEventType$=BI.AgentHandoffStartedEventType$outboundSchema=BI.AgentHandoffStartedEventType$inboundSchema=BI.AgentHandoffStartedEventType=void 0;BI.agentHandoffStartedEventToJSON=XJl;BI.agentHandoffStartedEventFromJSON=wJl;var lZ=vJl(se()),yOt=be(),fJl=oe();BI.AgentHandoffStartedEventType={AgentHandoffStarted:"agent.handoff.started"};BI.AgentHandoffStartedEventType$inboundSchema=lZ.nativeEnum(BI.AgentHandoffStartedEventType);BI.AgentHandoffStartedEventType$outboundSchema=BI.AgentHandoffStartedEventType$inboundSchema;var gOt;(function(t){t.inboundSchema=BI.AgentHandoffStartedEventType$inboundSchema,t.outboundSchema=BI.AgentHandoffStartedEventType$outboundSchema})(gOt||(BI.AgentHandoffStartedEventType$=gOt={}));BI.AgentHandoffStartedEvent$inboundSchema=lZ.object({type:BI.AgentHandoffStartedEventType$inboundSchema.default("agent.handoff.started"),created_at:lZ.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),output_index:lZ.number().int().default(0),id:lZ.string(),previous_agent_id:lZ.string(),previous_agent_name:lZ.string()}).transform(t=>(0,yOt.remap)(t,{created_at:"createdAt",output_index:"outputIndex",previous_agent_id:"previousAgentId",previous_agent_name:"previousAgentName"}));BI.AgentHandoffStartedEvent$outboundSchema=lZ.object({type:BI.AgentHandoffStartedEventType$outboundSchema.default("agent.handoff.started"),createdAt:lZ.date().transform(t=>t.toISOString()).optional(),outputIndex:lZ.number().int().default(0),id:lZ.string(),previousAgentId:lZ.string(),previousAgentName:lZ.string()}).transform(t=>(0,yOt.remap)(t,{createdAt:"created_at",outputIndex:"output_index",previousAgentId:"previous_agent_id",previousAgentName:"previous_agent_name"}));var ROt;(function(t){t.inboundSchema=BI.AgentHandoffStartedEvent$inboundSchema,t.outboundSchema=BI.AgentHandoffStartedEvent$outboundSchema})(ROt||(BI.AgentHandoffStartedEvent$=ROt={}));function XJl(t){return JSON.stringify(BI.AgentHandoffStartedEvent$outboundSchema.parse(t))}function wJl(t){return(0,fJl.safeParse)(t,e=>BI.AgentHandoffStartedEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentHandoffStartedEvent' from JSON")}});var nJ=f(SI=>{"use strict";var HJl=SI&&SI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),QJl=SI&&SI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),EJl=SI&&SI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&HJl(e,t,n);return QJl(e,t),e};Object.defineProperty(SI,"__esModule",{value:!0});SI.DocumentURLChunk$=SI.DocumentURLChunk$outboundSchema=SI.DocumentURLChunk$inboundSchema=SI.DocumentURLChunkType$=SI.DocumentURLChunkType$outboundSchema=SI.DocumentURLChunkType$inboundSchema=SI.DocumentURLChunkType=void 0;SI.documentURLChunkToJSON=CJl;SI.documentURLChunkFromJSON=LJl;var p0=EJl(se()),vOt=be(),JJl=oe();SI.DocumentURLChunkType={DocumentUrl:"document_url"};SI.DocumentURLChunkType$inboundSchema=p0.nativeEnum(SI.DocumentURLChunkType);SI.DocumentURLChunkType$outboundSchema=SI.DocumentURLChunkType$inboundSchema;var AOt;(function(t){t.inboundSchema=SI.DocumentURLChunkType$inboundSchema,t.outboundSchema=SI.DocumentURLChunkType$outboundSchema})(AOt||(SI.DocumentURLChunkType$=AOt={}));SI.DocumentURLChunk$inboundSchema=p0.object({document_url:p0.string(),document_name:p0.nullable(p0.string()).optional(),type:SI.DocumentURLChunkType$inboundSchema.default("document_url")}).transform(t=>(0,vOt.remap)(t,{document_url:"documentUrl",document_name:"documentName"}));SI.DocumentURLChunk$outboundSchema=p0.object({documentUrl:p0.string(),documentName:p0.nullable(p0.string()).optional(),type:SI.DocumentURLChunkType$outboundSchema.default("document_url")}).transform(t=>(0,vOt.remap)(t,{documentUrl:"document_url",documentName:"document_name"}));var FOt;(function(t){t.inboundSchema=SI.DocumentURLChunk$inboundSchema,t.outboundSchema=SI.DocumentURLChunk$outboundSchema})(FOt||(SI.DocumentURLChunk$=FOt={}));function CJl(t){return JSON.stringify(SI.DocumentURLChunk$outboundSchema.parse(t))}function LJl(t){return(0,JJl.safeParse)(t,e=>SI.DocumentURLChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DocumentURLChunk' from JSON")}});var Nde=f(Yi=>{"use strict";var kJl=Yi&&Yi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),xJl=Yi&&Yi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jJl=Yi&&Yi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&kJl(e,t,n);return xJl(e,t),e};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.FileChunk$=Yi.FileChunk$outboundSchema=Yi.FileChunk$inboundSchema=void 0;Yi.fileChunkToJSON=UJl;Yi.fileChunkFromJSON=zJl;var jj=jJl(se()),XOt=be(),OJl=oe();Yi.FileChunk$inboundSchema=jj.object({type:jj.literal("file").default("file"),file_id:jj.string()}).transform(t=>(0,XOt.remap)(t,{file_id:"fileId"}));Yi.FileChunk$outboundSchema=jj.object({type:jj.literal("file").default("file"),fileId:jj.string()}).transform(t=>(0,XOt.remap)(t,{fileId:"file_id"}));var fOt;(function(t){t.inboundSchema=Yi.FileChunk$inboundSchema,t.outboundSchema=Yi.FileChunk$outboundSchema})(fOt||(Yi.FileChunk$=fOt={}));function UJl(t){return JSON.stringify(Yi.FileChunk$outboundSchema.parse(t))}function zJl(t){return(0,OJl.safeParse)(t,e=>Yi.FileChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FileChunk' from JSON")}});var UUe=f(gi=>{"use strict";var BJl=gi&&gi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),SJl=gi&&gi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MJl=gi&&gi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&BJl(e,t,n);return SJl(e,t),e};Object.defineProperty(gi,"__esModule",{value:!0});gi.ImageURL$=gi.ImageURL$outboundSchema=gi.ImageURL$inboundSchema=void 0;gi.imageURLToJSON=DJl;gi.imageURLFromJSON=KJl;var ew=MJl(se()),TJl=oe();gi.ImageURL$inboundSchema=ew.object({url:ew.string(),detail:ew.nullable(ew.string()).optional()});gi.ImageURL$outboundSchema=ew.object({url:ew.string(),detail:ew.nullable(ew.string()).optional()});var wOt;(function(t){t.inboundSchema=gi.ImageURL$inboundSchema,t.outboundSchema=gi.ImageURL$outboundSchema})(wOt||(gi.ImageURL$=wOt={}));function DJl(t){return JSON.stringify(gi.ImageURL$outboundSchema.parse(t))}function KJl(t){return(0,TJl.safeParse)(t,e=>gi.ImageURL$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ImageURL' from JSON")}});var lJ=f(ll=>{"use strict";var _Jl=ll&&ll.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),PJl=ll&&ll.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qJl=ll&&ll.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_Jl(e,t,n);return PJl(e,t),e};Object.defineProperty(ll,"__esModule",{value:!0});ll.ImageURLChunk$=ll.ImageURLChunk$outboundSchema=ll.ImageURLChunk$inboundSchema=ll.ImageURLChunkType$=ll.ImageURLChunkType$outboundSchema=ll.ImageURLChunkType$inboundSchema=ll.ImageURLChunkImageURL$=ll.ImageURLChunkImageURL$outboundSchema=ll.ImageURLChunkImageURL$inboundSchema=ll.ImageURLChunkType=void 0;ll.imageURLChunkImageURLToJSON=$Jl;ll.imageURLChunkImageURLFromJSON=eCl;ll.imageURLChunkToJSON=tCl;ll.imageURLChunkFromJSON=nCl;var zV=qJl(se()),JOt=be(),COt=oe(),Vde=UUe();ll.ImageURLChunkType={ImageUrl:"image_url"};ll.ImageURLChunkImageURL$inboundSchema=zV.union([Vde.ImageURL$inboundSchema,zV.string()]);ll.ImageURLChunkImageURL$outboundSchema=zV.union([Vde.ImageURL$outboundSchema,zV.string()]);var HOt;(function(t){t.inboundSchema=ll.ImageURLChunkImageURL$inboundSchema,t.outboundSchema=ll.ImageURLChunkImageURL$outboundSchema})(HOt||(ll.ImageURLChunkImageURL$=HOt={}));function $Jl(t){return JSON.stringify(ll.ImageURLChunkImageURL$outboundSchema.parse(t))}function eCl(t){return(0,COt.safeParse)(t,e=>ll.ImageURLChunkImageURL$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ImageURLChunkImageURL' from JSON")}ll.ImageURLChunkType$inboundSchema=zV.nativeEnum(ll.ImageURLChunkType);ll.ImageURLChunkType$outboundSchema=ll.ImageURLChunkType$inboundSchema;var QOt;(function(t){t.inboundSchema=ll.ImageURLChunkType$inboundSchema,t.outboundSchema=ll.ImageURLChunkType$outboundSchema})(QOt||(ll.ImageURLChunkType$=QOt={}));ll.ImageURLChunk$inboundSchema=zV.object({image_url:zV.union([Vde.ImageURL$inboundSchema,zV.string()]),type:ll.ImageURLChunkType$inboundSchema.default("image_url")}).transform(t=>(0,JOt.remap)(t,{image_url:"imageUrl"}));ll.ImageURLChunk$outboundSchema=zV.object({imageUrl:zV.union([Vde.ImageURL$outboundSchema,zV.string()]),type:ll.ImageURLChunkType$outboundSchema.default("image_url")}).transform(t=>(0,JOt.remap)(t,{imageUrl:"image_url"}));var EOt;(function(t){t.inboundSchema=ll.ImageURLChunk$inboundSchema,t.outboundSchema=ll.ImageURLChunk$outboundSchema})(EOt||(ll.ImageURLChunk$=EOt={}));function tCl(t){return JSON.stringify(ll.ImageURLChunk$outboundSchema.parse(t))}function nCl(t){return(0,COt.safeParse)(t,e=>ll.ImageURLChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ImageURLChunk' from JSON")}});var zUe=f(MI=>{"use strict";var lCl=MI&&MI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ICl=MI&&MI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aCl=MI&&MI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&lCl(e,t,n);return ICl(e,t),e};Object.defineProperty(MI,"__esModule",{value:!0});MI.ReferenceChunk$=MI.ReferenceChunk$outboundSchema=MI.ReferenceChunk$inboundSchema=MI.ReferenceChunkType$=MI.ReferenceChunkType$outboundSchema=MI.ReferenceChunkType$inboundSchema=MI.ReferenceChunkType=void 0;MI.referenceChunkToJSON=cCl;MI.referenceChunkFromJSON=oCl;var IJ=aCl(se()),xOt=be(),rCl=oe();MI.ReferenceChunkType={Reference:"reference"};MI.ReferenceChunkType$inboundSchema=IJ.nativeEnum(MI.ReferenceChunkType);MI.ReferenceChunkType$outboundSchema=MI.ReferenceChunkType$inboundSchema;var LOt;(function(t){t.inboundSchema=MI.ReferenceChunkType$inboundSchema,t.outboundSchema=MI.ReferenceChunkType$outboundSchema})(LOt||(MI.ReferenceChunkType$=LOt={}));MI.ReferenceChunk$inboundSchema=IJ.object({reference_ids:IJ.array(IJ.number().int()),type:MI.ReferenceChunkType$inboundSchema.default("reference")}).transform(t=>(0,xOt.remap)(t,{reference_ids:"referenceIds"}));MI.ReferenceChunk$outboundSchema=IJ.object({referenceIds:IJ.array(IJ.number().int()),type:MI.ReferenceChunkType$outboundSchema.default("reference")}).transform(t=>(0,xOt.remap)(t,{referenceIds:"reference_ids"}));var kOt;(function(t){t.inboundSchema=MI.ReferenceChunk$inboundSchema,t.outboundSchema=MI.ReferenceChunk$outboundSchema})(kOt||(MI.ReferenceChunk$=kOt={}));function cCl(t){return JSON.stringify(MI.ReferenceChunk$outboundSchema.parse(t))}function oCl(t){return(0,rCl.safeParse)(t,e=>MI.ReferenceChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ReferenceChunk' from JSON")}});var aJ=f(TI=>{"use strict";var iCl=TI&&TI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),sCl=TI&&TI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uCl=TI&&TI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&iCl(e,t,n);return sCl(e,t),e};Object.defineProperty(TI,"__esModule",{value:!0});TI.TextChunk$=TI.TextChunk$outboundSchema=TI.TextChunk$inboundSchema=TI.TextChunkType$=TI.TextChunkType$outboundSchema=TI.TextChunkType$inboundSchema=TI.TextChunkType=void 0;TI.textChunkToJSON=GCl;TI.textChunkFromJSON=bCl;var o_=uCl(se()),dCl=oe();TI.TextChunkType={Text:"text"};TI.TextChunkType$inboundSchema=o_.nativeEnum(TI.TextChunkType);TI.TextChunkType$outboundSchema=TI.TextChunkType$inboundSchema;var jOt;(function(t){t.inboundSchema=TI.TextChunkType$inboundSchema,t.outboundSchema=TI.TextChunkType$outboundSchema})(jOt||(TI.TextChunkType$=jOt={}));TI.TextChunk$inboundSchema=o_.object({text:o_.string(),type:TI.TextChunkType$inboundSchema.default("text")});TI.TextChunk$outboundSchema=o_.object({text:o_.string(),type:TI.TextChunkType$outboundSchema.default("text")});var OOt;(function(t){t.inboundSchema=TI.TextChunk$inboundSchema,t.outboundSchema=TI.TextChunk$outboundSchema})(OOt||(TI.TextChunk$=OOt={}));function GCl(t){return JSON.stringify(TI.TextChunk$outboundSchema.parse(t))}function bCl(t){return(0,dCl.safeParse)(t,e=>TI.TextChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'TextChunk' from JSON")}});var Oj=f(Ri=>{"use strict";var mCl=Ri&&Ri.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),pCl=Ri&&Ri.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),hCl=Ri&&Ri.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&mCl(e,t,n);return pCl(e,t),e};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ContentChunk$=Ri.ContentChunk$outboundSchema=Ri.ContentChunk$inboundSchema=void 0;Ri.contentChunkToJSON=WCl;Ri.contentChunkFromJSON=NCl;var Jo=hCl(se()),ZCl=oe(),zOt=nJ(),BOt=Nde(),SOt=lJ(),MOt=zUe(),TOt=aJ();Ri.ContentChunk$inboundSchema=Jo.union([SOt.ImageURLChunk$inboundSchema.and(Jo.object({type:Jo.literal("image_url")}).transform(t=>({type:t.type}))),TOt.TextChunk$inboundSchema.and(Jo.object({type:Jo.literal("text")}).transform(t=>({type:t.type}))),MOt.ReferenceChunk$inboundSchema.and(Jo.object({type:Jo.literal("reference")}).transform(t=>({type:t.type}))),BOt.FileChunk$inboundSchema.and(Jo.object({type:Jo.literal("file")}).transform(t=>({type:t.type}))),zOt.DocumentURLChunk$inboundSchema.and(Jo.object({type:Jo.literal("document_url")}).transform(t=>({type:t.type})))]);Ri.ContentChunk$outboundSchema=Jo.union([SOt.ImageURLChunk$outboundSchema.and(Jo.object({type:Jo.literal("image_url")}).transform(t=>({type:t.type}))),TOt.TextChunk$outboundSchema.and(Jo.object({type:Jo.literal("text")}).transform(t=>({type:t.type}))),MOt.ReferenceChunk$outboundSchema.and(Jo.object({type:Jo.literal("reference")}).transform(t=>({type:t.type}))),BOt.FileChunk$outboundSchema.and(Jo.object({type:Jo.literal("file")}).transform(t=>({type:t.type}))),zOt.DocumentURLChunk$outboundSchema.and(Jo.object({type:Jo.literal("document_url")}).transform(t=>({type:t.type})))]);var UOt;(function(t){t.inboundSchema=Ri.ContentChunk$inboundSchema,t.outboundSchema=Ri.ContentChunk$outboundSchema})(UOt||(Ri.ContentChunk$=UOt={}));function WCl(t){return JSON.stringify(Ri.ContentChunk$outboundSchema.parse(t))}function NCl(t){return(0,ZCl.safeParse)(t,e=>Ri.ContentChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ContentChunk' from JSON")}});var BUe=f(za=>{"use strict";var VCl=za&&za.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),YCl=za&&za.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gCl=za&&za.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&VCl(e,t,n);return YCl(e,t),e};Object.defineProperty(za,"__esModule",{value:!0});za.FunctionCall$=za.FunctionCall$outboundSchema=za.FunctionCall$inboundSchema=za.Arguments$=za.Arguments$outboundSchema=za.Arguments$inboundSchema=void 0;za.argumentsToJSON=RCl;za.argumentsFromJSON=yCl;za.functionCallToJSON=ACl;za.functionCallFromJSON=FCl;var yi=gCl(se()),_Ot=oe();za.Arguments$inboundSchema=yi.union([yi.record(yi.any()),yi.string()]);za.Arguments$outboundSchema=yi.union([yi.record(yi.any()),yi.string()]);var DOt;(function(t){t.inboundSchema=za.Arguments$inboundSchema,t.outboundSchema=za.Arguments$outboundSchema})(DOt||(za.Arguments$=DOt={}));function RCl(t){return JSON.stringify(za.Arguments$outboundSchema.parse(t))}function yCl(t){return(0,_Ot.safeParse)(t,e=>za.Arguments$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Arguments' from JSON")}za.FunctionCall$inboundSchema=yi.object({name:yi.string(),arguments:yi.union([yi.record(yi.any()),yi.string()])});za.FunctionCall$outboundSchema=yi.object({name:yi.string(),arguments:yi.union([yi.record(yi.any()),yi.string()])});var KOt;(function(t){t.inboundSchema=za.FunctionCall$inboundSchema,t.outboundSchema=za.FunctionCall$outboundSchema})(KOt||(za.FunctionCall$=KOt={}));function ACl(t){return JSON.stringify(za.FunctionCall$outboundSchema.parse(t))}function FCl(t){return(0,_Ot.safeParse)(t,e=>za.FunctionCall$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionCall' from JSON")}});var BV=f(SUe=>{"use strict";Object.defineProperty(SUe,"__esModule",{value:!0});SUe.catchUnrecognizedEnum=vCl;function vCl(t){return t}});var i_=f(Ai=>{"use strict";var fCl=Ai&&Ai.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),XCl=Ai&&Ai.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wCl=Ai&&Ai.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&fCl(e,t,n);return XCl(e,t),e};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ToolTypes$=Ai.ToolTypes$outboundSchema=Ai.ToolTypes$inboundSchema=Ai.ToolTypes=void 0;var rJ=wCl(se()),HCl=BV();Ai.ToolTypes={Function:"function"};Ai.ToolTypes$inboundSchema=rJ.union([rJ.nativeEnum(Ai.ToolTypes),rJ.string().transform(HCl.catchUnrecognizedEnum)]);Ai.ToolTypes$outboundSchema=rJ.union([rJ.nativeEnum(Ai.ToolTypes),rJ.string().and(rJ.custom())]);var POt;(function(t){t.inboundSchema=Ai.ToolTypes$inboundSchema,t.outboundSchema=Ai.ToolTypes$outboundSchema})(POt||(Ai.ToolTypes$=POt={}))});var Yde=f(Fi=>{"use strict";var QCl=Fi&&Fi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ECl=Fi&&Fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),JCl=Fi&&Fi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&QCl(e,t,n);return ECl(e,t),e};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ToolCall$=Fi.ToolCall$outboundSchema=Fi.ToolCall$inboundSchema=void 0;Fi.toolCallToJSON=LCl;Fi.toolCallFromJSON=kCl;var Uj=JCl(se()),CCl=oe(),$Ot=BUe(),eUt=i_();Fi.ToolCall$inboundSchema=Uj.object({id:Uj.string().default("null"),type:eUt.ToolTypes$inboundSchema.optional(),function:$Ot.FunctionCall$inboundSchema,index:Uj.number().int().default(0)});Fi.ToolCall$outboundSchema=Uj.object({id:Uj.string().default("null"),type:eUt.ToolTypes$outboundSchema.optional(),function:$Ot.FunctionCall$outboundSchema,index:Uj.number().int().default(0)});var qOt;(function(t){t.inboundSchema=Fi.ToolCall$inboundSchema,t.outboundSchema=Fi.ToolCall$outboundSchema})(qOt||(Fi.ToolCall$=qOt={}));function LCl(t){return JSON.stringify(Fi.ToolCall$outboundSchema.parse(t))}function kCl(t){return(0,CCl.safeParse)(t,e=>Fi.ToolCall$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolCall' from JSON")}});var bR=f(Il=>{"use strict";var xCl=Il&&Il.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jCl=Il&&Il.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OCl=Il&&Il.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xCl(e,t,n);return jCl(e,t),e};Object.defineProperty(Il,"__esModule",{value:!0});Il.AssistantMessage$=Il.AssistantMessage$outboundSchema=Il.AssistantMessage$inboundSchema=Il.AssistantMessageRole$=Il.AssistantMessageRole$outboundSchema=Il.AssistantMessageRole$inboundSchema=Il.AssistantMessageContent$=Il.AssistantMessageContent$outboundSchema=Il.AssistantMessageContent$inboundSchema=Il.AssistantMessageRole=void 0;Il.assistantMessageContentToJSON=UCl;Il.assistantMessageContentFromJSON=zCl;Il.assistantMessageToJSON=BCl;Il.assistantMessageFromJSON=SCl;var ho=OCl(se()),IUt=be(),aUt=oe(),gde=Oj(),rUt=Yde();Il.AssistantMessageRole={Assistant:"assistant"};Il.AssistantMessageContent$inboundSchema=ho.union([ho.string(),ho.array(gde.ContentChunk$inboundSchema)]);Il.AssistantMessageContent$outboundSchema=ho.union([ho.string(),ho.array(gde.ContentChunk$outboundSchema)]);var tUt;(function(t){t.inboundSchema=Il.AssistantMessageContent$inboundSchema,t.outboundSchema=Il.AssistantMessageContent$outboundSchema})(tUt||(Il.AssistantMessageContent$=tUt={}));function UCl(t){return JSON.stringify(Il.AssistantMessageContent$outboundSchema.parse(t))}function zCl(t){return(0,aUt.safeParse)(t,e=>Il.AssistantMessageContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AssistantMessageContent' from JSON")}Il.AssistantMessageRole$inboundSchema=ho.nativeEnum(Il.AssistantMessageRole);Il.AssistantMessageRole$outboundSchema=Il.AssistantMessageRole$inboundSchema;var nUt;(function(t){t.inboundSchema=Il.AssistantMessageRole$inboundSchema,t.outboundSchema=Il.AssistantMessageRole$outboundSchema})(nUt||(Il.AssistantMessageRole$=nUt={}));Il.AssistantMessage$inboundSchema=ho.object({content:ho.nullable(ho.union([ho.string(),ho.array(gde.ContentChunk$inboundSchema)])).optional(),tool_calls:ho.nullable(ho.array(rUt.ToolCall$inboundSchema)).optional(),prefix:ho.boolean().default(!1),role:Il.AssistantMessageRole$inboundSchema.default("assistant")}).transform(t=>(0,IUt.remap)(t,{tool_calls:"toolCalls"}));Il.AssistantMessage$outboundSchema=ho.object({content:ho.nullable(ho.union([ho.string(),ho.array(gde.ContentChunk$outboundSchema)])).optional(),toolCalls:ho.nullable(ho.array(rUt.ToolCall$outboundSchema)).optional(),prefix:ho.boolean().default(!1),role:Il.AssistantMessageRole$outboundSchema.default("assistant")}).transform(t=>(0,IUt.remap)(t,{toolCalls:"tool_calls"}));var lUt;(function(t){t.inboundSchema=Il.AssistantMessage$inboundSchema,t.outboundSchema=Il.AssistantMessage$outboundSchema})(lUt||(Il.AssistantMessage$=lUt={}));function BCl(t){return JSON.stringify(Il.AssistantMessage$outboundSchema.parse(t))}function SCl(t){return(0,aUt.safeParse)(t,e=>Il.AssistantMessage$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AssistantMessage' from JSON")}});var zj=f(vi=>{"use strict";var MCl=vi&&vi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),TCl=vi&&vi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),DCl=vi&&vi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&MCl(e,t,n);return TCl(e,t),e};Object.defineProperty(vi,"__esModule",{value:!0});vi.MistralPromptMode$=vi.MistralPromptMode$outboundSchema=vi.MistralPromptMode$inboundSchema=vi.MistralPromptMode=void 0;var cJ=DCl(se()),KCl=BV();vi.MistralPromptMode={Reasoning:"reasoning"};vi.MistralPromptMode$inboundSchema=cJ.union([cJ.nativeEnum(vi.MistralPromptMode),cJ.string().transform(KCl.catchUnrecognizedEnum)]);vi.MistralPromptMode$outboundSchema=cJ.union([cJ.nativeEnum(vi.MistralPromptMode),cJ.string().and(cJ.custom())]);var cUt;(function(t){t.inboundSchema=vi.MistralPromptMode$inboundSchema,t.outboundSchema=vi.MistralPromptMode$outboundSchema})(cUt||(vi.MistralPromptMode$=cUt={}))});var h0=f(al=>{"use strict";var _Cl=al&&al.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),PCl=al&&al.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qCl=al&&al.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_Cl(e,t,n);return PCl(e,t),e};Object.defineProperty(al,"__esModule",{value:!0});al.SystemMessage$=al.SystemMessage$outboundSchema=al.SystemMessage$inboundSchema=al.Role$=al.Role$outboundSchema=al.Role$inboundSchema=al.SystemMessageContent$=al.SystemMessageContent$outboundSchema=al.SystemMessageContent$inboundSchema=al.Role=void 0;al.systemMessageContentToJSON=$Cl;al.systemMessageContentFromJSON=e5l;al.systemMessageToJSON=t5l;al.systemMessageFromJSON=n5l;var ym=qCl(se()),uUt=oe(),Rde=aJ();al.Role={System:"system"};al.SystemMessageContent$inboundSchema=ym.union([ym.string(),ym.array(Rde.TextChunk$inboundSchema)]);al.SystemMessageContent$outboundSchema=ym.union([ym.string(),ym.array(Rde.TextChunk$outboundSchema)]);var oUt;(function(t){t.inboundSchema=al.SystemMessageContent$inboundSchema,t.outboundSchema=al.SystemMessageContent$outboundSchema})(oUt||(al.SystemMessageContent$=oUt={}));function $Cl(t){return JSON.stringify(al.SystemMessageContent$outboundSchema.parse(t))}function e5l(t){return(0,uUt.safeParse)(t,e=>al.SystemMessageContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'SystemMessageContent' from JSON")}al.Role$inboundSchema=ym.nativeEnum(al.Role);al.Role$outboundSchema=al.Role$inboundSchema;var iUt;(function(t){t.inboundSchema=al.Role$inboundSchema,t.outboundSchema=al.Role$outboundSchema})(iUt||(al.Role$=iUt={}));al.SystemMessage$inboundSchema=ym.object({content:ym.union([ym.string(),ym.array(Rde.TextChunk$inboundSchema)]),role:al.Role$inboundSchema.default("system")});al.SystemMessage$outboundSchema=ym.object({content:ym.union([ym.string(),ym.array(Rde.TextChunk$outboundSchema)]),role:al.Role$outboundSchema.default("system")});var sUt;(function(t){t.inboundSchema=al.SystemMessage$inboundSchema,t.outboundSchema=al.SystemMessage$outboundSchema})(sUt||(al.SystemMessage$=sUt={}));function t5l(t){return JSON.stringify(al.SystemMessage$outboundSchema.parse(t))}function n5l(t){return(0,uUt.safeParse)(t,e=>al.SystemMessage$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'SystemMessage' from JSON")}});var Bj=f(fi=>{"use strict";var l5l=fi&&fi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),I5l=fi&&fi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a5l=fi&&fi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&l5l(e,t,n);return I5l(e,t),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.Tool$=fi.Tool$outboundSchema=fi.Tool$inboundSchema=void 0;fi.toolToJSON=c5l;fi.toolFromJSON=o5l;var GUt=a5l(se()),r5l=oe(),bUt=cde(),mUt=i_();fi.Tool$inboundSchema=GUt.object({type:mUt.ToolTypes$inboundSchema.optional(),function:bUt.FunctionT$inboundSchema});fi.Tool$outboundSchema=GUt.object({type:mUt.ToolTypes$outboundSchema.optional(),function:bUt.FunctionT$outboundSchema});var dUt;(function(t){t.inboundSchema=fi.Tool$inboundSchema,t.outboundSchema=fi.Tool$outboundSchema})(dUt||(fi.Tool$=dUt={}));function c5l(t){return JSON.stringify(fi.Tool$outboundSchema.parse(t))}function o5l(t){return(0,r5l.safeParse)(t,e=>fi.Tool$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Tool' from JSON")}});var MUe=f(Xi=>{"use strict";var i5l=Xi&&Xi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),s5l=Xi&&Xi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),u5l=Xi&&Xi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&i5l(e,t,n);return s5l(e,t),e};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.FunctionName$=Xi.FunctionName$outboundSchema=Xi.FunctionName$inboundSchema=void 0;Xi.functionNameToJSON=G5l;Xi.functionNameFromJSON=b5l;var yde=u5l(se()),d5l=oe();Xi.FunctionName$inboundSchema=yde.object({name:yde.string()});Xi.FunctionName$outboundSchema=yde.object({name:yde.string()});var pUt;(function(t){t.inboundSchema=Xi.FunctionName$inboundSchema,t.outboundSchema=Xi.FunctionName$outboundSchema})(pUt||(Xi.FunctionName$=pUt={}));function G5l(t){return JSON.stringify(Xi.FunctionName$outboundSchema.parse(t))}function b5l(t){return(0,d5l.safeParse)(t,e=>Xi.FunctionName$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionName' from JSON")}});var Sj=f(wi=>{"use strict";var m5l=wi&&wi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),p5l=wi&&wi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),h5l=wi&&wi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&m5l(e,t,n);return p5l(e,t),e};Object.defineProperty(wi,"__esModule",{value:!0});wi.ToolChoice$=wi.ToolChoice$outboundSchema=wi.ToolChoice$inboundSchema=void 0;wi.toolChoiceToJSON=W5l;wi.toolChoiceFromJSON=N5l;var ZUt=h5l(se()),Z5l=oe(),WUt=MUe(),NUt=i_();wi.ToolChoice$inboundSchema=ZUt.object({type:NUt.ToolTypes$inboundSchema.optional(),function:WUt.FunctionName$inboundSchema});wi.ToolChoice$outboundSchema=ZUt.object({type:NUt.ToolTypes$outboundSchema.optional(),function:WUt.FunctionName$outboundSchema});var hUt;(function(t){t.inboundSchema=wi.ToolChoice$inboundSchema,t.outboundSchema=wi.ToolChoice$outboundSchema})(hUt||(wi.ToolChoice$=hUt={}));function W5l(t){return JSON.stringify(wi.ToolChoice$outboundSchema.parse(t))}function N5l(t){return(0,Z5l.safeParse)(t,e=>wi.ToolChoice$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolChoice' from JSON")}});var Z0=f(rl=>{"use strict";var V5l=rl&&rl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Y5l=rl&&rl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g5l=rl&&rl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&V5l(e,t,n);return Y5l(e,t),e};Object.defineProperty(rl,"__esModule",{value:!0});rl.ToolMessage$=rl.ToolMessage$outboundSchema=rl.ToolMessage$inboundSchema=rl.ToolMessageRole$=rl.ToolMessageRole$outboundSchema=rl.ToolMessageRole$inboundSchema=rl.ToolMessageContent$=rl.ToolMessageContent$outboundSchema=rl.ToolMessageContent$inboundSchema=rl.ToolMessageRole=void 0;rl.toolMessageContentToJSON=R5l;rl.toolMessageContentFromJSON=y5l;rl.toolMessageToJSON=A5l;rl.toolMessageFromJSON=F5l;var Cc=g5l(se()),RUt=be(),yUt=oe(),Ade=Oj();rl.ToolMessageRole={Tool:"tool"};rl.ToolMessageContent$inboundSchema=Cc.union([Cc.string(),Cc.array(Ade.ContentChunk$inboundSchema)]);rl.ToolMessageContent$outboundSchema=Cc.union([Cc.string(),Cc.array(Ade.ContentChunk$outboundSchema)]);var VUt;(function(t){t.inboundSchema=rl.ToolMessageContent$inboundSchema,t.outboundSchema=rl.ToolMessageContent$outboundSchema})(VUt||(rl.ToolMessageContent$=VUt={}));function R5l(t){return JSON.stringify(rl.ToolMessageContent$outboundSchema.parse(t))}function y5l(t){return(0,yUt.safeParse)(t,e=>rl.ToolMessageContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolMessageContent' from JSON")}rl.ToolMessageRole$inboundSchema=Cc.nativeEnum(rl.ToolMessageRole);rl.ToolMessageRole$outboundSchema=rl.ToolMessageRole$inboundSchema;var YUt;(function(t){t.inboundSchema=rl.ToolMessageRole$inboundSchema,t.outboundSchema=rl.ToolMessageRole$outboundSchema})(YUt||(rl.ToolMessageRole$=YUt={}));rl.ToolMessage$inboundSchema=Cc.object({content:Cc.nullable(Cc.union([Cc.string(),Cc.array(Ade.ContentChunk$inboundSchema)])),tool_call_id:Cc.nullable(Cc.string()).optional(),name:Cc.nullable(Cc.string()).optional(),role:rl.ToolMessageRole$inboundSchema.default("tool")}).transform(t=>(0,RUt.remap)(t,{tool_call_id:"toolCallId"}));rl.ToolMessage$outboundSchema=Cc.object({content:Cc.nullable(Cc.union([Cc.string(),Cc.array(Ade.ContentChunk$outboundSchema)])),toolCallId:Cc.nullable(Cc.string()).optional(),name:Cc.nullable(Cc.string()).optional(),role:rl.ToolMessageRole$outboundSchema.default("tool")}).transform(t=>(0,RUt.remap)(t,{toolCallId:"tool_call_id"}));var gUt;(function(t){t.inboundSchema=rl.ToolMessage$inboundSchema,t.outboundSchema=rl.ToolMessage$outboundSchema})(gUt||(rl.ToolMessage$=gUt={}));function A5l(t){return JSON.stringify(rl.ToolMessage$outboundSchema.parse(t))}function F5l(t){return(0,yUt.safeParse)(t,e=>rl.ToolMessage$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolMessage' from JSON")}});var W0=f(cl=>{"use strict";var v5l=cl&&cl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),f5l=cl&&cl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),X5l=cl&&cl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&v5l(e,t,n);return f5l(e,t),e};Object.defineProperty(cl,"__esModule",{value:!0});cl.UserMessage$=cl.UserMessage$outboundSchema=cl.UserMessage$inboundSchema=cl.UserMessageRole$=cl.UserMessageRole$outboundSchema=cl.UserMessageRole$inboundSchema=cl.UserMessageContent$=cl.UserMessageContent$outboundSchema=cl.UserMessageContent$inboundSchema=cl.UserMessageRole=void 0;cl.userMessageContentToJSON=w5l;cl.userMessageContentFromJSON=H5l;cl.userMessageToJSON=Q5l;cl.userMessageFromJSON=E5l;var QG=X5l(se()),fUt=oe(),Fde=Oj();cl.UserMessageRole={User:"user"};cl.UserMessageContent$inboundSchema=QG.union([QG.string(),QG.array(Fde.ContentChunk$inboundSchema)]);cl.UserMessageContent$outboundSchema=QG.union([QG.string(),QG.array(Fde.ContentChunk$outboundSchema)]);var AUt;(function(t){t.inboundSchema=cl.UserMessageContent$inboundSchema,t.outboundSchema=cl.UserMessageContent$outboundSchema})(AUt||(cl.UserMessageContent$=AUt={}));function w5l(t){return JSON.stringify(cl.UserMessageContent$outboundSchema.parse(t))}function H5l(t){return(0,fUt.safeParse)(t,e=>cl.UserMessageContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'UserMessageContent' from JSON")}cl.UserMessageRole$inboundSchema=QG.nativeEnum(cl.UserMessageRole);cl.UserMessageRole$outboundSchema=cl.UserMessageRole$inboundSchema;var FUt;(function(t){t.inboundSchema=cl.UserMessageRole$inboundSchema,t.outboundSchema=cl.UserMessageRole$outboundSchema})(FUt||(cl.UserMessageRole$=FUt={}));cl.UserMessage$inboundSchema=QG.object({content:QG.nullable(QG.union([QG.string(),QG.array(Fde.ContentChunk$inboundSchema)])),role:cl.UserMessageRole$inboundSchema.default("user")});cl.UserMessage$outboundSchema=QG.object({content:QG.nullable(QG.union([QG.string(),QG.array(Fde.ContentChunk$outboundSchema)])),role:cl.UserMessageRole$outboundSchema.default("user")});var vUt;(function(t){t.inboundSchema=cl.UserMessage$inboundSchema,t.outboundSchema=cl.UserMessage$outboundSchema})(vUt||(cl.UserMessage$=vUt={}));function Q5l(t){return JSON.stringify(cl.UserMessage$outboundSchema.parse(t))}function E5l(t){return(0,fUt.safeParse)(t,e=>cl.UserMessage$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'UserMessage' from JSON")}});var xUt=f(un=>{"use strict";var J5l=un&&un.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),C5l=un&&un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L5l=un&&un.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&J5l(e,t,n);return C5l(e,t),e};Object.defineProperty(un,"__esModule",{value:!0});un.AgentsCompletionRequest$=un.AgentsCompletionRequest$outboundSchema=un.AgentsCompletionRequest$inboundSchema=un.AgentsCompletionRequestToolChoice$=un.AgentsCompletionRequestToolChoice$outboundSchema=un.AgentsCompletionRequestToolChoice$inboundSchema=un.AgentsCompletionRequestMessages$=un.AgentsCompletionRequestMessages$outboundSchema=un.AgentsCompletionRequestMessages$inboundSchema=un.AgentsCompletionRequestStop$=un.AgentsCompletionRequestStop$outboundSchema=un.AgentsCompletionRequestStop$inboundSchema=void 0;un.agentsCompletionRequestStopToJSON=k5l;un.agentsCompletionRequestStopFromJSON=x5l;un.agentsCompletionRequestMessagesToJSON=j5l;un.agentsCompletionRequestMessagesFromJSON=O5l;un.agentsCompletionRequestToolChoiceToJSON=U5l;un.agentsCompletionRequestToolChoiceFromJSON=z5l;un.agentsCompletionRequestToJSON=B5l;un.agentsCompletionRequestFromJSON=S5l;var nt=L5l(se()),EUt=be(),vde=oe(),fde=bR(),JUt=zj(),CUt=$1(),LUt=DX(),Xde=h0(),kUt=Bj(),wde=Sj(),Hde=eJ(),Qde=Z0(),Ede=W0();un.AgentsCompletionRequestStop$inboundSchema=nt.union([nt.string(),nt.array(nt.string())]);un.AgentsCompletionRequestStop$outboundSchema=nt.union([nt.string(),nt.array(nt.string())]);var XUt;(function(t){t.inboundSchema=un.AgentsCompletionRequestStop$inboundSchema,t.outboundSchema=un.AgentsCompletionRequestStop$outboundSchema})(XUt||(un.AgentsCompletionRequestStop$=XUt={}));function k5l(t){return JSON.stringify(un.AgentsCompletionRequestStop$outboundSchema.parse(t))}function x5l(t){return(0,vde.safeParse)(t,e=>un.AgentsCompletionRequestStop$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionRequestStop' from JSON")}un.AgentsCompletionRequestMessages$inboundSchema=nt.union([Xde.SystemMessage$inboundSchema.and(nt.object({role:nt.literal("system")}).transform(t=>({role:t.role}))),Ede.UserMessage$inboundSchema.and(nt.object({role:nt.literal("user")}).transform(t=>({role:t.role}))),fde.AssistantMessage$inboundSchema.and(nt.object({role:nt.literal("assistant")}).transform(t=>({role:t.role}))),Qde.ToolMessage$inboundSchema.and(nt.object({role:nt.literal("tool")}).transform(t=>({role:t.role})))]);un.AgentsCompletionRequestMessages$outboundSchema=nt.union([Xde.SystemMessage$outboundSchema.and(nt.object({role:nt.literal("system")}).transform(t=>({role:t.role}))),Ede.UserMessage$outboundSchema.and(nt.object({role:nt.literal("user")}).transform(t=>({role:t.role}))),fde.AssistantMessage$outboundSchema.and(nt.object({role:nt.literal("assistant")}).transform(t=>({role:t.role}))),Qde.ToolMessage$outboundSchema.and(nt.object({role:nt.literal("tool")}).transform(t=>({role:t.role})))]);var wUt;(function(t){t.inboundSchema=un.AgentsCompletionRequestMessages$inboundSchema,t.outboundSchema=un.AgentsCompletionRequestMessages$outboundSchema})(wUt||(un.AgentsCompletionRequestMessages$=wUt={}));function j5l(t){return JSON.stringify(un.AgentsCompletionRequestMessages$outboundSchema.parse(t))}function O5l(t){return(0,vde.safeParse)(t,e=>un.AgentsCompletionRequestMessages$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionRequestMessages' from JSON")}un.AgentsCompletionRequestToolChoice$inboundSchema=nt.union([wde.ToolChoice$inboundSchema,Hde.ToolChoiceEnum$inboundSchema]);un.AgentsCompletionRequestToolChoice$outboundSchema=nt.union([wde.ToolChoice$outboundSchema,Hde.ToolChoiceEnum$outboundSchema]);var HUt;(function(t){t.inboundSchema=un.AgentsCompletionRequestToolChoice$inboundSchema,t.outboundSchema=un.AgentsCompletionRequestToolChoice$outboundSchema})(HUt||(un.AgentsCompletionRequestToolChoice$=HUt={}));function U5l(t){return JSON.stringify(un.AgentsCompletionRequestToolChoice$outboundSchema.parse(t))}function z5l(t){return(0,vde.safeParse)(t,e=>un.AgentsCompletionRequestToolChoice$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionRequestToolChoice' from JSON")}un.AgentsCompletionRequest$inboundSchema=nt.object({max_tokens:nt.nullable(nt.number().int()).optional(),stream:nt.boolean().default(!1),stop:nt.union([nt.string(),nt.array(nt.string())]).optional(),random_seed:nt.nullable(nt.number().int()).optional(),messages:nt.array(nt.union([Xde.SystemMessage$inboundSchema.and(nt.object({role:nt.literal("system")}).transform(t=>({role:t.role}))),Ede.UserMessage$inboundSchema.and(nt.object({role:nt.literal("user")}).transform(t=>({role:t.role}))),fde.AssistantMessage$inboundSchema.and(nt.object({role:nt.literal("assistant")}).transform(t=>({role:t.role}))),Qde.ToolMessage$inboundSchema.and(nt.object({role:nt.literal("tool")}).transform(t=>({role:t.role})))])),response_format:LUt.ResponseFormat$inboundSchema.optional(),tools:nt.nullable(nt.array(kUt.Tool$inboundSchema)).optional(),tool_choice:nt.union([wde.ToolChoice$inboundSchema,Hde.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:nt.number().optional(),frequency_penalty:nt.number().optional(),n:nt.nullable(nt.number().int()).optional(),prediction:CUt.Prediction$inboundSchema.optional(),parallel_tool_calls:nt.boolean().optional(),prompt_mode:nt.nullable(JUt.MistralPromptMode$inboundSchema).optional(),agent_id:nt.string()}).transform(t=>(0,EUt.remap)(t,{max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",agent_id:"agentId"}));un.AgentsCompletionRequest$outboundSchema=nt.object({maxTokens:nt.nullable(nt.number().int()).optional(),stream:nt.boolean().default(!1),stop:nt.union([nt.string(),nt.array(nt.string())]).optional(),randomSeed:nt.nullable(nt.number().int()).optional(),messages:nt.array(nt.union([Xde.SystemMessage$outboundSchema.and(nt.object({role:nt.literal("system")}).transform(t=>({role:t.role}))),Ede.UserMessage$outboundSchema.and(nt.object({role:nt.literal("user")}).transform(t=>({role:t.role}))),fde.AssistantMessage$outboundSchema.and(nt.object({role:nt.literal("assistant")}).transform(t=>({role:t.role}))),Qde.ToolMessage$outboundSchema.and(nt.object({role:nt.literal("tool")}).transform(t=>({role:t.role})))])),responseFormat:LUt.ResponseFormat$outboundSchema.optional(),tools:nt.nullable(nt.array(kUt.Tool$outboundSchema)).optional(),toolChoice:nt.union([wde.ToolChoice$outboundSchema,Hde.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:nt.number().optional(),frequencyPenalty:nt.number().optional(),n:nt.nullable(nt.number().int()).optional(),prediction:CUt.Prediction$outboundSchema.optional(),parallelToolCalls:nt.boolean().optional(),promptMode:nt.nullable(JUt.MistralPromptMode$outboundSchema).optional(),agentId:nt.string()}).transform(t=>(0,EUt.remap)(t,{maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",agentId:"agent_id"}));var QUt;(function(t){t.inboundSchema=un.AgentsCompletionRequest$inboundSchema,t.outboundSchema=un.AgentsCompletionRequest$outboundSchema})(QUt||(un.AgentsCompletionRequest$=QUt={}));function B5l(t){return JSON.stringify(un.AgentsCompletionRequest$outboundSchema.parse(t))}function S5l(t){return(0,vde.safeParse)(t,e=>un.AgentsCompletionRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionRequest' from JSON")}});var KUt=f(dn=>{"use strict";var M5l=dn&&dn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),T5l=dn&&dn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),D5l=dn&&dn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&M5l(e,t,n);return T5l(e,t),e};Object.defineProperty(dn,"__esModule",{value:!0});dn.AgentsCompletionStreamRequest$=dn.AgentsCompletionStreamRequest$outboundSchema=dn.AgentsCompletionStreamRequest$inboundSchema=dn.AgentsCompletionStreamRequestToolChoice$=dn.AgentsCompletionStreamRequestToolChoice$outboundSchema=dn.AgentsCompletionStreamRequestToolChoice$inboundSchema=dn.AgentsCompletionStreamRequestMessages$=dn.AgentsCompletionStreamRequestMessages$outboundSchema=dn.AgentsCompletionStreamRequestMessages$inboundSchema=dn.AgentsCompletionStreamRequestStop$=dn.AgentsCompletionStreamRequestStop$outboundSchema=dn.AgentsCompletionStreamRequestStop$inboundSchema=void 0;dn.agentsCompletionStreamRequestStopToJSON=K5l;dn.agentsCompletionStreamRequestStopFromJSON=_5l;dn.agentsCompletionStreamRequestMessagesToJSON=P5l;dn.agentsCompletionStreamRequestMessagesFromJSON=q5l;dn.agentsCompletionStreamRequestToolChoiceToJSON=$5l;dn.agentsCompletionStreamRequestToolChoiceFromJSON=eLl;dn.agentsCompletionStreamRequestToJSON=tLl;dn.agentsCompletionStreamRequestFromJSON=nLl;var lt=D5l(se()),BUt=be(),Jde=oe(),Cde=bR(),SUt=zj(),MUt=$1(),TUt=DX(),Lde=h0(),DUt=Bj(),kde=Sj(),xde=eJ(),jde=Z0(),Ode=W0();dn.AgentsCompletionStreamRequestStop$inboundSchema=lt.union([lt.string(),lt.array(lt.string())]);dn.AgentsCompletionStreamRequestStop$outboundSchema=lt.union([lt.string(),lt.array(lt.string())]);var jUt;(function(t){t.inboundSchema=dn.AgentsCompletionStreamRequestStop$inboundSchema,t.outboundSchema=dn.AgentsCompletionStreamRequestStop$outboundSchema})(jUt||(dn.AgentsCompletionStreamRequestStop$=jUt={}));function K5l(t){return JSON.stringify(dn.AgentsCompletionStreamRequestStop$outboundSchema.parse(t))}function _5l(t){return(0,Jde.safeParse)(t,e=>dn.AgentsCompletionStreamRequestStop$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionStreamRequestStop' from JSON")}dn.AgentsCompletionStreamRequestMessages$inboundSchema=lt.union([Lde.SystemMessage$inboundSchema.and(lt.object({role:lt.literal("system")}).transform(t=>({role:t.role}))),Ode.UserMessage$inboundSchema.and(lt.object({role:lt.literal("user")}).transform(t=>({role:t.role}))),Cde.AssistantMessage$inboundSchema.and(lt.object({role:lt.literal("assistant")}).transform(t=>({role:t.role}))),jde.ToolMessage$inboundSchema.and(lt.object({role:lt.literal("tool")}).transform(t=>({role:t.role})))]);dn.AgentsCompletionStreamRequestMessages$outboundSchema=lt.union([Lde.SystemMessage$outboundSchema.and(lt.object({role:lt.literal("system")}).transform(t=>({role:t.role}))),Ode.UserMessage$outboundSchema.and(lt.object({role:lt.literal("user")}).transform(t=>({role:t.role}))),Cde.AssistantMessage$outboundSchema.and(lt.object({role:lt.literal("assistant")}).transform(t=>({role:t.role}))),jde.ToolMessage$outboundSchema.and(lt.object({role:lt.literal("tool")}).transform(t=>({role:t.role})))]);var OUt;(function(t){t.inboundSchema=dn.AgentsCompletionStreamRequestMessages$inboundSchema,t.outboundSchema=dn.AgentsCompletionStreamRequestMessages$outboundSchema})(OUt||(dn.AgentsCompletionStreamRequestMessages$=OUt={}));function P5l(t){return JSON.stringify(dn.AgentsCompletionStreamRequestMessages$outboundSchema.parse(t))}function q5l(t){return(0,Jde.safeParse)(t,e=>dn.AgentsCompletionStreamRequestMessages$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionStreamRequestMessages' from JSON")}dn.AgentsCompletionStreamRequestToolChoice$inboundSchema=lt.union([kde.ToolChoice$inboundSchema,xde.ToolChoiceEnum$inboundSchema]);dn.AgentsCompletionStreamRequestToolChoice$outboundSchema=lt.union([kde.ToolChoice$outboundSchema,xde.ToolChoiceEnum$outboundSchema]);var UUt;(function(t){t.inboundSchema=dn.AgentsCompletionStreamRequestToolChoice$inboundSchema,t.outboundSchema=dn.AgentsCompletionStreamRequestToolChoice$outboundSchema})(UUt||(dn.AgentsCompletionStreamRequestToolChoice$=UUt={}));function $5l(t){return JSON.stringify(dn.AgentsCompletionStreamRequestToolChoice$outboundSchema.parse(t))}function eLl(t){return(0,Jde.safeParse)(t,e=>dn.AgentsCompletionStreamRequestToolChoice$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionStreamRequestToolChoice' from JSON")}dn.AgentsCompletionStreamRequest$inboundSchema=lt.object({max_tokens:lt.nullable(lt.number().int()).optional(),stream:lt.boolean().default(!0),stop:lt.union([lt.string(),lt.array(lt.string())]).optional(),random_seed:lt.nullable(lt.number().int()).optional(),messages:lt.array(lt.union([Lde.SystemMessage$inboundSchema.and(lt.object({role:lt.literal("system")}).transform(t=>({role:t.role}))),Ode.UserMessage$inboundSchema.and(lt.object({role:lt.literal("user")}).transform(t=>({role:t.role}))),Cde.AssistantMessage$inboundSchema.and(lt.object({role:lt.literal("assistant")}).transform(t=>({role:t.role}))),jde.ToolMessage$inboundSchema.and(lt.object({role:lt.literal("tool")}).transform(t=>({role:t.role})))])),response_format:TUt.ResponseFormat$inboundSchema.optional(),tools:lt.nullable(lt.array(DUt.Tool$inboundSchema)).optional(),tool_choice:lt.union([kde.ToolChoice$inboundSchema,xde.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:lt.number().optional(),frequency_penalty:lt.number().optional(),n:lt.nullable(lt.number().int()).optional(),prediction:MUt.Prediction$inboundSchema.optional(),parallel_tool_calls:lt.boolean().optional(),prompt_mode:lt.nullable(SUt.MistralPromptMode$inboundSchema).optional(),agent_id:lt.string()}).transform(t=>(0,BUt.remap)(t,{max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",agent_id:"agentId"}));dn.AgentsCompletionStreamRequest$outboundSchema=lt.object({maxTokens:lt.nullable(lt.number().int()).optional(),stream:lt.boolean().default(!0),stop:lt.union([lt.string(),lt.array(lt.string())]).optional(),randomSeed:lt.nullable(lt.number().int()).optional(),messages:lt.array(lt.union([Lde.SystemMessage$outboundSchema.and(lt.object({role:lt.literal("system")}).transform(t=>({role:t.role}))),Ode.UserMessage$outboundSchema.and(lt.object({role:lt.literal("user")}).transform(t=>({role:t.role}))),Cde.AssistantMessage$outboundSchema.and(lt.object({role:lt.literal("assistant")}).transform(t=>({role:t.role}))),jde.ToolMessage$outboundSchema.and(lt.object({role:lt.literal("tool")}).transform(t=>({role:t.role})))])),responseFormat:TUt.ResponseFormat$outboundSchema.optional(),tools:lt.nullable(lt.array(DUt.Tool$outboundSchema)).optional(),toolChoice:lt.union([kde.ToolChoice$outboundSchema,xde.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:lt.number().optional(),frequencyPenalty:lt.number().optional(),n:lt.nullable(lt.number().int()).optional(),prediction:MUt.Prediction$outboundSchema.optional(),parallelToolCalls:lt.boolean().optional(),promptMode:lt.nullable(SUt.MistralPromptMode$outboundSchema).optional(),agentId:lt.string()}).transform(t=>(0,BUt.remap)(t,{maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",agentId:"agent_id"}));var zUt;(function(t){t.inboundSchema=dn.AgentsCompletionStreamRequest$inboundSchema,t.outboundSchema=dn.AgentsCompletionStreamRequest$outboundSchema})(zUt||(dn.AgentsCompletionStreamRequest$=zUt={}));function tLl(t){return JSON.stringify(dn.AgentsCompletionStreamRequest$outboundSchema.parse(t))}function nLl(t){return(0,Jde.safeParse)(t,e=>dn.AgentsCompletionStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsCompletionStreamRequest' from JSON")}});var t9t=f(Ba=>{"use strict";var lLl=Ba&&Ba.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ILl=Ba&&Ba.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aLl=Ba&&Ba.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&lLl(e,t,n);return ILl(e,t),e};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.AgentUpdateRequest$=Ba.AgentUpdateRequest$outboundSchema=Ba.AgentUpdateRequest$inboundSchema=Ba.AgentUpdateRequestTools$=Ba.AgentUpdateRequestTools$outboundSchema=Ba.AgentUpdateRequestTools$inboundSchema=void 0;Ba.agentUpdateRequestToolsToJSON=rLl;Ba.agentUpdateRequestToolsFromJSON=cLl;Ba.agentUpdateRequestToJSON=oLl;Ba.agentUpdateRequestFromJSON=iLl;var dt=aLl(se()),qUt=be(),$Ut=oe(),Ude=MX(),e9t=jW(),zde=KX(),Bde=_X(),Sde=PX(),Mde=qX(),Tde=$X();Ba.AgentUpdateRequestTools$inboundSchema=dt.union([Ude.CodeInterpreterTool$inboundSchema.and(dt.object({type:dt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Sde.ImageGenerationTool$inboundSchema.and(dt.object({type:dt.literal("image_generation")}).transform(t=>({type:t.type}))),Tde.WebSearchTool$inboundSchema.and(dt.object({type:dt.literal("web_search")}).transform(t=>({type:t.type}))),Mde.WebSearchPremiumTool$inboundSchema.and(dt.object({type:dt.literal("web_search_premium")}).transform(t=>({type:t.type}))),zde.DocumentLibraryTool$inboundSchema.and(dt.object({type:dt.literal("document_library")}).transform(t=>({type:t.type}))),Bde.FunctionTool$inboundSchema.and(dt.object({type:dt.literal("function")}).transform(t=>({type:t.type})))]);Ba.AgentUpdateRequestTools$outboundSchema=dt.union([Ude.CodeInterpreterTool$outboundSchema.and(dt.object({type:dt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Sde.ImageGenerationTool$outboundSchema.and(dt.object({type:dt.literal("image_generation")}).transform(t=>({type:t.type}))),Tde.WebSearchTool$outboundSchema.and(dt.object({type:dt.literal("web_search")}).transform(t=>({type:t.type}))),Mde.WebSearchPremiumTool$outboundSchema.and(dt.object({type:dt.literal("web_search_premium")}).transform(t=>({type:t.type}))),zde.DocumentLibraryTool$outboundSchema.and(dt.object({type:dt.literal("document_library")}).transform(t=>({type:t.type}))),Bde.FunctionTool$outboundSchema.and(dt.object({type:dt.literal("function")}).transform(t=>({type:t.type})))]);var _Ut;(function(t){t.inboundSchema=Ba.AgentUpdateRequestTools$inboundSchema,t.outboundSchema=Ba.AgentUpdateRequestTools$outboundSchema})(_Ut||(Ba.AgentUpdateRequestTools$=_Ut={}));function rLl(t){return JSON.stringify(Ba.AgentUpdateRequestTools$outboundSchema.parse(t))}function cLl(t){return(0,$Ut.safeParse)(t,e=>Ba.AgentUpdateRequestTools$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentUpdateRequestTools' from JSON")}Ba.AgentUpdateRequest$inboundSchema=dt.object({instructions:dt.nullable(dt.string()).optional(),tools:dt.array(dt.union([Ude.CodeInterpreterTool$inboundSchema.and(dt.object({type:dt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Sde.ImageGenerationTool$inboundSchema.and(dt.object({type:dt.literal("image_generation")}).transform(t=>({type:t.type}))),Tde.WebSearchTool$inboundSchema.and(dt.object({type:dt.literal("web_search")}).transform(t=>({type:t.type}))),Mde.WebSearchPremiumTool$inboundSchema.and(dt.object({type:dt.literal("web_search_premium")}).transform(t=>({type:t.type}))),zde.DocumentLibraryTool$inboundSchema.and(dt.object({type:dt.literal("document_library")}).transform(t=>({type:t.type}))),Bde.FunctionTool$inboundSchema.and(dt.object({type:dt.literal("function")}).transform(t=>({type:t.type})))])).optional(),completion_args:e9t.CompletionArgs$inboundSchema.optional(),model:dt.nullable(dt.string()).optional(),name:dt.nullable(dt.string()).optional(),description:dt.nullable(dt.string()).optional(),handoffs:dt.nullable(dt.array(dt.string())).optional()}).transform(t=>(0,qUt.remap)(t,{completion_args:"completionArgs"}));Ba.AgentUpdateRequest$outboundSchema=dt.object({instructions:dt.nullable(dt.string()).optional(),tools:dt.array(dt.union([Ude.CodeInterpreterTool$outboundSchema.and(dt.object({type:dt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Sde.ImageGenerationTool$outboundSchema.and(dt.object({type:dt.literal("image_generation")}).transform(t=>({type:t.type}))),Tde.WebSearchTool$outboundSchema.and(dt.object({type:dt.literal("web_search")}).transform(t=>({type:t.type}))),Mde.WebSearchPremiumTool$outboundSchema.and(dt.object({type:dt.literal("web_search_premium")}).transform(t=>({type:t.type}))),zde.DocumentLibraryTool$outboundSchema.and(dt.object({type:dt.literal("document_library")}).transform(t=>({type:t.type}))),Bde.FunctionTool$outboundSchema.and(dt.object({type:dt.literal("function")}).transform(t=>({type:t.type})))])).optional(),completionArgs:e9t.CompletionArgs$outboundSchema.optional(),model:dt.nullable(dt.string()).optional(),name:dt.nullable(dt.string()).optional(),description:dt.nullable(dt.string()).optional(),handoffs:dt.nullable(dt.array(dt.string())).optional()}).transform(t=>(0,qUt.remap)(t,{completionArgs:"completion_args"}));var PUt;(function(t){t.inboundSchema=Ba.AgentUpdateRequest$inboundSchema,t.outboundSchema=Ba.AgentUpdateRequest$outboundSchema})(PUt||(Ba.AgentUpdateRequest$=PUt={}));function oLl(t){return JSON.stringify(Ba.AgentUpdateRequest$outboundSchema.parse(t))}function iLl(t){return(0,$Ut.safeParse)(t,e=>Ba.AgentUpdateRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentUpdateRequest' from JSON")}});var TUe=f(Hi=>{"use strict";var sLl=Hi&&Hi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),uLl=Hi&&Hi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dLl=Hi&&Hi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&sLl(e,t,n);return uLl(e,t),e};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ApiEndpoint$=Hi.ApiEndpoint$outboundSchema=Hi.ApiEndpoint$inboundSchema=Hi.ApiEndpoint=void 0;var oJ=dLl(se()),GLl=BV();Hi.ApiEndpoint={RootV1ChatCompletions:"/v1/chat/completions",RootV1Embeddings:"/v1/embeddings",RootV1FimCompletions:"/v1/fim/completions",RootV1Moderations:"/v1/moderations",RootV1ChatModerations:"/v1/chat/moderations"};Hi.ApiEndpoint$inboundSchema=oJ.union([oJ.nativeEnum(Hi.ApiEndpoint),oJ.string().transform(GLl.catchUnrecognizedEnum)]);Hi.ApiEndpoint$outboundSchema=oJ.union([oJ.nativeEnum(Hi.ApiEndpoint),oJ.string().and(oJ.custom())]);var n9t;(function(t){t.inboundSchema=Hi.ApiEndpoint$inboundSchema,t.outboundSchema=Hi.ApiEndpoint$outboundSchema})(n9t||(Hi.ApiEndpoint$=n9t={}))});var a9t=f(DI=>{"use strict";var bLl=DI&&DI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),mLl=DI&&DI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pLl=DI&&DI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&bLl(e,t,n);return mLl(e,t),e};Object.defineProperty(DI,"__esModule",{value:!0});DI.ArchiveFTModelOut$=DI.ArchiveFTModelOut$outboundSchema=DI.ArchiveFTModelOut$inboundSchema=DI.ArchiveFTModelOutObject$=DI.ArchiveFTModelOutObject$outboundSchema=DI.ArchiveFTModelOutObject$inboundSchema=DI.ArchiveFTModelOutObject=void 0;DI.archiveFTModelOutToJSON=ZLl;DI.archiveFTModelOutFromJSON=WLl;var iJ=pLl(se()),hLl=oe();DI.ArchiveFTModelOutObject={Model:"model"};DI.ArchiveFTModelOutObject$inboundSchema=iJ.nativeEnum(DI.ArchiveFTModelOutObject);DI.ArchiveFTModelOutObject$outboundSchema=DI.ArchiveFTModelOutObject$inboundSchema;var l9t;(function(t){t.inboundSchema=DI.ArchiveFTModelOutObject$inboundSchema,t.outboundSchema=DI.ArchiveFTModelOutObject$outboundSchema})(l9t||(DI.ArchiveFTModelOutObject$=l9t={}));DI.ArchiveFTModelOut$inboundSchema=iJ.object({id:iJ.string(),object:DI.ArchiveFTModelOutObject$inboundSchema.default("model"),archived:iJ.boolean().default(!0)});DI.ArchiveFTModelOut$outboundSchema=iJ.object({id:iJ.string(),object:DI.ArchiveFTModelOutObject$outboundSchema.default("model"),archived:iJ.boolean().default(!0)});var I9t;(function(t){t.inboundSchema=DI.ArchiveFTModelOut$inboundSchema,t.outboundSchema=DI.ArchiveFTModelOut$outboundSchema})(I9t||(DI.ArchiveFTModelOut$=I9t={}));function ZLl(t){return JSON.stringify(DI.ArchiveFTModelOut$outboundSchema.parse(t))}function WLl(t){return(0,hLl.safeParse)(t,e=>DI.ArchiveFTModelOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ArchiveFTModelOut' from JSON")}});var Dde=f(Qi=>{"use strict";var NLl=Qi&&Qi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),VLl=Qi&&Qi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),YLl=Qi&&Qi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&NLl(e,t,n);return VLl(e,t),e};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ModelCapabilities$=Qi.ModelCapabilities$outboundSchema=Qi.ModelCapabilities$inboundSchema=void 0;Qi.modelCapabilitiesToJSON=RLl;Qi.modelCapabilitiesFromJSON=yLl;var Jp=YLl(se()),c9t=be(),gLl=oe();Qi.ModelCapabilities$inboundSchema=Jp.object({completion_chat:Jp.boolean().default(!0),completion_fim:Jp.boolean().default(!1),function_calling:Jp.boolean().default(!0),fine_tuning:Jp.boolean().default(!1),vision:Jp.boolean().default(!1),classification:Jp.boolean().default(!1)}).transform(t=>(0,c9t.remap)(t,{completion_chat:"completionChat",completion_fim:"completionFim",function_calling:"functionCalling",fine_tuning:"fineTuning"}));Qi.ModelCapabilities$outboundSchema=Jp.object({completionChat:Jp.boolean().default(!0),completionFim:Jp.boolean().default(!1),functionCalling:Jp.boolean().default(!0),fineTuning:Jp.boolean().default(!1),vision:Jp.boolean().default(!1),classification:Jp.boolean().default(!1)}).transform(t=>(0,c9t.remap)(t,{completionChat:"completion_chat",completionFim:"completion_fim",functionCalling:"function_calling",fineTuning:"fine_tuning"}));var r9t;(function(t){t.inboundSchema=Qi.ModelCapabilities$inboundSchema,t.outboundSchema=Qi.ModelCapabilities$outboundSchema})(r9t||(Qi.ModelCapabilities$=r9t={}));function RLl(t){return JSON.stringify(Qi.ModelCapabilities$outboundSchema.parse(t))}function yLl(t){return(0,gLl.safeParse)(t,e=>Qi.ModelCapabilities$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ModelCapabilities' from JSON")}});var DUe=f(Sa=>{"use strict";var ALl=Sa&&Sa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),FLl=Sa&&Sa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vLl=Sa&&Sa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ALl(e,t,n);return FLl(e,t),e};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.BaseModelCard$=Sa.BaseModelCard$outboundSchema=Sa.BaseModelCard$inboundSchema=Sa.Type$=Sa.Type$outboundSchema=Sa.Type$inboundSchema=Sa.Type=void 0;Sa.baseModelCardToJSON=XLl;Sa.baseModelCardFromJSON=wLl;var tI=vLl(se()),s9t=be(),fLl=oe(),u9t=Dde();Sa.Type={Base:"base"};Sa.Type$inboundSchema=tI.nativeEnum(Sa.Type);Sa.Type$outboundSchema=Sa.Type$inboundSchema;var o9t;(function(t){t.inboundSchema=Sa.Type$inboundSchema,t.outboundSchema=Sa.Type$outboundSchema})(o9t||(Sa.Type$=o9t={}));Sa.BaseModelCard$inboundSchema=tI.object({id:tI.string(),object:tI.string().default("model"),created:tI.number().int().optional(),owned_by:tI.string().default("mistralai"),capabilities:u9t.ModelCapabilities$inboundSchema,name:tI.nullable(tI.string()).optional(),description:tI.nullable(tI.string()).optional(),max_context_length:tI.number().int().default(32768),aliases:tI.array(tI.string()).optional(),deprecation:tI.nullable(tI.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),deprecation_replacement_model:tI.nullable(tI.string()).optional(),default_model_temperature:tI.nullable(tI.number()).optional(),type:tI.literal("base").default("base")}).transform(t=>(0,s9t.remap)(t,{owned_by:"ownedBy",max_context_length:"maxContextLength",deprecation_replacement_model:"deprecationReplacementModel",default_model_temperature:"defaultModelTemperature"}));Sa.BaseModelCard$outboundSchema=tI.object({id:tI.string(),object:tI.string().default("model"),created:tI.number().int().optional(),ownedBy:tI.string().default("mistralai"),capabilities:u9t.ModelCapabilities$outboundSchema,name:tI.nullable(tI.string()).optional(),description:tI.nullable(tI.string()).optional(),maxContextLength:tI.number().int().default(32768),aliases:tI.array(tI.string()).optional(),deprecation:tI.nullable(tI.date().transform(t=>t.toISOString())).optional(),deprecationReplacementModel:tI.nullable(tI.string()).optional(),defaultModelTemperature:tI.nullable(tI.number()).optional(),type:tI.literal("base").default("base")}).transform(t=>(0,s9t.remap)(t,{ownedBy:"owned_by",maxContextLength:"max_context_length",deprecationReplacementModel:"deprecation_replacement_model",defaultModelTemperature:"default_model_temperature"}));var i9t;(function(t){t.inboundSchema=Sa.BaseModelCard$inboundSchema,t.outboundSchema=Sa.BaseModelCard$outboundSchema})(i9t||(Sa.BaseModelCard$=i9t={}));function XLl(t){return JSON.stringify(Sa.BaseModelCard$outboundSchema.parse(t))}function wLl(t){return(0,fLl.safeParse)(t,e=>Sa.BaseModelCard$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'BaseModelCard' from JSON")}});var KUe=f(Ei=>{"use strict";var HLl=Ei&&Ei.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),QLl=Ei&&Ei.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ELl=Ei&&Ei.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&HLl(e,t,n);return QLl(e,t),e};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.BatchError$=Ei.BatchError$outboundSchema=Ei.BatchError$inboundSchema=void 0;Ei.batchErrorToJSON=CLl;Ei.batchErrorFromJSON=LLl;var Mj=ELl(se()),JLl=oe();Ei.BatchError$inboundSchema=Mj.object({message:Mj.string(),count:Mj.number().int().default(1)});Ei.BatchError$outboundSchema=Mj.object({message:Mj.string(),count:Mj.number().int().default(1)});var d9t;(function(t){t.inboundSchema=Ei.BatchError$inboundSchema,t.outboundSchema=Ei.BatchError$outboundSchema})(d9t||(Ei.BatchError$=d9t={}));function CLl(t){return JSON.stringify(Ei.BatchError$outboundSchema.parse(t))}function LLl(t){return(0,JLl.safeParse)(t,e=>Ei.BatchError$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'BatchError' from JSON")}});var p9t=f(Ji=>{"use strict";var kLl=Ji&&Ji.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),xLl=Ji&&Ji.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jLl=Ji&&Ji.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&kLl(e,t,n);return xLl(e,t),e};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.BatchJobIn$=Ji.BatchJobIn$outboundSchema=Ji.BatchJobIn$inboundSchema=void 0;Ji.batchJobInToJSON=ULl;Ji.batchJobInFromJSON=zLl;var Hb=jLl(se()),b9t=be(),OLl=oe(),m9t=TUe();Ji.BatchJobIn$inboundSchema=Hb.object({input_files:Hb.array(Hb.string()),endpoint:m9t.ApiEndpoint$inboundSchema,model:Hb.string(),metadata:Hb.nullable(Hb.record(Hb.string())).optional(),timeout_hours:Hb.number().int().default(24)}).transform(t=>(0,b9t.remap)(t,{input_files:"inputFiles",timeout_hours:"timeoutHours"}));Ji.BatchJobIn$outboundSchema=Hb.object({inputFiles:Hb.array(Hb.string()),endpoint:m9t.ApiEndpoint$outboundSchema,model:Hb.string(),metadata:Hb.nullable(Hb.record(Hb.string())).optional(),timeoutHours:Hb.number().int().default(24)}).transform(t=>(0,b9t.remap)(t,{inputFiles:"input_files",timeoutHours:"timeout_hours"}));var G9t;(function(t){t.inboundSchema=Ji.BatchJobIn$inboundSchema,t.outboundSchema=Ji.BatchJobIn$outboundSchema})(G9t||(Ji.BatchJobIn$=G9t={}));function ULl(t){return JSON.stringify(Ji.BatchJobIn$outboundSchema.parse(t))}function zLl(t){return(0,OLl.safeParse)(t,e=>Ji.BatchJobIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'BatchJobIn' from JSON")}});var _Ue=f(Ci=>{"use strict";var BLl=Ci&&Ci.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),SLl=Ci&&Ci.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MLl=Ci&&Ci.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&BLl(e,t,n);return SLl(e,t),e};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.BatchJobStatus$=Ci.BatchJobStatus$outboundSchema=Ci.BatchJobStatus$inboundSchema=Ci.BatchJobStatus=void 0;var TLl=MLl(se());Ci.BatchJobStatus={Queued:"QUEUED",Running:"RUNNING",Success:"SUCCESS",Failed:"FAILED",TimeoutExceeded:"TIMEOUT_EXCEEDED",CancellationRequested:"CANCELLATION_REQUESTED",Cancelled:"CANCELLED"};Ci.BatchJobStatus$inboundSchema=TLl.nativeEnum(Ci.BatchJobStatus);Ci.BatchJobStatus$outboundSchema=Ci.BatchJobStatus$inboundSchema;var h9t;(function(t){t.inboundSchema=Ci.BatchJobStatus$inboundSchema,t.outboundSchema=Ci.BatchJobStatus$outboundSchema})(h9t||(Ci.BatchJobStatus$=h9t={}))});var PUe=f(KI=>{"use strict";var DLl=KI&&KI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KLl=KI&&KI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_Ll=KI&&KI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DLl(e,t,n);return KLl(e,t),e};Object.defineProperty(KI,"__esModule",{value:!0});KI.BatchJobOut$=KI.BatchJobOut$outboundSchema=KI.BatchJobOut$inboundSchema=KI.BatchJobOutObject$=KI.BatchJobOutObject$outboundSchema=KI.BatchJobOutObject$inboundSchema=KI.BatchJobOutObject=void 0;KI.batchJobOutToJSON=qLl;KI.batchJobOutFromJSON=$Ll;var Kn=_Ll(se()),N9t=be(),PLl=oe(),V9t=KUe(),Y9t=_Ue();KI.BatchJobOutObject={Batch:"batch"};KI.BatchJobOutObject$inboundSchema=Kn.nativeEnum(KI.BatchJobOutObject);KI.BatchJobOutObject$outboundSchema=KI.BatchJobOutObject$inboundSchema;var Z9t;(function(t){t.inboundSchema=KI.BatchJobOutObject$inboundSchema,t.outboundSchema=KI.BatchJobOutObject$outboundSchema})(Z9t||(KI.BatchJobOutObject$=Z9t={}));KI.BatchJobOut$inboundSchema=Kn.object({id:Kn.string(),object:KI.BatchJobOutObject$inboundSchema.default("batch"),input_files:Kn.array(Kn.string()),metadata:Kn.nullable(Kn.record(Kn.any())).optional(),endpoint:Kn.string(),model:Kn.string(),output_file:Kn.nullable(Kn.string()).optional(),error_file:Kn.nullable(Kn.string()).optional(),errors:Kn.array(V9t.BatchError$inboundSchema),status:Y9t.BatchJobStatus$inboundSchema,created_at:Kn.number().int(),total_requests:Kn.number().int(),completed_requests:Kn.number().int(),succeeded_requests:Kn.number().int(),failed_requests:Kn.number().int(),started_at:Kn.nullable(Kn.number().int()).optional(),completed_at:Kn.nullable(Kn.number().int()).optional()}).transform(t=>(0,N9t.remap)(t,{input_files:"inputFiles",output_file:"outputFile",error_file:"errorFile",created_at:"createdAt",total_requests:"totalRequests",completed_requests:"completedRequests",succeeded_requests:"succeededRequests",failed_requests:"failedRequests",started_at:"startedAt",completed_at:"completedAt"}));KI.BatchJobOut$outboundSchema=Kn.object({id:Kn.string(),object:KI.BatchJobOutObject$outboundSchema.default("batch"),inputFiles:Kn.array(Kn.string()),metadata:Kn.nullable(Kn.record(Kn.any())).optional(),endpoint:Kn.string(),model:Kn.string(),outputFile:Kn.nullable(Kn.string()).optional(),errorFile:Kn.nullable(Kn.string()).optional(),errors:Kn.array(V9t.BatchError$outboundSchema),status:Y9t.BatchJobStatus$outboundSchema,createdAt:Kn.number().int(),totalRequests:Kn.number().int(),completedRequests:Kn.number().int(),succeededRequests:Kn.number().int(),failedRequests:Kn.number().int(),startedAt:Kn.nullable(Kn.number().int()).optional(),completedAt:Kn.nullable(Kn.number().int()).optional()}).transform(t=>(0,N9t.remap)(t,{inputFiles:"input_files",outputFile:"output_file",errorFile:"error_file",createdAt:"created_at",totalRequests:"total_requests",completedRequests:"completed_requests",succeededRequests:"succeeded_requests",failedRequests:"failed_requests",startedAt:"started_at",completedAt:"completed_at"}));var W9t;(function(t){t.inboundSchema=KI.BatchJobOut$inboundSchema,t.outboundSchema=KI.BatchJobOut$outboundSchema})(W9t||(KI.BatchJobOut$=W9t={}));function qLl(t){return JSON.stringify(KI.BatchJobOut$outboundSchema.parse(t))}function $Ll(t){return(0,PLl.safeParse)(t,e=>KI.BatchJobOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'BatchJobOut' from JSON")}});var A9t=f(_I=>{"use strict";var ekl=_I&&_I.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),tkl=_I&&_I.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nkl=_I&&_I.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ekl(e,t,n);return tkl(e,t),e};Object.defineProperty(_I,"__esModule",{value:!0});_I.BatchJobsOut$=_I.BatchJobsOut$outboundSchema=_I.BatchJobsOut$inboundSchema=_I.BatchJobsOutObject$=_I.BatchJobsOutObject$outboundSchema=_I.BatchJobsOutObject$inboundSchema=_I.BatchJobsOutObject=void 0;_I.batchJobsOutToJSON=Ikl;_I.batchJobsOutFromJSON=akl;var sJ=nkl(se()),lkl=oe(),y9t=PUe();_I.BatchJobsOutObject={List:"list"};_I.BatchJobsOutObject$inboundSchema=sJ.nativeEnum(_I.BatchJobsOutObject);_I.BatchJobsOutObject$outboundSchema=_I.BatchJobsOutObject$inboundSchema;var g9t;(function(t){t.inboundSchema=_I.BatchJobsOutObject$inboundSchema,t.outboundSchema=_I.BatchJobsOutObject$outboundSchema})(g9t||(_I.BatchJobsOutObject$=g9t={}));_I.BatchJobsOut$inboundSchema=sJ.object({data:sJ.array(y9t.BatchJobOut$inboundSchema).optional(),object:_I.BatchJobsOutObject$inboundSchema.default("list"),total:sJ.number().int()});_I.BatchJobsOut$outboundSchema=sJ.object({data:sJ.array(y9t.BatchJobOut$outboundSchema).optional(),object:_I.BatchJobsOutObject$outboundSchema.default("list"),total:sJ.number().int()});var R9t;(function(t){t.inboundSchema=_I.BatchJobsOut$inboundSchema,t.outboundSchema=_I.BatchJobsOut$outboundSchema})(R9t||(_I.BatchJobsOut$=R9t={}));function Ikl(t){return JSON.stringify(_I.BatchJobsOut$outboundSchema.parse(t))}function akl(t){return(0,lkl.safeParse)(t,e=>_I.BatchJobsOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'BatchJobsOut' from JSON")}});var tw=f(Li=>{"use strict";var rkl=Li&&Li.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ckl=Li&&Li.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),okl=Li&&Li.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&rkl(e,t,n);return ckl(e,t),e};Object.defineProperty(Li,"__esModule",{value:!0});Li.BuiltInConnectors$=Li.BuiltInConnectors$outboundSchema=Li.BuiltInConnectors$inboundSchema=Li.BuiltInConnectors=void 0;var ikl=okl(se());Li.BuiltInConnectors={WebSearch:"web_search",WebSearchPremium:"web_search_premium",CodeInterpreter:"code_interpreter",ImageGeneration:"image_generation",DocumentLibrary:"document_library"};Li.BuiltInConnectors$inboundSchema=ikl.nativeEnum(Li.BuiltInConnectors);Li.BuiltInConnectors$outboundSchema=Li.BuiltInConnectors$inboundSchema;var F9t;(function(t){t.inboundSchema=Li.BuiltInConnectors$inboundSchema,t.outboundSchema=Li.BuiltInConnectors$outboundSchema})(F9t||(Li.BuiltInConnectors$=F9t={}))});var qUe=f(Ma=>{"use strict";var skl=Ma&&Ma.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ukl=Ma&&Ma.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dkl=Ma&&Ma.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&skl(e,t,n);return ukl(e,t),e};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.InstructRequest$=Ma.InstructRequest$outboundSchema=Ma.InstructRequest$inboundSchema=Ma.InstructRequestMessages$=Ma.InstructRequestMessages$outboundSchema=Ma.InstructRequestMessages$inboundSchema=void 0;Ma.instructRequestMessagesToJSON=Gkl;Ma.instructRequestMessagesFromJSON=bkl;Ma.instructRequestToJSON=mkl;Ma.instructRequestFromJSON=pkl;var _l=dkl(se()),X9t=oe(),Kde=bR(),_de=h0(),Pde=Z0(),qde=W0();Ma.InstructRequestMessages$inboundSchema=_l.union([_de.SystemMessage$inboundSchema.and(_l.object({role:_l.literal("system")}).transform(t=>({role:t.role}))),qde.UserMessage$inboundSchema.and(_l.object({role:_l.literal("user")}).transform(t=>({role:t.role}))),Kde.AssistantMessage$inboundSchema.and(_l.object({role:_l.literal("assistant")}).transform(t=>({role:t.role}))),Pde.ToolMessage$inboundSchema.and(_l.object({role:_l.literal("tool")}).transform(t=>({role:t.role})))]);Ma.InstructRequestMessages$outboundSchema=_l.union([_de.SystemMessage$outboundSchema.and(_l.object({role:_l.literal("system")}).transform(t=>({role:t.role}))),qde.UserMessage$outboundSchema.and(_l.object({role:_l.literal("user")}).transform(t=>({role:t.role}))),Kde.AssistantMessage$outboundSchema.and(_l.object({role:_l.literal("assistant")}).transform(t=>({role:t.role}))),Pde.ToolMessage$outboundSchema.and(_l.object({role:_l.literal("tool")}).transform(t=>({role:t.role})))]);var v9t;(function(t){t.inboundSchema=Ma.InstructRequestMessages$inboundSchema,t.outboundSchema=Ma.InstructRequestMessages$outboundSchema})(v9t||(Ma.InstructRequestMessages$=v9t={}));function Gkl(t){return JSON.stringify(Ma.InstructRequestMessages$outboundSchema.parse(t))}function bkl(t){return(0,X9t.safeParse)(t,e=>Ma.InstructRequestMessages$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'InstructRequestMessages' from JSON")}Ma.InstructRequest$inboundSchema=_l.object({messages:_l.array(_l.union([_de.SystemMessage$inboundSchema.and(_l.object({role:_l.literal("system")}).transform(t=>({role:t.role}))),qde.UserMessage$inboundSchema.and(_l.object({role:_l.literal("user")}).transform(t=>({role:t.role}))),Kde.AssistantMessage$inboundSchema.and(_l.object({role:_l.literal("assistant")}).transform(t=>({role:t.role}))),Pde.ToolMessage$inboundSchema.and(_l.object({role:_l.literal("tool")}).transform(t=>({role:t.role})))]))});Ma.InstructRequest$outboundSchema=_l.object({messages:_l.array(_l.union([_de.SystemMessage$outboundSchema.and(_l.object({role:_l.literal("system")}).transform(t=>({role:t.role}))),qde.UserMessage$outboundSchema.and(_l.object({role:_l.literal("user")}).transform(t=>({role:t.role}))),Kde.AssistantMessage$outboundSchema.and(_l.object({role:_l.literal("assistant")}).transform(t=>({role:t.role}))),Pde.ToolMessage$outboundSchema.and(_l.object({role:_l.literal("tool")}).transform(t=>({role:t.role})))]))});var f9t;(function(t){t.inboundSchema=Ma.InstructRequest$inboundSchema,t.outboundSchema=Ma.InstructRequest$outboundSchema})(f9t||(Ma.InstructRequest$=f9t={}));function mkl(t){return JSON.stringify(Ma.InstructRequest$outboundSchema.parse(t))}function pkl(t){return(0,X9t.safeParse)(t,e=>Ma.InstructRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'InstructRequest' from JSON")}});var e9e=f(il=>{"use strict";var hkl=il&&il.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Zkl=il&&il.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Wkl=il&&il.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&hkl(e,t,n);return Zkl(e,t),e};Object.defineProperty(il,"__esModule",{value:!0});il.Inputs$=il.Inputs$outboundSchema=il.Inputs$inboundSchema=il.InstructRequestInputs$=il.InstructRequestInputs$outboundSchema=il.InstructRequestInputs$inboundSchema=il.InstructRequestInputsMessages$=il.InstructRequestInputsMessages$outboundSchema=il.InstructRequestInputsMessages$inboundSchema=void 0;il.instructRequestInputsMessagesToJSON=Nkl;il.instructRequestInputsMessagesFromJSON=Vkl;il.instructRequestInputsToJSON=Ykl;il.instructRequestInputsFromJSON=gkl;il.inputsToJSON=Rkl;il.inputsFromJSON=ykl;var ol=Wkl(se()),$Ue=oe(),$de=bR(),E9t=qUe(),eGe=h0(),tGe=Z0(),nGe=W0();il.InstructRequestInputsMessages$inboundSchema=ol.union([eGe.SystemMessage$inboundSchema.and(ol.object({role:ol.literal("system")}).transform(t=>({role:t.role}))),nGe.UserMessage$inboundSchema.and(ol.object({role:ol.literal("user")}).transform(t=>({role:t.role}))),$de.AssistantMessage$inboundSchema.and(ol.object({role:ol.literal("assistant")}).transform(t=>({role:t.role}))),tGe.ToolMessage$inboundSchema.and(ol.object({role:ol.literal("tool")}).transform(t=>({role:t.role})))]);il.InstructRequestInputsMessages$outboundSchema=ol.union([eGe.SystemMessage$outboundSchema.and(ol.object({role:ol.literal("system")}).transform(t=>({role:t.role}))),nGe.UserMessage$outboundSchema.and(ol.object({role:ol.literal("user")}).transform(t=>({role:t.role}))),$de.AssistantMessage$outboundSchema.and(ol.object({role:ol.literal("assistant")}).transform(t=>({role:t.role}))),tGe.ToolMessage$outboundSchema.and(ol.object({role:ol.literal("tool")}).transform(t=>({role:t.role})))]);var w9t;(function(t){t.inboundSchema=il.InstructRequestInputsMessages$inboundSchema,t.outboundSchema=il.InstructRequestInputsMessages$outboundSchema})(w9t||(il.InstructRequestInputsMessages$=w9t={}));function Nkl(t){return JSON.stringify(il.InstructRequestInputsMessages$outboundSchema.parse(t))}function Vkl(t){return(0,$Ue.safeParse)(t,e=>il.InstructRequestInputsMessages$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'InstructRequestInputsMessages' from JSON")}il.InstructRequestInputs$inboundSchema=ol.object({messages:ol.array(ol.union([eGe.SystemMessage$inboundSchema.and(ol.object({role:ol.literal("system")}).transform(t=>({role:t.role}))),nGe.UserMessage$inboundSchema.and(ol.object({role:ol.literal("user")}).transform(t=>({role:t.role}))),$de.AssistantMessage$inboundSchema.and(ol.object({role:ol.literal("assistant")}).transform(t=>({role:t.role}))),tGe.ToolMessage$inboundSchema.and(ol.object({role:ol.literal("tool")}).transform(t=>({role:t.role})))]))});il.InstructRequestInputs$outboundSchema=ol.object({messages:ol.array(ol.union([eGe.SystemMessage$outboundSchema.and(ol.object({role:ol.literal("system")}).transform(t=>({role:t.role}))),nGe.UserMessage$outboundSchema.and(ol.object({role:ol.literal("user")}).transform(t=>({role:t.role}))),$de.AssistantMessage$outboundSchema.and(ol.object({role:ol.literal("assistant")}).transform(t=>({role:t.role}))),tGe.ToolMessage$outboundSchema.and(ol.object({role:ol.literal("tool")}).transform(t=>({role:t.role})))]))});var H9t;(function(t){t.inboundSchema=il.InstructRequestInputs$inboundSchema,t.outboundSchema=il.InstructRequestInputs$outboundSchema})(H9t||(il.InstructRequestInputs$=H9t={}));function Ykl(t){return JSON.stringify(il.InstructRequestInputs$outboundSchema.parse(t))}function gkl(t){return(0,$Ue.safeParse)(t,e=>il.InstructRequestInputs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'InstructRequestInputs' from JSON")}il.Inputs$inboundSchema=ol.union([ol.lazy(()=>il.InstructRequestInputs$inboundSchema),ol.array(E9t.InstructRequest$inboundSchema)]);il.Inputs$outboundSchema=ol.union([ol.lazy(()=>il.InstructRequestInputs$outboundSchema),ol.array(E9t.InstructRequest$outboundSchema)]);var Q9t;(function(t){t.inboundSchema=il.Inputs$inboundSchema,t.outboundSchema=il.Inputs$outboundSchema})(Q9t||(il.Inputs$=Q9t={}));function Rkl(t){return JSON.stringify(il.Inputs$outboundSchema.parse(t))}function ykl(t){return(0,$Ue.safeParse)(t,e=>il.Inputs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Inputs' from JSON")}});var k9t=f(ki=>{"use strict";var Akl=ki&&ki.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Fkl=ki&&ki.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vkl=ki&&ki.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Akl(e,t,n);return Fkl(e,t),e};Object.defineProperty(ki,"__esModule",{value:!0});ki.ChatClassificationRequest$=ki.ChatClassificationRequest$outboundSchema=ki.ChatClassificationRequest$inboundSchema=void 0;ki.chatClassificationRequestToJSON=Xkl;ki.chatClassificationRequestFromJSON=wkl;var lGe=vkl(se()),C9t=be(),fkl=oe(),L9t=e9e();ki.ChatClassificationRequest$inboundSchema=lGe.object({model:lGe.string(),input:L9t.Inputs$inboundSchema}).transform(t=>(0,C9t.remap)(t,{input:"inputs"}));ki.ChatClassificationRequest$outboundSchema=lGe.object({model:lGe.string(),inputs:L9t.Inputs$outboundSchema}).transform(t=>(0,C9t.remap)(t,{inputs:"input"}));var J9t;(function(t){t.inboundSchema=ki.ChatClassificationRequest$inboundSchema,t.outboundSchema=ki.ChatClassificationRequest$outboundSchema})(J9t||(ki.ChatClassificationRequest$=J9t={}));function Xkl(t){return JSON.stringify(ki.ChatClassificationRequest$outboundSchema.parse(t))}function wkl(t){return(0,fkl.safeParse)(t,e=>ki.ChatClassificationRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatClassificationRequest' from JSON")}});var IGe=f(PI=>{"use strict";var Hkl=PI&&PI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Qkl=PI&&PI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ekl=PI&&PI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Hkl(e,t,n);return Qkl(e,t),e};Object.defineProperty(PI,"__esModule",{value:!0});PI.ChatCompletionChoice$=PI.ChatCompletionChoice$outboundSchema=PI.ChatCompletionChoice$inboundSchema=PI.FinishReason$=PI.FinishReason$outboundSchema=PI.FinishReason$inboundSchema=PI.FinishReason=void 0;PI.chatCompletionChoiceToJSON=Lkl;PI.chatCompletionChoiceFromJSON=kkl;var SV=Ekl(se()),O9t=be(),Jkl=oe(),Ckl=BV(),U9t=bR();PI.FinishReason={Stop:"stop",Length:"length",ModelLength:"model_length",Error:"error",ToolCalls:"tool_calls"};PI.FinishReason$inboundSchema=SV.union([SV.nativeEnum(PI.FinishReason),SV.string().transform(Ckl.catchUnrecognizedEnum)]);PI.FinishReason$outboundSchema=SV.union([SV.nativeEnum(PI.FinishReason),SV.string().and(SV.custom())]);var x9t;(function(t){t.inboundSchema=PI.FinishReason$inboundSchema,t.outboundSchema=PI.FinishReason$outboundSchema})(x9t||(PI.FinishReason$=x9t={}));PI.ChatCompletionChoice$inboundSchema=SV.object({index:SV.number().int(),message:U9t.AssistantMessage$inboundSchema,finish_reason:PI.FinishReason$inboundSchema}).transform(t=>(0,O9t.remap)(t,{finish_reason:"finishReason"}));PI.ChatCompletionChoice$outboundSchema=SV.object({index:SV.number().int(),message:U9t.AssistantMessage$outboundSchema,finishReason:PI.FinishReason$outboundSchema}).transform(t=>(0,O9t.remap)(t,{finishReason:"finish_reason"}));var j9t;(function(t){t.inboundSchema=PI.ChatCompletionChoice$inboundSchema,t.outboundSchema=PI.ChatCompletionChoice$outboundSchema})(j9t||(PI.ChatCompletionChoice$=j9t={}));function Lkl(t){return JSON.stringify(PI.ChatCompletionChoice$outboundSchema.parse(t))}function kkl(t){return(0,Jkl.safeParse)(t,e=>PI.ChatCompletionChoice$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionChoice' from JSON")}});var q9t=f(Gn=>{"use strict";var xkl=Gn&&Gn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jkl=Gn&&Gn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Okl=Gn&&Gn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xkl(e,t,n);return jkl(e,t),e};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ChatCompletionRequest$=Gn.ChatCompletionRequest$outboundSchema=Gn.ChatCompletionRequest$inboundSchema=Gn.ChatCompletionRequestToolChoice$=Gn.ChatCompletionRequestToolChoice$outboundSchema=Gn.ChatCompletionRequestToolChoice$inboundSchema=Gn.Messages$=Gn.Messages$outboundSchema=Gn.Messages$inboundSchema=Gn.Stop$=Gn.Stop$outboundSchema=Gn.Stop$inboundSchema=void 0;Gn.stopToJSON=Ukl;Gn.stopFromJSON=zkl;Gn.messagesToJSON=Bkl;Gn.messagesFromJSON=Skl;Gn.chatCompletionRequestToolChoiceToJSON=Mkl;Gn.chatCompletionRequestToolChoiceFromJSON=Tkl;Gn.chatCompletionRequestToJSON=Dkl;Gn.chatCompletionRequestFromJSON=Kkl;var Te=Okl(se()),T9t=be(),aGe=oe(),rGe=bR(),D9t=zj(),K9t=$1(),_9t=DX(),cGe=h0(),P9t=Bj(),oGe=Sj(),iGe=eJ(),sGe=Z0(),uGe=W0();Gn.Stop$inboundSchema=Te.union([Te.string(),Te.array(Te.string())]);Gn.Stop$outboundSchema=Te.union([Te.string(),Te.array(Te.string())]);var z9t;(function(t){t.inboundSchema=Gn.Stop$inboundSchema,t.outboundSchema=Gn.Stop$outboundSchema})(z9t||(Gn.Stop$=z9t={}));function Ukl(t){return JSON.stringify(Gn.Stop$outboundSchema.parse(t))}function zkl(t){return(0,aGe.safeParse)(t,e=>Gn.Stop$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Stop' from JSON")}Gn.Messages$inboundSchema=Te.union([cGe.SystemMessage$inboundSchema.and(Te.object({role:Te.literal("system")}).transform(t=>({role:t.role}))),uGe.UserMessage$inboundSchema.and(Te.object({role:Te.literal("user")}).transform(t=>({role:t.role}))),rGe.AssistantMessage$inboundSchema.and(Te.object({role:Te.literal("assistant")}).transform(t=>({role:t.role}))),sGe.ToolMessage$inboundSchema.and(Te.object({role:Te.literal("tool")}).transform(t=>({role:t.role})))]);Gn.Messages$outboundSchema=Te.union([cGe.SystemMessage$outboundSchema.and(Te.object({role:Te.literal("system")}).transform(t=>({role:t.role}))),uGe.UserMessage$outboundSchema.and(Te.object({role:Te.literal("user")}).transform(t=>({role:t.role}))),rGe.AssistantMessage$outboundSchema.and(Te.object({role:Te.literal("assistant")}).transform(t=>({role:t.role}))),sGe.ToolMessage$outboundSchema.and(Te.object({role:Te.literal("tool")}).transform(t=>({role:t.role})))]);var B9t;(function(t){t.inboundSchema=Gn.Messages$inboundSchema,t.outboundSchema=Gn.Messages$outboundSchema})(B9t||(Gn.Messages$=B9t={}));function Bkl(t){return JSON.stringify(Gn.Messages$outboundSchema.parse(t))}function Skl(t){return(0,aGe.safeParse)(t,e=>Gn.Messages$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Messages' from JSON")}Gn.ChatCompletionRequestToolChoice$inboundSchema=Te.union([oGe.ToolChoice$inboundSchema,iGe.ToolChoiceEnum$inboundSchema]);Gn.ChatCompletionRequestToolChoice$outboundSchema=Te.union([oGe.ToolChoice$outboundSchema,iGe.ToolChoiceEnum$outboundSchema]);var S9t;(function(t){t.inboundSchema=Gn.ChatCompletionRequestToolChoice$inboundSchema,t.outboundSchema=Gn.ChatCompletionRequestToolChoice$outboundSchema})(S9t||(Gn.ChatCompletionRequestToolChoice$=S9t={}));function Mkl(t){return JSON.stringify(Gn.ChatCompletionRequestToolChoice$outboundSchema.parse(t))}function Tkl(t){return(0,aGe.safeParse)(t,e=>Gn.ChatCompletionRequestToolChoice$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionRequestToolChoice' from JSON")}Gn.ChatCompletionRequest$inboundSchema=Te.object({model:Te.string(),temperature:Te.nullable(Te.number()).optional(),top_p:Te.number().optional(),max_tokens:Te.nullable(Te.number().int()).optional(),stream:Te.boolean().default(!1),stop:Te.union([Te.string(),Te.array(Te.string())]).optional(),random_seed:Te.nullable(Te.number().int()).optional(),messages:Te.array(Te.union([cGe.SystemMessage$inboundSchema.and(Te.object({role:Te.literal("system")}).transform(t=>({role:t.role}))),uGe.UserMessage$inboundSchema.and(Te.object({role:Te.literal("user")}).transform(t=>({role:t.role}))),rGe.AssistantMessage$inboundSchema.and(Te.object({role:Te.literal("assistant")}).transform(t=>({role:t.role}))),sGe.ToolMessage$inboundSchema.and(Te.object({role:Te.literal("tool")}).transform(t=>({role:t.role})))])),response_format:_9t.ResponseFormat$inboundSchema.optional(),tools:Te.nullable(Te.array(P9t.Tool$inboundSchema)).optional(),tool_choice:Te.union([oGe.ToolChoice$inboundSchema,iGe.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:Te.number().optional(),frequency_penalty:Te.number().optional(),n:Te.nullable(Te.number().int()).optional(),prediction:K9t.Prediction$inboundSchema.optional(),parallel_tool_calls:Te.boolean().optional(),prompt_mode:Te.nullable(D9t.MistralPromptMode$inboundSchema).optional(),safe_prompt:Te.boolean().optional()}).transform(t=>(0,T9t.remap)(t,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",safe_prompt:"safePrompt"}));Gn.ChatCompletionRequest$outboundSchema=Te.object({model:Te.string(),temperature:Te.nullable(Te.number()).optional(),topP:Te.number().optional(),maxTokens:Te.nullable(Te.number().int()).optional(),stream:Te.boolean().default(!1),stop:Te.union([Te.string(),Te.array(Te.string())]).optional(),randomSeed:Te.nullable(Te.number().int()).optional(),messages:Te.array(Te.union([cGe.SystemMessage$outboundSchema.and(Te.object({role:Te.literal("system")}).transform(t=>({role:t.role}))),uGe.UserMessage$outboundSchema.and(Te.object({role:Te.literal("user")}).transform(t=>({role:t.role}))),rGe.AssistantMessage$outboundSchema.and(Te.object({role:Te.literal("assistant")}).transform(t=>({role:t.role}))),sGe.ToolMessage$outboundSchema.and(Te.object({role:Te.literal("tool")}).transform(t=>({role:t.role})))])),responseFormat:_9t.ResponseFormat$outboundSchema.optional(),tools:Te.nullable(Te.array(P9t.Tool$outboundSchema)).optional(),toolChoice:Te.union([oGe.ToolChoice$outboundSchema,iGe.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:Te.number().optional(),frequencyPenalty:Te.number().optional(),n:Te.nullable(Te.number().int()).optional(),prediction:K9t.Prediction$outboundSchema.optional(),parallelToolCalls:Te.boolean().optional(),promptMode:Te.nullable(D9t.MistralPromptMode$outboundSchema).optional(),safePrompt:Te.boolean().optional()}).transform(t=>(0,T9t.remap)(t,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",safePrompt:"safe_prompt"}));var M9t;(function(t){t.inboundSchema=Gn.ChatCompletionRequest$inboundSchema,t.outboundSchema=Gn.ChatCompletionRequest$outboundSchema})(M9t||(Gn.ChatCompletionRequest$=M9t={}));function Dkl(t){return JSON.stringify(Gn.ChatCompletionRequest$outboundSchema.parse(t))}function Kkl(t){return(0,aGe.safeParse)(t,e=>Gn.ChatCompletionRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionRequest' from JSON")}});var Tj=f(xi=>{"use strict";var _kl=xi&&xi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Pkl=xi&&xi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qkl=xi&&xi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_kl(e,t,n);return Pkl(e,t),e};Object.defineProperty(xi,"__esModule",{value:!0});xi.UsageInfo$=xi.UsageInfo$outboundSchema=xi.UsageInfo$inboundSchema=void 0;xi.usageInfoToJSON=exl;xi.usageInfoFromJSON=txl;var nw=qkl(se()),ezt=be(),$kl=oe();xi.UsageInfo$inboundSchema=nw.object({prompt_tokens:nw.number().int(),completion_tokens:nw.number().int(),total_tokens:nw.number().int()}).transform(t=>(0,ezt.remap)(t,{prompt_tokens:"promptTokens",completion_tokens:"completionTokens",total_tokens:"totalTokens"}));xi.UsageInfo$outboundSchema=nw.object({promptTokens:nw.number().int(),completionTokens:nw.number().int(),totalTokens:nw.number().int()}).transform(t=>(0,ezt.remap)(t,{promptTokens:"prompt_tokens",completionTokens:"completion_tokens",totalTokens:"total_tokens"}));var $9t;(function(t){t.inboundSchema=xi.UsageInfo$inboundSchema,t.outboundSchema=xi.UsageInfo$outboundSchema})($9t||(xi.UsageInfo$=$9t={}));function exl(t){return JSON.stringify(xi.UsageInfo$outboundSchema.parse(t))}function txl(t){return(0,$kl.safeParse)(t,e=>xi.UsageInfo$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'UsageInfo' from JSON")}});var Izt=f(ji=>{"use strict";var nxl=ji&&ji.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),lxl=ji&&ji.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ixl=ji&&ji.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&nxl(e,t,n);return lxl(e,t),e};Object.defineProperty(ji,"__esModule",{value:!0});ji.ChatCompletionResponse$=ji.ChatCompletionResponse$outboundSchema=ji.ChatCompletionResponse$inboundSchema=void 0;ji.chatCompletionResponseToJSON=rxl;ji.chatCompletionResponseFromJSON=cxl;var UW=Ixl(se()),axl=oe(),nzt=IGe(),lzt=Tj();ji.ChatCompletionResponse$inboundSchema=UW.object({id:UW.string(),object:UW.string(),model:UW.string(),usage:lzt.UsageInfo$inboundSchema,created:UW.number().int(),choices:UW.array(nzt.ChatCompletionChoice$inboundSchema)});ji.ChatCompletionResponse$outboundSchema=UW.object({id:UW.string(),object:UW.string(),model:UW.string(),usage:lzt.UsageInfo$outboundSchema,created:UW.number().int(),choices:UW.array(nzt.ChatCompletionChoice$outboundSchema)});var tzt;(function(t){t.inboundSchema=ji.ChatCompletionResponse$inboundSchema,t.outboundSchema=ji.ChatCompletionResponse$outboundSchema})(tzt||(ji.ChatCompletionResponse$=tzt={}));function rxl(t){return JSON.stringify(ji.ChatCompletionResponse$outboundSchema.parse(t))}function cxl(t){return(0,axl.safeParse)(t,e=>ji.ChatCompletionResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionResponse' from JSON")}});var bzt=f(bn=>{"use strict";var oxl=bn&&bn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ixl=bn&&bn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sxl=bn&&bn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&oxl(e,t,n);return ixl(e,t),e};Object.defineProperty(bn,"__esModule",{value:!0});bn.ChatCompletionStreamRequest$=bn.ChatCompletionStreamRequest$outboundSchema=bn.ChatCompletionStreamRequest$inboundSchema=bn.ChatCompletionStreamRequestToolChoice$=bn.ChatCompletionStreamRequestToolChoice$outboundSchema=bn.ChatCompletionStreamRequestToolChoice$inboundSchema=bn.ChatCompletionStreamRequestMessages$=bn.ChatCompletionStreamRequestMessages$outboundSchema=bn.ChatCompletionStreamRequestMessages$inboundSchema=bn.ChatCompletionStreamRequestStop$=bn.ChatCompletionStreamRequestStop$outboundSchema=bn.ChatCompletionStreamRequestStop$inboundSchema=void 0;bn.chatCompletionStreamRequestStopToJSON=uxl;bn.chatCompletionStreamRequestStopFromJSON=dxl;bn.chatCompletionStreamRequestMessagesToJSON=Gxl;bn.chatCompletionStreamRequestMessagesFromJSON=bxl;bn.chatCompletionStreamRequestToolChoiceToJSON=mxl;bn.chatCompletionStreamRequestToolChoiceFromJSON=pxl;bn.chatCompletionStreamRequestToJSON=hxl;bn.chatCompletionStreamRequestFromJSON=Zxl;var De=sxl(se()),izt=be(),dGe=oe(),GGe=bR(),szt=zj(),uzt=$1(),dzt=DX(),bGe=h0(),Gzt=Bj(),mGe=Sj(),pGe=eJ(),hGe=Z0(),ZGe=W0();bn.ChatCompletionStreamRequestStop$inboundSchema=De.union([De.string(),De.array(De.string())]);bn.ChatCompletionStreamRequestStop$outboundSchema=De.union([De.string(),De.array(De.string())]);var azt;(function(t){t.inboundSchema=bn.ChatCompletionStreamRequestStop$inboundSchema,t.outboundSchema=bn.ChatCompletionStreamRequestStop$outboundSchema})(azt||(bn.ChatCompletionStreamRequestStop$=azt={}));function uxl(t){return JSON.stringify(bn.ChatCompletionStreamRequestStop$outboundSchema.parse(t))}function dxl(t){return(0,dGe.safeParse)(t,e=>bn.ChatCompletionStreamRequestStop$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionStreamRequestStop' from JSON")}bn.ChatCompletionStreamRequestMessages$inboundSchema=De.union([bGe.SystemMessage$inboundSchema.and(De.object({role:De.literal("system")}).transform(t=>({role:t.role}))),ZGe.UserMessage$inboundSchema.and(De.object({role:De.literal("user")}).transform(t=>({role:t.role}))),GGe.AssistantMessage$inboundSchema.and(De.object({role:De.literal("assistant")}).transform(t=>({role:t.role}))),hGe.ToolMessage$inboundSchema.and(De.object({role:De.literal("tool")}).transform(t=>({role:t.role})))]);bn.ChatCompletionStreamRequestMessages$outboundSchema=De.union([bGe.SystemMessage$outboundSchema.and(De.object({role:De.literal("system")}).transform(t=>({role:t.role}))),ZGe.UserMessage$outboundSchema.and(De.object({role:De.literal("user")}).transform(t=>({role:t.role}))),GGe.AssistantMessage$outboundSchema.and(De.object({role:De.literal("assistant")}).transform(t=>({role:t.role}))),hGe.ToolMessage$outboundSchema.and(De.object({role:De.literal("tool")}).transform(t=>({role:t.role})))]);var rzt;(function(t){t.inboundSchema=bn.ChatCompletionStreamRequestMessages$inboundSchema,t.outboundSchema=bn.ChatCompletionStreamRequestMessages$outboundSchema})(rzt||(bn.ChatCompletionStreamRequestMessages$=rzt={}));function Gxl(t){return JSON.stringify(bn.ChatCompletionStreamRequestMessages$outboundSchema.parse(t))}function bxl(t){return(0,dGe.safeParse)(t,e=>bn.ChatCompletionStreamRequestMessages$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionStreamRequestMessages' from JSON")}bn.ChatCompletionStreamRequestToolChoice$inboundSchema=De.union([mGe.ToolChoice$inboundSchema,pGe.ToolChoiceEnum$inboundSchema]);bn.ChatCompletionStreamRequestToolChoice$outboundSchema=De.union([mGe.ToolChoice$outboundSchema,pGe.ToolChoiceEnum$outboundSchema]);var czt;(function(t){t.inboundSchema=bn.ChatCompletionStreamRequestToolChoice$inboundSchema,t.outboundSchema=bn.ChatCompletionStreamRequestToolChoice$outboundSchema})(czt||(bn.ChatCompletionStreamRequestToolChoice$=czt={}));function mxl(t){return JSON.stringify(bn.ChatCompletionStreamRequestToolChoice$outboundSchema.parse(t))}function pxl(t){return(0,dGe.safeParse)(t,e=>bn.ChatCompletionStreamRequestToolChoice$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionStreamRequestToolChoice' from JSON")}bn.ChatCompletionStreamRequest$inboundSchema=De.object({model:De.string(),temperature:De.nullable(De.number()).optional(),top_p:De.number().optional(),max_tokens:De.nullable(De.number().int()).optional(),stream:De.boolean().default(!0),stop:De.union([De.string(),De.array(De.string())]).optional(),random_seed:De.nullable(De.number().int()).optional(),messages:De.array(De.union([bGe.SystemMessage$inboundSchema.and(De.object({role:De.literal("system")}).transform(t=>({role:t.role}))),ZGe.UserMessage$inboundSchema.and(De.object({role:De.literal("user")}).transform(t=>({role:t.role}))),GGe.AssistantMessage$inboundSchema.and(De.object({role:De.literal("assistant")}).transform(t=>({role:t.role}))),hGe.ToolMessage$inboundSchema.and(De.object({role:De.literal("tool")}).transform(t=>({role:t.role})))])),response_format:dzt.ResponseFormat$inboundSchema.optional(),tools:De.nullable(De.array(Gzt.Tool$inboundSchema)).optional(),tool_choice:De.union([mGe.ToolChoice$inboundSchema,pGe.ToolChoiceEnum$inboundSchema]).optional(),presence_penalty:De.number().optional(),frequency_penalty:De.number().optional(),n:De.nullable(De.number().int()).optional(),prediction:uzt.Prediction$inboundSchema.optional(),parallel_tool_calls:De.boolean().optional(),prompt_mode:De.nullable(szt.MistralPromptMode$inboundSchema).optional(),safe_prompt:De.boolean().optional()}).transform(t=>(0,izt.remap)(t,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",response_format:"responseFormat",tool_choice:"toolChoice",presence_penalty:"presencePenalty",frequency_penalty:"frequencyPenalty",parallel_tool_calls:"parallelToolCalls",prompt_mode:"promptMode",safe_prompt:"safePrompt"}));bn.ChatCompletionStreamRequest$outboundSchema=De.object({model:De.string(),temperature:De.nullable(De.number()).optional(),topP:De.number().optional(),maxTokens:De.nullable(De.number().int()).optional(),stream:De.boolean().default(!0),stop:De.union([De.string(),De.array(De.string())]).optional(),randomSeed:De.nullable(De.number().int()).optional(),messages:De.array(De.union([bGe.SystemMessage$outboundSchema.and(De.object({role:De.literal("system")}).transform(t=>({role:t.role}))),ZGe.UserMessage$outboundSchema.and(De.object({role:De.literal("user")}).transform(t=>({role:t.role}))),GGe.AssistantMessage$outboundSchema.and(De.object({role:De.literal("assistant")}).transform(t=>({role:t.role}))),hGe.ToolMessage$outboundSchema.and(De.object({role:De.literal("tool")}).transform(t=>({role:t.role})))])),responseFormat:dzt.ResponseFormat$outboundSchema.optional(),tools:De.nullable(De.array(Gzt.Tool$outboundSchema)).optional(),toolChoice:De.union([mGe.ToolChoice$outboundSchema,pGe.ToolChoiceEnum$outboundSchema]).optional(),presencePenalty:De.number().optional(),frequencyPenalty:De.number().optional(),n:De.nullable(De.number().int()).optional(),prediction:uzt.Prediction$outboundSchema.optional(),parallelToolCalls:De.boolean().optional(),promptMode:De.nullable(szt.MistralPromptMode$outboundSchema).optional(),safePrompt:De.boolean().optional()}).transform(t=>(0,izt.remap)(t,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",responseFormat:"response_format",toolChoice:"tool_choice",presencePenalty:"presence_penalty",frequencyPenalty:"frequency_penalty",parallelToolCalls:"parallel_tool_calls",promptMode:"prompt_mode",safePrompt:"safe_prompt"}));var ozt;(function(t){t.inboundSchema=bn.ChatCompletionStreamRequest$inboundSchema,t.outboundSchema=bn.ChatCompletionStreamRequest$outboundSchema})(ozt||(bn.ChatCompletionStreamRequest$=ozt={}));function hxl(t){return JSON.stringify(bn.ChatCompletionStreamRequest$outboundSchema.parse(t))}function Zxl(t){return(0,dGe.safeParse)(t,e=>bn.ChatCompletionStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatCompletionStreamRequest' from JSON")}});var Nzt=f(mn=>{"use strict";var Wxl=mn&&mn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Nxl=mn&&mn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vxl=mn&&mn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Wxl(e,t,n);return Nxl(e,t),e};Object.defineProperty(mn,"__esModule",{value:!0});mn.ChatModerationRequest$=mn.ChatModerationRequest$outboundSchema=mn.ChatModerationRequest$inboundSchema=mn.ChatModerationRequestInputs$=mn.ChatModerationRequestInputs$outboundSchema=mn.ChatModerationRequestInputs$inboundSchema=mn.One$=mn.One$outboundSchema=mn.One$inboundSchema=mn.Two$=mn.Two$outboundSchema=mn.Two$inboundSchema=void 0;mn.twoToJSON=Yxl;mn.twoFromJSON=gxl;mn.oneToJSON=Rxl;mn.oneFromJSON=yxl;mn.chatModerationRequestInputsToJSON=Axl;mn.chatModerationRequestInputsFromJSON=Fxl;mn.chatModerationRequestToJSON=vxl;mn.chatModerationRequestFromJSON=fxl;var Ee=Vxl(se()),Wzt=be(),WGe=oe(),zW=bR(),BW=h0(),SW=Z0(),MW=W0();mn.Two$inboundSchema=Ee.union([BW.SystemMessage$inboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$inboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$inboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$inboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))]);mn.Two$outboundSchema=Ee.union([BW.SystemMessage$outboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$outboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$outboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$outboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))]);var mzt;(function(t){t.inboundSchema=mn.Two$inboundSchema,t.outboundSchema=mn.Two$outboundSchema})(mzt||(mn.Two$=mzt={}));function Yxl(t){return JSON.stringify(mn.Two$outboundSchema.parse(t))}function gxl(t){return(0,WGe.safeParse)(t,e=>mn.Two$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Two' from JSON")}mn.One$inboundSchema=Ee.union([BW.SystemMessage$inboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$inboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$inboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$inboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))]);mn.One$outboundSchema=Ee.union([BW.SystemMessage$outboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$outboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$outboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$outboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))]);var pzt;(function(t){t.inboundSchema=mn.One$inboundSchema,t.outboundSchema=mn.One$outboundSchema})(pzt||(mn.One$=pzt={}));function Rxl(t){return JSON.stringify(mn.One$outboundSchema.parse(t))}function yxl(t){return(0,WGe.safeParse)(t,e=>mn.One$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'One' from JSON")}mn.ChatModerationRequestInputs$inboundSchema=Ee.union([Ee.array(Ee.union([BW.SystemMessage$inboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$inboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$inboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$inboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])),Ee.array(Ee.array(Ee.union([BW.SystemMessage$inboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$inboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$inboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$inboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])))]);mn.ChatModerationRequestInputs$outboundSchema=Ee.union([Ee.array(Ee.union([BW.SystemMessage$outboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$outboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$outboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$outboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])),Ee.array(Ee.array(Ee.union([BW.SystemMessage$outboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$outboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$outboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$outboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])))]);var hzt;(function(t){t.inboundSchema=mn.ChatModerationRequestInputs$inboundSchema,t.outboundSchema=mn.ChatModerationRequestInputs$outboundSchema})(hzt||(mn.ChatModerationRequestInputs$=hzt={}));function Axl(t){return JSON.stringify(mn.ChatModerationRequestInputs$outboundSchema.parse(t))}function Fxl(t){return(0,WGe.safeParse)(t,e=>mn.ChatModerationRequestInputs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatModerationRequestInputs' from JSON")}mn.ChatModerationRequest$inboundSchema=Ee.object({input:Ee.union([Ee.array(Ee.union([BW.SystemMessage$inboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$inboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$inboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$inboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])),Ee.array(Ee.array(Ee.union([BW.SystemMessage$inboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$inboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$inboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$inboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])))]),model:Ee.string()}).transform(t=>(0,Wzt.remap)(t,{input:"inputs"}));mn.ChatModerationRequest$outboundSchema=Ee.object({inputs:Ee.union([Ee.array(Ee.union([BW.SystemMessage$outboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$outboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$outboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$outboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])),Ee.array(Ee.array(Ee.union([BW.SystemMessage$outboundSchema.and(Ee.object({role:Ee.literal("system")}).transform(t=>({role:t.role}))),MW.UserMessage$outboundSchema.and(Ee.object({role:Ee.literal("user")}).transform(t=>({role:t.role}))),zW.AssistantMessage$outboundSchema.and(Ee.object({role:Ee.literal("assistant")}).transform(t=>({role:t.role}))),SW.ToolMessage$outboundSchema.and(Ee.object({role:Ee.literal("tool")}).transform(t=>({role:t.role})))])))]),model:Ee.string()}).transform(t=>(0,Wzt.remap)(t,{inputs:"input"}));var Zzt;(function(t){t.inboundSchema=mn.ChatModerationRequest$inboundSchema,t.outboundSchema=mn.ChatModerationRequest$outboundSchema})(Zzt||(mn.ChatModerationRequest$=Zzt={}));function vxl(t){return JSON.stringify(mn.ChatModerationRequest$outboundSchema.parse(t))}function fxl(t){return(0,WGe.safeParse)(t,e=>mn.ChatModerationRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ChatModerationRequest' from JSON")}});var t9e=f(Oi=>{"use strict";var Xxl=Oi&&Oi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),wxl=Oi&&Oi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Hxl=Oi&&Oi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Xxl(e,t,n);return wxl(e,t),e};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.MetricOut$=Oi.MetricOut$outboundSchema=Oi.MetricOut$inboundSchema=void 0;Oi.metricOutToJSON=Exl;Oi.metricOutFromJSON=Jxl;var Cp=Hxl(se()),Yzt=be(),Qxl=oe();Oi.MetricOut$inboundSchema=Cp.object({train_loss:Cp.nullable(Cp.number()).optional(),valid_loss:Cp.nullable(Cp.number()).optional(),valid_mean_token_accuracy:Cp.nullable(Cp.number()).optional()}).transform(t=>(0,Yzt.remap)(t,{train_loss:"trainLoss",valid_loss:"validLoss",valid_mean_token_accuracy:"validMeanTokenAccuracy"}));Oi.MetricOut$outboundSchema=Cp.object({trainLoss:Cp.nullable(Cp.number()).optional(),validLoss:Cp.nullable(Cp.number()).optional(),validMeanTokenAccuracy:Cp.nullable(Cp.number()).optional()}).transform(t=>(0,Yzt.remap)(t,{trainLoss:"train_loss",validLoss:"valid_loss",validMeanTokenAccuracy:"valid_mean_token_accuracy"}));var Vzt;(function(t){t.inboundSchema=Oi.MetricOut$inboundSchema,t.outboundSchema=Oi.MetricOut$outboundSchema})(Vzt||(Oi.MetricOut$=Vzt={}));function Exl(t){return JSON.stringify(Oi.MetricOut$outboundSchema.parse(t))}function Jxl(t){return(0,Qxl.safeParse)(t,e=>Oi.MetricOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MetricOut' from JSON")}});var NGe=f(Ui=>{"use strict";var Cxl=Ui&&Ui.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Lxl=Ui&&Ui.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kxl=Ui&&Ui.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Cxl(e,t,n);return Lxl(e,t),e};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.CheckpointOut$=Ui.CheckpointOut$outboundSchema=Ui.CheckpointOut$inboundSchema=void 0;Ui.checkpointOutToJSON=jxl;Ui.checkpointOutFromJSON=Oxl;var Dj=kxl(se()),Rzt=be(),xxl=oe(),yzt=t9e();Ui.CheckpointOut$inboundSchema=Dj.object({metrics:yzt.MetricOut$inboundSchema,step_number:Dj.number().int(),created_at:Dj.number().int()}).transform(t=>(0,Rzt.remap)(t,{step_number:"stepNumber",created_at:"createdAt"}));Ui.CheckpointOut$outboundSchema=Dj.object({metrics:yzt.MetricOut$outboundSchema,stepNumber:Dj.number().int(),createdAt:Dj.number().int()}).transform(t=>(0,Rzt.remap)(t,{stepNumber:"step_number",createdAt:"created_at"}));var gzt;(function(t){t.inboundSchema=Ui.CheckpointOut$inboundSchema,t.outboundSchema=Ui.CheckpointOut$outboundSchema})(gzt||(Ui.CheckpointOut$=gzt={}));function jxl(t){return JSON.stringify(Ui.CheckpointOut$outboundSchema.parse(t))}function Oxl(t){return(0,xxl.safeParse)(t,e=>Ui.CheckpointOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CheckpointOut' from JSON")}});var Xzt=f(Ta=>{"use strict";var Uxl=Ta&&Ta.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),zxl=Ta&&Ta.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Bxl=Ta&&Ta.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Uxl(e,t,n);return zxl(e,t),e};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.ClassificationRequest$=Ta.ClassificationRequest$outboundSchema=Ta.ClassificationRequest$inboundSchema=Ta.ClassificationRequestInputs$=Ta.ClassificationRequestInputs$outboundSchema=Ta.ClassificationRequestInputs$inboundSchema=void 0;Ta.classificationRequestInputsToJSON=Sxl;Ta.classificationRequestInputsFromJSON=Mxl;Ta.classificationRequestToJSON=Txl;Ta.classificationRequestFromJSON=Dxl;var zi=Bxl(se()),vzt=be(),fzt=oe();Ta.ClassificationRequestInputs$inboundSchema=zi.union([zi.string(),zi.array(zi.string())]);Ta.ClassificationRequestInputs$outboundSchema=zi.union([zi.string(),zi.array(zi.string())]);var Azt;(function(t){t.inboundSchema=Ta.ClassificationRequestInputs$inboundSchema,t.outboundSchema=Ta.ClassificationRequestInputs$outboundSchema})(Azt||(Ta.ClassificationRequestInputs$=Azt={}));function Sxl(t){return JSON.stringify(Ta.ClassificationRequestInputs$outboundSchema.parse(t))}function Mxl(t){return(0,fzt.safeParse)(t,e=>Ta.ClassificationRequestInputs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassificationRequestInputs' from JSON")}Ta.ClassificationRequest$inboundSchema=zi.object({model:zi.string(),input:zi.union([zi.string(),zi.array(zi.string())])}).transform(t=>(0,vzt.remap)(t,{input:"inputs"}));Ta.ClassificationRequest$outboundSchema=zi.object({model:zi.string(),inputs:zi.union([zi.string(),zi.array(zi.string())])}).transform(t=>(0,vzt.remap)(t,{inputs:"input"}));var Fzt;(function(t){t.inboundSchema=Ta.ClassificationRequest$inboundSchema,t.outboundSchema=Ta.ClassificationRequest$outboundSchema})(Fzt||(Ta.ClassificationRequest$=Fzt={}));function Txl(t){return JSON.stringify(Ta.ClassificationRequest$outboundSchema.parse(t))}function Dxl(t){return(0,fzt.safeParse)(t,e=>Ta.ClassificationRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassificationRequest' from JSON")}});var n9e=f(Bi=>{"use strict";var Kxl=Bi&&Bi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),_xl=Bi&&Bi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pxl=Bi&&Bi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Kxl(e,t,n);return _xl(e,t),e};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ClassificationTargetResult$=Bi.ClassificationTargetResult$outboundSchema=Bi.ClassificationTargetResult$inboundSchema=void 0;Bi.classificationTargetResultToJSON=$xl;Bi.classificationTargetResultFromJSON=e3l;var Kj=Pxl(se()),qxl=oe();Bi.ClassificationTargetResult$inboundSchema=Kj.object({scores:Kj.record(Kj.number())});Bi.ClassificationTargetResult$outboundSchema=Kj.object({scores:Kj.record(Kj.number())});var wzt;(function(t){t.inboundSchema=Bi.ClassificationTargetResult$inboundSchema,t.outboundSchema=Bi.ClassificationTargetResult$outboundSchema})(wzt||(Bi.ClassificationTargetResult$=wzt={}));function $xl(t){return JSON.stringify(Bi.ClassificationTargetResult$outboundSchema.parse(t))}function e3l(t){return(0,qxl.safeParse)(t,e=>Bi.ClassificationTargetResult$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassificationTargetResult' from JSON")}});var Ezt=f(Si=>{"use strict";var t3l=Si&&Si.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),n3l=Si&&Si.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),l3l=Si&&Si.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&t3l(e,t,n);return n3l(e,t),e};Object.defineProperty(Si,"__esModule",{value:!0});Si.ClassificationResponse$=Si.ClassificationResponse$outboundSchema=Si.ClassificationResponse$inboundSchema=void 0;Si.classificationResponseToJSON=a3l;Si.classificationResponseFromJSON=r3l;var mR=l3l(se()),I3l=oe(),Qzt=n9e();Si.ClassificationResponse$inboundSchema=mR.object({id:mR.string(),model:mR.string(),results:mR.array(mR.record(Qzt.ClassificationTargetResult$inboundSchema))});Si.ClassificationResponse$outboundSchema=mR.object({id:mR.string(),model:mR.string(),results:mR.array(mR.record(Qzt.ClassificationTargetResult$outboundSchema))});var Hzt;(function(t){t.inboundSchema=Si.ClassificationResponse$inboundSchema,t.outboundSchema=Si.ClassificationResponse$outboundSchema})(Hzt||(Si.ClassificationResponse$=Hzt={}));function a3l(t){return JSON.stringify(Si.ClassificationResponse$outboundSchema.parse(t))}function r3l(t){return(0,I3l.safeParse)(t,e=>Si.ClassificationResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassificationResponse' from JSON")}});var VGe=f(Mi=>{"use strict";var c3l=Mi&&Mi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),o3l=Mi&&Mi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i3l=Mi&&Mi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&c3l(e,t,n);return o3l(e,t),e};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.FTClassifierLossFunction$=Mi.FTClassifierLossFunction$outboundSchema=Mi.FTClassifierLossFunction$inboundSchema=Mi.FTClassifierLossFunction=void 0;var s3l=i3l(se());Mi.FTClassifierLossFunction={SingleClass:"single_class",MultiClass:"multi_class"};Mi.FTClassifierLossFunction$inboundSchema=s3l.nativeEnum(Mi.FTClassifierLossFunction);Mi.FTClassifierLossFunction$outboundSchema=Mi.FTClassifierLossFunction$inboundSchema;var Jzt;(function(t){t.inboundSchema=Mi.FTClassifierLossFunction$inboundSchema,t.outboundSchema=Mi.FTClassifierLossFunction$outboundSchema})(Jzt||(Mi.FTClassifierLossFunction$=Jzt={}))});var YGe=f(Ti=>{"use strict";var u3l=Ti&&Ti.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),d3l=Ti&&Ti.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G3l=Ti&&Ti.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&u3l(e,t,n);return d3l(e,t),e};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.ClassifierTargetOut$=Ti.ClassifierTargetOut$outboundSchema=Ti.ClassifierTargetOut$inboundSchema=void 0;Ti.classifierTargetOutToJSON=m3l;Ti.classifierTargetOutFromJSON=p3l;var pR=G3l(se()),Lzt=be(),b3l=oe(),kzt=VGe();Ti.ClassifierTargetOut$inboundSchema=pR.object({name:pR.string(),labels:pR.array(pR.string()),weight:pR.number(),loss_function:kzt.FTClassifierLossFunction$inboundSchema}).transform(t=>(0,Lzt.remap)(t,{loss_function:"lossFunction"}));Ti.ClassifierTargetOut$outboundSchema=pR.object({name:pR.string(),labels:pR.array(pR.string()),weight:pR.number(),lossFunction:kzt.FTClassifierLossFunction$outboundSchema}).transform(t=>(0,Lzt.remap)(t,{lossFunction:"loss_function"}));var Czt;(function(t){t.inboundSchema=Ti.ClassifierTargetOut$inboundSchema,t.outboundSchema=Ti.ClassifierTargetOut$outboundSchema})(Czt||(Ti.ClassifierTargetOut$=Czt={}));function m3l(t){return JSON.stringify(Ti.ClassifierTargetOut$outboundSchema.parse(t))}function p3l(t){return(0,b3l.safeParse)(t,e=>Ti.ClassifierTargetOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierTargetOut' from JSON")}});var gGe=f(Di=>{"use strict";var h3l=Di&&Di.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Z3l=Di&&Di.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),W3l=Di&&Di.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&h3l(e,t,n);return Z3l(e,t),e};Object.defineProperty(Di,"__esModule",{value:!0});Di.ClassifierTrainingParameters$=Di.ClassifierTrainingParameters$outboundSchema=Di.ClassifierTrainingParameters$inboundSchema=void 0;Di.classifierTrainingParametersToJSON=V3l;Di.classifierTrainingParametersFromJSON=Y3l;var qc=W3l(se()),jzt=be(),N3l=oe();Di.ClassifierTrainingParameters$inboundSchema=qc.object({training_steps:qc.nullable(qc.number().int()).optional(),learning_rate:qc.number().default(1e-4),weight_decay:qc.nullable(qc.number()).optional(),warmup_fraction:qc.nullable(qc.number()).optional(),epochs:qc.nullable(qc.number()).optional(),seq_len:qc.nullable(qc.number().int()).optional()}).transform(t=>(0,jzt.remap)(t,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen"}));Di.ClassifierTrainingParameters$outboundSchema=qc.object({trainingSteps:qc.nullable(qc.number().int()).optional(),learningRate:qc.number().default(1e-4),weightDecay:qc.nullable(qc.number()).optional(),warmupFraction:qc.nullable(qc.number()).optional(),epochs:qc.nullable(qc.number()).optional(),seqLen:qc.nullable(qc.number().int()).optional()}).transform(t=>(0,jzt.remap)(t,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len"}));var xzt;(function(t){t.inboundSchema=Di.ClassifierTrainingParameters$inboundSchema,t.outboundSchema=Di.ClassifierTrainingParameters$outboundSchema})(xzt||(Di.ClassifierTrainingParameters$=xzt={}));function V3l(t){return JSON.stringify(Di.ClassifierTrainingParameters$outboundSchema.parse(t))}function Y3l(t){return(0,N3l.safeParse)(t,e=>Di.ClassifierTrainingParameters$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierTrainingParameters' from JSON")}});var RGe=f(Ki=>{"use strict";var g3l=Ki&&Ki.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),R3l=Ki&&Ki.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),y3l=Ki&&Ki.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&g3l(e,t,n);return R3l(e,t),e};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.EventOut$=Ki.EventOut$outboundSchema=Ki.EventOut$inboundSchema=void 0;Ki.eventOutToJSON=F3l;Ki.eventOutFromJSON=v3l;var TW=y3l(se()),Uzt=be(),A3l=oe();Ki.EventOut$inboundSchema=TW.object({name:TW.string(),data:TW.nullable(TW.record(TW.any())).optional(),created_at:TW.number().int()}).transform(t=>(0,Uzt.remap)(t,{created_at:"createdAt"}));Ki.EventOut$outboundSchema=TW.object({name:TW.string(),data:TW.nullable(TW.record(TW.any())).optional(),createdAt:TW.number().int()}).transform(t=>(0,Uzt.remap)(t,{createdAt:"created_at"}));var Ozt;(function(t){t.inboundSchema=Ki.EventOut$inboundSchema,t.outboundSchema=Ki.EventOut$outboundSchema})(Ozt||(Ki.EventOut$=Ozt={}));function F3l(t){return JSON.stringify(Ki.EventOut$outboundSchema.parse(t))}function v3l(t){return(0,A3l.safeParse)(t,e=>Ki.EventOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'EventOut' from JSON")}});var _j=f(_i=>{"use strict";var f3l=_i&&_i.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),X3l=_i&&_i.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),w3l=_i&&_i.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&f3l(e,t,n);return X3l(e,t),e};Object.defineProperty(_i,"__esModule",{value:!0});_i.JobMetadataOut$=_i.JobMetadataOut$outboundSchema=_i.JobMetadataOut$inboundSchema=void 0;_i.jobMetadataOutToJSON=Q3l;_i.jobMetadataOutFromJSON=E3l;var Rr=w3l(se()),Bzt=be(),H3l=oe();_i.JobMetadataOut$inboundSchema=Rr.object({expected_duration_seconds:Rr.nullable(Rr.number().int()).optional(),cost:Rr.nullable(Rr.number()).optional(),cost_currency:Rr.nullable(Rr.string()).optional(),train_tokens_per_step:Rr.nullable(Rr.number().int()).optional(),train_tokens:Rr.nullable(Rr.number().int()).optional(),data_tokens:Rr.nullable(Rr.number().int()).optional(),estimated_start_time:Rr.nullable(Rr.number().int()).optional()}).transform(t=>(0,Bzt.remap)(t,{expected_duration_seconds:"expectedDurationSeconds",cost_currency:"costCurrency",train_tokens_per_step:"trainTokensPerStep",train_tokens:"trainTokens",data_tokens:"dataTokens",estimated_start_time:"estimatedStartTime"}));_i.JobMetadataOut$outboundSchema=Rr.object({expectedDurationSeconds:Rr.nullable(Rr.number().int()).optional(),cost:Rr.nullable(Rr.number()).optional(),costCurrency:Rr.nullable(Rr.string()).optional(),trainTokensPerStep:Rr.nullable(Rr.number().int()).optional(),trainTokens:Rr.nullable(Rr.number().int()).optional(),dataTokens:Rr.nullable(Rr.number().int()).optional(),estimatedStartTime:Rr.nullable(Rr.number().int()).optional()}).transform(t=>(0,Bzt.remap)(t,{expectedDurationSeconds:"expected_duration_seconds",costCurrency:"cost_currency",trainTokensPerStep:"train_tokens_per_step",trainTokens:"train_tokens",dataTokens:"data_tokens",estimatedStartTime:"estimated_start_time"}));var zzt;(function(t){t.inboundSchema=_i.JobMetadataOut$inboundSchema,t.outboundSchema=_i.JobMetadataOut$outboundSchema})(zzt||(_i.JobMetadataOut$=zzt={}));function Q3l(t){return JSON.stringify(_i.JobMetadataOut$outboundSchema.parse(t))}function E3l(t){return(0,H3l.safeParse)(t,e=>_i.JobMetadataOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobMetadataOut' from JSON")}});var Pj=f(qI=>{"use strict";var J3l=qI&&qI.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),C3l=qI&&qI.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L3l=qI&&qI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&J3l(e,t,n);return C3l(e,t),e};Object.defineProperty(qI,"__esModule",{value:!0});qI.WandbIntegrationOut$=qI.WandbIntegrationOut$outboundSchema=qI.WandbIntegrationOut$inboundSchema=qI.WandbIntegrationOutType$=qI.WandbIntegrationOutType$outboundSchema=qI.WandbIntegrationOutType$inboundSchema=qI.WandbIntegrationOutType=void 0;qI.wandbIntegrationOutToJSON=x3l;qI.wandbIntegrationOutFromJSON=j3l;var EG=L3l(se()),Tzt=be(),k3l=oe();qI.WandbIntegrationOutType={Wandb:"wandb"};qI.WandbIntegrationOutType$inboundSchema=EG.nativeEnum(qI.WandbIntegrationOutType);qI.WandbIntegrationOutType$outboundSchema=qI.WandbIntegrationOutType$inboundSchema;var Szt;(function(t){t.inboundSchema=qI.WandbIntegrationOutType$inboundSchema,t.outboundSchema=qI.WandbIntegrationOutType$outboundSchema})(Szt||(qI.WandbIntegrationOutType$=Szt={}));qI.WandbIntegrationOut$inboundSchema=EG.object({type:qI.WandbIntegrationOutType$inboundSchema.default("wandb"),project:EG.string(),name:EG.nullable(EG.string()).optional(),run_name:EG.nullable(EG.string()).optional(),url:EG.nullable(EG.string()).optional()}).transform(t=>(0,Tzt.remap)(t,{run_name:"runName"}));qI.WandbIntegrationOut$outboundSchema=EG.object({type:qI.WandbIntegrationOutType$outboundSchema.default("wandb"),project:EG.string(),name:EG.nullable(EG.string()).optional(),runName:EG.nullable(EG.string()).optional(),url:EG.nullable(EG.string()).optional()}).transform(t=>(0,Tzt.remap)(t,{runName:"run_name"}));var Mzt;(function(t){t.inboundSchema=qI.WandbIntegrationOut$inboundSchema,t.outboundSchema=qI.WandbIntegrationOut$outboundSchema})(Mzt||(qI.WandbIntegrationOut$=Mzt={}));function x3l(t){return JSON.stringify(qI.WandbIntegrationOut$outboundSchema.parse(t))}function j3l(t){return(0,k3l.safeParse)(t,e=>qI.WandbIntegrationOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'WandbIntegrationOut' from JSON")}});var rBt=f(Wt=>{"use strict";var O3l=Wt&&Wt.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),U3l=Wt&&Wt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),z3l=Wt&&Wt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&O3l(e,t,n);return U3l(e,t),e};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ClassifierDetailedJobOut$=Wt.ClassifierDetailedJobOut$outboundSchema=Wt.ClassifierDetailedJobOut$inboundSchema=Wt.ClassifierDetailedJobOutJobType$=Wt.ClassifierDetailedJobOutJobType$outboundSchema=Wt.ClassifierDetailedJobOutJobType$inboundSchema=Wt.ClassifierDetailedJobOutIntegrations$=Wt.ClassifierDetailedJobOutIntegrations$outboundSchema=Wt.ClassifierDetailedJobOutIntegrations$inboundSchema=Wt.ClassifierDetailedJobOutObject$=Wt.ClassifierDetailedJobOutObject$outboundSchema=Wt.ClassifierDetailedJobOutObject$inboundSchema=Wt.ClassifierDetailedJobOutStatus$=Wt.ClassifierDetailedJobOutStatus$outboundSchema=Wt.ClassifierDetailedJobOutStatus$inboundSchema=Wt.ClassifierDetailedJobOutJobType=Wt.ClassifierDetailedJobOutObject=Wt.ClassifierDetailedJobOutStatus=void 0;Wt.classifierDetailedJobOutIntegrationsToJSON=B3l;Wt.classifierDetailedJobOutIntegrationsFromJSON=S3l;Wt.classifierDetailedJobOutToJSON=M3l;Wt.classifierDetailedJobOutFromJSON=T3l;var Cn=z3l(se()),$zt=be(),eBt=oe(),tBt=NGe(),nBt=YGe(),lBt=gGe(),IBt=RGe(),aBt=_j(),yGe=Pj();Wt.ClassifierDetailedJobOutStatus={Queued:"QUEUED",Started:"STARTED",Validating:"VALIDATING",Validated:"VALIDATED",Running:"RUNNING",FailedValidation:"FAILED_VALIDATION",Failed:"FAILED",Success:"SUCCESS",Cancelled:"CANCELLED",CancellationRequested:"CANCELLATION_REQUESTED"};Wt.ClassifierDetailedJobOutObject={Job:"job"};Wt.ClassifierDetailedJobOutJobType={Classifier:"classifier"};Wt.ClassifierDetailedJobOutStatus$inboundSchema=Cn.nativeEnum(Wt.ClassifierDetailedJobOutStatus);Wt.ClassifierDetailedJobOutStatus$outboundSchema=Wt.ClassifierDetailedJobOutStatus$inboundSchema;var Dzt;(function(t){t.inboundSchema=Wt.ClassifierDetailedJobOutStatus$inboundSchema,t.outboundSchema=Wt.ClassifierDetailedJobOutStatus$outboundSchema})(Dzt||(Wt.ClassifierDetailedJobOutStatus$=Dzt={}));Wt.ClassifierDetailedJobOutObject$inboundSchema=Cn.nativeEnum(Wt.ClassifierDetailedJobOutObject);Wt.ClassifierDetailedJobOutObject$outboundSchema=Wt.ClassifierDetailedJobOutObject$inboundSchema;var Kzt;(function(t){t.inboundSchema=Wt.ClassifierDetailedJobOutObject$inboundSchema,t.outboundSchema=Wt.ClassifierDetailedJobOutObject$outboundSchema})(Kzt||(Wt.ClassifierDetailedJobOutObject$=Kzt={}));Wt.ClassifierDetailedJobOutIntegrations$inboundSchema=yGe.WandbIntegrationOut$inboundSchema;Wt.ClassifierDetailedJobOutIntegrations$outboundSchema=yGe.WandbIntegrationOut$outboundSchema;var _zt;(function(t){t.inboundSchema=Wt.ClassifierDetailedJobOutIntegrations$inboundSchema,t.outboundSchema=Wt.ClassifierDetailedJobOutIntegrations$outboundSchema})(_zt||(Wt.ClassifierDetailedJobOutIntegrations$=_zt={}));function B3l(t){return JSON.stringify(Wt.ClassifierDetailedJobOutIntegrations$outboundSchema.parse(t))}function S3l(t){return(0,eBt.safeParse)(t,e=>Wt.ClassifierDetailedJobOutIntegrations$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierDetailedJobOutIntegrations' from JSON")}Wt.ClassifierDetailedJobOutJobType$inboundSchema=Cn.nativeEnum(Wt.ClassifierDetailedJobOutJobType);Wt.ClassifierDetailedJobOutJobType$outboundSchema=Wt.ClassifierDetailedJobOutJobType$inboundSchema;var Pzt;(function(t){t.inboundSchema=Wt.ClassifierDetailedJobOutJobType$inboundSchema,t.outboundSchema=Wt.ClassifierDetailedJobOutJobType$outboundSchema})(Pzt||(Wt.ClassifierDetailedJobOutJobType$=Pzt={}));Wt.ClassifierDetailedJobOut$inboundSchema=Cn.object({id:Cn.string(),auto_start:Cn.boolean(),model:Cn.string(),status:Wt.ClassifierDetailedJobOutStatus$inboundSchema,created_at:Cn.number().int(),modified_at:Cn.number().int(),training_files:Cn.array(Cn.string()),validation_files:Cn.nullable(Cn.array(Cn.string())).optional(),object:Wt.ClassifierDetailedJobOutObject$inboundSchema.default("job"),fine_tuned_model:Cn.nullable(Cn.string()).optional(),suffix:Cn.nullable(Cn.string()).optional(),integrations:Cn.nullable(Cn.array(yGe.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:Cn.nullable(Cn.number().int()).optional(),metadata:Cn.nullable(aBt.JobMetadataOut$inboundSchema).optional(),job_type:Wt.ClassifierDetailedJobOutJobType$inboundSchema.default("classifier"),hyperparameters:lBt.ClassifierTrainingParameters$inboundSchema,events:Cn.array(IBt.EventOut$inboundSchema).optional(),checkpoints:Cn.array(tBt.CheckpointOut$inboundSchema).optional(),classifier_targets:Cn.array(nBt.ClassifierTargetOut$inboundSchema)}).transform(t=>(0,$zt.remap)(t,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType",classifier_targets:"classifierTargets"}));Wt.ClassifierDetailedJobOut$outboundSchema=Cn.object({id:Cn.string(),autoStart:Cn.boolean(),model:Cn.string(),status:Wt.ClassifierDetailedJobOutStatus$outboundSchema,createdAt:Cn.number().int(),modifiedAt:Cn.number().int(),trainingFiles:Cn.array(Cn.string()),validationFiles:Cn.nullable(Cn.array(Cn.string())).optional(),object:Wt.ClassifierDetailedJobOutObject$outboundSchema.default("job"),fineTunedModel:Cn.nullable(Cn.string()).optional(),suffix:Cn.nullable(Cn.string()).optional(),integrations:Cn.nullable(Cn.array(yGe.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:Cn.nullable(Cn.number().int()).optional(),metadata:Cn.nullable(aBt.JobMetadataOut$outboundSchema).optional(),jobType:Wt.ClassifierDetailedJobOutJobType$outboundSchema.default("classifier"),hyperparameters:lBt.ClassifierTrainingParameters$outboundSchema,events:Cn.array(IBt.EventOut$outboundSchema).optional(),checkpoints:Cn.array(tBt.CheckpointOut$outboundSchema).optional(),classifierTargets:Cn.array(nBt.ClassifierTargetOut$outboundSchema)}).transform(t=>(0,$zt.remap)(t,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type",classifierTargets:"classifier_targets"}));var qzt;(function(t){t.inboundSchema=Wt.ClassifierDetailedJobOut$inboundSchema,t.outboundSchema=Wt.ClassifierDetailedJobOut$outboundSchema})(qzt||(Wt.ClassifierDetailedJobOut$=qzt={}));function M3l(t){return JSON.stringify(Wt.ClassifierDetailedJobOut$outboundSchema.parse(t))}function T3l(t){return(0,eBt.safeParse)(t,e=>Wt.ClassifierDetailedJobOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierDetailedJobOut' from JSON")}});var AGe=f(Pi=>{"use strict";var D3l=Pi&&Pi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),K3l=Pi&&Pi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_3l=Pi&&Pi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&D3l(e,t,n);return K3l(e,t),e};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.FTModelCapabilitiesOut$=Pi.FTModelCapabilitiesOut$outboundSchema=Pi.FTModelCapabilitiesOut$inboundSchema=void 0;Pi.ftModelCapabilitiesOutToJSON=q3l;Pi.ftModelCapabilitiesOutFromJSON=$3l;var DW=_3l(se()),oBt=be(),P3l=oe();Pi.FTModelCapabilitiesOut$inboundSchema=DW.object({completion_chat:DW.boolean().default(!0),completion_fim:DW.boolean().default(!1),function_calling:DW.boolean().default(!1),fine_tuning:DW.boolean().default(!1),classification:DW.boolean().default(!1)}).transform(t=>(0,oBt.remap)(t,{completion_chat:"completionChat",completion_fim:"completionFim",function_calling:"functionCalling",fine_tuning:"fineTuning"}));Pi.FTModelCapabilitiesOut$outboundSchema=DW.object({completionChat:DW.boolean().default(!0),completionFim:DW.boolean().default(!1),functionCalling:DW.boolean().default(!1),fineTuning:DW.boolean().default(!1),classification:DW.boolean().default(!1)}).transform(t=>(0,oBt.remap)(t,{completionChat:"completion_chat",completionFim:"completion_fim",functionCalling:"function_calling",fineTuning:"fine_tuning"}));var cBt;(function(t){t.inboundSchema=Pi.FTModelCapabilitiesOut$inboundSchema,t.outboundSchema=Pi.FTModelCapabilitiesOut$outboundSchema})(cBt||(Pi.FTModelCapabilitiesOut$=cBt={}));function q3l(t){return JSON.stringify(Pi.FTModelCapabilitiesOut$outboundSchema.parse(t))}function $3l(t){return(0,P3l.safeParse)(t,e=>Pi.FTModelCapabilitiesOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FTModelCapabilitiesOut' from JSON")}});var mBt=f(Un=>{"use strict";var e4l=Un&&Un.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),t4l=Un&&Un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n4l=Un&&Un.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&e4l(e,t,n);return t4l(e,t),e};Object.defineProperty(Un,"__esModule",{value:!0});Un.ClassifierFTModelOut$=Un.ClassifierFTModelOut$outboundSchema=Un.ClassifierFTModelOut$inboundSchema=Un.ClassifierFTModelOutModelType$=Un.ClassifierFTModelOutModelType$outboundSchema=Un.ClassifierFTModelOutModelType$inboundSchema=Un.ClassifierFTModelOutObject$=Un.ClassifierFTModelOutObject$outboundSchema=Un.ClassifierFTModelOutObject$inboundSchema=Un.ClassifierFTModelOutModelType=Un.ClassifierFTModelOutObject=void 0;Un.classifierFTModelOutToJSON=I4l;Un.classifierFTModelOutFromJSON=a4l;var Da=n4l(se()),dBt=be(),l4l=oe(),GBt=YGe(),bBt=AGe();Un.ClassifierFTModelOutObject={Model:"model"};Un.ClassifierFTModelOutModelType={Classifier:"classifier"};Un.ClassifierFTModelOutObject$inboundSchema=Da.nativeEnum(Un.ClassifierFTModelOutObject);Un.ClassifierFTModelOutObject$outboundSchema=Un.ClassifierFTModelOutObject$inboundSchema;var iBt;(function(t){t.inboundSchema=Un.ClassifierFTModelOutObject$inboundSchema,t.outboundSchema=Un.ClassifierFTModelOutObject$outboundSchema})(iBt||(Un.ClassifierFTModelOutObject$=iBt={}));Un.ClassifierFTModelOutModelType$inboundSchema=Da.nativeEnum(Un.ClassifierFTModelOutModelType);Un.ClassifierFTModelOutModelType$outboundSchema=Un.ClassifierFTModelOutModelType$inboundSchema;var sBt;(function(t){t.inboundSchema=Un.ClassifierFTModelOutModelType$inboundSchema,t.outboundSchema=Un.ClassifierFTModelOutModelType$outboundSchema})(sBt||(Un.ClassifierFTModelOutModelType$=sBt={}));Un.ClassifierFTModelOut$inboundSchema=Da.object({id:Da.string(),object:Un.ClassifierFTModelOutObject$inboundSchema.default("model"),created:Da.number().int(),owned_by:Da.string(),root:Da.string(),archived:Da.boolean(),name:Da.nullable(Da.string()).optional(),description:Da.nullable(Da.string()).optional(),capabilities:bBt.FTModelCapabilitiesOut$inboundSchema,max_context_length:Da.number().int().default(32768),aliases:Da.array(Da.string()).optional(),job:Da.string(),classifier_targets:Da.array(GBt.ClassifierTargetOut$inboundSchema),model_type:Un.ClassifierFTModelOutModelType$inboundSchema.default("classifier")}).transform(t=>(0,dBt.remap)(t,{owned_by:"ownedBy",max_context_length:"maxContextLength",classifier_targets:"classifierTargets",model_type:"modelType"}));Un.ClassifierFTModelOut$outboundSchema=Da.object({id:Da.string(),object:Un.ClassifierFTModelOutObject$outboundSchema.default("model"),created:Da.number().int(),ownedBy:Da.string(),root:Da.string(),archived:Da.boolean(),name:Da.nullable(Da.string()).optional(),description:Da.nullable(Da.string()).optional(),capabilities:bBt.FTModelCapabilitiesOut$outboundSchema,maxContextLength:Da.number().int().default(32768),aliases:Da.array(Da.string()).optional(),job:Da.string(),classifierTargets:Da.array(GBt.ClassifierTargetOut$outboundSchema),modelType:Un.ClassifierFTModelOutModelType$outboundSchema.default("classifier")}).transform(t=>(0,dBt.remap)(t,{ownedBy:"owned_by",maxContextLength:"max_context_length",classifierTargets:"classifier_targets",modelType:"model_type"}));var uBt;(function(t){t.inboundSchema=Un.ClassifierFTModelOut$inboundSchema,t.outboundSchema=Un.ClassifierFTModelOut$outboundSchema})(uBt||(Un.ClassifierFTModelOut$=uBt={}));function I4l(t){return JSON.stringify(Un.ClassifierFTModelOut$outboundSchema.parse(t))}function a4l(t){return(0,l4l.safeParse)(t,e=>Un.ClassifierFTModelOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierFTModelOut' from JSON")}});var l9e=f(Nt=>{"use strict";var r4l=Nt&&Nt.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),c4l=Nt&&Nt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o4l=Nt&&Nt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&r4l(e,t,n);return c4l(e,t),e};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.ClassifierJobOut$=Nt.ClassifierJobOut$outboundSchema=Nt.ClassifierJobOut$inboundSchema=Nt.ClassifierJobOutJobType$=Nt.ClassifierJobOutJobType$outboundSchema=Nt.ClassifierJobOutJobType$inboundSchema=Nt.ClassifierJobOutIntegrations$=Nt.ClassifierJobOutIntegrations$outboundSchema=Nt.ClassifierJobOutIntegrations$inboundSchema=Nt.ClassifierJobOutObject$=Nt.ClassifierJobOutObject$outboundSchema=Nt.ClassifierJobOutObject$inboundSchema=Nt.ClassifierJobOutStatus$=Nt.ClassifierJobOutStatus$outboundSchema=Nt.ClassifierJobOutStatus$inboundSchema=Nt.ClassifierJobOutJobType=Nt.ClassifierJobOutObject=Nt.ClassifierJobOutStatus=void 0;Nt.classifierJobOutIntegrationsToJSON=i4l;Nt.classifierJobOutIntegrationsFromJSON=s4l;Nt.classifierJobOutToJSON=u4l;Nt.classifierJobOutFromJSON=d4l;var Ql=o4l(se()),VBt=be(),YBt=oe(),gBt=gGe(),RBt=_j(),FGe=Pj();Nt.ClassifierJobOutStatus={Queued:"QUEUED",Started:"STARTED",Validating:"VALIDATING",Validated:"VALIDATED",Running:"RUNNING",FailedValidation:"FAILED_VALIDATION",Failed:"FAILED",Success:"SUCCESS",Cancelled:"CANCELLED",CancellationRequested:"CANCELLATION_REQUESTED"};Nt.ClassifierJobOutObject={Job:"job"};Nt.ClassifierJobOutJobType={Classifier:"classifier"};Nt.ClassifierJobOutStatus$inboundSchema=Ql.nativeEnum(Nt.ClassifierJobOutStatus);Nt.ClassifierJobOutStatus$outboundSchema=Nt.ClassifierJobOutStatus$inboundSchema;var pBt;(function(t){t.inboundSchema=Nt.ClassifierJobOutStatus$inboundSchema,t.outboundSchema=Nt.ClassifierJobOutStatus$outboundSchema})(pBt||(Nt.ClassifierJobOutStatus$=pBt={}));Nt.ClassifierJobOutObject$inboundSchema=Ql.nativeEnum(Nt.ClassifierJobOutObject);Nt.ClassifierJobOutObject$outboundSchema=Nt.ClassifierJobOutObject$inboundSchema;var hBt;(function(t){t.inboundSchema=Nt.ClassifierJobOutObject$inboundSchema,t.outboundSchema=Nt.ClassifierJobOutObject$outboundSchema})(hBt||(Nt.ClassifierJobOutObject$=hBt={}));Nt.ClassifierJobOutIntegrations$inboundSchema=FGe.WandbIntegrationOut$inboundSchema;Nt.ClassifierJobOutIntegrations$outboundSchema=FGe.WandbIntegrationOut$outboundSchema;var ZBt;(function(t){t.inboundSchema=Nt.ClassifierJobOutIntegrations$inboundSchema,t.outboundSchema=Nt.ClassifierJobOutIntegrations$outboundSchema})(ZBt||(Nt.ClassifierJobOutIntegrations$=ZBt={}));function i4l(t){return JSON.stringify(Nt.ClassifierJobOutIntegrations$outboundSchema.parse(t))}function s4l(t){return(0,YBt.safeParse)(t,e=>Nt.ClassifierJobOutIntegrations$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierJobOutIntegrations' from JSON")}Nt.ClassifierJobOutJobType$inboundSchema=Ql.nativeEnum(Nt.ClassifierJobOutJobType);Nt.ClassifierJobOutJobType$outboundSchema=Nt.ClassifierJobOutJobType$inboundSchema;var WBt;(function(t){t.inboundSchema=Nt.ClassifierJobOutJobType$inboundSchema,t.outboundSchema=Nt.ClassifierJobOutJobType$outboundSchema})(WBt||(Nt.ClassifierJobOutJobType$=WBt={}));Nt.ClassifierJobOut$inboundSchema=Ql.object({id:Ql.string(),auto_start:Ql.boolean(),model:Ql.string(),status:Nt.ClassifierJobOutStatus$inboundSchema,created_at:Ql.number().int(),modified_at:Ql.number().int(),training_files:Ql.array(Ql.string()),validation_files:Ql.nullable(Ql.array(Ql.string())).optional(),object:Nt.ClassifierJobOutObject$inboundSchema.default("job"),fine_tuned_model:Ql.nullable(Ql.string()).optional(),suffix:Ql.nullable(Ql.string()).optional(),integrations:Ql.nullable(Ql.array(FGe.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:Ql.nullable(Ql.number().int()).optional(),metadata:Ql.nullable(RBt.JobMetadataOut$inboundSchema).optional(),job_type:Nt.ClassifierJobOutJobType$inboundSchema.default("classifier"),hyperparameters:gBt.ClassifierTrainingParameters$inboundSchema}).transform(t=>(0,VBt.remap)(t,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType"}));Nt.ClassifierJobOut$outboundSchema=Ql.object({id:Ql.string(),autoStart:Ql.boolean(),model:Ql.string(),status:Nt.ClassifierJobOutStatus$outboundSchema,createdAt:Ql.number().int(),modifiedAt:Ql.number().int(),trainingFiles:Ql.array(Ql.string()),validationFiles:Ql.nullable(Ql.array(Ql.string())).optional(),object:Nt.ClassifierJobOutObject$outboundSchema.default("job"),fineTunedModel:Ql.nullable(Ql.string()).optional(),suffix:Ql.nullable(Ql.string()).optional(),integrations:Ql.nullable(Ql.array(FGe.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:Ql.nullable(Ql.number().int()).optional(),metadata:Ql.nullable(RBt.JobMetadataOut$outboundSchema).optional(),jobType:Nt.ClassifierJobOutJobType$outboundSchema.default("classifier"),hyperparameters:gBt.ClassifierTrainingParameters$outboundSchema}).transform(t=>(0,VBt.remap)(t,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type"}));var NBt;(function(t){t.inboundSchema=Nt.ClassifierJobOut$inboundSchema,t.outboundSchema=Nt.ClassifierJobOut$outboundSchema})(NBt||(Nt.ClassifierJobOut$=NBt={}));function u4l(t){return JSON.stringify(Nt.ClassifierJobOut$outboundSchema.parse(t))}function d4l(t){return(0,YBt.safeParse)(t,e=>Nt.ClassifierJobOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierJobOut' from JSON")}});var I9e=f(qi=>{"use strict";var G4l=qi&&qi.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),b4l=qi&&qi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),m4l=qi&&qi.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&G4l(e,t,n);return b4l(e,t),e};Object.defineProperty(qi,"__esModule",{value:!0});qi.ClassifierTargetIn$=qi.ClassifierTargetIn$outboundSchema=qi.ClassifierTargetIn$inboundSchema=void 0;qi.classifierTargetInToJSON=h4l;qi.classifierTargetInFromJSON=Z4l;var KW=m4l(se()),ABt=be(),p4l=oe(),FBt=VGe();qi.ClassifierTargetIn$inboundSchema=KW.object({name:KW.string(),labels:KW.array(KW.string()),weight:KW.number().default(1),loss_function:KW.nullable(FBt.FTClassifierLossFunction$inboundSchema).optional()}).transform(t=>(0,ABt.remap)(t,{loss_function:"lossFunction"}));qi.ClassifierTargetIn$outboundSchema=KW.object({name:KW.string(),labels:KW.array(KW.string()),weight:KW.number().default(1),lossFunction:KW.nullable(FBt.FTClassifierLossFunction$outboundSchema).optional()}).transform(t=>(0,ABt.remap)(t,{lossFunction:"loss_function"}));var yBt;(function(t){t.inboundSchema=qi.ClassifierTargetIn$inboundSchema,t.outboundSchema=qi.ClassifierTargetIn$outboundSchema})(yBt||(qi.ClassifierTargetIn$=yBt={}));function h4l(t){return JSON.stringify(qi.ClassifierTargetIn$outboundSchema.parse(t))}function Z4l(t){return(0,p4l.safeParse)(t,e=>qi.ClassifierTargetIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierTargetIn' from JSON")}});var a9e=f($i=>{"use strict";var W4l=$i&&$i.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),N4l=$i&&$i.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V4l=$i&&$i.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&W4l(e,t,n);return N4l(e,t),e};Object.defineProperty($i,"__esModule",{value:!0});$i.ClassifierTrainingParametersIn$=$i.ClassifierTrainingParametersIn$outboundSchema=$i.ClassifierTrainingParametersIn$inboundSchema=void 0;$i.classifierTrainingParametersInToJSON=g4l;$i.classifierTrainingParametersInFromJSON=R4l;var $c=V4l(se()),fBt=be(),Y4l=oe();$i.ClassifierTrainingParametersIn$inboundSchema=$c.object({training_steps:$c.nullable($c.number().int()).optional(),learning_rate:$c.number().default(1e-4),weight_decay:$c.nullable($c.number()).optional(),warmup_fraction:$c.nullable($c.number()).optional(),epochs:$c.nullable($c.number()).optional(),seq_len:$c.nullable($c.number().int()).optional()}).transform(t=>(0,fBt.remap)(t,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen"}));$i.ClassifierTrainingParametersIn$outboundSchema=$c.object({trainingSteps:$c.nullable($c.number().int()).optional(),learningRate:$c.number().default(1e-4),weightDecay:$c.nullable($c.number()).optional(),warmupFraction:$c.nullable($c.number()).optional(),epochs:$c.nullable($c.number()).optional(),seqLen:$c.nullable($c.number().int()).optional()}).transform(t=>(0,fBt.remap)(t,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len"}));var vBt;(function(t){t.inboundSchema=$i.ClassifierTrainingParametersIn$inboundSchema,t.outboundSchema=$i.ClassifierTrainingParametersIn$outboundSchema})(vBt||($i.ClassifierTrainingParametersIn$=vBt={}));function g4l(t){return JSON.stringify($i.ClassifierTrainingParametersIn$outboundSchema.parse(t))}function R4l(t){return(0,Y4l.safeParse)(t,e=>$i.ClassifierTrainingParametersIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ClassifierTrainingParametersIn' from JSON")}});var r9e=f(Ka=>{"use strict";var y4l=Ka&&Ka.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),A4l=Ka&&Ka.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),F4l=Ka&&Ka.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&y4l(e,t,n);return A4l(e,t),e};Object.defineProperty(Ka,"__esModule",{value:!0});Ka.DeltaMessage$=Ka.DeltaMessage$outboundSchema=Ka.DeltaMessage$inboundSchema=Ka.Content$=Ka.Content$outboundSchema=Ka.Content$inboundSchema=void 0;Ka.contentToJSON=v4l;Ka.contentFromJSON=f4l;Ka.deltaMessageToJSON=X4l;Ka.deltaMessageFromJSON=w4l;var eo=F4l(se()),HBt=be(),QBt=oe(),vGe=Oj(),EBt=Yde();Ka.Content$inboundSchema=eo.union([eo.string(),eo.array(vGe.ContentChunk$inboundSchema)]);Ka.Content$outboundSchema=eo.union([eo.string(),eo.array(vGe.ContentChunk$outboundSchema)]);var XBt;(function(t){t.inboundSchema=Ka.Content$inboundSchema,t.outboundSchema=Ka.Content$outboundSchema})(XBt||(Ka.Content$=XBt={}));function v4l(t){return JSON.stringify(Ka.Content$outboundSchema.parse(t))}function f4l(t){return(0,QBt.safeParse)(t,e=>Ka.Content$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Content' from JSON")}Ka.DeltaMessage$inboundSchema=eo.object({role:eo.nullable(eo.string()).optional(),content:eo.nullable(eo.union([eo.string(),eo.array(vGe.ContentChunk$inboundSchema)])).optional(),tool_calls:eo.nullable(eo.array(EBt.ToolCall$inboundSchema)).optional()}).transform(t=>(0,HBt.remap)(t,{tool_calls:"toolCalls"}));Ka.DeltaMessage$outboundSchema=eo.object({role:eo.nullable(eo.string()).optional(),content:eo.nullable(eo.union([eo.string(),eo.array(vGe.ContentChunk$outboundSchema)])).optional(),toolCalls:eo.nullable(eo.array(EBt.ToolCall$outboundSchema)).optional()}).transform(t=>(0,HBt.remap)(t,{toolCalls:"tool_calls"}));var wBt;(function(t){t.inboundSchema=Ka.DeltaMessage$inboundSchema,t.outboundSchema=Ka.DeltaMessage$outboundSchema})(wBt||(Ka.DeltaMessage$=wBt={}));function X4l(t){return JSON.stringify(Ka.DeltaMessage$outboundSchema.parse(t))}function w4l(t){return(0,QBt.safeParse)(t,e=>Ka.DeltaMessage$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DeltaMessage' from JSON")}});var c9e=f($I=>{"use strict";var H4l=$I&&$I.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Q4l=$I&&$I.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),E4l=$I&&$I.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&H4l(e,t,n);return Q4l(e,t),e};Object.defineProperty($I,"__esModule",{value:!0});$I.CompletionResponseStreamChoice$=$I.CompletionResponseStreamChoice$outboundSchema=$I.CompletionResponseStreamChoice$inboundSchema=$I.CompletionResponseStreamChoiceFinishReason$=$I.CompletionResponseStreamChoiceFinishReason$outboundSchema=$I.CompletionResponseStreamChoiceFinishReason$inboundSchema=$I.CompletionResponseStreamChoiceFinishReason=void 0;$I.completionResponseStreamChoiceToJSON=L4l;$I.completionResponseStreamChoiceFromJSON=k4l;var IZ=E4l(se()),LBt=be(),J4l=oe(),C4l=BV(),kBt=r9e();$I.CompletionResponseStreamChoiceFinishReason={Stop:"stop",Length:"length",Error:"error",ToolCalls:"tool_calls"};$I.CompletionResponseStreamChoiceFinishReason$inboundSchema=IZ.union([IZ.nativeEnum($I.CompletionResponseStreamChoiceFinishReason),IZ.string().transform(C4l.catchUnrecognizedEnum)]);$I.CompletionResponseStreamChoiceFinishReason$outboundSchema=IZ.union([IZ.nativeEnum($I.CompletionResponseStreamChoiceFinishReason),IZ.string().and(IZ.custom())]);var JBt;(function(t){t.inboundSchema=$I.CompletionResponseStreamChoiceFinishReason$inboundSchema,t.outboundSchema=$I.CompletionResponseStreamChoiceFinishReason$outboundSchema})(JBt||($I.CompletionResponseStreamChoiceFinishReason$=JBt={}));$I.CompletionResponseStreamChoice$inboundSchema=IZ.object({index:IZ.number().int(),delta:kBt.DeltaMessage$inboundSchema,finish_reason:IZ.nullable($I.CompletionResponseStreamChoiceFinishReason$inboundSchema)}).transform(t=>(0,LBt.remap)(t,{finish_reason:"finishReason"}));$I.CompletionResponseStreamChoice$outboundSchema=IZ.object({index:IZ.number().int(),delta:kBt.DeltaMessage$outboundSchema,finishReason:IZ.nullable($I.CompletionResponseStreamChoiceFinishReason$outboundSchema)}).transform(t=>(0,LBt.remap)(t,{finishReason:"finish_reason"}));var CBt;(function(t){t.inboundSchema=$I.CompletionResponseStreamChoice$inboundSchema,t.outboundSchema=$I.CompletionResponseStreamChoice$outboundSchema})(CBt||($I.CompletionResponseStreamChoice$=CBt={}));function L4l(t){return JSON.stringify($I.CompletionResponseStreamChoice$outboundSchema.parse(t))}function k4l(t){return(0,J4l.safeParse)(t,e=>$I.CompletionResponseStreamChoice$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionResponseStreamChoice' from JSON")}});var o9e=f(es=>{"use strict";var x4l=es&&es.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),j4l=es&&es.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),O4l=es&&es.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&x4l(e,t,n);return j4l(e,t),e};Object.defineProperty(es,"__esModule",{value:!0});es.CompletionChunk$=es.CompletionChunk$outboundSchema=es.CompletionChunk$inboundSchema=void 0;es.completionChunkToJSON=z4l;es.completionChunkFromJSON=B4l;var _W=O4l(se()),U4l=oe(),jBt=c9e(),OBt=Tj();es.CompletionChunk$inboundSchema=_W.object({id:_W.string(),object:_W.string().optional(),created:_W.number().int().optional(),model:_W.string(),usage:OBt.UsageInfo$inboundSchema.optional(),choices:_W.array(jBt.CompletionResponseStreamChoice$inboundSchema)});es.CompletionChunk$outboundSchema=_W.object({id:_W.string(),object:_W.string().optional(),created:_W.number().int().optional(),model:_W.string(),usage:OBt.UsageInfo$outboundSchema.optional(),choices:_W.array(jBt.CompletionResponseStreamChoice$outboundSchema)});var xBt;(function(t){t.inboundSchema=es.CompletionChunk$inboundSchema,t.outboundSchema=es.CompletionChunk$outboundSchema})(xBt||(es.CompletionChunk$=xBt={}));function z4l(t){return JSON.stringify(es.CompletionChunk$outboundSchema.parse(t))}function B4l(t){return(0,U4l.safeParse)(t,e=>es.CompletionChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionChunk' from JSON")}});var fGe=f(ts=>{"use strict";var S4l=ts&&ts.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),M4l=ts&&ts.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),T4l=ts&&ts.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&S4l(e,t,n);return M4l(e,t),e};Object.defineProperty(ts,"__esModule",{value:!0});ts.CompletionTrainingParameters$=ts.CompletionTrainingParameters$outboundSchema=ts.CompletionTrainingParameters$inboundSchema=void 0;ts.completionTrainingParametersToJSON=K4l;ts.completionTrainingParametersFromJSON=_4l;var Br=T4l(se()),zBt=be(),D4l=oe();ts.CompletionTrainingParameters$inboundSchema=Br.object({training_steps:Br.nullable(Br.number().int()).optional(),learning_rate:Br.number().default(1e-4),weight_decay:Br.nullable(Br.number()).optional(),warmup_fraction:Br.nullable(Br.number()).optional(),epochs:Br.nullable(Br.number()).optional(),seq_len:Br.nullable(Br.number().int()).optional(),fim_ratio:Br.nullable(Br.number()).optional()}).transform(t=>(0,zBt.remap)(t,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen",fim_ratio:"fimRatio"}));ts.CompletionTrainingParameters$outboundSchema=Br.object({trainingSteps:Br.nullable(Br.number().int()).optional(),learningRate:Br.number().default(1e-4),weightDecay:Br.nullable(Br.number()).optional(),warmupFraction:Br.nullable(Br.number()).optional(),epochs:Br.nullable(Br.number()).optional(),seqLen:Br.nullable(Br.number().int()).optional(),fimRatio:Br.nullable(Br.number()).optional()}).transform(t=>(0,zBt.remap)(t,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len",fimRatio:"fim_ratio"}));var UBt;(function(t){t.inboundSchema=ts.CompletionTrainingParameters$inboundSchema,t.outboundSchema=ts.CompletionTrainingParameters$outboundSchema})(UBt||(ts.CompletionTrainingParameters$=UBt={}));function K4l(t){return JSON.stringify(ts.CompletionTrainingParameters$outboundSchema.parse(t))}function _4l(t){return(0,D4l.safeParse)(t,e=>ts.CompletionTrainingParameters$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionTrainingParameters' from JSON")}});var XGe=f(ea=>{"use strict";var P4l=ea&&ea.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),q4l=ea&&ea.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$4l=ea&&ea.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&P4l(e,t,n);return q4l(e,t),e};Object.defineProperty(ea,"__esModule",{value:!0});ea.GithubRepositoryOut$=ea.GithubRepositoryOut$outboundSchema=ea.GithubRepositoryOut$inboundSchema=ea.GithubRepositoryOutType$=ea.GithubRepositoryOutType$outboundSchema=ea.GithubRepositoryOutType$inboundSchema=ea.GithubRepositoryOutType=void 0;ea.githubRepositoryOutToJSON=tjl;ea.githubRepositoryOutFromJSON=njl;var Am=$4l(se()),MBt=be(),ejl=oe();ea.GithubRepositoryOutType={Github:"github"};ea.GithubRepositoryOutType$inboundSchema=Am.nativeEnum(ea.GithubRepositoryOutType);ea.GithubRepositoryOutType$outboundSchema=ea.GithubRepositoryOutType$inboundSchema;var BBt;(function(t){t.inboundSchema=ea.GithubRepositoryOutType$inboundSchema,t.outboundSchema=ea.GithubRepositoryOutType$outboundSchema})(BBt||(ea.GithubRepositoryOutType$=BBt={}));ea.GithubRepositoryOut$inboundSchema=Am.object({type:ea.GithubRepositoryOutType$inboundSchema.default("github"),name:Am.string(),owner:Am.string(),ref:Am.nullable(Am.string()).optional(),weight:Am.number().default(1),commit_id:Am.string()}).transform(t=>(0,MBt.remap)(t,{commit_id:"commitId"}));ea.GithubRepositoryOut$outboundSchema=Am.object({type:ea.GithubRepositoryOutType$outboundSchema.default("github"),name:Am.string(),owner:Am.string(),ref:Am.nullable(Am.string()).optional(),weight:Am.number().default(1),commitId:Am.string()}).transform(t=>(0,MBt.remap)(t,{commitId:"commit_id"}));var SBt;(function(t){t.inboundSchema=ea.GithubRepositoryOut$inboundSchema,t.outboundSchema=ea.GithubRepositoryOut$outboundSchema})(SBt||(ea.GithubRepositoryOut$=SBt={}));function tjl(t){return JSON.stringify(ea.GithubRepositoryOut$outboundSchema.parse(t))}function njl(t){return(0,ejl.safeParse)(t,e=>ea.GithubRepositoryOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'GithubRepositoryOut' from JSON")}});var ISt=f(at=>{"use strict";var ljl=at&&at.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Ijl=at&&at.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ajl=at&&at.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ljl(e,t,n);return Ijl(e,t),e};Object.defineProperty(at,"__esModule",{value:!0});at.CompletionDetailedJobOut$=at.CompletionDetailedJobOut$outboundSchema=at.CompletionDetailedJobOut$inboundSchema=at.CompletionDetailedJobOutRepositories$=at.CompletionDetailedJobOutRepositories$outboundSchema=at.CompletionDetailedJobOutRepositories$inboundSchema=at.CompletionDetailedJobOutJobType$=at.CompletionDetailedJobOutJobType$outboundSchema=at.CompletionDetailedJobOutJobType$inboundSchema=at.CompletionDetailedJobOutIntegrations$=at.CompletionDetailedJobOutIntegrations$outboundSchema=at.CompletionDetailedJobOutIntegrations$inboundSchema=at.CompletionDetailedJobOutObject$=at.CompletionDetailedJobOutObject$outboundSchema=at.CompletionDetailedJobOutObject$inboundSchema=at.CompletionDetailedJobOutStatus$=at.CompletionDetailedJobOutStatus$outboundSchema=at.CompletionDetailedJobOutStatus$inboundSchema=at.CompletionDetailedJobOutJobType=at.CompletionDetailedJobOutObject=at.CompletionDetailedJobOutStatus=void 0;at.completionDetailedJobOutIntegrationsToJSON=rjl;at.completionDetailedJobOutIntegrationsFromJSON=cjl;at.completionDetailedJobOutRepositoriesToJSON=ojl;at.completionDetailedJobOutRepositoriesFromJSON=ijl;at.completionDetailedJobOutToJSON=sjl;at.completionDetailedJobOutFromJSON=ujl;var Ln=ajl(se()),$Bt=be(),i9e=oe(),eSt=NGe(),tSt=fGe(),nSt=RGe(),wGe=XGe(),lSt=_j(),HGe=Pj();at.CompletionDetailedJobOutStatus={Queued:"QUEUED",Started:"STARTED",Validating:"VALIDATING",Validated:"VALIDATED",Running:"RUNNING",FailedValidation:"FAILED_VALIDATION",Failed:"FAILED",Success:"SUCCESS",Cancelled:"CANCELLED",CancellationRequested:"CANCELLATION_REQUESTED"};at.CompletionDetailedJobOutObject={Job:"job"};at.CompletionDetailedJobOutJobType={Completion:"completion"};at.CompletionDetailedJobOutStatus$inboundSchema=Ln.nativeEnum(at.CompletionDetailedJobOutStatus);at.CompletionDetailedJobOutStatus$outboundSchema=at.CompletionDetailedJobOutStatus$inboundSchema;var TBt;(function(t){t.inboundSchema=at.CompletionDetailedJobOutStatus$inboundSchema,t.outboundSchema=at.CompletionDetailedJobOutStatus$outboundSchema})(TBt||(at.CompletionDetailedJobOutStatus$=TBt={}));at.CompletionDetailedJobOutObject$inboundSchema=Ln.nativeEnum(at.CompletionDetailedJobOutObject);at.CompletionDetailedJobOutObject$outboundSchema=at.CompletionDetailedJobOutObject$inboundSchema;var DBt;(function(t){t.inboundSchema=at.CompletionDetailedJobOutObject$inboundSchema,t.outboundSchema=at.CompletionDetailedJobOutObject$outboundSchema})(DBt||(at.CompletionDetailedJobOutObject$=DBt={}));at.CompletionDetailedJobOutIntegrations$inboundSchema=HGe.WandbIntegrationOut$inboundSchema;at.CompletionDetailedJobOutIntegrations$outboundSchema=HGe.WandbIntegrationOut$outboundSchema;var KBt;(function(t){t.inboundSchema=at.CompletionDetailedJobOutIntegrations$inboundSchema,t.outboundSchema=at.CompletionDetailedJobOutIntegrations$outboundSchema})(KBt||(at.CompletionDetailedJobOutIntegrations$=KBt={}));function rjl(t){return JSON.stringify(at.CompletionDetailedJobOutIntegrations$outboundSchema.parse(t))}function cjl(t){return(0,i9e.safeParse)(t,e=>at.CompletionDetailedJobOutIntegrations$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionDetailedJobOutIntegrations' from JSON")}at.CompletionDetailedJobOutJobType$inboundSchema=Ln.nativeEnum(at.CompletionDetailedJobOutJobType);at.CompletionDetailedJobOutJobType$outboundSchema=at.CompletionDetailedJobOutJobType$inboundSchema;var _Bt;(function(t){t.inboundSchema=at.CompletionDetailedJobOutJobType$inboundSchema,t.outboundSchema=at.CompletionDetailedJobOutJobType$outboundSchema})(_Bt||(at.CompletionDetailedJobOutJobType$=_Bt={}));at.CompletionDetailedJobOutRepositories$inboundSchema=wGe.GithubRepositoryOut$inboundSchema;at.CompletionDetailedJobOutRepositories$outboundSchema=wGe.GithubRepositoryOut$outboundSchema;var PBt;(function(t){t.inboundSchema=at.CompletionDetailedJobOutRepositories$inboundSchema,t.outboundSchema=at.CompletionDetailedJobOutRepositories$outboundSchema})(PBt||(at.CompletionDetailedJobOutRepositories$=PBt={}));function ojl(t){return JSON.stringify(at.CompletionDetailedJobOutRepositories$outboundSchema.parse(t))}function ijl(t){return(0,i9e.safeParse)(t,e=>at.CompletionDetailedJobOutRepositories$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionDetailedJobOutRepositories' from JSON")}at.CompletionDetailedJobOut$inboundSchema=Ln.object({id:Ln.string(),auto_start:Ln.boolean(),model:Ln.string(),status:at.CompletionDetailedJobOutStatus$inboundSchema,created_at:Ln.number().int(),modified_at:Ln.number().int(),training_files:Ln.array(Ln.string()),validation_files:Ln.nullable(Ln.array(Ln.string())).optional(),object:at.CompletionDetailedJobOutObject$inboundSchema.default("job"),fine_tuned_model:Ln.nullable(Ln.string()).optional(),suffix:Ln.nullable(Ln.string()).optional(),integrations:Ln.nullable(Ln.array(HGe.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:Ln.nullable(Ln.number().int()).optional(),metadata:Ln.nullable(lSt.JobMetadataOut$inboundSchema).optional(),job_type:at.CompletionDetailedJobOutJobType$inboundSchema.default("completion"),hyperparameters:tSt.CompletionTrainingParameters$inboundSchema,repositories:Ln.array(wGe.GithubRepositoryOut$inboundSchema).optional(),events:Ln.array(nSt.EventOut$inboundSchema).optional(),checkpoints:Ln.array(eSt.CheckpointOut$inboundSchema).optional()}).transform(t=>(0,$Bt.remap)(t,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType"}));at.CompletionDetailedJobOut$outboundSchema=Ln.object({id:Ln.string(),autoStart:Ln.boolean(),model:Ln.string(),status:at.CompletionDetailedJobOutStatus$outboundSchema,createdAt:Ln.number().int(),modifiedAt:Ln.number().int(),trainingFiles:Ln.array(Ln.string()),validationFiles:Ln.nullable(Ln.array(Ln.string())).optional(),object:at.CompletionDetailedJobOutObject$outboundSchema.default("job"),fineTunedModel:Ln.nullable(Ln.string()).optional(),suffix:Ln.nullable(Ln.string()).optional(),integrations:Ln.nullable(Ln.array(HGe.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:Ln.nullable(Ln.number().int()).optional(),metadata:Ln.nullable(lSt.JobMetadataOut$outboundSchema).optional(),jobType:at.CompletionDetailedJobOutJobType$outboundSchema.default("completion"),hyperparameters:tSt.CompletionTrainingParameters$outboundSchema,repositories:Ln.array(wGe.GithubRepositoryOut$outboundSchema).optional(),events:Ln.array(nSt.EventOut$outboundSchema).optional(),checkpoints:Ln.array(eSt.CheckpointOut$outboundSchema).optional()}).transform(t=>(0,$Bt.remap)(t,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type"}));var qBt;(function(t){t.inboundSchema=at.CompletionDetailedJobOut$inboundSchema,t.outboundSchema=at.CompletionDetailedJobOut$outboundSchema})(qBt||(at.CompletionDetailedJobOut$=qBt={}));function sjl(t){return JSON.stringify(at.CompletionDetailedJobOut$outboundSchema.parse(t))}function ujl(t){return(0,i9e.safeParse)(t,e=>at.CompletionDetailedJobOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionDetailedJobOut' from JSON")}});var cSt=f(ns=>{"use strict";var djl=ns&&ns.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Gjl=ns&&ns.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bjl=ns&&ns.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&djl(e,t,n);return Gjl(e,t),e};Object.defineProperty(ns,"__esModule",{value:!0});ns.CompletionEvent$=ns.CompletionEvent$outboundSchema=ns.CompletionEvent$inboundSchema=void 0;ns.completionEventToJSON=pjl;ns.completionEventFromJSON=hjl;var s_=bjl(se()),mjl=oe(),rSt=o9e();ns.CompletionEvent$inboundSchema=s_.object({data:s_.string().transform((t,e)=>{try{return JSON.parse(t)}catch(n){return e.addIssue({code:s_.ZodIssueCode.custom,message:`malformed json: ${n}`}),s_.NEVER}}).pipe(rSt.CompletionChunk$inboundSchema)});ns.CompletionEvent$outboundSchema=s_.object({data:rSt.CompletionChunk$outboundSchema});var aSt;(function(t){t.inboundSchema=ns.CompletionEvent$inboundSchema,t.outboundSchema=ns.CompletionEvent$outboundSchema})(aSt||(ns.CompletionEvent$=aSt={}));function pjl(t){return JSON.stringify(ns.CompletionEvent$outboundSchema.parse(t))}function hjl(t){return(0,mjl.safeParse)(t,e=>ns.CompletionEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionEvent' from JSON")}});var GSt=f(zn=>{"use strict";var Zjl=zn&&zn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Wjl=zn&&zn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Njl=zn&&zn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Zjl(e,t,n);return Wjl(e,t),e};Object.defineProperty(zn,"__esModule",{value:!0});zn.CompletionFTModelOut$=zn.CompletionFTModelOut$outboundSchema=zn.CompletionFTModelOut$inboundSchema=zn.ModelType$=zn.ModelType$outboundSchema=zn.ModelType$inboundSchema=zn.CompletionFTModelOutObject$=zn.CompletionFTModelOutObject$outboundSchema=zn.CompletionFTModelOutObject$inboundSchema=zn.ModelType=zn.CompletionFTModelOutObject=void 0;zn.completionFTModelOutToJSON=Yjl;zn.completionFTModelOutFromJSON=gjl;var yr=Njl(se()),uSt=be(),Vjl=oe(),dSt=AGe();zn.CompletionFTModelOutObject={Model:"model"};zn.ModelType={Completion:"completion"};zn.CompletionFTModelOutObject$inboundSchema=yr.nativeEnum(zn.CompletionFTModelOutObject);zn.CompletionFTModelOutObject$outboundSchema=zn.CompletionFTModelOutObject$inboundSchema;var oSt;(function(t){t.inboundSchema=zn.CompletionFTModelOutObject$inboundSchema,t.outboundSchema=zn.CompletionFTModelOutObject$outboundSchema})(oSt||(zn.CompletionFTModelOutObject$=oSt={}));zn.ModelType$inboundSchema=yr.nativeEnum(zn.ModelType);zn.ModelType$outboundSchema=zn.ModelType$inboundSchema;var iSt;(function(t){t.inboundSchema=zn.ModelType$inboundSchema,t.outboundSchema=zn.ModelType$outboundSchema})(iSt||(zn.ModelType$=iSt={}));zn.CompletionFTModelOut$inboundSchema=yr.object({id:yr.string(),object:zn.CompletionFTModelOutObject$inboundSchema.default("model"),created:yr.number().int(),owned_by:yr.string(),root:yr.string(),archived:yr.boolean(),name:yr.nullable(yr.string()).optional(),description:yr.nullable(yr.string()).optional(),capabilities:dSt.FTModelCapabilitiesOut$inboundSchema,max_context_length:yr.number().int().default(32768),aliases:yr.array(yr.string()).optional(),job:yr.string(),model_type:zn.ModelType$inboundSchema.default("completion")}).transform(t=>(0,uSt.remap)(t,{owned_by:"ownedBy",max_context_length:"maxContextLength",model_type:"modelType"}));zn.CompletionFTModelOut$outboundSchema=yr.object({id:yr.string(),object:zn.CompletionFTModelOutObject$outboundSchema.default("model"),created:yr.number().int(),ownedBy:yr.string(),root:yr.string(),archived:yr.boolean(),name:yr.nullable(yr.string()).optional(),description:yr.nullable(yr.string()).optional(),capabilities:dSt.FTModelCapabilitiesOut$outboundSchema,maxContextLength:yr.number().int().default(32768),aliases:yr.array(yr.string()).optional(),job:yr.string(),modelType:zn.ModelType$outboundSchema.default("completion")}).transform(t=>(0,uSt.remap)(t,{ownedBy:"owned_by",maxContextLength:"max_context_length",modelType:"model_type"}));var sSt;(function(t){t.inboundSchema=zn.CompletionFTModelOut$inboundSchema,t.outboundSchema=zn.CompletionFTModelOut$outboundSchema})(sSt||(zn.CompletionFTModelOut$=sSt={}));function Yjl(t){return JSON.stringify(zn.CompletionFTModelOut$outboundSchema.parse(t))}function gjl(t){return(0,Vjl.safeParse)(t,e=>zn.CompletionFTModelOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionFTModelOut' from JSON")}});var u9e=f(rt=>{"use strict";var Rjl=rt&&rt.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),yjl=rt&&rt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ajl=rt&&rt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Rjl(e,t,n);return yjl(e,t),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.CompletionJobOut$=rt.CompletionJobOut$outboundSchema=rt.CompletionJobOut$inboundSchema=rt.Repositories$=rt.Repositories$outboundSchema=rt.Repositories$inboundSchema=rt.JobType$=rt.JobType$outboundSchema=rt.JobType$inboundSchema=rt.Integrations$=rt.Integrations$outboundSchema=rt.Integrations$inboundSchema=rt.CompletionJobOutObject$=rt.CompletionJobOutObject$outboundSchema=rt.CompletionJobOutObject$inboundSchema=rt.Status$=rt.Status$outboundSchema=rt.Status$inboundSchema=rt.JobType=rt.CompletionJobOutObject=rt.Status=void 0;rt.integrationsToJSON=Fjl;rt.integrationsFromJSON=vjl;rt.repositoriesToJSON=fjl;rt.repositoriesFromJSON=Xjl;rt.completionJobOutToJSON=wjl;rt.completionJobOutFromJSON=Hjl;var Yl=Ajl(se()),NSt=be(),s9e=oe(),VSt=fGe(),QGe=XGe(),YSt=_j(),EGe=Pj();rt.Status={Queued:"QUEUED",Started:"STARTED",Validating:"VALIDATING",Validated:"VALIDATED",Running:"RUNNING",FailedValidation:"FAILED_VALIDATION",Failed:"FAILED",Success:"SUCCESS",Cancelled:"CANCELLED",CancellationRequested:"CANCELLATION_REQUESTED"};rt.CompletionJobOutObject={Job:"job"};rt.JobType={Completion:"completion"};rt.Status$inboundSchema=Yl.nativeEnum(rt.Status);rt.Status$outboundSchema=rt.Status$inboundSchema;var bSt;(function(t){t.inboundSchema=rt.Status$inboundSchema,t.outboundSchema=rt.Status$outboundSchema})(bSt||(rt.Status$=bSt={}));rt.CompletionJobOutObject$inboundSchema=Yl.nativeEnum(rt.CompletionJobOutObject);rt.CompletionJobOutObject$outboundSchema=rt.CompletionJobOutObject$inboundSchema;var mSt;(function(t){t.inboundSchema=rt.CompletionJobOutObject$inboundSchema,t.outboundSchema=rt.CompletionJobOutObject$outboundSchema})(mSt||(rt.CompletionJobOutObject$=mSt={}));rt.Integrations$inboundSchema=EGe.WandbIntegrationOut$inboundSchema;rt.Integrations$outboundSchema=EGe.WandbIntegrationOut$outboundSchema;var pSt;(function(t){t.inboundSchema=rt.Integrations$inboundSchema,t.outboundSchema=rt.Integrations$outboundSchema})(pSt||(rt.Integrations$=pSt={}));function Fjl(t){return JSON.stringify(rt.Integrations$outboundSchema.parse(t))}function vjl(t){return(0,s9e.safeParse)(t,e=>rt.Integrations$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Integrations' from JSON")}rt.JobType$inboundSchema=Yl.nativeEnum(rt.JobType);rt.JobType$outboundSchema=rt.JobType$inboundSchema;var hSt;(function(t){t.inboundSchema=rt.JobType$inboundSchema,t.outboundSchema=rt.JobType$outboundSchema})(hSt||(rt.JobType$=hSt={}));rt.Repositories$inboundSchema=QGe.GithubRepositoryOut$inboundSchema;rt.Repositories$outboundSchema=QGe.GithubRepositoryOut$outboundSchema;var ZSt;(function(t){t.inboundSchema=rt.Repositories$inboundSchema,t.outboundSchema=rt.Repositories$outboundSchema})(ZSt||(rt.Repositories$=ZSt={}));function fjl(t){return JSON.stringify(rt.Repositories$outboundSchema.parse(t))}function Xjl(t){return(0,s9e.safeParse)(t,e=>rt.Repositories$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Repositories' from JSON")}rt.CompletionJobOut$inboundSchema=Yl.object({id:Yl.string(),auto_start:Yl.boolean(),model:Yl.string(),status:rt.Status$inboundSchema,created_at:Yl.number().int(),modified_at:Yl.number().int(),training_files:Yl.array(Yl.string()),validation_files:Yl.nullable(Yl.array(Yl.string())).optional(),object:rt.CompletionJobOutObject$inboundSchema.default("job"),fine_tuned_model:Yl.nullable(Yl.string()).optional(),suffix:Yl.nullable(Yl.string()).optional(),integrations:Yl.nullable(Yl.array(EGe.WandbIntegrationOut$inboundSchema)).optional(),trained_tokens:Yl.nullable(Yl.number().int()).optional(),metadata:Yl.nullable(YSt.JobMetadataOut$inboundSchema).optional(),job_type:rt.JobType$inboundSchema.default("completion"),hyperparameters:VSt.CompletionTrainingParameters$inboundSchema,repositories:Yl.array(QGe.GithubRepositoryOut$inboundSchema).optional()}).transform(t=>(0,NSt.remap)(t,{auto_start:"autoStart",created_at:"createdAt",modified_at:"modifiedAt",training_files:"trainingFiles",validation_files:"validationFiles",fine_tuned_model:"fineTunedModel",trained_tokens:"trainedTokens",job_type:"jobType"}));rt.CompletionJobOut$outboundSchema=Yl.object({id:Yl.string(),autoStart:Yl.boolean(),model:Yl.string(),status:rt.Status$outboundSchema,createdAt:Yl.number().int(),modifiedAt:Yl.number().int(),trainingFiles:Yl.array(Yl.string()),validationFiles:Yl.nullable(Yl.array(Yl.string())).optional(),object:rt.CompletionJobOutObject$outboundSchema.default("job"),fineTunedModel:Yl.nullable(Yl.string()).optional(),suffix:Yl.nullable(Yl.string()).optional(),integrations:Yl.nullable(Yl.array(EGe.WandbIntegrationOut$outboundSchema)).optional(),trainedTokens:Yl.nullable(Yl.number().int()).optional(),metadata:Yl.nullable(YSt.JobMetadataOut$outboundSchema).optional(),jobType:rt.JobType$outboundSchema.default("completion"),hyperparameters:VSt.CompletionTrainingParameters$outboundSchema,repositories:Yl.array(QGe.GithubRepositoryOut$outboundSchema).optional()}).transform(t=>(0,NSt.remap)(t,{autoStart:"auto_start",createdAt:"created_at",modifiedAt:"modified_at",trainingFiles:"training_files",validationFiles:"validation_files",fineTunedModel:"fine_tuned_model",trainedTokens:"trained_tokens",jobType:"job_type"}));var WSt;(function(t){t.inboundSchema=rt.CompletionJobOut$inboundSchema,t.outboundSchema=rt.CompletionJobOut$outboundSchema})(WSt||(rt.CompletionJobOut$=WSt={}));function wjl(t){return JSON.stringify(rt.CompletionJobOut$outboundSchema.parse(t))}function Hjl(t){return(0,s9e.safeParse)(t,e=>rt.CompletionJobOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionJobOut' from JSON")}});var d9e=f(ls=>{"use strict";var Qjl=ls&&ls.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Ejl=ls&&ls.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Jjl=ls&&ls.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Qjl(e,t,n);return Ejl(e,t),e};Object.defineProperty(ls,"__esModule",{value:!0});ls.CompletionTrainingParametersIn$=ls.CompletionTrainingParametersIn$outboundSchema=ls.CompletionTrainingParametersIn$inboundSchema=void 0;ls.completionTrainingParametersInToJSON=Ljl;ls.completionTrainingParametersInFromJSON=kjl;var Sr=Jjl(se()),RSt=be(),Cjl=oe();ls.CompletionTrainingParametersIn$inboundSchema=Sr.object({training_steps:Sr.nullable(Sr.number().int()).optional(),learning_rate:Sr.number().default(1e-4),weight_decay:Sr.nullable(Sr.number()).optional(),warmup_fraction:Sr.nullable(Sr.number()).optional(),epochs:Sr.nullable(Sr.number()).optional(),seq_len:Sr.nullable(Sr.number().int()).optional(),fim_ratio:Sr.nullable(Sr.number()).optional()}).transform(t=>(0,RSt.remap)(t,{training_steps:"trainingSteps",learning_rate:"learningRate",weight_decay:"weightDecay",warmup_fraction:"warmupFraction",seq_len:"seqLen",fim_ratio:"fimRatio"}));ls.CompletionTrainingParametersIn$outboundSchema=Sr.object({trainingSteps:Sr.nullable(Sr.number().int()).optional(),learningRate:Sr.number().default(1e-4),weightDecay:Sr.nullable(Sr.number()).optional(),warmupFraction:Sr.nullable(Sr.number()).optional(),epochs:Sr.nullable(Sr.number()).optional(),seqLen:Sr.nullable(Sr.number().int()).optional(),fimRatio:Sr.nullable(Sr.number()).optional()}).transform(t=>(0,RSt.remap)(t,{trainingSteps:"training_steps",learningRate:"learning_rate",weightDecay:"weight_decay",warmupFraction:"warmup_fraction",seqLen:"seq_len",fimRatio:"fim_ratio"}));var gSt;(function(t){t.inboundSchema=ls.CompletionTrainingParametersIn$inboundSchema,t.outboundSchema=ls.CompletionTrainingParametersIn$outboundSchema})(gSt||(ls.CompletionTrainingParametersIn$=gSt={}));function Ljl(t){return JSON.stringify(ls.CompletionTrainingParametersIn$outboundSchema.parse(t))}function kjl(t){return(0,Cjl.safeParse)(t,e=>ls.CompletionTrainingParametersIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'CompletionTrainingParametersIn' from JSON")}});var G9e=f(Is=>{"use strict";var xjl=Is&&Is.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jjl=Is&&Is.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ojl=Is&&Is.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xjl(e,t,n);return jjl(e,t),e};Object.defineProperty(Is,"__esModule",{value:!0});Is.FunctionCallEntryArguments$=Is.FunctionCallEntryArguments$outboundSchema=Is.FunctionCallEntryArguments$inboundSchema=void 0;Is.functionCallEntryArgumentsToJSON=zjl;Is.functionCallEntryArgumentsFromJSON=Bjl;var lw=Ojl(se()),Ujl=oe();Is.FunctionCallEntryArguments$inboundSchema=lw.union([lw.record(lw.any()),lw.string()]);Is.FunctionCallEntryArguments$outboundSchema=lw.union([lw.record(lw.any()),lw.string()]);var ySt;(function(t){t.inboundSchema=Is.FunctionCallEntryArguments$inboundSchema,t.outboundSchema=Is.FunctionCallEntryArguments$outboundSchema})(ySt||(Is.FunctionCallEntryArguments$=ySt={}));function zjl(t){return JSON.stringify(Is.FunctionCallEntryArguments$outboundSchema.parse(t))}function Bjl(t){return(0,Ujl.safeParse)(t,e=>Is.FunctionCallEntryArguments$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionCallEntryArguments' from JSON")}});var u_=f(Bn=>{"use strict";var Sjl=Bn&&Bn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Mjl=Bn&&Bn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Tjl=Bn&&Bn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Sjl(e,t,n);return Mjl(e,t),e};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.FunctionCallEntry$=Bn.FunctionCallEntry$outboundSchema=Bn.FunctionCallEntry$inboundSchema=Bn.FunctionCallEntryType$=Bn.FunctionCallEntryType$outboundSchema=Bn.FunctionCallEntryType$inboundSchema=Bn.FunctionCallEntryObject$=Bn.FunctionCallEntryObject$outboundSchema=Bn.FunctionCallEntryObject$inboundSchema=Bn.FunctionCallEntryType=Bn.FunctionCallEntryObject=void 0;Bn.functionCallEntryToJSON=Kjl;Bn.functionCallEntryFromJSON=_jl;var Qb=Tjl(se()),fSt=be(),Djl=oe(),XSt=G9e();Bn.FunctionCallEntryObject={Entry:"entry"};Bn.FunctionCallEntryType={FunctionCall:"function.call"};Bn.FunctionCallEntryObject$inboundSchema=Qb.nativeEnum(Bn.FunctionCallEntryObject);Bn.FunctionCallEntryObject$outboundSchema=Bn.FunctionCallEntryObject$inboundSchema;var ASt;(function(t){t.inboundSchema=Bn.FunctionCallEntryObject$inboundSchema,t.outboundSchema=Bn.FunctionCallEntryObject$outboundSchema})(ASt||(Bn.FunctionCallEntryObject$=ASt={}));Bn.FunctionCallEntryType$inboundSchema=Qb.nativeEnum(Bn.FunctionCallEntryType);Bn.FunctionCallEntryType$outboundSchema=Bn.FunctionCallEntryType$inboundSchema;var FSt;(function(t){t.inboundSchema=Bn.FunctionCallEntryType$inboundSchema,t.outboundSchema=Bn.FunctionCallEntryType$outboundSchema})(FSt||(Bn.FunctionCallEntryType$=FSt={}));Bn.FunctionCallEntry$inboundSchema=Qb.object({object:Bn.FunctionCallEntryObject$inboundSchema.default("entry"),type:Bn.FunctionCallEntryType$inboundSchema.default("function.call"),created_at:Qb.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),completed_at:Qb.nullable(Qb.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),id:Qb.string().optional(),tool_call_id:Qb.string(),name:Qb.string(),arguments:XSt.FunctionCallEntryArguments$inboundSchema}).transform(t=>(0,fSt.remap)(t,{created_at:"createdAt",completed_at:"completedAt",tool_call_id:"toolCallId"}));Bn.FunctionCallEntry$outboundSchema=Qb.object({object:Bn.FunctionCallEntryObject$outboundSchema.default("entry"),type:Bn.FunctionCallEntryType$outboundSchema.default("function.call"),createdAt:Qb.date().transform(t=>t.toISOString()).optional(),completedAt:Qb.nullable(Qb.date().transform(t=>t.toISOString())).optional(),id:Qb.string().optional(),toolCallId:Qb.string(),name:Qb.string(),arguments:XSt.FunctionCallEntryArguments$outboundSchema}).transform(t=>(0,fSt.remap)(t,{createdAt:"created_at",completedAt:"completed_at",toolCallId:"tool_call_id"}));var vSt;(function(t){t.inboundSchema=Bn.FunctionCallEntry$inboundSchema,t.outboundSchema=Bn.FunctionCallEntry$outboundSchema})(vSt||(Bn.FunctionCallEntry$=vSt={}));function Kjl(t){return JSON.stringify(Bn.FunctionCallEntry$outboundSchema.parse(t))}function _jl(t){return(0,Djl.safeParse)(t,e=>Bn.FunctionCallEntry$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionCallEntry' from JSON")}});var JGe=f(Sn=>{"use strict";var Pjl=Sn&&Sn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),qjl=Sn&&Sn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$jl=Sn&&Sn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Pjl(e,t,n);return qjl(e,t),e};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.FunctionResultEntry$=Sn.FunctionResultEntry$outboundSchema=Sn.FunctionResultEntry$inboundSchema=Sn.FunctionResultEntryType$=Sn.FunctionResultEntryType$outboundSchema=Sn.FunctionResultEntryType$inboundSchema=Sn.FunctionResultEntryObject$=Sn.FunctionResultEntryObject$outboundSchema=Sn.FunctionResultEntryObject$inboundSchema=Sn.FunctionResultEntryType=Sn.FunctionResultEntryObject=void 0;Sn.functionResultEntryToJSON=tOl;Sn.functionResultEntryFromJSON=nOl;var Eb=$jl(se()),ESt=be(),eOl=oe();Sn.FunctionResultEntryObject={Entry:"entry"};Sn.FunctionResultEntryType={FunctionResult:"function.result"};Sn.FunctionResultEntryObject$inboundSchema=Eb.nativeEnum(Sn.FunctionResultEntryObject);Sn.FunctionResultEntryObject$outboundSchema=Sn.FunctionResultEntryObject$inboundSchema;var wSt;(function(t){t.inboundSchema=Sn.FunctionResultEntryObject$inboundSchema,t.outboundSchema=Sn.FunctionResultEntryObject$outboundSchema})(wSt||(Sn.FunctionResultEntryObject$=wSt={}));Sn.FunctionResultEntryType$inboundSchema=Eb.nativeEnum(Sn.FunctionResultEntryType);Sn.FunctionResultEntryType$outboundSchema=Sn.FunctionResultEntryType$inboundSchema;var HSt;(function(t){t.inboundSchema=Sn.FunctionResultEntryType$inboundSchema,t.outboundSchema=Sn.FunctionResultEntryType$outboundSchema})(HSt||(Sn.FunctionResultEntryType$=HSt={}));Sn.FunctionResultEntry$inboundSchema=Eb.object({object:Sn.FunctionResultEntryObject$inboundSchema.default("entry"),type:Sn.FunctionResultEntryType$inboundSchema.default("function.result"),created_at:Eb.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),completed_at:Eb.nullable(Eb.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),id:Eb.string().optional(),tool_call_id:Eb.string(),result:Eb.string()}).transform(t=>(0,ESt.remap)(t,{created_at:"createdAt",completed_at:"completedAt",tool_call_id:"toolCallId"}));Sn.FunctionResultEntry$outboundSchema=Eb.object({object:Sn.FunctionResultEntryObject$outboundSchema.default("entry"),type:Sn.FunctionResultEntryType$outboundSchema.default("function.result"),createdAt:Eb.date().transform(t=>t.toISOString()).optional(),completedAt:Eb.nullable(Eb.date().transform(t=>t.toISOString())).optional(),id:Eb.string().optional(),toolCallId:Eb.string(),result:Eb.string()}).transform(t=>(0,ESt.remap)(t,{createdAt:"created_at",completedAt:"completed_at",toolCallId:"tool_call_id"}));var QSt;(function(t){t.inboundSchema=Sn.FunctionResultEntry$inboundSchema,t.outboundSchema=Sn.FunctionResultEntry$outboundSchema})(QSt||(Sn.FunctionResultEntry$=QSt={}));function tOl(t){return JSON.stringify(Sn.FunctionResultEntry$outboundSchema.parse(t))}function nOl(t){return(0,eOl.safeParse)(t,e=>Sn.FunctionResultEntry$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionResultEntry' from JSON")}});var d_=f(ta=>{"use strict";var lOl=ta&&ta.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),IOl=ta&&ta.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aOl=ta&&ta.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&lOl(e,t,n);return IOl(e,t),e};Object.defineProperty(ta,"__esModule",{value:!0});ta.ToolFileChunk$=ta.ToolFileChunk$outboundSchema=ta.ToolFileChunk$inboundSchema=ta.ToolFileChunkType$=ta.ToolFileChunkType$outboundSchema=ta.ToolFileChunkType$inboundSchema=ta.ToolFileChunkType=void 0;ta.toolFileChunkToJSON=cOl;ta.toolFileChunkFromJSON=oOl;var aZ=aOl(se()),LSt=be(),rOl=oe(),kSt=tw();ta.ToolFileChunkType={ToolFile:"tool_file"};ta.ToolFileChunkType$inboundSchema=aZ.nativeEnum(ta.ToolFileChunkType);ta.ToolFileChunkType$outboundSchema=ta.ToolFileChunkType$inboundSchema;var JSt;(function(t){t.inboundSchema=ta.ToolFileChunkType$inboundSchema,t.outboundSchema=ta.ToolFileChunkType$outboundSchema})(JSt||(ta.ToolFileChunkType$=JSt={}));ta.ToolFileChunk$inboundSchema=aZ.object({type:ta.ToolFileChunkType$inboundSchema.default("tool_file"),tool:kSt.BuiltInConnectors$inboundSchema,file_id:aZ.string(),file_name:aZ.nullable(aZ.string()).optional(),file_type:aZ.nullable(aZ.string()).optional()}).transform(t=>(0,LSt.remap)(t,{file_id:"fileId",file_name:"fileName",file_type:"fileType"}));ta.ToolFileChunk$outboundSchema=aZ.object({type:ta.ToolFileChunkType$outboundSchema.default("tool_file"),tool:kSt.BuiltInConnectors$outboundSchema,fileId:aZ.string(),fileName:aZ.nullable(aZ.string()).optional(),fileType:aZ.nullable(aZ.string()).optional()}).transform(t=>(0,LSt.remap)(t,{fileId:"file_id",fileName:"file_name",fileType:"file_type"}));var CSt;(function(t){t.inboundSchema=ta.ToolFileChunk$inboundSchema,t.outboundSchema=ta.ToolFileChunk$outboundSchema})(CSt||(ta.ToolFileChunk$=CSt={}));function cOl(t){return JSON.stringify(ta.ToolFileChunk$outboundSchema.parse(t))}function oOl(t){return(0,rOl.safeParse)(t,e=>ta.ToolFileChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolFileChunk' from JSON")}});var b9e=f(as=>{"use strict";var iOl=as&&as.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),sOl=as&&as.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uOl=as&&as.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&iOl(e,t,n);return sOl(e,t),e};Object.defineProperty(as,"__esModule",{value:!0});as.MessageInputContentChunks$=as.MessageInputContentChunks$outboundSchema=as.MessageInputContentChunks$inboundSchema=void 0;as.messageInputContentChunksToJSON=GOl;as.messageInputContentChunksFromJSON=bOl;var jSt=uOl(se()),dOl=oe(),OSt=nJ(),USt=lJ(),zSt=aJ(),BSt=d_();as.MessageInputContentChunks$inboundSchema=jSt.union([zSt.TextChunk$inboundSchema,USt.ImageURLChunk$inboundSchema,OSt.DocumentURLChunk$inboundSchema,BSt.ToolFileChunk$inboundSchema]);as.MessageInputContentChunks$outboundSchema=jSt.union([zSt.TextChunk$outboundSchema,USt.ImageURLChunk$outboundSchema,OSt.DocumentURLChunk$outboundSchema,BSt.ToolFileChunk$outboundSchema]);var xSt;(function(t){t.inboundSchema=as.MessageInputContentChunks$inboundSchema,t.outboundSchema=as.MessageInputContentChunks$outboundSchema})(xSt||(as.MessageInputContentChunks$=xSt={}));function GOl(t){return JSON.stringify(as.MessageInputContentChunks$outboundSchema.parse(t))}function bOl(t){return(0,dOl.safeParse)(t,e=>as.MessageInputContentChunks$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageInputContentChunks' from JSON")}});var G_=f(Vt=>{"use strict";var mOl=Vt&&Vt.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),pOl=Vt&&Vt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),hOl=Vt&&Vt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&mOl(e,t,n);return pOl(e,t),e};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.MessageInputEntry$=Vt.MessageInputEntry$outboundSchema=Vt.MessageInputEntry$inboundSchema=Vt.MessageInputEntryContent$=Vt.MessageInputEntryContent$outboundSchema=Vt.MessageInputEntryContent$inboundSchema=Vt.MessageInputEntryRole$=Vt.MessageInputEntryRole$outboundSchema=Vt.MessageInputEntryRole$inboundSchema=Vt.MessageInputEntryType$=Vt.MessageInputEntryType$outboundSchema=Vt.MessageInputEntryType$inboundSchema=Vt.ObjectT$=Vt.ObjectT$outboundSchema=Vt.ObjectT$inboundSchema=Vt.MessageInputEntryRole=Vt.MessageInputEntryType=Vt.ObjectT=void 0;Vt.messageInputEntryContentToJSON=ZOl;Vt.messageInputEntryContentFromJSON=WOl;Vt.messageInputEntryToJSON=NOl;Vt.messageInputEntryFromJSON=VOl;var nc=hOl(se()),_St=be(),PSt=oe(),CGe=b9e();Vt.ObjectT={Entry:"entry"};Vt.MessageInputEntryType={MessageInput:"message.input"};Vt.MessageInputEntryRole={Assistant:"assistant",User:"user"};Vt.ObjectT$inboundSchema=nc.nativeEnum(Vt.ObjectT);Vt.ObjectT$outboundSchema=Vt.ObjectT$inboundSchema;var SSt;(function(t){t.inboundSchema=Vt.ObjectT$inboundSchema,t.outboundSchema=Vt.ObjectT$outboundSchema})(SSt||(Vt.ObjectT$=SSt={}));Vt.MessageInputEntryType$inboundSchema=nc.nativeEnum(Vt.MessageInputEntryType);Vt.MessageInputEntryType$outboundSchema=Vt.MessageInputEntryType$inboundSchema;var MSt;(function(t){t.inboundSchema=Vt.MessageInputEntryType$inboundSchema,t.outboundSchema=Vt.MessageInputEntryType$outboundSchema})(MSt||(Vt.MessageInputEntryType$=MSt={}));Vt.MessageInputEntryRole$inboundSchema=nc.nativeEnum(Vt.MessageInputEntryRole);Vt.MessageInputEntryRole$outboundSchema=Vt.MessageInputEntryRole$inboundSchema;var TSt;(function(t){t.inboundSchema=Vt.MessageInputEntryRole$inboundSchema,t.outboundSchema=Vt.MessageInputEntryRole$outboundSchema})(TSt||(Vt.MessageInputEntryRole$=TSt={}));Vt.MessageInputEntryContent$inboundSchema=nc.union([nc.string(),nc.array(CGe.MessageInputContentChunks$inboundSchema)]);Vt.MessageInputEntryContent$outboundSchema=nc.union([nc.string(),nc.array(CGe.MessageInputContentChunks$outboundSchema)]);var DSt;(function(t){t.inboundSchema=Vt.MessageInputEntryContent$inboundSchema,t.outboundSchema=Vt.MessageInputEntryContent$outboundSchema})(DSt||(Vt.MessageInputEntryContent$=DSt={}));function ZOl(t){return JSON.stringify(Vt.MessageInputEntryContent$outboundSchema.parse(t))}function WOl(t){return(0,PSt.safeParse)(t,e=>Vt.MessageInputEntryContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageInputEntryContent' from JSON")}Vt.MessageInputEntry$inboundSchema=nc.object({object:Vt.ObjectT$inboundSchema.default("entry"),type:Vt.MessageInputEntryType$inboundSchema.default("message.input"),created_at:nc.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),completed_at:nc.nullable(nc.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),id:nc.string().optional(),role:Vt.MessageInputEntryRole$inboundSchema,content:nc.union([nc.string(),nc.array(CGe.MessageInputContentChunks$inboundSchema)]),prefix:nc.boolean().default(!1)}).transform(t=>(0,_St.remap)(t,{created_at:"createdAt",completed_at:"completedAt"}));Vt.MessageInputEntry$outboundSchema=nc.object({object:Vt.ObjectT$outboundSchema.default("entry"),type:Vt.MessageInputEntryType$outboundSchema.default("message.input"),createdAt:nc.date().transform(t=>t.toISOString()).optional(),completedAt:nc.nullable(nc.date().transform(t=>t.toISOString())).optional(),id:nc.string().optional(),role:Vt.MessageInputEntryRole$outboundSchema,content:nc.union([nc.string(),nc.array(CGe.MessageInputContentChunks$outboundSchema)]),prefix:nc.boolean().default(!1)}).transform(t=>(0,_St.remap)(t,{createdAt:"created_at",completedAt:"completed_at"}));var KSt;(function(t){t.inboundSchema=Vt.MessageInputEntry$inboundSchema,t.outboundSchema=Vt.MessageInputEntry$outboundSchema})(KSt||(Vt.MessageInputEntry$=KSt={}));function NOl(t){return JSON.stringify(Vt.MessageInputEntry$outboundSchema.parse(t))}function VOl(t){return(0,PSt.safeParse)(t,e=>Vt.MessageInputEntry$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageInputEntry' from JSON")}});var LGe=f(na=>{"use strict";var YOl=na&&na.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),gOl=na&&na.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ROl=na&&na.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&YOl(e,t,n);return gOl(e,t),e};Object.defineProperty(na,"__esModule",{value:!0});na.ToolReferenceChunk$=na.ToolReferenceChunk$outboundSchema=na.ToolReferenceChunk$inboundSchema=na.ToolReferenceChunkType$=na.ToolReferenceChunkType$outboundSchema=na.ToolReferenceChunkType$inboundSchema=na.ToolReferenceChunkType=void 0;na.toolReferenceChunkToJSON=AOl;na.toolReferenceChunkFromJSON=FOl;var JG=ROl(se()),yOl=oe(),eMt=tw();na.ToolReferenceChunkType={ToolReference:"tool_reference"};na.ToolReferenceChunkType$inboundSchema=JG.nativeEnum(na.ToolReferenceChunkType);na.ToolReferenceChunkType$outboundSchema=na.ToolReferenceChunkType$inboundSchema;var qSt;(function(t){t.inboundSchema=na.ToolReferenceChunkType$inboundSchema,t.outboundSchema=na.ToolReferenceChunkType$outboundSchema})(qSt||(na.ToolReferenceChunkType$=qSt={}));na.ToolReferenceChunk$inboundSchema=JG.object({type:na.ToolReferenceChunkType$inboundSchema.default("tool_reference"),tool:eMt.BuiltInConnectors$inboundSchema,title:JG.string(),url:JG.nullable(JG.string()).optional(),favicon:JG.nullable(JG.string()).optional(),description:JG.nullable(JG.string()).optional()});na.ToolReferenceChunk$outboundSchema=JG.object({type:na.ToolReferenceChunkType$outboundSchema.default("tool_reference"),tool:eMt.BuiltInConnectors$outboundSchema,title:JG.string(),url:JG.nullable(JG.string()).optional(),favicon:JG.nullable(JG.string()).optional(),description:JG.nullable(JG.string()).optional()});var $St;(function(t){t.inboundSchema=na.ToolReferenceChunk$inboundSchema,t.outboundSchema=na.ToolReferenceChunk$outboundSchema})($St||(na.ToolReferenceChunk$=$St={}));function AOl(t){return JSON.stringify(na.ToolReferenceChunk$outboundSchema.parse(t))}function FOl(t){return(0,yOl.safeParse)(t,e=>na.ToolReferenceChunk$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolReferenceChunk' from JSON")}});var m9e=f(rs=>{"use strict";var vOl=rs&&rs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),fOl=rs&&rs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XOl=rs&&rs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&vOl(e,t,n);return fOl(e,t),e};Object.defineProperty(rs,"__esModule",{value:!0});rs.MessageOutputContentChunks$=rs.MessageOutputContentChunks$outboundSchema=rs.MessageOutputContentChunks$inboundSchema=void 0;rs.messageOutputContentChunksToJSON=HOl;rs.messageOutputContentChunksFromJSON=QOl;var nMt=XOl(se()),wOl=oe(),lMt=nJ(),IMt=lJ(),aMt=aJ(),rMt=d_(),cMt=LGe();rs.MessageOutputContentChunks$inboundSchema=nMt.union([aMt.TextChunk$inboundSchema,IMt.ImageURLChunk$inboundSchema,lMt.DocumentURLChunk$inboundSchema,rMt.ToolFileChunk$inboundSchema,cMt.ToolReferenceChunk$inboundSchema]);rs.MessageOutputContentChunks$outboundSchema=nMt.union([aMt.TextChunk$outboundSchema,IMt.ImageURLChunk$outboundSchema,lMt.DocumentURLChunk$outboundSchema,rMt.ToolFileChunk$outboundSchema,cMt.ToolReferenceChunk$outboundSchema]);var tMt;(function(t){t.inboundSchema=rs.MessageOutputContentChunks$inboundSchema,t.outboundSchema=rs.MessageOutputContentChunks$outboundSchema})(tMt||(rs.MessageOutputContentChunks$=tMt={}));function HOl(t){return JSON.stringify(rs.MessageOutputContentChunks$outboundSchema.parse(t))}function QOl(t){return(0,wOl.safeParse)(t,e=>rs.MessageOutputContentChunks$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageOutputContentChunks' from JSON")}});var qj=f(Yt=>{"use strict";var EOl=Yt&&Yt.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),JOl=Yt&&Yt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),COl=Yt&&Yt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&EOl(e,t,n);return JOl(e,t),e};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.MessageOutputEntry$=Yt.MessageOutputEntry$outboundSchema=Yt.MessageOutputEntry$inboundSchema=Yt.MessageOutputEntryContent$=Yt.MessageOutputEntryContent$outboundSchema=Yt.MessageOutputEntryContent$inboundSchema=Yt.MessageOutputEntryRole$=Yt.MessageOutputEntryRole$outboundSchema=Yt.MessageOutputEntryRole$inboundSchema=Yt.MessageOutputEntryType$=Yt.MessageOutputEntryType$outboundSchema=Yt.MessageOutputEntryType$inboundSchema=Yt.MessageOutputEntryObject$=Yt.MessageOutputEntryObject$outboundSchema=Yt.MessageOutputEntryObject$inboundSchema=Yt.MessageOutputEntryRole=Yt.MessageOutputEntryType=Yt.MessageOutputEntryObject=void 0;Yt.messageOutputEntryContentToJSON=LOl;Yt.messageOutputEntryContentFromJSON=kOl;Yt.messageOutputEntryToJSON=xOl;Yt.messageOutputEntryFromJSON=jOl;var va=COl(se()),GMt=be(),bMt=oe(),kGe=m9e();Yt.MessageOutputEntryObject={Entry:"entry"};Yt.MessageOutputEntryType={MessageOutput:"message.output"};Yt.MessageOutputEntryRole={Assistant:"assistant"};Yt.MessageOutputEntryObject$inboundSchema=va.nativeEnum(Yt.MessageOutputEntryObject);Yt.MessageOutputEntryObject$outboundSchema=Yt.MessageOutputEntryObject$inboundSchema;var oMt;(function(t){t.inboundSchema=Yt.MessageOutputEntryObject$inboundSchema,t.outboundSchema=Yt.MessageOutputEntryObject$outboundSchema})(oMt||(Yt.MessageOutputEntryObject$=oMt={}));Yt.MessageOutputEntryType$inboundSchema=va.nativeEnum(Yt.MessageOutputEntryType);Yt.MessageOutputEntryType$outboundSchema=Yt.MessageOutputEntryType$inboundSchema;var iMt;(function(t){t.inboundSchema=Yt.MessageOutputEntryType$inboundSchema,t.outboundSchema=Yt.MessageOutputEntryType$outboundSchema})(iMt||(Yt.MessageOutputEntryType$=iMt={}));Yt.MessageOutputEntryRole$inboundSchema=va.nativeEnum(Yt.MessageOutputEntryRole);Yt.MessageOutputEntryRole$outboundSchema=Yt.MessageOutputEntryRole$inboundSchema;var sMt;(function(t){t.inboundSchema=Yt.MessageOutputEntryRole$inboundSchema,t.outboundSchema=Yt.MessageOutputEntryRole$outboundSchema})(sMt||(Yt.MessageOutputEntryRole$=sMt={}));Yt.MessageOutputEntryContent$inboundSchema=va.union([va.string(),va.array(kGe.MessageOutputContentChunks$inboundSchema)]);Yt.MessageOutputEntryContent$outboundSchema=va.union([va.string(),va.array(kGe.MessageOutputContentChunks$outboundSchema)]);var uMt;(function(t){t.inboundSchema=Yt.MessageOutputEntryContent$inboundSchema,t.outboundSchema=Yt.MessageOutputEntryContent$outboundSchema})(uMt||(Yt.MessageOutputEntryContent$=uMt={}));function LOl(t){return JSON.stringify(Yt.MessageOutputEntryContent$outboundSchema.parse(t))}function kOl(t){return(0,bMt.safeParse)(t,e=>Yt.MessageOutputEntryContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageOutputEntryContent' from JSON")}Yt.MessageOutputEntry$inboundSchema=va.object({object:Yt.MessageOutputEntryObject$inboundSchema.default("entry"),type:Yt.MessageOutputEntryType$inboundSchema.default("message.output"),created_at:va.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),completed_at:va.nullable(va.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),id:va.string().optional(),agent_id:va.nullable(va.string()).optional(),model:va.nullable(va.string()).optional(),role:Yt.MessageOutputEntryRole$inboundSchema.default("assistant"),content:va.union([va.string(),va.array(kGe.MessageOutputContentChunks$inboundSchema)])}).transform(t=>(0,GMt.remap)(t,{created_at:"createdAt",completed_at:"completedAt",agent_id:"agentId"}));Yt.MessageOutputEntry$outboundSchema=va.object({object:Yt.MessageOutputEntryObject$outboundSchema.default("entry"),type:Yt.MessageOutputEntryType$outboundSchema.default("message.output"),createdAt:va.date().transform(t=>t.toISOString()).optional(),completedAt:va.nullable(va.date().transform(t=>t.toISOString())).optional(),id:va.string().optional(),agentId:va.nullable(va.string()).optional(),model:va.nullable(va.string()).optional(),role:Yt.MessageOutputEntryRole$outboundSchema.default("assistant"),content:va.union([va.string(),va.array(kGe.MessageOutputContentChunks$outboundSchema)])}).transform(t=>(0,GMt.remap)(t,{createdAt:"created_at",completedAt:"completed_at",agentId:"agent_id"}));var dMt;(function(t){t.inboundSchema=Yt.MessageOutputEntry$inboundSchema,t.outboundSchema=Yt.MessageOutputEntry$outboundSchema})(dMt||(Yt.MessageOutputEntry$=dMt={}));function xOl(t){return JSON.stringify(Yt.MessageOutputEntry$outboundSchema.parse(t))}function jOl(t){return(0,bMt.safeParse)(t,e=>Yt.MessageOutputEntry$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageOutputEntry' from JSON")}});var b_=f(Mn=>{"use strict";var OOl=Mn&&Mn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),UOl=Mn&&Mn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zOl=Mn&&Mn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&OOl(e,t,n);return UOl(e,t),e};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ToolExecutionEntry$=Mn.ToolExecutionEntry$outboundSchema=Mn.ToolExecutionEntry$inboundSchema=Mn.ToolExecutionEntryType$=Mn.ToolExecutionEntryType$outboundSchema=Mn.ToolExecutionEntryType$inboundSchema=Mn.ToolExecutionEntryObject$=Mn.ToolExecutionEntryObject$outboundSchema=Mn.ToolExecutionEntryObject$inboundSchema=Mn.ToolExecutionEntryType=Mn.ToolExecutionEntryObject=void 0;Mn.toolExecutionEntryToJSON=SOl;Mn.toolExecutionEntryFromJSON=MOl;var Jd=zOl(se()),ZMt=be(),BOl=oe(),WMt=tw();Mn.ToolExecutionEntryObject={Entry:"entry"};Mn.ToolExecutionEntryType={ToolExecution:"tool.execution"};Mn.ToolExecutionEntryObject$inboundSchema=Jd.nativeEnum(Mn.ToolExecutionEntryObject);Mn.ToolExecutionEntryObject$outboundSchema=Mn.ToolExecutionEntryObject$inboundSchema;var mMt;(function(t){t.inboundSchema=Mn.ToolExecutionEntryObject$inboundSchema,t.outboundSchema=Mn.ToolExecutionEntryObject$outboundSchema})(mMt||(Mn.ToolExecutionEntryObject$=mMt={}));Mn.ToolExecutionEntryType$inboundSchema=Jd.nativeEnum(Mn.ToolExecutionEntryType);Mn.ToolExecutionEntryType$outboundSchema=Mn.ToolExecutionEntryType$inboundSchema;var pMt;(function(t){t.inboundSchema=Mn.ToolExecutionEntryType$inboundSchema,t.outboundSchema=Mn.ToolExecutionEntryType$outboundSchema})(pMt||(Mn.ToolExecutionEntryType$=pMt={}));Mn.ToolExecutionEntry$inboundSchema=Jd.object({object:Mn.ToolExecutionEntryObject$inboundSchema.default("entry"),type:Mn.ToolExecutionEntryType$inboundSchema.default("tool.execution"),created_at:Jd.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),completed_at:Jd.nullable(Jd.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),id:Jd.string().optional(),name:WMt.BuiltInConnectors$inboundSchema,arguments:Jd.string(),info:Jd.record(Jd.any()).optional()}).transform(t=>(0,ZMt.remap)(t,{created_at:"createdAt",completed_at:"completedAt"}));Mn.ToolExecutionEntry$outboundSchema=Jd.object({object:Mn.ToolExecutionEntryObject$outboundSchema.default("entry"),type:Mn.ToolExecutionEntryType$outboundSchema.default("tool.execution"),createdAt:Jd.date().transform(t=>t.toISOString()).optional(),completedAt:Jd.nullable(Jd.date().transform(t=>t.toISOString())).optional(),id:Jd.string().optional(),name:WMt.BuiltInConnectors$outboundSchema,arguments:Jd.string(),info:Jd.record(Jd.any()).optional()}).transform(t=>(0,ZMt.remap)(t,{createdAt:"created_at",completedAt:"completed_at"}));var hMt;(function(t){t.inboundSchema=Mn.ToolExecutionEntry$inboundSchema,t.outboundSchema=Mn.ToolExecutionEntry$outboundSchema})(hMt||(Mn.ToolExecutionEntry$=hMt={}));function SOl(t){return JSON.stringify(Mn.ToolExecutionEntry$outboundSchema.parse(t))}function MOl(t){return(0,BOl.safeParse)(t,e=>Mn.ToolExecutionEntry$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolExecutionEntry' from JSON")}});var p9e=f(cs=>{"use strict";var TOl=cs&&cs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),DOl=cs&&cs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KOl=cs&&cs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&TOl(e,t,n);return DOl(e,t),e};Object.defineProperty(cs,"__esModule",{value:!0});cs.InputEntries$=cs.InputEntries$outboundSchema=cs.InputEntries$inboundSchema=void 0;cs.inputEntriesToJSON=POl;cs.inputEntriesFromJSON=qOl;var VMt=KOl(se()),_Ol=oe(),YMt=c_(),gMt=u_(),RMt=JGe(),yMt=G_(),AMt=qj(),FMt=b_();cs.InputEntries$inboundSchema=VMt.union([RMt.FunctionResultEntry$inboundSchema,yMt.MessageInputEntry$inboundSchema,gMt.FunctionCallEntry$inboundSchema,FMt.ToolExecutionEntry$inboundSchema,AMt.MessageOutputEntry$inboundSchema,YMt.AgentHandoffEntry$inboundSchema]);cs.InputEntries$outboundSchema=VMt.union([RMt.FunctionResultEntry$outboundSchema,yMt.MessageInputEntry$outboundSchema,gMt.FunctionCallEntry$outboundSchema,FMt.ToolExecutionEntry$outboundSchema,AMt.MessageOutputEntry$outboundSchema,YMt.AgentHandoffEntry$outboundSchema]);var NMt;(function(t){t.inboundSchema=cs.InputEntries$inboundSchema,t.outboundSchema=cs.InputEntries$outboundSchema})(NMt||(cs.InputEntries$=NMt={}));function POl(t){return JSON.stringify(cs.InputEntries$outboundSchema.parse(t))}function qOl(t){return(0,_Ol.safeParse)(t,e=>cs.InputEntries$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'InputEntries' from JSON")}});var Iw=f(os=>{"use strict";var $Ol=os&&os.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),eUl=os&&os.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tUl=os&&os.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&$Ol(e,t,n);return eUl(e,t),e};Object.defineProperty(os,"__esModule",{value:!0});os.ConversationInputs$=os.ConversationInputs$outboundSchema=os.ConversationInputs$inboundSchema=void 0;os.conversationInputsToJSON=lUl;os.conversationInputsFromJSON=IUl;var $j=tUl(se()),nUl=oe(),fMt=p9e();os.ConversationInputs$inboundSchema=$j.union([$j.string(),$j.array(fMt.InputEntries$inboundSchema)]);os.ConversationInputs$outboundSchema=$j.union([$j.string(),$j.array(fMt.InputEntries$outboundSchema)]);var vMt;(function(t){t.inboundSchema=os.ConversationInputs$inboundSchema,t.outboundSchema=os.ConversationInputs$outboundSchema})(vMt||(os.ConversationInputs$=vMt={}));function lUl(t){return JSON.stringify(os.ConversationInputs$outboundSchema.parse(t))}function IUl(t){return(0,nUl.safeParse)(t,e=>os.ConversationInputs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationInputs' from JSON")}});var JMt=f(la=>{"use strict";var aUl=la&&la.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),rUl=la&&la.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cUl=la&&la.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&aUl(e,t,n);return rUl(e,t),e};Object.defineProperty(la,"__esModule",{value:!0});la.ConversationAppendRequest$=la.ConversationAppendRequest$outboundSchema=la.ConversationAppendRequest$inboundSchema=la.ConversationAppendRequestHandoffExecution$=la.ConversationAppendRequestHandoffExecution$outboundSchema=la.ConversationAppendRequestHandoffExecution$inboundSchema=la.ConversationAppendRequestHandoffExecution=void 0;la.conversationAppendRequestToJSON=iUl;la.conversationAppendRequestFromJSON=sUl;var uJ=cUl(se()),HMt=be(),oUl=oe(),QMt=jW(),EMt=Iw();la.ConversationAppendRequestHandoffExecution={Client:"client",Server:"server"};la.ConversationAppendRequestHandoffExecution$inboundSchema=uJ.nativeEnum(la.ConversationAppendRequestHandoffExecution);la.ConversationAppendRequestHandoffExecution$outboundSchema=la.ConversationAppendRequestHandoffExecution$inboundSchema;var XMt;(function(t){t.inboundSchema=la.ConversationAppendRequestHandoffExecution$inboundSchema,t.outboundSchema=la.ConversationAppendRequestHandoffExecution$outboundSchema})(XMt||(la.ConversationAppendRequestHandoffExecution$=XMt={}));la.ConversationAppendRequest$inboundSchema=uJ.object({inputs:EMt.ConversationInputs$inboundSchema,stream:uJ.boolean().default(!1),store:uJ.boolean().default(!0),handoff_execution:la.ConversationAppendRequestHandoffExecution$inboundSchema.default("server"),completion_args:QMt.CompletionArgs$inboundSchema.optional()}).transform(t=>(0,HMt.remap)(t,{handoff_execution:"handoffExecution",completion_args:"completionArgs"}));la.ConversationAppendRequest$outboundSchema=uJ.object({inputs:EMt.ConversationInputs$outboundSchema,stream:uJ.boolean().default(!1),store:uJ.boolean().default(!0),handoffExecution:la.ConversationAppendRequestHandoffExecution$outboundSchema.default("server"),completionArgs:QMt.CompletionArgs$outboundSchema.optional()}).transform(t=>(0,HMt.remap)(t,{handoffExecution:"handoff_execution",completionArgs:"completion_args"}));var wMt;(function(t){t.inboundSchema=la.ConversationAppendRequest$inboundSchema,t.outboundSchema=la.ConversationAppendRequest$outboundSchema})(wMt||(la.ConversationAppendRequest$=wMt={}));function iUl(t){return JSON.stringify(la.ConversationAppendRequest$outboundSchema.parse(t))}function sUl(t){return(0,oUl.safeParse)(t,e=>la.ConversationAppendRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationAppendRequest' from JSON")}});var OMt=f(Ia=>{"use strict";var uUl=Ia&&Ia.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),dUl=Ia&&Ia.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),GUl=Ia&&Ia.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&uUl(e,t,n);return dUl(e,t),e};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.ConversationAppendStreamRequest$=Ia.ConversationAppendStreamRequest$outboundSchema=Ia.ConversationAppendStreamRequest$inboundSchema=Ia.ConversationAppendStreamRequestHandoffExecution$=Ia.ConversationAppendStreamRequestHandoffExecution$outboundSchema=Ia.ConversationAppendStreamRequestHandoffExecution$inboundSchema=Ia.ConversationAppendStreamRequestHandoffExecution=void 0;Ia.conversationAppendStreamRequestToJSON=mUl;Ia.conversationAppendStreamRequestFromJSON=pUl;var dJ=GUl(se()),kMt=be(),bUl=oe(),xMt=jW(),jMt=Iw();Ia.ConversationAppendStreamRequestHandoffExecution={Client:"client",Server:"server"};Ia.ConversationAppendStreamRequestHandoffExecution$inboundSchema=dJ.nativeEnum(Ia.ConversationAppendStreamRequestHandoffExecution);Ia.ConversationAppendStreamRequestHandoffExecution$outboundSchema=Ia.ConversationAppendStreamRequestHandoffExecution$inboundSchema;var CMt;(function(t){t.inboundSchema=Ia.ConversationAppendStreamRequestHandoffExecution$inboundSchema,t.outboundSchema=Ia.ConversationAppendStreamRequestHandoffExecution$outboundSchema})(CMt||(Ia.ConversationAppendStreamRequestHandoffExecution$=CMt={}));Ia.ConversationAppendStreamRequest$inboundSchema=dJ.object({inputs:jMt.ConversationInputs$inboundSchema,stream:dJ.boolean().default(!0),store:dJ.boolean().default(!0),handoff_execution:Ia.ConversationAppendStreamRequestHandoffExecution$inboundSchema.default("server"),completion_args:xMt.CompletionArgs$inboundSchema.optional()}).transform(t=>(0,kMt.remap)(t,{handoff_execution:"handoffExecution",completion_args:"completionArgs"}));Ia.ConversationAppendStreamRequest$outboundSchema=dJ.object({inputs:jMt.ConversationInputs$outboundSchema,stream:dJ.boolean().default(!0),store:dJ.boolean().default(!0),handoffExecution:Ia.ConversationAppendStreamRequestHandoffExecution$outboundSchema.default("server"),completionArgs:xMt.CompletionArgs$outboundSchema.optional()}).transform(t=>(0,kMt.remap)(t,{handoffExecution:"handoff_execution",completionArgs:"completion_args"}));var LMt;(function(t){t.inboundSchema=Ia.ConversationAppendStreamRequest$inboundSchema,t.outboundSchema=Ia.ConversationAppendStreamRequest$outboundSchema})(LMt||(Ia.ConversationAppendStreamRequest$=LMt={}));function mUl(t){return JSON.stringify(Ia.ConversationAppendStreamRequest$outboundSchema.parse(t))}function pUl(t){return(0,bUl.safeParse)(t,e=>Ia.ConversationAppendStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationAppendStreamRequest' from JSON")}});var h9e=f(aa=>{"use strict";var hUl=aa&&aa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ZUl=aa&&aa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WUl=aa&&aa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&hUl(e,t,n);return ZUl(e,t),e};Object.defineProperty(aa,"__esModule",{value:!0});aa.FunctionCallEvent$=aa.FunctionCallEvent$outboundSchema=aa.FunctionCallEvent$inboundSchema=aa.FunctionCallEventType$=aa.FunctionCallEventType$outboundSchema=aa.FunctionCallEventType$inboundSchema=aa.FunctionCallEventType=void 0;aa.functionCallEventToJSON=VUl;aa.functionCallEventFromJSON=YUl;var Fm=WUl(se()),BMt=be(),NUl=oe();aa.FunctionCallEventType={FunctionCallDelta:"function.call.delta"};aa.FunctionCallEventType$inboundSchema=Fm.nativeEnum(aa.FunctionCallEventType);aa.FunctionCallEventType$outboundSchema=aa.FunctionCallEventType$inboundSchema;var UMt;(function(t){t.inboundSchema=aa.FunctionCallEventType$inboundSchema,t.outboundSchema=aa.FunctionCallEventType$outboundSchema})(UMt||(aa.FunctionCallEventType$=UMt={}));aa.FunctionCallEvent$inboundSchema=Fm.object({type:aa.FunctionCallEventType$inboundSchema.default("function.call.delta"),created_at:Fm.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),output_index:Fm.number().int().default(0),id:Fm.string(),name:Fm.string(),tool_call_id:Fm.string(),arguments:Fm.string()}).transform(t=>(0,BMt.remap)(t,{created_at:"createdAt",output_index:"outputIndex",tool_call_id:"toolCallId"}));aa.FunctionCallEvent$outboundSchema=Fm.object({type:aa.FunctionCallEventType$outboundSchema.default("function.call.delta"),createdAt:Fm.date().transform(t=>t.toISOString()).optional(),outputIndex:Fm.number().int().default(0),id:Fm.string(),name:Fm.string(),toolCallId:Fm.string(),arguments:Fm.string()}).transform(t=>(0,BMt.remap)(t,{createdAt:"created_at",outputIndex:"output_index",toolCallId:"tool_call_id"}));var zMt;(function(t){t.inboundSchema=aa.FunctionCallEvent$inboundSchema,t.outboundSchema=aa.FunctionCallEvent$outboundSchema})(zMt||(aa.FunctionCallEvent$=zMt={}));function VUl(t){return JSON.stringify(aa.FunctionCallEvent$outboundSchema.parse(t))}function YUl(t){return(0,NUl.safeParse)(t,e=>aa.FunctionCallEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FunctionCallEvent' from JSON")}});var Z9e=f(is=>{"use strict";var gUl=is&&is.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),RUl=is&&is.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yUl=is&&is.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&gUl(e,t,n);return RUl(e,t),e};Object.defineProperty(is,"__esModule",{value:!0});is.OutputContentChunks$=is.OutputContentChunks$outboundSchema=is.OutputContentChunks$inboundSchema=void 0;is.outputContentChunksToJSON=FUl;is.outputContentChunksFromJSON=vUl;var MMt=yUl(se()),AUl=oe(),TMt=nJ(),DMt=lJ(),KMt=aJ(),_Mt=d_(),PMt=LGe();is.OutputContentChunks$inboundSchema=MMt.union([KMt.TextChunk$inboundSchema,DMt.ImageURLChunk$inboundSchema,TMt.DocumentURLChunk$inboundSchema,_Mt.ToolFileChunk$inboundSchema,PMt.ToolReferenceChunk$inboundSchema]);is.OutputContentChunks$outboundSchema=MMt.union([KMt.TextChunk$outboundSchema,DMt.ImageURLChunk$outboundSchema,TMt.DocumentURLChunk$outboundSchema,_Mt.ToolFileChunk$outboundSchema,PMt.ToolReferenceChunk$outboundSchema]);var SMt;(function(t){t.inboundSchema=is.OutputContentChunks$inboundSchema,t.outboundSchema=is.OutputContentChunks$outboundSchema})(SMt||(is.OutputContentChunks$=SMt={}));function FUl(t){return JSON.stringify(is.OutputContentChunks$outboundSchema.parse(t))}function vUl(t){return(0,AUl.safeParse)(t,e=>is.OutputContentChunks$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'OutputContentChunks' from JSON")}});var W9e=f(Pt=>{"use strict";var fUl=Pt&&Pt.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),XUl=Pt&&Pt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wUl=Pt&&Pt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&fUl(e,t,n);return XUl(e,t),e};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.MessageOutputEvent$=Pt.MessageOutputEvent$outboundSchema=Pt.MessageOutputEvent$inboundSchema=Pt.MessageOutputEventContent$=Pt.MessageOutputEventContent$outboundSchema=Pt.MessageOutputEventContent$inboundSchema=Pt.MessageOutputEventRole$=Pt.MessageOutputEventRole$outboundSchema=Pt.MessageOutputEventRole$inboundSchema=Pt.MessageOutputEventType$=Pt.MessageOutputEventType$outboundSchema=Pt.MessageOutputEventType$inboundSchema=Pt.MessageOutputEventRole=Pt.MessageOutputEventType=void 0;Pt.messageOutputEventContentToJSON=HUl;Pt.messageOutputEventContentFromJSON=QUl;Pt.messageOutputEventToJSON=EUl;Pt.messageOutputEventFromJSON=JUl;var Mr=wUl(se()),nTt=be(),lTt=oe(),xGe=Z9e();Pt.MessageOutputEventType={MessageOutputDelta:"message.output.delta"};Pt.MessageOutputEventRole={Assistant:"assistant"};Pt.MessageOutputEventType$inboundSchema=Mr.nativeEnum(Pt.MessageOutputEventType);Pt.MessageOutputEventType$outboundSchema=Pt.MessageOutputEventType$inboundSchema;var qMt;(function(t){t.inboundSchema=Pt.MessageOutputEventType$inboundSchema,t.outboundSchema=Pt.MessageOutputEventType$outboundSchema})(qMt||(Pt.MessageOutputEventType$=qMt={}));Pt.MessageOutputEventRole$inboundSchema=Mr.nativeEnum(Pt.MessageOutputEventRole);Pt.MessageOutputEventRole$outboundSchema=Pt.MessageOutputEventRole$inboundSchema;var $Mt;(function(t){t.inboundSchema=Pt.MessageOutputEventRole$inboundSchema,t.outboundSchema=Pt.MessageOutputEventRole$outboundSchema})($Mt||(Pt.MessageOutputEventRole$=$Mt={}));Pt.MessageOutputEventContent$inboundSchema=Mr.union([Mr.string(),xGe.OutputContentChunks$inboundSchema]);Pt.MessageOutputEventContent$outboundSchema=Mr.union([Mr.string(),xGe.OutputContentChunks$outboundSchema]);var eTt;(function(t){t.inboundSchema=Pt.MessageOutputEventContent$inboundSchema,t.outboundSchema=Pt.MessageOutputEventContent$outboundSchema})(eTt||(Pt.MessageOutputEventContent$=eTt={}));function HUl(t){return JSON.stringify(Pt.MessageOutputEventContent$outboundSchema.parse(t))}function QUl(t){return(0,lTt.safeParse)(t,e=>Pt.MessageOutputEventContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageOutputEventContent' from JSON")}Pt.MessageOutputEvent$inboundSchema=Mr.object({type:Pt.MessageOutputEventType$inboundSchema.default("message.output.delta"),created_at:Mr.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),output_index:Mr.number().int().default(0),id:Mr.string(),content_index:Mr.number().int().default(0),model:Mr.nullable(Mr.string()).optional(),agent_id:Mr.nullable(Mr.string()).optional(),role:Pt.MessageOutputEventRole$inboundSchema.default("assistant"),content:Mr.union([Mr.string(),xGe.OutputContentChunks$inboundSchema])}).transform(t=>(0,nTt.remap)(t,{created_at:"createdAt",output_index:"outputIndex",content_index:"contentIndex",agent_id:"agentId"}));Pt.MessageOutputEvent$outboundSchema=Mr.object({type:Pt.MessageOutputEventType$outboundSchema.default("message.output.delta"),createdAt:Mr.date().transform(t=>t.toISOString()).optional(),outputIndex:Mr.number().int().default(0),id:Mr.string(),contentIndex:Mr.number().int().default(0),model:Mr.nullable(Mr.string()).optional(),agentId:Mr.nullable(Mr.string()).optional(),role:Pt.MessageOutputEventRole$outboundSchema.default("assistant"),content:Mr.union([Mr.string(),xGe.OutputContentChunks$outboundSchema])}).transform(t=>(0,nTt.remap)(t,{createdAt:"created_at",outputIndex:"output_index",contentIndex:"content_index",agentId:"agent_id"}));var tTt;(function(t){t.inboundSchema=Pt.MessageOutputEvent$inboundSchema,t.outboundSchema=Pt.MessageOutputEvent$outboundSchema})(tTt||(Pt.MessageOutputEvent$=tTt={}));function EUl(t){return JSON.stringify(Pt.MessageOutputEvent$outboundSchema.parse(t))}function JUl(t){return(0,lTt.safeParse)(t,e=>Pt.MessageOutputEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageOutputEvent' from JSON")}});var jGe=f(ss=>{"use strict";var CUl=ss&&ss.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),LUl=ss&&ss.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kUl=ss&&ss.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&CUl(e,t,n);return LUl(e,t),e};Object.defineProperty(ss,"__esModule",{value:!0});ss.ConversationUsageInfo$=ss.ConversationUsageInfo$outboundSchema=ss.ConversationUsageInfo$inboundSchema=void 0;ss.conversationUsageInfoToJSON=jUl;ss.conversationUsageInfoFromJSON=OUl;var Cd=kUl(se()),aTt=be(),xUl=oe();ss.ConversationUsageInfo$inboundSchema=Cd.object({prompt_tokens:Cd.number().int().default(0),completion_tokens:Cd.number().int().default(0),total_tokens:Cd.number().int().default(0),connector_tokens:Cd.nullable(Cd.number().int()).optional(),connectors:Cd.nullable(Cd.record(Cd.number().int())).optional()}).transform(t=>(0,aTt.remap)(t,{prompt_tokens:"promptTokens",completion_tokens:"completionTokens",total_tokens:"totalTokens",connector_tokens:"connectorTokens"}));ss.ConversationUsageInfo$outboundSchema=Cd.object({promptTokens:Cd.number().int().default(0),completionTokens:Cd.number().int().default(0),totalTokens:Cd.number().int().default(0),connectorTokens:Cd.nullable(Cd.number().int()).optional(),connectors:Cd.nullable(Cd.record(Cd.number().int())).optional()}).transform(t=>(0,aTt.remap)(t,{promptTokens:"prompt_tokens",completionTokens:"completion_tokens",totalTokens:"total_tokens",connectorTokens:"connector_tokens"}));var ITt;(function(t){t.inboundSchema=ss.ConversationUsageInfo$inboundSchema,t.outboundSchema=ss.ConversationUsageInfo$outboundSchema})(ITt||(ss.ConversationUsageInfo$=ITt={}));function jUl(t){return JSON.stringify(ss.ConversationUsageInfo$outboundSchema.parse(t))}function OUl(t){return(0,xUl.safeParse)(t,e=>ss.ConversationUsageInfo$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationUsageInfo' from JSON")}});var N9e=f(ra=>{"use strict";var UUl=ra&&ra.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),zUl=ra&&ra.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BUl=ra&&ra.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&UUl(e,t,n);return zUl(e,t),e};Object.defineProperty(ra,"__esModule",{value:!0});ra.ResponseDoneEvent$=ra.ResponseDoneEvent$outboundSchema=ra.ResponseDoneEvent$inboundSchema=ra.ResponseDoneEventType$=ra.ResponseDoneEventType$outboundSchema=ra.ResponseDoneEventType$inboundSchema=ra.ResponseDoneEventType=void 0;ra.responseDoneEventToJSON=MUl;ra.responseDoneEventFromJSON=TUl;var m_=BUl(se()),oTt=be(),SUl=oe(),iTt=jGe();ra.ResponseDoneEventType={ConversationResponseDone:"conversation.response.done"};ra.ResponseDoneEventType$inboundSchema=m_.nativeEnum(ra.ResponseDoneEventType);ra.ResponseDoneEventType$outboundSchema=ra.ResponseDoneEventType$inboundSchema;var rTt;(function(t){t.inboundSchema=ra.ResponseDoneEventType$inboundSchema,t.outboundSchema=ra.ResponseDoneEventType$outboundSchema})(rTt||(ra.ResponseDoneEventType$=rTt={}));ra.ResponseDoneEvent$inboundSchema=m_.object({type:ra.ResponseDoneEventType$inboundSchema.default("conversation.response.done"),created_at:m_.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),usage:iTt.ConversationUsageInfo$inboundSchema}).transform(t=>(0,oTt.remap)(t,{created_at:"createdAt"}));ra.ResponseDoneEvent$outboundSchema=m_.object({type:ra.ResponseDoneEventType$outboundSchema.default("conversation.response.done"),createdAt:m_.date().transform(t=>t.toISOString()).optional(),usage:iTt.ConversationUsageInfo$outboundSchema}).transform(t=>(0,oTt.remap)(t,{createdAt:"created_at"}));var cTt;(function(t){t.inboundSchema=ra.ResponseDoneEvent$inboundSchema,t.outboundSchema=ra.ResponseDoneEvent$outboundSchema})(cTt||(ra.ResponseDoneEvent$=cTt={}));function MUl(t){return JSON.stringify(ra.ResponseDoneEvent$outboundSchema.parse(t))}function TUl(t){return(0,SUl.safeParse)(t,e=>ra.ResponseDoneEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ResponseDoneEvent' from JSON")}});var V9e=f(ca=>{"use strict";var DUl=ca&&ca.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KUl=ca&&ca.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_Ul=ca&&ca.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DUl(e,t,n);return KUl(e,t),e};Object.defineProperty(ca,"__esModule",{value:!0});ca.ResponseErrorEvent$=ca.ResponseErrorEvent$outboundSchema=ca.ResponseErrorEvent$inboundSchema=ca.ResponseErrorEventType$=ca.ResponseErrorEventType$outboundSchema=ca.ResponseErrorEventType$inboundSchema=ca.ResponseErrorEventType=void 0;ca.responseErrorEventToJSON=qUl;ca.responseErrorEventFromJSON=$Ul;var N0=_Ul(se()),dTt=be(),PUl=oe();ca.ResponseErrorEventType={ConversationResponseError:"conversation.response.error"};ca.ResponseErrorEventType$inboundSchema=N0.nativeEnum(ca.ResponseErrorEventType);ca.ResponseErrorEventType$outboundSchema=ca.ResponseErrorEventType$inboundSchema;var sTt;(function(t){t.inboundSchema=ca.ResponseErrorEventType$inboundSchema,t.outboundSchema=ca.ResponseErrorEventType$outboundSchema})(sTt||(ca.ResponseErrorEventType$=sTt={}));ca.ResponseErrorEvent$inboundSchema=N0.object({type:ca.ResponseErrorEventType$inboundSchema.default("conversation.response.error"),created_at:N0.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),message:N0.string(),code:N0.number().int()}).transform(t=>(0,dTt.remap)(t,{created_at:"createdAt"}));ca.ResponseErrorEvent$outboundSchema=N0.object({type:ca.ResponseErrorEventType$outboundSchema.default("conversation.response.error"),createdAt:N0.date().transform(t=>t.toISOString()).optional(),message:N0.string(),code:N0.number().int()}).transform(t=>(0,dTt.remap)(t,{createdAt:"created_at"}));var uTt;(function(t){t.inboundSchema=ca.ResponseErrorEvent$inboundSchema,t.outboundSchema=ca.ResponseErrorEvent$outboundSchema})(uTt||(ca.ResponseErrorEvent$=uTt={}));function qUl(t){return JSON.stringify(ca.ResponseErrorEvent$outboundSchema.parse(t))}function $Ul(t){return(0,PUl.safeParse)(t,e=>ca.ResponseErrorEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ResponseErrorEvent' from JSON")}});var Y9e=f(oa=>{"use strict";var e9l=oa&&oa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),t9l=oa&&oa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n9l=oa&&oa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&e9l(e,t,n);return t9l(e,t),e};Object.defineProperty(oa,"__esModule",{value:!0});oa.ResponseStartedEvent$=oa.ResponseStartedEvent$outboundSchema=oa.ResponseStartedEvent$inboundSchema=oa.ResponseStartedEventType$=oa.ResponseStartedEventType$outboundSchema=oa.ResponseStartedEventType$inboundSchema=oa.ResponseStartedEventType=void 0;oa.responseStartedEventToJSON=I9l;oa.responseStartedEventFromJSON=a9l;var GJ=n9l(se()),mTt=be(),l9l=oe();oa.ResponseStartedEventType={ConversationResponseStarted:"conversation.response.started"};oa.ResponseStartedEventType$inboundSchema=GJ.nativeEnum(oa.ResponseStartedEventType);oa.ResponseStartedEventType$outboundSchema=oa.ResponseStartedEventType$inboundSchema;var GTt;(function(t){t.inboundSchema=oa.ResponseStartedEventType$inboundSchema,t.outboundSchema=oa.ResponseStartedEventType$outboundSchema})(GTt||(oa.ResponseStartedEventType$=GTt={}));oa.ResponseStartedEvent$inboundSchema=GJ.object({type:oa.ResponseStartedEventType$inboundSchema.default("conversation.response.started"),created_at:GJ.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),conversation_id:GJ.string()}).transform(t=>(0,mTt.remap)(t,{created_at:"createdAt",conversation_id:"conversationId"}));oa.ResponseStartedEvent$outboundSchema=GJ.object({type:oa.ResponseStartedEventType$outboundSchema.default("conversation.response.started"),createdAt:GJ.date().transform(t=>t.toISOString()).optional(),conversationId:GJ.string()}).transform(t=>(0,mTt.remap)(t,{createdAt:"created_at",conversationId:"conversation_id"}));var bTt;(function(t){t.inboundSchema=oa.ResponseStartedEvent$inboundSchema,t.outboundSchema=oa.ResponseStartedEvent$outboundSchema})(bTt||(oa.ResponseStartedEvent$=bTt={}));function I9l(t){return JSON.stringify(oa.ResponseStartedEvent$outboundSchema.parse(t))}function a9l(t){return(0,l9l.safeParse)(t,e=>oa.ResponseStartedEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ResponseStartedEvent' from JSON")}});var g9e=f(us=>{"use strict";var r9l=us&&us.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),c9l=us&&us.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o9l=us&&us.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&r9l(e,t,n);return c9l(e,t),e};Object.defineProperty(us,"__esModule",{value:!0});us.SSETypes$=us.SSETypes$outboundSchema=us.SSETypes$inboundSchema=us.SSETypes=void 0;var i9l=o9l(se());us.SSETypes={ConversationResponseStarted:"conversation.response.started",ConversationResponseDone:"conversation.response.done",ConversationResponseError:"conversation.response.error",MessageOutputDelta:"message.output.delta",ToolExecutionStarted:"tool.execution.started",ToolExecutionDelta:"tool.execution.delta",ToolExecutionDone:"tool.execution.done",AgentHandoffStarted:"agent.handoff.started",AgentHandoffDone:"agent.handoff.done",FunctionCallDelta:"function.call.delta"};us.SSETypes$inboundSchema=i9l.nativeEnum(us.SSETypes);us.SSETypes$outboundSchema=us.SSETypes$inboundSchema;var pTt;(function(t){t.inboundSchema=us.SSETypes$inboundSchema,t.outboundSchema=us.SSETypes$outboundSchema})(pTt||(us.SSETypes$=pTt={}))});var R9e=f(ia=>{"use strict";var s9l=ia&&ia.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),u9l=ia&&ia.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),d9l=ia&&ia.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&s9l(e,t,n);return u9l(e,t),e};Object.defineProperty(ia,"__esModule",{value:!0});ia.ToolExecutionDeltaEvent$=ia.ToolExecutionDeltaEvent$outboundSchema=ia.ToolExecutionDeltaEvent$inboundSchema=ia.ToolExecutionDeltaEventType$=ia.ToolExecutionDeltaEventType$outboundSchema=ia.ToolExecutionDeltaEventType$inboundSchema=ia.ToolExecutionDeltaEventType=void 0;ia.toolExecutionDeltaEventToJSON=b9l;ia.toolExecutionDeltaEventFromJSON=m9l;var MV=d9l(se()),WTt=be(),G9l=oe(),NTt=tw();ia.ToolExecutionDeltaEventType={ToolExecutionDelta:"tool.execution.delta"};ia.ToolExecutionDeltaEventType$inboundSchema=MV.nativeEnum(ia.ToolExecutionDeltaEventType);ia.ToolExecutionDeltaEventType$outboundSchema=ia.ToolExecutionDeltaEventType$inboundSchema;var hTt;(function(t){t.inboundSchema=ia.ToolExecutionDeltaEventType$inboundSchema,t.outboundSchema=ia.ToolExecutionDeltaEventType$outboundSchema})(hTt||(ia.ToolExecutionDeltaEventType$=hTt={}));ia.ToolExecutionDeltaEvent$inboundSchema=MV.object({type:ia.ToolExecutionDeltaEventType$inboundSchema.default("tool.execution.delta"),created_at:MV.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),output_index:MV.number().int().default(0),id:MV.string(),name:NTt.BuiltInConnectors$inboundSchema,arguments:MV.string()}).transform(t=>(0,WTt.remap)(t,{created_at:"createdAt",output_index:"outputIndex"}));ia.ToolExecutionDeltaEvent$outboundSchema=MV.object({type:ia.ToolExecutionDeltaEventType$outboundSchema.default("tool.execution.delta"),createdAt:MV.date().transform(t=>t.toISOString()).optional(),outputIndex:MV.number().int().default(0),id:MV.string(),name:NTt.BuiltInConnectors$outboundSchema,arguments:MV.string()}).transform(t=>(0,WTt.remap)(t,{createdAt:"created_at",outputIndex:"output_index"}));var ZTt;(function(t){t.inboundSchema=ia.ToolExecutionDeltaEvent$inboundSchema,t.outboundSchema=ia.ToolExecutionDeltaEvent$outboundSchema})(ZTt||(ia.ToolExecutionDeltaEvent$=ZTt={}));function b9l(t){return JSON.stringify(ia.ToolExecutionDeltaEvent$outboundSchema.parse(t))}function m9l(t){return(0,G9l.safeParse)(t,e=>ia.ToolExecutionDeltaEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolExecutionDeltaEvent' from JSON")}});var y9e=f(sa=>{"use strict";var p9l=sa&&sa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),h9l=sa&&sa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Z9l=sa&&sa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&p9l(e,t,n);return h9l(e,t),e};Object.defineProperty(sa,"__esModule",{value:!0});sa.ToolExecutionDoneEvent$=sa.ToolExecutionDoneEvent$outboundSchema=sa.ToolExecutionDoneEvent$inboundSchema=sa.ToolExecutionDoneEventType$=sa.ToolExecutionDoneEventType$outboundSchema=sa.ToolExecutionDoneEventType$inboundSchema=sa.ToolExecutionDoneEventType=void 0;sa.toolExecutionDoneEventToJSON=N9l;sa.toolExecutionDoneEventFromJSON=V9l;var rZ=Z9l(se()),gTt=be(),W9l=oe(),RTt=tw();sa.ToolExecutionDoneEventType={ToolExecutionDone:"tool.execution.done"};sa.ToolExecutionDoneEventType$inboundSchema=rZ.nativeEnum(sa.ToolExecutionDoneEventType);sa.ToolExecutionDoneEventType$outboundSchema=sa.ToolExecutionDoneEventType$inboundSchema;var VTt;(function(t){t.inboundSchema=sa.ToolExecutionDoneEventType$inboundSchema,t.outboundSchema=sa.ToolExecutionDoneEventType$outboundSchema})(VTt||(sa.ToolExecutionDoneEventType$=VTt={}));sa.ToolExecutionDoneEvent$inboundSchema=rZ.object({type:sa.ToolExecutionDoneEventType$inboundSchema.default("tool.execution.done"),created_at:rZ.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),output_index:rZ.number().int().default(0),id:rZ.string(),name:RTt.BuiltInConnectors$inboundSchema,info:rZ.record(rZ.any()).optional()}).transform(t=>(0,gTt.remap)(t,{created_at:"createdAt",output_index:"outputIndex"}));sa.ToolExecutionDoneEvent$outboundSchema=rZ.object({type:sa.ToolExecutionDoneEventType$outboundSchema.default("tool.execution.done"),createdAt:rZ.date().transform(t=>t.toISOString()).optional(),outputIndex:rZ.number().int().default(0),id:rZ.string(),name:RTt.BuiltInConnectors$outboundSchema,info:rZ.record(rZ.any()).optional()}).transform(t=>(0,gTt.remap)(t,{createdAt:"created_at",outputIndex:"output_index"}));var YTt;(function(t){t.inboundSchema=sa.ToolExecutionDoneEvent$inboundSchema,t.outboundSchema=sa.ToolExecutionDoneEvent$outboundSchema})(YTt||(sa.ToolExecutionDoneEvent$=YTt={}));function N9l(t){return JSON.stringify(sa.ToolExecutionDoneEvent$outboundSchema.parse(t))}function V9l(t){return(0,W9l.safeParse)(t,e=>sa.ToolExecutionDoneEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolExecutionDoneEvent' from JSON")}});var A9e=f(ua=>{"use strict";var Y9l=ua&&ua.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),g9l=ua&&ua.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),R9l=ua&&ua.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Y9l(e,t,n);return g9l(e,t),e};Object.defineProperty(ua,"__esModule",{value:!0});ua.ToolExecutionStartedEvent$=ua.ToolExecutionStartedEvent$outboundSchema=ua.ToolExecutionStartedEvent$inboundSchema=ua.ToolExecutionStartedEventType$=ua.ToolExecutionStartedEventType$outboundSchema=ua.ToolExecutionStartedEventType$inboundSchema=ua.ToolExecutionStartedEventType=void 0;ua.toolExecutionStartedEventToJSON=A9l;ua.toolExecutionStartedEventFromJSON=F9l;var TV=R9l(se()),FTt=be(),y9l=oe(),vTt=tw();ua.ToolExecutionStartedEventType={ToolExecutionStarted:"tool.execution.started"};ua.ToolExecutionStartedEventType$inboundSchema=TV.nativeEnum(ua.ToolExecutionStartedEventType);ua.ToolExecutionStartedEventType$outboundSchema=ua.ToolExecutionStartedEventType$inboundSchema;var yTt;(function(t){t.inboundSchema=ua.ToolExecutionStartedEventType$inboundSchema,t.outboundSchema=ua.ToolExecutionStartedEventType$outboundSchema})(yTt||(ua.ToolExecutionStartedEventType$=yTt={}));ua.ToolExecutionStartedEvent$inboundSchema=TV.object({type:ua.ToolExecutionStartedEventType$inboundSchema.default("tool.execution.started"),created_at:TV.string().datetime({offset:!0}).transform(t=>new Date(t)).optional(),output_index:TV.number().int().default(0),id:TV.string(),name:vTt.BuiltInConnectors$inboundSchema,arguments:TV.string()}).transform(t=>(0,FTt.remap)(t,{created_at:"createdAt",output_index:"outputIndex"}));ua.ToolExecutionStartedEvent$outboundSchema=TV.object({type:ua.ToolExecutionStartedEventType$outboundSchema.default("tool.execution.started"),createdAt:TV.date().transform(t=>t.toISOString()).optional(),outputIndex:TV.number().int().default(0),id:TV.string(),name:vTt.BuiltInConnectors$outboundSchema,arguments:TV.string()}).transform(t=>(0,FTt.remap)(t,{createdAt:"created_at",outputIndex:"output_index"}));var ATt;(function(t){t.inboundSchema=ua.ToolExecutionStartedEvent$inboundSchema,t.outboundSchema=ua.ToolExecutionStartedEvent$outboundSchema})(ATt||(ua.ToolExecutionStartedEvent$=ATt={}));function A9l(t){return JSON.stringify(ua.ToolExecutionStartedEvent$outboundSchema.parse(t))}function F9l(t){return(0,y9l.safeParse)(t,e=>ua.ToolExecutionStartedEvent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ToolExecutionStartedEvent' from JSON")}});var QTt=f(_a=>{"use strict";var v9l=_a&&_a.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),f9l=_a&&_a.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),X9l=_a&&_a.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&v9l(e,t,n);return f9l(e,t),e};Object.defineProperty(_a,"__esModule",{value:!0});_a.ConversationEvents$=_a.ConversationEvents$outboundSchema=_a.ConversationEvents$inboundSchema=_a.ConversationEventsData$=_a.ConversationEventsData$outboundSchema=_a.ConversationEventsData$inboundSchema=void 0;_a.conversationEventsDataToJSON=w9l;_a.conversationEventsDataFromJSON=H9l;_a.conversationEventsToJSON=Q9l;_a.conversationEventsFromJSON=E9l;var Pe=X9l(se()),wTt=oe(),OGe=jUe(),UGe=OUe(),zGe=h9e(),BGe=W9e(),SGe=N9e(),MGe=V9e(),TGe=Y9e(),HTt=g9e(),DGe=R9e(),KGe=y9e(),_Ge=A9e();_a.ConversationEventsData$inboundSchema=Pe.union([SGe.ResponseDoneEvent$inboundSchema.and(Pe.object({type:Pe.literal("conversation.response.done")}).transform(t=>({type:t.type}))),TGe.ResponseStartedEvent$inboundSchema.and(Pe.object({type:Pe.literal("conversation.response.started")}).transform(t=>({type:t.type}))),MGe.ResponseErrorEvent$inboundSchema.and(Pe.object({type:Pe.literal("conversation.response.error")}).transform(t=>({type:t.type}))),OGe.AgentHandoffDoneEvent$inboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.done")}).transform(t=>({type:t.type}))),UGe.AgentHandoffStartedEvent$inboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.started")}).transform(t=>({type:t.type}))),DGe.ToolExecutionDeltaEvent$inboundSchema.and(Pe.object({type:Pe.literal("tool.execution.delta")}).transform(t=>({type:t.type}))),KGe.ToolExecutionDoneEvent$inboundSchema.and(Pe.object({type:Pe.literal("tool.execution.done")}).transform(t=>({type:t.type}))),_Ge.ToolExecutionStartedEvent$inboundSchema.and(Pe.object({type:Pe.literal("tool.execution.started")}).transform(t=>({type:t.type}))),zGe.FunctionCallEvent$inboundSchema.and(Pe.object({type:Pe.literal("function.call.delta")}).transform(t=>({type:t.type}))),BGe.MessageOutputEvent$inboundSchema.and(Pe.object({type:Pe.literal("message.output.delta")}).transform(t=>({type:t.type})))]);_a.ConversationEventsData$outboundSchema=Pe.union([SGe.ResponseDoneEvent$outboundSchema.and(Pe.object({type:Pe.literal("conversation.response.done")}).transform(t=>({type:t.type}))),TGe.ResponseStartedEvent$outboundSchema.and(Pe.object({type:Pe.literal("conversation.response.started")}).transform(t=>({type:t.type}))),MGe.ResponseErrorEvent$outboundSchema.and(Pe.object({type:Pe.literal("conversation.response.error")}).transform(t=>({type:t.type}))),OGe.AgentHandoffDoneEvent$outboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.done")}).transform(t=>({type:t.type}))),UGe.AgentHandoffStartedEvent$outboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.started")}).transform(t=>({type:t.type}))),DGe.ToolExecutionDeltaEvent$outboundSchema.and(Pe.object({type:Pe.literal("tool.execution.delta")}).transform(t=>({type:t.type}))),KGe.ToolExecutionDoneEvent$outboundSchema.and(Pe.object({type:Pe.literal("tool.execution.done")}).transform(t=>({type:t.type}))),_Ge.ToolExecutionStartedEvent$outboundSchema.and(Pe.object({type:Pe.literal("tool.execution.started")}).transform(t=>({type:t.type}))),zGe.FunctionCallEvent$outboundSchema.and(Pe.object({type:Pe.literal("function.call.delta")}).transform(t=>({type:t.type}))),BGe.MessageOutputEvent$outboundSchema.and(Pe.object({type:Pe.literal("message.output.delta")}).transform(t=>({type:t.type})))]);var fTt;(function(t){t.inboundSchema=_a.ConversationEventsData$inboundSchema,t.outboundSchema=_a.ConversationEventsData$outboundSchema})(fTt||(_a.ConversationEventsData$=fTt={}));function w9l(t){return JSON.stringify(_a.ConversationEventsData$outboundSchema.parse(t))}function H9l(t){return(0,wTt.safeParse)(t,e=>_a.ConversationEventsData$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationEventsData' from JSON")}_a.ConversationEvents$inboundSchema=Pe.object({event:HTt.SSETypes$inboundSchema,data:Pe.string().transform((t,e)=>{try{return JSON.parse(t)}catch(n){return e.addIssue({code:Pe.ZodIssueCode.custom,message:`malformed json: ${n}`}),Pe.NEVER}}).pipe(Pe.union([SGe.ResponseDoneEvent$inboundSchema.and(Pe.object({type:Pe.literal("conversation.response.done")}).transform(t=>({type:t.type}))),TGe.ResponseStartedEvent$inboundSchema.and(Pe.object({type:Pe.literal("conversation.response.started")}).transform(t=>({type:t.type}))),MGe.ResponseErrorEvent$inboundSchema.and(Pe.object({type:Pe.literal("conversation.response.error")}).transform(t=>({type:t.type}))),OGe.AgentHandoffDoneEvent$inboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.done")}).transform(t=>({type:t.type}))),UGe.AgentHandoffStartedEvent$inboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.started")}).transform(t=>({type:t.type}))),DGe.ToolExecutionDeltaEvent$inboundSchema.and(Pe.object({type:Pe.literal("tool.execution.delta")}).transform(t=>({type:t.type}))),KGe.ToolExecutionDoneEvent$inboundSchema.and(Pe.object({type:Pe.literal("tool.execution.done")}).transform(t=>({type:t.type}))),_Ge.ToolExecutionStartedEvent$inboundSchema.and(Pe.object({type:Pe.literal("tool.execution.started")}).transform(t=>({type:t.type}))),zGe.FunctionCallEvent$inboundSchema.and(Pe.object({type:Pe.literal("function.call.delta")}).transform(t=>({type:t.type}))),BGe.MessageOutputEvent$inboundSchema.and(Pe.object({type:Pe.literal("message.output.delta")}).transform(t=>({type:t.type})))]))});_a.ConversationEvents$outboundSchema=Pe.object({event:HTt.SSETypes$outboundSchema,data:Pe.union([SGe.ResponseDoneEvent$outboundSchema.and(Pe.object({type:Pe.literal("conversation.response.done")}).transform(t=>({type:t.type}))),TGe.ResponseStartedEvent$outboundSchema.and(Pe.object({type:Pe.literal("conversation.response.started")}).transform(t=>({type:t.type}))),MGe.ResponseErrorEvent$outboundSchema.and(Pe.object({type:Pe.literal("conversation.response.error")}).transform(t=>({type:t.type}))),OGe.AgentHandoffDoneEvent$outboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.done")}).transform(t=>({type:t.type}))),UGe.AgentHandoffStartedEvent$outboundSchema.and(Pe.object({type:Pe.literal("agent.handoff.started")}).transform(t=>({type:t.type}))),DGe.ToolExecutionDeltaEvent$outboundSchema.and(Pe.object({type:Pe.literal("tool.execution.delta")}).transform(t=>({type:t.type}))),KGe.ToolExecutionDoneEvent$outboundSchema.and(Pe.object({type:Pe.literal("tool.execution.done")}).transform(t=>({type:t.type}))),_Ge.ToolExecutionStartedEvent$outboundSchema.and(Pe.object({type:Pe.literal("tool.execution.started")}).transform(t=>({type:t.type}))),zGe.FunctionCallEvent$outboundSchema.and(Pe.object({type:Pe.literal("function.call.delta")}).transform(t=>({type:t.type}))),BGe.MessageOutputEvent$outboundSchema.and(Pe.object({type:Pe.literal("message.output.delta")}).transform(t=>({type:t.type})))])});var XTt;(function(t){t.inboundSchema=_a.ConversationEvents$inboundSchema,t.outboundSchema=_a.ConversationEvents$outboundSchema})(XTt||(_a.ConversationEvents$=XTt={}));function Q9l(t){return JSON.stringify(_a.ConversationEvents$outboundSchema.parse(t))}function E9l(t){return(0,wTt.safeParse)(t,e=>_a.ConversationEvents$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationEvents' from JSON")}});var xTt=f(sl=>{"use strict";var J9l=sl&&sl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),C9l=sl&&sl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L9l=sl&&sl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&J9l(e,t,n);return C9l(e,t),e};Object.defineProperty(sl,"__esModule",{value:!0});sl.ConversationHistory$=sl.ConversationHistory$outboundSchema=sl.ConversationHistory$inboundSchema=sl.Entries$=sl.Entries$outboundSchema=sl.Entries$inboundSchema=sl.ConversationHistoryObject$=sl.ConversationHistoryObject$outboundSchema=sl.ConversationHistoryObject$inboundSchema=sl.ConversationHistoryObject=void 0;sl.entriesToJSON=k9l;sl.entriesFromJSON=x9l;sl.conversationHistoryToJSON=j9l;sl.conversationHistoryFromJSON=O9l;var DV=L9l(se()),LTt=be(),kTt=oe(),PGe=c_(),qGe=u_(),$Ge=JGe(),ebe=G_(),tbe=qj(),nbe=b_();sl.ConversationHistoryObject={ConversationHistory:"conversation.history"};sl.ConversationHistoryObject$inboundSchema=DV.nativeEnum(sl.ConversationHistoryObject);sl.ConversationHistoryObject$outboundSchema=sl.ConversationHistoryObject$inboundSchema;var ETt;(function(t){t.inboundSchema=sl.ConversationHistoryObject$inboundSchema,t.outboundSchema=sl.ConversationHistoryObject$outboundSchema})(ETt||(sl.ConversationHistoryObject$=ETt={}));sl.Entries$inboundSchema=DV.union([$Ge.FunctionResultEntry$inboundSchema,ebe.MessageInputEntry$inboundSchema,qGe.FunctionCallEntry$inboundSchema,nbe.ToolExecutionEntry$inboundSchema,tbe.MessageOutputEntry$inboundSchema,PGe.AgentHandoffEntry$inboundSchema]);sl.Entries$outboundSchema=DV.union([$Ge.FunctionResultEntry$outboundSchema,ebe.MessageInputEntry$outboundSchema,qGe.FunctionCallEntry$outboundSchema,nbe.ToolExecutionEntry$outboundSchema,tbe.MessageOutputEntry$outboundSchema,PGe.AgentHandoffEntry$outboundSchema]);var JTt;(function(t){t.inboundSchema=sl.Entries$inboundSchema,t.outboundSchema=sl.Entries$outboundSchema})(JTt||(sl.Entries$=JTt={}));function k9l(t){return JSON.stringify(sl.Entries$outboundSchema.parse(t))}function x9l(t){return(0,kTt.safeParse)(t,e=>sl.Entries$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Entries' from JSON")}sl.ConversationHistory$inboundSchema=DV.object({object:sl.ConversationHistoryObject$inboundSchema.default("conversation.history"),conversation_id:DV.string(),entries:DV.array(DV.union([$Ge.FunctionResultEntry$inboundSchema,ebe.MessageInputEntry$inboundSchema,qGe.FunctionCallEntry$inboundSchema,nbe.ToolExecutionEntry$inboundSchema,tbe.MessageOutputEntry$inboundSchema,PGe.AgentHandoffEntry$inboundSchema]))}).transform(t=>(0,LTt.remap)(t,{conversation_id:"conversationId"}));sl.ConversationHistory$outboundSchema=DV.object({object:sl.ConversationHistoryObject$outboundSchema.default("conversation.history"),conversationId:DV.string(),entries:DV.array(DV.union([$Ge.FunctionResultEntry$outboundSchema,ebe.MessageInputEntry$outboundSchema,qGe.FunctionCallEntry$outboundSchema,nbe.ToolExecutionEntry$outboundSchema,tbe.MessageOutputEntry$outboundSchema,PGe.AgentHandoffEntry$outboundSchema]))}).transform(t=>(0,LTt.remap)(t,{conversationId:"conversation_id"}));var CTt;(function(t){t.inboundSchema=sl.ConversationHistory$inboundSchema,t.outboundSchema=sl.ConversationHistory$outboundSchema})(CTt||(sl.ConversationHistory$=CTt={}));function j9l(t){return JSON.stringify(sl.ConversationHistory$outboundSchema.parse(t))}function O9l(t){return(0,kTt.safeParse)(t,e=>sl.ConversationHistory$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationHistory' from JSON")}});var F9e=f(ds=>{"use strict";var U9l=ds&&ds.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),z9l=ds&&ds.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),B9l=ds&&ds.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&U9l(e,t,n);return z9l(e,t),e};Object.defineProperty(ds,"__esModule",{value:!0});ds.MessageEntries$=ds.MessageEntries$outboundSchema=ds.MessageEntries$inboundSchema=void 0;ds.messageEntriesToJSON=M9l;ds.messageEntriesFromJSON=T9l;var OTt=B9l(se()),S9l=oe(),UTt=G_(),zTt=qj();ds.MessageEntries$inboundSchema=OTt.union([UTt.MessageInputEntry$inboundSchema,zTt.MessageOutputEntry$inboundSchema]);ds.MessageEntries$outboundSchema=OTt.union([UTt.MessageInputEntry$outboundSchema,zTt.MessageOutputEntry$outboundSchema]);var jTt;(function(t){t.inboundSchema=ds.MessageEntries$inboundSchema,t.outboundSchema=ds.MessageEntries$outboundSchema})(jTt||(ds.MessageEntries$=jTt={}));function M9l(t){return JSON.stringify(ds.MessageEntries$outboundSchema.parse(t))}function T9l(t){return(0,S9l.safeParse)(t,e=>ds.MessageEntries$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'MessageEntries' from JSON")}});var DTt=f(da=>{"use strict";var D9l=da&&da.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),K9l=da&&da.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_9l=da&&da.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&D9l(e,t,n);return K9l(e,t),e};Object.defineProperty(da,"__esModule",{value:!0});da.ConversationMessages$=da.ConversationMessages$outboundSchema=da.ConversationMessages$inboundSchema=da.ConversationMessagesObject$=da.ConversationMessagesObject$outboundSchema=da.ConversationMessagesObject$inboundSchema=da.ConversationMessagesObject=void 0;da.conversationMessagesToJSON=q9l;da.conversationMessagesFromJSON=$9l;var bJ=_9l(se()),MTt=be(),P9l=oe(),TTt=F9e();da.ConversationMessagesObject={ConversationMessages:"conversation.messages"};da.ConversationMessagesObject$inboundSchema=bJ.nativeEnum(da.ConversationMessagesObject);da.ConversationMessagesObject$outboundSchema=da.ConversationMessagesObject$inboundSchema;var BTt;(function(t){t.inboundSchema=da.ConversationMessagesObject$inboundSchema,t.outboundSchema=da.ConversationMessagesObject$outboundSchema})(BTt||(da.ConversationMessagesObject$=BTt={}));da.ConversationMessages$inboundSchema=bJ.object({object:da.ConversationMessagesObject$inboundSchema.default("conversation.messages"),conversation_id:bJ.string(),messages:bJ.array(TTt.MessageEntries$inboundSchema)}).transform(t=>(0,MTt.remap)(t,{conversation_id:"conversationId"}));da.ConversationMessages$outboundSchema=bJ.object({object:da.ConversationMessagesObject$outboundSchema.default("conversation.messages"),conversationId:bJ.string(),messages:bJ.array(TTt.MessageEntries$outboundSchema)}).transform(t=>(0,MTt.remap)(t,{conversationId:"conversation_id"}));var STt;(function(t){t.inboundSchema=da.ConversationMessages$inboundSchema,t.outboundSchema=da.ConversationMessages$outboundSchema})(STt||(da.ConversationMessages$=STt={}));function q9l(t){return JSON.stringify(da.ConversationMessages$outboundSchema.parse(t))}function $9l(t){return(0,P9l.safeParse)(t,e=>da.ConversationMessages$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationMessages' from JSON")}});var nDt=f(ul=>{"use strict";var ezl=ul&&ul.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),tzl=ul&&ul.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nzl=ul&&ul.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ezl(e,t,n);return tzl(e,t),e};Object.defineProperty(ul,"__esModule",{value:!0});ul.ConversationRequest$=ul.ConversationRequest$outboundSchema=ul.ConversationRequest$inboundSchema=ul.Tools$=ul.Tools$outboundSchema=ul.Tools$inboundSchema=ul.HandoffExecution$=ul.HandoffExecution$outboundSchema=ul.HandoffExecution$inboundSchema=ul.HandoffExecution=void 0;ul.toolsToJSON=lzl;ul.toolsFromJSON=Izl;ul.conversationRequestToJSON=azl;ul.conversationRequestFromJSON=rzl;var qe=nzl(se()),qTt=be(),$Tt=oe(),lbe=MX(),eDt=jW(),tDt=Iw(),Ibe=KX(),abe=_X(),rbe=PX(),cbe=qX(),obe=$X();ul.HandoffExecution={Client:"client",Server:"server"};ul.HandoffExecution$inboundSchema=qe.nativeEnum(ul.HandoffExecution);ul.HandoffExecution$outboundSchema=ul.HandoffExecution$inboundSchema;var KTt;(function(t){t.inboundSchema=ul.HandoffExecution$inboundSchema,t.outboundSchema=ul.HandoffExecution$outboundSchema})(KTt||(ul.HandoffExecution$=KTt={}));ul.Tools$inboundSchema=qe.union([lbe.CodeInterpreterTool$inboundSchema.and(qe.object({type:qe.literal("code_interpreter")}).transform(t=>({type:t.type}))),rbe.ImageGenerationTool$inboundSchema.and(qe.object({type:qe.literal("image_generation")}).transform(t=>({type:t.type}))),obe.WebSearchTool$inboundSchema.and(qe.object({type:qe.literal("web_search")}).transform(t=>({type:t.type}))),cbe.WebSearchPremiumTool$inboundSchema.and(qe.object({type:qe.literal("web_search_premium")}).transform(t=>({type:t.type}))),Ibe.DocumentLibraryTool$inboundSchema.and(qe.object({type:qe.literal("document_library")}).transform(t=>({type:t.type}))),abe.FunctionTool$inboundSchema.and(qe.object({type:qe.literal("function")}).transform(t=>({type:t.type})))]);ul.Tools$outboundSchema=qe.union([lbe.CodeInterpreterTool$outboundSchema.and(qe.object({type:qe.literal("code_interpreter")}).transform(t=>({type:t.type}))),rbe.ImageGenerationTool$outboundSchema.and(qe.object({type:qe.literal("image_generation")}).transform(t=>({type:t.type}))),obe.WebSearchTool$outboundSchema.and(qe.object({type:qe.literal("web_search")}).transform(t=>({type:t.type}))),cbe.WebSearchPremiumTool$outboundSchema.and(qe.object({type:qe.literal("web_search_premium")}).transform(t=>({type:t.type}))),Ibe.DocumentLibraryTool$outboundSchema.and(qe.object({type:qe.literal("document_library")}).transform(t=>({type:t.type}))),abe.FunctionTool$outboundSchema.and(qe.object({type:qe.literal("function")}).transform(t=>({type:t.type})))]);var _Tt;(function(t){t.inboundSchema=ul.Tools$inboundSchema,t.outboundSchema=ul.Tools$outboundSchema})(_Tt||(ul.Tools$=_Tt={}));function lzl(t){return JSON.stringify(ul.Tools$outboundSchema.parse(t))}function Izl(t){return(0,$Tt.safeParse)(t,e=>ul.Tools$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Tools' from JSON")}ul.ConversationRequest$inboundSchema=qe.object({inputs:tDt.ConversationInputs$inboundSchema,stream:qe.boolean().default(!1),store:qe.nullable(qe.boolean()).optional(),handoff_execution:qe.nullable(ul.HandoffExecution$inboundSchema).optional(),instructions:qe.nullable(qe.string()).optional(),tools:qe.nullable(qe.array(qe.union([lbe.CodeInterpreterTool$inboundSchema.and(qe.object({type:qe.literal("code_interpreter")}).transform(t=>({type:t.type}))),rbe.ImageGenerationTool$inboundSchema.and(qe.object({type:qe.literal("image_generation")}).transform(t=>({type:t.type}))),obe.WebSearchTool$inboundSchema.and(qe.object({type:qe.literal("web_search")}).transform(t=>({type:t.type}))),cbe.WebSearchPremiumTool$inboundSchema.and(qe.object({type:qe.literal("web_search_premium")}).transform(t=>({type:t.type}))),Ibe.DocumentLibraryTool$inboundSchema.and(qe.object({type:qe.literal("document_library")}).transform(t=>({type:t.type}))),abe.FunctionTool$inboundSchema.and(qe.object({type:qe.literal("function")}).transform(t=>({type:t.type})))]))).optional(),completion_args:qe.nullable(eDt.CompletionArgs$inboundSchema).optional(),name:qe.nullable(qe.string()).optional(),description:qe.nullable(qe.string()).optional(),agent_id:qe.nullable(qe.string()).optional(),model:qe.nullable(qe.string()).optional()}).transform(t=>(0,qTt.remap)(t,{handoff_execution:"handoffExecution",completion_args:"completionArgs",agent_id:"agentId"}));ul.ConversationRequest$outboundSchema=qe.object({inputs:tDt.ConversationInputs$outboundSchema,stream:qe.boolean().default(!1),store:qe.nullable(qe.boolean()).optional(),handoffExecution:qe.nullable(ul.HandoffExecution$outboundSchema).optional(),instructions:qe.nullable(qe.string()).optional(),tools:qe.nullable(qe.array(qe.union([lbe.CodeInterpreterTool$outboundSchema.and(qe.object({type:qe.literal("code_interpreter")}).transform(t=>({type:t.type}))),rbe.ImageGenerationTool$outboundSchema.and(qe.object({type:qe.literal("image_generation")}).transform(t=>({type:t.type}))),obe.WebSearchTool$outboundSchema.and(qe.object({type:qe.literal("web_search")}).transform(t=>({type:t.type}))),cbe.WebSearchPremiumTool$outboundSchema.and(qe.object({type:qe.literal("web_search_premium")}).transform(t=>({type:t.type}))),Ibe.DocumentLibraryTool$outboundSchema.and(qe.object({type:qe.literal("document_library")}).transform(t=>({type:t.type}))),abe.FunctionTool$outboundSchema.and(qe.object({type:qe.literal("function")}).transform(t=>({type:t.type})))]))).optional(),completionArgs:qe.nullable(eDt.CompletionArgs$outboundSchema).optional(),name:qe.nullable(qe.string()).optional(),description:qe.nullable(qe.string()).optional(),agentId:qe.nullable(qe.string()).optional(),model:qe.nullable(qe.string()).optional()}).transform(t=>(0,qTt.remap)(t,{handoffExecution:"handoff_execution",completionArgs:"completion_args",agentId:"agent_id"}));var PTt;(function(t){t.inboundSchema=ul.ConversationRequest$inboundSchema,t.outboundSchema=ul.ConversationRequest$outboundSchema})(PTt||(ul.ConversationRequest$=PTt={}));function azl(t){return JSON.stringify(ul.ConversationRequest$outboundSchema.parse(t))}function rzl(t){return(0,$Tt.safeParse)(t,e=>ul.ConversationRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationRequest' from JSON")}});var iDt=f(dl=>{"use strict";var czl=dl&&dl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ozl=dl&&dl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),izl=dl&&dl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&czl(e,t,n);return ozl(e,t),e};Object.defineProperty(dl,"__esModule",{value:!0});dl.ConversationResponse$=dl.ConversationResponse$outboundSchema=dl.ConversationResponse$inboundSchema=dl.Outputs$=dl.Outputs$outboundSchema=dl.Outputs$inboundSchema=dl.ConversationResponseObject$=dl.ConversationResponseObject$outboundSchema=dl.ConversationResponseObject$inboundSchema=dl.ConversationResponseObject=void 0;dl.outputsToJSON=szl;dl.outputsFromJSON=uzl;dl.conversationResponseToJSON=dzl;dl.conversationResponseFromJSON=Gzl;var KV=izl(se()),rDt=be(),cDt=oe(),ibe=c_(),oDt=jGe(),sbe=u_(),ube=qj(),dbe=b_();dl.ConversationResponseObject={ConversationResponse:"conversation.response"};dl.ConversationResponseObject$inboundSchema=KV.nativeEnum(dl.ConversationResponseObject);dl.ConversationResponseObject$outboundSchema=dl.ConversationResponseObject$inboundSchema;var lDt;(function(t){t.inboundSchema=dl.ConversationResponseObject$inboundSchema,t.outboundSchema=dl.ConversationResponseObject$outboundSchema})(lDt||(dl.ConversationResponseObject$=lDt={}));dl.Outputs$inboundSchema=KV.union([dbe.ToolExecutionEntry$inboundSchema,sbe.FunctionCallEntry$inboundSchema,ube.MessageOutputEntry$inboundSchema,ibe.AgentHandoffEntry$inboundSchema]);dl.Outputs$outboundSchema=KV.union([dbe.ToolExecutionEntry$outboundSchema,sbe.FunctionCallEntry$outboundSchema,ube.MessageOutputEntry$outboundSchema,ibe.AgentHandoffEntry$outboundSchema]);var IDt;(function(t){t.inboundSchema=dl.Outputs$inboundSchema,t.outboundSchema=dl.Outputs$outboundSchema})(IDt||(dl.Outputs$=IDt={}));function szl(t){return JSON.stringify(dl.Outputs$outboundSchema.parse(t))}function uzl(t){return(0,cDt.safeParse)(t,e=>dl.Outputs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Outputs' from JSON")}dl.ConversationResponse$inboundSchema=KV.object({object:dl.ConversationResponseObject$inboundSchema.default("conversation.response"),conversation_id:KV.string(),outputs:KV.array(KV.union([dbe.ToolExecutionEntry$inboundSchema,sbe.FunctionCallEntry$inboundSchema,ube.MessageOutputEntry$inboundSchema,ibe.AgentHandoffEntry$inboundSchema])),usage:oDt.ConversationUsageInfo$inboundSchema}).transform(t=>(0,rDt.remap)(t,{conversation_id:"conversationId"}));dl.ConversationResponse$outboundSchema=KV.object({object:dl.ConversationResponseObject$outboundSchema.default("conversation.response"),conversationId:KV.string(),outputs:KV.array(KV.union([dbe.ToolExecutionEntry$outboundSchema,sbe.FunctionCallEntry$outboundSchema,ube.MessageOutputEntry$outboundSchema,ibe.AgentHandoffEntry$outboundSchema])),usage:oDt.ConversationUsageInfo$outboundSchema}).transform(t=>(0,rDt.remap)(t,{conversationId:"conversation_id"}));var aDt;(function(t){t.inboundSchema=dl.ConversationResponse$inboundSchema,t.outboundSchema=dl.ConversationResponse$outboundSchema})(aDt||(dl.ConversationResponse$=aDt={}));function dzl(t){return JSON.stringify(dl.ConversationResponse$outboundSchema.parse(t))}function Gzl(t){return(0,cDt.safeParse)(t,e=>dl.ConversationResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationResponse' from JSON")}});var mDt=f(Ga=>{"use strict";var bzl=Ga&&Ga.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),mzl=Ga&&Ga.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pzl=Ga&&Ga.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&bzl(e,t,n);return mzl(e,t),e};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.ConversationRestartRequest$=Ga.ConversationRestartRequest$outboundSchema=Ga.ConversationRestartRequest$inboundSchema=Ga.ConversationRestartRequestHandoffExecution$=Ga.ConversationRestartRequestHandoffExecution$outboundSchema=Ga.ConversationRestartRequestHandoffExecution$inboundSchema=Ga.ConversationRestartRequestHandoffExecution=void 0;Ga.conversationRestartRequestToJSON=Zzl;Ga.conversationRestartRequestFromJSON=Wzl;var V0=pzl(se()),dDt=be(),hzl=oe(),GDt=jW(),bDt=Iw();Ga.ConversationRestartRequestHandoffExecution={Client:"client",Server:"server"};Ga.ConversationRestartRequestHandoffExecution$inboundSchema=V0.nativeEnum(Ga.ConversationRestartRequestHandoffExecution);Ga.ConversationRestartRequestHandoffExecution$outboundSchema=Ga.ConversationRestartRequestHandoffExecution$inboundSchema;var sDt;(function(t){t.inboundSchema=Ga.ConversationRestartRequestHandoffExecution$inboundSchema,t.outboundSchema=Ga.ConversationRestartRequestHandoffExecution$outboundSchema})(sDt||(Ga.ConversationRestartRequestHandoffExecution$=sDt={}));Ga.ConversationRestartRequest$inboundSchema=V0.object({inputs:bDt.ConversationInputs$inboundSchema,stream:V0.boolean().default(!1),store:V0.boolean().default(!0),handoff_execution:Ga.ConversationRestartRequestHandoffExecution$inboundSchema.default("server"),completion_args:GDt.CompletionArgs$inboundSchema.optional(),from_entry_id:V0.string()}).transform(t=>(0,dDt.remap)(t,{handoff_execution:"handoffExecution",completion_args:"completionArgs",from_entry_id:"fromEntryId"}));Ga.ConversationRestartRequest$outboundSchema=V0.object({inputs:bDt.ConversationInputs$outboundSchema,stream:V0.boolean().default(!1),store:V0.boolean().default(!0),handoffExecution:Ga.ConversationRestartRequestHandoffExecution$outboundSchema.default("server"),completionArgs:GDt.CompletionArgs$outboundSchema.optional(),fromEntryId:V0.string()}).transform(t=>(0,dDt.remap)(t,{handoffExecution:"handoff_execution",completionArgs:"completion_args",fromEntryId:"from_entry_id"}));var uDt;(function(t){t.inboundSchema=Ga.ConversationRestartRequest$inboundSchema,t.outboundSchema=Ga.ConversationRestartRequest$outboundSchema})(uDt||(Ga.ConversationRestartRequest$=uDt={}));function Zzl(t){return JSON.stringify(Ga.ConversationRestartRequest$outboundSchema.parse(t))}function Wzl(t){return(0,hzl.safeParse)(t,e=>Ga.ConversationRestartRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationRestartRequest' from JSON")}});var VDt=f(ba=>{"use strict";var Nzl=ba&&ba.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Vzl=ba&&ba.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Yzl=ba&&ba.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Nzl(e,t,n);return Vzl(e,t),e};Object.defineProperty(ba,"__esModule",{value:!0});ba.ConversationRestartStreamRequest$=ba.ConversationRestartStreamRequest$outboundSchema=ba.ConversationRestartStreamRequest$inboundSchema=ba.ConversationRestartStreamRequestHandoffExecution$=ba.ConversationRestartStreamRequestHandoffExecution$outboundSchema=ba.ConversationRestartStreamRequestHandoffExecution$inboundSchema=ba.ConversationRestartStreamRequestHandoffExecution=void 0;ba.conversationRestartStreamRequestToJSON=Rzl;ba.conversationRestartStreamRequestFromJSON=yzl;var Y0=Yzl(se()),ZDt=be(),gzl=oe(),WDt=jW(),NDt=Iw();ba.ConversationRestartStreamRequestHandoffExecution={Client:"client",Server:"server"};ba.ConversationRestartStreamRequestHandoffExecution$inboundSchema=Y0.nativeEnum(ba.ConversationRestartStreamRequestHandoffExecution);ba.ConversationRestartStreamRequestHandoffExecution$outboundSchema=ba.ConversationRestartStreamRequestHandoffExecution$inboundSchema;var pDt;(function(t){t.inboundSchema=ba.ConversationRestartStreamRequestHandoffExecution$inboundSchema,t.outboundSchema=ba.ConversationRestartStreamRequestHandoffExecution$outboundSchema})(pDt||(ba.ConversationRestartStreamRequestHandoffExecution$=pDt={}));ba.ConversationRestartStreamRequest$inboundSchema=Y0.object({inputs:NDt.ConversationInputs$inboundSchema,stream:Y0.boolean().default(!0),store:Y0.boolean().default(!0),handoff_execution:ba.ConversationRestartStreamRequestHandoffExecution$inboundSchema.default("server"),completion_args:WDt.CompletionArgs$inboundSchema.optional(),from_entry_id:Y0.string()}).transform(t=>(0,ZDt.remap)(t,{handoff_execution:"handoffExecution",completion_args:"completionArgs",from_entry_id:"fromEntryId"}));ba.ConversationRestartStreamRequest$outboundSchema=Y0.object({inputs:NDt.ConversationInputs$outboundSchema,stream:Y0.boolean().default(!0),store:Y0.boolean().default(!0),handoffExecution:ba.ConversationRestartStreamRequestHandoffExecution$outboundSchema.default("server"),completionArgs:WDt.CompletionArgs$outboundSchema.optional(),fromEntryId:Y0.string()}).transform(t=>(0,ZDt.remap)(t,{handoffExecution:"handoff_execution",completionArgs:"completion_args",fromEntryId:"from_entry_id"}));var hDt;(function(t){t.inboundSchema=ba.ConversationRestartStreamRequest$inboundSchema,t.outboundSchema=ba.ConversationRestartStreamRequest$outboundSchema})(hDt||(ba.ConversationRestartStreamRequest$=hDt={}));function Rzl(t){return JSON.stringify(ba.ConversationRestartStreamRequest$outboundSchema.parse(t))}function yzl(t){return(0,gzl.safeParse)(t,e=>ba.ConversationRestartStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationRestartStreamRequest' from JSON")}});var fDt=f(Gl=>{"use strict";var Azl=Gl&&Gl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Fzl=Gl&&Gl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vzl=Gl&&Gl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Azl(e,t,n);return Fzl(e,t),e};Object.defineProperty(Gl,"__esModule",{value:!0});Gl.ConversationStreamRequest$=Gl.ConversationStreamRequest$outboundSchema=Gl.ConversationStreamRequest$inboundSchema=Gl.ConversationStreamRequestTools$=Gl.ConversationStreamRequestTools$outboundSchema=Gl.ConversationStreamRequestTools$inboundSchema=Gl.ConversationStreamRequestHandoffExecution$=Gl.ConversationStreamRequestHandoffExecution$outboundSchema=Gl.ConversationStreamRequestHandoffExecution$inboundSchema=Gl.ConversationStreamRequestHandoffExecution=void 0;Gl.conversationStreamRequestToolsToJSON=fzl;Gl.conversationStreamRequestToolsFromJSON=Xzl;Gl.conversationStreamRequestToJSON=wzl;Gl.conversationStreamRequestFromJSON=Hzl;var $e=vzl(se()),yDt=be(),ADt=oe(),Gbe=MX(),FDt=jW(),vDt=Iw(),bbe=KX(),mbe=_X(),pbe=PX(),hbe=qX(),Zbe=$X();Gl.ConversationStreamRequestHandoffExecution={Client:"client",Server:"server"};Gl.ConversationStreamRequestHandoffExecution$inboundSchema=$e.nativeEnum(Gl.ConversationStreamRequestHandoffExecution);Gl.ConversationStreamRequestHandoffExecution$outboundSchema=Gl.ConversationStreamRequestHandoffExecution$inboundSchema;var YDt;(function(t){t.inboundSchema=Gl.ConversationStreamRequestHandoffExecution$inboundSchema,t.outboundSchema=Gl.ConversationStreamRequestHandoffExecution$outboundSchema})(YDt||(Gl.ConversationStreamRequestHandoffExecution$=YDt={}));Gl.ConversationStreamRequestTools$inboundSchema=$e.union([Gbe.CodeInterpreterTool$inboundSchema.and($e.object({type:$e.literal("code_interpreter")}).transform(t=>({type:t.type}))),pbe.ImageGenerationTool$inboundSchema.and($e.object({type:$e.literal("image_generation")}).transform(t=>({type:t.type}))),Zbe.WebSearchTool$inboundSchema.and($e.object({type:$e.literal("web_search")}).transform(t=>({type:t.type}))),hbe.WebSearchPremiumTool$inboundSchema.and($e.object({type:$e.literal("web_search_premium")}).transform(t=>({type:t.type}))),bbe.DocumentLibraryTool$inboundSchema.and($e.object({type:$e.literal("document_library")}).transform(t=>({type:t.type}))),mbe.FunctionTool$inboundSchema.and($e.object({type:$e.literal("function")}).transform(t=>({type:t.type})))]);Gl.ConversationStreamRequestTools$outboundSchema=$e.union([Gbe.CodeInterpreterTool$outboundSchema.and($e.object({type:$e.literal("code_interpreter")}).transform(t=>({type:t.type}))),pbe.ImageGenerationTool$outboundSchema.and($e.object({type:$e.literal("image_generation")}).transform(t=>({type:t.type}))),Zbe.WebSearchTool$outboundSchema.and($e.object({type:$e.literal("web_search")}).transform(t=>({type:t.type}))),hbe.WebSearchPremiumTool$outboundSchema.and($e.object({type:$e.literal("web_search_premium")}).transform(t=>({type:t.type}))),bbe.DocumentLibraryTool$outboundSchema.and($e.object({type:$e.literal("document_library")}).transform(t=>({type:t.type}))),mbe.FunctionTool$outboundSchema.and($e.object({type:$e.literal("function")}).transform(t=>({type:t.type})))]);var gDt;(function(t){t.inboundSchema=Gl.ConversationStreamRequestTools$inboundSchema,t.outboundSchema=Gl.ConversationStreamRequestTools$outboundSchema})(gDt||(Gl.ConversationStreamRequestTools$=gDt={}));function fzl(t){return JSON.stringify(Gl.ConversationStreamRequestTools$outboundSchema.parse(t))}function Xzl(t){return(0,ADt.safeParse)(t,e=>Gl.ConversationStreamRequestTools$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationStreamRequestTools' from JSON")}Gl.ConversationStreamRequest$inboundSchema=$e.object({inputs:vDt.ConversationInputs$inboundSchema,stream:$e.boolean().default(!0),store:$e.nullable($e.boolean()).optional(),handoff_execution:$e.nullable(Gl.ConversationStreamRequestHandoffExecution$inboundSchema).optional(),instructions:$e.nullable($e.string()).optional(),tools:$e.nullable($e.array($e.union([Gbe.CodeInterpreterTool$inboundSchema.and($e.object({type:$e.literal("code_interpreter")}).transform(t=>({type:t.type}))),pbe.ImageGenerationTool$inboundSchema.and($e.object({type:$e.literal("image_generation")}).transform(t=>({type:t.type}))),Zbe.WebSearchTool$inboundSchema.and($e.object({type:$e.literal("web_search")}).transform(t=>({type:t.type}))),hbe.WebSearchPremiumTool$inboundSchema.and($e.object({type:$e.literal("web_search_premium")}).transform(t=>({type:t.type}))),bbe.DocumentLibraryTool$inboundSchema.and($e.object({type:$e.literal("document_library")}).transform(t=>({type:t.type}))),mbe.FunctionTool$inboundSchema.and($e.object({type:$e.literal("function")}).transform(t=>({type:t.type})))]))).optional(),completion_args:$e.nullable(FDt.CompletionArgs$inboundSchema).optional(),name:$e.nullable($e.string()).optional(),description:$e.nullable($e.string()).optional(),agent_id:$e.nullable($e.string()).optional(),model:$e.nullable($e.string()).optional()}).transform(t=>(0,yDt.remap)(t,{handoff_execution:"handoffExecution",completion_args:"completionArgs",agent_id:"agentId"}));Gl.ConversationStreamRequest$outboundSchema=$e.object({inputs:vDt.ConversationInputs$outboundSchema,stream:$e.boolean().default(!0),store:$e.nullable($e.boolean()).optional(),handoffExecution:$e.nullable(Gl.ConversationStreamRequestHandoffExecution$outboundSchema).optional(),instructions:$e.nullable($e.string()).optional(),tools:$e.nullable($e.array($e.union([Gbe.CodeInterpreterTool$outboundSchema.and($e.object({type:$e.literal("code_interpreter")}).transform(t=>({type:t.type}))),pbe.ImageGenerationTool$outboundSchema.and($e.object({type:$e.literal("image_generation")}).transform(t=>({type:t.type}))),Zbe.WebSearchTool$outboundSchema.and($e.object({type:$e.literal("web_search")}).transform(t=>({type:t.type}))),hbe.WebSearchPremiumTool$outboundSchema.and($e.object({type:$e.literal("web_search_premium")}).transform(t=>({type:t.type}))),bbe.DocumentLibraryTool$outboundSchema.and($e.object({type:$e.literal("document_library")}).transform(t=>({type:t.type}))),mbe.FunctionTool$outboundSchema.and($e.object({type:$e.literal("function")}).transform(t=>({type:t.type})))]))).optional(),completionArgs:$e.nullable(FDt.CompletionArgs$outboundSchema).optional(),name:$e.nullable($e.string()).optional(),description:$e.nullable($e.string()).optional(),agentId:$e.nullable($e.string()).optional(),model:$e.nullable($e.string()).optional()}).transform(t=>(0,yDt.remap)(t,{handoffExecution:"handoff_execution",completionArgs:"completion_args",agentId:"agent_id"}));var RDt;(function(t){t.inboundSchema=Gl.ConversationStreamRequest$inboundSchema,t.outboundSchema=Gl.ConversationStreamRequest$outboundSchema})(RDt||(Gl.ConversationStreamRequest$=RDt={}));function wzl(t){return JSON.stringify(Gl.ConversationStreamRequest$outboundSchema.parse(t))}function Hzl(t){return(0,ADt.safeParse)(t,e=>Gl.ConversationStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ConversationStreamRequest' from JSON")}});var wDt=f(Gs=>{"use strict";var Qzl=Gs&&Gs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Ezl=Gs&&Gs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Jzl=Gs&&Gs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Qzl(e,t,n);return Ezl(e,t),e};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.DeleteFileOut$=Gs.DeleteFileOut$outboundSchema=Gs.DeleteFileOut$inboundSchema=void 0;Gs.deleteFileOutToJSON=Lzl;Gs.deleteFileOutFromJSON=kzl;var aw=Jzl(se()),Czl=oe();Gs.DeleteFileOut$inboundSchema=aw.object({id:aw.string(),object:aw.string(),deleted:aw.boolean()});Gs.DeleteFileOut$outboundSchema=aw.object({id:aw.string(),object:aw.string(),deleted:aw.boolean()});var XDt;(function(t){t.inboundSchema=Gs.DeleteFileOut$inboundSchema,t.outboundSchema=Gs.DeleteFileOut$outboundSchema})(XDt||(Gs.DeleteFileOut$=XDt={}));function Lzl(t){return JSON.stringify(Gs.DeleteFileOut$outboundSchema.parse(t))}function kzl(t){return(0,Czl.safeParse)(t,e=>Gs.DeleteFileOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DeleteFileOut' from JSON")}});var QDt=f(bs=>{"use strict";var xzl=bs&&bs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jzl=bs&&bs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ozl=bs&&bs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xzl(e,t,n);return jzl(e,t),e};Object.defineProperty(bs,"__esModule",{value:!0});bs.DeleteModelOut$=bs.DeleteModelOut$outboundSchema=bs.DeleteModelOut$inboundSchema=void 0;bs.deleteModelOutToJSON=zzl;bs.deleteModelOutFromJSON=Bzl;var rw=Ozl(se()),Uzl=oe();bs.DeleteModelOut$inboundSchema=rw.object({id:rw.string(),object:rw.string().default("model"),deleted:rw.boolean().default(!0)});bs.DeleteModelOut$outboundSchema=rw.object({id:rw.string(),object:rw.string().default("model"),deleted:rw.boolean().default(!0)});var HDt;(function(t){t.inboundSchema=bs.DeleteModelOut$inboundSchema,t.outboundSchema=bs.DeleteModelOut$outboundSchema})(HDt||(bs.DeleteModelOut$=HDt={}));function zzl(t){return JSON.stringify(bs.DeleteModelOut$outboundSchema.parse(t))}function Bzl(t){return(0,Uzl.safeParse)(t,e=>bs.DeleteModelOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DeleteModelOut' from JSON")}});var v9e=f(ms=>{"use strict";var Szl=ms&&ms.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Mzl=ms&&ms.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Tzl=ms&&ms.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Szl(e,t,n);return Mzl(e,t),e};Object.defineProperty(ms,"__esModule",{value:!0});ms.DocumentOut$=ms.DocumentOut$outboundSchema=ms.DocumentOut$inboundSchema=void 0;ms.documentOutToJSON=Kzl;ms.documentOutFromJSON=_zl;var bl=Tzl(se()),JDt=be(),Dzl=oe();ms.DocumentOut$inboundSchema=bl.object({id:bl.string(),library_id:bl.string(),hash:bl.string(),mime_type:bl.string(),extension:bl.string(),size:bl.number().int(),name:bl.string(),summary:bl.nullable(bl.string()).optional(),created_at:bl.string().datetime({offset:!0}).transform(t=>new Date(t)),last_processed_at:bl.nullable(bl.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),number_of_pages:bl.nullable(bl.number().int()).optional(),processing_status:bl.string(),uploaded_by_id:bl.string(),uploaded_by_type:bl.string(),tokens_processing_main_content:bl.nullable(bl.number().int()).optional(),tokens_processing_summary:bl.nullable(bl.number().int()).optional(),tokens_processing_total:bl.number().int()}).transform(t=>(0,JDt.remap)(t,{library_id:"libraryId",mime_type:"mimeType",created_at:"createdAt",last_processed_at:"lastProcessedAt",number_of_pages:"numberOfPages",processing_status:"processingStatus",uploaded_by_id:"uploadedById",uploaded_by_type:"uploadedByType",tokens_processing_main_content:"tokensProcessingMainContent",tokens_processing_summary:"tokensProcessingSummary",tokens_processing_total:"tokensProcessingTotal"}));ms.DocumentOut$outboundSchema=bl.object({id:bl.string(),libraryId:bl.string(),hash:bl.string(),mimeType:bl.string(),extension:bl.string(),size:bl.number().int(),name:bl.string(),summary:bl.nullable(bl.string()).optional(),createdAt:bl.date().transform(t=>t.toISOString()),lastProcessedAt:bl.nullable(bl.date().transform(t=>t.toISOString())).optional(),numberOfPages:bl.nullable(bl.number().int()).optional(),processingStatus:bl.string(),uploadedById:bl.string(),uploadedByType:bl.string(),tokensProcessingMainContent:bl.nullable(bl.number().int()).optional(),tokensProcessingSummary:bl.nullable(bl.number().int()).optional(),tokensProcessingTotal:bl.number().int()}).transform(t=>(0,JDt.remap)(t,{libraryId:"library_id",mimeType:"mime_type",createdAt:"created_at",lastProcessedAt:"last_processed_at",numberOfPages:"number_of_pages",processingStatus:"processing_status",uploadedById:"uploaded_by_id",uploadedByType:"uploaded_by_type",tokensProcessingMainContent:"tokens_processing_main_content",tokensProcessingSummary:"tokens_processing_summary",tokensProcessingTotal:"tokens_processing_total"}));var EDt;(function(t){t.inboundSchema=ms.DocumentOut$inboundSchema,t.outboundSchema=ms.DocumentOut$outboundSchema})(EDt||(ms.DocumentOut$=EDt={}));function Kzl(t){return JSON.stringify(ms.DocumentOut$outboundSchema.parse(t))}function _zl(t){return(0,Dzl.safeParse)(t,e=>ms.DocumentOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DocumentOut' from JSON")}});var LDt=f(ps=>{"use strict";var Pzl=ps&&ps.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),qzl=ps&&ps.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$zl=ps&&ps.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Pzl(e,t,n);return qzl(e,t),e};Object.defineProperty(ps,"__esModule",{value:!0});ps.DocumentTextContent$=ps.DocumentTextContent$outboundSchema=ps.DocumentTextContent$inboundSchema=void 0;ps.documentTextContentToJSON=tBl;ps.documentTextContentFromJSON=nBl;var Wbe=$zl(se()),eBl=oe();ps.DocumentTextContent$inboundSchema=Wbe.object({text:Wbe.string()});ps.DocumentTextContent$outboundSchema=Wbe.object({text:Wbe.string()});var CDt;(function(t){t.inboundSchema=ps.DocumentTextContent$inboundSchema,t.outboundSchema=ps.DocumentTextContent$outboundSchema})(CDt||(ps.DocumentTextContent$=CDt={}));function tBl(t){return JSON.stringify(ps.DocumentTextContent$outboundSchema.parse(t))}function nBl(t){return(0,eBl.safeParse)(t,e=>ps.DocumentTextContent$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DocumentTextContent' from JSON")}});var xDt=f(hs=>{"use strict";var lBl=hs&&hs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),IBl=hs&&hs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aBl=hs&&hs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&lBl(e,t,n);return IBl(e,t),e};Object.defineProperty(hs,"__esModule",{value:!0});hs.DocumentUpdateIn$=hs.DocumentUpdateIn$outboundSchema=hs.DocumentUpdateIn$inboundSchema=void 0;hs.documentUpdateInToJSON=cBl;hs.documentUpdateInFromJSON=oBl;var eO=aBl(se()),rBl=oe();hs.DocumentUpdateIn$inboundSchema=eO.object({name:eO.nullable(eO.string()).optional()});hs.DocumentUpdateIn$outboundSchema=eO.object({name:eO.nullable(eO.string()).optional()});var kDt;(function(t){t.inboundSchema=hs.DocumentUpdateIn$inboundSchema,t.outboundSchema=hs.DocumentUpdateIn$outboundSchema})(kDt||(hs.DocumentUpdateIn$=kDt={}));function cBl(t){return JSON.stringify(hs.DocumentUpdateIn$outboundSchema.parse(t))}function oBl(t){return(0,rBl.safeParse)(t,e=>hs.DocumentUpdateIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DocumentUpdateIn' from JSON")}});var f9e=f(Zs=>{"use strict";var iBl=Zs&&Zs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),sBl=Zs&&Zs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uBl=Zs&&Zs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&iBl(e,t,n);return sBl(e,t),e};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.EmbeddingDtype$=Zs.EmbeddingDtype$outboundSchema=Zs.EmbeddingDtype$inboundSchema=Zs.EmbeddingDtype=void 0;var dBl=uBl(se());Zs.EmbeddingDtype={Float:"float",Int8:"int8",Uint8:"uint8",Binary:"binary",Ubinary:"ubinary"};Zs.EmbeddingDtype$inboundSchema=dBl.nativeEnum(Zs.EmbeddingDtype);Zs.EmbeddingDtype$outboundSchema=Zs.EmbeddingDtype$inboundSchema;var jDt;(function(t){t.inboundSchema=Zs.EmbeddingDtype$inboundSchema,t.outboundSchema=Zs.EmbeddingDtype$outboundSchema})(jDt||(Zs.EmbeddingDtype$=jDt={}))});var MDt=f(Pa=>{"use strict";var GBl=Pa&&Pa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),bBl=Pa&&Pa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mBl=Pa&&Pa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&GBl(e,t,n);return bBl(e,t),e};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.EmbeddingRequest$=Pa.EmbeddingRequest$outboundSchema=Pa.EmbeddingRequest$inboundSchema=Pa.EmbeddingRequestInputs$=Pa.EmbeddingRequestInputs$outboundSchema=Pa.EmbeddingRequestInputs$inboundSchema=void 0;Pa.embeddingRequestInputsToJSON=pBl;Pa.embeddingRequestInputsFromJSON=hBl;Pa.embeddingRequestToJSON=ZBl;Pa.embeddingRequestFromJSON=WBl;var to=mBl(se()),zDt=be(),BDt=oe(),SDt=f9e();Pa.EmbeddingRequestInputs$inboundSchema=to.union([to.string(),to.array(to.string())]);Pa.EmbeddingRequestInputs$outboundSchema=to.union([to.string(),to.array(to.string())]);var ODt;(function(t){t.inboundSchema=Pa.EmbeddingRequestInputs$inboundSchema,t.outboundSchema=Pa.EmbeddingRequestInputs$outboundSchema})(ODt||(Pa.EmbeddingRequestInputs$=ODt={}));function pBl(t){return JSON.stringify(Pa.EmbeddingRequestInputs$outboundSchema.parse(t))}function hBl(t){return(0,BDt.safeParse)(t,e=>Pa.EmbeddingRequestInputs$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'EmbeddingRequestInputs' from JSON")}Pa.EmbeddingRequest$inboundSchema=to.object({model:to.string(),input:to.union([to.string(),to.array(to.string())]),output_dimension:to.nullable(to.number().int()).optional(),output_dtype:SDt.EmbeddingDtype$inboundSchema.optional()}).transform(t=>(0,zDt.remap)(t,{input:"inputs",output_dimension:"outputDimension",output_dtype:"outputDtype"}));Pa.EmbeddingRequest$outboundSchema=to.object({model:to.string(),inputs:to.union([to.string(),to.array(to.string())]),outputDimension:to.nullable(to.number().int()).optional(),outputDtype:SDt.EmbeddingDtype$outboundSchema.optional()}).transform(t=>(0,zDt.remap)(t,{inputs:"input",outputDimension:"output_dimension",outputDtype:"output_dtype"}));var UDt;(function(t){t.inboundSchema=Pa.EmbeddingRequest$inboundSchema,t.outboundSchema=Pa.EmbeddingRequest$outboundSchema})(UDt||(Pa.EmbeddingRequest$=UDt={}));function ZBl(t){return JSON.stringify(Pa.EmbeddingRequest$outboundSchema.parse(t))}function WBl(t){return(0,BDt.safeParse)(t,e=>Pa.EmbeddingRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'EmbeddingRequest' from JSON")}});var X9e=f(Ws=>{"use strict";var NBl=Ws&&Ws.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),VBl=Ws&&Ws.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),YBl=Ws&&Ws.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&NBl(e,t,n);return VBl(e,t),e};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.EmbeddingResponseData$=Ws.EmbeddingResponseData$outboundSchema=Ws.EmbeddingResponseData$inboundSchema=void 0;Ws.embeddingResponseDataToJSON=RBl;Ws.embeddingResponseDataFromJSON=yBl;var hR=YBl(se()),gBl=oe();Ws.EmbeddingResponseData$inboundSchema=hR.object({object:hR.string().optional(),embedding:hR.array(hR.number()).optional(),index:hR.number().int().optional()});Ws.EmbeddingResponseData$outboundSchema=hR.object({object:hR.string().optional(),embedding:hR.array(hR.number()).optional(),index:hR.number().int().optional()});var TDt;(function(t){t.inboundSchema=Ws.EmbeddingResponseData$inboundSchema,t.outboundSchema=Ws.EmbeddingResponseData$outboundSchema})(TDt||(Ws.EmbeddingResponseData$=TDt={}));function RBl(t){return JSON.stringify(Ws.EmbeddingResponseData$outboundSchema.parse(t))}function yBl(t){return(0,gBl.safeParse)(t,e=>Ws.EmbeddingResponseData$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'EmbeddingResponseData' from JSON")}});var PDt=f(Ns=>{"use strict";var ABl=Ns&&Ns.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),FBl=Ns&&Ns.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vBl=Ns&&Ns.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ABl(e,t,n);return FBl(e,t),e};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.EmbeddingResponse$=Ns.EmbeddingResponse$outboundSchema=Ns.EmbeddingResponse$inboundSchema=void 0;Ns.embeddingResponseToJSON=XBl;Ns.embeddingResponseFromJSON=wBl;var ZR=vBl(se()),fBl=oe(),KDt=X9e(),_Dt=Tj();Ns.EmbeddingResponse$inboundSchema=ZR.object({id:ZR.string(),object:ZR.string(),model:ZR.string(),usage:_Dt.UsageInfo$inboundSchema,data:ZR.array(KDt.EmbeddingResponseData$inboundSchema)});Ns.EmbeddingResponse$outboundSchema=ZR.object({id:ZR.string(),object:ZR.string(),model:ZR.string(),usage:_Dt.UsageInfo$outboundSchema,data:ZR.array(KDt.EmbeddingResponseData$outboundSchema)});var DDt;(function(t){t.inboundSchema=Ns.EmbeddingResponse$inboundSchema,t.outboundSchema=Ns.EmbeddingResponse$outboundSchema})(DDt||(Ns.EmbeddingResponse$=DDt={}));function XBl(t){return JSON.stringify(Ns.EmbeddingResponse$outboundSchema.parse(t))}function wBl(t){return(0,fBl.safeParse)(t,e=>Ns.EmbeddingResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'EmbeddingResponse' from JSON")}});var Nbe=f(Vs=>{"use strict";var HBl=Vs&&Vs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),QBl=Vs&&Vs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),EBl=Vs&&Vs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&HBl(e,t,n);return QBl(e,t),e};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.EntityType$=Vs.EntityType$outboundSchema=Vs.EntityType$inboundSchema=Vs.EntityType=void 0;var mJ=EBl(se()),JBl=BV();Vs.EntityType={User:"User",Workspace:"Workspace",Org:"Org"};Vs.EntityType$inboundSchema=mJ.union([mJ.nativeEnum(Vs.EntityType),mJ.string().transform(JBl.catchUnrecognizedEnum)]);Vs.EntityType$outboundSchema=mJ.union([mJ.nativeEnum(Vs.EntityType),mJ.string().and(mJ.custom())]);var qDt;(function(t){t.inboundSchema=Vs.EntityType$inboundSchema,t.outboundSchema=Vs.EntityType$outboundSchema})(qDt||(Vs.EntityType$=qDt={}))});var eKt=f(Ys=>{"use strict";var CBl=Ys&&Ys.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),LBl=Ys&&Ys.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kBl=Ys&&Ys.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&CBl(e,t,n);return LBl(e,t),e};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.FileT$=Ys.FileT$outboundSchema=Ys.FileT$inboundSchema=void 0;Ys.fileToJSON=jBl;Ys.fileFromJSON=OBl;var Lp=kBl(se()),xBl=oe();Ys.FileT$inboundSchema=Lp.object({fileName:Lp.string(),content:Lp.union([Lp.instanceof(ReadableStream),Lp.instanceof(Blob),Lp.instanceof(ArrayBuffer),Lp.instanceof(Uint8Array)])});Ys.FileT$outboundSchema=Lp.object({fileName:Lp.string(),content:Lp.union([Lp.instanceof(ReadableStream),Lp.instanceof(Blob),Lp.instanceof(ArrayBuffer),Lp.instanceof(Uint8Array)])});var $Dt;(function(t){t.inboundSchema=Ys.FileT$inboundSchema,t.outboundSchema=Ys.FileT$outboundSchema})($Dt||(Ys.FileT$=$Dt={}));function jBl(t){return JSON.stringify(Ys.FileT$outboundSchema.parse(t))}function OBl(t){return(0,xBl.safeParse)(t,e=>Ys.FileT$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FileT' from JSON")}});var p_=f(gs=>{"use strict";var UBl=gs&&gs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),zBl=gs&&gs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BBl=gs&&gs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&UBl(e,t,n);return zBl(e,t),e};Object.defineProperty(gs,"__esModule",{value:!0});gs.FilePurpose$=gs.FilePurpose$outboundSchema=gs.FilePurpose$inboundSchema=gs.FilePurpose=void 0;var pJ=BBl(se()),SBl=BV();gs.FilePurpose={FineTune:"fine-tune",Batch:"batch",Ocr:"ocr"};gs.FilePurpose$inboundSchema=pJ.union([pJ.nativeEnum(gs.FilePurpose),pJ.string().transform(SBl.catchUnrecognizedEnum)]);gs.FilePurpose$outboundSchema=pJ.union([pJ.nativeEnum(gs.FilePurpose),pJ.string().and(pJ.custom())]);var tKt;(function(t){t.inboundSchema=gs.FilePurpose$inboundSchema,t.outboundSchema=gs.FilePurpose$outboundSchema})(tKt||(gs.FilePurpose$=tKt={}))});var h_=f(Rs=>{"use strict";var MBl=Rs&&Rs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),TBl=Rs&&Rs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),DBl=Rs&&Rs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&MBl(e,t,n);return TBl(e,t),e};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.SampleType$=Rs.SampleType$outboundSchema=Rs.SampleType$inboundSchema=Rs.SampleType=void 0;var hJ=DBl(se()),KBl=BV();Rs.SampleType={Pretrain:"pretrain",Instruct:"instruct",BatchRequest:"batch_request",BatchResult:"batch_result",BatchError:"batch_error"};Rs.SampleType$inboundSchema=hJ.union([hJ.nativeEnum(Rs.SampleType),hJ.string().transform(KBl.catchUnrecognizedEnum)]);Rs.SampleType$outboundSchema=hJ.union([hJ.nativeEnum(Rs.SampleType),hJ.string().and(hJ.custom())]);var nKt;(function(t){t.inboundSchema=Rs.SampleType$inboundSchema,t.outboundSchema=Rs.SampleType$outboundSchema})(nKt||(Rs.SampleType$=nKt={}))});var Z_=f(ys=>{"use strict";var _Bl=ys&&ys.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),PBl=ys&&ys.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qBl=ys&&ys.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_Bl(e,t,n);return PBl(e,t),e};Object.defineProperty(ys,"__esModule",{value:!0});ys.Source$=ys.Source$outboundSchema=ys.Source$inboundSchema=ys.Source=void 0;var ZJ=qBl(se()),$Bl=BV();ys.Source={Upload:"upload",Repository:"repository",Mistral:"mistral"};ys.Source$inboundSchema=ZJ.union([ZJ.nativeEnum(ys.Source),ZJ.string().transform($Bl.catchUnrecognizedEnum)]);ys.Source$outboundSchema=ZJ.union([ZJ.nativeEnum(ys.Source),ZJ.string().and(ZJ.custom())]);var lKt;(function(t){t.inboundSchema=ys.Source$inboundSchema,t.outboundSchema=ys.Source$outboundSchema})(lKt||(ys.Source$=lKt={}))});var w9e=f(As=>{"use strict";var eSl=As&&As.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),tSl=As&&As.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nSl=As&&As.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&eSl(e,t,n);return tSl(e,t),e};Object.defineProperty(As,"__esModule",{value:!0});As.FileSchema$=As.FileSchema$outboundSchema=As.FileSchema$inboundSchema=void 0;As.fileSchemaToJSON=ISl;As.fileSchemaFromJSON=aSl;var Jb=nSl(se()),aKt=be(),lSl=oe(),rKt=p_(),cKt=h_(),oKt=Z_();As.FileSchema$inboundSchema=Jb.object({id:Jb.string(),object:Jb.string(),bytes:Jb.number().int(),created_at:Jb.number().int(),filename:Jb.string(),purpose:rKt.FilePurpose$inboundSchema,sample_type:cKt.SampleType$inboundSchema,num_lines:Jb.nullable(Jb.number().int()).optional(),source:oKt.Source$inboundSchema}).transform(t=>(0,aKt.remap)(t,{bytes:"sizeBytes",created_at:"createdAt",sample_type:"sampleType",num_lines:"numLines"}));As.FileSchema$outboundSchema=Jb.object({id:Jb.string(),object:Jb.string(),sizeBytes:Jb.number().int(),createdAt:Jb.number().int(),filename:Jb.string(),purpose:rKt.FilePurpose$outboundSchema,sampleType:cKt.SampleType$outboundSchema,numLines:Jb.nullable(Jb.number().int()).optional(),source:oKt.Source$outboundSchema}).transform(t=>(0,aKt.remap)(t,{sizeBytes:"bytes",createdAt:"created_at",sampleType:"sample_type",numLines:"num_lines"}));var IKt;(function(t){t.inboundSchema=As.FileSchema$inboundSchema,t.outboundSchema=As.FileSchema$outboundSchema})(IKt||(As.FileSchema$=IKt={}));function ISl(t){return JSON.stringify(As.FileSchema$outboundSchema.parse(t))}function aSl(t){return(0,lSl.safeParse)(t,e=>As.FileSchema$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FileSchema' from JSON")}});var sKt=f(Fs=>{"use strict";var rSl=Fs&&Fs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),cSl=Fs&&Fs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),oSl=Fs&&Fs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&rSl(e,t,n);return cSl(e,t),e};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.FileSignedURL$=Fs.FileSignedURL$outboundSchema=Fs.FileSignedURL$inboundSchema=void 0;Fs.fileSignedURLToJSON=sSl;Fs.fileSignedURLFromJSON=uSl;var Vbe=oSl(se()),iSl=oe();Fs.FileSignedURL$inboundSchema=Vbe.object({url:Vbe.string()});Fs.FileSignedURL$outboundSchema=Vbe.object({url:Vbe.string()});var iKt;(function(t){t.inboundSchema=Fs.FileSignedURL$inboundSchema,t.outboundSchema=Fs.FileSignedURL$outboundSchema})(iKt||(Fs.FileSignedURL$=iKt={}));function sSl(t){return JSON.stringify(Fs.FileSignedURL$outboundSchema.parse(t))}function uSl(t){return(0,iSl.safeParse)(t,e=>Fs.FileSignedURL$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FileSignedURL' from JSON")}});var mKt=f(qa=>{"use strict";var dSl=qa&&qa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),GSl=qa&&qa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bSl=qa&&qa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&dSl(e,t,n);return GSl(e,t),e};Object.defineProperty(qa,"__esModule",{value:!0});qa.FIMCompletionRequest$=qa.FIMCompletionRequest$outboundSchema=qa.FIMCompletionRequest$inboundSchema=qa.FIMCompletionRequestStop$=qa.FIMCompletionRequestStop$outboundSchema=qa.FIMCompletionRequestStop$inboundSchema=void 0;qa.fimCompletionRequestStopToJSON=mSl;qa.fimCompletionRequestStopFromJSON=pSl;qa.fimCompletionRequestToJSON=hSl;qa.fimCompletionRequestFromJSON=ZSl;var ml=bSl(se()),GKt=be(),bKt=oe();qa.FIMCompletionRequestStop$inboundSchema=ml.union([ml.string(),ml.array(ml.string())]);qa.FIMCompletionRequestStop$outboundSchema=ml.union([ml.string(),ml.array(ml.string())]);var uKt;(function(t){t.inboundSchema=qa.FIMCompletionRequestStop$inboundSchema,t.outboundSchema=qa.FIMCompletionRequestStop$outboundSchema})(uKt||(qa.FIMCompletionRequestStop$=uKt={}));function mSl(t){return JSON.stringify(qa.FIMCompletionRequestStop$outboundSchema.parse(t))}function pSl(t){return(0,bKt.safeParse)(t,e=>qa.FIMCompletionRequestStop$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FIMCompletionRequestStop' from JSON")}qa.FIMCompletionRequest$inboundSchema=ml.object({model:ml.string(),temperature:ml.nullable(ml.number()).optional(),top_p:ml.number().default(1),max_tokens:ml.nullable(ml.number().int()).optional(),stream:ml.boolean().default(!1),stop:ml.union([ml.string(),ml.array(ml.string())]).optional(),random_seed:ml.nullable(ml.number().int()).optional(),prompt:ml.string(),suffix:ml.nullable(ml.string()).optional(),min_tokens:ml.nullable(ml.number().int()).optional()}).transform(t=>(0,GKt.remap)(t,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",min_tokens:"minTokens"}));qa.FIMCompletionRequest$outboundSchema=ml.object({model:ml.string(),temperature:ml.nullable(ml.number()).optional(),topP:ml.number().default(1),maxTokens:ml.nullable(ml.number().int()).optional(),stream:ml.boolean().default(!1),stop:ml.union([ml.string(),ml.array(ml.string())]).optional(),randomSeed:ml.nullable(ml.number().int()).optional(),prompt:ml.string(),suffix:ml.nullable(ml.string()).optional(),minTokens:ml.nullable(ml.number().int()).optional()}).transform(t=>(0,GKt.remap)(t,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",minTokens:"min_tokens"}));var dKt;(function(t){t.inboundSchema=qa.FIMCompletionRequest$inboundSchema,t.outboundSchema=qa.FIMCompletionRequest$outboundSchema})(dKt||(qa.FIMCompletionRequest$=dKt={}));function hSl(t){return JSON.stringify(qa.FIMCompletionRequest$outboundSchema.parse(t))}function ZSl(t){return(0,bKt.safeParse)(t,e=>qa.FIMCompletionRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FIMCompletionRequest' from JSON")}});var WKt=f(vs=>{"use strict";var WSl=vs&&vs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),NSl=vs&&vs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VSl=vs&&vs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&WSl(e,t,n);return NSl(e,t),e};Object.defineProperty(vs,"__esModule",{value:!0});vs.FIMCompletionResponse$=vs.FIMCompletionResponse$outboundSchema=vs.FIMCompletionResponse$inboundSchema=void 0;vs.fimCompletionResponseToJSON=gSl;vs.fimCompletionResponseFromJSON=RSl;var PW=VSl(se()),YSl=oe(),hKt=IGe(),ZKt=Tj();vs.FIMCompletionResponse$inboundSchema=PW.object({id:PW.string(),object:PW.string(),model:PW.string(),usage:ZKt.UsageInfo$inboundSchema,created:PW.number().int(),choices:PW.array(hKt.ChatCompletionChoice$inboundSchema)});vs.FIMCompletionResponse$outboundSchema=PW.object({id:PW.string(),object:PW.string(),model:PW.string(),usage:ZKt.UsageInfo$outboundSchema,created:PW.number().int(),choices:PW.array(hKt.ChatCompletionChoice$outboundSchema)});var pKt;(function(t){t.inboundSchema=vs.FIMCompletionResponse$inboundSchema,t.outboundSchema=vs.FIMCompletionResponse$outboundSchema})(pKt||(vs.FIMCompletionResponse$=pKt={}));function gSl(t){return JSON.stringify(vs.FIMCompletionResponse$outboundSchema.parse(t))}function RSl(t){return(0,YSl.safeParse)(t,e=>vs.FIMCompletionResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FIMCompletionResponse' from JSON")}});var RKt=f($a=>{"use strict";var ySl=$a&&$a.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ASl=$a&&$a.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),FSl=$a&&$a.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ySl(e,t,n);return ASl(e,t),e};Object.defineProperty($a,"__esModule",{value:!0});$a.FIMCompletionStreamRequest$=$a.FIMCompletionStreamRequest$outboundSchema=$a.FIMCompletionStreamRequest$inboundSchema=$a.FIMCompletionStreamRequestStop$=$a.FIMCompletionStreamRequestStop$outboundSchema=$a.FIMCompletionStreamRequestStop$inboundSchema=void 0;$a.fimCompletionStreamRequestStopToJSON=vSl;$a.fimCompletionStreamRequestStopFromJSON=fSl;$a.fimCompletionStreamRequestToJSON=XSl;$a.fimCompletionStreamRequestFromJSON=wSl;var pl=FSl(se()),YKt=be(),gKt=oe();$a.FIMCompletionStreamRequestStop$inboundSchema=pl.union([pl.string(),pl.array(pl.string())]);$a.FIMCompletionStreamRequestStop$outboundSchema=pl.union([pl.string(),pl.array(pl.string())]);var NKt;(function(t){t.inboundSchema=$a.FIMCompletionStreamRequestStop$inboundSchema,t.outboundSchema=$a.FIMCompletionStreamRequestStop$outboundSchema})(NKt||($a.FIMCompletionStreamRequestStop$=NKt={}));function vSl(t){return JSON.stringify($a.FIMCompletionStreamRequestStop$outboundSchema.parse(t))}function fSl(t){return(0,gKt.safeParse)(t,e=>$a.FIMCompletionStreamRequestStop$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FIMCompletionStreamRequestStop' from JSON")}$a.FIMCompletionStreamRequest$inboundSchema=pl.object({model:pl.string(),temperature:pl.nullable(pl.number()).optional(),top_p:pl.number().default(1),max_tokens:pl.nullable(pl.number().int()).optional(),stream:pl.boolean().default(!0),stop:pl.union([pl.string(),pl.array(pl.string())]).optional(),random_seed:pl.nullable(pl.number().int()).optional(),prompt:pl.string(),suffix:pl.nullable(pl.string()).optional(),min_tokens:pl.nullable(pl.number().int()).optional()}).transform(t=>(0,YKt.remap)(t,{top_p:"topP",max_tokens:"maxTokens",random_seed:"randomSeed",min_tokens:"minTokens"}));$a.FIMCompletionStreamRequest$outboundSchema=pl.object({model:pl.string(),temperature:pl.nullable(pl.number()).optional(),topP:pl.number().default(1),maxTokens:pl.nullable(pl.number().int()).optional(),stream:pl.boolean().default(!0),stop:pl.union([pl.string(),pl.array(pl.string())]).optional(),randomSeed:pl.nullable(pl.number().int()).optional(),prompt:pl.string(),suffix:pl.nullable(pl.string()).optional(),minTokens:pl.nullable(pl.number().int()).optional()}).transform(t=>(0,YKt.remap)(t,{topP:"top_p",maxTokens:"max_tokens",randomSeed:"random_seed",minTokens:"min_tokens"}));var VKt;(function(t){t.inboundSchema=$a.FIMCompletionStreamRequest$inboundSchema,t.outboundSchema=$a.FIMCompletionStreamRequest$outboundSchema})(VKt||($a.FIMCompletionStreamRequest$=VKt={}));function XSl(t){return JSON.stringify($a.FIMCompletionStreamRequest$outboundSchema.parse(t))}function wSl(t){return(0,gKt.safeParse)(t,e=>$a.FIMCompletionStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FIMCompletionStreamRequest' from JSON")}});var H9e=f(fs=>{"use strict";var HSl=fs&&fs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),QSl=fs&&fs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ESl=fs&&fs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&HSl(e,t,n);return QSl(e,t),e};Object.defineProperty(fs,"__esModule",{value:!0});fs.FineTuneableModelType$=fs.FineTuneableModelType$outboundSchema=fs.FineTuneableModelType$inboundSchema=fs.FineTuneableModelType=void 0;var JSl=ESl(se());fs.FineTuneableModelType={Completion:"completion",Classifier:"classifier"};fs.FineTuneableModelType$inboundSchema=JSl.nativeEnum(fs.FineTuneableModelType);fs.FineTuneableModelType$outboundSchema=fs.FineTuneableModelType$inboundSchema;var yKt;(function(t){t.inboundSchema=fs.FineTuneableModelType$inboundSchema,t.outboundSchema=fs.FineTuneableModelType$outboundSchema})(yKt||(fs.FineTuneableModelType$=yKt={}))});var Q9e=f(er=>{"use strict";var CSl=er&&er.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),LSl=er&&er.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kSl=er&&er.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&CSl(e,t,n);return LSl(e,t),e};Object.defineProperty(er,"__esModule",{value:!0});er.FTModelCard$=er.FTModelCard$outboundSchema=er.FTModelCard$inboundSchema=er.FTModelCardType$=er.FTModelCardType$outboundSchema=er.FTModelCardType$inboundSchema=er.FTModelCardType=void 0;er.ftModelCardToJSON=jSl;er.ftModelCardFromJSON=OSl;var gl=kSl(se()),vKt=be(),xSl=oe(),fKt=Dde();er.FTModelCardType={FineTuned:"fine-tuned"};er.FTModelCardType$inboundSchema=gl.nativeEnum(er.FTModelCardType);er.FTModelCardType$outboundSchema=er.FTModelCardType$inboundSchema;var AKt;(function(t){t.inboundSchema=er.FTModelCardType$inboundSchema,t.outboundSchema=er.FTModelCardType$outboundSchema})(AKt||(er.FTModelCardType$=AKt={}));er.FTModelCard$inboundSchema=gl.object({id:gl.string(),object:gl.string().default("model"),created:gl.number().int().optional(),owned_by:gl.string().default("mistralai"),capabilities:fKt.ModelCapabilities$inboundSchema,name:gl.nullable(gl.string()).optional(),description:gl.nullable(gl.string()).optional(),max_context_length:gl.number().int().default(32768),aliases:gl.array(gl.string()).optional(),deprecation:gl.nullable(gl.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),deprecation_replacement_model:gl.nullable(gl.string()).optional(),default_model_temperature:gl.nullable(gl.number()).optional(),type:gl.literal("fine-tuned").default("fine-tuned"),job:gl.string(),root:gl.string(),archived:gl.boolean().default(!1)}).transform(t=>(0,vKt.remap)(t,{owned_by:"ownedBy",max_context_length:"maxContextLength",deprecation_replacement_model:"deprecationReplacementModel",default_model_temperature:"defaultModelTemperature"}));er.FTModelCard$outboundSchema=gl.object({id:gl.string(),object:gl.string().default("model"),created:gl.number().int().optional(),ownedBy:gl.string().default("mistralai"),capabilities:fKt.ModelCapabilities$outboundSchema,name:gl.nullable(gl.string()).optional(),description:gl.nullable(gl.string()).optional(),maxContextLength:gl.number().int().default(32768),aliases:gl.array(gl.string()).optional(),deprecation:gl.nullable(gl.date().transform(t=>t.toISOString())).optional(),deprecationReplacementModel:gl.nullable(gl.string()).optional(),defaultModelTemperature:gl.nullable(gl.number()).optional(),type:gl.literal("fine-tuned").default("fine-tuned"),job:gl.string(),root:gl.string(),archived:gl.boolean().default(!1)}).transform(t=>(0,vKt.remap)(t,{ownedBy:"owned_by",maxContextLength:"max_context_length",deprecationReplacementModel:"deprecation_replacement_model",defaultModelTemperature:"default_model_temperature"}));var FKt;(function(t){t.inboundSchema=er.FTModelCard$inboundSchema,t.outboundSchema=er.FTModelCard$outboundSchema})(FKt||(er.FTModelCard$=FKt={}));function jSl(t){return JSON.stringify(er.FTModelCard$outboundSchema.parse(t))}function OSl(t){return(0,xSl.safeParse)(t,e=>er.FTModelCard$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FTModelCard' from JSON")}});var E9e=f(ma=>{"use strict";var USl=ma&&ma.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),zSl=ma&&ma.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BSl=ma&&ma.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&USl(e,t,n);return zSl(e,t),e};Object.defineProperty(ma,"__esModule",{value:!0});ma.GithubRepositoryIn$=ma.GithubRepositoryIn$outboundSchema=ma.GithubRepositoryIn$inboundSchema=ma.GithubRepositoryInType$=ma.GithubRepositoryInType$outboundSchema=ma.GithubRepositoryInType$inboundSchema=ma.GithubRepositoryInType=void 0;ma.githubRepositoryInToJSON=MSl;ma.githubRepositoryInFromJSON=TSl;var vm=BSl(se()),SSl=oe();ma.GithubRepositoryInType={Github:"github"};ma.GithubRepositoryInType$inboundSchema=vm.nativeEnum(ma.GithubRepositoryInType);ma.GithubRepositoryInType$outboundSchema=ma.GithubRepositoryInType$inboundSchema;var XKt;(function(t){t.inboundSchema=ma.GithubRepositoryInType$inboundSchema,t.outboundSchema=ma.GithubRepositoryInType$outboundSchema})(XKt||(ma.GithubRepositoryInType$=XKt={}));ma.GithubRepositoryIn$inboundSchema=vm.object({type:ma.GithubRepositoryInType$inboundSchema.default("github"),name:vm.string(),owner:vm.string(),ref:vm.nullable(vm.string()).optional(),weight:vm.number().default(1),token:vm.string()});ma.GithubRepositoryIn$outboundSchema=vm.object({type:ma.GithubRepositoryInType$outboundSchema.default("github"),name:vm.string(),owner:vm.string(),ref:vm.nullable(vm.string()).optional(),weight:vm.number().default(1),token:vm.string()});var wKt;(function(t){t.inboundSchema=ma.GithubRepositoryIn$inboundSchema,t.outboundSchema=ma.GithubRepositoryIn$outboundSchema})(wKt||(ma.GithubRepositoryIn$=wKt={}));function MSl(t){return JSON.stringify(ma.GithubRepositoryIn$outboundSchema.parse(t))}function TSl(t){return(0,SSl.safeParse)(t,e=>ma.GithubRepositoryIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'GithubRepositoryIn' from JSON")}});var J9e=f(Xs=>{"use strict";var DSl=Xs&&Xs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KSl=Xs&&Xs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_Sl=Xs&&Xs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DSl(e,t,n);return KSl(e,t),e};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.TrainingFile$=Xs.TrainingFile$outboundSchema=Xs.TrainingFile$inboundSchema=void 0;Xs.trainingFileToJSON=qSl;Xs.trainingFileFromJSON=$Sl;var tO=_Sl(se()),QKt=be(),PSl=oe();Xs.TrainingFile$inboundSchema=tO.object({file_id:tO.string(),weight:tO.number().default(1)}).transform(t=>(0,QKt.remap)(t,{file_id:"fileId"}));Xs.TrainingFile$outboundSchema=tO.object({fileId:tO.string(),weight:tO.number().default(1)}).transform(t=>(0,QKt.remap)(t,{fileId:"file_id"}));var HKt;(function(t){t.inboundSchema=Xs.TrainingFile$inboundSchema,t.outboundSchema=Xs.TrainingFile$outboundSchema})(HKt||(Xs.TrainingFile$=HKt={}));function qSl(t){return JSON.stringify(Xs.TrainingFile$outboundSchema.parse(t))}function $Sl(t){return(0,PSl.safeParse)(t,e=>Xs.TrainingFile$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'TrainingFile' from JSON")}});var C9e=f(pa=>{"use strict";var eMl=pa&&pa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),tMl=pa&&pa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nMl=pa&&pa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&eMl(e,t,n);return tMl(e,t),e};Object.defineProperty(pa,"__esModule",{value:!0});pa.WandbIntegration$=pa.WandbIntegration$outboundSchema=pa.WandbIntegration$inboundSchema=pa.WandbIntegrationType$=pa.WandbIntegrationType$outboundSchema=pa.WandbIntegrationType$inboundSchema=pa.WandbIntegrationType=void 0;pa.wandbIntegrationToJSON=IMl;pa.wandbIntegrationFromJSON=aMl;var fm=nMl(se()),CKt=be(),lMl=oe();pa.WandbIntegrationType={Wandb:"wandb"};pa.WandbIntegrationType$inboundSchema=fm.nativeEnum(pa.WandbIntegrationType);pa.WandbIntegrationType$outboundSchema=pa.WandbIntegrationType$inboundSchema;var EKt;(function(t){t.inboundSchema=pa.WandbIntegrationType$inboundSchema,t.outboundSchema=pa.WandbIntegrationType$outboundSchema})(EKt||(pa.WandbIntegrationType$=EKt={}));pa.WandbIntegration$inboundSchema=fm.object({type:pa.WandbIntegrationType$inboundSchema.default("wandb"),project:fm.string(),name:fm.nullable(fm.string()).optional(),api_key:fm.string(),run_name:fm.nullable(fm.string()).optional()}).transform(t=>(0,CKt.remap)(t,{api_key:"apiKey",run_name:"runName"}));pa.WandbIntegration$outboundSchema=fm.object({type:pa.WandbIntegrationType$outboundSchema.default("wandb"),project:fm.string(),name:fm.nullable(fm.string()).optional(),apiKey:fm.string(),runName:fm.nullable(fm.string()).optional()}).transform(t=>(0,CKt.remap)(t,{apiKey:"api_key",runName:"run_name"}));var JKt;(function(t){t.inboundSchema=pa.WandbIntegration$inboundSchema,t.outboundSchema=pa.WandbIntegration$outboundSchema})(JKt||(pa.WandbIntegration$=JKt={}));function IMl(t){return JSON.stringify(pa.WandbIntegration$outboundSchema.parse(t))}function aMl(t){return(0,lMl.safeParse)(t,e=>pa.WandbIntegration$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'WandbIntegration' from JSON")}});var SKt=f(pn=>{"use strict";var rMl=pn&&pn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),cMl=pn&&pn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),oMl=pn&&pn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&rMl(e,t,n);return cMl(e,t),e};Object.defineProperty(pn,"__esModule",{value:!0});pn.JobIn$=pn.JobIn$outboundSchema=pn.JobIn$inboundSchema=pn.JobInRepositories$=pn.JobInRepositories$outboundSchema=pn.JobInRepositories$inboundSchema=pn.Hyperparameters$=pn.Hyperparameters$outboundSchema=pn.Hyperparameters$inboundSchema=pn.JobInIntegrations$=pn.JobInIntegrations$outboundSchema=pn.JobInIntegrations$inboundSchema=void 0;pn.jobInIntegrationsToJSON=iMl;pn.jobInIntegrationsFromJSON=sMl;pn.hyperparametersToJSON=uMl;pn.hyperparametersFromJSON=dMl;pn.jobInRepositoriesToJSON=GMl;pn.jobInRepositoriesFromJSON=bMl;pn.jobInToJSON=mMl;pn.jobInFromJSON=pMl;var rI=oMl(se()),OKt=be(),Ybe=oe(),UKt=I9e(),gbe=a9e(),Rbe=d9e(),zKt=H9e(),ybe=E9e(),BKt=J9e(),Abe=C9e();pn.JobInIntegrations$inboundSchema=Abe.WandbIntegration$inboundSchema;pn.JobInIntegrations$outboundSchema=Abe.WandbIntegration$outboundSchema;var LKt;(function(t){t.inboundSchema=pn.JobInIntegrations$inboundSchema,t.outboundSchema=pn.JobInIntegrations$outboundSchema})(LKt||(pn.JobInIntegrations$=LKt={}));function iMl(t){return JSON.stringify(pn.JobInIntegrations$outboundSchema.parse(t))}function sMl(t){return(0,Ybe.safeParse)(t,e=>pn.JobInIntegrations$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobInIntegrations' from JSON")}pn.Hyperparameters$inboundSchema=rI.union([gbe.ClassifierTrainingParametersIn$inboundSchema,Rbe.CompletionTrainingParametersIn$inboundSchema]);pn.Hyperparameters$outboundSchema=rI.union([gbe.ClassifierTrainingParametersIn$outboundSchema,Rbe.CompletionTrainingParametersIn$outboundSchema]);var kKt;(function(t){t.inboundSchema=pn.Hyperparameters$inboundSchema,t.outboundSchema=pn.Hyperparameters$outboundSchema})(kKt||(pn.Hyperparameters$=kKt={}));function uMl(t){return JSON.stringify(pn.Hyperparameters$outboundSchema.parse(t))}function dMl(t){return(0,Ybe.safeParse)(t,e=>pn.Hyperparameters$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Hyperparameters' from JSON")}pn.JobInRepositories$inboundSchema=ybe.GithubRepositoryIn$inboundSchema;pn.JobInRepositories$outboundSchema=ybe.GithubRepositoryIn$outboundSchema;var xKt;(function(t){t.inboundSchema=pn.JobInRepositories$inboundSchema,t.outboundSchema=pn.JobInRepositories$outboundSchema})(xKt||(pn.JobInRepositories$=xKt={}));function GMl(t){return JSON.stringify(pn.JobInRepositories$outboundSchema.parse(t))}function bMl(t){return(0,Ybe.safeParse)(t,e=>pn.JobInRepositories$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobInRepositories' from JSON")}pn.JobIn$inboundSchema=rI.object({model:rI.string(),training_files:rI.array(BKt.TrainingFile$inboundSchema).optional(),validation_files:rI.nullable(rI.array(rI.string())).optional(),suffix:rI.nullable(rI.string()).optional(),integrations:rI.nullable(rI.array(Abe.WandbIntegration$inboundSchema)).optional(),auto_start:rI.boolean().optional(),invalid_sample_skip_percentage:rI.number().default(0),job_type:rI.nullable(zKt.FineTuneableModelType$inboundSchema).optional(),hyperparameters:rI.union([gbe.ClassifierTrainingParametersIn$inboundSchema,Rbe.CompletionTrainingParametersIn$inboundSchema]),repositories:rI.nullable(rI.array(ybe.GithubRepositoryIn$inboundSchema)).optional(),classifier_targets:rI.nullable(rI.array(UKt.ClassifierTargetIn$inboundSchema)).optional()}).transform(t=>(0,OKt.remap)(t,{training_files:"trainingFiles",validation_files:"validationFiles",auto_start:"autoStart",invalid_sample_skip_percentage:"invalidSampleSkipPercentage",job_type:"jobType",classifier_targets:"classifierTargets"}));pn.JobIn$outboundSchema=rI.object({model:rI.string(),trainingFiles:rI.array(BKt.TrainingFile$outboundSchema).optional(),validationFiles:rI.nullable(rI.array(rI.string())).optional(),suffix:rI.nullable(rI.string()).optional(),integrations:rI.nullable(rI.array(Abe.WandbIntegration$outboundSchema)).optional(),autoStart:rI.boolean().optional(),invalidSampleSkipPercentage:rI.number().default(0),jobType:rI.nullable(zKt.FineTuneableModelType$outboundSchema).optional(),hyperparameters:rI.union([gbe.ClassifierTrainingParametersIn$outboundSchema,Rbe.CompletionTrainingParametersIn$outboundSchema]),repositories:rI.nullable(rI.array(ybe.GithubRepositoryIn$outboundSchema)).optional(),classifierTargets:rI.nullable(rI.array(UKt.ClassifierTargetIn$outboundSchema)).optional()}).transform(t=>(0,OKt.remap)(t,{trainingFiles:"training_files",validationFiles:"validation_files",autoStart:"auto_start",invalidSampleSkipPercentage:"invalid_sample_skip_percentage",jobType:"job_type",classifierTargets:"classifier_targets"}));var jKt;(function(t){t.inboundSchema=pn.JobIn$inboundSchema,t.outboundSchema=pn.JobIn$outboundSchema})(jKt||(pn.JobIn$=jKt={}));function mMl(t){return JSON.stringify(pn.JobIn$outboundSchema.parse(t))}function pMl(t){return(0,Ybe.safeParse)(t,e=>pn.JobIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobIn' from JSON")}});var _Kt=f(hl=>{"use strict";var hMl=hl&&hl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ZMl=hl&&hl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WMl=hl&&hl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&hMl(e,t,n);return ZMl(e,t),e};Object.defineProperty(hl,"__esModule",{value:!0});hl.JobsOut$=hl.JobsOut$outboundSchema=hl.JobsOut$inboundSchema=hl.JobsOutObject$=hl.JobsOutObject$outboundSchema=hl.JobsOutObject$inboundSchema=hl.JobsOutData$=hl.JobsOutData$outboundSchema=hl.JobsOutData$inboundSchema=hl.JobsOutObject=void 0;hl.jobsOutDataToJSON=NMl;hl.jobsOutDataFromJSON=VMl;hl.jobsOutToJSON=YMl;hl.jobsOutFromJSON=gMl;var lc=WMl(se()),KKt=oe(),Fbe=l9e(),vbe=u9e();hl.JobsOutObject={List:"list"};hl.JobsOutData$inboundSchema=lc.union([Fbe.ClassifierJobOut$inboundSchema.and(lc.object({job_type:lc.literal("classifier")}).transform(t=>({jobType:t.job_type}))),vbe.CompletionJobOut$inboundSchema.and(lc.object({job_type:lc.literal("completion")}).transform(t=>({jobType:t.job_type})))]);hl.JobsOutData$outboundSchema=lc.union([Fbe.ClassifierJobOut$outboundSchema.and(lc.object({jobType:lc.literal("classifier")}).transform(t=>({job_type:t.jobType}))),vbe.CompletionJobOut$outboundSchema.and(lc.object({jobType:lc.literal("completion")}).transform(t=>({job_type:t.jobType})))]);var MKt;(function(t){t.inboundSchema=hl.JobsOutData$inboundSchema,t.outboundSchema=hl.JobsOutData$outboundSchema})(MKt||(hl.JobsOutData$=MKt={}));function NMl(t){return JSON.stringify(hl.JobsOutData$outboundSchema.parse(t))}function VMl(t){return(0,KKt.safeParse)(t,e=>hl.JobsOutData$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsOutData' from JSON")}hl.JobsOutObject$inboundSchema=lc.nativeEnum(hl.JobsOutObject);hl.JobsOutObject$outboundSchema=hl.JobsOutObject$inboundSchema;var TKt;(function(t){t.inboundSchema=hl.JobsOutObject$inboundSchema,t.outboundSchema=hl.JobsOutObject$outboundSchema})(TKt||(hl.JobsOutObject$=TKt={}));hl.JobsOut$inboundSchema=lc.object({data:lc.array(lc.union([Fbe.ClassifierJobOut$inboundSchema.and(lc.object({job_type:lc.literal("classifier")}).transform(t=>({jobType:t.job_type}))),vbe.CompletionJobOut$inboundSchema.and(lc.object({job_type:lc.literal("completion")}).transform(t=>({jobType:t.job_type})))])).optional(),object:hl.JobsOutObject$inboundSchema.default("list"),total:lc.number().int()});hl.JobsOut$outboundSchema=lc.object({data:lc.array(lc.union([Fbe.ClassifierJobOut$outboundSchema.and(lc.object({jobType:lc.literal("classifier")}).transform(t=>({job_type:t.jobType}))),vbe.CompletionJobOut$outboundSchema.and(lc.object({jobType:lc.literal("completion")}).transform(t=>({job_type:t.jobType})))])).optional(),object:hl.JobsOutObject$outboundSchema.default("list"),total:lc.number().int()});var DKt;(function(t){t.inboundSchema=hl.JobsOut$inboundSchema,t.outboundSchema=hl.JobsOut$outboundSchema})(DKt||(hl.JobsOut$=DKt={}));function YMl(t){return JSON.stringify(hl.JobsOut$outboundSchema.parse(t))}function gMl(t){return(0,KKt.safeParse)(t,e=>hl.JobsOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsOut' from JSON")}});var e_t=f(ha=>{"use strict";var RMl=ha&&ha.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),yMl=ha&&ha.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AMl=ha&&ha.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&RMl(e,t,n);return yMl(e,t),e};Object.defineProperty(ha,"__esModule",{value:!0});ha.LegacyJobMetadataOut$=ha.LegacyJobMetadataOut$outboundSchema=ha.LegacyJobMetadataOut$inboundSchema=ha.LegacyJobMetadataOutObject$=ha.LegacyJobMetadataOutObject$outboundSchema=ha.LegacyJobMetadataOutObject$inboundSchema=ha.LegacyJobMetadataOutObject=void 0;ha.legacyJobMetadataOutToJSON=vMl;ha.legacyJobMetadataOutFromJSON=fMl;var El=AMl(se()),$Kt=be(),FMl=oe();ha.LegacyJobMetadataOutObject={JobMetadata:"job.metadata"};ha.LegacyJobMetadataOutObject$inboundSchema=El.nativeEnum(ha.LegacyJobMetadataOutObject);ha.LegacyJobMetadataOutObject$outboundSchema=ha.LegacyJobMetadataOutObject$inboundSchema;var PKt;(function(t){t.inboundSchema=ha.LegacyJobMetadataOutObject$inboundSchema,t.outboundSchema=ha.LegacyJobMetadataOutObject$outboundSchema})(PKt||(ha.LegacyJobMetadataOutObject$=PKt={}));ha.LegacyJobMetadataOut$inboundSchema=El.object({expected_duration_seconds:El.nullable(El.number().int()).optional(),cost:El.nullable(El.number()).optional(),cost_currency:El.nullable(El.string()).optional(),train_tokens_per_step:El.nullable(El.number().int()).optional(),train_tokens:El.nullable(El.number().int()).optional(),data_tokens:El.nullable(El.number().int()).optional(),estimated_start_time:El.nullable(El.number().int()).optional(),deprecated:El.boolean().default(!0),details:El.string(),epochs:El.nullable(El.number()).optional(),training_steps:El.nullable(El.number().int()).optional(),object:ha.LegacyJobMetadataOutObject$inboundSchema.default("job.metadata")}).transform(t=>(0,$Kt.remap)(t,{expected_duration_seconds:"expectedDurationSeconds",cost_currency:"costCurrency",train_tokens_per_step:"trainTokensPerStep",train_tokens:"trainTokens",data_tokens:"dataTokens",estimated_start_time:"estimatedStartTime",training_steps:"trainingSteps"}));ha.LegacyJobMetadataOut$outboundSchema=El.object({expectedDurationSeconds:El.nullable(El.number().int()).optional(),cost:El.nullable(El.number()).optional(),costCurrency:El.nullable(El.string()).optional(),trainTokensPerStep:El.nullable(El.number().int()).optional(),trainTokens:El.nullable(El.number().int()).optional(),dataTokens:El.nullable(El.number().int()).optional(),estimatedStartTime:El.nullable(El.number().int()).optional(),deprecated:El.boolean().default(!0),details:El.string(),epochs:El.nullable(El.number()).optional(),trainingSteps:El.nullable(El.number().int()).optional(),object:ha.LegacyJobMetadataOutObject$outboundSchema.default("job.metadata")}).transform(t=>(0,$Kt.remap)(t,{expectedDurationSeconds:"expected_duration_seconds",costCurrency:"cost_currency",trainTokensPerStep:"train_tokens_per_step",trainTokens:"train_tokens",dataTokens:"data_tokens",estimatedStartTime:"estimated_start_time",trainingSteps:"training_steps"}));var qKt;(function(t){t.inboundSchema=ha.LegacyJobMetadataOut$inboundSchema,t.outboundSchema=ha.LegacyJobMetadataOut$outboundSchema})(qKt||(ha.LegacyJobMetadataOut$=qKt={}));function vMl(t){return JSON.stringify(ha.LegacyJobMetadataOut$outboundSchema.parse(t))}function fMl(t){return(0,FMl.safeParse)(t,e=>ha.LegacyJobMetadataOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LegacyJobMetadataOut' from JSON")}});var l_t=f(ws=>{"use strict";var XMl=ws&&ws.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),wMl=ws&&ws.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),HMl=ws&&ws.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&XMl(e,t,n);return wMl(e,t),e};Object.defineProperty(ws,"__esModule",{value:!0});ws.LibraryIn$=ws.LibraryIn$outboundSchema=ws.LibraryIn$inboundSchema=void 0;ws.libraryInToJSON=EMl;ws.libraryInFromJSON=JMl;var qW=HMl(se()),n_t=be(),QMl=oe();ws.LibraryIn$inboundSchema=qW.object({name:qW.string(),description:qW.nullable(qW.string()).optional(),chunk_size:qW.nullable(qW.number().int()).optional()}).transform(t=>(0,n_t.remap)(t,{chunk_size:"chunkSize"}));ws.LibraryIn$outboundSchema=qW.object({name:qW.string(),description:qW.nullable(qW.string()).optional(),chunkSize:qW.nullable(qW.number().int()).optional()}).transform(t=>(0,n_t.remap)(t,{chunkSize:"chunk_size"}));var t_t;(function(t){t.inboundSchema=ws.LibraryIn$inboundSchema,t.outboundSchema=ws.LibraryIn$outboundSchema})(t_t||(ws.LibraryIn$=t_t={}));function EMl(t){return JSON.stringify(ws.LibraryIn$outboundSchema.parse(t))}function JMl(t){return(0,QMl.safeParse)(t,e=>ws.LibraryIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibraryIn' from JSON")}});var a_t=f(Hs=>{"use strict";var CMl=Hs&&Hs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),LMl=Hs&&Hs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kMl=Hs&&Hs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&CMl(e,t,n);return LMl(e,t),e};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.LibraryInUpdate$=Hs.LibraryInUpdate$outboundSchema=Hs.LibraryInUpdate$inboundSchema=void 0;Hs.libraryInUpdateToJSON=jMl;Hs.libraryInUpdateFromJSON=OMl;var WR=kMl(se()),xMl=oe();Hs.LibraryInUpdate$inboundSchema=WR.object({name:WR.nullable(WR.string()).optional(),description:WR.nullable(WR.string()).optional()});Hs.LibraryInUpdate$outboundSchema=WR.object({name:WR.nullable(WR.string()).optional(),description:WR.nullable(WR.string()).optional()});var I_t;(function(t){t.inboundSchema=Hs.LibraryInUpdate$inboundSchema,t.outboundSchema=Hs.LibraryInUpdate$outboundSchema})(I_t||(Hs.LibraryInUpdate$=I_t={}));function jMl(t){return JSON.stringify(Hs.LibraryInUpdate$outboundSchema.parse(t))}function OMl(t){return(0,xMl.safeParse)(t,e=>Hs.LibraryInUpdate$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibraryInUpdate' from JSON")}});var L9e=f(Qs=>{"use strict";var UMl=Qs&&Qs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),zMl=Qs&&Qs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BMl=Qs&&Qs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&UMl(e,t,n);return zMl(e,t),e};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LibraryOut$=Qs.LibraryOut$outboundSchema=Qs.LibraryOut$inboundSchema=void 0;Qs.libraryOutToJSON=MMl;Qs.libraryOutFromJSON=TMl;var wn=BMl(se()),c_t=be(),SMl=oe();Qs.LibraryOut$inboundSchema=wn.object({id:wn.string(),name:wn.string(),created_at:wn.string().datetime({offset:!0}).transform(t=>new Date(t)),updated_at:wn.string().datetime({offset:!0}).transform(t=>new Date(t)),owner_id:wn.string(),owner_type:wn.string(),total_size:wn.number().int(),nb_documents:wn.number().int(),chunk_size:wn.nullable(wn.number().int()),emoji:wn.nullable(wn.string()).optional(),description:wn.nullable(wn.string()).optional(),generated_name:wn.nullable(wn.string()).optional(),generated_description:wn.nullable(wn.string()).optional(),explicit_user_members_count:wn.nullable(wn.number().int()).optional(),explicit_workspace_members_count:wn.nullable(wn.number().int()).optional(),org_sharing_role:wn.nullable(wn.string()).optional()}).transform(t=>(0,c_t.remap)(t,{created_at:"createdAt",updated_at:"updatedAt",owner_id:"ownerId",owner_type:"ownerType",total_size:"totalSize",nb_documents:"nbDocuments",chunk_size:"chunkSize",generated_name:"generatedName",generated_description:"generatedDescription",explicit_user_members_count:"explicitUserMembersCount",explicit_workspace_members_count:"explicitWorkspaceMembersCount",org_sharing_role:"orgSharingRole"}));Qs.LibraryOut$outboundSchema=wn.object({id:wn.string(),name:wn.string(),createdAt:wn.date().transform(t=>t.toISOString()),updatedAt:wn.date().transform(t=>t.toISOString()),ownerId:wn.string(),ownerType:wn.string(),totalSize:wn.number().int(),nbDocuments:wn.number().int(),chunkSize:wn.nullable(wn.number().int()),emoji:wn.nullable(wn.string()).optional(),description:wn.nullable(wn.string()).optional(),generatedName:wn.nullable(wn.string()).optional(),generatedDescription:wn.nullable(wn.string()).optional(),explicitUserMembersCount:wn.nullable(wn.number().int()).optional(),explicitWorkspaceMembersCount:wn.nullable(wn.number().int()).optional(),orgSharingRole:wn.nullable(wn.string()).optional()}).transform(t=>(0,c_t.remap)(t,{createdAt:"created_at",updatedAt:"updated_at",ownerId:"owner_id",ownerType:"owner_type",totalSize:"total_size",nbDocuments:"nb_documents",chunkSize:"chunk_size",generatedName:"generated_name",generatedDescription:"generated_description",explicitUserMembersCount:"explicit_user_members_count",explicitWorkspaceMembersCount:"explicit_workspace_members_count",orgSharingRole:"org_sharing_role"}));var r_t;(function(t){t.inboundSchema=Qs.LibraryOut$inboundSchema,t.outboundSchema=Qs.LibraryOut$outboundSchema})(r_t||(Qs.LibraryOut$=r_t={}));function MMl(t){return JSON.stringify(Qs.LibraryOut$outboundSchema.parse(t))}function TMl(t){return(0,SMl.safeParse)(t,e=>Qs.LibraryOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibraryOut' from JSON")}});var k9e=f(Es=>{"use strict";var DMl=Es&&Es.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KMl=Es&&Es.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_Ml=Es&&Es.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DMl(e,t,n);return KMl(e,t),e};Object.defineProperty(Es,"__esModule",{value:!0});Es.PaginationInfo$=Es.PaginationInfo$outboundSchema=Es.PaginationInfo$inboundSchema=void 0;Es.paginationInfoToJSON=qMl;Es.paginationInfoFromJSON=$Ml;var $W=_Ml(se()),i_t=be(),PMl=oe();Es.PaginationInfo$inboundSchema=$W.object({total_items:$W.number().int(),total_pages:$W.number().int(),current_page:$W.number().int(),page_size:$W.number().int(),has_more:$W.boolean()}).transform(t=>(0,i_t.remap)(t,{total_items:"totalItems",total_pages:"totalPages",current_page:"currentPage",page_size:"pageSize",has_more:"hasMore"}));Es.PaginationInfo$outboundSchema=$W.object({totalItems:$W.number().int(),totalPages:$W.number().int(),currentPage:$W.number().int(),pageSize:$W.number().int(),hasMore:$W.boolean()}).transform(t=>(0,i_t.remap)(t,{totalItems:"total_items",totalPages:"total_pages",currentPage:"current_page",pageSize:"page_size",hasMore:"has_more"}));var o_t;(function(t){t.inboundSchema=Es.PaginationInfo$inboundSchema,t.outboundSchema=Es.PaginationInfo$outboundSchema})(o_t||(Es.PaginationInfo$=o_t={}));function qMl(t){return JSON.stringify(Es.PaginationInfo$outboundSchema.parse(t))}function $Ml(t){return(0,PMl.safeParse)(t,e=>Es.PaginationInfo$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'PaginationInfo' from JSON")}});var G_t=f(Js=>{"use strict";var eTl=Js&&Js.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),tTl=Js&&Js.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nTl=Js&&Js.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&eTl(e,t,n);return tTl(e,t),e};Object.defineProperty(Js,"__esModule",{value:!0});Js.ListDocumentOut$=Js.ListDocumentOut$outboundSchema=Js.ListDocumentOut$inboundSchema=void 0;Js.listDocumentOutToJSON=ITl;Js.listDocumentOutFromJSON=aTl;var fbe=nTl(se()),lTl=oe(),u_t=v9e(),d_t=k9e();Js.ListDocumentOut$inboundSchema=fbe.object({pagination:d_t.PaginationInfo$inboundSchema,data:fbe.array(u_t.DocumentOut$inboundSchema)});Js.ListDocumentOut$outboundSchema=fbe.object({pagination:d_t.PaginationInfo$outboundSchema,data:fbe.array(u_t.DocumentOut$outboundSchema)});var s_t;(function(t){t.inboundSchema=Js.ListDocumentOut$inboundSchema,t.outboundSchema=Js.ListDocumentOut$outboundSchema})(s_t||(Js.ListDocumentOut$=s_t={}));function ITl(t){return JSON.stringify(Js.ListDocumentOut$outboundSchema.parse(t))}function aTl(t){return(0,lTl.safeParse)(t,e=>Js.ListDocumentOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ListDocumentOut' from JSON")}});var p_t=f(Cs=>{"use strict";var rTl=Cs&&Cs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),cTl=Cs&&Cs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),oTl=Cs&&Cs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&rTl(e,t,n);return cTl(e,t),e};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.ListFilesOut$=Cs.ListFilesOut$outboundSchema=Cs.ListFilesOut$inboundSchema=void 0;Cs.listFilesOutToJSON=sTl;Cs.listFilesOutFromJSON=uTl;var cw=oTl(se()),iTl=oe(),m_t=w9e();Cs.ListFilesOut$inboundSchema=cw.object({data:cw.array(m_t.FileSchema$inboundSchema),object:cw.string(),total:cw.number().int()});Cs.ListFilesOut$outboundSchema=cw.object({data:cw.array(m_t.FileSchema$outboundSchema),object:cw.string(),total:cw.number().int()});var b_t;(function(t){t.inboundSchema=Cs.ListFilesOut$inboundSchema,t.outboundSchema=Cs.ListFilesOut$outboundSchema})(b_t||(Cs.ListFilesOut$=b_t={}));function sTl(t){return JSON.stringify(Cs.ListFilesOut$outboundSchema.parse(t))}function uTl(t){return(0,iTl.safeParse)(t,e=>Cs.ListFilesOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ListFilesOut' from JSON")}});var W_t=f(Ls=>{"use strict";var dTl=Ls&&Ls.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),GTl=Ls&&Ls.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bTl=Ls&&Ls.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&dTl(e,t,n);return GTl(e,t),e};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.ListLibraryOut$=Ls.ListLibraryOut$outboundSchema=Ls.ListLibraryOut$inboundSchema=void 0;Ls.listLibraryOutToJSON=pTl;Ls.listLibraryOutFromJSON=hTl;var Xbe=bTl(se()),mTl=oe(),Z_t=L9e();Ls.ListLibraryOut$inboundSchema=Xbe.object({data:Xbe.array(Z_t.LibraryOut$inboundSchema)});Ls.ListLibraryOut$outboundSchema=Xbe.object({data:Xbe.array(Z_t.LibraryOut$outboundSchema)});var h_t;(function(t){t.inboundSchema=Ls.ListLibraryOut$inboundSchema,t.outboundSchema=Ls.ListLibraryOut$outboundSchema})(h_t||(Ls.ListLibraryOut$=h_t={}));function pTl(t){return JSON.stringify(Ls.ListLibraryOut$outboundSchema.parse(t))}function hTl(t){return(0,mTl.safeParse)(t,e=>Ls.ListLibraryOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ListLibraryOut' from JSON")}});var x9e=f(ks=>{"use strict";var ZTl=ks&&ks.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),WTl=ks&&ks.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NTl=ks&&ks.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ZTl(e,t,n);return WTl(e,t),e};Object.defineProperty(ks,"__esModule",{value:!0});ks.SharingOut$=ks.SharingOut$outboundSchema=ks.SharingOut$inboundSchema=void 0;ks.sharingOutToJSON=YTl;ks.sharingOutFromJSON=gTl;var Cb=NTl(se()),V_t=be(),VTl=oe();ks.SharingOut$inboundSchema=Cb.object({library_id:Cb.string(),user_id:Cb.nullable(Cb.string()).optional(),org_id:Cb.string(),role:Cb.string(),share_with_type:Cb.string(),share_with_uuid:Cb.string()}).transform(t=>(0,V_t.remap)(t,{library_id:"libraryId",user_id:"userId",org_id:"orgId",share_with_type:"shareWithType",share_with_uuid:"shareWithUuid"}));ks.SharingOut$outboundSchema=Cb.object({libraryId:Cb.string(),userId:Cb.nullable(Cb.string()).optional(),orgId:Cb.string(),role:Cb.string(),shareWithType:Cb.string(),shareWithUuid:Cb.string()}).transform(t=>(0,V_t.remap)(t,{libraryId:"library_id",userId:"user_id",orgId:"org_id",shareWithType:"share_with_type",shareWithUuid:"share_with_uuid"}));var N_t;(function(t){t.inboundSchema=ks.SharingOut$inboundSchema,t.outboundSchema=ks.SharingOut$outboundSchema})(N_t||(ks.SharingOut$=N_t={}));function YTl(t){return JSON.stringify(ks.SharingOut$outboundSchema.parse(t))}function gTl(t){return(0,VTl.safeParse)(t,e=>ks.SharingOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'SharingOut' from JSON")}});var R_t=f(xs=>{"use strict";var RTl=xs&&xs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),yTl=xs&&xs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ATl=xs&&xs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&RTl(e,t,n);return yTl(e,t),e};Object.defineProperty(xs,"__esModule",{value:!0});xs.ListSharingOut$=xs.ListSharingOut$outboundSchema=xs.ListSharingOut$inboundSchema=void 0;xs.listSharingOutToJSON=vTl;xs.listSharingOutFromJSON=fTl;var wbe=ATl(se()),FTl=oe(),g_t=x9e();xs.ListSharingOut$inboundSchema=wbe.object({data:wbe.array(g_t.SharingOut$inboundSchema)});xs.ListSharingOut$outboundSchema=wbe.object({data:wbe.array(g_t.SharingOut$outboundSchema)});var Y_t;(function(t){t.inboundSchema=xs.ListSharingOut$inboundSchema,t.outboundSchema=xs.ListSharingOut$outboundSchema})(Y_t||(xs.ListSharingOut$=Y_t={}));function vTl(t){return JSON.stringify(xs.ListSharingOut$outboundSchema.parse(t))}function fTl(t){return(0,FTl.safeParse)(t,e=>xs.ListSharingOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ListSharingOut' from JSON")}});var w_t=f(Zl=>{"use strict";var XTl=Zl&&Zl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),wTl=Zl&&Zl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),HTl=Zl&&Zl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&XTl(e,t,n);return wTl(e,t),e};Object.defineProperty(Zl,"__esModule",{value:!0});Zl.ModelConversation$=Zl.ModelConversation$outboundSchema=Zl.ModelConversation$inboundSchema=Zl.ModelConversationObject$=Zl.ModelConversationObject$outboundSchema=Zl.ModelConversationObject$inboundSchema=Zl.ModelConversationTools$=Zl.ModelConversationTools$outboundSchema=Zl.ModelConversationTools$inboundSchema=Zl.ModelConversationObject=void 0;Zl.modelConversationToolsToJSON=QTl;Zl.modelConversationToolsFromJSON=ETl;Zl.modelConversationToJSON=JTl;Zl.modelConversationFromJSON=CTl;var Gt=HTl(se()),v_t=be(),f_t=oe(),Hbe=MX(),X_t=jW(),Qbe=KX(),Ebe=_X(),Jbe=PX(),Cbe=qX(),Lbe=$X();Zl.ModelConversationObject={Conversation:"conversation"};Zl.ModelConversationTools$inboundSchema=Gt.union([Hbe.CodeInterpreterTool$inboundSchema.and(Gt.object({type:Gt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Jbe.ImageGenerationTool$inboundSchema.and(Gt.object({type:Gt.literal("image_generation")}).transform(t=>({type:t.type}))),Lbe.WebSearchTool$inboundSchema.and(Gt.object({type:Gt.literal("web_search")}).transform(t=>({type:t.type}))),Cbe.WebSearchPremiumTool$inboundSchema.and(Gt.object({type:Gt.literal("web_search_premium")}).transform(t=>({type:t.type}))),Qbe.DocumentLibraryTool$inboundSchema.and(Gt.object({type:Gt.literal("document_library")}).transform(t=>({type:t.type}))),Ebe.FunctionTool$inboundSchema.and(Gt.object({type:Gt.literal("function")}).transform(t=>({type:t.type})))]);Zl.ModelConversationTools$outboundSchema=Gt.union([Hbe.CodeInterpreterTool$outboundSchema.and(Gt.object({type:Gt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Jbe.ImageGenerationTool$outboundSchema.and(Gt.object({type:Gt.literal("image_generation")}).transform(t=>({type:t.type}))),Lbe.WebSearchTool$outboundSchema.and(Gt.object({type:Gt.literal("web_search")}).transform(t=>({type:t.type}))),Cbe.WebSearchPremiumTool$outboundSchema.and(Gt.object({type:Gt.literal("web_search_premium")}).transform(t=>({type:t.type}))),Qbe.DocumentLibraryTool$outboundSchema.and(Gt.object({type:Gt.literal("document_library")}).transform(t=>({type:t.type}))),Ebe.FunctionTool$outboundSchema.and(Gt.object({type:Gt.literal("function")}).transform(t=>({type:t.type})))]);var y_t;(function(t){t.inboundSchema=Zl.ModelConversationTools$inboundSchema,t.outboundSchema=Zl.ModelConversationTools$outboundSchema})(y_t||(Zl.ModelConversationTools$=y_t={}));function QTl(t){return JSON.stringify(Zl.ModelConversationTools$outboundSchema.parse(t))}function ETl(t){return(0,f_t.safeParse)(t,e=>Zl.ModelConversationTools$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ModelConversationTools' from JSON")}Zl.ModelConversationObject$inboundSchema=Gt.nativeEnum(Zl.ModelConversationObject);Zl.ModelConversationObject$outboundSchema=Zl.ModelConversationObject$inboundSchema;var A_t;(function(t){t.inboundSchema=Zl.ModelConversationObject$inboundSchema,t.outboundSchema=Zl.ModelConversationObject$outboundSchema})(A_t||(Zl.ModelConversationObject$=A_t={}));Zl.ModelConversation$inboundSchema=Gt.object({instructions:Gt.nullable(Gt.string()).optional(),tools:Gt.array(Gt.union([Hbe.CodeInterpreterTool$inboundSchema.and(Gt.object({type:Gt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Jbe.ImageGenerationTool$inboundSchema.and(Gt.object({type:Gt.literal("image_generation")}).transform(t=>({type:t.type}))),Lbe.WebSearchTool$inboundSchema.and(Gt.object({type:Gt.literal("web_search")}).transform(t=>({type:t.type}))),Cbe.WebSearchPremiumTool$inboundSchema.and(Gt.object({type:Gt.literal("web_search_premium")}).transform(t=>({type:t.type}))),Qbe.DocumentLibraryTool$inboundSchema.and(Gt.object({type:Gt.literal("document_library")}).transform(t=>({type:t.type}))),Ebe.FunctionTool$inboundSchema.and(Gt.object({type:Gt.literal("function")}).transform(t=>({type:t.type})))])).optional(),completion_args:X_t.CompletionArgs$inboundSchema.optional(),name:Gt.nullable(Gt.string()).optional(),description:Gt.nullable(Gt.string()).optional(),object:Zl.ModelConversationObject$inboundSchema.default("conversation"),id:Gt.string(),created_at:Gt.string().datetime({offset:!0}).transform(t=>new Date(t)),updated_at:Gt.string().datetime({offset:!0}).transform(t=>new Date(t)),model:Gt.string()}).transform(t=>(0,v_t.remap)(t,{completion_args:"completionArgs",created_at:"createdAt",updated_at:"updatedAt"}));Zl.ModelConversation$outboundSchema=Gt.object({instructions:Gt.nullable(Gt.string()).optional(),tools:Gt.array(Gt.union([Hbe.CodeInterpreterTool$outboundSchema.and(Gt.object({type:Gt.literal("code_interpreter")}).transform(t=>({type:t.type}))),Jbe.ImageGenerationTool$outboundSchema.and(Gt.object({type:Gt.literal("image_generation")}).transform(t=>({type:t.type}))),Lbe.WebSearchTool$outboundSchema.and(Gt.object({type:Gt.literal("web_search")}).transform(t=>({type:t.type}))),Cbe.WebSearchPremiumTool$outboundSchema.and(Gt.object({type:Gt.literal("web_search_premium")}).transform(t=>({type:t.type}))),Qbe.DocumentLibraryTool$outboundSchema.and(Gt.object({type:Gt.literal("document_library")}).transform(t=>({type:t.type}))),Ebe.FunctionTool$outboundSchema.and(Gt.object({type:Gt.literal("function")}).transform(t=>({type:t.type})))])).optional(),completionArgs:X_t.CompletionArgs$outboundSchema.optional(),name:Gt.nullable(Gt.string()).optional(),description:Gt.nullable(Gt.string()).optional(),object:Zl.ModelConversationObject$outboundSchema.default("conversation"),id:Gt.string(),createdAt:Gt.date().transform(t=>t.toISOString()),updatedAt:Gt.date().transform(t=>t.toISOString()),model:Gt.string()}).transform(t=>(0,v_t.remap)(t,{completionArgs:"completion_args",createdAt:"created_at",updatedAt:"updated_at"}));var F_t;(function(t){t.inboundSchema=Zl.ModelConversation$inboundSchema,t.outboundSchema=Zl.ModelConversation$outboundSchema})(F_t||(Zl.ModelConversation$=F_t={}));function JTl(t){return JSON.stringify(Zl.ModelConversation$outboundSchema.parse(t))}function CTl(t){return(0,f_t.safeParse)(t,e=>Zl.ModelConversation$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ModelConversation' from JSON")}});var J_t=f(tr=>{"use strict";var LTl=tr&&tr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),kTl=tr&&tr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xTl=tr&&tr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&<l(e,t,n);return kTl(e,t),e};Object.defineProperty(tr,"__esModule",{value:!0});tr.ModelList$=tr.ModelList$outboundSchema=tr.ModelList$inboundSchema=tr.Data$=tr.Data$outboundSchema=tr.Data$inboundSchema=void 0;tr.dataToJSON=jTl;tr.dataFromJSON=OTl;tr.modelListToJSON=UTl;tr.modelListFromJSON=zTl;var Nc=xTl(se()),E_t=oe(),kbe=DUe(),xbe=Q9e();tr.Data$inboundSchema=Nc.union([kbe.BaseModelCard$inboundSchema.and(Nc.object({type:Nc.literal("base")}).transform(t=>({type:t.type}))),xbe.FTModelCard$inboundSchema.and(Nc.object({type:Nc.literal("fine-tuned")}).transform(t=>({type:t.type})))]);tr.Data$outboundSchema=Nc.union([kbe.BaseModelCard$outboundSchema.and(Nc.object({type:Nc.literal("base")}).transform(t=>({type:t.type}))),xbe.FTModelCard$outboundSchema.and(Nc.object({type:Nc.literal("fine-tuned")}).transform(t=>({type:t.type})))]);var H_t;(function(t){t.inboundSchema=tr.Data$inboundSchema,t.outboundSchema=tr.Data$outboundSchema})(H_t||(tr.Data$=H_t={}));function jTl(t){return JSON.stringify(tr.Data$outboundSchema.parse(t))}function OTl(t){return(0,E_t.safeParse)(t,e=>tr.Data$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Data' from JSON")}tr.ModelList$inboundSchema=Nc.object({object:Nc.string().default("list"),data:Nc.array(Nc.union([kbe.BaseModelCard$inboundSchema.and(Nc.object({type:Nc.literal("base")}).transform(t=>({type:t.type}))),xbe.FTModelCard$inboundSchema.and(Nc.object({type:Nc.literal("fine-tuned")}).transform(t=>({type:t.type})))])).optional()});tr.ModelList$outboundSchema=Nc.object({object:Nc.string().default("list"),data:Nc.array(Nc.union([kbe.BaseModelCard$outboundSchema.and(Nc.object({type:Nc.literal("base")}).transform(t=>({type:t.type}))),xbe.FTModelCard$outboundSchema.and(Nc.object({type:Nc.literal("fine-tuned")}).transform(t=>({type:t.type})))])).optional()});var Q_t;(function(t){t.inboundSchema=tr.ModelList$inboundSchema,t.outboundSchema=tr.ModelList$outboundSchema})(Q_t||(tr.ModelList$=Q_t={}));function UTl(t){return JSON.stringify(tr.ModelList$outboundSchema.parse(t))}function zTl(t){return(0,E_t.safeParse)(t,e=>tr.ModelList$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ModelList' from JSON")}});var j9e=f(js=>{"use strict";var BTl=js&&js.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),STl=js&&js.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MTl=js&&js.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&BTl(e,t,n);return STl(e,t),e};Object.defineProperty(js,"__esModule",{value:!0});js.ModerationObject$=js.ModerationObject$outboundSchema=js.ModerationObject$inboundSchema=void 0;js.moderationObjectToJSON=DTl;js.moderationObjectFromJSON=KTl;var NR=MTl(se()),L_t=be(),TTl=oe();js.ModerationObject$inboundSchema=NR.object({categories:NR.record(NR.boolean()).optional(),category_scores:NR.record(NR.number()).optional()}).transform(t=>(0,L_t.remap)(t,{category_scores:"categoryScores"}));js.ModerationObject$outboundSchema=NR.object({categories:NR.record(NR.boolean()).optional(),categoryScores:NR.record(NR.number()).optional()}).transform(t=>(0,L_t.remap)(t,{categoryScores:"category_scores"}));var C_t;(function(t){t.inboundSchema=js.ModerationObject$inboundSchema,t.outboundSchema=js.ModerationObject$outboundSchema})(C_t||(js.ModerationObject$=C_t={}));function DTl(t){return JSON.stringify(js.ModerationObject$outboundSchema.parse(t))}function KTl(t){return(0,TTl.safeParse)(t,e=>js.ModerationObject$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ModerationObject' from JSON")}});var j_t=f(Os=>{"use strict";var _Tl=Os&&Os.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),PTl=Os&&Os.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qTl=Os&&Os.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_Tl(e,t,n);return PTl(e,t),e};Object.defineProperty(Os,"__esModule",{value:!0});Os.ModerationResponse$=Os.ModerationResponse$outboundSchema=Os.ModerationResponse$inboundSchema=void 0;Os.moderationResponseToJSON=eDl;Os.moderationResponseFromJSON=tDl;var ow=qTl(se()),$Tl=oe(),x_t=j9e();Os.ModerationResponse$inboundSchema=ow.object({id:ow.string(),model:ow.string(),results:ow.array(x_t.ModerationObject$inboundSchema)});Os.ModerationResponse$outboundSchema=ow.object({id:ow.string(),model:ow.string(),results:ow.array(x_t.ModerationObject$outboundSchema)});var k_t;(function(t){t.inboundSchema=Os.ModerationResponse$inboundSchema,t.outboundSchema=Os.ModerationResponse$outboundSchema})(k_t||(Os.ModerationResponse$=k_t={}));function eDl(t){return JSON.stringify(Os.ModerationResponse$outboundSchema.parse(t))}function tDl(t){return(0,$Tl.safeParse)(t,e=>Os.ModerationResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ModerationResponse' from JSON")}});var O9e=f(Us=>{"use strict";var nDl=Us&&Us.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),lDl=Us&&Us.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IDl=Us&&Us.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&nDl(e,t,n);return lDl(e,t),e};Object.defineProperty(Us,"__esModule",{value:!0});Us.OCRImageObject$=Us.OCRImageObject$outboundSchema=Us.OCRImageObject$inboundSchema=void 0;Us.ocrImageObjectToJSON=rDl;Us.ocrImageObjectFromJSON=cDl;var Tr=IDl(se()),U_t=be(),aDl=oe();Us.OCRImageObject$inboundSchema=Tr.object({id:Tr.string(),top_left_x:Tr.nullable(Tr.number().int()),top_left_y:Tr.nullable(Tr.number().int()),bottom_right_x:Tr.nullable(Tr.number().int()),bottom_right_y:Tr.nullable(Tr.number().int()),image_base64:Tr.nullable(Tr.string()).optional(),image_annotation:Tr.nullable(Tr.string()).optional()}).transform(t=>(0,U_t.remap)(t,{top_left_x:"topLeftX",top_left_y:"topLeftY",bottom_right_x:"bottomRightX",bottom_right_y:"bottomRightY",image_base64:"imageBase64",image_annotation:"imageAnnotation"}));Us.OCRImageObject$outboundSchema=Tr.object({id:Tr.string(),topLeftX:Tr.nullable(Tr.number().int()),topLeftY:Tr.nullable(Tr.number().int()),bottomRightX:Tr.nullable(Tr.number().int()),bottomRightY:Tr.nullable(Tr.number().int()),imageBase64:Tr.nullable(Tr.string()).optional(),imageAnnotation:Tr.nullable(Tr.string()).optional()}).transform(t=>(0,U_t.remap)(t,{topLeftX:"top_left_x",topLeftY:"top_left_y",bottomRightX:"bottom_right_x",bottomRightY:"bottom_right_y",imageBase64:"image_base64",imageAnnotation:"image_annotation"}));var O_t;(function(t){t.inboundSchema=Us.OCRImageObject$inboundSchema,t.outboundSchema=Us.OCRImageObject$outboundSchema})(O_t||(Us.OCRImageObject$=O_t={}));function rDl(t){return JSON.stringify(Us.OCRImageObject$outboundSchema.parse(t))}function cDl(t){return(0,aDl.safeParse)(t,e=>Us.OCRImageObject$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'OCRImageObject' from JSON")}});var U9e=f(zs=>{"use strict";var oDl=zs&&zs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),iDl=zs&&zs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sDl=zs&&zs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&oDl(e,t,n);return iDl(e,t),e};Object.defineProperty(zs,"__esModule",{value:!0});zs.OCRPageDimensions$=zs.OCRPageDimensions$outboundSchema=zs.OCRPageDimensions$inboundSchema=void 0;zs.ocrPageDimensionsToJSON=dDl;zs.ocrPageDimensionsFromJSON=GDl;var iw=sDl(se()),uDl=oe();zs.OCRPageDimensions$inboundSchema=iw.object({dpi:iw.number().int(),height:iw.number().int(),width:iw.number().int()});zs.OCRPageDimensions$outboundSchema=iw.object({dpi:iw.number().int(),height:iw.number().int(),width:iw.number().int()});var z_t;(function(t){t.inboundSchema=zs.OCRPageDimensions$inboundSchema,t.outboundSchema=zs.OCRPageDimensions$outboundSchema})(z_t||(zs.OCRPageDimensions$=z_t={}));function dDl(t){return JSON.stringify(zs.OCRPageDimensions$outboundSchema.parse(t))}function GDl(t){return(0,uDl.safeParse)(t,e=>zs.OCRPageDimensions$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'OCRPageDimensions' from JSON")}});var z9e=f(Bs=>{"use strict";var bDl=Bs&&Bs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),mDl=Bs&&Bs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pDl=Bs&&Bs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&bDl(e,t,n);return mDl(e,t),e};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.OCRPageObject$=Bs.OCRPageObject$outboundSchema=Bs.OCRPageObject$inboundSchema=void 0;Bs.ocrPageObjectToJSON=ZDl;Bs.ocrPageObjectFromJSON=WDl;var VR=pDl(se()),hDl=oe(),S_t=O9e(),M_t=U9e();Bs.OCRPageObject$inboundSchema=VR.object({index:VR.number().int(),markdown:VR.string(),images:VR.array(S_t.OCRImageObject$inboundSchema),dimensions:VR.nullable(M_t.OCRPageDimensions$inboundSchema)});Bs.OCRPageObject$outboundSchema=VR.object({index:VR.number().int(),markdown:VR.string(),images:VR.array(S_t.OCRImageObject$outboundSchema),dimensions:VR.nullable(M_t.OCRPageDimensions$outboundSchema)});var B_t;(function(t){t.inboundSchema=Bs.OCRPageObject$inboundSchema,t.outboundSchema=Bs.OCRPageObject$outboundSchema})(B_t||(Bs.OCRPageObject$=B_t={}));function ZDl(t){return JSON.stringify(Bs.OCRPageObject$outboundSchema.parse(t))}function WDl(t){return(0,hDl.safeParse)(t,e=>Bs.OCRPageObject$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'OCRPageObject' from JSON")}});var P_t=f(nr=>{"use strict";var NDl=nr&&nr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),VDl=nr&&nr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),YDl=nr&&nr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&NDl(e,t,n);return VDl(e,t),e};Object.defineProperty(nr,"__esModule",{value:!0});nr.OCRRequest$=nr.OCRRequest$outboundSchema=nr.OCRRequest$inboundSchema=nr.Document$=nr.Document$outboundSchema=nr.Document$inboundSchema=void 0;nr.documentToJSON=gDl;nr.documentFromJSON=RDl;nr.ocrRequestToJSON=yDl;nr.ocrRequestFromJSON=ADl;var Za=YDl(se()),K_t=be(),__t=oe(),Obe=nJ(),Ube=Nde(),zbe=lJ(),jbe=DX();nr.Document$inboundSchema=Za.union([Ube.FileChunk$inboundSchema,zbe.ImageURLChunk$inboundSchema,Obe.DocumentURLChunk$inboundSchema]);nr.Document$outboundSchema=Za.union([Ube.FileChunk$outboundSchema,zbe.ImageURLChunk$outboundSchema,Obe.DocumentURLChunk$outboundSchema]);var T_t;(function(t){t.inboundSchema=nr.Document$inboundSchema,t.outboundSchema=nr.Document$outboundSchema})(T_t||(nr.Document$=T_t={}));function gDl(t){return JSON.stringify(nr.Document$outboundSchema.parse(t))}function RDl(t){return(0,__t.safeParse)(t,e=>nr.Document$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Document' from JSON")}nr.OCRRequest$inboundSchema=Za.object({model:Za.nullable(Za.string()),id:Za.string().optional(),document:Za.union([Ube.FileChunk$inboundSchema,zbe.ImageURLChunk$inboundSchema,Obe.DocumentURLChunk$inboundSchema]),pages:Za.nullable(Za.array(Za.number().int())).optional(),include_image_base64:Za.nullable(Za.boolean()).optional(),image_limit:Za.nullable(Za.number().int()).optional(),image_min_size:Za.nullable(Za.number().int()).optional(),bbox_annotation_format:Za.nullable(jbe.ResponseFormat$inboundSchema).optional(),document_annotation_format:Za.nullable(jbe.ResponseFormat$inboundSchema).optional()}).transform(t=>(0,K_t.remap)(t,{include_image_base64:"includeImageBase64",image_limit:"imageLimit",image_min_size:"imageMinSize",bbox_annotation_format:"bboxAnnotationFormat",document_annotation_format:"documentAnnotationFormat"}));nr.OCRRequest$outboundSchema=Za.object({model:Za.nullable(Za.string()),id:Za.string().optional(),document:Za.union([Ube.FileChunk$outboundSchema,zbe.ImageURLChunk$outboundSchema,Obe.DocumentURLChunk$outboundSchema]),pages:Za.nullable(Za.array(Za.number().int())).optional(),includeImageBase64:Za.nullable(Za.boolean()).optional(),imageLimit:Za.nullable(Za.number().int()).optional(),imageMinSize:Za.nullable(Za.number().int()).optional(),bboxAnnotationFormat:Za.nullable(jbe.ResponseFormat$outboundSchema).optional(),documentAnnotationFormat:Za.nullable(jbe.ResponseFormat$outboundSchema).optional()}).transform(t=>(0,K_t.remap)(t,{includeImageBase64:"include_image_base64",imageLimit:"image_limit",imageMinSize:"image_min_size",bboxAnnotationFormat:"bbox_annotation_format",documentAnnotationFormat:"document_annotation_format"}));var D_t;(function(t){t.inboundSchema=nr.OCRRequest$inboundSchema,t.outboundSchema=nr.OCRRequest$outboundSchema})(D_t||(nr.OCRRequest$=D_t={}));function yDl(t){return JSON.stringify(nr.OCRRequest$outboundSchema.parse(t))}function ADl(t){return(0,__t.safeParse)(t,e=>nr.OCRRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'OCRRequest' from JSON")}});var B9e=f(Ss=>{"use strict";var FDl=Ss&&Ss.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),vDl=Ss&&Ss.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fDl=Ss&&Ss.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&FDl(e,t,n);return vDl(e,t),e};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.OCRUsageInfo$=Ss.OCRUsageInfo$outboundSchema=Ss.OCRUsageInfo$inboundSchema=void 0;Ss.ocrUsageInfoToJSON=wDl;Ss.ocrUsageInfoFromJSON=HDl;var sw=fDl(se()),$_t=be(),XDl=oe();Ss.OCRUsageInfo$inboundSchema=sw.object({pages_processed:sw.number().int(),doc_size_bytes:sw.nullable(sw.number().int()).optional()}).transform(t=>(0,$_t.remap)(t,{pages_processed:"pagesProcessed",doc_size_bytes:"docSizeBytes"}));Ss.OCRUsageInfo$outboundSchema=sw.object({pagesProcessed:sw.number().int(),docSizeBytes:sw.nullable(sw.number().int()).optional()}).transform(t=>(0,$_t.remap)(t,{pagesProcessed:"pages_processed",docSizeBytes:"doc_size_bytes"}));var q_t;(function(t){t.inboundSchema=Ss.OCRUsageInfo$inboundSchema,t.outboundSchema=Ss.OCRUsageInfo$outboundSchema})(q_t||(Ss.OCRUsageInfo$=q_t={}));function wDl(t){return JSON.stringify(Ss.OCRUsageInfo$outboundSchema.parse(t))}function HDl(t){return(0,XDl.safeParse)(t,e=>Ss.OCRUsageInfo$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'OCRUsageInfo' from JSON")}});var IPt=f(Ms=>{"use strict";var QDl=Ms&&Ms.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),EDl=Ms&&Ms.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),JDl=Ms&&Ms.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&QDl(e,t,n);return EDl(e,t),e};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.OCRResponse$=Ms.OCRResponse$outboundSchema=Ms.OCRResponse$inboundSchema=void 0;Ms.ocrResponseToJSON=LDl;Ms.ocrResponseFromJSON=kDl;var YR=JDl(se()),tPt=be(),CDl=oe(),nPt=z9e(),lPt=B9e();Ms.OCRResponse$inboundSchema=YR.object({pages:YR.array(nPt.OCRPageObject$inboundSchema),model:YR.string(),document_annotation:YR.nullable(YR.string()).optional(),usage_info:lPt.OCRUsageInfo$inboundSchema}).transform(t=>(0,tPt.remap)(t,{document_annotation:"documentAnnotation",usage_info:"usageInfo"}));Ms.OCRResponse$outboundSchema=YR.object({pages:YR.array(nPt.OCRPageObject$outboundSchema),model:YR.string(),documentAnnotation:YR.nullable(YR.string()).optional(),usageInfo:lPt.OCRUsageInfo$outboundSchema}).transform(t=>(0,tPt.remap)(t,{documentAnnotation:"document_annotation",usageInfo:"usage_info"}));var ePt;(function(t){t.inboundSchema=Ms.OCRResponse$inboundSchema,t.outboundSchema=Ms.OCRResponse$outboundSchema})(ePt||(Ms.OCRResponse$=ePt={}));function LDl(t){return JSON.stringify(Ms.OCRResponse$outboundSchema.parse(t))}function kDl(t){return(0,CDl.safeParse)(t,e=>Ms.OCRResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'OCRResponse' from JSON")}});var cPt=f(Ts=>{"use strict";var xDl=Ts&&Ts.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jDl=Ts&&Ts.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ODl=Ts&&Ts.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xDl(e,t,n);return jDl(e,t),e};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.ProcessingStatusOut$=Ts.ProcessingStatusOut$outboundSchema=Ts.ProcessingStatusOut$inboundSchema=void 0;Ts.processingStatusOutToJSON=zDl;Ts.processingStatusOutFromJSON=BDl;var nO=ODl(se()),rPt=be(),UDl=oe();Ts.ProcessingStatusOut$inboundSchema=nO.object({document_id:nO.string(),processing_status:nO.string()}).transform(t=>(0,rPt.remap)(t,{document_id:"documentId",processing_status:"processingStatus"}));Ts.ProcessingStatusOut$outboundSchema=nO.object({documentId:nO.string(),processingStatus:nO.string()}).transform(t=>(0,rPt.remap)(t,{documentId:"document_id",processingStatus:"processing_status"}));var aPt;(function(t){t.inboundSchema=Ts.ProcessingStatusOut$inboundSchema,t.outboundSchema=Ts.ProcessingStatusOut$outboundSchema})(aPt||(Ts.ProcessingStatusOut$=aPt={}));function zDl(t){return JSON.stringify(Ts.ProcessingStatusOut$outboundSchema.parse(t))}function BDl(t){return(0,UDl.safeParse)(t,e=>Ts.ProcessingStatusOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ProcessingStatusOut' from JSON")}});var GPt=f(Ds=>{"use strict";var SDl=Ds&&Ds.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),MDl=Ds&&Ds.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TDl=Ds&&Ds.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&SDl(e,t,n);return MDl(e,t),e};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.RetrieveFileOut$=Ds.RetrieveFileOut$outboundSchema=Ds.RetrieveFileOut$inboundSchema=void 0;Ds.retrieveFileOutToJSON=KDl;Ds.retrieveFileOutFromJSON=_Dl;var Ld=TDl(se()),iPt=be(),DDl=oe(),sPt=p_(),uPt=h_(),dPt=Z_();Ds.RetrieveFileOut$inboundSchema=Ld.object({id:Ld.string(),object:Ld.string(),bytes:Ld.number().int(),created_at:Ld.number().int(),filename:Ld.string(),purpose:sPt.FilePurpose$inboundSchema,sample_type:uPt.SampleType$inboundSchema,num_lines:Ld.nullable(Ld.number().int()).optional(),source:dPt.Source$inboundSchema,deleted:Ld.boolean()}).transform(t=>(0,iPt.remap)(t,{bytes:"sizeBytes",created_at:"createdAt",sample_type:"sampleType",num_lines:"numLines"}));Ds.RetrieveFileOut$outboundSchema=Ld.object({id:Ld.string(),object:Ld.string(),sizeBytes:Ld.number().int(),createdAt:Ld.number().int(),filename:Ld.string(),purpose:sPt.FilePurpose$outboundSchema,sampleType:uPt.SampleType$outboundSchema,numLines:Ld.nullable(Ld.number().int()).optional(),source:dPt.Source$outboundSchema,deleted:Ld.boolean()}).transform(t=>(0,iPt.remap)(t,{sizeBytes:"bytes",createdAt:"created_at",sampleType:"sample_type",numLines:"num_lines"}));var oPt;(function(t){t.inboundSchema=Ds.RetrieveFileOut$inboundSchema,t.outboundSchema=Ds.RetrieveFileOut$outboundSchema})(oPt||(Ds.RetrieveFileOut$=oPt={}));function KDl(t){return JSON.stringify(Ds.RetrieveFileOut$outboundSchema.parse(t))}function _Dl(t){return(0,DDl.safeParse)(t,e=>Ds.RetrieveFileOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'RetrieveFileOut' from JSON")}});var pPt=f(Ks=>{"use strict";var PDl=Ks&&Ks.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),qDl=Ks&&Ks.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$Dl=Ks&&Ks.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&PDl(e,t,n);return qDl(e,t),e};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.Security$=Ks.Security$outboundSchema=Ks.Security$inboundSchema=void 0;Ks.securityToJSON=tKl;Ks.securityFromJSON=nKl;var Bbe=$Dl(se()),mPt=be(),eKl=oe();Ks.Security$inboundSchema=Bbe.object({ApiKey:Bbe.string().optional()}).transform(t=>(0,mPt.remap)(t,{ApiKey:"apiKey"}));Ks.Security$outboundSchema=Bbe.object({apiKey:Bbe.string().optional()}).transform(t=>(0,mPt.remap)(t,{apiKey:"ApiKey"}));var bPt;(function(t){t.inboundSchema=Ks.Security$inboundSchema,t.outboundSchema=Ks.Security$outboundSchema})(bPt||(Ks.Security$=bPt={}));function tKl(t){return JSON.stringify(Ks.Security$outboundSchema.parse(t))}function nKl(t){return(0,eKl.safeParse)(t,e=>Ks.Security$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Security' from JSON")}});var S9e=f(_s=>{"use strict";var lKl=_s&&_s.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),IKl=_s&&_s.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aKl=_s&&_s.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&lKl(e,t,n);return IKl(e,t),e};Object.defineProperty(_s,"__esModule",{value:!0});_s.ShareEnum$=_s.ShareEnum$outboundSchema=_s.ShareEnum$inboundSchema=_s.ShareEnum=void 0;var WJ=aKl(se()),rKl=BV();_s.ShareEnum={Viewer:"Viewer",Editor:"Editor"};_s.ShareEnum$inboundSchema=WJ.union([WJ.nativeEnum(_s.ShareEnum),WJ.string().transform(rKl.catchUnrecognizedEnum)]);_s.ShareEnum$outboundSchema=WJ.union([WJ.nativeEnum(_s.ShareEnum),WJ.string().and(WJ.custom())]);var hPt;(function(t){t.inboundSchema=_s.ShareEnum$inboundSchema,t.outboundSchema=_s.ShareEnum$outboundSchema})(hPt||(_s.ShareEnum$=hPt={}))});var VPt=f(Ps=>{"use strict";var cKl=Ps&&Ps.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),oKl=Ps&&Ps.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iKl=Ps&&Ps.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&cKl(e,t,n);return oKl(e,t),e};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.SharingDelete$=Ps.SharingDelete$outboundSchema=Ps.SharingDelete$inboundSchema=void 0;Ps.sharingDeleteToJSON=uKl;Ps.sharingDeleteFromJSON=dKl;var lO=iKl(se()),WPt=be(),sKl=oe(),NPt=Nbe();Ps.SharingDelete$inboundSchema=lO.object({org_id:lO.string(),share_with_uuid:lO.string(),share_with_type:NPt.EntityType$inboundSchema}).transform(t=>(0,WPt.remap)(t,{org_id:"orgId",share_with_uuid:"shareWithUuid",share_with_type:"shareWithType"}));Ps.SharingDelete$outboundSchema=lO.object({orgId:lO.string(),shareWithUuid:lO.string(),shareWithType:NPt.EntityType$outboundSchema}).transform(t=>(0,WPt.remap)(t,{orgId:"org_id",shareWithUuid:"share_with_uuid",shareWithType:"share_with_type"}));var ZPt;(function(t){t.inboundSchema=Ps.SharingDelete$inboundSchema,t.outboundSchema=Ps.SharingDelete$outboundSchema})(ZPt||(Ps.SharingDelete$=ZPt={}));function uKl(t){return JSON.stringify(Ps.SharingDelete$outboundSchema.parse(t))}function dKl(t){return(0,sKl.safeParse)(t,e=>Ps.SharingDelete$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'SharingDelete' from JSON")}});var APt=f(qs=>{"use strict";var GKl=qs&&qs.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),bKl=qs&&qs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mKl=qs&&qs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&GKl(e,t,n);return bKl(e,t),e};Object.defineProperty(qs,"__esModule",{value:!0});qs.SharingIn$=qs.SharingIn$outboundSchema=qs.SharingIn$inboundSchema=void 0;qs.sharingInToJSON=hKl;qs.sharingInFromJSON=ZKl;var IO=mKl(se()),gPt=be(),pKl=oe(),RPt=Nbe(),yPt=S9e();qs.SharingIn$inboundSchema=IO.object({org_id:IO.string(),level:yPt.ShareEnum$inboundSchema,share_with_uuid:IO.string(),share_with_type:RPt.EntityType$inboundSchema}).transform(t=>(0,gPt.remap)(t,{org_id:"orgId",share_with_uuid:"shareWithUuid",share_with_type:"shareWithType"}));qs.SharingIn$outboundSchema=IO.object({orgId:IO.string(),level:yPt.ShareEnum$outboundSchema,shareWithUuid:IO.string(),shareWithType:RPt.EntityType$outboundSchema}).transform(t=>(0,gPt.remap)(t,{orgId:"org_id",shareWithUuid:"share_with_uuid",shareWithType:"share_with_type"}));var YPt;(function(t){t.inboundSchema=qs.SharingIn$inboundSchema,t.outboundSchema=qs.SharingIn$outboundSchema})(YPt||(qs.SharingIn$=YPt={}));function hKl(t){return JSON.stringify(qs.SharingIn$outboundSchema.parse(t))}function ZKl(t){return(0,pKl.safeParse)(t,e=>qs.SharingIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'SharingIn' from JSON")}});var fPt=f(Wa=>{"use strict";var WKl=Wa&&Wa.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),NKl=Wa&&Wa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VKl=Wa&&Wa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&WKl(e,t,n);return NKl(e,t),e};Object.defineProperty(Wa,"__esModule",{value:!0});Wa.UnarchiveFTModelOut$=Wa.UnarchiveFTModelOut$outboundSchema=Wa.UnarchiveFTModelOut$inboundSchema=Wa.UnarchiveFTModelOutObject$=Wa.UnarchiveFTModelOutObject$outboundSchema=Wa.UnarchiveFTModelOutObject$inboundSchema=Wa.UnarchiveFTModelOutObject=void 0;Wa.unarchiveFTModelOutToJSON=gKl;Wa.unarchiveFTModelOutFromJSON=RKl;var NJ=VKl(se()),YKl=oe();Wa.UnarchiveFTModelOutObject={Model:"model"};Wa.UnarchiveFTModelOutObject$inboundSchema=NJ.nativeEnum(Wa.UnarchiveFTModelOutObject);Wa.UnarchiveFTModelOutObject$outboundSchema=Wa.UnarchiveFTModelOutObject$inboundSchema;var FPt;(function(t){t.inboundSchema=Wa.UnarchiveFTModelOutObject$inboundSchema,t.outboundSchema=Wa.UnarchiveFTModelOutObject$outboundSchema})(FPt||(Wa.UnarchiveFTModelOutObject$=FPt={}));Wa.UnarchiveFTModelOut$inboundSchema=NJ.object({id:NJ.string(),object:Wa.UnarchiveFTModelOutObject$inboundSchema.default("model"),archived:NJ.boolean().default(!1)});Wa.UnarchiveFTModelOut$outboundSchema=NJ.object({id:NJ.string(),object:Wa.UnarchiveFTModelOutObject$outboundSchema.default("model"),archived:NJ.boolean().default(!1)});var vPt;(function(t){t.inboundSchema=Wa.UnarchiveFTModelOut$inboundSchema,t.outboundSchema=Wa.UnarchiveFTModelOut$outboundSchema})(vPt||(Wa.UnarchiveFTModelOut$=vPt={}));function gKl(t){return JSON.stringify(Wa.UnarchiveFTModelOut$outboundSchema.parse(t))}function RKl(t){return(0,YKl.safeParse)(t,e=>Wa.UnarchiveFTModelOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'UnarchiveFTModelOut' from JSON")}});var wPt=f($s=>{"use strict";var yKl=$s&&$s.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),AKl=$s&&$s.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),FKl=$s&&$s.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&yKl(e,t,n);return AKl(e,t),e};Object.defineProperty($s,"__esModule",{value:!0});$s.UpdateFTModelIn$=$s.UpdateFTModelIn$outboundSchema=$s.UpdateFTModelIn$inboundSchema=void 0;$s.updateFTModelInToJSON=fKl;$s.updateFTModelInFromJSON=XKl;var gR=FKl(se()),vKl=oe();$s.UpdateFTModelIn$inboundSchema=gR.object({name:gR.nullable(gR.string()).optional(),description:gR.nullable(gR.string()).optional()});$s.UpdateFTModelIn$outboundSchema=gR.object({name:gR.nullable(gR.string()).optional(),description:gR.nullable(gR.string()).optional()});var XPt;(function(t){t.inboundSchema=$s.UpdateFTModelIn$inboundSchema,t.outboundSchema=$s.UpdateFTModelIn$outboundSchema})(XPt||($s.UpdateFTModelIn$=XPt={}));function fKl(t){return JSON.stringify($s.UpdateFTModelIn$outboundSchema.parse(t))}function XKl(t){return(0,vKl.safeParse)(t,e=>$s.UpdateFTModelIn$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'UpdateFTModelIn' from JSON")}});var LPt=f(eu=>{"use strict";var wKl=eu&&eu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),HKl=eu&&eu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QKl=eu&&eu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&wKl(e,t,n);return HKl(e,t),e};Object.defineProperty(eu,"__esModule",{value:!0});eu.UploadFileOut$=eu.UploadFileOut$outboundSchema=eu.UploadFileOut$inboundSchema=void 0;eu.uploadFileOutToJSON=JKl;eu.uploadFileOutFromJSON=CKl;var Lb=QKl(se()),QPt=be(),EKl=oe(),EPt=p_(),JPt=h_(),CPt=Z_();eu.UploadFileOut$inboundSchema=Lb.object({id:Lb.string(),object:Lb.string(),bytes:Lb.number().int(),created_at:Lb.number().int(),filename:Lb.string(),purpose:EPt.FilePurpose$inboundSchema,sample_type:JPt.SampleType$inboundSchema,num_lines:Lb.nullable(Lb.number().int()).optional(),source:CPt.Source$inboundSchema}).transform(t=>(0,QPt.remap)(t,{bytes:"sizeBytes",created_at:"createdAt",sample_type:"sampleType",num_lines:"numLines"}));eu.UploadFileOut$outboundSchema=Lb.object({id:Lb.string(),object:Lb.string(),sizeBytes:Lb.number().int(),createdAt:Lb.number().int(),filename:Lb.string(),purpose:EPt.FilePurpose$outboundSchema,sampleType:JPt.SampleType$outboundSchema,numLines:Lb.nullable(Lb.number().int()).optional(),source:CPt.Source$outboundSchema}).transform(t=>(0,QPt.remap)(t,{sizeBytes:"bytes",createdAt:"created_at",sampleType:"sample_type",numLines:"num_lines"}));var HPt;(function(t){t.inboundSchema=eu.UploadFileOut$inboundSchema,t.outboundSchema=eu.UploadFileOut$outboundSchema})(HPt||(eu.UploadFileOut$=HPt={}));function JKl(t){return JSON.stringify(eu.UploadFileOut$outboundSchema.parse(t))}function CKl(t){return(0,EKl.safeParse)(t,e=>eu.UploadFileOut$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'UploadFileOut' from JSON")}});var OPt=f(lr=>{"use strict";var LKl=lr&&lr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),kKl=lr&&lr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xKl=lr&&lr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&LKl(e,t,n);return kKl(e,t),e};Object.defineProperty(lr,"__esModule",{value:!0});lr.ValidationError$=lr.ValidationError$outboundSchema=lr.ValidationError$inboundSchema=lr.Loc$=lr.Loc$outboundSchema=lr.Loc$inboundSchema=void 0;lr.locToJSON=jKl;lr.locFromJSON=OKl;lr.validationErrorToJSON=UKl;lr.validationErrorFromJSON=zKl;var tu=xKl(se()),jPt=oe();lr.Loc$inboundSchema=tu.union([tu.string(),tu.number().int()]);lr.Loc$outboundSchema=tu.union([tu.string(),tu.number().int()]);var kPt;(function(t){t.inboundSchema=lr.Loc$inboundSchema,t.outboundSchema=lr.Loc$outboundSchema})(kPt||(lr.Loc$=kPt={}));function jKl(t){return JSON.stringify(lr.Loc$outboundSchema.parse(t))}function OKl(t){return(0,jPt.safeParse)(t,e=>lr.Loc$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'Loc' from JSON")}lr.ValidationError$inboundSchema=tu.object({loc:tu.array(tu.union([tu.string(),tu.number().int()])),msg:tu.string(),type:tu.string()});lr.ValidationError$outboundSchema=tu.object({loc:tu.array(tu.union([tu.string(),tu.number().int()])),msg:tu.string(),type:tu.string()});var xPt;(function(t){t.inboundSchema=lr.ValidationError$inboundSchema,t.outboundSchema=lr.ValidationError$outboundSchema})(xPt||(lr.ValidationError$=xPt={}));function UKl(t){return JSON.stringify(lr.ValidationError$outboundSchema.parse(t))}function zKl(t){return(0,jPt.safeParse)(t,e=>lr.ValidationError$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ValidationError' from JSON")}});var bt=f(We=>{"use strict";var BKl=We&&We.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Ne=We&&We.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&BKl(e,t,n)};Object.defineProperty(We,"__esModule",{value:!0});Ne(aOt(),We);Ne(iOt(),We);Ne(mOt(),We);Ne(jUe(),We);Ne(c_(),We);Ne(OUe(),We);Ne(xUt(),We);Ne(KUt(),We);Ne(t9t(),We);Ne(TUe(),We);Ne(a9t(),We);Ne(bR(),We);Ne(DUe(),We);Ne(KUe(),We);Ne(p9t(),We);Ne(PUe(),We);Ne(A9t(),We);Ne(_Ue(),We);Ne(tw(),We);Ne(k9t(),We);Ne(IGe(),We);Ne(q9t(),We);Ne(Izt(),We);Ne(bzt(),We);Ne(Nzt(),We);Ne(NGe(),We);Ne(Xzt(),We);Ne(Ezt(),We);Ne(n9e(),We);Ne(rBt(),We);Ne(mBt(),We);Ne(l9e(),We);Ne(I9e(),We);Ne(YGe(),We);Ne(gGe(),We);Ne(a9e(),We);Ne(MX(),We);Ne(jW(),We);Ne(QUe(),We);Ne(o9e(),We);Ne(ISt(),We);Ne(cSt(),We);Ne(GSt(),We);Ne(u9e(),We);Ne(c9e(),We);Ne(fGe(),We);Ne(d9e(),We);Ne(Oj(),We);Ne(JMt(),We);Ne(OMt(),We);Ne(QTt(),We);Ne(xTt(),We);Ne(Iw(),We);Ne(DTt(),We);Ne(nDt(),We);Ne(iDt(),We);Ne(mDt(),We);Ne(VDt(),We);Ne(fDt(),We);Ne(jGe(),We);Ne(wDt(),We);Ne(QDt(),We);Ne(r9e(),We);Ne(KX(),We);Ne(v9e(),We);Ne(LDt(),We);Ne(xDt(),We);Ne(nJ(),We);Ne(f9e(),We);Ne(MDt(),We);Ne(PDt(),We);Ne(X9e(),We);Ne(Nbe(),We);Ne(RGe(),We);Ne(eKt(),We);Ne(Nde(),We);Ne(p_(),We);Ne(w9e(),We);Ne(sKt(),We);Ne(mKt(),We);Ne(WKt(),We);Ne(RKt(),We);Ne(H9e(),We);Ne(VGe(),We);Ne(AGe(),We);Ne(Q9e(),We);Ne(cde(),We);Ne(BUe(),We);Ne(u_(),We);Ne(G9e(),We);Ne(h9e(),We);Ne(MUe(),We);Ne(JGe(),We);Ne(_X(),We);Ne(E9e(),We);Ne(XGe(),We);Ne(PX(),We);Ne(UUe(),We);Ne(lJ(),We);Ne(p9e(),We);Ne(e9e(),We);Ne(qUe(),We);Ne(SKt(),We);Ne(_j(),We);Ne(_Kt(),We);Ne(EUe(),We);Ne(e_t(),We);Ne(l_t(),We);Ne(a_t(),We);Ne(L9e(),We);Ne(G_t(),We);Ne(p_t(),We);Ne(W_t(),We);Ne(R_t(),We);Ne(F9e(),We);Ne(b9e(),We);Ne(G_(),We);Ne(m9e(),We);Ne(qj(),We);Ne(W9e(),We);Ne(t9e(),We);Ne(zj(),We);Ne(Dde(),We);Ne(w_t(),We);Ne(J_t(),We);Ne(j9e(),We);Ne(j_t(),We);Ne(O9e(),We);Ne(U9e(),We);Ne(z9e(),We);Ne(P_t(),We);Ne(IPt(),We);Ne(B9e(),We);Ne(Z9e(),We);Ne(k9e(),We);Ne($1(),We);Ne(cPt(),We);Ne(zUe(),We);Ne(N9e(),We);Ne(V9e(),We);Ne(DX(),We);Ne(JUe(),We);Ne(Y9e(),We);Ne(GPt(),We);Ne(h_(),We);Ne(pPt(),We);Ne(S9e(),We);Ne(VPt(),We);Ne(APt(),We);Ne(x9e(),We);Ne(Z_(),We);Ne(g9e(),We);Ne(h0(),We);Ne(aJ(),We);Ne(Bj(),We);Ne(Yde(),We);Ne(Sj(),We);Ne(eJ(),We);Ne(R9e(),We);Ne(y9e(),We);Ne(b_(),We);Ne(A9e(),We);Ne(d_(),We);Ne(Z0(),We);Ne(LGe(),We);Ne(i_(),We);Ne(J9e(),We);Ne(fPt(),We);Ne(wPt(),We);Ne(LPt(),We);Ne(Tj(),We);Ne(W0(),We);Ne(OPt(),We);Ne(C9e(),We);Ne(Pj(),We);Ne(qX(),We);Ne($X(),We)});var SPt=f(kd=>{"use strict";var SKl=kd&&kd.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),MKl=kd&&kd.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zPt=kd&&kd.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&SKl(e,t,n);return MKl(e,t),e};Object.defineProperty(kd,"__esModule",{value:!0});kd.HTTPValidationError$=kd.HTTPValidationError$outboundSchema=kd.HTTPValidationError$inboundSchema=kd.HTTPValidationError=void 0;var W_=zPt(se()),BPt=zPt(bt()),N_=class extends Error{constructor(e){let n="message"in e&&typeof e.message=="string"?e.message:`API error occurred: ${JSON.stringify(e)}`;super(n),this.data$=e,e.detail!=null&&(this.detail=e.detail),this.name="HTTPValidationError"}};kd.HTTPValidationError=N_;kd.HTTPValidationError$inboundSchema=W_.object({detail:W_.array(BPt.ValidationError$inboundSchema).optional()}).transform(t=>new N_(t));kd.HTTPValidationError$outboundSchema=W_.instanceof(N_).transform(t=>t.data$).pipe(W_.object({detail:W_.array(BPt.ValidationError$outboundSchema).optional()}));var UPt;(function(t){t.inboundSchema=kd.HTTPValidationError$inboundSchema,t.outboundSchema=kd.HTTPValidationError$outboundSchema})(UPt||(kd.HTTPValidationError$=UPt={}))});var Tn=f(RR=>{"use strict";var TKl=RR&&RR.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Sbe=RR&&RR.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TKl(e,t,n)};Object.defineProperty(RR,"__esModule",{value:!0});Sbe(lUe(),RR);Sbe(SPt(),RR);Sbe(yUe(),RR);Sbe(XUe(),RR)});var Jt=f(uw=>{"use strict";var MPt=uw&&uw.__classPrivateFieldSet||function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},V_=uw&&uw.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},aO,Y_,TPt;Object.defineProperty(uw,"__esModule",{value:!0});uw.APIPromise=void 0;var M9e=class{constructor(e){aO.set(this,void 0),Y_.set(this,void 0),this[TPt]="APIPromise",MPt(this,aO,e instanceof Promise?e:Promise.resolve(e),"f"),MPt(this,Y_,e instanceof Promise?V_(this,aO,"f").then(([n])=>n):Promise.resolve(e[0]),"f")}then(e,n){return V_(this,aO,"f").then(e?([l])=>e(l):void 0,n)}catch(e){return V_(this,Y_,"f").catch(e)}finally(e){return V_(this,Y_,"f").finally(e)}$inspect(){return V_(this,aO,"f")}};uw.APIPromise=M9e;aO=new WeakMap,Y_=new WeakMap,TPt=Symbol.toStringTag});var _Pt=f(g0=>{"use strict";var DKl=g0&&g0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KKl=g0&&g0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),T9e=g0&&g0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DKl(e,t,n);return KKl(e,t),e};Object.defineProperty(g0,"__esModule",{value:!0});g0.agentsComplete=n_l;var _Kl=kt(),g_=T9e(Qt()),PKl=be(),qKl=oe(),DPt=Et(),$Kl=wt(),KPt=T9e(bt()),e_l=T9e(Tn()),t_l=Jt();function n_l(t,e,n){return new t_l.APIPromise(l_l(t,e,n))}async function l_l(t,e,n){let l=(0,qKl.safeParse)(e,y=>KPt.AgentsCompletionRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,_Kl.encodeJSON)("body",I,{explode:!0}),c=(0,$Kl.pathToFunc)("/v1/agents/completions")(),i=new Headers((0,PKl.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,DPt.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,DPt.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_completion_v1_agents_completions_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await g_.match(g_.json(200,KPt.ChatCompletionResponse$inboundSchema),g_.jsonErr(422,e_l.HTTPValidationError$inboundSchema),g_.fail("4XX"),g_.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var $Pt=f(R0=>{"use strict";var I_l=R0&&R0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),a_l=R0&&R0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Mbe=R0&&R0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&I_l(e,t,n);return a_l(e,t),e};Object.defineProperty(R0,"__esModule",{value:!0});R0.agentsStream=b_l;var r_l=Mbe(se()),c_l=kt(),o_l=BX(),R_=Mbe(Qt()),i_l=be(),s_l=oe(),PPt=Et(),u_l=wt(),qPt=Mbe(bt()),d_l=Mbe(Tn()),G_l=Jt();function b_l(t,e,n){return new G_l.APIPromise(m_l(t,e,n))}async function m_l(t,e,n){let l=(0,s_l.safeParse)(e,y=>qPt.AgentsCompletionStreamRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,c_l.encodeJSON)("body",I,{explode:!0}),c=(0,u_l.pathToFunc)("/v1/agents/completions#stream")(),i=new Headers((0,i_l.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),s=await(0,PPt.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,PPt.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"stream_agents",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await R_.match(R_.sse(200,r_l.instanceof(ReadableStream).transform(y=>new o_l.EventStream({stream:y,decoder(X){return qPt.CompletionEvent$inboundSchema.parse(X)}})),{sseSentinel:"[DONE]"}),R_.jsonErr(422,d_l.HTTPValidationError$inboundSchema),R_.fail("4XX"),R_.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var t6t=f(Tbe=>{"use strict";Object.defineProperty(Tbe,"__esModule",{value:!0});Tbe.Agents=void 0;var p_l=_Pt(),h_l=$Pt(),Z_l=di(),e6t=Hd(),D9e=class extends Z_l.ClientSDK{async complete(e,n){return(0,e6t.unwrapAsync)((0,p_l.agentsComplete)(this,e,n))}async stream(e,n){return(0,e6t.unwrapAsync)((0,h_l.agentsStream)(this,e,n))}};Tbe.Agents=D9e});var I6t=f(nu=>{"use strict";var W_l=nu&&nu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),N_l=nu&&nu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V_l=nu&&nu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&W_l(e,t,n);return N_l(e,t),e};Object.defineProperty(nu,"__esModule",{value:!0});nu.AgentsApiV1AgentsGetRequest$=nu.AgentsApiV1AgentsGetRequest$outboundSchema=nu.AgentsApiV1AgentsGetRequest$inboundSchema=void 0;nu.agentsApiV1AgentsGetRequestToJSON=g_l;nu.agentsApiV1AgentsGetRequestFromJSON=R_l;var Dbe=V_l(se()),l6t=be(),Y_l=oe();nu.AgentsApiV1AgentsGetRequest$inboundSchema=Dbe.object({agent_id:Dbe.string()}).transform(t=>(0,l6t.remap)(t,{agent_id:"agentId"}));nu.AgentsApiV1AgentsGetRequest$outboundSchema=Dbe.object({agentId:Dbe.string()}).transform(t=>(0,l6t.remap)(t,{agentId:"agent_id"}));var n6t;(function(t){t.inboundSchema=nu.AgentsApiV1AgentsGetRequest$inboundSchema,t.outboundSchema=nu.AgentsApiV1AgentsGetRequest$outboundSchema})(n6t||(nu.AgentsApiV1AgentsGetRequest$=n6t={}));function g_l(t){return JSON.stringify(nu.AgentsApiV1AgentsGetRequest$outboundSchema.parse(t))}function R_l(t){return(0,Y_l.safeParse)(t,e=>nu.AgentsApiV1AgentsGetRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1AgentsGetRequest' from JSON")}});var c6t=f(lu=>{"use strict";var y_l=lu&&lu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),A_l=lu&&lu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),F_l=lu&&lu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&y_l(e,t,n);return A_l(e,t),e};Object.defineProperty(lu,"__esModule",{value:!0});lu.AgentsApiV1AgentsListRequest$=lu.AgentsApiV1AgentsListRequest$outboundSchema=lu.AgentsApiV1AgentsListRequest$inboundSchema=void 0;lu.agentsApiV1AgentsListRequestToJSON=f_l;lu.agentsApiV1AgentsListRequestFromJSON=X_l;var rO=F_l(se()),r6t=be(),v_l=oe();lu.AgentsApiV1AgentsListRequest$inboundSchema=rO.object({page:rO.number().int().default(0),page_size:rO.number().int().default(20)}).transform(t=>(0,r6t.remap)(t,{page_size:"pageSize"}));lu.AgentsApiV1AgentsListRequest$outboundSchema=rO.object({page:rO.number().int().default(0),pageSize:rO.number().int().default(20)}).transform(t=>(0,r6t.remap)(t,{pageSize:"page_size"}));var a6t;(function(t){t.inboundSchema=lu.AgentsApiV1AgentsListRequest$inboundSchema,t.outboundSchema=lu.AgentsApiV1AgentsListRequest$outboundSchema})(a6t||(lu.AgentsApiV1AgentsListRequest$=a6t={}));function f_l(t){return JSON.stringify(lu.AgentsApiV1AgentsListRequest$outboundSchema.parse(t))}function X_l(t){return(0,v_l.safeParse)(t,e=>lu.AgentsApiV1AgentsListRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1AgentsListRequest' from JSON")}});var d6t=f(Iu=>{"use strict";var w_l=Iu&&Iu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),H_l=Iu&&Iu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i6t=Iu&&Iu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&w_l(e,t,n);return H_l(e,t),e};Object.defineProperty(Iu,"__esModule",{value:!0});Iu.AgentsApiV1AgentsUpdateRequest$=Iu.AgentsApiV1AgentsUpdateRequest$outboundSchema=Iu.AgentsApiV1AgentsUpdateRequest$inboundSchema=void 0;Iu.agentsApiV1AgentsUpdateRequestToJSON=E_l;Iu.agentsApiV1AgentsUpdateRequestFromJSON=J_l;var Kbe=i6t(se()),s6t=be(),Q_l=oe(),u6t=i6t(bt());Iu.AgentsApiV1AgentsUpdateRequest$inboundSchema=Kbe.object({agent_id:Kbe.string(),AgentUpdateRequest:u6t.AgentUpdateRequest$inboundSchema}).transform(t=>(0,s6t.remap)(t,{agent_id:"agentId",AgentUpdateRequest:"agentUpdateRequest"}));Iu.AgentsApiV1AgentsUpdateRequest$outboundSchema=Kbe.object({agentId:Kbe.string(),agentUpdateRequest:u6t.AgentUpdateRequest$outboundSchema}).transform(t=>(0,s6t.remap)(t,{agentId:"agent_id",agentUpdateRequest:"AgentUpdateRequest"}));var o6t;(function(t){t.inboundSchema=Iu.AgentsApiV1AgentsUpdateRequest$inboundSchema,t.outboundSchema=Iu.AgentsApiV1AgentsUpdateRequest$outboundSchema})(o6t||(Iu.AgentsApiV1AgentsUpdateRequest$=o6t={}));function E_l(t){return JSON.stringify(Iu.AgentsApiV1AgentsUpdateRequest$outboundSchema.parse(t))}function J_l(t){return(0,Q_l.safeParse)(t,e=>Iu.AgentsApiV1AgentsUpdateRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1AgentsUpdateRequest' from JSON")}});var m6t=f(au=>{"use strict";var C_l=au&&au.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),L_l=au&&au.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),k_l=au&&au.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&C_l(e,t,n);return L_l(e,t),e};Object.defineProperty(au,"__esModule",{value:!0});au.AgentsApiV1AgentsUpdateVersionRequest$=au.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema=au.AgentsApiV1AgentsUpdateVersionRequest$inboundSchema=void 0;au.agentsApiV1AgentsUpdateVersionRequestToJSON=j_l;au.agentsApiV1AgentsUpdateVersionRequestFromJSON=O_l;var cO=k_l(se()),b6t=be(),x_l=oe();au.AgentsApiV1AgentsUpdateVersionRequest$inboundSchema=cO.object({agent_id:cO.string(),version:cO.number().int()}).transform(t=>(0,b6t.remap)(t,{agent_id:"agentId"}));au.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema=cO.object({agentId:cO.string(),version:cO.number().int()}).transform(t=>(0,b6t.remap)(t,{agentId:"agent_id"}));var G6t;(function(t){t.inboundSchema=au.AgentsApiV1AgentsUpdateVersionRequest$inboundSchema,t.outboundSchema=au.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema})(G6t||(au.AgentsApiV1AgentsUpdateVersionRequest$=G6t={}));function j_l(t){return JSON.stringify(au.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema.parse(t))}function O_l(t){return(0,x_l.safeParse)(t,e=>au.AgentsApiV1AgentsUpdateVersionRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1AgentsUpdateVersionRequest' from JSON")}});var N6t=f(ru=>{"use strict";var U_l=ru&&ru.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),z_l=ru&&ru.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),h6t=ru&&ru.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&U_l(e,t,n);return z_l(e,t),e};Object.defineProperty(ru,"__esModule",{value:!0});ru.AgentsApiV1ConversationsAppendRequest$=ru.AgentsApiV1ConversationsAppendRequest$outboundSchema=ru.AgentsApiV1ConversationsAppendRequest$inboundSchema=void 0;ru.agentsApiV1ConversationsAppendRequestToJSON=S_l;ru.agentsApiV1ConversationsAppendRequestFromJSON=M_l;var _be=h6t(se()),Z6t=be(),B_l=oe(),W6t=h6t(bt());ru.AgentsApiV1ConversationsAppendRequest$inboundSchema=_be.object({conversation_id:_be.string(),ConversationAppendRequest:W6t.ConversationAppendRequest$inboundSchema}).transform(t=>(0,Z6t.remap)(t,{conversation_id:"conversationId",ConversationAppendRequest:"conversationAppendRequest"}));ru.AgentsApiV1ConversationsAppendRequest$outboundSchema=_be.object({conversationId:_be.string(),conversationAppendRequest:W6t.ConversationAppendRequest$outboundSchema}).transform(t=>(0,Z6t.remap)(t,{conversationId:"conversation_id",conversationAppendRequest:"ConversationAppendRequest"}));var p6t;(function(t){t.inboundSchema=ru.AgentsApiV1ConversationsAppendRequest$inboundSchema,t.outboundSchema=ru.AgentsApiV1ConversationsAppendRequest$outboundSchema})(p6t||(ru.AgentsApiV1ConversationsAppendRequest$=p6t={}));function S_l(t){return JSON.stringify(ru.AgentsApiV1ConversationsAppendRequest$outboundSchema.parse(t))}function M_l(t){return(0,B_l.safeParse)(t,e=>ru.AgentsApiV1ConversationsAppendRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsAppendRequest' from JSON")}});var y6t=f(cu=>{"use strict";var T_l=cu&&cu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),D_l=cu&&cu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Y6t=cu&&cu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&T_l(e,t,n);return D_l(e,t),e};Object.defineProperty(cu,"__esModule",{value:!0});cu.AgentsApiV1ConversationsAppendStreamRequest$=cu.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema=cu.AgentsApiV1ConversationsAppendStreamRequest$inboundSchema=void 0;cu.agentsApiV1ConversationsAppendStreamRequestToJSON=__l;cu.agentsApiV1ConversationsAppendStreamRequestFromJSON=P_l;var Pbe=Y6t(se()),g6t=be(),K_l=oe(),R6t=Y6t(bt());cu.AgentsApiV1ConversationsAppendStreamRequest$inboundSchema=Pbe.object({conversation_id:Pbe.string(),ConversationAppendStreamRequest:R6t.ConversationAppendStreamRequest$inboundSchema}).transform(t=>(0,g6t.remap)(t,{conversation_id:"conversationId",ConversationAppendStreamRequest:"conversationAppendStreamRequest"}));cu.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema=Pbe.object({conversationId:Pbe.string(),conversationAppendStreamRequest:R6t.ConversationAppendStreamRequest$outboundSchema}).transform(t=>(0,g6t.remap)(t,{conversationId:"conversation_id",conversationAppendStreamRequest:"ConversationAppendStreamRequest"}));var V6t;(function(t){t.inboundSchema=cu.AgentsApiV1ConversationsAppendStreamRequest$inboundSchema,t.outboundSchema=cu.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema})(V6t||(cu.AgentsApiV1ConversationsAppendStreamRequest$=V6t={}));function __l(t){return JSON.stringify(cu.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema.parse(t))}function P_l(t){return(0,K_l.safeParse)(t,e=>cu.AgentsApiV1ConversationsAppendStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsAppendStreamRequest' from JSON")}});var w6t=f(Ir=>{"use strict";var q_l=Ir&&Ir.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),$_l=Ir&&Ir.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),v6t=Ir&&Ir.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&q_l(e,t,n);return $_l(e,t),e};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$=Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$outboundSchema=Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema=Ir.AgentsApiV1ConversationsGetRequest$=Ir.AgentsApiV1ConversationsGetRequest$outboundSchema=Ir.AgentsApiV1ConversationsGetRequest$inboundSchema=void 0;Ir.agentsApiV1ConversationsGetRequestToJSON=ePl;Ir.agentsApiV1ConversationsGetRequestFromJSON=tPl;Ir.agentsApiV1ConversationsGetResponseV1ConversationsGetToJSON=nPl;Ir.agentsApiV1ConversationsGetResponseV1ConversationsGetFromJSON=lPl;var oO=v6t(se()),f6t=be(),X6t=oe(),qbe=v6t(bt());Ir.AgentsApiV1ConversationsGetRequest$inboundSchema=oO.object({conversation_id:oO.string()}).transform(t=>(0,f6t.remap)(t,{conversation_id:"conversationId"}));Ir.AgentsApiV1ConversationsGetRequest$outboundSchema=oO.object({conversationId:oO.string()}).transform(t=>(0,f6t.remap)(t,{conversationId:"conversation_id"}));var A6t;(function(t){t.inboundSchema=Ir.AgentsApiV1ConversationsGetRequest$inboundSchema,t.outboundSchema=Ir.AgentsApiV1ConversationsGetRequest$outboundSchema})(A6t||(Ir.AgentsApiV1ConversationsGetRequest$=A6t={}));function ePl(t){return JSON.stringify(Ir.AgentsApiV1ConversationsGetRequest$outboundSchema.parse(t))}function tPl(t){return(0,X6t.safeParse)(t,e=>Ir.AgentsApiV1ConversationsGetRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsGetRequest' from JSON")}Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema=oO.union([qbe.AgentConversation$inboundSchema,qbe.ModelConversation$inboundSchema]);Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$outboundSchema=oO.union([qbe.AgentConversation$outboundSchema,qbe.ModelConversation$outboundSchema]);var F6t;(function(t){t.inboundSchema=Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema,t.outboundSchema=Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$outboundSchema})(F6t||(Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$=F6t={}));function nPl(t){return JSON.stringify(Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$outboundSchema.parse(t))}function lPl(t){return(0,X6t.safeParse)(t,e=>Ir.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsGetResponseV1ConversationsGet' from JSON")}});var E6t=f(ou=>{"use strict";var IPl=ou&&ou.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),aPl=ou&&ou.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rPl=ou&&ou.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&IPl(e,t,n);return aPl(e,t),e};Object.defineProperty(ou,"__esModule",{value:!0});ou.AgentsApiV1ConversationsHistoryRequest$=ou.AgentsApiV1ConversationsHistoryRequest$outboundSchema=ou.AgentsApiV1ConversationsHistoryRequest$inboundSchema=void 0;ou.agentsApiV1ConversationsHistoryRequestToJSON=oPl;ou.agentsApiV1ConversationsHistoryRequestFromJSON=iPl;var $be=rPl(se()),Q6t=be(),cPl=oe();ou.AgentsApiV1ConversationsHistoryRequest$inboundSchema=$be.object({conversation_id:$be.string()}).transform(t=>(0,Q6t.remap)(t,{conversation_id:"conversationId"}));ou.AgentsApiV1ConversationsHistoryRequest$outboundSchema=$be.object({conversationId:$be.string()}).transform(t=>(0,Q6t.remap)(t,{conversationId:"conversation_id"}));var H6t;(function(t){t.inboundSchema=ou.AgentsApiV1ConversationsHistoryRequest$inboundSchema,t.outboundSchema=ou.AgentsApiV1ConversationsHistoryRequest$outboundSchema})(H6t||(ou.AgentsApiV1ConversationsHistoryRequest$=H6t={}));function oPl(t){return JSON.stringify(ou.AgentsApiV1ConversationsHistoryRequest$outboundSchema.parse(t))}function iPl(t){return(0,cPl.safeParse)(t,e=>ou.AgentsApiV1ConversationsHistoryRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsHistoryRequest' from JSON")}});var j6t=f(ar=>{"use strict";var sPl=ar&&ar.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),uPl=ar&&ar.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L6t=ar&&ar.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&sPl(e,t,n);return uPl(e,t),e};Object.defineProperty(ar,"__esModule",{value:!0});ar.ResponseBody$=ar.ResponseBody$outboundSchema=ar.ResponseBody$inboundSchema=ar.AgentsApiV1ConversationsListRequest$=ar.AgentsApiV1ConversationsListRequest$outboundSchema=ar.AgentsApiV1ConversationsListRequest$inboundSchema=void 0;ar.agentsApiV1ConversationsListRequestToJSON=dPl;ar.agentsApiV1ConversationsListRequestFromJSON=GPl;ar.responseBodyToJSON=bPl;ar.responseBodyFromJSON=mPl;var dw=L6t(se()),k6t=be(),x6t=oe(),eme=L6t(bt());ar.AgentsApiV1ConversationsListRequest$inboundSchema=dw.object({page:dw.number().int().default(0),page_size:dw.number().int().default(100)}).transform(t=>(0,k6t.remap)(t,{page_size:"pageSize"}));ar.AgentsApiV1ConversationsListRequest$outboundSchema=dw.object({page:dw.number().int().default(0),pageSize:dw.number().int().default(100)}).transform(t=>(0,k6t.remap)(t,{pageSize:"page_size"}));var J6t;(function(t){t.inboundSchema=ar.AgentsApiV1ConversationsListRequest$inboundSchema,t.outboundSchema=ar.AgentsApiV1ConversationsListRequest$outboundSchema})(J6t||(ar.AgentsApiV1ConversationsListRequest$=J6t={}));function dPl(t){return JSON.stringify(ar.AgentsApiV1ConversationsListRequest$outboundSchema.parse(t))}function GPl(t){return(0,x6t.safeParse)(t,e=>ar.AgentsApiV1ConversationsListRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsListRequest' from JSON")}ar.ResponseBody$inboundSchema=dw.union([eme.AgentConversation$inboundSchema,eme.ModelConversation$inboundSchema]);ar.ResponseBody$outboundSchema=dw.union([eme.AgentConversation$outboundSchema,eme.ModelConversation$outboundSchema]);var C6t;(function(t){t.inboundSchema=ar.ResponseBody$inboundSchema,t.outboundSchema=ar.ResponseBody$outboundSchema})(C6t||(ar.ResponseBody$=C6t={}));function bPl(t){return JSON.stringify(ar.ResponseBody$outboundSchema.parse(t))}function mPl(t){return(0,x6t.safeParse)(t,e=>ar.ResponseBody$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'ResponseBody' from JSON")}});var z6t=f(iu=>{"use strict";var pPl=iu&&iu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),hPl=iu&&iu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZPl=iu&&iu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&pPl(e,t,n);return hPl(e,t),e};Object.defineProperty(iu,"__esModule",{value:!0});iu.AgentsApiV1ConversationsMessagesRequest$=iu.AgentsApiV1ConversationsMessagesRequest$outboundSchema=iu.AgentsApiV1ConversationsMessagesRequest$inboundSchema=void 0;iu.agentsApiV1ConversationsMessagesRequestToJSON=NPl;iu.agentsApiV1ConversationsMessagesRequestFromJSON=VPl;var tme=ZPl(se()),U6t=be(),WPl=oe();iu.AgentsApiV1ConversationsMessagesRequest$inboundSchema=tme.object({conversation_id:tme.string()}).transform(t=>(0,U6t.remap)(t,{conversation_id:"conversationId"}));iu.AgentsApiV1ConversationsMessagesRequest$outboundSchema=tme.object({conversationId:tme.string()}).transform(t=>(0,U6t.remap)(t,{conversationId:"conversation_id"}));var O6t;(function(t){t.inboundSchema=iu.AgentsApiV1ConversationsMessagesRequest$inboundSchema,t.outboundSchema=iu.AgentsApiV1ConversationsMessagesRequest$outboundSchema})(O6t||(iu.AgentsApiV1ConversationsMessagesRequest$=O6t={}));function NPl(t){return JSON.stringify(iu.AgentsApiV1ConversationsMessagesRequest$outboundSchema.parse(t))}function VPl(t){return(0,WPl.safeParse)(t,e=>iu.AgentsApiV1ConversationsMessagesRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsMessagesRequest' from JSON")}});var D6t=f(su=>{"use strict";var YPl=su&&su.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),gPl=su&&su.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),S6t=su&&su.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&YPl(e,t,n);return gPl(e,t),e};Object.defineProperty(su,"__esModule",{value:!0});su.AgentsApiV1ConversationsRestartRequest$=su.AgentsApiV1ConversationsRestartRequest$outboundSchema=su.AgentsApiV1ConversationsRestartRequest$inboundSchema=void 0;su.agentsApiV1ConversationsRestartRequestToJSON=yPl;su.agentsApiV1ConversationsRestartRequestFromJSON=APl;var nme=S6t(se()),M6t=be(),RPl=oe(),T6t=S6t(bt());su.AgentsApiV1ConversationsRestartRequest$inboundSchema=nme.object({conversation_id:nme.string(),ConversationRestartRequest:T6t.ConversationRestartRequest$inboundSchema}).transform(t=>(0,M6t.remap)(t,{conversation_id:"conversationId",ConversationRestartRequest:"conversationRestartRequest"}));su.AgentsApiV1ConversationsRestartRequest$outboundSchema=nme.object({conversationId:nme.string(),conversationRestartRequest:T6t.ConversationRestartRequest$outboundSchema}).transform(t=>(0,M6t.remap)(t,{conversationId:"conversation_id",conversationRestartRequest:"ConversationRestartRequest"}));var B6t;(function(t){t.inboundSchema=su.AgentsApiV1ConversationsRestartRequest$inboundSchema,t.outboundSchema=su.AgentsApiV1ConversationsRestartRequest$outboundSchema})(B6t||(su.AgentsApiV1ConversationsRestartRequest$=B6t={}));function yPl(t){return JSON.stringify(su.AgentsApiV1ConversationsRestartRequest$outboundSchema.parse(t))}function APl(t){return(0,RPl.safeParse)(t,e=>su.AgentsApiV1ConversationsRestartRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsRestartRequest' from JSON")}});var $6t=f(uu=>{"use strict";var FPl=uu&&uu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),vPl=uu&&uu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_6t=uu&&uu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&FPl(e,t,n);return vPl(e,t),e};Object.defineProperty(uu,"__esModule",{value:!0});uu.AgentsApiV1ConversationsRestartStreamRequest$=uu.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema=uu.AgentsApiV1ConversationsRestartStreamRequest$inboundSchema=void 0;uu.agentsApiV1ConversationsRestartStreamRequestToJSON=XPl;uu.agentsApiV1ConversationsRestartStreamRequestFromJSON=wPl;var lme=_6t(se()),P6t=be(),fPl=oe(),q6t=_6t(bt());uu.AgentsApiV1ConversationsRestartStreamRequest$inboundSchema=lme.object({conversation_id:lme.string(),ConversationRestartStreamRequest:q6t.ConversationRestartStreamRequest$inboundSchema}).transform(t=>(0,P6t.remap)(t,{conversation_id:"conversationId",ConversationRestartStreamRequest:"conversationRestartStreamRequest"}));uu.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema=lme.object({conversationId:lme.string(),conversationRestartStreamRequest:q6t.ConversationRestartStreamRequest$outboundSchema}).transform(t=>(0,P6t.remap)(t,{conversationId:"conversation_id",conversationRestartStreamRequest:"ConversationRestartStreamRequest"}));var K6t;(function(t){t.inboundSchema=uu.AgentsApiV1ConversationsRestartStreamRequest$inboundSchema,t.outboundSchema=uu.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema})(K6t||(uu.AgentsApiV1ConversationsRestartStreamRequest$=K6t={}));function XPl(t){return JSON.stringify(uu.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema.parse(t))}function wPl(t){return(0,fPl.safeParse)(t,e=>uu.AgentsApiV1ConversationsRestartStreamRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'AgentsApiV1ConversationsRestartStreamRequest' from JSON")}});var nqt=f(du=>{"use strict";var HPl=du&&du.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),QPl=du&&du.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),EPl=du&&du.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&HPl(e,t,n);return QPl(e,t),e};Object.defineProperty(du,"__esModule",{value:!0});du.DeleteModelV1ModelsModelIdDeleteRequest$=du.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema=du.DeleteModelV1ModelsModelIdDeleteRequest$inboundSchema=void 0;du.deleteModelV1ModelsModelIdDeleteRequestToJSON=CPl;du.deleteModelV1ModelsModelIdDeleteRequestFromJSON=LPl;var Ime=EPl(se()),tqt=be(),JPl=oe();du.DeleteModelV1ModelsModelIdDeleteRequest$inboundSchema=Ime.object({model_id:Ime.string()}).transform(t=>(0,tqt.remap)(t,{model_id:"modelId"}));du.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema=Ime.object({modelId:Ime.string()}).transform(t=>(0,tqt.remap)(t,{modelId:"model_id"}));var eqt;(function(t){t.inboundSchema=du.DeleteModelV1ModelsModelIdDeleteRequest$inboundSchema,t.outboundSchema=du.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema})(eqt||(du.DeleteModelV1ModelsModelIdDeleteRequest$=eqt={}));function CPl(t){return JSON.stringify(du.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema.parse(t))}function LPl(t){return(0,JPl.safeParse)(t,e=>du.DeleteModelV1ModelsModelIdDeleteRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'DeleteModelV1ModelsModelIdDeleteRequest' from JSON")}});var aqt=f(Gu=>{"use strict";var kPl=Gu&&Gu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),xPl=Gu&&Gu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jPl=Gu&&Gu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&kPl(e,t,n);return xPl(e,t),e};Object.defineProperty(Gu,"__esModule",{value:!0});Gu.FilesApiRoutesDeleteFileRequest$=Gu.FilesApiRoutesDeleteFileRequest$outboundSchema=Gu.FilesApiRoutesDeleteFileRequest$inboundSchema=void 0;Gu.filesApiRoutesDeleteFileRequestToJSON=UPl;Gu.filesApiRoutesDeleteFileRequestFromJSON=zPl;var ame=jPl(se()),Iqt=be(),OPl=oe();Gu.FilesApiRoutesDeleteFileRequest$inboundSchema=ame.object({file_id:ame.string()}).transform(t=>(0,Iqt.remap)(t,{file_id:"fileId"}));Gu.FilesApiRoutesDeleteFileRequest$outboundSchema=ame.object({fileId:ame.string()}).transform(t=>(0,Iqt.remap)(t,{fileId:"file_id"}));var lqt;(function(t){t.inboundSchema=Gu.FilesApiRoutesDeleteFileRequest$inboundSchema,t.outboundSchema=Gu.FilesApiRoutesDeleteFileRequest$outboundSchema})(lqt||(Gu.FilesApiRoutesDeleteFileRequest$=lqt={}));function UPl(t){return JSON.stringify(Gu.FilesApiRoutesDeleteFileRequest$outboundSchema.parse(t))}function zPl(t){return(0,OPl.safeParse)(t,e=>Gu.FilesApiRoutesDeleteFileRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FilesApiRoutesDeleteFileRequest' from JSON")}});var oqt=f(bu=>{"use strict";var BPl=bu&&bu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),SPl=bu&&bu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MPl=bu&&bu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&BPl(e,t,n);return SPl(e,t),e};Object.defineProperty(bu,"__esModule",{value:!0});bu.FilesApiRoutesDownloadFileRequest$=bu.FilesApiRoutesDownloadFileRequest$outboundSchema=bu.FilesApiRoutesDownloadFileRequest$inboundSchema=void 0;bu.filesApiRoutesDownloadFileRequestToJSON=DPl;bu.filesApiRoutesDownloadFileRequestFromJSON=KPl;var rme=MPl(se()),cqt=be(),TPl=oe();bu.FilesApiRoutesDownloadFileRequest$inboundSchema=rme.object({file_id:rme.string()}).transform(t=>(0,cqt.remap)(t,{file_id:"fileId"}));bu.FilesApiRoutesDownloadFileRequest$outboundSchema=rme.object({fileId:rme.string()}).transform(t=>(0,cqt.remap)(t,{fileId:"file_id"}));var rqt;(function(t){t.inboundSchema=bu.FilesApiRoutesDownloadFileRequest$inboundSchema,t.outboundSchema=bu.FilesApiRoutesDownloadFileRequest$outboundSchema})(rqt||(bu.FilesApiRoutesDownloadFileRequest$=rqt={}));function DPl(t){return JSON.stringify(bu.FilesApiRoutesDownloadFileRequest$outboundSchema.parse(t))}function KPl(t){return(0,TPl.safeParse)(t,e=>bu.FilesApiRoutesDownloadFileRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FilesApiRoutesDownloadFileRequest' from JSON")}});var uqt=f(mu=>{"use strict";var _Pl=mu&&mu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),PPl=mu&&mu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qPl=mu&&mu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_Pl(e,t,n);return PPl(e,t),e};Object.defineProperty(mu,"__esModule",{value:!0});mu.FilesApiRoutesGetSignedUrlRequest$=mu.FilesApiRoutesGetSignedUrlRequest$outboundSchema=mu.FilesApiRoutesGetSignedUrlRequest$inboundSchema=void 0;mu.filesApiRoutesGetSignedUrlRequestToJSON=e6l;mu.filesApiRoutesGetSignedUrlRequestFromJSON=t6l;var iO=qPl(se()),sqt=be(),$Pl=oe();mu.FilesApiRoutesGetSignedUrlRequest$inboundSchema=iO.object({file_id:iO.string(),expiry:iO.number().int().default(24)}).transform(t=>(0,sqt.remap)(t,{file_id:"fileId"}));mu.FilesApiRoutesGetSignedUrlRequest$outboundSchema=iO.object({fileId:iO.string(),expiry:iO.number().int().default(24)}).transform(t=>(0,sqt.remap)(t,{fileId:"file_id"}));var iqt;(function(t){t.inboundSchema=mu.FilesApiRoutesGetSignedUrlRequest$inboundSchema,t.outboundSchema=mu.FilesApiRoutesGetSignedUrlRequest$outboundSchema})(iqt||(mu.FilesApiRoutesGetSignedUrlRequest$=iqt={}));function e6l(t){return JSON.stringify(mu.FilesApiRoutesGetSignedUrlRequest$outboundSchema.parse(t))}function t6l(t){return(0,$Pl.safeParse)(t,e=>mu.FilesApiRoutesGetSignedUrlRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FilesApiRoutesGetSignedUrlRequest' from JSON")}});var mqt=f(hu=>{"use strict";var n6l=hu&&hu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),l6l=hu&&hu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Gqt=hu&&hu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&n6l(e,t,n);return l6l(e,t),e};Object.defineProperty(hu,"__esModule",{value:!0});hu.FilesApiRoutesListFilesRequest$=hu.FilesApiRoutesListFilesRequest$outboundSchema=hu.FilesApiRoutesListFilesRequest$inboundSchema=void 0;hu.filesApiRoutesListFilesRequestToJSON=a6l;hu.filesApiRoutesListFilesRequestFromJSON=r6l;var pu=Gqt(se()),bqt=be(),I6l=oe(),sO=Gqt(bt());hu.FilesApiRoutesListFilesRequest$inboundSchema=pu.object({page:pu.number().int().default(0),page_size:pu.number().int().default(100),sample_type:pu.nullable(pu.array(sO.SampleType$inboundSchema)).optional(),source:pu.nullable(pu.array(sO.Source$inboundSchema)).optional(),search:pu.nullable(pu.string()).optional(),purpose:pu.nullable(sO.FilePurpose$inboundSchema).optional()}).transform(t=>(0,bqt.remap)(t,{page_size:"pageSize",sample_type:"sampleType"}));hu.FilesApiRoutesListFilesRequest$outboundSchema=pu.object({page:pu.number().int().default(0),pageSize:pu.number().int().default(100),sampleType:pu.nullable(pu.array(sO.SampleType$outboundSchema)).optional(),source:pu.nullable(pu.array(sO.Source$outboundSchema)).optional(),search:pu.nullable(pu.string()).optional(),purpose:pu.nullable(sO.FilePurpose$outboundSchema).optional()}).transform(t=>(0,bqt.remap)(t,{pageSize:"page_size",sampleType:"sample_type"}));var dqt;(function(t){t.inboundSchema=hu.FilesApiRoutesListFilesRequest$inboundSchema,t.outboundSchema=hu.FilesApiRoutesListFilesRequest$outboundSchema})(dqt||(hu.FilesApiRoutesListFilesRequest$=dqt={}));function a6l(t){return JSON.stringify(hu.FilesApiRoutesListFilesRequest$outboundSchema.parse(t))}function r6l(t){return(0,I6l.safeParse)(t,e=>hu.FilesApiRoutesListFilesRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FilesApiRoutesListFilesRequest' from JSON")}});var Zqt=f(Zu=>{"use strict";var c6l=Zu&&Zu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),o6l=Zu&&Zu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i6l=Zu&&Zu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&c6l(e,t,n);return o6l(e,t),e};Object.defineProperty(Zu,"__esModule",{value:!0});Zu.FilesApiRoutesRetrieveFileRequest$=Zu.FilesApiRoutesRetrieveFileRequest$outboundSchema=Zu.FilesApiRoutesRetrieveFileRequest$inboundSchema=void 0;Zu.filesApiRoutesRetrieveFileRequestToJSON=u6l;Zu.filesApiRoutesRetrieveFileRequestFromJSON=d6l;var cme=i6l(se()),hqt=be(),s6l=oe();Zu.FilesApiRoutesRetrieveFileRequest$inboundSchema=cme.object({file_id:cme.string()}).transform(t=>(0,hqt.remap)(t,{file_id:"fileId"}));Zu.FilesApiRoutesRetrieveFileRequest$outboundSchema=cme.object({fileId:cme.string()}).transform(t=>(0,hqt.remap)(t,{fileId:"file_id"}));var pqt;(function(t){t.inboundSchema=Zu.FilesApiRoutesRetrieveFileRequest$inboundSchema,t.outboundSchema=Zu.FilesApiRoutesRetrieveFileRequest$outboundSchema})(pqt||(Zu.FilesApiRoutesRetrieveFileRequest$=pqt={}));function u6l(t){return JSON.stringify(Zu.FilesApiRoutesRetrieveFileRequest$outboundSchema.parse(t))}function d6l(t){return(0,s6l.safeParse)(t,e=>Zu.FilesApiRoutesRetrieveFileRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FilesApiRoutesRetrieveFileRequest' from JSON")}});var y_=f(_V=>{"use strict";var G6l=_V&&_V.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),b6l=_V&&_V.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),m6l=_V&&_V.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&G6l(e,t,n);return b6l(e,t),e};Object.defineProperty(_V,"__esModule",{value:!0});_V.blobLikeSchema=void 0;_V.isBlobLike=Wqt;var p6l=m6l(se());_V.blobLikeSchema=p6l.custom(Wqt,{message:"expected a Blob, File or Blob-like object",fatal:!0});function Wqt(t){if(t instanceof Blob)return!0;if(typeof t!="object"||t==null||!(Symbol.toStringTag in t))return!1;let e=t[Symbol.toStringTag];return typeof e!="string"||e!=="Blob"&&e!=="File"?!1:"stream"in t&&typeof t.stream=="function"}});var gqt=f(Wu=>{"use strict";var h6l=Wu&&Wu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Z6l=Wu&&Wu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vqt=Wu&&Wu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&h6l(e,t,n);return Z6l(e,t),e};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.FilesApiRoutesUploadFileMultiPartBodyParams$=Wu.FilesApiRoutesUploadFileMultiPartBodyParams$outboundSchema=Wu.FilesApiRoutesUploadFileMultiPartBodyParams$inboundSchema=void 0;Wu.filesApiRoutesUploadFileMultiPartBodyParamsToJSON=V6l;Wu.filesApiRoutesUploadFileMultiPartBodyParamsFromJSON=Y6l;var Yqt=Vqt(se()),W6l=oe(),N6l=y_(),ome=Vqt(bt());Wu.FilesApiRoutesUploadFileMultiPartBodyParams$inboundSchema=Yqt.object({file:ome.FileT$inboundSchema,purpose:ome.FilePurpose$inboundSchema.optional()});Wu.FilesApiRoutesUploadFileMultiPartBodyParams$outboundSchema=Yqt.object({file:ome.FileT$outboundSchema.or(N6l.blobLikeSchema),purpose:ome.FilePurpose$outboundSchema.optional()});var Nqt;(function(t){t.inboundSchema=Wu.FilesApiRoutesUploadFileMultiPartBodyParams$inboundSchema,t.outboundSchema=Wu.FilesApiRoutesUploadFileMultiPartBodyParams$outboundSchema})(Nqt||(Wu.FilesApiRoutesUploadFileMultiPartBodyParams$=Nqt={}));function V6l(t){return JSON.stringify(Wu.FilesApiRoutesUploadFileMultiPartBodyParams$outboundSchema.parse(t))}function Y6l(t){return(0,W6l.safeParse)(t,e=>Wu.FilesApiRoutesUploadFileMultiPartBodyParams$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'FilesApiRoutesUploadFileMultiPartBodyParams' from JSON")}});var Aqt=f(Nu=>{"use strict";var g6l=Nu&&Nu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),R6l=Nu&&Nu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),y6l=Nu&&Nu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&g6l(e,t,n);return R6l(e,t),e};Object.defineProperty(Nu,"__esModule",{value:!0});Nu.JobsApiRoutesBatchCancelBatchJobRequest$=Nu.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema=Nu.JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema=void 0;Nu.jobsApiRoutesBatchCancelBatchJobRequestToJSON=F6l;Nu.jobsApiRoutesBatchCancelBatchJobRequestFromJSON=v6l;var ime=y6l(se()),yqt=be(),A6l=oe();Nu.JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema=ime.object({job_id:ime.string()}).transform(t=>(0,yqt.remap)(t,{job_id:"jobId"}));Nu.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema=ime.object({jobId:ime.string()}).transform(t=>(0,yqt.remap)(t,{jobId:"job_id"}));var Rqt;(function(t){t.inboundSchema=Nu.JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema,t.outboundSchema=Nu.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema})(Rqt||(Nu.JobsApiRoutesBatchCancelBatchJobRequest$=Rqt={}));function F6l(t){return JSON.stringify(Nu.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema.parse(t))}function v6l(t){return(0,A6l.safeParse)(t,e=>Nu.JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesBatchCancelBatchJobRequest' from JSON")}});var fqt=f(Vu=>{"use strict";var f6l=Vu&&Vu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),X6l=Vu&&Vu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),w6l=Vu&&Vu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&f6l(e,t,n);return X6l(e,t),e};Object.defineProperty(Vu,"__esModule",{value:!0});Vu.JobsApiRoutesBatchGetBatchJobRequest$=Vu.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema=Vu.JobsApiRoutesBatchGetBatchJobRequest$inboundSchema=void 0;Vu.jobsApiRoutesBatchGetBatchJobRequestToJSON=Q6l;Vu.jobsApiRoutesBatchGetBatchJobRequestFromJSON=E6l;var sme=w6l(se()),vqt=be(),H6l=oe();Vu.JobsApiRoutesBatchGetBatchJobRequest$inboundSchema=sme.object({job_id:sme.string()}).transform(t=>(0,vqt.remap)(t,{job_id:"jobId"}));Vu.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema=sme.object({jobId:sme.string()}).transform(t=>(0,vqt.remap)(t,{jobId:"job_id"}));var Fqt;(function(t){t.inboundSchema=Vu.JobsApiRoutesBatchGetBatchJobRequest$inboundSchema,t.outboundSchema=Vu.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema})(Fqt||(Vu.JobsApiRoutesBatchGetBatchJobRequest$=Fqt={}));function Q6l(t){return JSON.stringify(Vu.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema.parse(t))}function E6l(t){return(0,H6l.safeParse)(t,e=>Vu.JobsApiRoutesBatchGetBatchJobRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesBatchGetBatchJobRequest' from JSON")}});var Eqt=f(Yu=>{"use strict";var J6l=Yu&&Yu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),C6l=Yu&&Yu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wqt=Yu&&Yu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&J6l(e,t,n);return C6l(e,t),e};Object.defineProperty(Yu,"__esModule",{value:!0});Yu.JobsApiRoutesBatchGetBatchJobsRequest$=Yu.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema=Yu.JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema=void 0;Yu.jobsApiRoutesBatchGetBatchJobsRequestToJSON=k6l;Yu.jobsApiRoutesBatchGetBatchJobsRequestFromJSON=x6l;var Vc=wqt(se()),Hqt=be(),L6l=oe(),Qqt=wqt(bt());Yu.JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema=Vc.object({page:Vc.number().int().default(0),page_size:Vc.number().int().default(100),model:Vc.nullable(Vc.string()).optional(),metadata:Vc.nullable(Vc.record(Vc.any())).optional(),created_after:Vc.nullable(Vc.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),created_by_me:Vc.boolean().default(!1),status:Vc.nullable(Vc.array(Qqt.BatchJobStatus$inboundSchema)).optional()}).transform(t=>(0,Hqt.remap)(t,{page_size:"pageSize",created_after:"createdAfter",created_by_me:"createdByMe"}));Yu.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema=Vc.object({page:Vc.number().int().default(0),pageSize:Vc.number().int().default(100),model:Vc.nullable(Vc.string()).optional(),metadata:Vc.nullable(Vc.record(Vc.any())).optional(),createdAfter:Vc.nullable(Vc.date().transform(t=>t.toISOString())).optional(),createdByMe:Vc.boolean().default(!1),status:Vc.nullable(Vc.array(Qqt.BatchJobStatus$outboundSchema)).optional()}).transform(t=>(0,Hqt.remap)(t,{pageSize:"page_size",createdAfter:"created_after",createdByMe:"created_by_me"}));var Xqt;(function(t){t.inboundSchema=Yu.JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema,t.outboundSchema=Yu.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema})(Xqt||(Yu.JobsApiRoutesBatchGetBatchJobsRequest$=Xqt={}));function k6l(t){return JSON.stringify(Yu.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema.parse(t))}function x6l(t){return(0,L6l.safeParse)(t,e=>Yu.JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesBatchGetBatchJobsRequest' from JSON")}});var Lqt=f(gu=>{"use strict";var j6l=gu&&gu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),O6l=gu&&gu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),U6l=gu&&gu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&j6l(e,t,n);return O6l(e,t),e};Object.defineProperty(gu,"__esModule",{value:!0});gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$=gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema=gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$inboundSchema=void 0;gu.jobsApiRoutesFineTuningArchiveFineTunedModelRequestToJSON=B6l;gu.jobsApiRoutesFineTuningArchiveFineTunedModelRequestFromJSON=S6l;var ume=U6l(se()),Cqt=be(),z6l=oe();gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$inboundSchema=ume.object({model_id:ume.string()}).transform(t=>(0,Cqt.remap)(t,{model_id:"modelId"}));gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema=ume.object({modelId:ume.string()}).transform(t=>(0,Cqt.remap)(t,{modelId:"model_id"}));var Jqt;(function(t){t.inboundSchema=gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$inboundSchema,t.outboundSchema=gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema})(Jqt||(gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$=Jqt={}));function B6l(t){return JSON.stringify(gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema.parse(t))}function S6l(t){return(0,z6l.safeParse)(t,e=>gu.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningArchiveFineTunedModelRequest' from JSON")}});var zqt=f(rr=>{"use strict";var M6l=rr&&rr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),T6l=rr&&rr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jqt=rr&&rr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&M6l(e,t,n);return T6l(e,t),e};Object.defineProperty(rr,"__esModule",{value:!0});rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$=rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$outboundSchema=rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema=rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$=rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema=rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$inboundSchema=void 0;rr.jobsApiRoutesFineTuningCancelFineTuningJobRequestToJSON=D6l;rr.jobsApiRoutesFineTuningCancelFineTuningJobRequestFromJSON=K6l;rr.jobsApiRoutesFineTuningCancelFineTuningJobResponseToJSON=_6l;rr.jobsApiRoutesFineTuningCancelFineTuningJobResponseFromJSON=P6l;var kp=jqt(se()),Oqt=be(),Uqt=oe(),dme=jqt(bt());rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$inboundSchema=kp.object({job_id:kp.string()}).transform(t=>(0,Oqt.remap)(t,{job_id:"jobId"}));rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema=kp.object({jobId:kp.string()}).transform(t=>(0,Oqt.remap)(t,{jobId:"job_id"}));var kqt;(function(t){t.inboundSchema=rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$inboundSchema,t.outboundSchema=rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema})(kqt||(rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$=kqt={}));function D6l(t){return JSON.stringify(rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema.parse(t))}function K6l(t){return(0,Uqt.safeParse)(t,e=>rr.JobsApiRoutesFineTuningCancelFineTuningJobRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningCancelFineTuningJobRequest' from JSON")}rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema=kp.union([dme.ClassifierDetailedJobOut$inboundSchema.and(kp.object({job_type:kp.literal("classifier")}).transform(t=>({jobType:t.job_type}))),dme.CompletionDetailedJobOut$inboundSchema.and(kp.object({job_type:kp.literal("completion")}).transform(t=>({jobType:t.job_type})))]);rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$outboundSchema=kp.union([dme.ClassifierDetailedJobOut$outboundSchema.and(kp.object({jobType:kp.literal("classifier")}).transform(t=>({job_type:t.jobType}))),dme.CompletionDetailedJobOut$outboundSchema.and(kp.object({jobType:kp.literal("completion")}).transform(t=>({job_type:t.jobType})))]);var xqt;(function(t){t.inboundSchema=rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema,t.outboundSchema=rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$outboundSchema})(xqt||(rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$=xqt={}));function _6l(t){return JSON.stringify(rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$outboundSchema.parse(t))}function P6l(t){return(0,Uqt.safeParse)(t,e=>rr.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningCancelFineTuningJobResponse' from JSON")}});var Dqt=f(cr=>{"use strict";var q6l=cr&&cr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),$6l=cr&&cr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Mqt=cr&&cr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&q6l(e,t,n);return $6l(e,t),e};Object.defineProperty(cr,"__esModule",{value:!0});cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$=cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$outboundSchema=cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema=cr.One$=cr.One$outboundSchema=cr.One$inboundSchema=void 0;cr.oneToJSON=eql;cr.oneFromJSON=tql;cr.jobsApiRoutesFineTuningCreateFineTuningJobResponseToJSON=nql;cr.jobsApiRoutesFineTuningCreateFineTuningJobResponseFromJSON=lql;var Co=Mqt(se()),Tqt=oe(),yR=Mqt(bt());cr.One$inboundSchema=Co.union([yR.ClassifierJobOut$inboundSchema.and(Co.object({job_type:Co.literal("classifier")}).transform(t=>({jobType:t.job_type}))),yR.CompletionJobOut$inboundSchema.and(Co.object({job_type:Co.literal("completion")}).transform(t=>({jobType:t.job_type})))]);cr.One$outboundSchema=Co.union([yR.ClassifierJobOut$outboundSchema.and(Co.object({jobType:Co.literal("classifier")}).transform(t=>({job_type:t.jobType}))),yR.CompletionJobOut$outboundSchema.and(Co.object({jobType:Co.literal("completion")}).transform(t=>({job_type:t.jobType})))]);var Bqt;(function(t){t.inboundSchema=cr.One$inboundSchema,t.outboundSchema=cr.One$outboundSchema})(Bqt||(cr.One$=Bqt={}));function eql(t){return JSON.stringify(cr.One$outboundSchema.parse(t))}function tql(t){return(0,Tqt.safeParse)(t,e=>cr.One$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'One' from JSON")}cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema=Co.union([yR.LegacyJobMetadataOut$inboundSchema,Co.union([yR.ClassifierJobOut$inboundSchema.and(Co.object({job_type:Co.literal("classifier")}).transform(t=>({jobType:t.job_type}))),yR.CompletionJobOut$inboundSchema.and(Co.object({job_type:Co.literal("completion")}).transform(t=>({jobType:t.job_type})))])]);cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$outboundSchema=Co.union([yR.LegacyJobMetadataOut$outboundSchema,Co.union([yR.ClassifierJobOut$outboundSchema.and(Co.object({jobType:Co.literal("classifier")}).transform(t=>({job_type:t.jobType}))),yR.CompletionJobOut$outboundSchema.and(Co.object({jobType:Co.literal("completion")}).transform(t=>({job_type:t.jobType})))])]);var Sqt;(function(t){t.inboundSchema=cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema,t.outboundSchema=cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$outboundSchema})(Sqt||(cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$=Sqt={}));function nql(t){return JSON.stringify(cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$outboundSchema.parse(t))}function lql(t){return(0,Tqt.safeParse)(t,e=>cr.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningCreateFineTuningJobResponse' from JSON")}});var e7t=f(or=>{"use strict";var Iql=or&&or.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),aql=or&&or.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pqt=or&&or.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Iql(e,t,n);return aql(e,t),e};Object.defineProperty(or,"__esModule",{value:!0});or.JobsApiRoutesFineTuningGetFineTuningJobResponse$=or.JobsApiRoutesFineTuningGetFineTuningJobResponse$outboundSchema=or.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema=or.JobsApiRoutesFineTuningGetFineTuningJobRequest$=or.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema=or.JobsApiRoutesFineTuningGetFineTuningJobRequest$inboundSchema=void 0;or.jobsApiRoutesFineTuningGetFineTuningJobRequestToJSON=rql;or.jobsApiRoutesFineTuningGetFineTuningJobRequestFromJSON=cql;or.jobsApiRoutesFineTuningGetFineTuningJobResponseToJSON=oql;or.jobsApiRoutesFineTuningGetFineTuningJobResponseFromJSON=iql;var xp=Pqt(se()),qqt=be(),$qt=oe(),Gme=Pqt(bt());or.JobsApiRoutesFineTuningGetFineTuningJobRequest$inboundSchema=xp.object({job_id:xp.string()}).transform(t=>(0,qqt.remap)(t,{job_id:"jobId"}));or.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema=xp.object({jobId:xp.string()}).transform(t=>(0,qqt.remap)(t,{jobId:"job_id"}));var Kqt;(function(t){t.inboundSchema=or.JobsApiRoutesFineTuningGetFineTuningJobRequest$inboundSchema,t.outboundSchema=or.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema})(Kqt||(or.JobsApiRoutesFineTuningGetFineTuningJobRequest$=Kqt={}));function rql(t){return JSON.stringify(or.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema.parse(t))}function cql(t){return(0,$qt.safeParse)(t,e=>or.JobsApiRoutesFineTuningGetFineTuningJobRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningGetFineTuningJobRequest' from JSON")}or.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema=xp.union([Gme.ClassifierDetailedJobOut$inboundSchema.and(xp.object({job_type:xp.literal("classifier")}).transform(t=>({jobType:t.job_type}))),Gme.CompletionDetailedJobOut$inboundSchema.and(xp.object({job_type:xp.literal("completion")}).transform(t=>({jobType:t.job_type})))]);or.JobsApiRoutesFineTuningGetFineTuningJobResponse$outboundSchema=xp.union([Gme.ClassifierDetailedJobOut$outboundSchema.and(xp.object({jobType:xp.literal("classifier")}).transform(t=>({job_type:t.jobType}))),Gme.CompletionDetailedJobOut$outboundSchema.and(xp.object({jobType:xp.literal("completion")}).transform(t=>({job_type:t.jobType})))]);var _qt;(function(t){t.inboundSchema=or.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema,t.outboundSchema=or.JobsApiRoutesFineTuningGetFineTuningJobResponse$outboundSchema})(_qt||(or.JobsApiRoutesFineTuningGetFineTuningJobResponse$=_qt={}));function oql(t){return JSON.stringify(or.JobsApiRoutesFineTuningGetFineTuningJobResponse$outboundSchema.parse(t))}function iql(t){return(0,$qt.safeParse)(t,e=>or.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningGetFineTuningJobResponse' from JSON")}});var I7t=f(Na=>{"use strict";var sql=Na&&Na.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),uql=Na&&Na.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dql=Na&&Na.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&sql(e,t,n);return uql(e,t),e};Object.defineProperty(Na,"__esModule",{value:!0});Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$=Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema=Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$inboundSchema=Na.Status$=Na.Status$outboundSchema=Na.Status$inboundSchema=Na.Status=void 0;Na.jobsApiRoutesFineTuningGetFineTuningJobsRequestToJSON=bql;Na.jobsApiRoutesFineTuningGetFineTuningJobsRequestFromJSON=mql;var vI=dql(se()),l7t=be(),Gql=oe();Na.Status={Queued:"QUEUED",Started:"STARTED",Validating:"VALIDATING",Validated:"VALIDATED",Running:"RUNNING",FailedValidation:"FAILED_VALIDATION",Failed:"FAILED",Success:"SUCCESS",Cancelled:"CANCELLED",CancellationRequested:"CANCELLATION_REQUESTED"};Na.Status$inboundSchema=vI.nativeEnum(Na.Status);Na.Status$outboundSchema=Na.Status$inboundSchema;var t7t;(function(t){t.inboundSchema=Na.Status$inboundSchema,t.outboundSchema=Na.Status$outboundSchema})(t7t||(Na.Status$=t7t={}));Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$inboundSchema=vI.object({page:vI.number().int().default(0),page_size:vI.number().int().default(100),model:vI.nullable(vI.string()).optional(),created_after:vI.nullable(vI.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),created_before:vI.nullable(vI.string().datetime({offset:!0}).transform(t=>new Date(t))).optional(),created_by_me:vI.boolean().default(!1),status:vI.nullable(Na.Status$inboundSchema).optional(),wandb_project:vI.nullable(vI.string()).optional(),wandb_name:vI.nullable(vI.string()).optional(),suffix:vI.nullable(vI.string()).optional()}).transform(t=>(0,l7t.remap)(t,{page_size:"pageSize",created_after:"createdAfter",created_before:"createdBefore",created_by_me:"createdByMe",wandb_project:"wandbProject",wandb_name:"wandbName"}));Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema=vI.object({page:vI.number().int().default(0),pageSize:vI.number().int().default(100),model:vI.nullable(vI.string()).optional(),createdAfter:vI.nullable(vI.date().transform(t=>t.toISOString())).optional(),createdBefore:vI.nullable(vI.date().transform(t=>t.toISOString())).optional(),createdByMe:vI.boolean().default(!1),status:vI.nullable(Na.Status$outboundSchema).optional(),wandbProject:vI.nullable(vI.string()).optional(),wandbName:vI.nullable(vI.string()).optional(),suffix:vI.nullable(vI.string()).optional()}).transform(t=>(0,l7t.remap)(t,{pageSize:"page_size",createdAfter:"created_after",createdBefore:"created_before",createdByMe:"created_by_me",wandbProject:"wandb_project",wandbName:"wandb_name"}));var n7t;(function(t){t.inboundSchema=Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$inboundSchema,t.outboundSchema=Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema})(n7t||(Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$=n7t={}));function bql(t){return JSON.stringify(Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema.parse(t))}function mql(t){return(0,Gql.safeParse)(t,e=>Na.JobsApiRoutesFineTuningGetFineTuningJobsRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningGetFineTuningJobsRequest' from JSON")}});var s7t=f(ir=>{"use strict";var pql=ir&&ir.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),hql=ir&&ir.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c7t=ir&&ir.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&pql(e,t,n);return hql(e,t),e};Object.defineProperty(ir,"__esModule",{value:!0});ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$=ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$outboundSchema=ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema=ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$=ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema=ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$inboundSchema=void 0;ir.jobsApiRoutesFineTuningStartFineTuningJobRequestToJSON=Zql;ir.jobsApiRoutesFineTuningStartFineTuningJobRequestFromJSON=Wql;ir.jobsApiRoutesFineTuningStartFineTuningJobResponseToJSON=Nql;ir.jobsApiRoutesFineTuningStartFineTuningJobResponseFromJSON=Vql;var jp=c7t(se()),o7t=be(),i7t=oe(),bme=c7t(bt());ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$inboundSchema=jp.object({job_id:jp.string()}).transform(t=>(0,o7t.remap)(t,{job_id:"jobId"}));ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema=jp.object({jobId:jp.string()}).transform(t=>(0,o7t.remap)(t,{jobId:"job_id"}));var a7t;(function(t){t.inboundSchema=ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$inboundSchema,t.outboundSchema=ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema})(a7t||(ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$=a7t={}));function Zql(t){return JSON.stringify(ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema.parse(t))}function Wql(t){return(0,i7t.safeParse)(t,e=>ir.JobsApiRoutesFineTuningStartFineTuningJobRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningStartFineTuningJobRequest' from JSON")}ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema=jp.union([bme.ClassifierDetailedJobOut$inboundSchema.and(jp.object({job_type:jp.literal("classifier")}).transform(t=>({jobType:t.job_type}))),bme.CompletionDetailedJobOut$inboundSchema.and(jp.object({job_type:jp.literal("completion")}).transform(t=>({jobType:t.job_type})))]);ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$outboundSchema=jp.union([bme.ClassifierDetailedJobOut$outboundSchema.and(jp.object({jobType:jp.literal("classifier")}).transform(t=>({job_type:t.jobType}))),bme.CompletionDetailedJobOut$outboundSchema.and(jp.object({jobType:jp.literal("completion")}).transform(t=>({job_type:t.jobType})))]);var r7t;(function(t){t.inboundSchema=ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema,t.outboundSchema=ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$outboundSchema})(r7t||(ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$=r7t={}));function Nql(t){return JSON.stringify(ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$outboundSchema.parse(t))}function Vql(t){return(0,i7t.safeParse)(t,e=>ir.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningStartFineTuningJobResponse' from JSON")}});var G7t=f(Ru=>{"use strict";var Yql=Ru&&Ru.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),gql=Ru&&Ru.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Rql=Ru&&Ru.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Yql(e,t,n);return gql(e,t),e};Object.defineProperty(Ru,"__esModule",{value:!0});Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$=Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema=Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$inboundSchema=void 0;Ru.jobsApiRoutesFineTuningUnarchiveFineTunedModelRequestToJSON=Aql;Ru.jobsApiRoutesFineTuningUnarchiveFineTunedModelRequestFromJSON=Fql;var mme=Rql(se()),d7t=be(),yql=oe();Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$inboundSchema=mme.object({model_id:mme.string()}).transform(t=>(0,d7t.remap)(t,{model_id:"modelId"}));Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema=mme.object({modelId:mme.string()}).transform(t=>(0,d7t.remap)(t,{modelId:"model_id"}));var u7t;(function(t){t.inboundSchema=Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$inboundSchema,t.outboundSchema=Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema})(u7t||(Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$=u7t={}));function Aql(t){return JSON.stringify(Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema.parse(t))}function Fql(t){return(0,yql.safeParse)(t,e=>Ru.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest' from JSON")}});var W7t=f(sr=>{"use strict";var vql=sr&&sr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),fql=sr&&sr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),p7t=sr&&sr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&vql(e,t,n);return fql(e,t),e};Object.defineProperty(sr,"__esModule",{value:!0});sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$=sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$outboundSchema=sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema=sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$=sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema=sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$inboundSchema=void 0;sr.jobsApiRoutesFineTuningUpdateFineTunedModelRequestToJSON=Xql;sr.jobsApiRoutesFineTuningUpdateFineTunedModelRequestFromJSON=wql;sr.jobsApiRoutesFineTuningUpdateFineTunedModelResponseToJSON=Hql;sr.jobsApiRoutesFineTuningUpdateFineTunedModelResponseFromJSON=Qql;var Op=p7t(se()),h7t=be(),Z7t=oe(),uO=p7t(bt());sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$inboundSchema=Op.object({model_id:Op.string(),UpdateFTModelIn:uO.UpdateFTModelIn$inboundSchema}).transform(t=>(0,h7t.remap)(t,{model_id:"modelId",UpdateFTModelIn:"updateFTModelIn"}));sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema=Op.object({modelId:Op.string(),updateFTModelIn:uO.UpdateFTModelIn$outboundSchema}).transform(t=>(0,h7t.remap)(t,{modelId:"model_id",updateFTModelIn:"UpdateFTModelIn"}));var b7t;(function(t){t.inboundSchema=sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$inboundSchema,t.outboundSchema=sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema})(b7t||(sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$=b7t={}));function Xql(t){return JSON.stringify(sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema.parse(t))}function wql(t){return(0,Z7t.safeParse)(t,e=>sr.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningUpdateFineTunedModelRequest' from JSON")}sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema=Op.union([uO.CompletionFTModelOut$inboundSchema.and(Op.object({model_type:Op.literal("completion")}).transform(t=>({modelType:t.model_type}))),uO.ClassifierFTModelOut$inboundSchema.and(Op.object({model_type:Op.literal("classifier")}).transform(t=>({modelType:t.model_type})))]);sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$outboundSchema=Op.union([uO.CompletionFTModelOut$outboundSchema.and(Op.object({modelType:Op.literal("completion")}).transform(t=>({model_type:t.modelType}))),uO.ClassifierFTModelOut$outboundSchema.and(Op.object({modelType:Op.literal("classifier")}).transform(t=>({model_type:t.modelType})))]);var m7t;(function(t){t.inboundSchema=sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema,t.outboundSchema=sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$outboundSchema})(m7t||(sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$=m7t={}));function Hql(t){return JSON.stringify(sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$outboundSchema.parse(t))}function Qql(t){return(0,Z7t.safeParse)(t,e=>sr.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'JobsApiRoutesFineTuningUpdateFineTunedModelResponse' from JSON")}});var Y7t=f(yu=>{"use strict";var Eql=yu&&yu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Jql=yu&&yu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cql=yu&&yu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Eql(e,t,n);return Jql(e,t),e};Object.defineProperty(yu,"__esModule",{value:!0});yu.LibrariesDeleteV1Request$=yu.LibrariesDeleteV1Request$outboundSchema=yu.LibrariesDeleteV1Request$inboundSchema=void 0;yu.librariesDeleteV1RequestToJSON=kql;yu.librariesDeleteV1RequestFromJSON=xql;var pme=Cql(se()),V7t=be(),Lql=oe();yu.LibrariesDeleteV1Request$inboundSchema=pme.object({library_id:pme.string()}).transform(t=>(0,V7t.remap)(t,{library_id:"libraryId"}));yu.LibrariesDeleteV1Request$outboundSchema=pme.object({libraryId:pme.string()}).transform(t=>(0,V7t.remap)(t,{libraryId:"library_id"}));var N7t;(function(t){t.inboundSchema=yu.LibrariesDeleteV1Request$inboundSchema,t.outboundSchema=yu.LibrariesDeleteV1Request$outboundSchema})(N7t||(yu.LibrariesDeleteV1Request$=N7t={}));function kql(t){return JSON.stringify(yu.LibrariesDeleteV1Request$outboundSchema.parse(t))}function xql(t){return(0,Lql.safeParse)(t,e=>yu.LibrariesDeleteV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDeleteV1Request' from JSON")}});var y7t=f(Au=>{"use strict";var jql=Au&&Au.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Oql=Au&&Au.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Uql=Au&&Au.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&jql(e,t,n);return Oql(e,t),e};Object.defineProperty(Au,"__esModule",{value:!0});Au.LibrariesDocumentsDeleteV1Request$=Au.LibrariesDocumentsDeleteV1Request$outboundSchema=Au.LibrariesDocumentsDeleteV1Request$inboundSchema=void 0;Au.librariesDocumentsDeleteV1RequestToJSON=Bql;Au.librariesDocumentsDeleteV1RequestFromJSON=Sql;var dO=Uql(se()),R7t=be(),zql=oe();Au.LibrariesDocumentsDeleteV1Request$inboundSchema=dO.object({library_id:dO.string(),document_id:dO.string()}).transform(t=>(0,R7t.remap)(t,{library_id:"libraryId",document_id:"documentId"}));Au.LibrariesDocumentsDeleteV1Request$outboundSchema=dO.object({libraryId:dO.string(),documentId:dO.string()}).transform(t=>(0,R7t.remap)(t,{libraryId:"library_id",documentId:"document_id"}));var g7t;(function(t){t.inboundSchema=Au.LibrariesDocumentsDeleteV1Request$inboundSchema,t.outboundSchema=Au.LibrariesDocumentsDeleteV1Request$outboundSchema})(g7t||(Au.LibrariesDocumentsDeleteV1Request$=g7t={}));function Bql(t){return JSON.stringify(Au.LibrariesDocumentsDeleteV1Request$outboundSchema.parse(t))}function Sql(t){return(0,zql.safeParse)(t,e=>Au.LibrariesDocumentsDeleteV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsDeleteV1Request' from JSON")}});var v7t=f(Fu=>{"use strict";var Mql=Fu&&Fu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Tql=Fu&&Fu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Dql=Fu&&Fu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Mql(e,t,n);return Tql(e,t),e};Object.defineProperty(Fu,"__esModule",{value:!0});Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$=Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema=Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$inboundSchema=void 0;Fu.librariesDocumentsGetExtractedTextSignedUrlV1RequestToJSON=_ql;Fu.librariesDocumentsGetExtractedTextSignedUrlV1RequestFromJSON=Pql;var GO=Dql(se()),F7t=be(),Kql=oe();Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$inboundSchema=GO.object({library_id:GO.string(),document_id:GO.string()}).transform(t=>(0,F7t.remap)(t,{library_id:"libraryId",document_id:"documentId"}));Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema=GO.object({libraryId:GO.string(),documentId:GO.string()}).transform(t=>(0,F7t.remap)(t,{libraryId:"library_id",documentId:"document_id"}));var A7t;(function(t){t.inboundSchema=Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$inboundSchema,t.outboundSchema=Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema})(A7t||(Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$=A7t={}));function _ql(t){return JSON.stringify(Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema.parse(t))}function Pql(t){return(0,Kql.safeParse)(t,e=>Fu.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsGetExtractedTextSignedUrlV1Request' from JSON")}});var w7t=f(vu=>{"use strict";var qql=vu&&vu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),$ql=vu&&vu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e7l=vu&&vu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&qql(e,t,n);return $ql(e,t),e};Object.defineProperty(vu,"__esModule",{value:!0});vu.LibrariesDocumentsGetSignedUrlV1Request$=vu.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema=vu.LibrariesDocumentsGetSignedUrlV1Request$inboundSchema=void 0;vu.librariesDocumentsGetSignedUrlV1RequestToJSON=n7l;vu.librariesDocumentsGetSignedUrlV1RequestFromJSON=l7l;var bO=e7l(se()),X7t=be(),t7l=oe();vu.LibrariesDocumentsGetSignedUrlV1Request$inboundSchema=bO.object({library_id:bO.string(),document_id:bO.string()}).transform(t=>(0,X7t.remap)(t,{library_id:"libraryId",document_id:"documentId"}));vu.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema=bO.object({libraryId:bO.string(),documentId:bO.string()}).transform(t=>(0,X7t.remap)(t,{libraryId:"library_id",documentId:"document_id"}));var f7t;(function(t){t.inboundSchema=vu.LibrariesDocumentsGetSignedUrlV1Request$inboundSchema,t.outboundSchema=vu.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema})(f7t||(vu.LibrariesDocumentsGetSignedUrlV1Request$=f7t={}));function n7l(t){return JSON.stringify(vu.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema.parse(t))}function l7l(t){return(0,t7l.safeParse)(t,e=>vu.LibrariesDocumentsGetSignedUrlV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsGetSignedUrlV1Request' from JSON")}});var E7t=f(fu=>{"use strict";var I7l=fu&&fu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),a7l=fu&&fu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r7l=fu&&fu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&I7l(e,t,n);return a7l(e,t),e};Object.defineProperty(fu,"__esModule",{value:!0});fu.LibrariesDocumentsGetStatusV1Request$=fu.LibrariesDocumentsGetStatusV1Request$outboundSchema=fu.LibrariesDocumentsGetStatusV1Request$inboundSchema=void 0;fu.librariesDocumentsGetStatusV1RequestToJSON=o7l;fu.librariesDocumentsGetStatusV1RequestFromJSON=i7l;var mO=r7l(se()),Q7t=be(),c7l=oe();fu.LibrariesDocumentsGetStatusV1Request$inboundSchema=mO.object({library_id:mO.string(),document_id:mO.string()}).transform(t=>(0,Q7t.remap)(t,{library_id:"libraryId",document_id:"documentId"}));fu.LibrariesDocumentsGetStatusV1Request$outboundSchema=mO.object({libraryId:mO.string(),documentId:mO.string()}).transform(t=>(0,Q7t.remap)(t,{libraryId:"library_id",documentId:"document_id"}));var H7t;(function(t){t.inboundSchema=fu.LibrariesDocumentsGetStatusV1Request$inboundSchema,t.outboundSchema=fu.LibrariesDocumentsGetStatusV1Request$outboundSchema})(H7t||(fu.LibrariesDocumentsGetStatusV1Request$=H7t={}));function o7l(t){return JSON.stringify(fu.LibrariesDocumentsGetStatusV1Request$outboundSchema.parse(t))}function i7l(t){return(0,c7l.safeParse)(t,e=>fu.LibrariesDocumentsGetStatusV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsGetStatusV1Request' from JSON")}});var L7t=f(Xu=>{"use strict";var s7l=Xu&&Xu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),u7l=Xu&&Xu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),d7l=Xu&&Xu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&s7l(e,t,n);return u7l(e,t),e};Object.defineProperty(Xu,"__esModule",{value:!0});Xu.LibrariesDocumentsGetTextContentV1Request$=Xu.LibrariesDocumentsGetTextContentV1Request$outboundSchema=Xu.LibrariesDocumentsGetTextContentV1Request$inboundSchema=void 0;Xu.librariesDocumentsGetTextContentV1RequestToJSON=b7l;Xu.librariesDocumentsGetTextContentV1RequestFromJSON=m7l;var pO=d7l(se()),C7t=be(),G7l=oe();Xu.LibrariesDocumentsGetTextContentV1Request$inboundSchema=pO.object({library_id:pO.string(),document_id:pO.string()}).transform(t=>(0,C7t.remap)(t,{library_id:"libraryId",document_id:"documentId"}));Xu.LibrariesDocumentsGetTextContentV1Request$outboundSchema=pO.object({libraryId:pO.string(),documentId:pO.string()}).transform(t=>(0,C7t.remap)(t,{libraryId:"library_id",documentId:"document_id"}));var J7t;(function(t){t.inboundSchema=Xu.LibrariesDocumentsGetTextContentV1Request$inboundSchema,t.outboundSchema=Xu.LibrariesDocumentsGetTextContentV1Request$outboundSchema})(J7t||(Xu.LibrariesDocumentsGetTextContentV1Request$=J7t={}));function b7l(t){return JSON.stringify(Xu.LibrariesDocumentsGetTextContentV1Request$outboundSchema.parse(t))}function m7l(t){return(0,G7l.safeParse)(t,e=>Xu.LibrariesDocumentsGetTextContentV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsGetTextContentV1Request' from JSON")}});var j7t=f(wu=>{"use strict";var p7l=wu&&wu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),h7l=wu&&wu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Z7l=wu&&wu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&p7l(e,t,n);return h7l(e,t),e};Object.defineProperty(wu,"__esModule",{value:!0});wu.LibrariesDocumentsGetV1Request$=wu.LibrariesDocumentsGetV1Request$outboundSchema=wu.LibrariesDocumentsGetV1Request$inboundSchema=void 0;wu.librariesDocumentsGetV1RequestToJSON=N7l;wu.librariesDocumentsGetV1RequestFromJSON=V7l;var hO=Z7l(se()),x7t=be(),W7l=oe();wu.LibrariesDocumentsGetV1Request$inboundSchema=hO.object({library_id:hO.string(),document_id:hO.string()}).transform(t=>(0,x7t.remap)(t,{library_id:"libraryId",document_id:"documentId"}));wu.LibrariesDocumentsGetV1Request$outboundSchema=hO.object({libraryId:hO.string(),documentId:hO.string()}).transform(t=>(0,x7t.remap)(t,{libraryId:"library_id",documentId:"document_id"}));var k7t;(function(t){t.inboundSchema=wu.LibrariesDocumentsGetV1Request$inboundSchema,t.outboundSchema=wu.LibrariesDocumentsGetV1Request$outboundSchema})(k7t||(wu.LibrariesDocumentsGetV1Request$=k7t={}));function N7l(t){return JSON.stringify(wu.LibrariesDocumentsGetV1Request$outboundSchema.parse(t))}function V7l(t){return(0,W7l.safeParse)(t,e=>wu.LibrariesDocumentsGetV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsGetV1Request' from JSON")}});var z7t=f(Hu=>{"use strict";var Y7l=Hu&&Hu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),g7l=Hu&&Hu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),R7l=Hu&&Hu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Y7l(e,t,n);return g7l(e,t),e};Object.defineProperty(Hu,"__esModule",{value:!0});Hu.LibrariesDocumentsListV1Request$=Hu.LibrariesDocumentsListV1Request$outboundSchema=Hu.LibrariesDocumentsListV1Request$inboundSchema=void 0;Hu.librariesDocumentsListV1RequestToJSON=A7l;Hu.librariesDocumentsListV1RequestFromJSON=F7l;var kb=R7l(se()),U7t=be(),y7l=oe();Hu.LibrariesDocumentsListV1Request$inboundSchema=kb.object({library_id:kb.string(),search:kb.nullable(kb.string()).optional(),page_size:kb.number().int().default(100),page:kb.number().int().default(0),sort_by:kb.string().default("created_at"),sort_order:kb.string().default("desc")}).transform(t=>(0,U7t.remap)(t,{library_id:"libraryId",page_size:"pageSize",sort_by:"sortBy",sort_order:"sortOrder"}));Hu.LibrariesDocumentsListV1Request$outboundSchema=kb.object({libraryId:kb.string(),search:kb.nullable(kb.string()).optional(),pageSize:kb.number().int().default(100),page:kb.number().int().default(0),sortBy:kb.string().default("created_at"),sortOrder:kb.string().default("desc")}).transform(t=>(0,U7t.remap)(t,{libraryId:"library_id",pageSize:"page_size",sortBy:"sort_by",sortOrder:"sort_order"}));var O7t;(function(t){t.inboundSchema=Hu.LibrariesDocumentsListV1Request$inboundSchema,t.outboundSchema=Hu.LibrariesDocumentsListV1Request$outboundSchema})(O7t||(Hu.LibrariesDocumentsListV1Request$=O7t={}));function A7l(t){return JSON.stringify(Hu.LibrariesDocumentsListV1Request$outboundSchema.parse(t))}function F7l(t){return(0,y7l.safeParse)(t,e=>Hu.LibrariesDocumentsListV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsListV1Request' from JSON")}});var M7t=f(Qu=>{"use strict";var v7l=Qu&&Qu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),f7l=Qu&&Qu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),X7l=Qu&&Qu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&v7l(e,t,n);return f7l(e,t),e};Object.defineProperty(Qu,"__esModule",{value:!0});Qu.LibrariesDocumentsReprocessV1Request$=Qu.LibrariesDocumentsReprocessV1Request$outboundSchema=Qu.LibrariesDocumentsReprocessV1Request$inboundSchema=void 0;Qu.librariesDocumentsReprocessV1RequestToJSON=H7l;Qu.librariesDocumentsReprocessV1RequestFromJSON=Q7l;var ZO=X7l(se()),S7t=be(),w7l=oe();Qu.LibrariesDocumentsReprocessV1Request$inboundSchema=ZO.object({library_id:ZO.string(),document_id:ZO.string()}).transform(t=>(0,S7t.remap)(t,{library_id:"libraryId",document_id:"documentId"}));Qu.LibrariesDocumentsReprocessV1Request$outboundSchema=ZO.object({libraryId:ZO.string(),documentId:ZO.string()}).transform(t=>(0,S7t.remap)(t,{libraryId:"library_id",documentId:"document_id"}));var B7t;(function(t){t.inboundSchema=Qu.LibrariesDocumentsReprocessV1Request$inboundSchema,t.outboundSchema=Qu.LibrariesDocumentsReprocessV1Request$outboundSchema})(B7t||(Qu.LibrariesDocumentsReprocessV1Request$=B7t={}));function H7l(t){return JSON.stringify(Qu.LibrariesDocumentsReprocessV1Request$outboundSchema.parse(t))}function Q7l(t){return(0,w7l.safeParse)(t,e=>Qu.LibrariesDocumentsReprocessV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsReprocessV1Request' from JSON")}});var P7t=f(Eu=>{"use strict";var E7l=Eu&&Eu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),J7l=Eu&&Eu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),D7t=Eu&&Eu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&E7l(e,t,n);return J7l(e,t),e};Object.defineProperty(Eu,"__esModule",{value:!0});Eu.LibrariesDocumentsUpdateV1Request$=Eu.LibrariesDocumentsUpdateV1Request$outboundSchema=Eu.LibrariesDocumentsUpdateV1Request$inboundSchema=void 0;Eu.librariesDocumentsUpdateV1RequestToJSON=L7l;Eu.librariesDocumentsUpdateV1RequestFromJSON=k7l;var WO=D7t(se()),K7t=be(),C7l=oe(),_7t=D7t(bt());Eu.LibrariesDocumentsUpdateV1Request$inboundSchema=WO.object({library_id:WO.string(),document_id:WO.string(),DocumentUpdateIn:_7t.DocumentUpdateIn$inboundSchema}).transform(t=>(0,K7t.remap)(t,{library_id:"libraryId",document_id:"documentId",DocumentUpdateIn:"documentUpdateIn"}));Eu.LibrariesDocumentsUpdateV1Request$outboundSchema=WO.object({libraryId:WO.string(),documentId:WO.string(),documentUpdateIn:_7t.DocumentUpdateIn$outboundSchema}).transform(t=>(0,K7t.remap)(t,{libraryId:"library_id",documentId:"document_id",documentUpdateIn:"DocumentUpdateIn"}));var T7t;(function(t){t.inboundSchema=Eu.LibrariesDocumentsUpdateV1Request$inboundSchema,t.outboundSchema=Eu.LibrariesDocumentsUpdateV1Request$outboundSchema})(T7t||(Eu.LibrariesDocumentsUpdateV1Request$=T7t={}));function L7l(t){return JSON.stringify(Eu.LibrariesDocumentsUpdateV1Request$outboundSchema.parse(t))}function k7l(t){return(0,C7l.safeParse)(t,e=>Eu.LibrariesDocumentsUpdateV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsUpdateV1Request' from JSON")}});var I8t=f(Va=>{"use strict";var x7l=Va&&Va.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),j7l=Va&&Va.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e8t=Va&&Va.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&x7l(e,t,n);return j7l(e,t),e};Object.defineProperty(Va,"__esModule",{value:!0});Va.LibrariesDocumentsUploadV1Request$=Va.LibrariesDocumentsUploadV1Request$outboundSchema=Va.LibrariesDocumentsUploadV1Request$inboundSchema=Va.LibrariesDocumentsUploadV1DocumentUpload$=Va.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema=Va.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema=void 0;Va.librariesDocumentsUploadV1DocumentUploadToJSON=U7l;Va.librariesDocumentsUploadV1DocumentUploadFromJSON=z7l;Va.librariesDocumentsUploadV1RequestToJSON=B7l;Va.librariesDocumentsUploadV1RequestFromJSON=S7l;var Gw=e8t(se()),t8t=be(),n8t=oe(),O7l=y_(),l8t=e8t(bt());Va.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema=Gw.object({file:l8t.FileT$inboundSchema});Va.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema=Gw.object({file:l8t.FileT$outboundSchema.or(O7l.blobLikeSchema)});var q7t;(function(t){t.inboundSchema=Va.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema,t.outboundSchema=Va.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema})(q7t||(Va.LibrariesDocumentsUploadV1DocumentUpload$=q7t={}));function U7l(t){return JSON.stringify(Va.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema.parse(t))}function z7l(t){return(0,n8t.safeParse)(t,e=>Va.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsUploadV1DocumentUpload' from JSON")}Va.LibrariesDocumentsUploadV1Request$inboundSchema=Gw.object({library_id:Gw.string(),RequestBody:Gw.lazy(()=>Va.LibrariesDocumentsUploadV1DocumentUpload$inboundSchema)}).transform(t=>(0,t8t.remap)(t,{library_id:"libraryId",RequestBody:"requestBody"}));Va.LibrariesDocumentsUploadV1Request$outboundSchema=Gw.object({libraryId:Gw.string(),requestBody:Gw.lazy(()=>Va.LibrariesDocumentsUploadV1DocumentUpload$outboundSchema)}).transform(t=>(0,t8t.remap)(t,{libraryId:"library_id",requestBody:"RequestBody"}));var $7t;(function(t){t.inboundSchema=Va.LibrariesDocumentsUploadV1Request$inboundSchema,t.outboundSchema=Va.LibrariesDocumentsUploadV1Request$outboundSchema})($7t||(Va.LibrariesDocumentsUploadV1Request$=$7t={}));function B7l(t){return JSON.stringify(Va.LibrariesDocumentsUploadV1Request$outboundSchema.parse(t))}function S7l(t){return(0,n8t.safeParse)(t,e=>Va.LibrariesDocumentsUploadV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesDocumentsUploadV1Request' from JSON")}});var c8t=f(Ju=>{"use strict";var M7l=Ju&&Ju.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),T7l=Ju&&Ju.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),D7l=Ju&&Ju.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&M7l(e,t,n);return T7l(e,t),e};Object.defineProperty(Ju,"__esModule",{value:!0});Ju.LibrariesGetV1Request$=Ju.LibrariesGetV1Request$outboundSchema=Ju.LibrariesGetV1Request$inboundSchema=void 0;Ju.librariesGetV1RequestToJSON=_7l;Ju.librariesGetV1RequestFromJSON=P7l;var hme=D7l(se()),r8t=be(),K7l=oe();Ju.LibrariesGetV1Request$inboundSchema=hme.object({library_id:hme.string()}).transform(t=>(0,r8t.remap)(t,{library_id:"libraryId"}));Ju.LibrariesGetV1Request$outboundSchema=hme.object({libraryId:hme.string()}).transform(t=>(0,r8t.remap)(t,{libraryId:"library_id"}));var a8t;(function(t){t.inboundSchema=Ju.LibrariesGetV1Request$inboundSchema,t.outboundSchema=Ju.LibrariesGetV1Request$outboundSchema})(a8t||(Ju.LibrariesGetV1Request$=a8t={}));function _7l(t){return JSON.stringify(Ju.LibrariesGetV1Request$outboundSchema.parse(t))}function P7l(t){return(0,K7l.safeParse)(t,e=>Ju.LibrariesGetV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesGetV1Request' from JSON")}});var d8t=f(Cu=>{"use strict";var q7l=Cu&&Cu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),$7l=Cu&&Cu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i8t=Cu&&Cu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&q7l(e,t,n);return $7l(e,t),e};Object.defineProperty(Cu,"__esModule",{value:!0});Cu.LibrariesShareCreateV1Request$=Cu.LibrariesShareCreateV1Request$outboundSchema=Cu.LibrariesShareCreateV1Request$inboundSchema=void 0;Cu.librariesShareCreateV1RequestToJSON=t8l;Cu.librariesShareCreateV1RequestFromJSON=n8l;var Zme=i8t(se()),s8t=be(),e8l=oe(),u8t=i8t(bt());Cu.LibrariesShareCreateV1Request$inboundSchema=Zme.object({library_id:Zme.string(),SharingIn:u8t.SharingIn$inboundSchema}).transform(t=>(0,s8t.remap)(t,{library_id:"libraryId",SharingIn:"sharingIn"}));Cu.LibrariesShareCreateV1Request$outboundSchema=Zme.object({libraryId:Zme.string(),sharingIn:u8t.SharingIn$outboundSchema}).transform(t=>(0,s8t.remap)(t,{libraryId:"library_id",sharingIn:"SharingIn"}));var o8t;(function(t){t.inboundSchema=Cu.LibrariesShareCreateV1Request$inboundSchema,t.outboundSchema=Cu.LibrariesShareCreateV1Request$outboundSchema})(o8t||(Cu.LibrariesShareCreateV1Request$=o8t={}));function t8l(t){return JSON.stringify(Cu.LibrariesShareCreateV1Request$outboundSchema.parse(t))}function n8l(t){return(0,e8l.safeParse)(t,e=>Cu.LibrariesShareCreateV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesShareCreateV1Request' from JSON")}});var h8t=f(Lu=>{"use strict";var l8l=Lu&&Lu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),I8l=Lu&&Lu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b8t=Lu&&Lu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&l8l(e,t,n);return I8l(e,t),e};Object.defineProperty(Lu,"__esModule",{value:!0});Lu.LibrariesShareDeleteV1Request$=Lu.LibrariesShareDeleteV1Request$outboundSchema=Lu.LibrariesShareDeleteV1Request$inboundSchema=void 0;Lu.librariesShareDeleteV1RequestToJSON=r8l;Lu.librariesShareDeleteV1RequestFromJSON=c8l;var Wme=b8t(se()),m8t=be(),a8l=oe(),p8t=b8t(bt());Lu.LibrariesShareDeleteV1Request$inboundSchema=Wme.object({library_id:Wme.string(),SharingDelete:p8t.SharingDelete$inboundSchema}).transform(t=>(0,m8t.remap)(t,{library_id:"libraryId",SharingDelete:"sharingDelete"}));Lu.LibrariesShareDeleteV1Request$outboundSchema=Wme.object({libraryId:Wme.string(),sharingDelete:p8t.SharingDelete$outboundSchema}).transform(t=>(0,m8t.remap)(t,{libraryId:"library_id",sharingDelete:"SharingDelete"}));var G8t;(function(t){t.inboundSchema=Lu.LibrariesShareDeleteV1Request$inboundSchema,t.outboundSchema=Lu.LibrariesShareDeleteV1Request$outboundSchema})(G8t||(Lu.LibrariesShareDeleteV1Request$=G8t={}));function r8l(t){return JSON.stringify(Lu.LibrariesShareDeleteV1Request$outboundSchema.parse(t))}function c8l(t){return(0,a8l.safeParse)(t,e=>Lu.LibrariesShareDeleteV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesShareDeleteV1Request' from JSON")}});var N8t=f(ku=>{"use strict";var o8l=ku&&ku.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),i8l=ku&&ku.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s8l=ku&&ku.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&o8l(e,t,n);return i8l(e,t),e};Object.defineProperty(ku,"__esModule",{value:!0});ku.LibrariesShareListV1Request$=ku.LibrariesShareListV1Request$outboundSchema=ku.LibrariesShareListV1Request$inboundSchema=void 0;ku.librariesShareListV1RequestToJSON=d8l;ku.librariesShareListV1RequestFromJSON=G8l;var Nme=s8l(se()),W8t=be(),u8l=oe();ku.LibrariesShareListV1Request$inboundSchema=Nme.object({library_id:Nme.string()}).transform(t=>(0,W8t.remap)(t,{library_id:"libraryId"}));ku.LibrariesShareListV1Request$outboundSchema=Nme.object({libraryId:Nme.string()}).transform(t=>(0,W8t.remap)(t,{libraryId:"library_id"}));var Z8t;(function(t){t.inboundSchema=ku.LibrariesShareListV1Request$inboundSchema,t.outboundSchema=ku.LibrariesShareListV1Request$outboundSchema})(Z8t||(ku.LibrariesShareListV1Request$=Z8t={}));function d8l(t){return JSON.stringify(ku.LibrariesShareListV1Request$outboundSchema.parse(t))}function G8l(t){return(0,u8l.safeParse)(t,e=>ku.LibrariesShareListV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesShareListV1Request' from JSON")}});var y8t=f(xu=>{"use strict";var b8l=xu&&xu.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),m8l=xu&&xu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Y8t=xu&&xu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&b8l(e,t,n);return m8l(e,t),e};Object.defineProperty(xu,"__esModule",{value:!0});xu.LibrariesUpdateV1Request$=xu.LibrariesUpdateV1Request$outboundSchema=xu.LibrariesUpdateV1Request$inboundSchema=void 0;xu.librariesUpdateV1RequestToJSON=h8l;xu.librariesUpdateV1RequestFromJSON=Z8l;var Vme=Y8t(se()),g8t=be(),p8l=oe(),R8t=Y8t(bt());xu.LibrariesUpdateV1Request$inboundSchema=Vme.object({library_id:Vme.string(),LibraryInUpdate:R8t.LibraryInUpdate$inboundSchema}).transform(t=>(0,g8t.remap)(t,{library_id:"libraryId",LibraryInUpdate:"libraryInUpdate"}));xu.LibrariesUpdateV1Request$outboundSchema=Vme.object({libraryId:Vme.string(),libraryInUpdate:R8t.LibraryInUpdate$outboundSchema}).transform(t=>(0,g8t.remap)(t,{libraryId:"library_id",libraryInUpdate:"LibraryInUpdate"}));var V8t;(function(t){t.inboundSchema=xu.LibrariesUpdateV1Request$inboundSchema,t.outboundSchema=xu.LibrariesUpdateV1Request$outboundSchema})(V8t||(xu.LibrariesUpdateV1Request$=V8t={}));function h8l(t){return JSON.stringify(xu.LibrariesUpdateV1Request$outboundSchema.parse(t))}function Z8l(t){return(0,p8l.safeParse)(t,e=>xu.LibrariesUpdateV1Request$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'LibrariesUpdateV1Request' from JSON")}});var w8t=f(ur=>{"use strict";var W8l=ur&&ur.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),N8l=ur&&ur.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),v8t=ur&&ur.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&W8l(e,t,n);return N8l(e,t),e};Object.defineProperty(ur,"__esModule",{value:!0});ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$=ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$outboundSchema=ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema=ur.RetrieveModelV1ModelsModelIdGetRequest$=ur.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema=ur.RetrieveModelV1ModelsModelIdGetRequest$inboundSchema=void 0;ur.retrieveModelV1ModelsModelIdGetRequestToJSON=V8l;ur.retrieveModelV1ModelsModelIdGetRequestFromJSON=Y8l;ur.retrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGetToJSON=g8l;ur.retrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGetFromJSON=R8l;var Up=v8t(se()),f8t=be(),X8t=oe(),Yme=v8t(bt());ur.RetrieveModelV1ModelsModelIdGetRequest$inboundSchema=Up.object({model_id:Up.string()}).transform(t=>(0,f8t.remap)(t,{model_id:"modelId"}));ur.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema=Up.object({modelId:Up.string()}).transform(t=>(0,f8t.remap)(t,{modelId:"model_id"}));var A8t;(function(t){t.inboundSchema=ur.RetrieveModelV1ModelsModelIdGetRequest$inboundSchema,t.outboundSchema=ur.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema})(A8t||(ur.RetrieveModelV1ModelsModelIdGetRequest$=A8t={}));function V8l(t){return JSON.stringify(ur.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema.parse(t))}function Y8l(t){return(0,X8t.safeParse)(t,e=>ur.RetrieveModelV1ModelsModelIdGetRequest$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'RetrieveModelV1ModelsModelIdGetRequest' from JSON")}ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema=Up.union([Yme.BaseModelCard$inboundSchema.and(Up.object({type:Up.literal("base")}).transform(t=>({type:t.type}))),Yme.FTModelCard$inboundSchema.and(Up.object({type:Up.literal("fine-tuned")}).transform(t=>({type:t.type})))]);ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$outboundSchema=Up.union([Yme.BaseModelCard$outboundSchema.and(Up.object({type:Up.literal("base")}).transform(t=>({type:t.type}))),Yme.FTModelCard$outboundSchema.and(Up.object({type:Up.literal("fine-tuned")}).transform(t=>({type:t.type})))]);var F8t;(function(t){t.inboundSchema=ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema,t.outboundSchema=ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$outboundSchema})(F8t||(ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$=F8t={}));function g8l(t){return JSON.stringify(ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$outboundSchema.parse(t))}function R8l(t){return(0,X8t.safeParse)(t,e=>ur.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema.parse(JSON.parse(e)),"Failed to parse 'RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet' from JSON")}});var Dn=f(Vn=>{"use strict";var y8l=Vn&&Vn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),_n=Vn&&Vn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&y8l(e,t,n)};Object.defineProperty(Vn,"__esModule",{value:!0});_n(I6t(),Vn);_n(c6t(),Vn);_n(d6t(),Vn);_n(m6t(),Vn);_n(N6t(),Vn);_n(y6t(),Vn);_n(w6t(),Vn);_n(E6t(),Vn);_n(j6t(),Vn);_n(z6t(),Vn);_n(D6t(),Vn);_n($6t(),Vn);_n(nqt(),Vn);_n(aqt(),Vn);_n(oqt(),Vn);_n(uqt(),Vn);_n(mqt(),Vn);_n(Zqt(),Vn);_n(gqt(),Vn);_n(Aqt(),Vn);_n(fqt(),Vn);_n(Eqt(),Vn);_n(Lqt(),Vn);_n(zqt(),Vn);_n(Dqt(),Vn);_n(e7t(),Vn);_n(I7t(),Vn);_n(s7t(),Vn);_n(G7t(),Vn);_n(W7t(),Vn);_n(Y7t(),Vn);_n(y7t(),Vn);_n(v7t(),Vn);_n(w7t(),Vn);_n(E7t(),Vn);_n(L7t(),Vn);_n(j7t(),Vn);_n(z7t(),Vn);_n(M7t(),Vn);_n(P7t(),Vn);_n(I8t(),Vn);_n(c8t(),Vn);_n(d8t(),Vn);_n(h8t(),Vn);_n(N8t(),Vn);_n(y8t(),Vn);_n(w8t(),Vn)});var Q8t=f(y0=>{"use strict";var A8l=y0&&y0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),F8l=y0&&y0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),K9e=y0&&y0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&A8l(e,t,n);return F8l(e,t),e};Object.defineProperty(y0,"__esModule",{value:!0});y0.batchJobsCancel=J8l;var v8l=kt(),gme=K9e(Qt()),f8l=be(),X8l=oe(),H8t=Et(),w8l=wt(),H8l=K9e(bt()),Q8l=K9e(Dn()),E8l=Jt();function J8l(t,e,n){return new E8l.APIPromise(C8l(t,e,n))}async function C8l(t,e,n){let l=(0,X8l.safeParse)(e,y=>Q8l.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={job_id:(0,v8l.encodeSimple)("job_id",I.job_id,{explode:!1,charEncoding:"percent"})},i=(0,w8l.pathToFunc)("/v1/batch/jobs/{job_id}/cancel")(c),s=new Headers((0,f8l.compactMap)({Accept:"application/json"})),r=await(0,H8t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,H8t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_batch_cancel_batch_job",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await gme.match(gme.json(200,H8l.BatchJobOut$inboundSchema),gme.fail("4XX"),gme.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var L8t=f(A0=>{"use strict";var L8l=A0&&A0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),k8l=A0&&A0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),C8t=A0&&A0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&L8l(e,t,n);return k8l(e,t),e};Object.defineProperty(A0,"__esModule",{value:!0});A0.batchJobsCreate=B8l;var x8l=kt(),Rme=C8t(Qt()),j8l=be(),O8l=oe(),E8t=Et(),U8l=wt(),J8t=C8t(bt()),z8l=Jt();function B8l(t,e,n){return new z8l.APIPromise(S8l(t,e,n))}async function S8l(t,e,n){let l=(0,O8l.safeParse)(e,g=>J8t.BatchJobIn$outboundSchema.parse(g),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,x8l.encodeJSON)("body",I,{explode:!0}),c=(0,U8l.pathToFunc)("/v1/batch/jobs")(),i=new Headers((0,j8l.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,E8t.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,E8t.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_batch_create_batch_job",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,[N]=await Rme.match(Rme.json(200,J8t.BatchJobOut$inboundSchema),Rme.fail("4XX"),Rme.fail("5XX"))(Z);return N.ok?[N,{status:"complete",request:b,response:Z}]:[N,{status:"complete",request:b,response:Z}]}});var x8t=f(F0=>{"use strict";var M8l=F0&&F0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),T8l=F0&&F0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_9e=F0&&F0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&M8l(e,t,n);return T8l(e,t),e};Object.defineProperty(F0,"__esModule",{value:!0});F0.batchJobsGet=t$l;var D8l=kt(),yme=_9e(Qt()),K8l=be(),_8l=oe(),k8t=Et(),P8l=wt(),q8l=_9e(bt()),$8l=_9e(Dn()),e$l=Jt();function t$l(t,e,n){return new e$l.APIPromise(n$l(t,e,n))}async function n$l(t,e,n){let l=(0,_8l.safeParse)(e,y=>$8l.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={job_id:(0,D8l.encodeSimple)("job_id",I.job_id,{explode:!1,charEncoding:"percent"})},i=(0,P8l.pathToFunc)("/v1/batch/jobs/{job_id}")(c),s=new Headers((0,K8l.compactMap)({Accept:"application/json"})),r=await(0,k8t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,k8t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_batch_get_batch_job",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await yme.match(yme.json(200,q8l.BatchJobOut$inboundSchema),yme.fail("4XX"),yme.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var O8t=f(v0=>{"use strict";var l$l=v0&&v0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),I$l=v0&&v0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),P9e=v0&&v0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&l$l(e,t,n);return I$l(e,t),e};Object.defineProperty(v0,"__esModule",{value:!0});v0.batchJobsList=d$l;var a$l=kt(),Ame=P9e(Qt()),r$l=be(),c$l=oe(),j8t=Et(),o$l=wt(),i$l=P9e(bt()),s$l=P9e(Dn()),u$l=Jt();function d$l(t,e,n){return new u$l.APIPromise(G$l(t,e,n))}async function G$l(t,e,n){let l=(0,c$l.safeParse)(e,y=>s$l.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema.optional().parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c=(0,o$l.pathToFunc)("/v1/batch/jobs")(),i=(0,a$l.encodeFormQuery)({created_after:I?.created_after,created_by_me:I?.created_by_me,metadata:I?.metadata,model:I?.model,page:I?.page,page_size:I?.page_size,status:I?.status}),s=new Headers((0,r$l.compactMap)({Accept:"application/json"})),r=await(0,j8t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,j8t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_batch_get_batch_jobs",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:c,headers:s,query:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await Ame.match(Ame.json(200,i$l.BatchJobsOut$inboundSchema),Ame.fail("4XX"),Ame.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var U8t=f(vme=>{"use strict";Object.defineProperty(vme,"__esModule",{value:!0});vme.MistralJobs=void 0;var b$l=Q8t(),m$l=L8t(),p$l=x8t(),h$l=O8t(),Z$l=di(),Fme=Hd(),q9e=class extends Z$l.ClientSDK{async list(e,n){return(0,Fme.unwrapAsync)((0,h$l.batchJobsList)(this,e,n))}async create(e,n){return(0,Fme.unwrapAsync)((0,m$l.batchJobsCreate)(this,e,n))}async get(e,n){return(0,Fme.unwrapAsync)((0,p$l.batchJobsGet)(this,e,n))}async cancel(e,n){return(0,Fme.unwrapAsync)((0,b$l.batchJobsCancel)(this,e,n))}};vme.MistralJobs=q9e});var z8t=f(fme=>{"use strict";Object.defineProperty(fme,"__esModule",{value:!0});fme.Batch=void 0;var W$l=di(),N$l=U8t(),$9e=class extends W$l.ClientSDK{get jobs(){return this._jobs??(this._jobs=new N$l.MistralJobs(this._options))}};fme.Batch=$9e});var M8t=f(f0=>{"use strict";var V$l=f0&&f0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Y$l=f0&&f0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Xme=f0&&f0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&V$l(e,t,n);return Y$l(e,t),e};Object.defineProperty(f0,"__esModule",{value:!0});f0.betaConversationsAppend=X$l;var B8t=kt(),A_=Xme(Qt()),g$l=be(),R$l=oe(),S8t=Et(),y$l=wt(),A$l=Xme(bt()),F$l=Xme(Tn()),v$l=Xme(Dn()),f$l=Jt();function X$l(t,e,n){return new f$l.APIPromise(w$l(t,e,n))}async function w$l(t,e,n){let l=(0,R$l.safeParse)(e,X=>v$l.AgentsApiV1ConversationsAppendRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,B8t.encodeJSON)("body",I.ConversationAppendRequest,{explode:!0}),c={conversation_id:(0,B8t.encodeSimple)("conversation_id",I.conversation_id,{explode:!1,charEncoding:"percent"})},i=(0,y$l.pathToFunc)("/v1/conversations/{conversation_id}")(c),s=new Headers((0,g$l.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,S8t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,S8t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_append",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await A_.match(A_.json(200,A$l.ConversationResponse$inboundSchema),A_.jsonErr(422,F$l.HTTPValidationError$inboundSchema),A_.fail("4XX"),A_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var K8t=f(X0=>{"use strict";var H$l=X0&&X0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Q$l=X0&&X0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),v_=X0&&X0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&H$l(e,t,n);return Q$l(e,t),e};Object.defineProperty(X0,"__esModule",{value:!0});X0.betaConversationsAppendStream=z$l;var E$l=v_(se()),T8t=kt(),J$l=BX(),F_=v_(Qt()),C$l=be(),L$l=oe(),D8t=Et(),k$l=wt(),x$l=v_(bt()),j$l=v_(Tn()),O$l=v_(Dn()),U$l=Jt();function z$l(t,e,n){return new U$l.APIPromise(B$l(t,e,n))}async function B$l(t,e,n){let l=(0,L$l.safeParse)(e,X=>O$l.AgentsApiV1ConversationsAppendStreamRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,T8t.encodeJSON)("body",I.ConversationAppendStreamRequest,{explode:!0}),c={conversation_id:(0,T8t.encodeSimple)("conversation_id",I.conversation_id,{explode:!1,charEncoding:"percent"})},i=(0,k$l.pathToFunc)("/v1/conversations/{conversation_id}#stream")(c),s=new Headers((0,C$l.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),r=await(0,D8t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,D8t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_append_stream",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await F_.match(F_.sse(200,E$l.instanceof(ReadableStream).transform(X=>new J$l.EventStream({stream:X,decoder(v){return x$l.ConversationEvents$inboundSchema.parse(v)}}))),F_.jsonErr(422,j$l.HTTPValidationError$inboundSchema),F_.fail("4XX"),F_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var q8t=f(w0=>{"use strict";var S$l=w0&&w0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),M$l=w0&&w0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eze=w0&&w0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&S$l(e,t,n);return M$l(e,t),e};Object.defineProperty(w0,"__esModule",{value:!0});w0.betaConversationsGet=$$l;var T$l=kt(),f_=eze(Qt()),D$l=be(),K$l=oe(),_8t=Et(),_$l=wt(),P$l=eze(Tn()),P8t=eze(Dn()),q$l=Jt();function $$l(t,e,n){return new q$l.APIPromise(eeI(t,e,n))}async function eeI(t,e,n){let l=(0,K$l.safeParse)(e,X=>P8t.AgentsApiV1ConversationsGetRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={conversation_id:(0,T$l.encodeSimple)("conversation_id",I.conversation_id,{explode:!1,charEncoding:"percent"})},i=(0,_$l.pathToFunc)("/v1/conversations/{conversation_id}")(c),s=new Headers((0,D$l.compactMap)({Accept:"application/json"})),r=await(0,_8t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,_8t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_get",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await f_.match(f_.json(200,P8t.AgentsApiV1ConversationsGetResponseV1ConversationsGet$inboundSchema),f_.jsonErr(422,P$l.HTTPValidationError$inboundSchema),f_.fail("4XX"),f_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var e$t=f(H0=>{"use strict";var teI=H0&&H0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),neI=H0&&H0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wme=H0&&H0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&teI(e,t,n);return neI(e,t),e};Object.defineProperty(H0,"__esModule",{value:!0});H0.betaConversationsGetHistory=ueI;var leI=kt(),X_=wme(Qt()),IeI=be(),aeI=oe(),$8t=Et(),reI=wt(),ceI=wme(bt()),oeI=wme(Tn()),ieI=wme(Dn()),seI=Jt();function ueI(t,e,n){return new seI.APIPromise(deI(t,e,n))}async function deI(t,e,n){let l=(0,aeI.safeParse)(e,X=>ieI.AgentsApiV1ConversationsHistoryRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={conversation_id:(0,leI.encodeSimple)("conversation_id",I.conversation_id,{explode:!1,charEncoding:"percent"})},i=(0,reI.pathToFunc)("/v1/conversations/{conversation_id}/history")(c),s=new Headers((0,IeI.compactMap)({Accept:"application/json"})),r=await(0,$8t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,$8t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_history",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await X_.match(X_.json(200,ceI.ConversationHistory$inboundSchema),X_.jsonErr(422,oeI.HTTPValidationError$inboundSchema),X_.fail("4XX"),X_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var n$t=f(Q0=>{"use strict";var GeI=Q0&&Q0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),beI=Q0&&Q0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Hme=Q0&&Q0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&GeI(e,t,n);return beI(e,t),e};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.betaConversationsGetMessages=geI;var meI=kt(),w_=Hme(Qt()),peI=be(),heI=oe(),t$t=Et(),ZeI=wt(),WeI=Hme(bt()),NeI=Hme(Tn()),VeI=Hme(Dn()),YeI=Jt();function geI(t,e,n){return new YeI.APIPromise(ReI(t,e,n))}async function ReI(t,e,n){let l=(0,heI.safeParse)(e,X=>VeI.AgentsApiV1ConversationsMessagesRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={conversation_id:(0,meI.encodeSimple)("conversation_id",I.conversation_id,{explode:!1,charEncoding:"percent"})},i=(0,ZeI.pathToFunc)("/v1/conversations/{conversation_id}/messages")(c),s=new Headers((0,peI.compactMap)({Accept:"application/json"})),r=await(0,t$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,t$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_messages",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await w_.match(w_.json(200,WeI.ConversationMessages$inboundSchema),w_.jsonErr(422,NeI.HTTPValidationError$inboundSchema),w_.fail("4XX"),w_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var a$t=f(E0=>{"use strict";var yeI=E0&&E0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),AeI=E0&&E0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qme=E0&&E0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&yeI(e,t,n);return AeI(e,t),e};Object.defineProperty(E0,"__esModule",{value:!0});E0.betaConversationsList=EeI;var FeI=Qme(se()),veI=kt(),H_=Qme(Qt()),feI=be(),XeI=oe(),l$t=Et(),weI=wt(),HeI=Qme(Tn()),I$t=Qme(Dn()),QeI=Jt();function EeI(t,e,n){return new QeI.APIPromise(JeI(t,e,n))}async function JeI(t,e,n){let l=(0,XeI.safeParse)(e,X=>I$t.AgentsApiV1ConversationsListRequest$outboundSchema.optional().parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c=(0,weI.pathToFunc)("/v1/conversations")(),i=(0,veI.encodeFormQuery)({page:I?.page,page_size:I?.page_size}),s=new Headers((0,feI.compactMap)({Accept:"application/json"})),r=await(0,l$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,l$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_list",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:c,headers:s,query:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await H_.match(H_.json(200,FeI.array(I$t.ResponseBody$inboundSchema)),H_.jsonErr(422,HeI.HTTPValidationError$inboundSchema),H_.fail("4XX"),H_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var o$t=f(J0=>{"use strict";var CeI=J0&&J0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),LeI=J0&&J0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Eme=J0&&J0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&CeI(e,t,n);return LeI(e,t),e};Object.defineProperty(J0,"__esModule",{value:!0});J0.betaConversationsRestart=SeI;var r$t=kt(),Q_=Eme(Qt()),keI=be(),xeI=oe(),c$t=Et(),jeI=wt(),OeI=Eme(bt()),UeI=Eme(Tn()),zeI=Eme(Dn()),BeI=Jt();function SeI(t,e,n){return new BeI.APIPromise(MeI(t,e,n))}async function MeI(t,e,n){let l=(0,xeI.safeParse)(e,X=>zeI.AgentsApiV1ConversationsRestartRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,r$t.encodeJSON)("body",I.ConversationRestartRequest,{explode:!0}),c={conversation_id:(0,r$t.encodeSimple)("conversation_id",I.conversation_id,{explode:!1,charEncoding:"percent"})},i=(0,jeI.pathToFunc)("/v1/conversations/{conversation_id}/restart")(c),s=new Headers((0,keI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,c$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,c$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_restart",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await Q_.match(Q_.json(200,OeI.ConversationResponse$inboundSchema),Q_.jsonErr(422,UeI.HTTPValidationError$inboundSchema),Q_.fail("4XX"),Q_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var u$t=f(C0=>{"use strict";var TeI=C0&&C0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),DeI=C0&&C0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),J_=C0&&C0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&TeI(e,t,n);return DeI(e,t),e};Object.defineProperty(C0,"__esModule",{value:!0});C0.betaConversationsRestartStream=ItI;var KeI=J_(se()),i$t=kt(),_eI=BX(),E_=J_(Qt()),PeI=be(),qeI=oe(),s$t=Et(),$eI=wt(),etI=J_(bt()),ttI=J_(Tn()),ntI=J_(Dn()),ltI=Jt();function ItI(t,e,n){return new ltI.APIPromise(atI(t,e,n))}async function atI(t,e,n){let l=(0,qeI.safeParse)(e,X=>ntI.AgentsApiV1ConversationsRestartStreamRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,i$t.encodeJSON)("body",I.ConversationRestartStreamRequest,{explode:!0}),c={conversation_id:(0,i$t.encodeSimple)("conversation_id",I.conversation_id,{explode:!1,charEncoding:"percent"})},i=(0,$eI.pathToFunc)("/v1/conversations/{conversation_id}/restart#stream")(c),s=new Headers((0,PeI.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),r=await(0,s$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,s$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_restart_stream",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await E_.match(E_.sse(200,KeI.instanceof(ReadableStream).transform(X=>new _eI.EventStream({stream:X,decoder(v){return etI.ConversationEvents$inboundSchema.parse(v)}}))),E_.jsonErr(422,ttI.HTTPValidationError$inboundSchema),E_.fail("4XX"),E_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var b$t=f(L0=>{"use strict";var rtI=L0&&L0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ctI=L0&&L0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tze=L0&&L0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&rtI(e,t,n);return ctI(e,t),e};Object.defineProperty(L0,"__esModule",{value:!0});L0.betaConversationsStart=btI;var otI=kt(),C_=tze(Qt()),itI=be(),stI=oe(),d$t=Et(),utI=wt(),G$t=tze(bt()),dtI=tze(Tn()),GtI=Jt();function btI(t,e,n){return new GtI.APIPromise(mtI(t,e,n))}async function mtI(t,e,n){let l=(0,stI.safeParse)(e,y=>G$t.ConversationRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,otI.encodeJSON)("body",I,{explode:!0}),c=(0,utI.pathToFunc)("/v1/conversations")(),i=new Headers((0,itI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,d$t.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,d$t.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_start",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await C_.match(C_.json(200,G$t.ConversationResponse$inboundSchema),C_.jsonErr(422,dtI.HTTPValidationError$inboundSchema),C_.fail("4XX"),C_.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var h$t=f(k0=>{"use strict";var ptI=k0&&k0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),htI=k0&&k0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Jme=k0&&k0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ptI(e,t,n);return htI(e,t),e};Object.defineProperty(k0,"__esModule",{value:!0});k0.betaConversationsStartStream=AtI;var ZtI=Jme(se()),WtI=kt(),NtI=BX(),L_=Jme(Qt()),VtI=be(),YtI=oe(),m$t=Et(),gtI=wt(),p$t=Jme(bt()),RtI=Jme(Tn()),ytI=Jt();function AtI(t,e,n){return new ytI.APIPromise(FtI(t,e,n))}async function FtI(t,e,n){let l=(0,YtI.safeParse)(e,y=>p$t.ConversationStreamRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,WtI.encodeJSON)("body",I,{explode:!0}),c=(0,gtI.pathToFunc)("/v1/conversations#stream")(),i=new Headers((0,VtI.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),s=await(0,m$t.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,m$t.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_conversations_start_stream",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await L_.match(L_.sse(200,ZtI.instanceof(ReadableStream).transform(y=>new NtI.EventStream({stream:y,decoder(X){return p$t.ConversationEvents$inboundSchema.parse(X)}}))),L_.jsonErr(422,RtI.HTTPValidationError$inboundSchema),L_.fail("4XX"),L_.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Z$t=f(Cme=>{"use strict";Object.defineProperty(Cme,"__esModule",{value:!0});Cme.Conversations=void 0;var vtI=M8t(),ftI=K8t(),XtI=q8t(),wtI=e$t(),HtI=n$t(),QtI=a$t(),EtI=o$t(),JtI=u$t(),CtI=b$t(),LtI=h$t(),ktI=di(),AR=Hd(),nze=class extends ktI.ClientSDK{async start(e,n){return(0,AR.unwrapAsync)((0,CtI.betaConversationsStart)(this,e,n))}async list(e,n){return(0,AR.unwrapAsync)((0,QtI.betaConversationsList)(this,e,n))}async get(e,n){return(0,AR.unwrapAsync)((0,XtI.betaConversationsGet)(this,e,n))}async append(e,n){return(0,AR.unwrapAsync)((0,vtI.betaConversationsAppend)(this,e,n))}async getHistory(e,n){return(0,AR.unwrapAsync)((0,wtI.betaConversationsGetHistory)(this,e,n))}async getMessages(e,n){return(0,AR.unwrapAsync)((0,HtI.betaConversationsGetMessages)(this,e,n))}async restart(e,n){return(0,AR.unwrapAsync)((0,EtI.betaConversationsRestart)(this,e,n))}async startStream(e,n){return(0,AR.unwrapAsync)((0,LtI.betaConversationsStartStream)(this,e,n))}async appendStream(e,n){return(0,AR.unwrapAsync)((0,ftI.betaConversationsAppendStream)(this,e,n))}async restartStream(e,n){return(0,AR.unwrapAsync)((0,JtI.betaConversationsRestartStream)(this,e,n))}};Cme.Conversations=nze});var V$t=f(x0=>{"use strict";var xtI=x0&&x0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jtI=x0&&x0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lze=x0&&x0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xtI(e,t,n);return jtI(e,t),e};Object.defineProperty(x0,"__esModule",{value:!0});x0.betaLibrariesCreate=TtI;var OtI=kt(),k_=lze(Qt()),UtI=be(),ztI=oe(),W$t=Et(),BtI=wt(),N$t=lze(bt()),StI=lze(Tn()),MtI=Jt();function TtI(t,e,n){return new MtI.APIPromise(DtI(t,e,n))}async function DtI(t,e,n){let l=(0,ztI.safeParse)(e,y=>N$t.LibraryIn$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,OtI.encodeJSON)("body",I,{explode:!0}),c=(0,BtI.pathToFunc)("/v1/libraries")(),i=new Headers((0,UtI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,W$t.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,W$t.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_create_v1",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await k_.match(k_.json(201,N$t.LibraryOut$inboundSchema),k_.jsonErr(422,StI.HTTPValidationError$inboundSchema),k_.fail("4XX"),k_.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var g$t=f(j0=>{"use strict";var KtI=j0&&j0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),_tI=j0&&j0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Lme=j0&&j0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&KtI(e,t,n);return _tI(e,t),e};Object.defineProperty(j0,"__esModule",{value:!0});j0.betaLibrariesDelete=anI;var PtI=kt(),x_=Lme(Qt()),qtI=be(),$tI=oe(),Y$t=Et(),enI=wt(),tnI=Lme(bt()),nnI=Lme(Tn()),lnI=Lme(Dn()),InI=Jt();function anI(t,e,n){return new InI.APIPromise(rnI(t,e,n))}async function rnI(t,e,n){let l=(0,$tI.safeParse)(e,X=>lnI.LibrariesDeleteV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={library_id:(0,PtI.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,enI.pathToFunc)("/v1/libraries/{library_id}")(c),s=new Headers((0,qtI.compactMap)({Accept:"application/json"})),r=await(0,Y$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Y$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_delete_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"DELETE",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await x_.match(x_.json(200,tnI.LibraryOut$inboundSchema),x_.jsonErr(422,nnI.HTTPValidationError$inboundSchema),x_.fail("4XX"),x_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var y$t=f(O0=>{"use strict";var cnI=O0&&O0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),onI=O0&&O0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kme=O0&&O0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&cnI(e,t,n);return onI(e,t),e};Object.defineProperty(O0,"__esModule",{value:!0});O0.betaLibrariesGet=hnI;var inI=kt(),j_=kme(Qt()),snI=be(),unI=oe(),R$t=Et(),dnI=wt(),GnI=kme(bt()),bnI=kme(Tn()),mnI=kme(Dn()),pnI=Jt();function hnI(t,e,n){return new pnI.APIPromise(ZnI(t,e,n))}async function ZnI(t,e,n){let l=(0,unI.safeParse)(e,X=>mnI.LibrariesGetV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={library_id:(0,inI.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,dnI.pathToFunc)("/v1/libraries/{library_id}")(c),s=new Headers((0,snI.compactMap)({Accept:"application/json"})),r=await(0,R$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,R$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_get_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await j_.match(j_.json(200,GnI.LibraryOut$inboundSchema),j_.jsonErr(422,bnI.HTTPValidationError$inboundSchema),j_.fail("4XX"),j_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var v$t=f(U0=>{"use strict";var WnI=U0&&U0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),NnI=U0&&U0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),F$t=U0&&U0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&WnI(e,t,n);return NnI(e,t),e};Object.defineProperty(U0,"__esModule",{value:!0});U0.betaLibrariesList=ynI;var xme=F$t(Qt()),VnI=be(),A$t=Et(),YnI=wt(),gnI=F$t(bt()),RnI=Jt();function ynI(t,e){return new RnI.APIPromise(AnI(t,e))}async function AnI(t,e){let n=(0,YnI.pathToFunc)("/v1/libraries")(),l=new Headers((0,VnI.compactMap)({Accept:"application/json"})),I=await(0,A$t.extractSecurity)(t._options.apiKey),a=I==null?{}:{apiKey:I},c=(0,A$t.resolveGlobalSecurity)(a),i={baseURL:e?.serverURL??t._baseURL??"",operationID:"libraries_list_v1",oAuth2Scopes:[],resolvedSecurity:c,securitySource:t._options.apiKey,retryConfig:e?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:e?.retryCodes||["429","500","502","503","504"]},s=t._createRequest(i,{security:c,method:"GET",baseURL:e?.serverURL,path:n,headers:l,timeoutMs:e?.timeoutMs||t._options.timeoutMs||-1},e);if(!s.ok)return[s,{status:"invalid"}];let r=s.value,u=await t._do(r,{context:i,errorCodes:["4XX","5XX"],retryConfig:i.retryConfig,retryCodes:i.retryCodes});if(!u.ok)return[u,{status:"request-error",request:r}];let o=u.value,[d]=await xme.match(xme.json(200,gnI.ListLibraryOut$inboundSchema),xme.fail("4XX"),xme.fail("5XX"))(o);return d.ok?[d,{status:"complete",request:r,response:o}]:[d,{status:"complete",request:r,response:o}]}});var w$t=f(z0=>{"use strict";var FnI=z0&&z0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),vnI=z0&&z0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jme=z0&&z0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&FnI(e,t,n);return vnI(e,t),e};Object.defineProperty(z0,"__esModule",{value:!0});z0.betaLibrariesUpdate=CnI;var f$t=kt(),O_=jme(Qt()),fnI=be(),XnI=oe(),X$t=Et(),wnI=wt(),HnI=jme(bt()),QnI=jme(Tn()),EnI=jme(Dn()),JnI=Jt();function CnI(t,e,n){return new JnI.APIPromise(LnI(t,e,n))}async function LnI(t,e,n){let l=(0,XnI.safeParse)(e,X=>EnI.LibrariesUpdateV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,f$t.encodeJSON)("body",I.LibraryInUpdate,{explode:!0}),c={library_id:(0,f$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,wnI.pathToFunc)("/v1/libraries/{library_id}")(c),s=new Headers((0,fnI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,X$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,X$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_update_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"PUT",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await O_.match(O_.json(200,HnI.LibraryOut$inboundSchema),O_.jsonErr(422,QnI.HTTPValidationError$inboundSchema),O_.fail("4XX"),O_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var E$t=f(B0=>{"use strict";var knI=B0&&B0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),xnI=B0&&B0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ome=B0&&B0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&knI(e,t,n);return xnI(e,t),e};Object.defineProperty(B0,"__esModule",{value:!0});B0.betaLibrariesAccessesDelete=TnI;var H$t=kt(),U_=Ome(Qt()),jnI=be(),OnI=oe(),Q$t=Et(),UnI=wt(),znI=Ome(bt()),BnI=Ome(Tn()),SnI=Ome(Dn()),MnI=Jt();function TnI(t,e,n){return new MnI.APIPromise(DnI(t,e,n))}async function DnI(t,e,n){let l=(0,OnI.safeParse)(e,X=>SnI.LibrariesShareDeleteV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,H$t.encodeJSON)("body",I.SharingDelete,{explode:!0}),c={library_id:(0,H$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,UnI.pathToFunc)("/v1/libraries/{library_id}/share")(c),s=new Headers((0,jnI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,Q$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Q$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_share_delete_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"DELETE",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await U_.match(U_.json(200,znI.SharingOut$inboundSchema),U_.jsonErr(422,BnI.HTTPValidationError$inboundSchema),U_.fail("4XX"),U_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var C$t=f(S0=>{"use strict";var KnI=S0&&S0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),_nI=S0&&S0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ume=S0&&S0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&KnI(e,t,n);return _nI(e,t),e};Object.defineProperty(S0,"__esModule",{value:!0});S0.betaLibrariesAccessesList=alI;var PnI=kt(),z_=Ume(Qt()),qnI=be(),$nI=oe(),J$t=Et(),elI=wt(),tlI=Ume(bt()),nlI=Ume(Tn()),llI=Ume(Dn()),IlI=Jt();function alI(t,e,n){return new IlI.APIPromise(rlI(t,e,n))}async function rlI(t,e,n){let l=(0,$nI.safeParse)(e,X=>llI.LibrariesShareListV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={library_id:(0,PnI.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,elI.pathToFunc)("/v1/libraries/{library_id}/share")(c),s=new Headers((0,qnI.compactMap)({Accept:"application/json"})),r=await(0,J$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,J$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_share_list_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await z_.match(z_.json(200,tlI.ListSharingOut$inboundSchema),z_.jsonErr(422,nlI.HTTPValidationError$inboundSchema),z_.fail("4XX"),z_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var x$t=f(M0=>{"use strict";var clI=M0&&M0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),olI=M0&&M0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zme=M0&&M0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&clI(e,t,n);return olI(e,t),e};Object.defineProperty(M0,"__esModule",{value:!0});M0.betaLibrariesAccessesUpdateOrCreate=plI;var L$t=kt(),B_=zme(Qt()),ilI=be(),slI=oe(),k$t=Et(),ulI=wt(),dlI=zme(bt()),GlI=zme(Tn()),blI=zme(Dn()),mlI=Jt();function plI(t,e,n){return new mlI.APIPromise(hlI(t,e,n))}async function hlI(t,e,n){let l=(0,slI.safeParse)(e,X=>blI.LibrariesShareCreateV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,L$t.encodeJSON)("body",I.SharingIn,{explode:!0}),c={library_id:(0,L$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,ulI.pathToFunc)("/v1/libraries/{library_id}/share")(c),s=new Headers((0,ilI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,k$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,k$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_share_create_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"PUT",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await B_.match(B_.json(200,dlI.SharingOut$inboundSchema),B_.jsonErr(422,GlI.HTTPValidationError$inboundSchema),B_.fail("4XX"),B_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var j$t=f(Bme=>{"use strict";Object.defineProperty(Bme,"__esModule",{value:!0});Bme.Accesses=void 0;var ZlI=E$t(),WlI=C$t(),NlI=x$t(),VlI=di(),Ize=Hd(),aze=class extends VlI.ClientSDK{async list(e,n){return(0,Ize.unwrapAsync)((0,WlI.betaLibrariesAccessesList)(this,e,n))}async updateOrCreate(e,n){return(0,Ize.unwrapAsync)((0,NlI.betaLibrariesAccessesUpdateOrCreate)(this,e,n))}async delete(e,n){return(0,Ize.unwrapAsync)((0,ZlI.betaLibrariesAccessesDelete)(this,e,n))}};Bme.Accesses=aze});var z$t=f(T0=>{"use strict";var YlI=T0&&T0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),glI=T0&&T0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Sme=T0&&T0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&YlI(e,t,n);return glI(e,t),e};Object.defineProperty(T0,"__esModule",{value:!0});T0.betaLibrariesDocumentsDelete=wlI;var RlI=Sme(se()),O$t=kt(),S_=Sme(Qt()),ylI=be(),AlI=oe(),U$t=Et(),FlI=wt(),vlI=Sme(Tn()),flI=Sme(Dn()),XlI=Jt();function wlI(t,e,n){return new XlI.APIPromise(HlI(t,e,n))}async function HlI(t,e,n){let l=(0,AlI.safeParse)(e,X=>flI.LibrariesDocumentsDeleteV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={document_id:(0,O$t.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,O$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,FlI.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}")(c),s=new Headers((0,ylI.compactMap)({Accept:"application/json"})),r=await(0,U$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,U$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_delete_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"DELETE",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await S_.match(S_.nil(204,RlI.void()),S_.jsonErr(422,vlI.HTTPValidationError$inboundSchema),S_.fail("4XX"),S_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var M$t=f(D0=>{"use strict";var QlI=D0&&D0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ElI=D0&&D0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Mme=D0&&D0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&QlI(e,t,n);return ElI(e,t),e};Object.defineProperty(D0,"__esModule",{value:!0});D0.betaLibrariesDocumentsExtractedTextSignedUrl=UlI;var JlI=Mme(se()),B$t=kt(),M_=Mme(Qt()),ClI=be(),LlI=oe(),S$t=Et(),klI=wt(),xlI=Mme(Tn()),jlI=Mme(Dn()),OlI=Jt();function UlI(t,e,n){return new OlI.APIPromise(zlI(t,e,n))}async function zlI(t,e,n){let l=(0,LlI.safeParse)(e,X=>jlI.LibrariesDocumentsGetExtractedTextSignedUrlV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={document_id:(0,B$t.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,B$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,klI.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url")(c),s=new Headers((0,ClI.compactMap)({Accept:"application/json"})),r=await(0,S$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,S$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_get_extracted_text_signed_url_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await M_.match(M_.json(200,JlI.string()),M_.jsonErr(422,xlI.HTTPValidationError$inboundSchema),M_.fail("4XX"),M_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var K$t=f(K0=>{"use strict";var BlI=K0&&K0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),SlI=K0&&K0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Tme=K0&&K0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&BlI(e,t,n);return SlI(e,t),e};Object.defineProperty(K0,"__esModule",{value:!0});K0.betaLibrariesDocumentsGet=$lI;var T$t=kt(),T_=Tme(Qt()),MlI=be(),TlI=oe(),D$t=Et(),DlI=wt(),KlI=Tme(bt()),_lI=Tme(Tn()),PlI=Tme(Dn()),qlI=Jt();function $lI(t,e,n){return new qlI.APIPromise(eII(t,e,n))}async function eII(t,e,n){let l=(0,TlI.safeParse)(e,X=>PlI.LibrariesDocumentsGetV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={document_id:(0,T$t.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,T$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,DlI.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}")(c),s=new Headers((0,MlI.compactMap)({Accept:"application/json"})),r=await(0,D$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,D$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_get_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await T_.match(T_.json(200,KlI.DocumentOut$inboundSchema),T_.jsonErr(422,_lI.HTTPValidationError$inboundSchema),T_.fail("4XX"),T_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var q$t=f(_0=>{"use strict";var tII=_0&&_0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),nII=_0&&_0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Dme=_0&&_0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&tII(e,t,n);return nII(e,t),e};Object.defineProperty(_0,"__esModule",{value:!0});_0.betaLibrariesDocumentsGetSignedUrl=sII;var lII=Dme(se()),_$t=kt(),D_=Dme(Qt()),III=be(),aII=oe(),P$t=Et(),rII=wt(),cII=Dme(Tn()),oII=Dme(Dn()),iII=Jt();function sII(t,e,n){return new iII.APIPromise(uII(t,e,n))}async function uII(t,e,n){let l=(0,aII.safeParse)(e,X=>oII.LibrariesDocumentsGetSignedUrlV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={document_id:(0,_$t.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,_$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,rII.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/signed-url")(c),s=new Headers((0,III.compactMap)({Accept:"application/json"})),r=await(0,P$t.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,P$t.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_get_signed_url_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await D_.match(D_.json(200,lII.string()),D_.jsonErr(422,cII.HTTPValidationError$inboundSchema),D_.fail("4XX"),D_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var ten=f(P0=>{"use strict";var dII=P0&&P0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),GII=P0&&P0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kme=P0&&P0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&dII(e,t,n);return GII(e,t),e};Object.defineProperty(P0,"__esModule",{value:!0});P0.betaLibrariesDocumentsList=VII;var $$t=kt(),K_=Kme(Qt()),bII=be(),mII=oe(),een=Et(),pII=wt(),hII=Kme(bt()),ZII=Kme(Tn()),WII=Kme(Dn()),NII=Jt();function VII(t,e,n){return new NII.APIPromise(YII(t,e,n))}async function YII(t,e,n){let l=(0,mII.safeParse)(e,v=>WII.LibrariesDocumentsListV1Request$outboundSchema.parse(v),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={library_id:(0,$$t.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,pII.pathToFunc)("/v1/libraries/{library_id}/documents")(c),s=(0,$$t.encodeFormQuery)({page:I.page,page_size:I.page_size,search:I.search,sort_by:I.sort_by,sort_order:I.sort_order}),r=new Headers((0,bII.compactMap)({Accept:"application/json"})),u=await(0,een.extractSecurity)(t._options.apiKey),o=u==null?{}:{apiKey:u},d=(0,een.resolveGlobalSecurity)(o),b={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_list_v1",oAuth2Scopes:[],resolvedSecurity:d,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},h=t._createRequest(b,{security:d,method:"GET",baseURL:n?.serverURL,path:i,headers:r,query:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!h.ok)return[h,{status:"invalid"}];let Z=h.value,N=await t._do(Z,{context:b,errorCodes:["422","4XX","5XX"],retryConfig:b.retryConfig,retryCodes:b.retryCodes});if(!N.ok)return[N,{status:"request-error",request:Z}];let g=N.value,y={HttpMeta:{Response:g,Request:Z}},[X]=await K_.match(K_.json(200,hII.ListDocumentOut$inboundSchema),K_.jsonErr(422,ZII.HTTPValidationError$inboundSchema),K_.fail("4XX"),K_.fail("5XX"))(g,{extraFields:y});return X.ok?[X,{status:"complete",request:Z,response:g}]:[X,{status:"complete",request:Z,response:g}]}});var Ien=f(q0=>{"use strict";var gII=q0&&q0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),RII=q0&&q0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_me=q0&&q0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&gII(e,t,n);return RII(e,t),e};Object.defineProperty(q0,"__esModule",{value:!0});q0.betaLibrariesDocumentsReprocess=HII;var yII=_me(se()),nen=kt(),__=_me(Qt()),AII=be(),FII=oe(),len=Et(),vII=wt(),fII=_me(Tn()),XII=_me(Dn()),wII=Jt();function HII(t,e,n){return new wII.APIPromise(QII(t,e,n))}async function QII(t,e,n){let l=(0,FII.safeParse)(e,X=>XII.LibrariesDocumentsReprocessV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={document_id:(0,nen.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,nen.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,vII.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/reprocess")(c),s=new Headers((0,AII.compactMap)({Accept:"application/json"})),r=await(0,len.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,len.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_reprocess_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await __.match(__.nil(204,yII.void()),__.jsonErr(422,fII.HTTPValidationError$inboundSchema),__.fail("4XX"),__.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var cen=f($0=>{"use strict";var EII=$0&&$0.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),JII=$0&&$0.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pme=$0&&$0.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&EII(e,t,n);return JII(e,t),e};Object.defineProperty($0,"__esModule",{value:!0});$0.betaLibrariesDocumentsStatus=zII;var aen=kt(),P_=Pme(Qt()),CII=be(),LII=oe(),ren=Et(),kII=wt(),xII=Pme(bt()),jII=Pme(Tn()),OII=Pme(Dn()),UII=Jt();function zII(t,e,n){return new UII.APIPromise(BII(t,e,n))}async function BII(t,e,n){let l=(0,LII.safeParse)(e,X=>OII.LibrariesDocumentsGetStatusV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={document_id:(0,aen.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,aen.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,kII.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/status")(c),s=new Headers((0,CII.compactMap)({Accept:"application/json"})),r=await(0,ren.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,ren.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_get_status_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await P_.match(P_.json(200,xII.ProcessingStatusOut$inboundSchema),P_.jsonErr(422,jII.HTTPValidationError$inboundSchema),P_.fail("4XX"),P_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var sen=f(eF=>{"use strict";var SII=eF&&eF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),MII=eF&&eF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qme=eF&&eF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&SII(e,t,n);return MII(e,t),e};Object.defineProperty(eF,"__esModule",{value:!0});eF.betaLibrariesDocumentsTextContent=eaI;var oen=kt(),q_=qme(Qt()),TII=be(),DII=oe(),ien=Et(),KII=wt(),_II=qme(bt()),PII=qme(Tn()),qII=qme(Dn()),$II=Jt();function eaI(t,e,n){return new $II.APIPromise(taI(t,e,n))}async function taI(t,e,n){let l=(0,DII.safeParse)(e,X=>qII.LibrariesDocumentsGetTextContentV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={document_id:(0,oen.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,oen.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,KII.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}/text_content")(c),s=new Headers((0,TII.compactMap)({Accept:"application/json"})),r=await(0,ien.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,ien.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_get_text_content_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await q_.match(q_.json(200,_II.DocumentTextContent$inboundSchema),q_.jsonErr(422,PII.HTTPValidationError$inboundSchema),q_.fail("4XX"),q_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var den=f(tF=>{"use strict";var naI=tF&&tF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),laI=tF&&tF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$me=tF&&tF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&naI(e,t,n);return laI(e,t),e};Object.defineProperty(tF,"__esModule",{value:!0});tF.betaLibrariesDocumentsUpdate=uaI;var rze=kt(),$_=$me(Qt()),IaI=be(),aaI=oe(),uen=Et(),raI=wt(),caI=$me(bt()),oaI=$me(Tn()),iaI=$me(Dn()),saI=Jt();function uaI(t,e,n){return new saI.APIPromise(daI(t,e,n))}async function daI(t,e,n){let l=(0,aaI.safeParse)(e,X=>iaI.LibrariesDocumentsUpdateV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,rze.encodeJSON)("body",I.DocumentUpdateIn,{explode:!0}),c={document_id:(0,rze.encodeSimple)("document_id",I.document_id,{explode:!1,charEncoding:"percent"}),library_id:(0,rze.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,raI.pathToFunc)("/v1/libraries/{library_id}/documents/{document_id}")(c),s=new Headers((0,IaI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,uen.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,uen.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_update_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"PUT",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await $_.match($_.json(200,caI.DocumentOut$inboundSchema),$_.jsonErr(422,oaI.HTTPValidationError$inboundSchema),$_.fail("4XX"),$_.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var oze=f(cze=>{"use strict";Object.defineProperty(cze,"__esModule",{value:!0});cze.isReadableStream=GaI;function GaI(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.getReader=="function"&&typeof e.cancel=="function"&&typeof e.tee=="function"}});var ben=f(nF=>{"use strict";var baI=nF&&nF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),maI=nF&&nF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tpe=nF&&nF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&baI(e,t,n);return maI(e,t),e};Object.defineProperty(nF,"__esModule",{value:!0});nF.betaLibrariesDocumentsUpload=AaI;var epe=kt(),paI=xue(),eP=tpe(Qt()),haI=be(),ZaI=oe(),Gen=Et(),WaI=wt(),NaI=tpe(bt()),VaI=tpe(Tn()),YaI=tpe(Dn()),gaI=Jt(),RaI=y_(),yaI=oze();function AaI(t,e,n){return new gaI.APIPromise(FaI(t,e,n))}async function FaI(t,e,n){let l=(0,ZaI.safeParse)(e,X=>YaI.LibrariesDocumentsUploadV1Request$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=new FormData;if((0,RaI.isBlobLike)(I.RequestBody.file))(0,epe.appendForm)(a,"file",I.RequestBody.file);else if((0,yaI.isReadableStream)(I.RequestBody.file.content)){let X=await(0,paI.readableStreamToArrayBuffer)(I.RequestBody.file.content),v=new Blob([X],{type:"application/octet-stream"});(0,epe.appendForm)(a,"file",v)}else(0,epe.appendForm)(a,"file",new Blob([I.RequestBody.file.content],{type:"application/octet-stream"}),I.RequestBody.file.fileName);let c={library_id:(0,epe.encodeSimple)("library_id",I.library_id,{explode:!1,charEncoding:"percent"})},i=(0,WaI.pathToFunc)("/v1/libraries/{library_id}/documents")(c),s=new Headers((0,haI.compactMap)({Accept:"application/json"})),r=await(0,Gen.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Gen.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"libraries_documents_upload_v1",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await eP.match(eP.json([200,201],NaI.DocumentOut$inboundSchema),eP.jsonErr(422,VaI.HTTPValidationError$inboundSchema),eP.fail("4XX"),eP.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var men=f(npe=>{"use strict";Object.defineProperty(npe,"__esModule",{value:!0});npe.Documents=void 0;var vaI=z$t(),faI=M$t(),XaI=K$t(),waI=q$t(),HaI=ten(),QaI=Ien(),EaI=cen(),JaI=sen(),CaI=den(),LaI=ben(),kaI=di(),FR=Hd(),ize=class extends kaI.ClientSDK{async list(e,n){return(0,FR.unwrapAsync)((0,HaI.betaLibrariesDocumentsList)(this,e,n))}async upload(e,n){return(0,FR.unwrapAsync)((0,LaI.betaLibrariesDocumentsUpload)(this,e,n))}async get(e,n){return(0,FR.unwrapAsync)((0,XaI.betaLibrariesDocumentsGet)(this,e,n))}async update(e,n){return(0,FR.unwrapAsync)((0,CaI.betaLibrariesDocumentsUpdate)(this,e,n))}async delete(e,n){return(0,FR.unwrapAsync)((0,vaI.betaLibrariesDocumentsDelete)(this,e,n))}async textContent(e,n){return(0,FR.unwrapAsync)((0,JaI.betaLibrariesDocumentsTextContent)(this,e,n))}async status(e,n){return(0,FR.unwrapAsync)((0,EaI.betaLibrariesDocumentsStatus)(this,e,n))}async getSignedUrl(e,n){return(0,FR.unwrapAsync)((0,waI.betaLibrariesDocumentsGetSignedUrl)(this,e,n))}async extractedTextSignedUrl(e,n){return(0,FR.unwrapAsync)((0,faI.betaLibrariesDocumentsExtractedTextSignedUrl)(this,e,n))}async reprocess(e,n){return(0,FR.unwrapAsync)((0,QaI.betaLibrariesDocumentsReprocess)(this,e,n))}};npe.Documents=ize});var pen=f(lpe=>{"use strict";Object.defineProperty(lpe,"__esModule",{value:!0});lpe.Libraries=void 0;var xaI=V$t(),jaI=g$t(),OaI=y$t(),UaI=v$t(),zaI=w$t(),BaI=di(),tP=Hd(),SaI=j$t(),MaI=men(),sze=class extends BaI.ClientSDK{get documents(){return this._documents??(this._documents=new MaI.Documents(this._options))}get accesses(){return this._accesses??(this._accesses=new SaI.Accesses(this._options))}async list(e){return(0,tP.unwrapAsync)((0,UaI.betaLibrariesList)(this,e))}async create(e,n){return(0,tP.unwrapAsync)((0,xaI.betaLibrariesCreate)(this,e,n))}async get(e,n){return(0,tP.unwrapAsync)((0,OaI.betaLibrariesGet)(this,e,n))}async delete(e,n){return(0,tP.unwrapAsync)((0,jaI.betaLibrariesDelete)(this,e,n))}async update(e,n){return(0,tP.unwrapAsync)((0,zaI.betaLibrariesUpdate)(this,e,n))}};lpe.Libraries=sze});var Wen=f(lF=>{"use strict";var TaI=lF&&lF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),DaI=lF&&lF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uze=lF&&lF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&TaI(e,t,n);return DaI(e,t),e};Object.defineProperty(lF,"__esModule",{value:!0});lF.betaAgentsCreate=trI;var KaI=kt(),nP=uze(Qt()),_aI=be(),PaI=oe(),hen=Et(),qaI=wt(),Zen=uze(bt()),$aI=uze(Tn()),erI=Jt();function trI(t,e,n){return new erI.APIPromise(nrI(t,e,n))}async function nrI(t,e,n){let l=(0,PaI.safeParse)(e,y=>Zen.AgentCreationRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,KaI.encodeJSON)("body",I,{explode:!0}),c=(0,qaI.pathToFunc)("/v1/agents")(),i=new Headers((0,_aI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,hen.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,hen.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_agents_create",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await nP.match(nP.json(200,Zen.Agent$inboundSchema),nP.jsonErr(422,$aI.HTTPValidationError$inboundSchema),nP.fail("4XX"),nP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Ven=f(IF=>{"use strict";var lrI=IF&&IF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),IrI=IF&&IF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ipe=IF&&IF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&lrI(e,t,n);return IrI(e,t),e};Object.defineProperty(IF,"__esModule",{value:!0});IF.betaAgentsGet=GrI;var arI=kt(),lP=Ipe(Qt()),rrI=be(),crI=oe(),Nen=Et(),orI=wt(),irI=Ipe(bt()),srI=Ipe(Tn()),urI=Ipe(Dn()),drI=Jt();function GrI(t,e,n){return new drI.APIPromise(brI(t,e,n))}async function brI(t,e,n){let l=(0,crI.safeParse)(e,X=>urI.AgentsApiV1AgentsGetRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={agent_id:(0,arI.encodeSimple)("agent_id",I.agent_id,{explode:!1,charEncoding:"percent"})},i=(0,orI.pathToFunc)("/v1/agents/{agent_id}")(c),s=new Headers((0,rrI.compactMap)({Accept:"application/json"})),r=await(0,Nen.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Nen.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_agents_get",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await lP.match(lP.json(200,irI.Agent$inboundSchema),lP.jsonErr(422,srI.HTTPValidationError$inboundSchema),lP.fail("4XX"),lP.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var gen=f(aF=>{"use strict";var mrI=aF&&aF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),prI=aF&&aF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aP=aF&&aF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&mrI(e,t,n);return prI(e,t),e};Object.defineProperty(aF,"__esModule",{value:!0});aF.betaAgentsList=ArI;var hrI=aP(se()),ZrI=kt(),IP=aP(Qt()),WrI=be(),NrI=oe(),Yen=Et(),VrI=wt(),YrI=aP(bt()),grI=aP(Tn()),RrI=aP(Dn()),yrI=Jt();function ArI(t,e,n){return new yrI.APIPromise(FrI(t,e,n))}async function FrI(t,e,n){let l=(0,NrI.safeParse)(e,X=>RrI.AgentsApiV1AgentsListRequest$outboundSchema.optional().parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c=(0,VrI.pathToFunc)("/v1/agents")(),i=(0,ZrI.encodeFormQuery)({page:I?.page,page_size:I?.page_size}),s=new Headers((0,WrI.compactMap)({Accept:"application/json"})),r=await(0,Yen.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Yen.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_agents_list",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:c,headers:s,query:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await IP.match(IP.json(200,hrI.array(YrI.Agent$inboundSchema)),IP.jsonErr(422,grI.HTTPValidationError$inboundSchema),IP.fail("4XX"),IP.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var Aen=f(rF=>{"use strict";var vrI=rF&&rF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),frI=rF&&rF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ape=rF&&rF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&vrI(e,t,n);return frI(e,t),e};Object.defineProperty(rF,"__esModule",{value:!0});rF.betaAgentsUpdate=LrI;var Ren=kt(),rP=ape(Qt()),XrI=be(),wrI=oe(),yen=Et(),HrI=wt(),QrI=ape(bt()),ErI=ape(Tn()),JrI=ape(Dn()),CrI=Jt();function LrI(t,e,n){return new CrI.APIPromise(krI(t,e,n))}async function krI(t,e,n){let l=(0,wrI.safeParse)(e,X=>JrI.AgentsApiV1AgentsUpdateRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,Ren.encodeJSON)("body",I.AgentUpdateRequest,{explode:!0}),c={agent_id:(0,Ren.encodeSimple)("agent_id",I.agent_id,{explode:!1,charEncoding:"percent"})},i=(0,HrI.pathToFunc)("/v1/agents/{agent_id}")(c),s=new Headers((0,XrI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,yen.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,yen.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_agents_update",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"PATCH",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await rP.match(rP.json(200,QrI.Agent$inboundSchema),rP.jsonErr(422,ErI.HTTPValidationError$inboundSchema),rP.fail("4XX"),rP.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var fen=f(cF=>{"use strict";var xrI=cF&&cF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jrI=cF&&cF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rpe=cF&&cF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xrI(e,t,n);return jrI(e,t),e};Object.defineProperty(cF,"__esModule",{value:!0});cF.betaAgentsUpdateVersion=DrI;var Fen=kt(),cP=rpe(Qt()),OrI=be(),UrI=oe(),ven=Et(),zrI=wt(),BrI=rpe(bt()),SrI=rpe(Tn()),MrI=rpe(Dn()),TrI=Jt();function DrI(t,e,n){return new TrI.APIPromise(KrI(t,e,n))}async function KrI(t,e,n){let l=(0,UrI.safeParse)(e,v=>MrI.AgentsApiV1AgentsUpdateVersionRequest$outboundSchema.parse(v),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={agent_id:(0,Fen.encodeSimple)("agent_id",I.agent_id,{explode:!1,charEncoding:"percent"})},i=(0,zrI.pathToFunc)("/v1/agents/{agent_id}/version")(c),s=(0,Fen.encodeFormQuery)({version:I.version}),r=new Headers((0,OrI.compactMap)({Accept:"application/json"})),u=await(0,ven.extractSecurity)(t._options.apiKey),o=u==null?{}:{apiKey:u},d=(0,ven.resolveGlobalSecurity)(o),b={baseURL:n?.serverURL??t._baseURL??"",operationID:"agents_api_v1_agents_update_version",oAuth2Scopes:[],resolvedSecurity:d,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},h=t._createRequest(b,{security:d,method:"PATCH",baseURL:n?.serverURL,path:i,headers:r,query:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!h.ok)return[h,{status:"invalid"}];let Z=h.value,N=await t._do(Z,{context:b,errorCodes:["422","4XX","5XX"],retryConfig:b.retryConfig,retryCodes:b.retryCodes});if(!N.ok)return[N,{status:"request-error",request:Z}];let g=N.value,y={HttpMeta:{Response:g,Request:Z}},[X]=await cP.match(cP.json(200,BrI.Agent$inboundSchema),cP.jsonErr(422,SrI.HTTPValidationError$inboundSchema),cP.fail("4XX"),cP.fail("5XX"))(g,{extraFields:y});return X.ok?[X,{status:"complete",request:Z,response:g}]:[X,{status:"complete",request:Z,response:g}]}});var Xen=f(cpe=>{"use strict";Object.defineProperty(cpe,"__esModule",{value:!0});cpe.MistralAgents=void 0;var _rI=Wen(),PrI=Ven(),qrI=gen(),$rI=Aen(),ecI=fen(),tcI=di(),oP=Hd(),dze=class extends tcI.ClientSDK{async create(e,n){return(0,oP.unwrapAsync)((0,_rI.betaAgentsCreate)(this,e,n))}async list(e,n){return(0,oP.unwrapAsync)((0,qrI.betaAgentsList)(this,e,n))}async get(e,n){return(0,oP.unwrapAsync)((0,PrI.betaAgentsGet)(this,e,n))}async update(e,n){return(0,oP.unwrapAsync)((0,$rI.betaAgentsUpdate)(this,e,n))}async updateVersion(e,n){return(0,oP.unwrapAsync)((0,ecI.betaAgentsUpdateVersion)(this,e,n))}};cpe.MistralAgents=dze});var wen=f(ope=>{"use strict";Object.defineProperty(ope,"__esModule",{value:!0});ope.Beta=void 0;var ncI=di(),lcI=Z$t(),IcI=pen(),acI=Xen(),Gze=class extends ncI.ClientSDK{get conversations(){return this._conversations??(this._conversations=new lcI.Conversations(this._options))}get agents(){return this._agents??(this._agents=new acI.MistralAgents(this._options))}get libraries(){return this._libraries??(this._libraries=new IcI.Libraries(this._options))}};ope.Beta=Gze});var Een=f(oF=>{"use strict";var rcI=oF&&oF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ccI=oF&&oF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bze=oF&&oF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&rcI(e,t,n);return ccI(e,t),e};Object.defineProperty(oF,"__esModule",{value:!0});oF.chatComplete=bcI;var ocI=kt(),iP=bze(Qt()),icI=be(),scI=oe(),Hen=Et(),ucI=wt(),Qen=bze(bt()),dcI=bze(Tn()),GcI=Jt();function bcI(t,e,n){return new GcI.APIPromise(mcI(t,e,n))}async function mcI(t,e,n){let l=(0,scI.safeParse)(e,y=>Qen.ChatCompletionRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,ocI.encodeJSON)("body",I,{explode:!0}),c=(0,ucI.pathToFunc)("/v1/chat/completions")(),i=new Headers((0,icI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,Hen.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,Hen.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"chat_completion_v1_chat_completions_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await iP.match(iP.json(200,Qen.ChatCompletionResponse$inboundSchema),iP.jsonErr(422,dcI.HTTPValidationError$inboundSchema),iP.fail("4XX"),iP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Len=f(iF=>{"use strict";var pcI=iF&&iF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),hcI=iF&&iF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ipe=iF&&iF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&pcI(e,t,n);return hcI(e,t),e};Object.defineProperty(iF,"__esModule",{value:!0});iF.chatStream=AcI;var ZcI=ipe(se()),WcI=kt(),NcI=BX(),sP=ipe(Qt()),VcI=be(),YcI=oe(),Jen=Et(),gcI=wt(),Cen=ipe(bt()),RcI=ipe(Tn()),ycI=Jt();function AcI(t,e,n){return new ycI.APIPromise(FcI(t,e,n))}async function FcI(t,e,n){let l=(0,YcI.safeParse)(e,y=>Cen.ChatCompletionStreamRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,WcI.encodeJSON)("body",I,{explode:!0}),c=(0,gcI.pathToFunc)("/v1/chat/completions#stream")(),i=new Headers((0,VcI.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),s=await(0,Jen.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,Jen.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"stream_chat",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await sP.match(sP.sse(200,ZcI.instanceof(ReadableStream).transform(y=>new NcI.EventStream({stream:y,decoder(X){return Cen.CompletionEvent$inboundSchema.parse(X)}})),{sseSentinel:"[DONE]"}),sP.jsonErr(422,RcI.HTTPValidationError$inboundSchema),sP.fail("4XX"),sP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var spe=f(eN=>{"use strict";Object.defineProperty(eN,"__esModule",{value:!0});eN.getDefaultOptions=eN.defaultOptions=eN.jsonDescription=eN.ignoreOverride=void 0;eN.ignoreOverride=Symbol("Let zodToJsonSchema decide on which parser to use");var vcI=(t,e)=>{if(e.description)try{return{...t,...JSON.parse(e.description)}}catch{}return t};eN.jsonDescription=vcI;eN.defaultOptions={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"};var fcI=t=>typeof t=="string"?{...eN.defaultOptions,name:t}:{...eN.defaultOptions,...t};eN.getDefaultOptions=fcI});var mze=f(upe=>{"use strict";Object.defineProperty(upe,"__esModule",{value:!0});upe.getRefs=void 0;var XcI=spe(),wcI=t=>{let e=(0,XcI.getDefaultOptions)(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([l,I])=>[I._def,{def:I._def,path:[...e.basePath,e.definitionPath,l],jsonSchema:void 0}]))}};upe.getRefs=wcI});var bw=f(NO=>{"use strict";Object.defineProperty(NO,"__esModule",{value:!0});NO.setResponseValueAndErrors=NO.addErrorMessage=void 0;function ken(t,e,n,l){l?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}NO.addErrorMessage=ken;function HcI(t,e,n,l,I){t[e]=n,ken(t,e,l,I)}NO.setResponseValueAndErrors=HcI});var Gpe=f(dpe=>{"use strict";Object.defineProperty(dpe,"__esModule",{value:!0});dpe.getRelativePath=void 0;var QcI=(t,e)=>{let n=0;for(;n{"use strict";Object.defineProperty(bpe,"__esModule",{value:!0});bpe.parseAnyDef=void 0;var EcI=Gpe();function JcI(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?(0,EcI.getRelativePath)(e,t.currentPath):e.join("/")}}bpe.parseAnyDef=JcI});var pze=f(ppe=>{"use strict";Object.defineProperty(ppe,"__esModule",{value:!0});ppe.parseArrayDef=void 0;var CcI=se(),mpe=bw(),LcI=ju();function kcI(t,e){let n={type:"array"};return t.type?._def&&t.type?._def?.typeName!==CcI.ZodFirstPartyTypeKind.ZodAny&&(n.items=(0,LcI.parseDef)(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(0,mpe.setResponseValueAndErrors)(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&(0,mpe.setResponseValueAndErrors)(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&((0,mpe.setResponseValueAndErrors)(n,"minItems",t.exactLength.value,t.exactLength.message,e),(0,mpe.setResponseValueAndErrors)(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}ppe.parseArrayDef=kcI});var hze=f(hpe=>{"use strict";Object.defineProperty(hpe,"__esModule",{value:!0});hpe.parseBigintDef=void 0;var VJ=bw();function xcI(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let l of t.checks)switch(l.kind){case"min":e.target==="jsonSchema7"?l.inclusive?(0,VJ.setResponseValueAndErrors)(n,"minimum",l.value,l.message,e):(0,VJ.setResponseValueAndErrors)(n,"exclusiveMinimum",l.value,l.message,e):(l.inclusive||(n.exclusiveMinimum=!0),(0,VJ.setResponseValueAndErrors)(n,"minimum",l.value,l.message,e));break;case"max":e.target==="jsonSchema7"?l.inclusive?(0,VJ.setResponseValueAndErrors)(n,"maximum",l.value,l.message,e):(0,VJ.setResponseValueAndErrors)(n,"exclusiveMaximum",l.value,l.message,e):(l.inclusive||(n.exclusiveMaximum=!0),(0,VJ.setResponseValueAndErrors)(n,"maximum",l.value,l.message,e));break;case"multipleOf":(0,VJ.setResponseValueAndErrors)(n,"multipleOf",l.value,l.message,e);break}return n}hpe.parseBigintDef=xcI});var Zze=f(Zpe=>{"use strict";Object.defineProperty(Zpe,"__esModule",{value:!0});Zpe.parseBooleanDef=void 0;function jcI(){return{type:"boolean"}}Zpe.parseBooleanDef=jcI});var Npe=f(Wpe=>{"use strict";Object.defineProperty(Wpe,"__esModule",{value:!0});Wpe.parseBrandedDef=void 0;var OcI=ju();function UcI(t,e){return(0,OcI.parseDef)(t.type._def,e)}Wpe.parseBrandedDef=UcI});var Wze=f(Vpe=>{"use strict";Object.defineProperty(Vpe,"__esModule",{value:!0});Vpe.parseCatchDef=void 0;var zcI=ju(),BcI=(t,e)=>(0,zcI.parseDef)(t.innerType._def,e);Vpe.parseCatchDef=BcI});var Nze=f(Ype=>{"use strict";Object.defineProperty(Ype,"__esModule",{value:!0});Ype.parseDateDef=void 0;var xen=bw();function jen(t,e,n){let l=n??e.dateStrategy;if(Array.isArray(l))return{anyOf:l.map((I,a)=>jen(t,e,I))};switch(l){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ScI(t,e)}}Ype.parseDateDef=jen;var ScI=(t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let l of t.checks)switch(l.kind){case"min":(0,xen.setResponseValueAndErrors)(n,"minimum",l.value,l.message,e);break;case"max":(0,xen.setResponseValueAndErrors)(n,"maximum",l.value,l.message,e);break}return n}});var Vze=f(gpe=>{"use strict";Object.defineProperty(gpe,"__esModule",{value:!0});gpe.parseDefaultDef=void 0;var McI=ju();function TcI(t,e){return{...(0,McI.parseDef)(t.innerType._def,e),default:t.defaultValue()}}gpe.parseDefaultDef=TcI});var Yze=f(Rpe=>{"use strict";Object.defineProperty(Rpe,"__esModule",{value:!0});Rpe.parseEffectsDef=void 0;var DcI=ju(),KcI=tN();function _cI(t,e){return e.effectStrategy==="input"?(0,DcI.parseDef)(t.schema._def,e):(0,KcI.parseAnyDef)(e)}Rpe.parseEffectsDef=_cI});var gze=f(ype=>{"use strict";Object.defineProperty(ype,"__esModule",{value:!0});ype.parseEnumDef=void 0;function PcI(t){return{type:"string",enum:Array.from(t.values)}}ype.parseEnumDef=PcI});var Rze=f(Ape=>{"use strict";Object.defineProperty(Ape,"__esModule",{value:!0});Ape.parseIntersectionDef=void 0;var Oen=ju(),qcI=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function $cI(t,e){let n=[(0,Oen.parseDef)(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),(0,Oen.parseDef)(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(a=>!!a),l=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,I=[];return n.forEach(a=>{if(qcI(a))I.push(...a.allOf),a.unevaluatedProperties===void 0&&(l=void 0);else{let c=a;if("additionalProperties"in a&&a.additionalProperties===!1){let{additionalProperties:i,...s}=a;c=s}else l=void 0;I.push(c)}}),I.length?{allOf:I,...l}:void 0}Ape.parseIntersectionDef=$cI});var yze=f(Fpe=>{"use strict";Object.defineProperty(Fpe,"__esModule",{value:!0});Fpe.parseLiteralDef=void 0;function eoI(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}Fpe.parseLiteralDef=eoI});var vpe=f(CG=>{"use strict";Object.defineProperty(CG,"__esModule",{value:!0});CG.parseStringDef=CG.zodPatterns=void 0;var YJ=bw(),Aze;CG.zodPatterns={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Aze===void 0&&(Aze=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Aze),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function toI(t,e){let n={type:"string"};if(t.checks)for(let l of t.checks)switch(l.kind){case"min":(0,YJ.setResponseValueAndErrors)(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,l.value):l.value,l.message,e);break;case"max":(0,YJ.setResponseValueAndErrors)(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,l.value):l.value,l.message,e);break;case"email":switch(e.emailStrategy){case"format:email":PV(n,"email",l.message,e);break;case"format:idn-email":PV(n,"idn-email",l.message,e);break;case"pattern:zod":Xm(n,CG.zodPatterns.email,l.message,e);break}break;case"url":PV(n,"uri",l.message,e);break;case"uuid":PV(n,"uuid",l.message,e);break;case"regex":Xm(n,l.regex,l.message,e);break;case"cuid":Xm(n,CG.zodPatterns.cuid,l.message,e);break;case"cuid2":Xm(n,CG.zodPatterns.cuid2,l.message,e);break;case"startsWith":Xm(n,RegExp(`^${Fze(l.value,e)}`),l.message,e);break;case"endsWith":Xm(n,RegExp(`${Fze(l.value,e)}$`),l.message,e);break;case"datetime":PV(n,"date-time",l.message,e);break;case"date":PV(n,"date",l.message,e);break;case"time":PV(n,"time",l.message,e);break;case"duration":PV(n,"duration",l.message,e);break;case"length":(0,YJ.setResponseValueAndErrors)(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,l.value):l.value,l.message,e),(0,YJ.setResponseValueAndErrors)(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,l.value):l.value,l.message,e);break;case"includes":{Xm(n,RegExp(Fze(l.value,e)),l.message,e);break}case"ip":{l.version!=="v6"&&PV(n,"ipv4",l.message,e),l.version!=="v4"&&PV(n,"ipv6",l.message,e);break}case"base64url":Xm(n,CG.zodPatterns.base64url,l.message,e);break;case"jwt":Xm(n,CG.zodPatterns.jwt,l.message,e);break;case"cidr":{l.version!=="v6"&&Xm(n,CG.zodPatterns.ipv4Cidr,l.message,e),l.version!=="v4"&&Xm(n,CG.zodPatterns.ipv6Cidr,l.message,e);break}case"emoji":Xm(n,CG.zodPatterns.emoji(),l.message,e);break;case"ulid":{Xm(n,CG.zodPatterns.ulid,l.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{PV(n,"binary",l.message,e);break}case"contentEncoding:base64":{(0,YJ.setResponseValueAndErrors)(n,"contentEncoding","base64",l.message,e);break}case"pattern:zod":{Xm(n,CG.zodPatterns.base64,l.message,e);break}}break}case"nanoid":Xm(n,CG.zodPatterns.nanoid,l.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}CG.parseStringDef=toI;function Fze(t,e){return e.patternStrategy==="escape"?loI(t):t}var noI=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function loI(t){let e="";for(let n=0;nI.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&l.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&l.errorMessages&&{errorMessage:{format:n}}})):(0,YJ.setResponseValueAndErrors)(t,"format",e,n,l)}function Xm(t,e,n,l){t.pattern||t.allOf?.some(I=>I.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&l.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Uen(e,l),...n&&l.errorMessages&&{errorMessage:{pattern:n}}})):(0,YJ.setResponseValueAndErrors)(t,"pattern",Uen(e,l),n,l)}function Uen(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},l=n.i?t.source.toLowerCase():t.source,I="",a=!1,c=!1,i=!1;for(let s=0;s{"use strict";Object.defineProperty(fpe,"__esModule",{value:!0});fpe.parseRecordDef=void 0;var uP=se(),zen=ju(),IoI=vpe(),aoI=Npe(),roI=tN();function coI(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===uP.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((l,I)=>({...l,[I]:(0,zen.parseDef)(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",I]})??(0,roI.parseAnyDef)(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:(0,zen.parseDef)(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===uP.ZodFirstPartyTypeKind.ZodString&&t.keyType._def.checks?.length){let{type:l,...I}=(0,IoI.parseStringDef)(t.keyType._def,e);return{...n,propertyNames:I}}else{if(t.keyType?._def.typeName===uP.ZodFirstPartyTypeKind.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===uP.ZodFirstPartyTypeKind.ZodBranded&&t.keyType._def.type._def.typeName===uP.ZodFirstPartyTypeKind.ZodString&&t.keyType._def.type._def.checks?.length){let{type:l,...I}=(0,aoI.parseBrandedDef)(t.keyType._def,e);return{...n,propertyNames:I}}}return n}fpe.parseRecordDef=coI});var vze=f(wpe=>{"use strict";Object.defineProperty(wpe,"__esModule",{value:!0});wpe.parseMapDef=void 0;var Ben=ju(),ooI=Xpe(),Sen=tN();function ioI(t,e){if(e.mapStrategy==="record")return(0,ooI.parseRecordDef)(t,e);let n=(0,Ben.parseDef)(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||(0,Sen.parseAnyDef)(e),l=(0,Ben.parseDef)(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||(0,Sen.parseAnyDef)(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,l],minItems:2,maxItems:2}}}wpe.parseMapDef=ioI});var fze=f(Hpe=>{"use strict";Object.defineProperty(Hpe,"__esModule",{value:!0});Hpe.parseNativeEnumDef=void 0;function soI(t){let e=t.values,l=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),I=Array.from(new Set(l.map(a=>typeof a)));return{type:I.length===1?I[0]==="string"?"string":"number":["string","number"],enum:l}}Hpe.parseNativeEnumDef=soI});var Xze=f(Qpe=>{"use strict";Object.defineProperty(Qpe,"__esModule",{value:!0});Qpe.parseNeverDef=void 0;var uoI=tN();function doI(t){return t.target==="openAi"?void 0:{not:(0,uoI.parseAnyDef)({...t,currentPath:[...t.currentPath,"not"]})}}Qpe.parseNeverDef=doI});var wze=f(Epe=>{"use strict";Object.defineProperty(Epe,"__esModule",{value:!0});Epe.parseNullDef=void 0;function GoI(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}Epe.parseNullDef=GoI});var Jpe=f(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});mw.parseUnionDef=mw.primitiveMappings=void 0;var boI=ju();mw.primitiveMappings={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function moI(t,e){if(e.target==="openApi3")return Men(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(l=>l._def.typeName in mw.primitiveMappings&&(!l._def.checks||!l._def.checks.length))){let l=n.reduce((I,a)=>{let c=mw.primitiveMappings[a._def.typeName];return c&&!I.includes(c)?[...I,c]:I},[]);return{type:l.length>1?l:l[0]}}else if(n.every(l=>l._def.typeName==="ZodLiteral"&&!l.description)){let l=n.reduce((I,a)=>{let c=typeof a._def.value;switch(c){case"string":case"number":case"boolean":return[...I,c];case"bigint":return[...I,"integer"];case"object":if(a._def.value===null)return[...I,"null"];case"symbol":case"undefined":case"function":default:return I}},[]);if(l.length===n.length){let I=l.filter((a,c,i)=>i.indexOf(a)===c);return{type:I.length>1?I:I[0],enum:n.reduce((a,c)=>a.includes(c._def.value)?a:[...a,c._def.value],[])}}}else if(n.every(l=>l._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((l,I)=>[...l,...I._def.values.filter(a=>!l.includes(a))],[])};return Men(t,e)}mw.parseUnionDef=moI;var Men=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((l,I)=>(0,boI.parseDef)(l._def,{...e,currentPath:[...e.currentPath,"anyOf",`${I}`]})).filter(l=>!!l&&(!e.strictUnions||typeof l=="object"&&Object.keys(l).length>0));return n.length?{anyOf:n}:void 0}});var Hze=f(Cpe=>{"use strict";Object.defineProperty(Cpe,"__esModule",{value:!0});Cpe.parseNullableDef=void 0;var Ten=ju(),Den=Jpe();function poI(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Den.primitiveMappings[t.innerType._def.typeName],nullable:!0}:{type:[Den.primitiveMappings[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let l=(0,Ten.parseDef)(t.innerType._def,{...e,currentPath:[...e.currentPath]});return l&&"$ref"in l?{allOf:[l],nullable:!0}:l&&{...l,nullable:!0}}let n=(0,Ten.parseDef)(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}Cpe.parseNullableDef=poI});var Qze=f(Lpe=>{"use strict";Object.defineProperty(Lpe,"__esModule",{value:!0});Lpe.parseNumberDef=void 0;var pw=bw();function hoI(t,e){let n={type:"number"};if(!t.checks)return n;for(let l of t.checks)switch(l.kind){case"int":n.type="integer",(0,pw.addErrorMessage)(n,"type",l.message,e);break;case"min":e.target==="jsonSchema7"?l.inclusive?(0,pw.setResponseValueAndErrors)(n,"minimum",l.value,l.message,e):(0,pw.setResponseValueAndErrors)(n,"exclusiveMinimum",l.value,l.message,e):(l.inclusive||(n.exclusiveMinimum=!0),(0,pw.setResponseValueAndErrors)(n,"minimum",l.value,l.message,e));break;case"max":e.target==="jsonSchema7"?l.inclusive?(0,pw.setResponseValueAndErrors)(n,"maximum",l.value,l.message,e):(0,pw.setResponseValueAndErrors)(n,"exclusiveMaximum",l.value,l.message,e):(l.inclusive||(n.exclusiveMaximum=!0),(0,pw.setResponseValueAndErrors)(n,"maximum",l.value,l.message,e));break;case"multipleOf":(0,pw.setResponseValueAndErrors)(n,"multipleOf",l.value,l.message,e);break}return n}Lpe.parseNumberDef=hoI});var Eze=f(kpe=>{"use strict";Object.defineProperty(kpe,"__esModule",{value:!0});kpe.parseObjectDef=void 0;var Ken=ju();function ZoI(t,e){let n=e.target==="openAi",l={type:"object",properties:{}},I=[],a=t.shape();for(let i in a){let s=a[i];if(s===void 0||s._def===void 0)continue;let r=NoI(s);r&&n&&(s._def.typeName==="ZodOptional"&&(s=s._def.innerType),s.isNullable()||(s=s.nullable()),r=!1);let u=(0,Ken.parseDef)(s._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});u!==void 0&&(l.properties[i]=u,r||I.push(i))}I.length&&(l.required=I);let c=WoI(t,e);return c!==void 0&&(l.additionalProperties=c),l}kpe.parseObjectDef=ZoI;function WoI(t,e){if(t.catchall._def.typeName!=="ZodNever")return(0,Ken.parseDef)(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function NoI(t){try{return t.isOptional()}catch{return!0}}});var Jze=f(xpe=>{"use strict";Object.defineProperty(xpe,"__esModule",{value:!0});xpe.parseOptionalDef=void 0;var _en=ju(),Pen=tN(),VoI=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return(0,_en.parseDef)(t.innerType._def,e);let n=(0,_en.parseDef)(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:(0,Pen.parseAnyDef)(e)},n]}:(0,Pen.parseAnyDef)(e)};xpe.parseOptionalDef=VoI});var Cze=f(Ope=>{"use strict";Object.defineProperty(Ope,"__esModule",{value:!0});Ope.parsePipelineDef=void 0;var jpe=ju(),YoI=(t,e)=>{if(e.pipeStrategy==="input")return(0,jpe.parseDef)(t.in._def,e);if(e.pipeStrategy==="output")return(0,jpe.parseDef)(t.out._def,e);let n=(0,jpe.parseDef)(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),l=(0,jpe.parseDef)(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,l].filter(I=>I!==void 0)}};Ope.parsePipelineDef=YoI});var Lze=f(Upe=>{"use strict";Object.defineProperty(Upe,"__esModule",{value:!0});Upe.parsePromiseDef=void 0;var goI=ju();function RoI(t,e){return(0,goI.parseDef)(t.type._def,e)}Upe.parsePromiseDef=RoI});var kze=f(zpe=>{"use strict";Object.defineProperty(zpe,"__esModule",{value:!0});zpe.parseSetDef=void 0;var qen=bw(),yoI=ju();function AoI(t,e){let l={type:"array",uniqueItems:!0,items:(0,yoI.parseDef)(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(0,qen.setResponseValueAndErrors)(l,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&(0,qen.setResponseValueAndErrors)(l,"maxItems",t.maxSize.value,t.maxSize.message,e),l}zpe.parseSetDef=AoI});var jze=f(Bpe=>{"use strict";Object.defineProperty(Bpe,"__esModule",{value:!0});Bpe.parseTupleDef=void 0;var xze=ju();function FoI(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,l)=>(0,xze.parseDef)(n._def,{...e,currentPath:[...e.currentPath,"items",`${l}`]})).reduce((n,l)=>l===void 0?n:[...n,l],[]),additionalItems:(0,xze.parseDef)(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,l)=>(0,xze.parseDef)(n._def,{...e,currentPath:[...e.currentPath,"items",`${l}`]})).reduce((n,l)=>l===void 0?n:[...n,l],[])}}Bpe.parseTupleDef=FoI});var Oze=f(Spe=>{"use strict";Object.defineProperty(Spe,"__esModule",{value:!0});Spe.parseUndefinedDef=void 0;var voI=tN();function foI(t){return{not:(0,voI.parseAnyDef)(t)}}Spe.parseUndefinedDef=foI});var Uze=f(Mpe=>{"use strict";Object.defineProperty(Mpe,"__esModule",{value:!0});Mpe.parseUnknownDef=void 0;var XoI=tN();function woI(t){return(0,XoI.parseAnyDef)(t)}Mpe.parseUnknownDef=woI});var zze=f(Tpe=>{"use strict";Object.defineProperty(Tpe,"__esModule",{value:!0});Tpe.parseReadonlyDef=void 0;var HoI=ju(),QoI=(t,e)=>(0,HoI.parseDef)(t.innerType._def,e);Tpe.parseReadonlyDef=QoI});var Bze=f(Dpe=>{"use strict";Object.defineProperty(Dpe,"__esModule",{value:!0});Dpe.selectParser=void 0;var VI=se(),EoI=tN(),JoI=pze(),CoI=hze(),LoI=Zze(),koI=Npe(),xoI=Wze(),joI=Nze(),OoI=Vze(),UoI=Yze(),zoI=gze(),BoI=Rze(),SoI=yze(),MoI=vze(),ToI=fze(),DoI=Xze(),KoI=wze(),_oI=Hze(),PoI=Qze(),qoI=Eze(),$oI=Jze(),eiI=Cze(),tiI=Lze(),niI=Xpe(),liI=kze(),IiI=vpe(),aiI=jze(),riI=Oze(),ciI=Jpe(),oiI=Uze(),iiI=zze(),siI=(t,e,n)=>{switch(e){case VI.ZodFirstPartyTypeKind.ZodString:return(0,IiI.parseStringDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodNumber:return(0,PoI.parseNumberDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodObject:return(0,qoI.parseObjectDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodBigInt:return(0,CoI.parseBigintDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodBoolean:return(0,LoI.parseBooleanDef)();case VI.ZodFirstPartyTypeKind.ZodDate:return(0,joI.parseDateDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodUndefined:return(0,riI.parseUndefinedDef)(n);case VI.ZodFirstPartyTypeKind.ZodNull:return(0,KoI.parseNullDef)(n);case VI.ZodFirstPartyTypeKind.ZodArray:return(0,JoI.parseArrayDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodUnion:case VI.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,ciI.parseUnionDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodIntersection:return(0,BoI.parseIntersectionDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodTuple:return(0,aiI.parseTupleDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodRecord:return(0,niI.parseRecordDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodLiteral:return(0,SoI.parseLiteralDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodEnum:return(0,zoI.parseEnumDef)(t);case VI.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,ToI.parseNativeEnumDef)(t);case VI.ZodFirstPartyTypeKind.ZodNullable:return(0,_oI.parseNullableDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodOptional:return(0,$oI.parseOptionalDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodMap:return(0,MoI.parseMapDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodSet:return(0,liI.parseSetDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodLazy:return()=>t.getter()._def;case VI.ZodFirstPartyTypeKind.ZodPromise:return(0,tiI.parsePromiseDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodNaN:case VI.ZodFirstPartyTypeKind.ZodNever:return(0,DoI.parseNeverDef)(n);case VI.ZodFirstPartyTypeKind.ZodEffects:return(0,UoI.parseEffectsDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodAny:return(0,EoI.parseAnyDef)(n);case VI.ZodFirstPartyTypeKind.ZodUnknown:return(0,oiI.parseUnknownDef)(n);case VI.ZodFirstPartyTypeKind.ZodDefault:return(0,OoI.parseDefaultDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodBranded:return(0,koI.parseBrandedDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodReadonly:return(0,iiI.parseReadonlyDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodCatch:return(0,xoI.parseCatchDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodPipeline:return(0,eiI.parsePipelineDef)(t,n);case VI.ZodFirstPartyTypeKind.ZodFunction:case VI.ZodFirstPartyTypeKind.ZodVoid:case VI.ZodFirstPartyTypeKind.ZodSymbol:return;default:return(l=>{})(e)}};Dpe.selectParser=siI});var ju=f(Kpe=>{"use strict";Object.defineProperty(Kpe,"__esModule",{value:!0});Kpe.parseDef=void 0;var uiI=spe(),diI=Bze(),GiI=Gpe(),$en=tN();function etn(t,e,n=!1){let l=e.seen.get(t);if(e.override){let i=e.override?.(t,e,l,n);if(i!==uiI.ignoreOverride)return i}if(l&&!n){let i=biI(l,e);if(i!==void 0)return i}let I={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,I);let a=(0,diI.selectParser)(t,t.typeName,e),c=typeof a=="function"?etn(a(),e):a;if(c&&miI(t,e,c),e.postProcess){let i=e.postProcess(c,t,e);return I.jsonSchema=c,i}return I.jsonSchema=c,c}Kpe.parseDef=etn;var biI=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:(0,GiI.getRelativePath)(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[l]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),(0,$en.parseAnyDef)(e)):e.$refStrategy==="seen"?(0,$en.parseAnyDef)(e):void 0}},miI=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n)});var ntn=f(ttn=>{"use strict";Object.defineProperty(ttn,"__esModule",{value:!0})});var Sze=f(_pe=>{"use strict";Object.defineProperty(_pe,"__esModule",{value:!0});_pe.zodToJsonSchema=void 0;var ltn=ju(),piI=mze(),Itn=tN(),hiI=(t,e)=>{let n=(0,piI.getRefs)(e),l=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((s,[r,u])=>({...s,[r]:(0,ltn.parseDef)(u._def,{...n,currentPath:[...n.basePath,n.definitionPath,r]},!0)??(0,Itn.parseAnyDef)(n)}),{}):void 0,I=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(0,ltn.parseDef)(t._def,I===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,I]},!1)??(0,Itn.parseAnyDef)(n),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(a.title=c),n.flags.hasReferencedOpenAiAnyType&&(l||(l={}),l[n.openAiAnyTypeName]||(l[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let i=I===void 0?l?{...a,[n.definitionPath]:l}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,I].join("/"),[n.definitionPath]:{...l,[I]:a}};return n.target==="jsonSchema7"?i.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(i.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in i||"oneOf"in i||"allOf"in i||"type"in i&&Array.isArray(i.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),i};_pe.zodToJsonSchema=hiI});var atn=f(Rl=>{"use strict";var ZiI=Rl&&Rl.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),cI=Rl&&Rl.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&ZiI(e,t,n)};Object.defineProperty(Rl,"__esModule",{value:!0});cI(spe(),Rl);cI(mze(),Rl);cI(bw(),Rl);cI(Gpe(),Rl);cI(ju(),Rl);cI(ntn(),Rl);cI(tN(),Rl);cI(pze(),Rl);cI(hze(),Rl);cI(Zze(),Rl);cI(Npe(),Rl);cI(Wze(),Rl);cI(Nze(),Rl);cI(Vze(),Rl);cI(Yze(),Rl);cI(gze(),Rl);cI(Rze(),Rl);cI(yze(),Rl);cI(vze(),Rl);cI(fze(),Rl);cI(Xze(),Rl);cI(wze(),Rl);cI(Hze(),Rl);cI(Qze(),Rl);cI(Eze(),Rl);cI(Jze(),Rl);cI(Cze(),Rl);cI(Lze(),Rl);cI(zze(),Rl);cI(Xpe(),Rl);cI(kze(),Rl);cI(vpe(),Rl);cI(jze(),Rl);cI(Oze(),Rl);cI(Jpe(),Rl);cI(Uze(),Rl);cI(Bze(),Rl);cI(Sze(),Rl);var WiI=Sze();Rl.default=WiI.zodToJsonSchema});var ctn=f(dP=>{"use strict";Object.defineProperty(dP,"__esModule",{value:!0});dP.transformToChatCompletionRequest=ViI;dP.convertToParsedChatCompletionResponse=YiI;dP.responseFormatFromZodObject=rtn;var NiI=atn();function ViI(t){let{responseFormat:e,...n}=t,l=rtn(e);return{...n,responseFormat:l}}function YiI(t,e){if(t.choices===void 0||t.choices.length===0)return{...t,choices:t.choices===void 0?void 0:[]};let n=[];for(let l of t.choices)l.message===null||typeof l.message>"u"?n.push({...l,message:void 0}):l.message.content!==null&&typeof l.message.content<"u"&&!Array.isArray(l.message.content)&&n.push({...l,message:{...l.message,parsed:e.safeParse(JSON.parse(l.message.content)).data}});return{...t,choices:n}}function rtn(t){return{type:"json_schema",jsonSchema:{name:"placeholderName",schemaDefinition:(0,NiI.zodToJsonSchema)(t),strict:!0}}}});var stn=f(qpe=>{"use strict";Object.defineProperty(qpe,"__esModule",{value:!0});qpe.Chat=void 0;var otn=Een(),itn=Len(),giI=di(),Ppe=Hd(),Mze=ctn(),Tze=class extends giI.ClientSDK{async parse(e,n){let l=(0,Mze.transformToChatCompletionRequest)(e),I=await(0,Ppe.unwrapAsync)((0,otn.chatComplete)(this,l,n));return(0,Mze.convertToParsedChatCompletionResponse)(I,e.responseFormat)}async parseStream(e,n){let l=(0,Mze.transformToChatCompletionRequest)(e);return(0,Ppe.unwrapAsync)((0,itn.chatStream)(this,l,n))}async complete(e,n){return(0,Ppe.unwrapAsync)((0,otn.chatComplete)(this,e,n))}async stream(e,n){return(0,Ppe.unwrapAsync)((0,itn.chatStream)(this,e,n))}};qpe.Chat=Tze});var Gtn=f(sF=>{"use strict";var RiI=sF&&sF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),yiI=sF&&sF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Dze=sF&&sF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&RiI(e,t,n);return yiI(e,t),e};Object.defineProperty(sF,"__esModule",{value:!0});sF.classifiersClassify=HiI;var AiI=kt(),GP=Dze(Qt()),FiI=be(),viI=oe(),utn=Et(),fiI=wt(),dtn=Dze(bt()),XiI=Dze(Tn()),wiI=Jt();function HiI(t,e,n){return new wiI.APIPromise(QiI(t,e,n))}async function QiI(t,e,n){let l=(0,viI.safeParse)(e,y=>dtn.ClassificationRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,AiI.encodeJSON)("body",I,{explode:!0}),c=(0,fiI.pathToFunc)("/v1/classifications")(),i=new Headers((0,FiI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,utn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,utn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"classifications_v1_classifications_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await GP.match(GP.json(200,dtn.ClassificationResponse$inboundSchema),GP.jsonErr(422,XiI.HTTPValidationError$inboundSchema),GP.fail("4XX"),GP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var ptn=f(uF=>{"use strict";var EiI=uF&&uF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),JiI=uF&&uF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kze=uF&&uF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&EiI(e,t,n);return JiI(e,t),e};Object.defineProperty(uF,"__esModule",{value:!0});uF.classifiersClassifyChat=UiI;var CiI=kt(),bP=Kze(Qt()),LiI=be(),kiI=oe(),btn=Et(),xiI=wt(),mtn=Kze(bt()),jiI=Kze(Tn()),OiI=Jt();function UiI(t,e,n){return new OiI.APIPromise(ziI(t,e,n))}async function ziI(t,e,n){let l=(0,kiI.safeParse)(e,y=>mtn.ChatClassificationRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,CiI.encodeJSON)("body",I,{explode:!0}),c=(0,xiI.pathToFunc)("/v1/chat/classifications")(),i=new Headers((0,LiI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,btn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,btn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"chat_classifications_v1_chat_classifications_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await bP.match(bP.json(200,mtn.ClassificationResponse$inboundSchema),bP.jsonErr(422,jiI.HTTPValidationError$inboundSchema),bP.fail("4XX"),bP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Wtn=f(dF=>{"use strict";var BiI=dF&&dF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),SiI=dF&&dF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_ze=dF&&dF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&BiI(e,t,n);return SiI(e,t),e};Object.defineProperty(dF,"__esModule",{value:!0});dF.classifiersModerate=qiI;var MiI=kt(),mP=_ze(Qt()),TiI=be(),DiI=oe(),htn=Et(),KiI=wt(),Ztn=_ze(bt()),_iI=_ze(Tn()),PiI=Jt();function qiI(t,e,n){return new PiI.APIPromise($iI(t,e,n))}async function $iI(t,e,n){let l=(0,DiI.safeParse)(e,y=>Ztn.ClassificationRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,MiI.encodeJSON)("body",I,{explode:!0}),c=(0,KiI.pathToFunc)("/v1/moderations")(),i=new Headers((0,TiI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,htn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,htn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"moderations_v1_moderations_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await mP.match(mP.json(200,Ztn.ModerationResponse$inboundSchema),mP.jsonErr(422,_iI.HTTPValidationError$inboundSchema),mP.fail("4XX"),mP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Ytn=f(GF=>{"use strict";var esI=GF&&GF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),tsI=GF&&GF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pze=GF&&GF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&esI(e,t,n);return tsI(e,t),e};Object.defineProperty(GF,"__esModule",{value:!0});GF.classifiersModerateChat=osI;var nsI=kt(),pP=Pze(Qt()),lsI=be(),IsI=oe(),Ntn=Et(),asI=wt(),Vtn=Pze(bt()),rsI=Pze(Tn()),csI=Jt();function osI(t,e,n){return new csI.APIPromise(isI(t,e,n))}async function isI(t,e,n){let l=(0,IsI.safeParse)(e,y=>Vtn.ChatModerationRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,nsI.encodeJSON)("body",I,{explode:!0}),c=(0,asI.pathToFunc)("/v1/chat/moderations")(),i=new Headers((0,lsI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,Ntn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,Ntn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"chat_moderations_v1_chat_moderations_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await pP.match(pP.json(200,Vtn.ModerationResponse$inboundSchema),pP.jsonErr(422,rsI.HTTPValidationError$inboundSchema),pP.fail("4XX"),pP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var gtn=f(ehe=>{"use strict";Object.defineProperty(ehe,"__esModule",{value:!0});ehe.Classifiers=void 0;var ssI=Gtn(),usI=ptn(),dsI=Wtn(),GsI=Ytn(),bsI=di(),$pe=Hd(),qze=class extends bsI.ClientSDK{async moderate(e,n){return(0,$pe.unwrapAsync)((0,dsI.classifiersModerate)(this,e,n))}async moderateChat(e,n){return(0,$pe.unwrapAsync)((0,GsI.classifiersModerateChat)(this,e,n))}async classify(e,n){return(0,$pe.unwrapAsync)((0,ssI.classifiersClassify)(this,e,n))}async classifyChat(e,n){return(0,$pe.unwrapAsync)((0,usI.classifiersClassifyChat)(this,e,n))}};ehe.Classifiers=qze});var Atn=f(bF=>{"use strict";var msI=bF&&bF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),psI=bF&&bF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$ze=bF&&bF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&msI(e,t,n);return psI(e,t),e};Object.defineProperty(bF,"__esModule",{value:!0});bF.embeddingsCreate=gsI;var hsI=kt(),hP=$ze(Qt()),ZsI=be(),WsI=oe(),Rtn=Et(),NsI=wt(),ytn=$ze(bt()),VsI=$ze(Tn()),YsI=Jt();function gsI(t,e,n){return new YsI.APIPromise(RsI(t,e,n))}async function RsI(t,e,n){let l=(0,WsI.safeParse)(e,y=>ytn.EmbeddingRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,hsI.encodeJSON)("body",I,{explode:!0}),c=(0,NsI.pathToFunc)("/v1/embeddings")(),i=new Headers((0,ZsI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,Rtn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,Rtn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"embeddings_v1_embeddings_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await hP.match(hP.json(200,ytn.EmbeddingResponse$inboundSchema),hP.jsonErr(422,VsI.HTTPValidationError$inboundSchema),hP.fail("4XX"),hP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Ftn=f(the=>{"use strict";Object.defineProperty(the,"__esModule",{value:!0});the.Embeddings=void 0;var ysI=Atn(),AsI=di(),FsI=Hd(),eBe=class extends AsI.ClientSDK{async create(e,n){return(0,FsI.unwrapAsync)((0,ysI.embeddingsCreate)(this,e,n))}};the.Embeddings=eBe});var ftn=f(mF=>{"use strict";var vsI=mF&&mF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),fsI=mF&&mF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tBe=mF&&mF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&vsI(e,t,n);return fsI(e,t),e};Object.defineProperty(mF,"__esModule",{value:!0});mF.filesDelete=LsI;var XsI=kt(),nhe=tBe(Qt()),wsI=be(),HsI=oe(),vtn=Et(),QsI=wt(),EsI=tBe(bt()),JsI=tBe(Dn()),CsI=Jt();function LsI(t,e,n){return new CsI.APIPromise(ksI(t,e,n))}async function ksI(t,e,n){let l=(0,HsI.safeParse)(e,y=>JsI.FilesApiRoutesDeleteFileRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={file_id:(0,XsI.encodeSimple)("file_id",I.file_id,{explode:!1,charEncoding:"percent"})},i=(0,QsI.pathToFunc)("/v1/files/{file_id}")(c),s=new Headers((0,wsI.compactMap)({Accept:"application/json"})),r=await(0,vtn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,vtn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"files_api_routes_delete_file",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"DELETE",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await nhe.match(nhe.json(200,EsI.DeleteFileOut$inboundSchema),nhe.fail("4XX"),nhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var wtn=f(pF=>{"use strict";var xsI=pF&&pF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jsI=pF&&pF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nBe=pF&&pF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xsI(e,t,n);return jsI(e,t),e};Object.defineProperty(pF,"__esModule",{value:!0});pF.filesDownload=DsI;var OsI=nBe(se()),UsI=kt(),lhe=nBe(Qt()),zsI=be(),BsI=oe(),Xtn=Et(),SsI=wt(),MsI=nBe(Dn()),TsI=Jt();function DsI(t,e,n){return new TsI.APIPromise(KsI(t,e,n))}async function KsI(t,e,n){let l=(0,BsI.safeParse)(e,y=>MsI.FilesApiRoutesDownloadFileRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={file_id:(0,UsI.encodeSimple)("file_id",I.file_id,{explode:!1,charEncoding:"percent"})},i=(0,SsI.pathToFunc)("/v1/files/{file_id}/content")(c),s=new Headers((0,zsI.compactMap)({Accept:"application/octet-stream"})),r=await(0,Xtn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Xtn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"files_api_routes_download_file",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await lhe.match(lhe.stream(200,OsI.instanceof(ReadableStream)),lhe.fail("4XX"),lhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var Etn=f(hF=>{"use strict";var _sI=hF&&hF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),PsI=hF&&hF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lBe=hF&&hF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&_sI(e,t,n);return PsI(e,t),e};Object.defineProperty(hF,"__esModule",{value:!0});hF.filesGetSignedUrl=IuI;var Htn=kt(),Ihe=lBe(Qt()),qsI=be(),$sI=oe(),Qtn=Et(),euI=wt(),tuI=lBe(bt()),nuI=lBe(Dn()),luI=Jt();function IuI(t,e,n){return new luI.APIPromise(auI(t,e,n))}async function auI(t,e,n){let l=(0,$sI.safeParse)(e,X=>nuI.FilesApiRoutesGetSignedUrlRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={file_id:(0,Htn.encodeSimple)("file_id",I.file_id,{explode:!1,charEncoding:"percent"})},i=(0,euI.pathToFunc)("/v1/files/{file_id}/url")(c),s=(0,Htn.encodeFormQuery)({expiry:I.expiry}),r=new Headers((0,qsI.compactMap)({Accept:"application/json"})),u=await(0,Qtn.extractSecurity)(t._options.apiKey),o=u==null?{}:{apiKey:u},d=(0,Qtn.resolveGlobalSecurity)(o),b={baseURL:n?.serverURL??t._baseURL??"",operationID:"files_api_routes_get_signed_url",oAuth2Scopes:[],resolvedSecurity:d,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},h=t._createRequest(b,{security:d,method:"GET",baseURL:n?.serverURL,path:i,headers:r,query:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!h.ok)return[h,{status:"invalid"}];let Z=h.value,N=await t._do(Z,{context:b,errorCodes:["4XX","5XX"],retryConfig:b.retryConfig,retryCodes:b.retryCodes});if(!N.ok)return[N,{status:"request-error",request:Z}];let g=N.value,[y]=await Ihe.match(Ihe.json(200,tuI.FileSignedURL$inboundSchema),Ihe.fail("4XX"),Ihe.fail("5XX"))(g);return y.ok?[y,{status:"complete",request:Z,response:g}]:[y,{status:"complete",request:Z,response:g}]}});var Ctn=f(ZF=>{"use strict";var ruI=ZF&&ZF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),cuI=ZF&&ZF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IBe=ZF&&ZF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ruI(e,t,n);return cuI(e,t),e};Object.defineProperty(ZF,"__esModule",{value:!0});ZF.filesList=muI;var ouI=kt(),ahe=IBe(Qt()),iuI=be(),suI=oe(),Jtn=Et(),uuI=wt(),duI=IBe(bt()),GuI=IBe(Dn()),buI=Jt();function muI(t,e,n){return new buI.APIPromise(puI(t,e,n))}async function puI(t,e,n){let l=(0,suI.safeParse)(e,y=>GuI.FilesApiRoutesListFilesRequest$outboundSchema.optional().parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c=(0,uuI.pathToFunc)("/v1/files")(),i=(0,ouI.encodeFormQuery)({page:I?.page,page_size:I?.page_size,purpose:I?.purpose,sample_type:I?.sample_type,search:I?.search,source:I?.source}),s=new Headers((0,iuI.compactMap)({Accept:"application/json"})),r=await(0,Jtn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Jtn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"files_api_routes_list_files",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:c,headers:s,query:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await ahe.match(ahe.json(200,duI.ListFilesOut$inboundSchema),ahe.fail("4XX"),ahe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var ktn=f(WF=>{"use strict";var huI=WF&&WF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ZuI=WF&&WF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aBe=WF&&WF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&huI(e,t,n);return ZuI(e,t),e};Object.defineProperty(WF,"__esModule",{value:!0});WF.filesRetrieve=AuI;var WuI=kt(),rhe=aBe(Qt()),NuI=be(),VuI=oe(),Ltn=Et(),YuI=wt(),guI=aBe(bt()),RuI=aBe(Dn()),yuI=Jt();function AuI(t,e,n){return new yuI.APIPromise(FuI(t,e,n))}async function FuI(t,e,n){let l=(0,VuI.safeParse)(e,y=>RuI.FilesApiRoutesRetrieveFileRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={file_id:(0,WuI.encodeSimple)("file_id",I.file_id,{explode:!1,charEncoding:"percent"})},i=(0,YuI.pathToFunc)("/v1/files/{file_id}")(c),s=new Headers((0,NuI.compactMap)({Accept:"application/json"})),r=await(0,Ltn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Ltn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"files_api_routes_retrieve_file",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await rhe.match(rhe.json(200,guI.RetrieveFileOut$inboundSchema),rhe.fail("4XX"),rhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var jtn=f(NF=>{"use strict";var vuI=NF&&NF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),fuI=NF&&NF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rBe=NF&&NF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&vuI(e,t,n);return fuI(e,t),e};Object.defineProperty(NF,"__esModule",{value:!0});NF.filesUpload=xuI;var che=kt(),XuI=xue(),ohe=rBe(Qt()),wuI=be(),HuI=oe(),xtn=Et(),QuI=wt(),EuI=rBe(bt()),JuI=rBe(Dn()),CuI=Jt(),LuI=y_(),kuI=oze();function xuI(t,e,n){return new CuI.APIPromise(juI(t,e,n))}async function juI(t,e,n){let l=(0,HuI.safeParse)(e,g=>JuI.FilesApiRoutesUploadFileMultiPartBodyParams$outboundSchema.parse(g),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=new FormData;if((0,LuI.isBlobLike)(I.file))(0,che.appendForm)(a,"file",I.file);else if((0,kuI.isReadableStream)(I.file.content)){let g=await(0,XuI.readableStreamToArrayBuffer)(I.file.content),y=new Blob([g],{type:"application/octet-stream"});(0,che.appendForm)(a,"file",y)}else(0,che.appendForm)(a,"file",new Blob([I.file.content],{type:"application/octet-stream"}),I.file.fileName);I.purpose!==void 0&&(0,che.appendForm)(a,"purpose",I.purpose);let c=(0,QuI.pathToFunc)("/v1/files")(),i=new Headers((0,wuI.compactMap)({Accept:"application/json"})),s=await(0,xtn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,xtn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"files_api_routes_upload_file",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,[N]=await ohe.match(ohe.json(200,EuI.UploadFileOut$inboundSchema),ohe.fail("4XX"),ohe.fail("5XX"))(Z);return N.ok?[N,{status:"complete",request:b,response:Z}]:[N,{status:"complete",request:b,response:Z}]}});var Otn=f(ihe=>{"use strict";Object.defineProperty(ihe,"__esModule",{value:!0});ihe.Files=void 0;var OuI=ftn(),UuI=wtn(),zuI=Etn(),BuI=Ctn(),SuI=ktn(),MuI=jtn(),TuI=di(),VO=Hd(),cBe=class extends TuI.ClientSDK{async upload(e,n){return(0,VO.unwrapAsync)((0,MuI.filesUpload)(this,e,n))}async list(e,n){return(0,VO.unwrapAsync)((0,BuI.filesList)(this,e,n))}async retrieve(e,n){return(0,VO.unwrapAsync)((0,SuI.filesRetrieve)(this,e,n))}async delete(e,n){return(0,VO.unwrapAsync)((0,OuI.filesDelete)(this,e,n))}async download(e,n){return(0,VO.unwrapAsync)((0,UuI.filesDownload)(this,e,n))}async getSignedUrl(e,n){return(0,VO.unwrapAsync)((0,zuI.filesGetSignedUrl)(this,e,n))}};ihe.Files=cBe});var Btn=f(VF=>{"use strict";var DuI=VF&&VF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KuI=VF&&VF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),oBe=VF&&VF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DuI(e,t,n);return KuI(e,t),e};Object.defineProperty(VF,"__esModule",{value:!0});VF.fimComplete=ndI;var _uI=kt(),ZP=oBe(Qt()),PuI=be(),quI=oe(),Utn=Et(),$uI=wt(),ztn=oBe(bt()),edI=oBe(Tn()),tdI=Jt();function ndI(t,e,n){return new tdI.APIPromise(ldI(t,e,n))}async function ldI(t,e,n){let l=(0,quI.safeParse)(e,y=>ztn.FIMCompletionRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,_uI.encodeJSON)("body",I,{explode:!0}),c=(0,$uI.pathToFunc)("/v1/fim/completions")(),i=new Headers((0,PuI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,Utn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,Utn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"fim_completion_v1_fim_completions_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await ZP.match(ZP.json(200,ztn.FIMCompletionResponse$inboundSchema),ZP.jsonErr(422,edI.HTTPValidationError$inboundSchema),ZP.fail("4XX"),ZP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Ttn=f(YF=>{"use strict";var IdI=YF&&YF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),adI=YF&&YF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),she=YF&&YF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&IdI(e,t,n);return adI(e,t),e};Object.defineProperty(YF,"__esModule",{value:!0});YF.fimStream=bdI;var rdI=she(se()),cdI=kt(),odI=BX(),WP=she(Qt()),idI=be(),sdI=oe(),Stn=Et(),udI=wt(),Mtn=she(bt()),ddI=she(Tn()),GdI=Jt();function bdI(t,e,n){return new GdI.APIPromise(mdI(t,e,n))}async function mdI(t,e,n){let l=(0,sdI.safeParse)(e,y=>Mtn.FIMCompletionStreamRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,cdI.encodeJSON)("body",I,{explode:!0}),c=(0,udI.pathToFunc)("/v1/fim/completions#stream")(),i=new Headers((0,idI.compactMap)({"Content-Type":"application/json",Accept:"text/event-stream"})),s=await(0,Stn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,Stn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"stream_fim",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await WP.match(WP.sse(200,rdI.instanceof(ReadableStream).transform(y=>new odI.EventStream({stream:y,decoder(X){return Mtn.CompletionEvent$inboundSchema.parse(X)}})),{sseSentinel:"[DONE]"}),WP.jsonErr(422,ddI.HTTPValidationError$inboundSchema),WP.fail("4XX"),WP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Ktn=f(uhe=>{"use strict";Object.defineProperty(uhe,"__esModule",{value:!0});uhe.Fim=void 0;var pdI=Btn(),hdI=Ttn(),ZdI=di(),Dtn=Hd(),iBe=class extends ZdI.ClientSDK{async complete(e,n){return(0,Dtn.unwrapAsync)((0,pdI.fimComplete)(this,e,n))}async stream(e,n){return(0,Dtn.unwrapAsync)((0,hdI.fimStream)(this,e,n))}};uhe.Fim=iBe});var $tn=f(gF=>{"use strict";var WdI=gF&&gF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),NdI=gF&&gF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qtn=gF&&gF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&WdI(e,t,n);return NdI(e,t),e};Object.defineProperty(gF,"__esModule",{value:!0});gF.fineTuningJobsCancel=AdI;var VdI=kt(),dhe=qtn(Qt()),YdI=be(),gdI=oe(),_tn=Et(),RdI=wt(),Ptn=qtn(Dn()),ydI=Jt();function AdI(t,e,n){return new ydI.APIPromise(FdI(t,e,n))}async function FdI(t,e,n){let l=(0,gdI.safeParse)(e,y=>Ptn.JobsApiRoutesFineTuningCancelFineTuningJobRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={job_id:(0,VdI.encodeSimple)("job_id",I.job_id,{explode:!1,charEncoding:"percent"})},i=(0,RdI.pathToFunc)("/v1/fine_tuning/jobs/{job_id}/cancel")(c),s=new Headers((0,YdI.compactMap)({Accept:"application/json"})),r=await(0,_tn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,_tn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_cancel_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await dhe.match(dhe.json(200,Ptn.JobsApiRoutesFineTuningCancelFineTuningJobResponse$inboundSchema),dhe.fail("4XX"),dhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var tnn=f(RF=>{"use strict";var vdI=RF&&RF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),fdI=RF&&RF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sBe=RF&&RF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&vdI(e,t,n);return fdI(e,t),e};Object.defineProperty(RF,"__esModule",{value:!0});RF.fineTuningJobsCreate=LdI;var XdI=kt(),Ghe=sBe(Qt()),wdI=be(),HdI=oe(),enn=Et(),QdI=wt(),EdI=sBe(bt()),JdI=sBe(Dn()),CdI=Jt();function LdI(t,e,n){return new CdI.APIPromise(kdI(t,e,n))}async function kdI(t,e,n){let l=(0,HdI.safeParse)(e,g=>EdI.JobIn$outboundSchema.parse(g),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,XdI.encodeJSON)("body",I,{explode:!0}),c=(0,QdI.pathToFunc)("/v1/fine_tuning/jobs")(),i=new Headers((0,wdI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,enn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,enn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_create_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,[N]=await Ghe.match(Ghe.json(200,JdI.JobsApiRoutesFineTuningCreateFineTuningJobResponse$inboundSchema),Ghe.fail("4XX"),Ghe.fail("5XX"))(Z);return N.ok?[N,{status:"complete",request:b,response:Z}]:[N,{status:"complete",request:b,response:Z}]}});var ann=f(yF=>{"use strict";var xdI=yF&&yF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jdI=yF&&yF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Inn=yF&&yF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&xdI(e,t,n);return jdI(e,t),e};Object.defineProperty(yF,"__esModule",{value:!0});yF.fineTuningJobsGet=MdI;var OdI=kt(),bhe=Inn(Qt()),UdI=be(),zdI=oe(),nnn=Et(),BdI=wt(),lnn=Inn(Dn()),SdI=Jt();function MdI(t,e,n){return new SdI.APIPromise(TdI(t,e,n))}async function TdI(t,e,n){let l=(0,zdI.safeParse)(e,y=>lnn.JobsApiRoutesFineTuningGetFineTuningJobRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={job_id:(0,OdI.encodeSimple)("job_id",I.job_id,{explode:!1,charEncoding:"percent"})},i=(0,BdI.pathToFunc)("/v1/fine_tuning/jobs/{job_id}")(c),s=new Headers((0,UdI.compactMap)({Accept:"application/json"})),r=await(0,nnn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,nnn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_get_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await bhe.match(bhe.json(200,lnn.JobsApiRoutesFineTuningGetFineTuningJobResponse$inboundSchema),bhe.fail("4XX"),bhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var cnn=f(AF=>{"use strict";var DdI=AF&&AF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KdI=AF&&AF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uBe=AF&&AF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DdI(e,t,n);return KdI(e,t),e};Object.defineProperty(AF,"__esModule",{value:!0});AF.fineTuningJobsList=lGI;var _dI=kt(),mhe=uBe(Qt()),PdI=be(),qdI=oe(),rnn=Et(),$dI=wt(),eGI=uBe(bt()),tGI=uBe(Dn()),nGI=Jt();function lGI(t,e,n){return new nGI.APIPromise(IGI(t,e,n))}async function IGI(t,e,n){let l=(0,qdI.safeParse)(e,y=>tGI.JobsApiRoutesFineTuningGetFineTuningJobsRequest$outboundSchema.optional().parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c=(0,$dI.pathToFunc)("/v1/fine_tuning/jobs")(),i=(0,_dI.encodeFormQuery)({created_after:I?.created_after,created_before:I?.created_before,created_by_me:I?.created_by_me,model:I?.model,page:I?.page,page_size:I?.page_size,status:I?.status,suffix:I?.suffix,wandb_name:I?.wandb_name,wandb_project:I?.wandb_project}),s=new Headers((0,PdI.compactMap)({Accept:"application/json"})),r=await(0,rnn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,rnn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_get_fine_tuning_jobs",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:c,headers:s,query:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await mhe.match(mhe.json(200,eGI.JobsOut$inboundSchema),mhe.fail("4XX"),mhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var unn=f(FF=>{"use strict";var aGI=FF&&FF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),rGI=FF&&FF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),snn=FF&&FF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&aGI(e,t,n);return rGI(e,t),e};Object.defineProperty(FF,"__esModule",{value:!0});FF.fineTuningJobsStart=dGI;var cGI=kt(),phe=snn(Qt()),oGI=be(),iGI=oe(),onn=Et(),sGI=wt(),inn=snn(Dn()),uGI=Jt();function dGI(t,e,n){return new uGI.APIPromise(GGI(t,e,n))}async function GGI(t,e,n){let l=(0,iGI.safeParse)(e,y=>inn.JobsApiRoutesFineTuningStartFineTuningJobRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={job_id:(0,cGI.encodeSimple)("job_id",I.job_id,{explode:!1,charEncoding:"percent"})},i=(0,sGI.pathToFunc)("/v1/fine_tuning/jobs/{job_id}/start")(c),s=new Headers((0,oGI.compactMap)({Accept:"application/json"})),r=await(0,onn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,onn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_start_fine_tuning_job",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await phe.match(phe.json(200,inn.JobsApiRoutesFineTuningStartFineTuningJobResponse$inboundSchema),phe.fail("4XX"),phe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var dnn=f(hhe=>{"use strict";Object.defineProperty(hhe,"__esModule",{value:!0});hhe.Jobs=void 0;var bGI=$tn(),mGI=tnn(),pGI=ann(),hGI=cnn(),ZGI=unn(),WGI=di(),NP=Hd(),dBe=class extends WGI.ClientSDK{async list(e,n){return(0,NP.unwrapAsync)((0,hGI.fineTuningJobsList)(this,e,n))}async create(e,n){return(0,NP.unwrapAsync)((0,mGI.fineTuningJobsCreate)(this,e,n))}async get(e,n){return(0,NP.unwrapAsync)((0,pGI.fineTuningJobsGet)(this,e,n))}async cancel(e,n){return(0,NP.unwrapAsync)((0,bGI.fineTuningJobsCancel)(this,e,n))}async start(e,n){return(0,NP.unwrapAsync)((0,ZGI.fineTuningJobsStart)(this,e,n))}};hhe.Jobs=dBe});var Gnn=f(Zhe=>{"use strict";Object.defineProperty(Zhe,"__esModule",{value:!0});Zhe.FineTuning=void 0;var NGI=di(),VGI=dnn(),GBe=class extends NGI.ClientSDK{get jobs(){return this._jobs??(this._jobs=new VGI.Jobs(this._options))}};Zhe.FineTuning=GBe});var mnn=f(vF=>{"use strict";var YGI=vF&&vF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),gGI=vF&&vF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bBe=vF&&vF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&YGI(e,t,n);return gGI(e,t),e};Object.defineProperty(vF,"__esModule",{value:!0});vF.modelsArchive=wGI;var RGI=kt(),Whe=bBe(Qt()),yGI=be(),AGI=oe(),bnn=Et(),FGI=wt(),vGI=bBe(bt()),fGI=bBe(Dn()),XGI=Jt();function wGI(t,e,n){return new XGI.APIPromise(HGI(t,e,n))}async function HGI(t,e,n){let l=(0,AGI.safeParse)(e,y=>fGI.JobsApiRoutesFineTuningArchiveFineTunedModelRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={model_id:(0,RGI.encodeSimple)("model_id",I.model_id,{explode:!1,charEncoding:"percent"})},i=(0,FGI.pathToFunc)("/v1/fine_tuning/models/{model_id}/archive")(c),s=new Headers((0,yGI.compactMap)({Accept:"application/json"})),r=await(0,bnn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,bnn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_archive_fine_tuned_model",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"POST",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await Whe.match(Whe.json(200,vGI.ArchiveFTModelOut$inboundSchema),Whe.fail("4XX"),Whe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var hnn=f(fF=>{"use strict";var QGI=fF&&fF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),EGI=fF&&fF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Nhe=fF&&fF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&QGI(e,t,n);return EGI(e,t),e};Object.defineProperty(fF,"__esModule",{value:!0});fF.modelsDelete=zGI;var JGI=kt(),VP=Nhe(Qt()),CGI=be(),LGI=oe(),pnn=Et(),kGI=wt(),xGI=Nhe(bt()),jGI=Nhe(Tn()),OGI=Nhe(Dn()),UGI=Jt();function zGI(t,e,n){return new UGI.APIPromise(BGI(t,e,n))}async function BGI(t,e,n){let l=(0,LGI.safeParse)(e,X=>OGI.DeleteModelV1ModelsModelIdDeleteRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={model_id:(0,JGI.encodeSimple)("model_id",I.model_id,{explode:!1,charEncoding:"percent"})},i=(0,kGI.pathToFunc)("/v1/models/{model_id}")(c),s=new Headers((0,CGI.compactMap)({Accept:"application/json"})),r=await(0,pnn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,pnn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"delete_model_v1_models__model_id__delete",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"DELETE",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await VP.match(VP.json(200,xGI.DeleteModelOut$inboundSchema),VP.jsonErr(422,jGI.HTTPValidationError$inboundSchema),VP.fail("4XX"),VP.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var Wnn=f(XF=>{"use strict";var SGI=XF&&XF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),MGI=XF&&XF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mBe=XF&&XF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&SGI(e,t,n);return MGI(e,t),e};Object.defineProperty(XF,"__esModule",{value:!0});XF.modelsList=qGI;var YP=mBe(Qt()),TGI=be(),Znn=Et(),DGI=wt(),KGI=mBe(bt()),_GI=mBe(Tn()),PGI=Jt();function qGI(t,e){return new PGI.APIPromise($GI(t,e))}async function $GI(t,e){let n=(0,DGI.pathToFunc)("/v1/models")(),l=new Headers((0,TGI.compactMap)({Accept:"application/json"})),I=await(0,Znn.extractSecurity)(t._options.apiKey),a=I==null?{}:{apiKey:I},c=(0,Znn.resolveGlobalSecurity)(a),i={baseURL:e?.serverURL??t._baseURL??"",operationID:"list_models_v1_models_get",oAuth2Scopes:[],resolvedSecurity:c,securitySource:t._options.apiKey,retryConfig:e?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:e?.retryCodes||["429","500","502","503","504"]},s=t._createRequest(i,{security:c,method:"GET",baseURL:e?.serverURL,path:n,headers:l,timeoutMs:e?.timeoutMs||t._options.timeoutMs||-1},e);if(!s.ok)return[s,{status:"invalid"}];let r=s.value,u=await t._do(r,{context:i,errorCodes:["422","4XX","5XX"],retryConfig:i.retryConfig,retryCodes:i.retryCodes});if(!u.ok)return[u,{status:"request-error",request:r}];let o=u.value,d={HttpMeta:{Response:o,Request:r}},[b]=await YP.match(YP.json(200,KGI.ModelList$inboundSchema),YP.jsonErr(422,_GI.HTTPValidationError$inboundSchema),YP.fail("4XX"),YP.fail("5XX"))(o,{extraFields:d});return b.ok?[b,{status:"complete",request:r,response:o}]:[b,{status:"complete",request:r,response:o}]}});var Ynn=f(wF=>{"use strict";var ebI=wF&&wF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),tbI=wF&&wF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pBe=wF&&wF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ebI(e,t,n);return tbI(e,t),e};Object.defineProperty(wF,"__esModule",{value:!0});wF.modelsRetrieve=obI;var nbI=kt(),gP=pBe(Qt()),lbI=be(),IbI=oe(),Nnn=Et(),abI=wt(),rbI=pBe(Tn()),Vnn=pBe(Dn()),cbI=Jt();function obI(t,e,n){return new cbI.APIPromise(ibI(t,e,n))}async function ibI(t,e,n){let l=(0,IbI.safeParse)(e,X=>Vnn.RetrieveModelV1ModelsModelIdGetRequest$outboundSchema.parse(X),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={model_id:(0,nbI.encodeSimple)("model_id",I.model_id,{explode:!1,charEncoding:"percent"})},i=(0,abI.pathToFunc)("/v1/models/{model_id}")(c),s=new Headers((0,lbI.compactMap)({Accept:"application/json"})),r=await(0,Nnn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Nnn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"retrieve_model_v1_models__model_id__get",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"GET",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["422","4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,g={HttpMeta:{Response:N,Request:h}},[y]=await gP.match(gP.json(200,Vnn.RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet$inboundSchema),gP.jsonErr(422,rbI.HTTPValidationError$inboundSchema),gP.fail("4XX"),gP.fail("5XX"))(N,{extraFields:g});return y.ok?[y,{status:"complete",request:h,response:N}]:[y,{status:"complete",request:h,response:N}]}});var Rnn=f(HF=>{"use strict";var sbI=HF&&HF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),ubI=HF&&HF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),hBe=HF&&HF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&sbI(e,t,n);return ubI(e,t),e};Object.defineProperty(HF,"__esModule",{value:!0});HF.modelsUnarchive=WbI;var dbI=kt(),Vhe=hBe(Qt()),GbI=be(),bbI=oe(),gnn=Et(),mbI=wt(),pbI=hBe(bt()),hbI=hBe(Dn()),ZbI=Jt();function WbI(t,e,n){return new ZbI.APIPromise(NbI(t,e,n))}async function NbI(t,e,n){let l=(0,bbI.safeParse)(e,y=>hbI.JobsApiRoutesFineTuningUnarchiveFineTunedModelRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=null,c={model_id:(0,dbI.encodeSimple)("model_id",I.model_id,{explode:!1,charEncoding:"percent"})},i=(0,mbI.pathToFunc)("/v1/fine_tuning/models/{model_id}/archive")(c),s=new Headers((0,GbI.compactMap)({Accept:"application/json"})),r=await(0,gnn.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,gnn.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_unarchive_fine_tuned_model",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"DELETE",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await Vhe.match(Vhe.json(200,pbI.UnarchiveFTModelOut$inboundSchema),Vhe.fail("4XX"),Vhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var fnn=f(QF=>{"use strict";var VbI=QF&&QF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),YbI=QF&&QF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vnn=QF&&QF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&VbI(e,t,n);return YbI(e,t),e};Object.defineProperty(QF,"__esModule",{value:!0});QF.modelsUpdate=FbI;var ynn=kt(),Yhe=vnn(Qt()),gbI=be(),RbI=oe(),Ann=Et(),ybI=wt(),Fnn=vnn(Dn()),AbI=Jt();function FbI(t,e,n){return new AbI.APIPromise(vbI(t,e,n))}async function vbI(t,e,n){let l=(0,RbI.safeParse)(e,y=>Fnn.JobsApiRoutesFineTuningUpdateFineTunedModelRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,ynn.encodeJSON)("body",I.UpdateFTModelIn,{explode:!0}),c={model_id:(0,ynn.encodeSimple)("model_id",I.model_id,{explode:!1,charEncoding:"percent"})},i=(0,ybI.pathToFunc)("/v1/fine_tuning/models/{model_id}")(c),s=new Headers((0,gbI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),r=await(0,Ann.extractSecurity)(t._options.apiKey),u=r==null?{}:{apiKey:r},o=(0,Ann.resolveGlobalSecurity)(u),d={baseURL:n?.serverURL??t._baseURL??"",operationID:"jobs_api_routes_fine_tuning_update_fine_tuned_model",oAuth2Scopes:[],resolvedSecurity:o,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},b=t._createRequest(d,{security:o,method:"PATCH",baseURL:n?.serverURL,path:i,headers:s,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!b.ok)return[b,{status:"invalid"}];let h=b.value,Z=await t._do(h,{context:d,errorCodes:["4XX","5XX"],retryConfig:d.retryConfig,retryCodes:d.retryCodes});if(!Z.ok)return[Z,{status:"request-error",request:h}];let N=Z.value,[g]=await Yhe.match(Yhe.json(200,Fnn.JobsApiRoutesFineTuningUpdateFineTunedModelResponse$inboundSchema),Yhe.fail("4XX"),Yhe.fail("5XX"))(N);return g.ok?[g,{status:"complete",request:h,response:N}]:[g,{status:"complete",request:h,response:N}]}});var Xnn=f(ghe=>{"use strict";Object.defineProperty(ghe,"__esModule",{value:!0});ghe.Models=void 0;var fbI=mnn(),XbI=hnn(),wbI=Wnn(),HbI=Ynn(),QbI=Rnn(),EbI=fnn(),JbI=di(),YO=Hd(),ZBe=class extends JbI.ClientSDK{async list(e){return(0,YO.unwrapAsync)((0,wbI.modelsList)(this,e))}async retrieve(e,n){return(0,YO.unwrapAsync)((0,HbI.modelsRetrieve)(this,e,n))}async delete(e,n){return(0,YO.unwrapAsync)((0,XbI.modelsDelete)(this,e,n))}async update(e,n){return(0,YO.unwrapAsync)((0,EbI.modelsUpdate)(this,e,n))}async archive(e,n){return(0,YO.unwrapAsync)((0,fbI.modelsArchive)(this,e,n))}async unarchive(e,n){return(0,YO.unwrapAsync)((0,QbI.modelsUnarchive)(this,e,n))}};ghe.Models=ZBe});var Qnn=f(EF=>{"use strict";var CbI=EF&&EF.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),LbI=EF&&EF.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WBe=EF&&EF.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&CbI(e,t,n);return LbI(e,t),e};Object.defineProperty(EF,"__esModule",{value:!0});EF.ocrProcess=BbI;var kbI=kt(),RP=WBe(Qt()),xbI=be(),jbI=oe(),wnn=Et(),ObI=wt(),Hnn=WBe(bt()),UbI=WBe(Tn()),zbI=Jt();function BbI(t,e,n){return new zbI.APIPromise(SbI(t,e,n))}async function SbI(t,e,n){let l=(0,jbI.safeParse)(e,y=>Hnn.OCRRequest$outboundSchema.parse(y),"Input validation failed");if(!l.ok)return[l,{status:"invalid"}];let I=l.value,a=(0,kbI.encodeJSON)("body",I,{explode:!0}),c=(0,ObI.pathToFunc)("/v1/ocr")(),i=new Headers((0,xbI.compactMap)({"Content-Type":"application/json",Accept:"application/json"})),s=await(0,wnn.extractSecurity)(t._options.apiKey),r=s==null?{}:{apiKey:s},u=(0,wnn.resolveGlobalSecurity)(r),o={baseURL:n?.serverURL??t._baseURL??"",operationID:"ocr_v1_ocr_post",oAuth2Scopes:[],resolvedSecurity:u,securitySource:t._options.apiKey,retryConfig:n?.retries||t._options.retryConfig||{strategy:"none"},retryCodes:n?.retryCodes||["429","500","502","503","504"]},d=t._createRequest(o,{security:u,method:"POST",baseURL:n?.serverURL,path:c,headers:i,body:a,timeoutMs:n?.timeoutMs||t._options.timeoutMs||-1},n);if(!d.ok)return[d,{status:"invalid"}];let b=d.value,h=await t._do(b,{context:o,errorCodes:["422","4XX","5XX"],retryConfig:o.retryConfig,retryCodes:o.retryCodes});if(!h.ok)return[h,{status:"request-error",request:b}];let Z=h.value,N={HttpMeta:{Response:Z,Request:b}},[g]=await RP.match(RP.json(200,Hnn.OCRResponse$inboundSchema),RP.jsonErr(422,UbI.HTTPValidationError$inboundSchema),RP.fail("4XX"),RP.fail("5XX"))(Z,{extraFields:N});return g.ok?[g,{status:"complete",request:b,response:Z}]:[g,{status:"complete",request:b,response:Z}]}});var Enn=f(Rhe=>{"use strict";Object.defineProperty(Rhe,"__esModule",{value:!0});Rhe.Ocr=void 0;var MbI=Qnn(),TbI=di(),DbI=Hd(),NBe=class extends TbI.ClientSDK{async process(e,n){return(0,DbI.unwrapAsync)((0,MbI.ocrProcess)(this,e,n))}};Rhe.Ocr=NBe});var Jnn=f(yhe=>{"use strict";Object.defineProperty(yhe,"__esModule",{value:!0});yhe.Mistral=void 0;var KbI=di(),_bI=t6t(),PbI=z8t(),qbI=wen(),$bI=stn(),emI=gtn(),tmI=Ftn(),nmI=Otn(),lmI=Ktn(),ImI=Gnn(),amI=Xnn(),rmI=Enn(),VBe=class extends KbI.ClientSDK{get models(){return this._models??(this._models=new amI.Models(this._options))}get beta(){return this._beta??(this._beta=new qbI.Beta(this._options))}get files(){return this._files??(this._files=new nmI.Files(this._options))}get fineTuning(){return this._fineTuning??(this._fineTuning=new ImI.FineTuning(this._options))}get batch(){return this._batch??(this._batch=new PbI.Batch(this._options))}get chat(){return this._chat??(this._chat=new $bI.Chat(this._options))}get fim(){return this._fim??(this._fim=new lmI.Fim(this._options))}get agents(){return this._agents??(this._agents=new _bI.Agents(this._options))}get embeddings(){return this._embeddings??(this._embeddings=new tmI.Embeddings(this._options))}get classifiers(){return this._classifiers??(this._classifiers=new emI.Classifiers(this._options))}get ocr(){return this._ocr??(this._ocr=new rmI.Ocr(this._options))}};yhe.Mistral=VBe});var Ahe=f(zp=>{"use strict";var Cnn=zp&&zp.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),cmI=zp&&zp.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Lnn=zp&&zp.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Cnn(e,t,n)},omI=zp&&zp.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Cnn(e,t,n);return cmI(e,t),e};Object.defineProperty(zp,"__esModule",{value:!0});zp.files=void 0;Lnn(kue(),zp);zp.files=omI(xue());Lnn(Jnn(),zp)});function smI(t){return imI.test(t)}function umI(t){let e=t,n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";if(e===0)return n[0];let l=[],I=n.length;for(;e;)l.push(n[e%I]),e=Math.floor(e/I);return l.reverse().join("")}function dmI(t){let e=0;for(let n=0;n=9?n.slice(0,9):n.padStart(9,"0")}}function gBe(t){return t?typeof t=="string"?t:t.map(e=>{if(e.type==="image_url"){if(typeof e.imageUrl!="string"&&e.imageUrl?.detail){let{detail:n}=e.imageUrl;if(n!=="high"&&n!=="auto"&&n!=="low")return{type:e.type,image_url:{url:e.imageUrl.url}}}return{type:e.type,image_url:e.imageUrl}}return e}):""}var imI,knn=B(()=>{imI=/^[a-zA-Z0-9]{9}$/});function xnn(t){let e=I=>{switch(I){case"human":return"user";case"ai":return"assistant";case"system":return"system";case"tool":return"tool";case"function":return"assistant";default:throw new Error(`Unknown message type: ${I}`)}},n=(I,a)=>{let c=(i,s)=>{if(i.type==="image_url"&&(s==="user"||s==="assistant"))return{type:i.type,imageUrl:i?.image_url};if(i.type==="text")return{type:i.type,text:i?.text};throw new Error(`ChatMistralAI only supports messages of "image_url" for roles "user" and "assistant", and "text" for all others. + +Received: ${JSON.stringify(I,null,2)}`)};if(typeof I=="string")return I;if(Array.isArray(I)){let i=e(a),s=[];return I.forEach(r=>{if(r.type==="text"||r.type==="image_url")s.push(c(r,i));else throw new Error('Mistral only supports types "text" or "image_url" for complex message types.')}),s}throw new Error(`Message content must be a string or an array. + +Received: ${JSON.stringify(I,null,2)}`)},l=I=>{if(qG(I)&&I.tool_calls?.length)return I.tool_calls.map(a=>({...a,id:YBe(a.id??"")})).map(kne)};return t.map(I=>{let a=l(I),c=n(I.content,I.getType());return"tool_call_id"in I&&typeof I.tool_call_id=="string"?{role:e(I.getType()),content:c,name:I.name,toolCallId:YBe(I.tool_call_id)}:qG(I)?a===void 0?{role:e(I.getType()),content:c}:{role:e(I.getType()),toolCalls:a}:{role:e(I.getType()),content:c}})}function GmI(t,e){let{message:n}=t;if(n===void 0)throw new Error("No message found in response");let l=[];"toolCalls"in n&&Array.isArray(n.toolCalls)&&(l=n.toolCalls);let I=gBe(n.content);switch(n.role){case"assistant":{let a=[],c=[];for(let i of l)try{let s=uS(i,{returnId:!0});a.push({...s,id:s.id??$n().replace(/-/g,"")})}catch(s){c.push(xne(i,s.message))}return new _t({content:I,tool_calls:a,invalid_tool_calls:c,additional_kwargs:{},usage_metadata:e?{input_tokens:e.promptTokens,output_tokens:e.completionTokens,total_tokens:e.totalTokens}:void 0})}default:return new Qn({content:I})}}function bmI(t,e){if(!t.content&&!t.toolCalls)return e?new Jl({content:"",usage_metadata:e?{input_tokens:e.promptTokens,output_tokens:e.completionTokens,total_tokens:e.totalTokens}:void 0}):null;let n=t.toolCalls?.length?t.toolCalls?.map((i,s)=>({...i,index:s,id:i.id??$n().replace(/-/g,""),type:"function"})):void 0,l="assistant";t.role&&(l=t.role);let I=gBe(t.content),a,c=[];if(n!==void 0)for(let i of n){let s=i.function?.arguments,r=s===void 0||typeof s=="string"?s:JSON.stringify(s);c.push({name:i.function?.name,args:r,id:i.id,index:i.index,type:"tool_call_chunk"})}else a={};return l==="user"?new oG({content:I}):l==="assistant"?new Jl({content:I,tool_call_chunks:c,additional_kwargs:a,usage_metadata:e?{input_tokens:e.promptTokens,output_tokens:e.completionTokens,total_tokens:e.totalTokens}:void 0}):l==="tool"?new PG({content:I,additional_kwargs:a,tool_call_id:n?.[0].id??""}):l==="function"?new cG({content:I,additional_kwargs:a}):new aG({content:I,role:l})}function jnn(t){if(!(!t||!t.length))return t.map(e=>{if("function"in e)return{type:e.type??"function",function:e.function};if(cb(e)){let n=e.description??`Tool: ${e.name}`;return{type:"function",function:{name:e.name,description:n,parameters:wr(e.schema)?Wl(e.schema):e.schema}}}throw new Error(`Unknown tool type passed to ChatMistral: ${JSON.stringify(e,null,2)}`)})}var Onn,Unn,RBe,znn=B(()=>{uG();Onn=$(Ahe(),1),Unn=$(_1(),1);Vr();Xk();gh();VS();Xh();Ul();bwe();Bo();tp();_N();ep();knn();RBe=class extends Vd{static lc_name(){return"ChatMistralAI"}constructor(e){super(e??{}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","chat_models","mistralai"]}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"mistral-small-latest"}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serverURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:.7}),Object.defineProperty(this,"streaming",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"safeMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"safePrompt",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"randomSeed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"seed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"streamUsage",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"beforeRequestHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestErrorHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responseHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"presencePenalty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"frequencyPenalty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numCompletions",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let n=e?.apiKey??yt("MISTRAL_API_KEY");if(!n)throw new Error("API key MISTRAL_API_KEY is missing for MistralAI, but it is required.");this.apiKey=n,this.streaming=e?.streaming??this.streaming,this.serverURL=e?.serverURL??this.serverURL,this.temperature=e?.temperature??this.temperature,this.topP=e?.topP??this.topP,this.maxTokens=e?.maxTokens??this.maxTokens,this.safePrompt=e?.safePrompt??this.safePrompt,this.randomSeed=e?.seed??e?.randomSeed??this.seed,this.seed=this.randomSeed,this.maxRetries=e?.maxRetries,this.httpClient=e?.httpClient,this.model=e?.model??e?.modelName??this.model,this.streamUsage=e?.streamUsage??this.streamUsage,this.beforeRequestHooks=e?.beforeRequestHooks??this.beforeRequestHooks,this.requestErrorHooks=e?.requestErrorHooks??this.requestErrorHooks,this.responseHooks=e?.responseHooks??this.responseHooks,this.presencePenalty=e?.presencePenalty??this.presencePenalty,this.frequencyPenalty=e?.frequencyPenalty??this.frequencyPenalty,this.numCompletions=e?.numCompletions??this.numCompletions,this.addAllHooksToHttpClient()}get lc_secrets(){return{apiKey:"MISTRAL_API_KEY"}}get lc_aliases(){return{apiKey:"mistral_api_key"}}getLsParams(e){let n=this.invocationParams(e);return{ls_provider:"mistral",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:n.temperature??void 0,ls_max_tokens:n.maxTokens??void 0}}_llmType(){return"mistral_ai"}invocationParams(e){let{response_format:n,tools:l,tool_choice:I}=e??{},a=l?.length?jnn(l):void 0;return{model:this.model,tools:a,temperature:this.temperature,maxTokens:this.maxTokens,topP:this.topP,randomSeed:this.seed,safePrompt:this.safePrompt,toolChoice:I,responseFormat:n,presencePenalty:this.presencePenalty,frequencyPenalty:this.frequencyPenalty,n:this.numCompletions}}bindTools(e,n){let l=jnn(e);return new dG({bound:this,kwargs:{...n??{},tools:l},config:{}})}async completionWithRetry(e,n){let l=new _u({maxRetries:this.maxRetries}),I=new Onn.Mistral({apiKey:this.apiKey,serverURL:this.serverURL,...this.httpClient?{httpClient:this.httpClient}:{}});return l.call(async()=>{try{let a;return n?a=await I.chat.stream(e):a=await I.chat.complete(e),a}catch(a){throw(a.message?.includes("status: 400")||a.message?.toLowerCase().includes("status 400")||a.message?.includes("validation failed"))&&(a.status=400),a}})}async _generate(e,n,l){let I={},a=this.invocationParams(n),c=xnn(e),i={...a,messages:c},s=n.signal??!!n.timeout;if(this.streaming||s){let h=this._streamResponseChunks(e,n,l),Z={};for await(let g of h){let y=g.generationInfo?.completion??0;Z[y]===void 0?Z[y]=g:Z[y]=Z[y].concat(g)}return{generations:Object.entries(Z).sort(([g],[y])=>parseInt(g,10)-parseInt(y,10)).map(([g,y])=>y),llmOutput:{estimatedTokenUsage:I}}}let r=await this.completionWithRetry(i,!1),{completionTokens:u,promptTokens:o,totalTokens:d}=r?.usage??{};u&&(I.completionTokens=(I.completionTokens??0)+u),o&&(I.promptTokens=(I.promptTokens??0)+o),d&&(I.totalTokens=(I.totalTokens??0)+d);let b=[];for(let h of r?.choices??[]){if("delta"in h)throw new Error("Delta not supported in non-streaming mode.");if(!("message"in h))throw new Error("No message found in the choice.");let Z=h.message?.content??"";Array.isArray(Z)&&(Z=Z[0].type==="text"?Z[0].text:"");let N={text:Z,message:GmI(h,r?.usage)};h.finishReason&&(N.generationInfo={finishReason:h.finishReason}),b.push(N)}return{generations:b,llmOutput:{tokenUsage:I}}}async*_streamResponseChunks(e,n,l){let I=xnn(e),c={...this.invocationParams(n),messages:I},i=await this.completionWithRetry(c,!0);for await(let{data:s}of i){if(n.signal?.aborted)throw new Error("AbortError");let r=s?.choices[0];if(!r||!("delta"in r))continue;let{delta:u}=r;if(!u)continue;let o={prompt:0,completion:r.index??0},d=this.streamUsage||n.streamUsage,b=bmI(u,d?s.usage:null);if(b===null)continue;let h=u.content??"";Array.isArray(h)&&(h=h[0].type==="text"?h[0].text:"");let Z=new Io({message:b,text:h,generationInfo:o});yield Z,l?.handleLLMNewToken(Z.text??"",o,void 0,void 0,void 0,{chunk:Z})}}addAllHooksToHttpClient(){try{if(this.removeAllHooksFromHttpClient(),[this.beforeRequestHooks,this.requestErrorHooks,this.responseHooks].some(n=>n&&n.length>0)&&!this.httpClient&&(this.httpClient=new Unn.HTTPClient),this.beforeRequestHooks)for(let n of this.beforeRequestHooks)this.httpClient?.addHook("beforeRequest",n);if(this.requestErrorHooks)for(let n of this.requestErrorHooks)this.httpClient?.addHook("requestError",n);if(this.responseHooks)for(let n of this.responseHooks)this.httpClient?.addHook("response",n)}catch{throw new Error("Error in adding all hooks")}}removeAllHooksFromHttpClient(){try{if(this.beforeRequestHooks)for(let e of this.beforeRequestHooks)this.httpClient?.removeHook("beforeRequest",e);if(this.requestErrorHooks)for(let e of this.requestErrorHooks)this.httpClient?.removeHook("requestError",e);if(this.responseHooks)for(let e of this.responseHooks)this.httpClient?.removeHook("response",e)}catch{throw new Error("Error in removing hooks")}}removeHookFromHttpClient(e){try{this.httpClient?.removeHook("beforeRequest",e),this.httpClient?.removeHook("requestError",e),this.httpClient?.removeHook("response",e)}catch{throw new Error("Error in removing hook")}}_combineLLMOutput(){return[]}withStructuredOutput(e,n){let l=e,I=n?.name,a=n?.method,c=n?.includeRaw,i,s;if(a==="jsonMode")i=this.withConfig({response_format:{type:"json_object"}}),wr(l)?s=Py.fromZodSchema(l):s=new ng;else{let d=I??"extract";if(wr(l)){let b=Wl(l);i=this.bindTools([{type:"function",function:{name:d,description:b.description,parameters:b}}]).withConfig({tool_choice:"any"}),s=new Xv({returnSingle:!0,keyName:d,zodSchema:l})}else{let b;typeof l.name=="string"&&typeof l.parameters=="object"&&l.parameters!=null?(b=l,d=l.name):b={name:d,description:l.description??"",parameters:l},i=this.bindTools([{type:"function",function:b}]).withConfig({tool_choice:"any"}),s=new Xv({returnSingle:!0,keyName:d})}}if(!c)return i.pipe(s);let r=Tl.assign({parsed:(d,b)=>s.invoke(d.raw,b)}),u=Tl.assign({parsed:()=>null}),o=r.withFallbacks({fallbacks:[u]});return Hr.from([{raw:i},o])}}});var Bnn,yBe,Snn=B(()=>{Xh();WS();wk();Bnn=$(_1(),1),yBe=class extends Pm{constructor(e){super(e??{}),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"mistral-embed"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"mistral-embed"}),Object.defineProperty(this,"encodingFormat",{enumerable:!0,configurable:!0,writable:!0,value:"float"}),Object.defineProperty(this,"batchSize",{enumerable:!0,configurable:!0,writable:!0,value:512}),Object.defineProperty(this,"stripNewLines",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serverURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"beforeRequestHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestErrorHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responseHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let n=e?.apiKey??yt("MISTRAL_API_KEY");if(!n)throw new Error("API key missing for MistralAI, but it is required.");this.apiKey=n,this.serverURL=e?.serverURL??this.serverURL,this.modelName=e?.model??e?.modelName??this.model,this.model=this.modelName,this.encodingFormat=e?.encodingFormat??this.encodingFormat,this.batchSize=e?.batchSize??this.batchSize,this.stripNewLines=e?.stripNewLines??this.stripNewLines,this.beforeRequestHooks=e?.beforeRequestHooks??this.beforeRequestHooks,this.requestErrorHooks=e?.requestErrorHooks??this.requestErrorHooks,this.responseHooks=e?.responseHooks??this.responseHooks,this.httpClient=e?.httpClient??this.httpClient,this.addAllHooksToHttpClient()}async embedDocuments(e){let n=BZ(this.stripNewLines?e.map(c=>c.replace(/\n/g," ")):e,this.batchSize),l=n.map(c=>this.embeddingWithRetry(c)),I=await Promise.all(l),a=[];for(let c=0;cawait l.embeddings.create(I))}addAllHooksToHttpClient(){try{if(this.removeAllHooksFromHttpClient(),[this.beforeRequestHooks,this.requestErrorHooks,this.responseHooks].some(n=>n&&n.length>0)&&!this.httpClient&&(this.httpClient=new Bnn.HTTPClient),this.beforeRequestHooks)for(let n of this.beforeRequestHooks)this.httpClient?.addHook("beforeRequest",n);if(this.requestErrorHooks)for(let n of this.requestErrorHooks)this.httpClient?.addHook("requestError",n);if(this.responseHooks)for(let n of this.responseHooks)this.httpClient?.addHook("response",n)}catch{throw new Error("Error in adding all hooks")}}removeAllHooksFromHttpClient(){try{if(this.beforeRequestHooks)for(let e of this.beforeRequestHooks)this.httpClient?.removeHook("beforeRequest",e);if(this.requestErrorHooks)for(let e of this.requestErrorHooks)this.httpClient?.removeHook("requestError",e);if(this.responseHooks)for(let e of this.responseHooks)this.httpClient?.removeHook("response",e)}catch{throw new Error("Error in removing hooks")}}removeHookFromHttpClient(e){try{this.httpClient?.removeHook("beforeRequest",e),this.httpClient?.removeHook("requestError",e),this.httpClient?.removeHook("response",e)}catch{throw new Error("Error in removing hook")}}async imports(){let{Mistral:e}=await Promise.resolve().then(()=>$(Ahe(),1));return{Mistral:e}}}});var Mnn,ABe,Tnn=B(()=>{Kne();gh();Mnn=$(_1(),1);Xh();wk();VS();ABe=class extends eg{static lc_name(){return"MistralAI"}constructor(e){super(e??{}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","llms","mistralai"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"codestral-latest"}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"randomSeed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streaming",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"batchSize",{enumerable:!0,configurable:!0,writable:!0,value:20}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serverURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"beforeRequestHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestErrorHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responseHooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"httpClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.model=e?.model??this.model,this.temperature=e?.temperature??this.temperature,this.topP=e?.topP??this.topP,this.maxTokens=e?.maxTokens??this.maxTokens,this.randomSeed=e?.randomSeed??this.randomSeed,this.batchSize=e?.batchSize??this.batchSize,this.streaming=e?.streaming??this.streaming,this.serverURL=e?.serverURL??this.serverURL,this.maxRetries=e?.maxRetries,this.maxConcurrency=e?.maxConcurrency,this.beforeRequestHooks=e?.beforeRequestHooks??this.beforeRequestHooks,this.requestErrorHooks=e?.requestErrorHooks??this.requestErrorHooks,this.responseHooks=e?.responseHooks??this.responseHooks,this.httpClient=e?.httpClient??this.httpClient;let n=e?.apiKey??yt("MISTRAL_API_KEY");if(!n)throw new Error(`MistralAI requires an API key to be set. +Either provide one via the "apiKey" field in the constructor, or set the "MISTRAL_API_KEY" environment variable.`);this.apiKey=n,this.addAllHooksToHttpClient()}get lc_secrets(){return{apiKey:"MISTRAL_API_KEY"}}get lc_aliases(){return{apiKey:"mistral_api_key"}}_llmType(){return"mistralai"}invocationParams(e){return{model:this.model,suffix:e.suffix,temperature:this.temperature,maxTokens:this.maxTokens,topP:this.topP,randomSeed:this.randomSeed,stop:e.stop}}async _call(e,n){let l={...this.invocationParams(n),prompt:e},a=(await this.completionWithRetry(l,n,!1))?.choices?.[0].message.content??"";return Array.isArray(a)&&(a=a[0].type==="text"?a[0].text:""),a}async _generate(e,n,l){let I=BZ(e,this.batchSize),a=[],c=this.invocationParams(n);for(let s=0;s{if(this.streaming){let u=[];for(let o=0;ou.choices??[]))}return{generations:a.map(s=>s.map(r=>{let u=r.message?.content??"";return Array.isArray(u)&&(u=u[0].type==="text"?u[0].text:""),{text:u,generationInfo:{finishReason:r.finishReason}}}))}}async completionWithRetry(e,n,l){let{Mistral:I}=await this.imports(),a=new _u({maxConcurrency:n.maxConcurrency||this.maxConcurrency,maxRetries:this.maxRetries}),c=new I({apiKey:this.apiKey,serverURL:this.serverURL,timeoutMs:n.timeout,...this.httpClient?{httpClient:this.httpClient}:{}});return a.callWithOptions({signal:n.signal},async()=>{try{let i;return l?i=await c.fim.stream(e):i=await c.fim.complete(e),i}catch(i){throw(i.message?.includes("status: 400")||i.message?.toLowerCase().includes("status 400")||i.message?.includes("validation failed"))&&(i.status=400),i}})}async*_streamResponseChunks(e,n,l){let I={...this.invocationParams(n),prompt:e},a=await this.completionWithRetry(I,n,!0);for await(let c of a){let{data:i}=c,s=i?.choices[0];if(!s)continue;let r=s.delta.content??"";Array.isArray(r)&&(r=r[0].type==="text"?r[0].text:"");let u=new zo({text:r,generationInfo:{finishReason:s.finishReason,tokenUsage:i.usage}});yield u,l?.handleLLMNewToken(u.text??"")}if(n.signal?.aborted)throw new Error("AbortError")}addAllHooksToHttpClient(){try{if(this.removeAllHooksFromHttpClient(),[this.beforeRequestHooks,this.requestErrorHooks,this.responseHooks].some(n=>n&&n.length>0)&&!this.httpClient&&(this.httpClient=new Mnn.HTTPClient),this.beforeRequestHooks)for(let n of this.beforeRequestHooks)this.httpClient?.addHook("beforeRequest",n);if(this.requestErrorHooks)for(let n of this.requestErrorHooks)this.httpClient?.addHook("requestError",n);if(this.responseHooks)for(let n of this.responseHooks)this.httpClient?.addHook("response",n)}catch{throw new Error("Error in adding all hooks")}}removeAllHooksFromHttpClient(){try{if(this.beforeRequestHooks)for(let e of this.beforeRequestHooks)this.httpClient?.removeHook("beforeRequest",e);if(this.requestErrorHooks)for(let e of this.requestErrorHooks)this.httpClient?.removeHook("requestError",e);if(this.responseHooks)for(let e of this.responseHooks)this.httpClient?.removeHook("response",e)}catch{throw new Error("Error in removing hooks")}}removeHookFromHttpClient(e){try{this.httpClient?.removeHook("beforeRequest",e),this.httpClient?.removeHook("requestError",e),this.httpClient?.removeHook("response",e)}catch{throw new Error("Error in removing hook")}}async imports(){let{Mistral:e}=await Promise.resolve().then(()=>$(Ahe(),1));return{Mistral:e}}}});var Dnn=B(()=>{znn();Snn();Tnn()});var Knn={};Xe(Knn,{ChatMistralAI:()=>RBe,MistralAI:()=>ABe,MistralAIEmbeddings:()=>yBe});var _nn=B(()=>{Dnn()});function $nn(t){if(typeof t>"u")return null;try{return JSON.parse(t)}catch{}let e="",n=[],l=!1,I=!1;for(let a of t){if(l)a==='"'&&!I?l=!1:a===` +`&&!I?a="\\n":a==="\\"?I=!I:I=!1;else if(a==='"')l=!0,I=!1;else if(a==="{")n.push("}");else if(a==="[")n.push("]");else if(a==="}"||a==="]")if(n&&n[n.length-1]===a)n.pop();else return null;e+=a}l&&(e+='"');for(let a=n.length-1;a>=0;a-=1)e+=n[a];try{return JSON.parse(e)}catch{return null}}var eln=B(()=>{});function nln(t,e){return e?.[t]||(0,tln.default)(t)}function lln(t,e,n){let l={};for(let I in t)Object.hasOwn(t,I)&&(l[e(I,n)]=t[I]);return l}var tln,mmI,Iln=B(()=>{tln=$(Xye(),1),mmI=$(Hye(),1)});function aln(t){return Array.isArray(t)?[...t]:{...t}}function pmI(t,e){let n=aln(t);for(let[l,I]of Object.entries(e)){let[a,...c]=l.split(".").reverse(),i=n;for(let s of c.reverse()){if(i[s]===void 0)break;i[s]=aln(i[s]),i=i[s]}i[a]!==void 0&&(i[a]={lc:1,type:"secret",id:[I]})}return n}function XBe(t){let e=Object.getPrototypeOf(t);return typeof t.lc_name=="function"&&(typeof e.lc_name!="function"||t.lc_name()!==e.lc_name())?t.lc_name():t.name}var qV,FP=B(()=>{Iln();qV=class t{static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,XBe(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}constructor(e,...n){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_kwargs=e||{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof t||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let e={},n={},l=Object.keys(this.lc_kwargs).reduce((I,a)=>(I[a]=a in this?this[a]:this.lc_kwargs[a],I),{});for(let I=Object.getPrototypeOf(this);I;I=Object.getPrototypeOf(I))Object.assign(e,Reflect.get(I,"lc_aliases",this)),Object.assign(n,Reflect.get(I,"lc_secrets",this)),Object.assign(l,Reflect.get(I,"lc_attributes",this));return Object.keys(n).forEach(I=>{let a=this,c=l,[i,...s]=I.split(".").reverse();for(let r of s.reverse()){if(!(r in a)||a[r]===void 0)return;(!(r in c)||c[r]===void 0)&&(typeof a[r]=="object"&&a[r]!=null?c[r]={}:Array.isArray(a[r])&&(c[r]=[])),a=a[r],c=c[r]}i in a&&a[i]!==void 0&&(c[i]=c[i]||a[i])}),{lc:1,type:"constructor",id:this.lc_id,kwargs:lln(Object.keys(n).length?pmI(l,n):l,nln,e)}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}}});function gJ(t,e){return typeof t=="string"?typeof e=="string"?t+e:[{type:"text",text:t},...e]:Array.isArray(e)?Fhe(t,e)??[...t,...e]:[...t,{type:"text",text:e}]}function hmI(t,e){function n(l,I){if(typeof l!="object"||l===null||l===void 0)return l;if(I>=e)return Array.isArray(l)?"[Array]":"[Object]";if(Array.isArray(l))return l.map(c=>n(c,I+1));let a={};for(let c of Object.keys(l))a[c]=n(l[c],I+1);return a}return JSON.stringify(n(t,0),null,2)}function vR(t,e){let n={...t};for(let[l,I]of Object.entries(e))if(n[l]==null)n[l]=I;else{if(I==null)continue;if(typeof n[l]!=typeof I||Array.isArray(n[l])!==Array.isArray(I))throw new Error(`field[${l}] already exists in the message chunk, but with a different type.`);if(typeof n[l]=="string"){if(l==="type")continue;n[l]+=I}else if(typeof n[l]=="object"&&!Array.isArray(n[l]))n[l]=vR(n[l],I);else if(Array.isArray(n[l]))n[l]=Fhe(n[l],I);else{if(n[l]===I)continue;console.warn(`field[${l}] already exists in this message chunk and value has unsupported type.`)}}return n}function Fhe(t,e){if(!(t===void 0&&e===void 0)){if(t===void 0||e===void 0)return t||e;{let n=[...t];for(let l of e)if(typeof l=="object"&&"index"in l&&typeof l.index=="number"){let I=n.findIndex(a=>a.index===l.index);I!==-1?n[I]=vR(n[I],l):n.push(l)}else{if(typeof l=="object"&&"text"in l&&l.text==="")continue;n.push(l)}return n}}}function rln(t){return typeof t.role=="string"}function vP(t){return typeof t?._getType=="function"}var wm,JF,fR=B(()=>{FP();wm=class extends qV{get lc_aliases(){return{additional_kwargs:"additional_kwargs",response_metadata:"response_metadata"}}get text(){return typeof this.content=="string"?this.content:""}constructor(e,n){typeof e=="string"&&(e={content:e,additional_kwargs:n,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 n=hmI(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${n}`}};JF=class extends wm{}});function cln(t){let e=[],n=[];for(let l of t)if(l.function){let I=l.function.name;try{let a=JSON.parse(l.function.arguments),c={name:I||"",args:a||{},id:l.id};e.push(c)}catch{n.push({name:I,args:l.function.arguments,id:l.id,error:"Malformed args."})}}else continue;return[e,n]}var gO,fP=B(()=>{fR();gO=class extends wm{static lc_name(){return"ToolMessage"}get lc_aliases(){return{tool_call_id:"tool_call_id"}}constructor(e,n,l){typeof e=="string"&&(e={content:e,name:l,tool_call_id:n}),super(e),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tool_call_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"artifact",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tool_call_id=e.tool_call_id,this.artifact=e.artifact,this.status=e.status}_getType(){return"tool"}static isInstance(e){return e._getType()==="tool"}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}}});var $V,hw,RO=B(()=>{eln();fR();fP();$V=class extends wm{get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls"}}constructor(e,n){let l;if(typeof e=="string")l={content:e,tool_calls:[],invalid_tool_calls:[],additional_kwargs:n??{}};else{l=e;let I=l.additional_kwargs?.tool_calls,a=l.tool_calls;I!=null&&I.length>0&&(a===void 0||a.length===0)&&console.warn(["New LangChain packages are available that more efficiently handle",`tool calling. + +Please upgrade your packages to versions that set`,"message tool calls. e.g., `yarn add @langchain/anthropic`,","yarn add @langchain/openai`, etc."].join(" "));try{if(I!=null&&a===void 0){let[c,i]=cln(I);l.tool_calls=c??[],l.invalid_tool_calls=i??[]}else l.tool_calls=l.tool_calls??[],l.invalid_tool_calls=l.invalid_tool_calls??[]}catch{l.tool_calls=[],l.invalid_tool_calls=[]}}super(l),Object.defineProperty(this,"tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"invalid_tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"usage_metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),typeof l!="string"&&(this.tool_calls=l.tool_calls??this.tool_calls,this.invalid_tool_calls=l.invalid_tool_calls??this.invalid_tool_calls),this.usage_metadata=l.usage_metadata}static lc_name(){return"AIMessage"}_getType(){return"ai"}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}},hw=class t extends JF{constructor(e){let n;if(typeof e=="string")n={content:e,tool_calls:[],invalid_tool_calls:[],tool_call_chunks:[]};else if(e.tool_call_chunks===void 0)n={...e,tool_calls:e.tool_calls??[],invalid_tool_calls:[],tool_call_chunks:[]};else{let l=[],I=[];for(let a of e.tool_call_chunks){let c={};try{if(c=$nn(a.args||"{}"),c===null||typeof c!="object"||Array.isArray(c))throw new Error("Malformed tool call chunk args.");l.push({name:a.name??"",args:c,id:a.id,type:"tool_call"})}catch{I.push({name:a.name,args:a.args,id:a.id,error:"Malformed args.",type:"invalid_tool_call"})}}n={...e,tool_calls:l,invalid_tool_calls:I}}super(n),Object.defineProperty(this,"tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"invalid_tool_calls",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"tool_call_chunks",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"usage_metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tool_call_chunks=n.tool_call_chunks??this.tool_call_chunks,this.tool_calls=n.tool_calls??this.tool_calls,this.invalid_tool_calls=n.invalid_tool_calls??this.invalid_tool_calls,this.usage_metadata=n.usage_metadata}get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls",tool_call_chunks:"tool_call_chunks"}}static lc_name(){return"AIMessageChunk"}_getType(){return"ai"}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,tool_call_chunks:this.tool_call_chunks,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}concat(e){let n={content:gJ(this.content,e.content),additional_kwargs:vR(this.additional_kwargs,e.additional_kwargs),response_metadata:vR(this.response_metadata,e.response_metadata),tool_call_chunks:[],id:this.id??e.id};if(this.tool_call_chunks!==void 0||e.tool_call_chunks!==void 0){let l=Fhe(this.tool_call_chunks,e.tool_call_chunks);l!==void 0&&l.length>0&&(n.tool_call_chunks=l)}if(this.usage_metadata!==void 0||e.usage_metadata!==void 0){let l=this.usage_metadata??{input_tokens:0,output_tokens:0,total_tokens:0},I=e.usage_metadata??{input_tokens:0,output_tokens:0,total_tokens:0},a={input_tokens:l.input_tokens+I.input_tokens,output_tokens:l.output_tokens+I.output_tokens,total_tokens:l.total_tokens+I.total_tokens};n.usage_metadata=a}return new t(n)}}});var yO,vhe=B(()=>{fR();yO=class t extends wm{static lc_name(){return"ChatMessage"}static _chatMessageClass(){return t}constructor(e,n){typeof e=="string"&&(e={content:e,role:n}),super(e),Object.defineProperty(this,"role",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.role=e.role}_getType(){return"generic"}static isInstance(e){return e._getType()==="generic"}get _printableFields(){return{...super._printableFields,role:this.role}}}});var fhe=B(()=>{fR()});var XR,XP=B(()=>{fR();XR=class extends wm{static lc_name(){return"HumanMessage"}_getType(){return"human"}}});var wP,Xhe=B(()=>{fR();wP=class extends wm{static lc_name(){return"SystemMessage"}_getType(){return"system"}}});function Hhe(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="tool_call")}var whe,wBe=B(()=>{whe=class extends Error{constructor(e,n){super(e),Object.defineProperty(this,"output",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.output=n}}});function gmI(t){return Hhe(t)?t:typeof t.id=="string"&&t.type==="function"&&typeof t.function=="object"&&t.function!==null&&"arguments"in t.function&&typeof t.function.arguments=="string"&&"name"in t.function&&typeof t.function.name=="string"?{id:t.id,args:JSON.parse(t.function.arguments),name:t.function.name,type:"tool_call"}:t}function HBe(t){let{type:e,...n}=t;if(e==="human"||e==="user")return new XR(n);if(e==="ai"||e==="assistant"){let{tool_calls:l,...I}=n;if(!Array.isArray(l))return new $V(n);let a=l.map(gmI);return new $V({...I,tool_calls:a})}else{if(e==="system")return new wP(n);if(e==="tool"&&"tool_call_id"in n)return new gO({...n,content:n.content,tool_call_id:n.tool_call_id,name:n.name});throw new Error("Unable to coerce message from array: only human, AI, or system message coercion is currently supported.")}}function RJ(t){if(typeof t=="string")return new XR(t);if(vP(t))return t;if(Array.isArray(t)){let[e,n]=t;return HBe({type:e,content:n})}else if(rln(t)){let{role:e,...n}=t;return HBe({...n,type:e})}else return HBe(t)}function AO(t,e="Human",n="AI"){let l=[];for(let I of t){let a;if(I._getType()==="human")a=e;else if(I._getType()==="ai")a=n;else if(I._getType()==="system")a="System";else if(I._getType()==="function")a="Function";else if(I._getType()==="tool")a="Tool";else if(I._getType()==="generic")a=I.role;else throw new Error(`Got unsupported message type: ${I._getType()}`);let c=I.name?`${I.name}, `:"",i=typeof I.content=="string"?I.content:JSON.stringify(I.content,null,2);l.push(`${a}: ${c}${i}`)}return l.join(` +`)}var yJ=B(()=>{wBe();RO();fR();vhe();fhe();XP();Xhe();fP()});var RmI,ymI,Wn,Qhe=B(()=>{RmI=(...t)=>fetch(...t),ymI=Symbol.for("ls:fetch_implementation"),Wn=()=>globalThis[ymI]??RmI});var oln,Ehe,AmI,FmI,HP,iln=B(()=>{oln=$(CH(),1),Ehe=$(jH(),1);Qhe();AmI=[400,401,403,404,405,406,407,408],FmI=[409],HP=class{constructor(e){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,"default"in Ehe.default?this.queue=new Ehe.default.default({concurrency:this.maxConcurrency}):this.queue=new Ehe.default({concurrency:this.maxConcurrency}),this.onFailedResponseHook=e?.onFailedResponseHook}call(e,...n){let l=this.onFailedResponseHook;return this.queue.add(()=>(0,oln.default)(()=>e(...n).catch(I=>{throw I instanceof Error?I:new Error(I)}),{async onFailedAttempt(I){if(I.message.startsWith("Cancel")||I.message.startsWith("TimeoutError")||I.message.startsWith("AbortError")||I?.code==="ECONNABORTED")throw I;let a=I?.response,c=a?.status;if(c){if(AmI.includes(+c))throw I;if(FmI.includes(+c))return;l&&await l(a)}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,n,...l){return e.signal?Promise.race([this.call(n,...l),new Promise((I,a)=>{e.signal?.addEventListener("abort",()=>{a(new Error("AbortError"))})})]):this.call(n,...l)}fetch(...e){return this.call(()=>Wn()(...e).then(n=>n.ok?n:Promise.reject(n)))}}});function QBe(t){return typeof t?._getType=="function"}function EBe(t){let e={type:t._getType(),data:{content:t.content}};return t?.additional_kwargs&&Object.keys(t.additional_kwargs).length>0&&(e.data.additional_kwargs={...t.additional_kwargs}),e}var sln=B(()=>{});function mI(t,e){if(!zm(t)){let n=e!==void 0?`Invalid UUID for ${e}: ${t}`:`Invalid UUID: ${t}`;throw new Error(n)}return t}var uln=B(()=>{uG()});function Jhe(t){dln[t]||(console.warn(t),dln[t]=!0)}var dln,JBe=B(()=>{dln={}});function Gln(t,e){let n=(0,CBe.parse)(t),l=(0,CBe.parse)(e);if(!n||!l)throw new Error("Invalid version format.");return n.compare(l)>=0}function CF(t){if(!t||t.split("/").length>2||t.startsWith("/")||t.endsWith("/")||t.split(":").length>2)throw new Error(`Invalid identifier format: ${t}`);let[e,n]=t.split(":"),l=n||"latest";if(e.includes("/")){let[I,a]=e.split("/",2);if(!I||!a)throw new Error(`Invalid identifier format: ${t}`);return[I,a,l]}else{if(!e)throw new Error(`Invalid identifier format: ${t}`);return["-",e,l]}}var CBe,bln=B(()=>{CBe=$(N5(),1)});async function oI(t,e,n){let l;if(t.ok){n&&(l=await t.text());return}l=await t.text();let I=`Failed to ${e}. Received status [${t.status}]: ${t.statusText}. Server response: ${l}`;throw t.status===409?new LBe(I):new Error(I)}var LBe,mln=B(()=>{LBe=class extends Error{constructor(e){super(e),this.name="LangSmithConflictError"}}});function fmI(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function AJ(t,e,n,l){try{return JSON.stringify(t,e,n)}catch(c){if(!c.message?.includes("Converting circular structure to JSON"))return console.warn("[WARNING]: LangSmith received unserializable value."),"[Unserializable]";console.warn("[WARNING]: LangSmith received circular JSON. This will decrease tracer performance."),typeof l>"u"&&(l=fmI()),xBe(t,"",0,[],void 0,0,l);var I;try{FO.length===0?I=JSON.stringify(t,e,n):I=JSON.stringify(t,XmI(e),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Che.length!==0;){var a=Che.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return I}}function kBe(t,e,n,l){var I=Object.getOwnPropertyDescriptor(l,n);I.get!==void 0?I.configurable?(Object.defineProperty(l,n,{value:t}),Che.push([l,n,e,I])):FO.push([e,n,t]):(l[n]=t,Che.push([l,n,e]))}function xBe(t,e,n,l,I,a,c){a+=1;var i;if(typeof t=="object"&&t!==null){for(i=0;ic.depthLimit){kBe(pln,t,e,I);return}if(typeof c.edgesLimit<"u"&&n+1>c.edgesLimit){kBe(pln,t,e,I);return}if(l.push(t),Array.isArray(t))for(i=0;i0)for(var l=0;l{pln="[...]",vmI={result:"[Circular]"},Che=[],FO=[]});function Zln(t){let e=xhe(),n=Wln(),l=t.extra??{},I=l.metadata;return t.extra={...l,runtime:{...e,...l?.runtime},metadata:{...n,...n.revision_id||t.revision_id?{revision_id:t.revision_id??n.revision_id}:{},...I}},t}async function QmI(t){let e=[];for await(let n of t)e.push(n);return e}function jBe(t){if(t!==void 0)return t.trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}var wmI,HmI,EmI,OBe,JmI,CmI,FJ,UBe=B(()=>{uG();iln();sln();jhe();khe();uln();JBe();bln();mln();Qhe();hln();wmI=()=>{let t=LF("TRACING_SAMPLING_RATE");if(t===void 0)return;let e=parseFloat(t);if(e<0||e>1)throw new Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${e}`);return e},HmI=t=>{let n=t.replace("http://","").replace("https://","").split("/")[0].split(":")[0];return n==="localhost"||n==="127.0.0.1"||n==="::1"};EmI=async t=>{if(t?.status===429){let e=parseInt(t.headers.get("retry-after")??"30",10)*1e3;if(e>0)return await new Promise(n=>setTimeout(n,e)),!0}return!1},OBe=class{constructor(){Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0})}peek(){return this.items[0]}push(e){let n,l=new Promise(a=>{n=a}),I=AJ(e.item).length;return this.items.push({action:e.action,payload:e.item,itemPromiseResolve:n,itemPromise:l,size:I}),this.sizeBytes+=I,l}pop(e){if(e<1)throw new Error("Number of bytes to pop off may not be less than 1.");let n=[],l=0;for(;l+(this.peek()?.size??0)0;){let I=this.items.shift();I&&(n.push(I),l+=I.size,this.sizeBytes-=I.size)}if(n.length===0&&this.items.length>0){let I=this.items.shift();n.push(I),l+=I.size,this.sizeBytes-=I.size}return[n.map(I=>({action:I.action,item:I.payload})),()=>n.forEach(I=>I.itemPromiseResolve())]}},JmI=20971520,CmI=1e3,FJ=class t{constructor(e={}){Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"webUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchIngestCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout_ms",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tenantId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingSampleRate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filteredPostUuids",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"autoBatchTracing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"autoBatchQueue",{enumerable:!0,configurable:!0,writable:!0,value:new OBe}),Object.defineProperty(this,"autoBatchTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"autoBatchInitialDelayMs",{enumerable:!0,configurable:!0,writable:!0,value:250}),Object.defineProperty(this,"autoBatchAggregationDelayMs",{enumerable:!0,configurable:!0,writable:!0,value:50}),Object.defineProperty(this,"batchSizeBytesLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"blockOnRootRunFinalization",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_serverInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_getServerInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let n=t.getDefaultClientConfig();this.tracingSampleRate=wmI(),this.apiUrl=jBe(e.apiUrl??n.apiUrl)??"",this.apiUrl.endsWith("/")&&(this.apiUrl=this.apiUrl.slice(0,-1)),this.apiKey=jBe(e.apiKey??n.apiKey),this.webUrl=jBe(e.webUrl??n.webUrl),this.webUrl?.endsWith("/")&&(this.webUrl=this.webUrl.slice(0,-1)),this.timeout_ms=e.timeout_ms??12e3,this.caller=new HP(e.callerOptions??{}),this.batchIngestCaller=new HP({...e.callerOptions??{},onFailedResponseHook:EmI}),this.hideInputs=e.hideInputs??e.anonymizer??n.hideInputs,this.hideOutputs=e.hideOutputs??e.anonymizer??n.hideOutputs,this.autoBatchTracing=e.autoBatchTracing??this.autoBatchTracing,this.blockOnRootRunFinalization=e.blockOnRootRunFinalization??this.blockOnRootRunFinalization,this.batchSizeBytesLimit=e.batchSizeBytesLimit,this.fetchOptions=e.fetchOptions||{}}static getDefaultClientConfig(){let e=LF("API_KEY"),n=LF("ENDPOINT")??"https://api.smith.langchain.com",l=LF("HIDE_INPUTS")==="true",I=LF("HIDE_OUTPUTS")==="true";return{apiUrl:n,apiKey:e,webUrl:void 0,hideInputs:l,hideOutputs:I}}getHostUrl(){return this.webUrl?this.webUrl:HmI(this.apiUrl)?(this.webUrl="http://localhost:3000",this.webUrl):this.apiUrl.includes("/api")&&!this.apiUrl.split(".",1)[0].endsWith("api")?(this.webUrl=this.apiUrl.replace("/api",""),this.webUrl):this.apiUrl.split(".",1)[0].includes("dev")?(this.webUrl="https://dev.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("eu")?(this.webUrl="https://eu.smith.langchain.com",this.webUrl):(this.webUrl="https://smith.langchain.com",this.webUrl)}get headers(){let e={"User-Agent":`langsmith-js/${Lhe}`};return this.apiKey&&(e["x-api-key"]=`${this.apiKey}`),e}processInputs(e){return this.hideInputs===!1?e:this.hideInputs===!0?{}:typeof this.hideInputs=="function"?this.hideInputs(e):e}processOutputs(e){return this.hideOutputs===!1?e:this.hideOutputs===!0?{}:typeof this.hideOutputs=="function"?this.hideOutputs(e):e}prepareRunCreateOrUpdateInputs(e){let n={...e};return n.inputs!==void 0&&(n.inputs=this.processInputs(n.inputs)),n.outputs!==void 0&&(n.outputs=this.processOutputs(n.outputs)),n}async _getResponse(e,n){let l=n?.toString()??"",I=`${this.apiUrl}${e}?${l}`,a=await this.caller.call(Wn(),I,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(a,`Failed to fetch ${e}`),a}async _get(e,n){return(await this._getResponse(e,n)).json()}async*_getPaginated(e,n=new URLSearchParams,l){let I=Number(n.get("offset"))||0,a=Number(n.get("limit"))||100;for(;;){n.set("offset",String(I)),n.set("limit",String(a));let c=`${this.apiUrl}${e}?${n}`,i=await this.caller.call(Wn(),c,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(i,`Failed to fetch ${e}`);let s=l?l(await i.json()):await i.json();if(s.length===0||(yield s,s.length=0;){let[e,n]=this.autoBatchQueue.pop(await this._getBatchSizeLimitBytes());if(!e.length){n();return}try{let l={runCreates:e.filter(a=>a.action==="create").map(a=>a.item),runUpdates:e.filter(a=>a.action==="update").map(a=>a.item)};(await this._ensureServerInfo())?.batch_ingest_config?.use_multipart_endpoint?await this.multipartIngestRuns(l):await this.batchIngestRuns(l)}finally{n()}}}async processRunOperation(e,n){let l=this.autoBatchTimeout;clearTimeout(this.autoBatchTimeout),this.autoBatchTimeout=void 0,e.action==="create"&&(e.item=Zln(e.item));let I=this.autoBatchQueue.push(e),a=await this._getBatchSizeLimitBytes();return(n||this.autoBatchQueue.sizeBytes>a)&&await this.drainAutoBatchQueue().catch(console.error),this.autoBatchQueue.items.length>0&&(this.autoBatchTimeout=setTimeout(()=>{this.autoBatchTimeout=void 0,this.drainAutoBatchQueue().catch(console.error)},l?this.autoBatchAggregationDelayMs:this.autoBatchInitialDelayMs)),I}async _getServerInfo(){let e=await Wn()(`${this.apiUrl}/info`,{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(CmI),...this.fetchOptions});return await oI(e,"get server info"),e.json()}async _ensureServerInfo(){return this._getServerInfoPromise===void 0&&(this._getServerInfoPromise=(async()=>{if(this._serverInfo===void 0)try{this._serverInfo=await this._getServerInfo()}catch{console.warn("[WARNING]: LangSmith failed to fetch info on supported operations. Falling back to single calls and default limits.")}return this._serverInfo??{}})()),this._getServerInfoPromise.then(e=>(this._serverInfo===void 0&&(this._getServerInfoPromise=void 0),e))}async _getSettings(){return this.settings||(this.settings=this._get("/settings")),await this.settings}async createRun(e){if(!this._filterForSampling([e]).length)return;let n={...this.headers,"Content-Type":"application/json"},l=e.project_name;delete e.project_name;let I=this.prepareRunCreateOrUpdateInputs({session_name:l,...e,start_time:e.start_time??Date.now()});if(this.autoBatchTracing&&I.trace_id!==void 0&&I.dotted_order!==void 0){this.processRunOperation({action:"create",item:I}).catch(console.error);return}let a=Zln(I),c=await this.caller.call(Wn(),`${this.apiUrl}/runs`,{method:"POST",headers:n,body:AJ(a),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(c,"create run",!0)}async batchIngestRuns({runCreates:e,runUpdates:n}){if(e===void 0&&n===void 0)return;let l=e?.map(s=>this.prepareRunCreateOrUpdateInputs(s))??[],I=n?.map(s=>this.prepareRunCreateOrUpdateInputs(s))??[];if(l.length>0&&I.length>0){let s=l.reduce((u,o)=>(o.id&&(u[o.id]=o),u),{}),r=[];for(let u of I)u.id!==void 0&&s[u.id]?s[u.id]={...s[u.id],...u}:r.push(u);l=Object.values(s),I=r}let a={post:this._filterForSampling(l),patch:this._filterForSampling(I,!0)};if(!a.post.length&&!a.patch.length)return;if((await this._ensureServerInfo()).version===void 0){this.autoBatchTracing=!1;for(let s of a.post)await this.createRun(s);for(let s of a.patch)s.id!==void 0&&await this.updateRun(s.id,s);return}let i={post:[],patch:[]};for(let s of["post","patch"]){let r=s,u=a[r].reverse(),o=u.pop();for(;o!==void 0;)i[r].push(o),o=u.pop()}(i.post.length>0||i.patch.length>0)&&await this._postBatchIngestRuns(AJ(i))}async _postBatchIngestRuns(e){let n={...this.headers,"Content-Type":"application/json",Accept:"application/json"},l=await this.batchIngestCaller.call(Wn(),`${this.apiUrl}/runs/batch`,{method:"POST",headers:n,body:e,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(l,"batch create run",!0)}async multipartIngestRuns({runCreates:e,runUpdates:n}){if(e===void 0&&n===void 0)return;let l={},I=[];for(let u of e??[]){let o=this.prepareRunCreateOrUpdateInputs(u);o.id!==void 0&&o.attachments!==void 0&&(l[o.id]=o.attachments),delete o.attachments,I.push(o)}let a=[];for(let u of n??[])a.push(this.prepareRunCreateOrUpdateInputs(u));if(I.find(u=>u.trace_id===void 0||u.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(a.find(u=>u.trace_id===void 0||u.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(I.length>0&&a.length>0){let u=I.reduce((d,b)=>(b.id&&(d[b.id]=b),d),{}),o=[];for(let d of a)d.id!==void 0&&u[d.id]?u[d.id]={...u[d.id],...d}:o.push(d);I=Object.values(u),a=o}if(I.length===0&&a.length===0)return;let s=[],r=[];for(let[u,o]of[["post",I],["patch",a]])for(let d of o){let{inputs:b,outputs:h,events:Z,...N}=d,g={inputs:b,outputs:h,events:Z},y=AJ(N);r.push({name:`${u}.${N.id}`,payload:new Blob([y],{type:`application/json; length=${y.length}`})});for(let[X,v]of Object.entries(g)){if(v===void 0)continue;let H=AJ(v);r.push({name:`${u}.${N.id}.${X}`,payload:new Blob([H],{type:`application/json; length=${H.length}`})})}if(N.id!==void 0){let X=l[N.id];if(X){delete l[N.id];for(let[v,[H,Q]]of Object.entries(X))r.push({name:`attachment.${N.id}.${v}`,payload:new Blob([Q],{type:`${H}; length=${Q.length}`})})}}s.push(`trace=${N.trace_id},id=${N.id}`)}await this._sendMultipartRequest(r,s.join("; "))}async _sendMultipartRequest(e,n){try{let l=new FormData;for(let I of e)l.append(I.name,I.payload);await this.batchIngestCaller.call(Wn(),`${this.apiUrl}/runs/multipart`,{method:"POST",headers:{...this.headers},body:l,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})}catch(l){let I="Failed to multipart ingest runs";l instanceof Error?I+=`: ${l.stack||l.message}`:I+=`: ${String(l)}`,console.warn(`${I.trim()} + +Context: ${n}`)}}async updateRun(e,n){mI(e),n.inputs&&(n.inputs=this.processInputs(n.inputs)),n.outputs&&(n.outputs=this.processOutputs(n.outputs));let l={...n,id:e};if(!this._filterForSampling([l],!0).length)return;if(this.autoBatchTracing&&l.trace_id!==void 0&&l.dotted_order!==void 0){if(n.end_time!==void 0&&l.parent_run_id===void 0&&this.blockOnRootRunFinalization){await this.processRunOperation({action:"update",item:l},!0);return}else this.processRunOperation({action:"update",item:l}).catch(console.error);return}let I={...this.headers,"Content-Type":"application/json"},a=await this.caller.call(Wn(),`${this.apiUrl}/runs/${e}`,{method:"PATCH",headers:I,body:AJ(n),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(a,"update run",!0)}async readRun(e,{loadChildRuns:n}={loadChildRuns:!1}){mI(e);let l=await this._get(`/runs/${e}`);return n&&l.child_run_ids&&(l=await this._loadChildRuns(l)),l}async getRunUrl({runId:e,run:n,projectOpts:l}){if(n!==void 0){let I;n.session_id?I=n.session_id:l?.projectName?I=(await this.readProject({projectName:l?.projectName})).id:l?.projectId?I=l?.projectId:I=(await this.readProject({projectName:LF("PROJECT")||"default"})).id;let a=await this._getTenantId();return`${this.getHostUrl()}/o/${a}/projects/p/${I}/r/${n.id}?poll=true`}else if(e!==void 0){let I=await this.readRun(e);if(!I.app_path)throw new Error(`Run ${e} has no app_path`);return`${this.getHostUrl()}${I.app_path}`}else throw new Error("Must provide either runId or run")}async _loadChildRuns(e){let n=await QmI(this.listRuns({id:e.child_run_ids})),l={},I={};n.sort((a,c)=>(a?.dotted_order??"").localeCompare(c?.dotted_order??""));for(let a of n){if(a.parent_run_id===null||a.parent_run_id===void 0)throw new Error(`Child run ${a.id} has no parent`);a.parent_run_id in l||(l[a.parent_run_id]=[]),l[a.parent_run_id].push(a),I[a.id]=a}e.child_runs=l[e.id]||[];for(let a in l)a!==e.id&&(I[a].child_runs=l[a]);return e}async*listRuns(e){let{projectId:n,projectName:l,parentRunId:I,traceId:a,referenceExampleId:c,startTime:i,executionOrder:s,isRoot:r,runType:u,error:o,id:d,query:b,filter:h,traceFilter:Z,treeFilter:N,limit:g,select:y}=e,X=[];if(n&&(X=Array.isArray(n)?n:[n]),l){let L=Array.isArray(l)?l:[l],J=await Promise.all(L.map(O=>this.readProject({projectName:O}).then(U=>U.id)));X.push(...J)}let v=["app_path","child_run_ids","completion_cost","completion_tokens","dotted_order","end_time","error","events","extra","feedback_stats","first_token_time","id","inputs","name","outputs","parent_run_id","parent_run_ids","prompt_cost","prompt_tokens","reference_example_id","run_type","session_id","start_time","status","tags","total_cost","total_tokens","trace_id"],H={session:X.length?X:null,run_type:u,reference_example:c,query:b,filter:h,trace_filter:Z,tree_filter:N,execution_order:s,parent_run:I,start_time:i?i.toISOString():null,error:o,id:d,limit:g,trace:a,select:y||v,is_root:r},Q=0;for await(let L of this._getCursorPaginatedList("/runs/query",H))if(g){if(Q>=g)break;if(L.length+Q>g){yield*L.slice(0,g-Q);break}Q+=L.length,yield*L}else yield*L}async getRunStats({id:e,trace:n,parentRun:l,runType:I,projectNames:a,projectIds:c,referenceExampleIds:i,startTime:s,endTime:r,error:u,query:o,filter:d,traceFilter:b,treeFilter:h,isRoot:Z,dataSourceType:N}){let g=c||[];a&&(g=[...c||[],...await Promise.all(a.map(Q=>this.readProject({projectName:Q}).then(L=>L.id)))]);let X=Object.fromEntries(Object.entries({id:e,trace:n,parent_run:l,run_type:I,session:g,reference_example:i,start_time:s,end_time:r,error:u,query:o,filter:d,trace_filter:b,tree_filter:h,is_root:Z,data_source_type:N}).filter(([Q,L])=>L!==void 0));return await(await this.caller.call(Wn(),`${this.apiUrl}/runs/stats`,{method:"POST",headers:this.headers,body:JSON.stringify(X),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async shareRun(e,{shareId:n}={}){let l={run_id:e,share_token:n||$n()};mI(e);let a=await(await this.caller.call(Wn(),`${this.apiUrl}/runs/${e}/share`,{method:"PUT",headers:this.headers,body:JSON.stringify(l),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();if(a===null||!("share_token"in a))throw new Error("Invalid response from server");return`${this.getHostUrl()}/public/${a.share_token}/r`}async unshareRun(e){mI(e);let n=await this.caller.call(Wn(),`${this.apiUrl}/runs/${e}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(n,"unshare run",!0)}async readRunSharedLink(e){mI(e);let l=await(await this.caller.call(Wn(),`${this.apiUrl}/runs/${e}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();if(!(l===null||!("share_token"in l)))return`${this.getHostUrl()}/public/${l.share_token}/r`}async listSharedRuns(e,{runIds:n}={}){let l=new URLSearchParams({share_token:e});if(n!==void 0)for(let c of n)l.append("id",c);return mI(e),await(await this.caller.call(Wn(),`${this.apiUrl}/public/${e}/runs${l}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async readDatasetSharedSchema(e,n){if(!e&&!n)throw new Error("Either datasetId or datasetName must be given");e||(e=(await this.readDataset({datasetName:n})).id),mI(e);let I=await(await this.caller.call(Wn(),`${this.apiUrl}/datasets/${e}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();return I.url=`${this.getHostUrl()}/public/${I.share_token}/d`,I}async shareDataset(e,n){if(!e&&!n)throw new Error("Either datasetId or datasetName must be given");e||(e=(await this.readDataset({datasetName:n})).id);let l={dataset_id:e};mI(e);let a=await(await this.caller.call(Wn(),`${this.apiUrl}/datasets/${e}/share`,{method:"PUT",headers:this.headers,body:JSON.stringify(l),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json();return a.url=`${this.getHostUrl()}/public/${a.share_token}/d`,a}async unshareDataset(e){mI(e);let n=await this.caller.call(Wn(),`${this.apiUrl}/datasets/${e}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(n,"unshare dataset",!0)}async readSharedDataset(e){return mI(e),await(await this.caller.call(Wn(),`${this.apiUrl}/public/${e}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async listSharedExamples(e,n){let l={};n?.exampleIds&&(l.id=n.exampleIds);let I=new URLSearchParams;Object.entries(l).forEach(([i,s])=>{Array.isArray(s)?s.forEach(r=>I.append(i,r)):I.append(i,s)});let a=await this.caller.call(Wn(),`${this.apiUrl}/public/${e}/examples?${I.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions}),c=await a.json();if(!a.ok)throw"detail"in c?new Error(`Failed to list shared examples. +Status: ${a.status} +Message: ${c.detail.join(` +`)}`):new Error(`Failed to list shared examples: ${a.status} ${a.statusText}`);return c.map(i=>({...i,_hostUrl:this.getHostUrl()}))}async createProject({projectName:e,description:n=null,metadata:l=null,upsert:I=!1,projectExtra:a=null,referenceDatasetId:c=null}){let i=I?"?upsert=true":"",s=`${this.apiUrl}/sessions${i}`,r=a||{};l&&(r.metadata=l);let u={name:e,extra:r,description:n};c!==null&&(u.reference_dataset_id=c);let o=await this.caller.call(Wn(),s,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(u),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(o,"create project"),await o.json()}async updateProject(e,{name:n=null,description:l=null,metadata:I=null,projectExtra:a=null,endTime:c=null}){let i=`${this.apiUrl}/sessions/${e}`,s=a;I&&(s={...s||{},metadata:I});let r={name:n,extra:s,description:l,end_time:c?new Date(c).toISOString():null},u=await this.caller.call(Wn(),i,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(r),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(u,"update project"),await u.json()}async hasProject({projectId:e,projectName:n}){let l="/sessions",I=new URLSearchParams;if(e!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(e!==void 0)mI(e),l+=`/${e}`;else if(n!==void 0)I.append("name",n);else throw new Error("Must provide projectName or projectId");let a=await this.caller.call(Wn(),`${this.apiUrl}${l}?${I}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});try{let c=await a.json();return a.ok?Array.isArray(c)?c.length>0:!0:!1}catch{return!1}}async readProject({projectId:e,projectName:n,includeStats:l}){let I="/sessions",a=new URLSearchParams;if(e!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(e!==void 0)mI(e),I+=`/${e}`;else if(n!==void 0)a.append("name",n);else throw new Error("Must provide projectName or projectId");l!==void 0&&a.append("include_stats",l.toString());let c=await this._get(I,a),i;if(Array.isArray(c)){if(c.length===0)throw new Error(`Project[id=${e}, name=${n}] not found`);i=c[0]}else i=c;return i}async getProjectUrl({projectId:e,projectName:n}){if(e===void 0&&n===void 0)throw new Error("Must provide either projectName or projectId");let l=await this.readProject({projectId:e,projectName:n}),I=await this._getTenantId();return`${this.getHostUrl()}/o/${I}/projects/p/${l.id}`}async getDatasetUrl({datasetId:e,datasetName:n}){if(e===void 0&&n===void 0)throw new Error("Must provide either datasetName or datasetId");let l=await this.readDataset({datasetId:e,datasetName:n}),I=await this._getTenantId();return`${this.getHostUrl()}/o/${I}/datasets/${l.id}`}async _getTenantId(){if(this._tenantId!==null)return this._tenantId;let e=new URLSearchParams({limit:"1"});for await(let n of this._getPaginated("/sessions",e))return this._tenantId=n[0].tenant_id,n[0].tenant_id;throw new Error("No projects found to resolve tenant.")}async*listProjects({projectIds:e,name:n,nameContains:l,referenceDatasetId:I,referenceDatasetName:a,referenceFree:c,metadata:i}={}){let s=new URLSearchParams;if(e!==void 0)for(let r of e)s.append("id",r);if(n!==void 0&&s.append("name",n),l!==void 0&&s.append("name_contains",l),I!==void 0)s.append("reference_dataset",I);else if(a!==void 0){let r=await this.readDataset({datasetName:a});s.append("reference_dataset",r.id)}c!==void 0&&s.append("reference_free",c.toString()),i!==void 0&&s.append("metadata",JSON.stringify(i));for await(let r of this._getPaginated("/sessions",s))yield*r}async deleteProject({projectId:e,projectName:n}){let l;if(e===void 0&&n===void 0)throw new Error("Must provide projectName or projectId");if(e!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");e===void 0?l=(await this.readProject({projectName:n})).id:l=e,mI(l);let I=await this.caller.call(Wn(),`${this.apiUrl}/sessions/${l}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(I,`delete session ${l} (${n})`,!0)}async uploadCsv({csvFile:e,fileName:n,inputKeys:l,outputKeys:I,description:a,dataType:c,name:i}){let s=`${this.apiUrl}/datasets/upload`,r=new FormData;r.append("file",e,n),l.forEach(d=>{r.append("input_keys",d)}),I.forEach(d=>{r.append("output_keys",d)}),a&&r.append("description",a),c&&r.append("data_type",c),i&&r.append("name",i);let u=await this.caller.call(Wn(),s,{method:"POST",headers:this.headers,body:r,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(u,"upload CSV"),await u.json()}async createDataset(e,{description:n,dataType:l,inputsSchema:I,outputsSchema:a,metadata:c}={}){let i={name:e,description:n,extra:c?{metadata:c}:void 0};l&&(i.data_type=l),I&&(i.inputs_schema_definition=I),a&&(i.outputs_schema_definition=a);let s=await this.caller.call(Wn(),`${this.apiUrl}/datasets`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(s,"create dataset"),await s.json()}async readDataset({datasetId:e,datasetName:n}){let l="/datasets",I=new URLSearchParams({limit:"1"});if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(e!==void 0)mI(e),l+=`/${e}`;else if(n!==void 0)I.append("name",n);else throw new Error("Must provide datasetName or datasetId");let a=await this._get(l,I),c;if(Array.isArray(a)){if(a.length===0)throw new Error(`Dataset[id=${e}, name=${n}] not found`);c=a[0]}else c=a;return c}async hasDataset({datasetId:e,datasetName:n}){try{return await this.readDataset({datasetId:e,datasetName:n}),!0}catch(l){if(l instanceof Error&&l.message.toLocaleLowerCase().includes("not found"))return!1;throw l}}async diffDatasetVersions({datasetId:e,datasetName:n,fromVersion:l,toVersion:I}){let a=e;if(a===void 0&&n===void 0)throw new Error("Must provide either datasetName or datasetId");if(a!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");a===void 0&&(a=(await this.readDataset({datasetName:n})).id);let c=new URLSearchParams({from_version:typeof l=="string"?l:l.toISOString(),to_version:typeof I=="string"?I:I.toISOString()});return await this._get(`/datasets/${a}/versions/diff`,c)}async readDatasetOpenaiFinetuning({datasetId:e,datasetName:n}){let l="/datasets";if(e===void 0)if(n!==void 0)e=(await this.readDataset({datasetName:n})).id;else throw new Error("Must provide datasetName or datasetId");return(await(await this._getResponse(`${l}/${e}/openai_ft`)).text()).trim().split(` +`).map(i=>JSON.parse(i))}async*listDatasets({limit:e=100,offset:n=0,datasetIds:l,datasetName:I,datasetNameContains:a,metadata:c}={}){let i="/datasets",s=new URLSearchParams({limit:e.toString(),offset:n.toString()});if(l!==void 0)for(let r of l)s.append("id",r);I!==void 0&&s.append("name",I),a!==void 0&&s.append("name_contains",a),c!==void 0&&s.append("metadata",JSON.stringify(c));for await(let r of this._getPaginated(i,s))yield*r}async updateDataset(e){let{datasetId:n,datasetName:l,...I}=e;if(!n&&!l)throw new Error("Must provide either datasetName or datasetId");let a=n??(await this.readDataset({datasetName:l})).id;mI(a);let c=await this.caller.call(Wn(),`${this.apiUrl}/datasets/${a}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(I),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(c,"update dataset"),await c.json()}async deleteDataset({datasetId:e,datasetName:n}){let l="/datasets",I=e;if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(n!==void 0&&(I=(await this.readDataset({datasetName:n})).id),I!==void 0)mI(I),l+=`/${I}`;else throw new Error("Must provide datasetName or datasetId");let a=await this.caller.call(Wn(),this.apiUrl+l,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(a,`delete ${l}`),await a.json()}async indexDataset({datasetId:e,datasetName:n,tag:l}){let I=e;if(!I&&!n)throw new Error("Must provide either datasetName or datasetId");if(I&&n)throw new Error("Must provide either datasetName or datasetId, not both");I||(I=(await this.readDataset({datasetName:n})).id),mI(I);let a={tag:l},c=await this.caller.call(Wn(),`${this.apiUrl}/datasets/${I}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(a),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(c,"index dataset"),await c.json()}async similarExamples(e,n,l,{filter:I}={}){let a={limit:l,inputs:e};I!==void 0&&(a.filter=I),mI(n);let c=await this.caller.call(Wn(),`${this.apiUrl}/datasets/${n}/search`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(a),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(c,"fetch similar examples"),(await c.json()).examples}async createExample(e,n,{datasetId:l,datasetName:I,createdAt:a,exampleId:c,metadata:i,split:s,sourceRunId:r}){let u=l;if(u===void 0&&I===void 0)throw new Error("Must provide either datasetName or datasetId");if(u!==void 0&&I!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");u===void 0&&(u=(await this.readDataset({datasetName:I})).id);let d={dataset_id:u,inputs:e,outputs:n,created_at:(a||new Date)?.toISOString(),id:c,metadata:i,split:s,source_run_id:r},b=await this.caller.call(Wn(),`${this.apiUrl}/examples`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(d),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(b,"create example"),await b.json()}async createExamples(e){let{inputs:n,outputs:l,metadata:I,sourceRunIds:a,exampleIds:c,datasetId:i,datasetName:s}=e,r=i;if(r===void 0&&s===void 0)throw new Error("Must provide either datasetName or datasetId");if(r!==void 0&&s!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");r===void 0&&(r=(await this.readDataset({datasetName:s})).id);let u=n.map((b,h)=>({dataset_id:r,inputs:b,outputs:l?l[h]:void 0,metadata:I?I[h]:void 0,split:e.splits?e.splits[h]:void 0,id:c?c[h]:void 0,source_run_id:a?a[h]:void 0})),o=await this.caller.call(Wn(),`${this.apiUrl}/examples/bulk`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(u),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(o,"create examples"),await o.json()}async createLLMExample(e,n,l){return this.createExample({input:e},{output:n},l)}async createChatExample(e,n,l){let I=e.map(c=>QBe(c)?EBe(c):c),a=QBe(n)?EBe(n):n;return this.createExample({input:I},{output:a},l)}async readExample(e){mI(e);let n=`/examples/${e}`;return await this._get(n)}async*listExamples({datasetId:e,datasetName:n,exampleIds:l,asOf:I,splits:a,inlineS3Urls:c,metadata:i,limit:s,offset:r,filter:u}={}){let o;if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(e!==void 0)o=e;else if(n!==void 0)o=(await this.readDataset({datasetName:n})).id;else throw new Error("Must provide a datasetName or datasetId");let d=new URLSearchParams({dataset:o}),b=I?typeof I=="string"?I:I?.toISOString():void 0;b&&d.append("as_of",b);let h=c??!0;if(d.append("inline_s3_urls",h.toString()),l!==void 0)for(let N of l)d.append("id",N);if(a!==void 0)for(let N of a)d.append("splits",N);if(i!==void 0){let N=JSON.stringify(i);d.append("metadata",N)}s!==void 0&&d.append("limit",s.toString()),r!==void 0&&d.append("offset",r.toString()),u!==void 0&&d.append("filter",u);let Z=0;for await(let N of this._getPaginated("/examples",d)){for(let g of N)yield g,Z++;if(s!==void 0&&Z>=s)break}}async deleteExample(e){mI(e);let n=`/examples/${e}`,l=await this.caller.call(Wn(),this.apiUrl+n,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(l,`delete ${n}`),await l.json()}async updateExample(e,n){mI(e);let l=await this.caller.call(Wn(),`${this.apiUrl}/examples/${e}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(n),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(l,"update example"),await l.json()}async updateExamples(e){let n=await this.caller.call(Wn(),`${this.apiUrl}/examples/bulk`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(n,"update examples"),await n.json()}async listDatasetSplits({datasetId:e,datasetName:n,asOf:l}){let I;if(e===void 0&&n===void 0)throw new Error("Must provide dataset name or ID");if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");e===void 0?I=(await this.readDataset({datasetName:n})).id:I=e,mI(I);let a=new URLSearchParams,c=l?typeof l=="string"?l:l?.toISOString():void 0;return c&&a.append("as_of",c),await this._get(`/datasets/${I}/splits`,a)}async updateDatasetSplits({datasetId:e,datasetName:n,splitName:l,exampleIds:I,remove:a=!1}){let c;if(e===void 0&&n===void 0)throw new Error("Must provide dataset name or ID");if(e!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");e===void 0?c=(await this.readDataset({datasetName:n})).id:c=e,mI(c);let i={split_name:l,examples:I.map(r=>(mI(r),r)),remove:a},s=await this.caller.call(Wn(),`${this.apiUrl}/datasets/${c}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(s,"update dataset splits",!0)}async evaluateRun(e,n,{sourceInfo:l,loadChildRuns:I,referenceExample:a}={loadChildRuns:!1}){Jhe("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");let c;if(typeof e=="string")c=await this.readRun(e,{loadChildRuns:I});else if(typeof e=="object"&&"id"in e)c=e;else throw new Error(`Invalid run type: ${typeof e}`);c.reference_example_id!==null&&c.reference_example_id!==void 0&&(a=await this.readExample(c.reference_example_id));let i=await n.evaluateRun(c,a),[s,r]=await this._logEvaluationFeedback(i,c,l);return r[0]}async createFeedback(e,n,{score:l,value:I,correction:a,comment:c,sourceInfo:i,feedbackSourceType:s="api",sourceRunId:r,feedbackId:u,feedbackConfig:o,projectId:d,comparativeExperimentId:b}){if(!e&&!d)throw new Error("One of runId or projectId must be provided");if(e&&d)throw new Error("Only one of runId or projectId can be provided");let h={type:s??"api",metadata:i??{}};r!==void 0&&h?.metadata!==void 0&&!h.metadata.__run&&(h.metadata.__run={run_id:r}),h?.metadata!==void 0&&h.metadata.__run?.run_id!==void 0&&mI(h.metadata.__run.run_id);let Z={id:u??$n(),run_id:e,key:n,score:l,value:I,correction:a,comment:c,feedback_source:h,comparative_experiment_id:b,feedbackConfig:o,session_id:d},N=`${this.apiUrl}/feedback`,g=await this.caller.call(Wn(),N,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(Z),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(g,"create feedback",!0),Z}async updateFeedback(e,{score:n,value:l,correction:I,comment:a}){let c={};n!=null&&(c.score=n),l!=null&&(c.value=l),I!=null&&(c.correction=I),a!=null&&(c.comment=a),mI(e);let i=await this.caller.call(Wn(),`${this.apiUrl}/feedback/${e}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(c),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(i,"update feedback",!0)}async readFeedback(e){mI(e);let n=`/feedback/${e}`;return await this._get(n)}async deleteFeedback(e){mI(e);let n=`/feedback/${e}`,l=await this.caller.call(Wn(),this.apiUrl+n,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(l,`delete ${n}`),await l.json()}async*listFeedback({runIds:e,feedbackKeys:n,feedbackSourceTypes:l}={}){let I=new URLSearchParams;if(e&&I.append("run",e.join(",")),n)for(let a of n)I.append("key",a);if(l)for(let a of l)I.append("source",a);for await(let a of this._getPaginated("/feedback",I))yield*a}async createPresignedFeedbackToken(e,n,{expiration:l,feedbackConfig:I}={}){let a={run_id:e,feedback_key:n,feedback_config:I};return l?typeof l=="string"?a.expires_at=l:(l?.hours||l?.minutes||l?.days)&&(a.expires_in=l):a.expires_in={hours:3},await(await this.caller.call(Wn(),`${this.apiUrl}/feedback/tokens`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(a),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async createComparativeExperiment({name:e,experimentIds:n,referenceDatasetId:l,createdAt:I,description:a,metadata:c,id:i}){if(n.length===0)throw new Error("At least one experiment is required");if(l||(l=(await this.readProject({projectId:n[0]})).reference_dataset_id),!l==null)throw new Error("A reference dataset is required");let s={id:i,name:e,experiment_ids:n,reference_dataset_id:l,description:a,created_at:(I??new Date)?.toISOString(),extra:{}};return c&&(s.extra.metadata=c),await(await this.caller.call(Wn(),`${this.apiUrl}/datasets/comparative`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(s),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async*listPresignedFeedbackTokens(e){mI(e);let n=new URLSearchParams({run_id:e});for await(let l of this._getPaginated("/feedback/tokens",n))yield*l}_selectEvalResults(e){let n;return"results"in e?n=e.results:n=[e],n}async _logEvaluationFeedback(e,n,l){let I=this._selectEvalResults(e),a=[];for(let c of I){let i=l||{};c.evaluatorInfo&&(i={...c.evaluatorInfo,...i});let s=null;c.targetRunId?s=c.targetRunId:n&&(s=n.id),a.push(await this.createFeedback(s,c.key,{score:c.score,value:c.value,comment:c.comment,correction:c.correction,sourceInfo:i,sourceRunId:c.sourceRunId,feedbackConfig:c.feedbackConfig,feedbackSourceType:"model"}))}return[I,a]}async logEvaluationFeedback(e,n,l){let[I]=await this._logEvaluationFeedback(e,n,l);return I}async*listAnnotationQueues(e={}){let{queueIds:n,name:l,nameContains:I,limit:a}=e,c=new URLSearchParams;n&&n.forEach((s,r)=>{mI(s,`queueIds[${r}]`),c.append("ids",s)}),l&&c.append("name",l),I&&c.append("name_contains",I),c.append("limit",(a!==void 0?Math.min(a,100):100).toString());let i=0;for await(let s of this._getPaginated("/annotation-queues",c))if(yield*s,i++,a!==void 0&&i>=a)break}async createAnnotationQueue(e){let{name:n,description:l,queueId:I}=e,a={name:n,description:l,id:I||$n()},c=await this.caller.call(Wn(),`${this.apiUrl}/annotation-queues`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(Object.fromEntries(Object.entries(a).filter(([s,r])=>r!==void 0))),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(c,"create annotation queue"),await c.json()}async readAnnotationQueue(e){let n=await this.listAnnotationQueues({queueIds:[e]}).next();if(n.done)throw new Error(`Annotation queue with ID ${e} not found`);return n.value}async updateAnnotationQueue(e,n){let{name:l,description:I}=n,a=await this.caller.call(Wn(),`${this.apiUrl}/annotation-queues/${mI(e,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify({name:l,description:I}),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(a,"update annotation queue")}async deleteAnnotationQueue(e){let n=await this.caller.call(Wn(),`${this.apiUrl}/annotation-queues/${mI(e,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(n,"delete annotation queue")}async addRunsToAnnotationQueue(e,n){let l=await this.caller.call(Wn(),`${this.apiUrl}/annotation-queues/${mI(e,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(n.map((I,a)=>mI(I,`runIds[${a}]`).toString())),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(l,"add runs to annotation queue")}async getRunFromAnnotationQueue(e,n){let l=`/annotation-queues/${mI(e,"queueId")}/run`,I=await this.caller.call(Wn(),`${this.apiUrl}${l}/${n}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(I,"get run from annotation queue"),await I.json()}async _currentTenantIsOwner(e){let n=await this._getSettings();return e=="-"||n.tenant_handle===e}async _ownerConflictError(e,n){let l=await this._getSettings();return new Error(`Cannot ${e} for another tenant. + + Current tenant: ${l.tenant_handle} + + Requested tenant: ${n}`)}async _getLatestCommitHash(e){let n=await this.caller.call(Wn(),`${this.apiUrl}/commits/${e}/?limit=1&offset=0`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions}),l=await n.json();if(!n.ok){let I=typeof l.detail=="string"?l.detail:JSON.stringify(l.detail),a=new Error(`Error ${n.status}: ${n.statusText} +${I}`);throw a.statusCode=n.status,a}if(l.commits.length!==0)return l.commits[0].commit_hash}async _likeOrUnlikePrompt(e,n){let[l,I,a]=CF(e),c=await this.caller.call(Wn(),`${this.apiUrl}/likes/${l}/${I}`,{method:"POST",body:JSON.stringify({like:n}),headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(c,`${n?"like":"unlike"} prompt`),await c.json()}async _getPromptUrl(e){let[n,l,I]=CF(e);if(await this._currentTenantIsOwner(n)){let a=await this._getSettings();return I!=="latest"?`${this.getHostUrl()}/prompts/${l}/${I.substring(0,8)}?organizationId=${a.id}`:`${this.getHostUrl()}/prompts/${l}?organizationId=${a.id}`}else return I!=="latest"?`${this.getHostUrl()}/hub/${n}/${l}/${I.substring(0,8)}`:`${this.getHostUrl()}/hub/${n}/${l}`}async promptExists(e){return!!await this.getPrompt(e)}async likePrompt(e){return this._likeOrUnlikePrompt(e,!0)}async unlikePrompt(e){return this._likeOrUnlikePrompt(e,!1)}async*listCommits(e){for await(let n of this._getPaginated(`/commits/${e}/`,new URLSearchParams,l=>l.commits))yield*n}async*listPrompts(e){let n=new URLSearchParams;n.append("sort_field",e?.sortField??"updated_at"),n.append("sort_direction","desc"),n.append("is_archived",(!!e?.isArchived).toString()),e?.isPublic!==void 0&&n.append("is_public",e.isPublic.toString()),e?.query&&n.append("query",e.query);for await(let l of this._getPaginated("/repos",n,I=>I.repos))yield*l}async getPrompt(e){let[n,l,I]=CF(e),a=await this.caller.call(Wn(),`${this.apiUrl}/repos/${n}/${l}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});if(a.status===404)return null;await oI(a,"get prompt");let c=await a.json();return c.repo?c.repo:null}async createPrompt(e,n){let l=await this._getSettings();if(n?.isPublic&&!l.tenant_handle)throw new Error(`Cannot create a public prompt without first + + creating a LangChain Hub handle. + You can add a handle by creating a public prompt at: + + https://smith.langchain.com/prompts`);let[I,a,c]=CF(e);if(!await this._currentTenantIsOwner(I))throw await this._ownerConflictError("create a prompt",I);let i={repo_handle:a,...n?.description&&{description:n.description},...n?.readme&&{readme:n.readme},...n?.tags&&{tags:n.tags},is_public:!!n?.isPublic},s=await this.caller.call(Wn(),`${this.apiUrl}/repos/`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(s,"create prompt");let{repo:r}=await s.json();return r}async createCommit(e,n,l){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[I,a,c]=CF(e),i=l?.parentCommitHash==="latest"||!l?.parentCommitHash?await this._getLatestCommitHash(`${I}/${a}`):l?.parentCommitHash,s={manifest:JSON.parse(JSON.stringify(n)),parent_commit:i},r=await this.caller.call(Wn(),`${this.apiUrl}/commits/${I}/${a}`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify(s),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(r,"create commit");let u=await r.json();return this._getPromptUrl(`${I}/${a}${u.commit_hash?`:${u.commit_hash}`:""}`)}async updatePrompt(e,n){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[l,I]=CF(e);if(!await this._currentTenantIsOwner(l))throw await this._ownerConflictError("update a prompt",l);let a={};if(n?.description!==void 0&&(a.description=n.description),n?.readme!==void 0&&(a.readme=n.readme),n?.tags!==void 0&&(a.tags=n.tags),n?.isPublic!==void 0&&(a.is_public=n.isPublic),n?.isArchived!==void 0&&(a.is_archived=n.isArchived),Object.keys(a).length===0)throw new Error("No valid update options provided");let c=await this.caller.call(Wn(),`${this.apiUrl}/repos/${l}/${I}`,{method:"PATCH",body:JSON.stringify(a),headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await oI(c,"update prompt"),c.json()}async deletePrompt(e){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[n,l,I]=CF(e);if(!await this._currentTenantIsOwner(n))throw await this._ownerConflictError("delete a prompt",n);return await(await this.caller.call(Wn(),`${this.apiUrl}/repos/${n}/${l}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions})).json()}async pullPromptCommit(e,n){let[l,I,a]=CF(e),c=await this._getServerInfo(),i=Gln(c.version,"0.5.23"),s=a;if(!i&&a==="latest"){let o=await this._getLatestCommitHash(`${l}/${I}`);if(o)s=o;else throw new Error("No commits found")}let r=await this.caller.call(Wn(),`${this.apiUrl}/commits/${l}/${I}/${s}${n?.includeModel?"?include_model=true":""}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});await oI(r,"pull prompt commit");let u=await r.json();return{owner:l,repo:I,commit_hash:u.commit_hash,manifest:u.manifest,examples:u.examples}}async _pullPrompt(e,n){let l=await this.pullPromptCommit(e,{includeModel:n?.includeModel});return JSON.stringify(l.manifest)}async pushPrompt(e,n){return await this.promptExists(e)?n&&Object.keys(n).some(I=>I!=="object")&&await this.updatePrompt(e,{description:n?.description,readme:n?.readme,tags:n?.tags,isPublic:n?.isPublic}):await this.createPrompt(e,{description:n?.description,readme:n?.readme,tags:n?.tags,isPublic:n?.isPublic}),n?.object?await this.createCommit(e,n?.object,{parentCommitHash:n?.parentCommitHash}):await this._getPromptUrl(e)}async clonePublicDataset(e,n={}){let{sourceApiUrl:l=this.apiUrl,datasetName:I}=n,[a,c]=this.parseTokenOrUrl(e,l),i=new t({apiUrl:a,apiKey:"placeholder"}),s=await i.readSharedDataset(c),r=I||s.name;try{if(await this.hasDataset({datasetId:r})){console.log(`Dataset ${r} already exists in your tenant. Skipping.`);return}}catch{}let u=await i.listSharedExamples(c),o=await this.createDataset(r,{description:s.description,dataType:s.data_type||"kv",inputsSchema:s.inputs_schema_definition??void 0,outputsSchema:s.outputs_schema_definition??void 0});try{await this.createExamples({inputs:u.map(d=>d.inputs),outputs:u.flatMap(d=>d.outputs?[d.outputs]:[]),datasetId:o.id})}catch(d){throw console.error(`An error occurred while creating dataset ${r}. You should delete it manually.`),d}}parseTokenOrUrl(e,n,l=2,I="dataset"){try{return mI(e),[n,e]}catch{}try{let c=new URL(e).pathname.split("/").filter(i=>i!=="");if(c.length>=l){let i=c[c.length-l];return[n,i]}else throw new Error(`Invalid public ${I} URL: ${e}`)}catch{throw new Error(`Invalid public ${I} URL or token: ${e}`)}}awaitPendingTraceBatches(){return Promise.all(this.autoBatchQueue.items.map(({itemPromise:e})=>e))}}});var Lhe,khe=B(()=>{UBe();Ohe();Qhe();Lhe="0.1.68"});function xhe(){if(zBe===void 0){let t=OmI(),e=zmI();zBe={library:"langsmith",runtime:t,sdk:"langsmith-js",sdk_version:Lhe,...e}}return zBe}function Wln(){let t=UmI()||{},e={},n=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION"];for(let[l,I]of Object.entries(t))l.startsWith("LANGCHAIN_")&&typeof I=="string"&&!n.includes(l)&&!l.toLowerCase().includes("key")&&!l.toLowerCase().includes("secret")&&!l.toLowerCase().includes("token")&&(l==="LANGCHAIN_REVISION_ID"?e.revision_id=I:e[l]=I);return e}function UmI(){try{return typeof process<"u"&&process.env?Object.entries(process.env).reduce((t,[e,n])=>(t[e]=String(n),t),{}):void 0}catch{return}}function Ww(t){try{return typeof process<"u"?process.env?.[t]:void 0}catch{return}}function LF(t){return Ww(`LANGSMITH_${t}`)||Ww(`LANGCHAIN_${t}`)}function zmI(){if(BBe!==void 0)return BBe;let t=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],e={};for(let n of t){let l=Ww(n);l!==void 0&&(e[n]=l)}return BBe=e,e}var kF,LmI,kmI,xmI,Nln,jmI,OmI,zBe,BBe,jhe=B(()=>{khe();LmI=()=>typeof window<"u"&&typeof window.document<"u",kmI=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",xmI=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Nln=()=>typeof Deno<"u",jmI=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!Nln(),OmI=()=>kF||(LmI()?kF="browser":jmI()?kF="node":kmI()?kF="webworker":xmI()?kF="jsdom":Nln()?kF="deno":kF="other",kF)});var Vln,Yln=B(()=>{jhe();Vln=t=>t!==void 0?t:!!["TRACING_V2","TRACING"].find(n=>LF(n)==="true")});var Uhe,gln=B(()=>{Uhe=Symbol.for("lc:context_variables")});function BmI(t){return t.replace(/[-:.]/g,"")}function SmI(t,e,n=1){let l=n.toFixed(0).slice(0,3).padStart(3,"0");return BmI(`${new Date(t).toISOString().slice(0,-1)}${l}Z`)+e}function SBe(t){return t!==void 0&&typeof t.createChild=="function"&&typeof t.postRun=="function"}function yln(t){return typeof t=="object"&&t!=null&&typeof t.name=="string"&&t.name==="langchain_tracer"}function Rln(t){return Array.isArray(t)&&t.some(e=>yln(e))}function MmI(t){return typeof t=="object"&&t!=null&&Array.isArray(t.handlers)}function TmI(t){return t!==void 0&&typeof t.callbacks=="object"&&(Rln(t.callbacks?.handlers)||Rln(t.callbacks))}var zhe,Zw,Ohe=B(()=>{uG();jhe();UBe();Yln();JBe();gln();zhe=class t{constructor(e,n){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}),this.metadata=e,this.tags=n}static fromHeader(e){let n=e.split(","),l={},I=[];for(let a of n){let[c,i]=a.split("="),s=decodeURIComponent(i);c==="langsmith-metadata"?l=JSON.parse(s):c==="langsmith-tags"&&(I=s.split(","))}return new t(l,I)}toHeader(){let e=[];return this.metadata&&Object.keys(this.metadata).length>0&&e.push(`langsmith-metadata=${encodeURIComponent(JSON.stringify(this.metadata))}`),this.tags&&this.tags.length>0&&e.push(`langsmith-tags=${encodeURIComponent(this.tags.join(","))}`),e.join(",")}},Zw=class t{constructor(e){if(Object.defineProperty(this,"id",{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,"run_type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"project_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parent_run",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"start_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"end_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reference_example_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"trace_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dotted_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingEnabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),SBe(e)){Object.assign(this,{...e});return}let n=t.getDefaultConfig(),{metadata:l,...I}=e,a=I.client??t.getSharedClient(),c={...l,...I?.extra?.metadata};if(I.extra={...I.extra,metadata:c},Object.assign(this,{...n,...I,client:a}),this.trace_id||(this.parent_run?this.trace_id=this.parent_run.trace_id??this.id:this.trace_id=this.id),this.execution_order??=1,this.child_execution_order??=1,!this.dotted_order){let i=SmI(this.start_time,this.id,this.execution_order);this.parent_run?this.dotted_order=this.parent_run.dotted_order+"."+i:this.dotted_order=i}}static getDefaultConfig(){return{id:$n(),run_type:"chain",project_name:Ww("LANGCHAIN_PROJECT")??Ww("LANGCHAIN_SESSION")??"default",child_runs:[],api_url:Ww("LANGCHAIN_ENDPOINT")??"http://localhost:1984",api_key:Ww("LANGCHAIN_API_KEY"),caller_options:{},start_time:Date.now(),serialized:{},inputs:{},extra:{}}}static getSharedClient(){return t.sharedClient||(t.sharedClient=new FJ),t.sharedClient}createChild(e){let n=this.child_execution_order+1,l=new t({...e,parent_run:this,project_name:this.project_name,client:this.client,tracingEnabled:this.tracingEnabled,execution_order:n,child_execution_order:n});Uhe in this&&(l[Uhe]=this[Uhe]);let I=Symbol.for("lc:child_config"),a=e.extra?.[I]??this.extra[I];if(TmI(a)){let s={...a},r=MmI(s.callbacks)?s.callbacks.copy?.():void 0;r&&(Object.assign(r,{_parentRunId:l.id}),r.handlers?.find(yln)?.updateFromRunTree?.(l),s.callbacks=r),l.extra[I]=s}let c=new Set,i=this;for(;i!=null&&!c.has(i.id);)c.add(i.id),i.child_execution_order=Math.max(i.child_execution_order,n),i=i.parent_run;return this.child_runs.push(l),l}async end(e,n,l=Date.now(),I){this.outputs=this.outputs??e,this.error=this.error??n,this.end_time=this.end_time??l,I&&Object.keys(I).length>0&&(this.extra=this.extra?{...this.extra,metadata:{...this.extra.metadata,...I}}:{metadata:I})}_convertToCreate(e,n,l=!0){let I=e.extra??{};if(I.runtime||(I.runtime={}),n)for(let[s,r]of Object.entries(n))I.runtime[s]||(I.runtime[s]=r);let a,c;return l?(c=e.parent_run?.id,a=[]):(a=e.child_runs.map(s=>this._convertToCreate(s,n,l)),c=void 0),{id:e.id,name:e.name,start_time:e.start_time,end_time:e.end_time,run_type:e.run_type,reference_example_id:e.reference_example_id,extra:I,serialized:e.serialized,error:e.error,inputs:e.inputs,outputs:e.outputs,session_name:e.project_name,child_runs:a,parent_run_id:c,trace_id:e.trace_id,dotted_order:e.dotted_order,tags:e.tags}}async postRun(e=!0){try{let n=xhe(),l=await this._convertToCreate(this,n,!0);if(await this.client.createRun(l),!e){Jhe("Posting with excludeChildRuns=false is deprecated and will be removed in a future version.");for(let I of this.child_runs)await I.postRun(!1)}}catch(n){console.error(`Error in postRun for run ${this.id}:`,n)}}async patchRun(){try{let e={end_time:this.end_time,error:this.error,inputs:this.inputs,outputs:this.outputs,parent_run_id:this.parent_run?.id,reference_example_id:this.reference_example_id,extra:this.extra,events:this.events,dotted_order:this.dotted_order,trace_id:this.trace_id,tags:this.tags};await this.client.updateRun(this.id,e)}catch(e){console.error(`Error in patchRun for run ${this.id}`,e)}}toJSON(){return this._convertToCreate(this,void 0,!1)}static fromRunnableConfig(e,n){let l=e?.callbacks,I,a,c,i=Vln();if(l){let r=l?.getParentRunId?.()??"",u=l?.handlers?.find(o=>o?.name=="langchain_tracer");I=u?.getRun?.(r),a=u?.projectName,c=u?.client,i=i||!!u}return I?new t({name:I.name,id:I.id,trace_id:I.trace_id,dotted_order:I.dotted_order,client:c,tracingEnabled:i,project_name:a,tags:[...new Set((I?.tags??[]).concat(e?.tags??[]))],extra:{metadata:{...I?.extra?.metadata,...e?.metadata}}}).createChild(n):new t({...n,client:c,tracingEnabled:i,project_name:a})}static fromDottedOrder(e){return this.fromHeaders({"langsmith-trace":e})}static fromHeaders(e,n){let l="get"in e&&typeof e.get=="function"?{"langsmith-trace":e.get("langsmith-trace"),baggage:e.get("baggage")}:e,I=l["langsmith-trace"];if(!I||typeof I!="string")return;let a=I.trim(),c=a.split(".").map(r=>{let[u,o]=r.split("Z");return{strTime:u,time:Date.parse(u+"Z"),uuid:o}}),i=c[0].uuid,s={...n,name:n?.name??"parent",run_type:n?.run_type??"chain",start_time:n?.start_time??Date.now(),id:c.at(-1)?.uuid,trace_id:i,dotted_order:a};if(l.baggage&&typeof l.baggage=="string"){let r=zhe.fromHeader(l.baggage);s.metadata=r.metadata,s.tags=r.tags}return new t(s)}toHeaders(e){let n={"langsmith-trace":this.dotted_order,baggage:new zhe(this.extra?.metadata,this.tags).toHeader()};if(e)for(let[l,I]of Object.entries(n))e.set(l,I);return n}};Object.defineProperty(Zw,"sharedClient",{enumerable:!0,configurable:!0,writable:!0,value:null})});function Bhe(t){return typeof t=="function"&&"langsmith:traceable"in t}var TBe,MBe,DmI,DBe,KmI,Aln,Ksr,Fln=B(()=>{Ohe();TBe=class{getStore(){}run(e,n){return n()}},MBe=Symbol.for("ls:tracing_async_local_storage"),DmI=new TBe,DBe=class{getInstance(){return globalThis[MBe]??DmI}initializeGlobalInstance(e){globalThis[MBe]===void 0&&(globalThis[MBe]=e)}},KmI=new DBe,Aln=()=>{let t=KmI.getInstance().getStore();if(!SBe(t))throw new Error(["Could not get the current run tree.","","Please make sure you are calling this method within a traceable function or the tracing is enabled."].join(` +`));return t},Ksr=Symbol.for("langsmith:traceable:root")});var KBe=B(()=>{Fln()});function fln(t,e){return _mI.call(t,e)}function Xln(t){if(Array.isArray(t)){let n=new Array(t.length);for(let l=0;l=48&&l<=57){e++;continue}return!1}return!0}function The(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function QP(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function She(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(let n=0,l=t.length;n{_mI=Object.prototype.hasOwnProperty;vJ=class extends Error{constructor(e,n,l,I,a){super(vln(e,{name:n,index:l,operation:I,tree:a})),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"operation",{enumerable:!0,configurable:!0,writable:!0,value:I}),Object.defineProperty(this,"tree",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.setPrototypeOf(this,new.target.prototype),this.message=vln(e,{name:n,index:l,operation:I,tree:a})}}});var _Be={};Xe(_Be,{JsonPatchError:()=>Lo,_areEquals:()=>JP,applyOperation:()=>fJ,applyPatch:()=>XJ,applyReducer:()=>$mI,deepClone:()=>PmI,getValueByPointer:()=>Dhe,validate:()=>wln,validator:()=>Khe});function Dhe(t,e){if(e=="")return t;var n={op:"_get",path:e};return fJ(t,n),n.value}function fJ(t,e,n=!1,l=!0,I=!0,a=0){if(n&&(typeof n=="function"?n(e,0,t,e.path):Khe(e,0)),e.path===""){let c={newDocument:t};if(e.op==="add")return c.newDocument=e.value,c;if(e.op==="replace")return c.newDocument=e.value,c.removed=t,c;if(e.op==="move"||e.op==="copy")return c.newDocument=Dhe(t,e.from),e.op==="move"&&(c.removed=t),c;if(e.op==="test"){if(c.test=JP(t,e.value),c.test===!1)throw new Lo("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return c.newDocument=t,c}else{if(e.op==="remove")return c.removed=t,c.newDocument=null,c;if(e.op==="_get")return e.value=t,c;if(n)throw new Lo("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,e,t);return c}}else{l||(t=nN(t));let i=(e.path||"").split("/"),s=t,r=1,u=i.length,o,d,b;for(typeof n=="function"?b=n:b=Khe;;){if(d=i[r],d&&d.indexOf("~")!=-1&&(d=QP(d)),I&&(d=="__proto__"||d=="prototype"&&r>0&&i[r-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&o===void 0&&(s[d]===void 0?o=i.slice(0,r).join("/"):r==u-1&&(o=e.path),o!==void 0&&b(e,0,t,o)),r++,Array.isArray(s)){if(d==="-")d=s.length;else{if(n&&!Mhe(d))throw new Lo("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,e,t);Mhe(d)&&(d=~~d)}if(r>=u){if(n&&e.op==="add"&&d>s.length)throw new Lo("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,e,t);let h=qmI[e.op].call(e,s,d,t);if(h.test===!1)throw new Lo("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return h}}else if(r>=u){let h=vO[e.op].call(e,s,d,t);if(h.test===!1)throw new Lo("Test operation failed","TEST_OPERATION_FAILED",a,e,t);return h}if(s=s[d],n&&r0)throw new Lo('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Lo("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Lo("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&She(t.value))throw new Lo("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n){if(t.op=="add"){var I=t.path.split("/").length,a=l.split("/").length;if(I!==a+1&&I!==a)throw new Lo("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==l)throw new Lo("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if(t.op==="move"||t.op==="copy"){var c={op:"_get",path:t.from,value:void 0},i=wln([c],n);if(i&&i.name==="OPERATION_PATH_UNRESOLVABLE")throw new Lo("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}}else throw new Lo("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n)}function wln(t,e,n){try{if(!Array.isArray(t))throw new Lo("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)XJ(nN(e),nN(t),n||!0);else{n=n||Khe;for(var l=0;l{EP();Lo=vJ,PmI=nN,vO={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var l=t[e];return delete t[e],{newDocument:n,removed:l}},replace:function(t,e,n){var l=t[e];return t[e]=this.value,{newDocument:n,removed:l}},move:function(t,e,n){let l=Dhe(n,this.path);l&&(l=nN(l));let I=fJ(n,{op:"remove",path:this.from}).removed;return fJ(n,{op:"add",path:this.path,value:I}),{newDocument:n,removed:l}},copy:function(t,e,n){let l=Dhe(n,this.from);return fJ(n,{op:"add",path:this.path,value:nN(l)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:JP(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},qmI={add:function(t,e,n){return Mhe(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){var l=t.splice(e,1);return{newDocument:n,removed:l[0]}},replace:function(t,e,n){var l=t[e];return t[e]=this.value,{newDocument:n,removed:l}},move:vO.move,copy:vO.copy,test:vO.test,_get:vO._get}});var Hln=B(()=>{EP();_he();});var aur,Qln=B(()=>{_he();Hln();EP();_he();EP();aur={..._Be,JsonPatchError:vJ,deepClone:nN,escapePathComponent:The,unescapePathComponent:QP}});async function Jln(){return PBe===void 0&&(PBe={library:"langchain-js",runtime:IpI()}),PBe}function Hm(t){try{return typeof process<"u"?process.env?.[t]:void 0}catch{return}}var epI,tpI,npI,Eln,lpI,IpI,PBe,fO=B(()=>{epI=()=>typeof window<"u"&&typeof window.document<"u",tpI=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",npI=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Eln=()=>typeof Deno<"u",lpI=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!Eln(),IpI=()=>{let t;return epI()?t="browser":lpI()?t="node":tpI()?t="webworker":npI()?t="jsdom":Eln()?t="deno":t="other",t}});var qBe,wJ,$Be=B(()=>{uG();FP();fO();qBe=class{},wJ=class t extends qBe{get lc_namespace(){return["langchain_core","callbacks",this.name]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,XBe(this.constructor)]}constructor(e){super(),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}),Object.defineProperty(this,"ignoreLLM",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreChain",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreAgent",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreRetriever",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreCustomEvent",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"raiseError",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"awaitHandlers",{enumerable:!0,configurable:!0,writable:!0,value:Hm("LANGCHAIN_CALLBACKS_BACKGROUND")!=="true"}),this.lc_kwargs=e||{},e&&(this.ignoreLLM=e.ignoreLLM??this.ignoreLLM,this.ignoreChain=e.ignoreChain??this.ignoreChain,this.ignoreAgent=e.ignoreAgent??this.ignoreAgent,this.ignoreRetriever=e.ignoreRetriever??this.ignoreRetriever,this.ignoreCustomEvent=e.ignoreCustomEvent??this.ignoreCustomEvent,this.raiseError=e.raiseError??this.raiseError,this.awaitHandlers=this.raiseError||(e._awaitHandler??this.awaitHandlers))}copy(){return new this.constructor(this)}toJSON(){return qV.prototype.toJSON.call(this)}toJSONNotImplemented(){return qV.prototype.toJSONNotImplemented.call(this)}static fromMethods(e){class n extends t{constructor(){super(),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:$n()}),Object.assign(this,e)}}return new n}}});function eSe(t,e){return t&&!Array.isArray(t)&&typeof t=="object"?t:{[e]:t}}function apI(t){return t.replace(/[-:.]/g,"")}function rpI(t,e,n){let l=n.toFixed(0).slice(0,3).padStart(3,"0");return apI(`${new Date(t).toISOString().slice(0,-1)}${l}Z`)+e}function XO(t){return typeof t._addRunToRunMap=="function"}var lN,HJ=B(()=>{$Be();lN=class extends wJ{constructor(e){super(...arguments),Object.defineProperty(this,"runMap",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}copy(){return this}stringifyError(e){return e instanceof Error?e.message+(e?.stack?` + +${e.stack}`:""):typeof e=="string"?e:`${e}`}_addChildRun(e,n){e.child_runs.push(n)}_addRunToRunMap(e){let n=rpI(e.start_time,e.id,e.execution_order),l={...e};if(l.parent_run_id!==void 0){let I=this.runMap.get(l.parent_run_id);I&&(this._addChildRun(I,l),I.child_execution_order=Math.max(I.child_execution_order,l.child_execution_order),l.trace_id=I.trace_id,I.dotted_order!==void 0&&(l.dotted_order=[I.dotted_order,n].join(".")))}else l.trace_id=l.id,l.dotted_order=n;return this.runMap.set(l.id,l),l}async _endTrace(e){let n=e.parent_run_id!==void 0&&this.runMap.get(e.parent_run_id);n?n.child_execution_order=Math.max(n.child_execution_order,e.child_execution_order):await this.persistRun(e),this.runMap.delete(e.id),await this.onRunUpdate?.(e)}_getExecutionOrder(e){let n=e!==void 0&&this.runMap.get(e);return n?n.child_execution_order+1:1}_createRunForLLMStart(e,n,l,I,a,c,i,s){let r=this._getExecutionOrder(I),u=Date.now(),o=i?{...a,metadata:i}:a,d={id:l,name:s??e.id[e.id.length-1],parent_run_id:I,start_time:u,serialized:e,events:[{name:"start",time:new Date(u).toISOString()}],inputs:{prompts:n},execution_order:r,child_runs:[],child_execution_order:r,run_type:"llm",extra:o??{},tags:c||[]};return this._addRunToRunMap(d)}async handleLLMStart(e,n,l,I,a,c,i,s){let r=this.runMap.get(l)??this._createRunForLLMStart(e,n,l,I,a,c,i,s);return await this.onRunCreate?.(r),await this.onLLMStart?.(r),r}_createRunForChatModelStart(e,n,l,I,a,c,i,s){let r=this._getExecutionOrder(I),u=Date.now(),o=i?{...a,metadata:i}:a,d={id:l,name:s??e.id[e.id.length-1],parent_run_id:I,start_time:u,serialized:e,events:[{name:"start",time:new Date(u).toISOString()}],inputs:{messages:n},execution_order:r,child_runs:[],child_execution_order:r,run_type:"llm",extra:o??{},tags:c||[]};return this._addRunToRunMap(d)}async handleChatModelStart(e,n,l,I,a,c,i,s){let r=this.runMap.get(l)??this._createRunForChatModelStart(e,n,l,I,a,c,i,s);return await this.onRunCreate?.(r),await this.onLLMStart?.(r),r}async handleLLMEnd(e,n){let l=this.runMap.get(n);if(!l||l?.run_type!=="llm")throw new Error("No LLM run to end.");return l.end_time=Date.now(),l.outputs=e,l.events.push({name:"end",time:new Date(l.end_time).toISOString()}),await this.onLLMEnd?.(l),await this._endTrace(l),l}async handleLLMError(e,n){let l=this.runMap.get(n);if(!l||l?.run_type!=="llm")throw new Error("No LLM run to end.");return l.end_time=Date.now(),l.error=this.stringifyError(e),l.events.push({name:"error",time:new Date(l.end_time).toISOString()}),await this.onLLMError?.(l),await this._endTrace(l),l}_createRunForChainStart(e,n,l,I,a,c,i,s){let r=this._getExecutionOrder(I),u=Date.now(),o={id:l,name:s??e.id[e.id.length-1],parent_run_id:I,start_time:u,serialized:e,events:[{name:"start",time:new Date(u).toISOString()}],inputs:n,execution_order:r,child_execution_order:r,run_type:i??"chain",child_runs:[],extra:c?{metadata:c}:{},tags:a||[]};return this._addRunToRunMap(o)}async handleChainStart(e,n,l,I,a,c,i,s){let r=this.runMap.get(l)??this._createRunForChainStart(e,n,l,I,a,c,i,s);return await this.onRunCreate?.(r),await this.onChainStart?.(r),r}async handleChainEnd(e,n,l,I,a){let c=this.runMap.get(n);if(!c)throw new Error("No chain run to end.");return c.end_time=Date.now(),c.outputs=eSe(e,"output"),c.events.push({name:"end",time:new Date(c.end_time).toISOString()}),a?.inputs!==void 0&&(c.inputs=eSe(a.inputs,"input")),await this.onChainEnd?.(c),await this._endTrace(c),c}async handleChainError(e,n,l,I,a){let c=this.runMap.get(n);if(!c)throw new Error("No chain run to end.");return c.end_time=Date.now(),c.error=this.stringifyError(e),c.events.push({name:"error",time:new Date(c.end_time).toISOString()}),a?.inputs!==void 0&&(c.inputs=eSe(a.inputs,"input")),await this.onChainError?.(c),await this._endTrace(c),c}_createRunForToolStart(e,n,l,I,a,c,i){let s=this._getExecutionOrder(I),r=Date.now(),u={id:l,name:i??e.id[e.id.length-1],parent_run_id:I,start_time:r,serialized:e,events:[{name:"start",time:new Date(r).toISOString()}],inputs:{input:n},execution_order:s,child_execution_order:s,run_type:"tool",child_runs:[],extra:c?{metadata:c}:{},tags:a||[]};return this._addRunToRunMap(u)}async handleToolStart(e,n,l,I,a,c,i){let s=this.runMap.get(l)??this._createRunForToolStart(e,n,l,I,a,c,i);return await this.onRunCreate?.(s),await this.onToolStart?.(s),s}async handleToolEnd(e,n){let l=this.runMap.get(n);if(!l||l?.run_type!=="tool")throw new Error("No tool run to end");return l.end_time=Date.now(),l.outputs={output:e},l.events.push({name:"end",time:new Date(l.end_time).toISOString()}),await this.onToolEnd?.(l),await this._endTrace(l),l}async handleToolError(e,n){let l=this.runMap.get(n);if(!l||l?.run_type!=="tool")throw new Error("No tool run to end");return l.end_time=Date.now(),l.error=this.stringifyError(e),l.events.push({name:"error",time:new Date(l.end_time).toISOString()}),await this.onToolError?.(l),await this._endTrace(l),l}async handleAgentAction(e,n){let l=this.runMap.get(n);if(!l||l?.run_type!=="chain")return;let I=l;I.actions=I.actions||[],I.actions.push(e),I.events.push({name:"agent_action",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentAction?.(l)}async handleAgentEnd(e,n){let l=this.runMap.get(n);!l||l?.run_type!=="chain"||(l.events.push({name:"agent_end",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentEnd?.(l))}_createRunForRetrieverStart(e,n,l,I,a,c,i){let s=this._getExecutionOrder(I),r=Date.now(),u={id:l,name:i??e.id[e.id.length-1],parent_run_id:I,start_time:r,serialized:e,events:[{name:"start",time:new Date(r).toISOString()}],inputs:{query:n},execution_order:s,child_execution_order:s,run_type:"retriever",child_runs:[],extra:c?{metadata:c}:{},tags:a||[]};return this._addRunToRunMap(u)}async handleRetrieverStart(e,n,l,I,a,c,i){let s=this.runMap.get(l)??this._createRunForRetrieverStart(e,n,l,I,a,c,i);return await this.onRunCreate?.(s),await this.onRetrieverStart?.(s),s}async handleRetrieverEnd(e,n){let l=this.runMap.get(n);if(!l||l?.run_type!=="retriever")throw new Error("No retriever run to end");return l.end_time=Date.now(),l.outputs={documents:e},l.events.push({name:"end",time:new Date(l.end_time).toISOString()}),await this.onRetrieverEnd?.(l),await this._endTrace(l),l}async handleRetrieverError(e,n){let l=this.runMap.get(n);if(!l||l?.run_type!=="retriever")throw new Error("No retriever run to end");return l.end_time=Date.now(),l.error=this.stringifyError(e),l.events.push({name:"error",time:new Date(l.end_time).toISOString()}),await this.onRetrieverError?.(l),await this._endTrace(l),l}async handleText(e,n){let l=this.runMap.get(n);!l||l?.run_type!=="chain"||(l.events.push({name:"text",time:new Date().toISOString(),kwargs:{text:e}}),await this.onText?.(l))}async handleLLMNewToken(e,n,l,I,a,c){let i=this.runMap.get(l);if(!i||i?.run_type!=="llm")throw new Error('Invalid "runId" provided to "handleLLMNewToken" callback.');return i.events.push({name:"new_token",time:new Date().toISOString(),kwargs:{token:e,idx:n,chunk:c?.chunk}}),await this.onLLMNewToken?.(i,e,{chunk:c?.chunk}),i}}});var tSe=B(()=>{khe()});function Qm(t,e){return`${t.open}${e}${t.close}`}function IN(t,e){try{return JSON.stringify(t,null,2)}catch{return e}}function Cln(t){return typeof t=="string"?t.trim():t==null?t:IN(t,t.toString())}function Nw(t){if(!t.end_time)return"";let e=t.end_time-t.start_time;return e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}var nSe,Bp,CP,Lln=B(()=>{nSe=$(b0e(),1);HJ();({color:Bp}=nSe.default),CP=class extends lN{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"console_callback_handler"})}persistRun(e){return Promise.resolve()}getParents(e){let n=[],l=e;for(;l.parent_run_id;){let I=this.runMap.get(l.parent_run_id);if(I)n.push(I),l=I;else break}return n}getBreadcrumbs(e){let l=[...this.getParents(e).reverse(),e].map((I,a,c)=>{let i=`${I.execution_order}:${I.run_type}:${I.name}`;return a===c.length-1?Qm(nSe.default.bold,i):i}).join(" > ");return Qm(Bp.grey,l)}onChainStart(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.green,"[chain/start]")} [${n}] Entering Chain run with input: ${IN(e.inputs,"[inputs]")}`)}onChainEnd(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.cyan,"[chain/end]")} [${n}] [${Nw(e)}] Exiting Chain run with output: ${IN(e.outputs,"[outputs]")}`)}onChainError(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.red,"[chain/error]")} [${n}] [${Nw(e)}] Chain run errored with error: ${IN(e.error,"[error]")}`)}onLLMStart(e){let n=this.getBreadcrumbs(e),l="prompts"in e.inputs?{prompts:e.inputs.prompts.map(I=>I.trim())}:e.inputs;console.log(`${Qm(Bp.green,"[llm/start]")} [${n}] Entering LLM run with input: ${IN(l,"[inputs]")}`)}onLLMEnd(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.cyan,"[llm/end]")} [${n}] [${Nw(e)}] Exiting LLM run with output: ${IN(e.outputs,"[response]")}`)}onLLMError(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.red,"[llm/error]")} [${n}] [${Nw(e)}] LLM run errored with error: ${IN(e.error,"[error]")}`)}onToolStart(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.green,"[tool/start]")} [${n}] Entering Tool run with input: "${Cln(e.inputs.input)}"`)}onToolEnd(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.cyan,"[tool/end]")} [${n}] [${Nw(e)}] Exiting Tool run with output: "${Cln(e.outputs?.output)}"`)}onToolError(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.red,"[tool/error]")} [${n}] [${Nw(e)}] Tool run errored with error: ${IN(e.error,"[error]")}`)}onRetrieverStart(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.green,"[retriever/start]")} [${n}] Entering Retriever run with input: ${IN(e.inputs,"[inputs]")}`)}onRetrieverEnd(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.cyan,"[retriever/end]")} [${n}] [${Nw(e)}] Exiting Retriever run with output: ${IN(e.outputs,"[outputs]")}`)}onRetrieverError(e){let n=this.getBreadcrumbs(e);console.log(`${Qm(Bp.red,"[retriever/error]")} [${n}] [${Nw(e)}] Retriever run errored with error: ${IN(e.error,"[error]")}`)}onAgentAction(e){let n=e,l=this.getBreadcrumbs(e);console.log(`${Qm(Bp.blue,"[agent/action]")} [${l}] Agent selected action: ${IN(n.actions[n.actions.length-1],"[action]")}`)}}});var kln=B(()=>{Ohe()});var wO,xln=B(()=>{tSe();kln();KBe();fO();HJ();wO=class t extends lN{constructor(e={}){super(e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"langchain_tracer"}),Object.defineProperty(this,"projectName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let{exampleId:n,projectName:l,client:I}=e;this.projectName=l??Hm("LANGCHAIN_PROJECT")??Hm("LANGCHAIN_SESSION"),this.exampleId=n,this.client=I??new FJ({});let a=t.getTraceableRunTree();a&&this.updateFromRunTree(a)}async _convertToCreate(e,n=void 0){return{...e,extra:{...e.extra,runtime:await Jln()},child_runs:void 0,session_name:this.projectName,reference_example_id:e.parent_run_id?void 0:n}}async persistRun(e){}async onRunCreate(e){let n=await this._convertToCreate(e,this.exampleId);await this.client.createRun(n)}async onRunUpdate(e){let n={end_time:e.end_time,error:e.error,outputs:e.outputs,events:e.events,inputs:e.inputs,trace_id:e.trace_id,dotted_order:e.dotted_order,parent_run_id:e.parent_run_id};await this.client.updateRun(e.id,n)}getRun(e){return this.runMap.get(e)}updateFromRunTree(e){let n=e,l=new Set;for(;n.parent_run&&!(l.has(n.id)||(l.add(n.id),!n.parent_run));)n=n.parent_run;l.clear();let I=[n];for(;I.length>0;){let a=I.shift();!a||l.has(a.id)||(l.add(a.id),this.runMap.set(a.id,a),a.child_runs&&I.push(...a.child_runs))}this.client=e.client??this.client,this.projectName=e.project_name??this.projectName,this.exampleId=e.reference_example_id??this.exampleId}convertToRunTree(e){let n={},l=[];for(let[I,a]of this.runMap){let c=new Zw({...a,child_runs:[],parent_run:void 0,client:this.client,project_name:this.projectName,reference_example_id:this.exampleId,tracingEnabled:!0});n[I]=c,l.push([I,a.dotted_order])}l.sort((I,a)=>!I[1]||!a[1]?0:I[1].localeCompare(a[1]));for(let[I]of l){let a=this.runMap.get(I),c=n[I];if(!(!a||!c)&&a.parent_run_id){let i=n[a.parent_run_id];i&&(i.child_runs.push(c),c.parent_run=i)}}return n[e]}static getTraceableRunTree(){try{return Aln()}catch{return}}}});function cpI(){let t="default"in Phe.default?Phe.default.default:Phe.default;return new t({autoStart:!0,concurrency:1})}async function Ou(t,e){e===!0?await t():(typeof lSe>"u"&&(lSe=cpI()),lSe.add(t))}var Phe,lSe,jln=B(()=>{Phe=$(jH(),1)});var ISe,Oln=B(()=>{fO();ISe=t=>t!==void 0?t:!!["LANGSMITH_TRACING_V2","LANGCHAIN_TRACING_V2","LANGSMITH_TRACING","LANGCHAIN_TRACING"].find(n=>Hm(n)==="true")});function LP(t){return"name"in t?t:wJ.fromMethods(t)}var aSe,HO,rSe,qhe,cSe,oSe,xd,kP=B(()=>{uG();$Be();Lln();yJ();fO();xln();jln();Oln();HJ();ISe()&&Hm("LANGCHAIN_CALLBACKS_BACKGROUND")!=="true"&&["[WARN]: You have enabled LangSmith tracing without backgrounding callbacks.","[WARN]: If you are not using a serverless environment where you must wait for tracing calls to finish,",'[WARN]: we suggest setting "process.env.LANGCHAIN_CALLBACKS_BACKGROUND=true" to avoid additional latency.'].join(` +`);aSe=class{setHandler(e){return this.setHandlers([e])}},HO=class{constructor(e,n,l,I,a,c,i,s){Object.defineProperty(this,"runId",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"inheritableHandlers",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:I}),Object.defineProperty(this,"inheritableTags",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"inheritableMetadata",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_parentRunId",{enumerable:!0,configurable:!0,writable:!0,value:s})}get parentRunId(){return this._parentRunId}async handleText(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{try{await n.handleText?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleText: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}async handleCustomEvent(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Ou(async()=>{try{await c.handleCustomEvent?.(e,n,this.runId,this.tags,this.metadata)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleCustomEvent: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}},rSe=class extends HO{getChild(e){let n=new xd(this.runId);return n.setHandlers(this.inheritableHandlers),n.addTags(this.inheritableTags),n.addMetadata(this.inheritableMetadata),e&&n.addTags([e],!1),n}async handleRetrieverEnd(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreRetriever)try{await n.handleRetrieverEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleRetriever`),n.raiseError)throw l}},n.awaitHandlers)))}async handleRetrieverError(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreRetriever)try{await n.handleRetrieverError?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleRetrieverError: ${l}`),n.raiseError)throw e}},n.awaitHandlers)))}},qhe=class extends HO{async handleLLMNewToken(e,n,l,I,a,c){await Promise.all(this.handlers.map(i=>Ou(async()=>{if(!i.ignoreLLM)try{await i.handleLLMNewToken?.(e,n??{prompt:0,completion:0},this.runId,this._parentRunId,this.tags,c)}catch(s){if((i.raiseError?console.error:console.warn)(`Error in handler ${i.constructor.name}, handleLLMNewToken: ${s}`),i.raiseError)throw s}},i.awaitHandlers)))}async handleLLMError(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreLLM)try{await n.handleLLMError?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleLLMError: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}async handleLLMEnd(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreLLM)try{await n.handleLLMEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleLLMEnd: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}},cSe=class extends HO{getChild(e){let n=new xd(this.runId);return n.setHandlers(this.inheritableHandlers),n.addTags(this.inheritableTags),n.addMetadata(this.inheritableMetadata),e&&n.addTags([e],!1),n}async handleChainError(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Ou(async()=>{if(!c.ignoreChain)try{await c.handleChainError?.(e,this.runId,this._parentRunId,this.tags,a)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleChainError: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}async handleChainEnd(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Ou(async()=>{if(!c.ignoreChain)try{await c.handleChainEnd?.(e,this.runId,this._parentRunId,this.tags,a)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleChainEnd: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}async handleAgentAction(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreAgent)try{await n.handleAgentAction?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleAgentAction: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}async handleAgentEnd(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreAgent)try{await n.handleAgentEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleAgentEnd: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}},oSe=class extends HO{getChild(e){let n=new xd(this.runId);return n.setHandlers(this.inheritableHandlers),n.addTags(this.inheritableTags),n.addMetadata(this.inheritableMetadata),e&&n.addTags([e],!1),n}async handleToolError(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreAgent)try{await n.handleToolError?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleToolError: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}async handleToolEnd(e){await Promise.all(this.handlers.map(n=>Ou(async()=>{if(!n.ignoreAgent)try{await n.handleToolEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(l){if((n.raiseError?console.error:console.warn)(`Error in handler ${n.constructor.name}, handleToolEnd: ${l}`),n.raiseError)throw l}},n.awaitHandlers)))}},xd=class t extends aSe{constructor(e,n){super(),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"inheritableHandlers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"inheritableTags",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"inheritableMetadata",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"callback_manager"}),Object.defineProperty(this,"_parentRunId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.handlers=n?.handlers??this.handlers,this.inheritableHandlers=n?.inheritableHandlers??this.inheritableHandlers,this.tags=n?.tags??this.tags,this.inheritableTags=n?.inheritableTags??this.inheritableTags,this.metadata=n?.metadata??this.metadata,this.inheritableMetadata=n?.inheritableMetadata??this.inheritableMetadata,this._parentRunId=e}getParentRunId(){return this._parentRunId}async handleLLMStart(e,n,l=void 0,I=void 0,a=void 0,c=void 0,i=void 0,s=void 0){return Promise.all(n.map(async(r,u)=>{let o=u===0&&l?l:$n();return await Promise.all(this.handlers.map(d=>{if(!d.ignoreLLM)return XO(d)&&d._createRunForLLMStart(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s),Ou(async()=>{try{await d.handleLLMStart?.(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s)}catch(b){if((d.raiseError?console.error:console.warn)(`Error in handler ${d.constructor.name}, handleLLMStart: ${b}`),d.raiseError)throw b}},d.awaitHandlers)})),new qhe(o,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChatModelStart(e,n,l=void 0,I=void 0,a=void 0,c=void 0,i=void 0,s=void 0){return Promise.all(n.map(async(r,u)=>{let o=u===0&&l?l:$n();return await Promise.all(this.handlers.map(d=>{if(!d.ignoreLLM)return XO(d)&&d._createRunForChatModelStart(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s),Ou(async()=>{try{if(d.handleChatModelStart)await d.handleChatModelStart?.(e,[r],o,this._parentRunId,a,this.tags,this.metadata,s);else if(d.handleLLMStart){let b=AO(r);await d.handleLLMStart?.(e,[b],o,this._parentRunId,a,this.tags,this.metadata,s)}}catch(b){if((d.raiseError?console.error:console.warn)(`Error in handler ${d.constructor.name}, handleLLMStart: ${b}`),d.raiseError)throw b}},d.awaitHandlers)})),new qhe(o,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChainStart(e,n,l=$n(),I=void 0,a=void 0,c=void 0,i=void 0){return await Promise.all(this.handlers.map(s=>{if(!s.ignoreChain)return XO(s)&&s._createRunForChainStart(e,n,l,this._parentRunId,this.tags,this.metadata,I,i),Ou(async()=>{try{await s.handleChainStart?.(e,n,l,this._parentRunId,this.tags,this.metadata,I,i)}catch(r){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleChainStart: ${r}`),s.raiseError)throw r}},s.awaitHandlers)})),new cSe(l,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleToolStart(e,n,l=$n(),I=void 0,a=void 0,c=void 0,i=void 0){return await Promise.all(this.handlers.map(s=>{if(!s.ignoreAgent)return XO(s)&&s._createRunForToolStart(e,n,l,this._parentRunId,this.tags,this.metadata,i),Ou(async()=>{try{await s.handleToolStart?.(e,n,l,this._parentRunId,this.tags,this.metadata,i)}catch(r){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleToolStart: ${r}`),s.raiseError)throw r}},s.awaitHandlers)})),new oSe(l,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleRetrieverStart(e,n,l=$n(),I=void 0,a=void 0,c=void 0,i=void 0){return await Promise.all(this.handlers.map(s=>{if(!s.ignoreRetriever)return XO(s)&&s._createRunForRetrieverStart(e,n,l,this._parentRunId,this.tags,this.metadata,i),Ou(async()=>{try{await s.handleRetrieverStart?.(e,n,l,this._parentRunId,this.tags,this.metadata,i)}catch(r){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleRetrieverStart: ${r}`),s.raiseError)throw r}},s.awaitHandlers)})),new rSe(l,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleCustomEvent(e,n,l,I,a){await Promise.all(this.handlers.map(c=>Ou(async()=>{if(!c.ignoreCustomEvent)try{await c.handleCustomEvent?.(e,n,l,this.tags,this.metadata)}catch(i){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleCustomEvent: ${i}`),c.raiseError)throw i}},c.awaitHandlers)))}addHandler(e,n=!0){this.handlers.push(e),n&&this.inheritableHandlers.push(e)}removeHandler(e){this.handlers=this.handlers.filter(n=>n!==e),this.inheritableHandlers=this.inheritableHandlers.filter(n=>n!==e)}setHandlers(e,n=!0){this.handlers=[],this.inheritableHandlers=[];for(let l of e)this.addHandler(l,n)}addTags(e,n=!0){this.removeTags(e),this.tags.push(...e),n&&this.inheritableTags.push(...e)}removeTags(e){this.tags=this.tags.filter(n=>!e.includes(n)),this.inheritableTags=this.inheritableTags.filter(n=>!e.includes(n))}addMetadata(e,n=!0){this.metadata={...this.metadata,...e},n&&(this.inheritableMetadata={...this.inheritableMetadata,...e})}removeMetadata(e){for(let n of Object.keys(e))delete this.metadata[n],delete this.inheritableMetadata[n]}copy(e=[],n=!0){let l=new t(this._parentRunId);for(let I of this.handlers){let a=this.inheritableHandlers.includes(I);l.addHandler(I,a)}for(let I of this.tags){let a=this.inheritableTags.includes(I);l.addTags([I],a)}for(let I of Object.keys(this.metadata)){let a=Object.keys(this.inheritableMetadata).includes(I);l.addMetadata({[I]:this.metadata[I]},a)}for(let I of e)l.handlers.filter(a=>a.name==="console_callback_handler").some(a=>a.name===I.name)||l.addHandler(I,n);return l}static fromHandlers(e){class n extends wJ{constructor(){super(),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:$n()}),Object.assign(this,e)}}let l=new this;return l.addHandler(new n),l}static async configure(e,n,l,I,a,c,i){return this._configureSync(e,n,l,I,a,c,i)}static _configureSync(e,n,l,I,a,c,i){let s;(e||n)&&(Array.isArray(e)||!e?(s=new t,s.setHandlers(e?.map(LP)??[],!0)):s=e,s=s.copy(Array.isArray(n)?n.map(LP):n?.handlers,!1));let r=Hm("LANGCHAIN_VERBOSE")==="true"||i?.verbose,u=wO.getTraceableRunTree()?.tracingEnabled||ISe(),o=u||(Hm("LANGCHAIN_TRACING")??!1);if(r||o){if(s||(s=new t),r&&!s.handlers.some(d=>d.name===CP.prototype.name)){let d=new CP;s.addHandler(d,!0)}if(o&&!s.handlers.some(d=>d.name==="langchain_tracer")&&u){let d=new wO;s.addHandler(d,!0),s._parentRunId=wO.getTraceableRunTree()?.id??s._parentRunId}}return(l||I)&&s&&(s.addTags(l??[]),s.addTags(I??[],!1)),(a||c)&&s&&(s.addMetadata(a??{}),s.addMetadata(c??{},!1)),s}}});var sSe,opI,iSe,Uln,uSe,eY,xP=B(()=>{tSe();kP();sSe=class{getStore(){}run(e,n){return n()}},opI=new sSe,iSe=Symbol.for("ls:tracing_async_local_storage"),Uln=Symbol.for("lc:child_config"),uSe=class{getInstance(){return globalThis[iSe]??opI}getRunnableConfig(){return this.getInstance().getStore()?.extra?.[Uln]}runWithConfig(e,n,l){let I=xd._configureSync(e?.callbacks,void 0,e?.tags,void 0,e?.metadata),a=this.getInstance(),c=I?.getParentRunId(),i=I?.handlers?.find(r=>r?.name==="langchain_tracer"),s;return i&&c?s=i.convertToRunTree(c):l||(s=new Zw({name:"",tracingEnabled:!1})),s&&(s.extra={...s.extra,[Uln]:e}),a.run(s,n)}initializeGlobalInstance(e){globalThis[iSe]===void 0&&(globalThis[iSe]=e)}},eY=new uSe});async function wR(t,e){if(e===void 0)return t;let n;return Promise.race([t.catch(l=>{if(!e?.aborted)throw l}),new Promise((l,I)=>{n=()=>{I(new Error("Aborted"))},e.addEventListener("abort",n),e.aborted&&I(new Error("Aborted"))})]).finally(()=>e.removeEventListener("abort",n))}var dSe=B(()=>{});function GSe(t,e=2){let n=Array.from({length:e},()=>[]);return n.map(async function*(I){for(;;)if(I.length===0){let a=await t.next();for(let c of n)c.push(a)}else{if(I[0].done)return;yield I.shift().value}})}function jb(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.concat(e);if(typeof t=="string"&&typeof e=="string")return t+e;if(typeof t=="number"&&typeof e=="number")return t+e;if("concat"in t&&typeof t.concat=="function")return t.concat(e);if(typeof t=="object"&&typeof e=="object"){let n={...t};for(let[l,I]of Object.entries(e))l in n&&!Array.isArray(n[l])?n[l]=jb(n[l],I):n[l]=I;return n}else throw new Error(`Cannot concat ${typeof t} and ${typeof e}`)}async function zln(t,e,n,l,...I){let a=new xF({generator:e,startSetup:n,signal:l}),c=await a.setup;return{output:t(a,c,...I),setup:c}}var jd,xF,jF=B(()=>{xP();dSe();jd=class t extends ReadableStream{constructor(){super(...arguments),Object.defineProperty(this,"reader",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{let e=await this.reader.read();return e.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:e.value}}catch(e){throw this.reader.releaseLock(),e}}async return(){if(this.ensureReader(),this.locked){let e=this.reader.cancel();this.reader.releaseLock(),await e}return{done:!0,value:void 0}}async throw(e){if(this.ensureReader(),this.locked){let n=this.reader.cancel();this.reader.releaseLock(),await n}throw e}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(e){let n=e.getReader();return new t({start(l){return I();function I(){return n.read().then(({done:a,value:c})=>{if(a){l.close();return}return l.enqueue(c),I()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(e){return new t({async pull(n){let{value:l,done:I}=await e.next();I&&n.close(),n.enqueue(l)},async cancel(n){await e.return(n)}})}};xF=class{constructor(e){Object.defineProperty(this,"generator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"setup",{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,"signal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"firstResult",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"firstResultUsed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.generator=e.generator,this.config=e.config,this.signal=e.signal??this.config?.signal,this.setup=new Promise((n,l)=>{eY.runWithConfig(e.config,async()=>{this.firstResult=e.generator.next(),e.startSetup?this.firstResult.then(e.startSetup).then(n,l):this.firstResult.then(I=>n(void 0),l)},!0)})}async next(...e){return this.signal?.throwIfAborted(),this.firstResultUsed?eY.runWithConfig(this.config,this.signal?async()=>wR(this.generator.next(...e),this.signal):async()=>this.generator.next(...e),!0):(this.firstResultUsed=!0,this.firstResult)}async return(e){return this.generator.return(e)}async throw(e){return this.generator.throw(e)}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}}});async function Bln(t,e){if(e==="original")throw new Error("Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.");let{inputs:n}=t;if(["retriever","llm","prompt"].includes(t.run_type))return n;if(!(Object.keys(n).length===1&&n?.input===""))return n.input}async function Sln(t,e){let{outputs:n}=t;return e==="original"||["retriever","llm","prompt"].includes(t.run_type)?n:n!==void 0&&Object.keys(n).length===1&&n?.output!==void 0?n.output:n}function ipI(t){return t!==void 0&&t.message!==void 0}var tY,jP,QO,OP,$he=B(()=>{Qln();HJ();jF();RO();tY=class{constructor(e){Object.defineProperty(this,"ops",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ops=e.ops??[]}concat(e){let n=this.ops.concat(e.ops),l=XJ({},n);return new jP({ops:n,state:l[l.length-1].newDocument})}},jP=class t extends tY{constructor(e){super(e),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.state=e.state}concat(e){let n=this.ops.concat(e.ops),l=XJ(this.state,e.ops);return new t({ops:n,state:l[l.length-1].newDocument})}static fromRunLogPatch(e){let n=XJ({},e.ops);return new t({ops:e.ops,state:n[n.length-1].newDocument})}},QO=t=>t.name==="log_stream_tracer";OP=class extends lN{constructor(e){super({_awaitHandler:!0,...e}),Object.defineProperty(this,"autoClose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"includeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_schemaFormat",{enumerable:!0,configurable:!0,writable:!0,value:"original"}),Object.defineProperty(this,"rootId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyMapByRunId",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"counterMapByRunName",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"transformStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"receiveStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"log_stream_tracer"}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this._schemaFormat=e?._schemaFormat??this._schemaFormat,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=jd.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){if(e.id===this.rootId)return!1;let n=e.tags??[],l=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(l=l||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(l=l||this.includeTypes.includes(e.run_type)),this.includeTags!==void 0&&(l=l||n.find(I=>this.includeTags?.includes(I))!==void 0),this.excludeNames!==void 0&&(l=l&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(l=l&&!this.excludeTypes.includes(e.run_type)),this.excludeTags!==void 0&&(l=l&&n.every(I=>!this.excludeTags?.includes(I))),l}async*tapOutputIterable(e,n){for await(let l of n){if(e!==this.rootId){let I=this.keyMapByRunId[e];I&&await this.writer.write(new tY({ops:[{op:"add",path:`/logs/${I}/streamed_output/-`,value:l}]}))}yield l}}async onRunCreate(e){if(this.rootId===void 0&&(this.rootId=e.id,await this.writer.write(new tY({ops:[{op:"replace",path:"",value:{id:e.id,name:e.name,type:e.run_type,streamed_output:[],final_output:void 0,logs:{}}}]}))),!this._includeRun(e))return;this.counterMapByRunName[e.name]===void 0&&(this.counterMapByRunName[e.name]=0),this.counterMapByRunName[e.name]+=1;let n=this.counterMapByRunName[e.name];this.keyMapByRunId[e.id]=n===1?e.name:`${e.name}:${n}`;let l={id:e.id,name:e.name,type:e.run_type,tags:e.tags??[],metadata:e.extra?.metadata??{},start_time:new Date(e.start_time).toISOString(),streamed_output:[],streamed_output_str:[],final_output:void 0,end_time:void 0};this._schemaFormat==="streaming_events"&&(l.inputs=await Bln(e,this._schemaFormat)),await this.writer.write(new tY({ops:[{op:"add",path:`/logs/${this.keyMapByRunId[e.id]}`,value:l}]}))}async onRunUpdate(e){try{let n=this.keyMapByRunId[e.id];if(n===void 0)return;let l=[];this._schemaFormat==="streaming_events"&&l.push({op:"replace",path:`/logs/${n}/inputs`,value:await Bln(e,this._schemaFormat)}),l.push({op:"add",path:`/logs/${n}/final_output`,value:await Sln(e,this._schemaFormat)}),e.end_time!==void 0&&l.push({op:"add",path:`/logs/${n}/end_time`,value:new Date(e.end_time).toISOString()});let I=new tY({ops:l});await this.writer.write(I)}finally{if(e.id===this.rootId){let n=new tY({ops:[{op:"replace",path:"/final_output",value:await Sln(e,this._schemaFormat)}]});await this.writer.write(n),this.autoClose&&await this.writer.close()}}}async onLLMNewToken(e,n,l){let I=this.keyMapByRunId[e.id];if(I===void 0)return;let a=e.inputs.messages!==void 0,c;a?ipI(l?.chunk)?c=l?.chunk:c=new hw({id:`run-${e.id}`,content:n}):c=n;let i=new tY({ops:[{op:"add",path:`/logs/${I}/streamed_output_str/-`,value:n},{op:"add",path:`/logs/${I}/streamed_output/-`,value:c}]});await this.writer.write(i)}}});var EO,cZ,UP=B(()=>{EO="__run",cZ=class t{constructor(e){Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generationInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.text=e.text,this.generationInfo=e.generationInfo}concat(e){return new t({text:this.text+e.text,generationInfo:{...this.generationInfo,...e.generationInfo}})}}});function eZe({name:t,serialized:e}){return t!==void 0?t:e?.name!==void 0?e.name:e?.id!==void 0&&Array.isArray(e?.id)?e.id[e.id.length-1]:"Unnamed"}var JO,tZe,nZe=B(()=>{HJ();jF();RO();UP();JO=t=>t.name==="event_stream_tracer",tZe=class extends lN{constructor(e){super({_awaitHandler:!0,...e}),Object.defineProperty(this,"autoClose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"includeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runInfoMap",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"tappedPromises",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"transformStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"receiveStream",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"event_stream_tracer"}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=jd.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){let n=e.tags??[],l=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(l=l||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(l=l||this.includeTypes.includes(e.runType)),this.includeTags!==void 0&&(l=l||n.find(I=>this.includeTags?.includes(I))!==void 0),this.excludeNames!==void 0&&(l=l&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(l=l&&!this.excludeTypes.includes(e.runType)),this.excludeTags!==void 0&&(l=l&&n.every(I=>!this.excludeTags?.includes(I))),l}async*tapOutputIterable(e,n){let l=await n.next();if(l.done)return;let I=this.runInfoMap.get(e);if(I===void 0){yield l.value;return}function a(i,s){return i==="llm"&&typeof s=="string"?new cZ({text:s}):s}let c=this.tappedPromises.get(e);if(c===void 0){let i;c=new Promise(s=>{i=s}),this.tappedPromises.set(e,c);try{let s={event:`on_${I.runType}_stream`,run_id:e,name:I.name,tags:I.tags,metadata:I.metadata,data:{}};await this.send({...s,data:{chunk:a(I.runType,l.value)}},I),yield l.value;for await(let r of n)I.runType!=="tool"&&I.runType!=="retriever"&&await this.send({...s,data:{chunk:a(I.runType,r)}},I),yield r}finally{i()}}else{yield l.value;for await(let i of n)yield i}}async send(e,n){this._includeRun(n)&&await this.writer.write(e)}async sendEndEvent(e,n){let l=this.tappedPromises.get(e.run_id);l!==void 0?l.then(()=>{this.send(e,n)}):await this.send(e,n)}async onLLMStart(e){let n=eZe(e),l=e.inputs.messages!==void 0?"chat_model":"llm",I={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:l,inputs:e.inputs};this.runInfoMap.set(e.id,I);let a=`on_${l}_start`;await this.send({event:a,data:{input:e.inputs},name:n,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},I)}async onLLMNewToken(e,n,l){let I=this.runInfoMap.get(e.id),a,c;if(I===void 0)throw new Error(`onLLMNewToken: Run ID ${e.id} not found in run map.`);if(this.runInfoMap.size!==1){if(I.runType==="chat_model")c="on_chat_model_stream",l?.chunk===void 0?a=new hw({content:n,id:`run-${e.id}`}):a=l.chunk.message;else if(I.runType==="llm")c="on_llm_stream",l?.chunk===void 0?a=new cZ({text:n}):a=l.chunk;else throw new Error(`Unexpected run type ${I.runType}`);await this.send({event:c,data:{chunk:a},run_id:e.id,name:I.name,tags:I.tags,metadata:I.metadata},I)}}async onLLMEnd(e){let n=this.runInfoMap.get(e.id);this.runInfoMap.delete(e.id);let l;if(n===void 0)throw new Error(`onLLMEnd: Run ID ${e.id} not found in run map.`);let I=e.outputs?.generations,a;if(n.runType==="chat_model"){for(let c of I??[]){if(a!==void 0)break;a=c[0]?.message}l="on_chat_model_end"}else if(n.runType==="llm")a={generations:I?.map(c=>c.map(i=>({text:i.text,generationInfo:i.generationInfo}))),llmOutput:e.outputs?.llmOutput??{}},l="on_llm_end";else throw new Error(`onLLMEnd: Unexpected run type: ${n.runType}`);await this.sendEndEvent({event:l,data:{output:a,input:n.inputs},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}async onChainStart(e){let n=eZe(e),l=e.run_type??"chain",I={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:e.run_type},a={};e.inputs.input===""&&Object.keys(e.inputs).length===1?(a={},I.inputs={}):e.inputs.input!==void 0?(a.input=e.inputs.input,I.inputs=e.inputs.input):(a.input=e.inputs,I.inputs=e.inputs),this.runInfoMap.set(e.id,I),await this.send({event:`on_${l}_start`,data:a,name:n,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},I)}async onChainEnd(e){let n=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),n===void 0)throw new Error(`onChainEnd: Run ID ${e.id} not found in run map.`);let l=`on_${e.run_type}_end`,I=e.inputs??n.inputs??{},c={output:e.outputs?.output??e.outputs,input:I};I.input&&Object.keys(I).length===1&&(c.input=I.input,n.inputs=I.input),await this.sendEndEvent({event:l,data:c,run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata??{}},n)}async onToolStart(e){let n=eZe(e),l={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:"tool",inputs:e.inputs??{}};this.runInfoMap.set(e.id,l),await this.send({event:"on_tool_start",data:{input:e.inputs??{}},name:n,run_id:e.id,tags:e.tags??[],metadata:e.extra?.metadata??{}},l)}async onToolEnd(e){let n=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),n===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(n.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);let l=e.outputs?.output===void 0?e.outputs:e.outputs.output;await this.sendEndEvent({event:"on_tool_end",data:{output:l,input:n.inputs},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}async onRetrieverStart(e){let n=eZe(e),I={tags:e.tags??[],metadata:e.extra?.metadata??{},name:n,runType:"retriever",inputs:{query:e.inputs.query}};this.runInfoMap.set(e.id,I),await this.send({event:"on_retriever_start",data:{input:{query:e.inputs.query}},name:n,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},I)}async onRetrieverEnd(e){let n=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),n===void 0)throw new Error(`onRetrieverEnd: Run ID ${e.id} not found in run map.`);await this.sendEndEvent({event:"on_retriever_end",data:{output:e.outputs?.documents??e.outputs,input:n.inputs},run_id:e.id,name:n.name,tags:n.tags,metadata:n.metadata},n)}async handleCustomEvent(e,n,l){let I=this.runInfoMap.get(l);if(I===void 0)throw new Error(`handleCustomEvent: Run ID ${l} not found in run map.`);await this.send({event:"on_custom_event",run_id:l,name:e,tags:I.tags,metadata:I.metadata,data:n},I)}async finish(){let e=[...this.tappedPromises.values()];Promise.all(e).finally(()=>{this.writer.close()})}}});async function aN(t){return xd._configureSync(t?.callbacks,void 0,t?.tags,void 0,t?.metadata)}function bSe(...t){let e={};for(let n of t.filter(l=>!!l))for(let l of Object.keys(n))if(l==="metadata")e[l]={...e[l],...n[l]};else if(l==="tags"){let I=e[l]??[];e[l]=[...new Set(I.concat(n[l]??[]))]}else if(l==="configurable")e[l]={...e[l],...n[l]};else if(l==="timeout")e.timeout===void 0?e.timeout=n.timeout:n.timeout!==void 0&&(e.timeout=Math.min(e.timeout,n.timeout));else if(l==="signal")e.signal===void 0?e.signal=n.signal:n.signal!==void 0&&("any"in AbortSignal?e.signal=AbortSignal.any([e.signal,n.signal]):e.signal=n.signal);else if(l==="callbacks"){let I=e.callbacks,a=n.callbacks;if(Array.isArray(a))if(!I)e.callbacks=a;else if(Array.isArray(I))e.callbacks=I.concat(a);else{let c=I.copy();for(let i of a)c.addHandler(LP(i),!0);e.callbacks=c}else if(a)if(!I)e.callbacks=a;else if(Array.isArray(I)){let c=a.copy();for(let i of I)c.addHandler(LP(i),!0);e.callbacks=c}else e.callbacks=new xd(a._parentRunId,{handlers:I.handlers.concat(a.handlers),inheritableHandlers:I.inheritableHandlers.concat(a.inheritableHandlers),tags:Array.from(new Set(I.tags.concat(a.tags))),inheritableTags:Array.from(new Set(I.inheritableTags.concat(a.inheritableTags))),metadata:{...I.metadata,...a.metadata}})}else{let I=l;e[I]=n[I]??e[I]}return e}function dr(t){let e=eY.getRunnableConfig(),n={tags:[],metadata:{},recursionLimit:25,runId:void 0};if(e){let{runId:l,runName:I,...a}=e;n=Object.entries(a).reduce((c,[i,s])=>(s!==void 0&&(c[i]=s),c),n)}if(t&&(n=Object.entries(t).reduce((l,[I,a])=>(a!==void 0&&(l[I]=a),l),n)),n?.configurable)for(let l of Object.keys(n.configurable))spI.has(typeof n.configurable[l])&&!n.metadata?.[l]&&(n.metadata||(n.metadata={}),n.metadata[l]=n.configurable[l]);if(n.timeout!==void 0){if(n.timeout<=0)throw new Error("Timeout must be a positive number");let l=AbortSignal.timeout(n.timeout);n.signal!==void 0?"any"in AbortSignal&&(n.signal=AbortSignal.any([n.signal,l])):n.signal=l,delete n.timeout}return n}function LG(t={},{callbacks:e,maxConcurrency:n,recursionLimit:l,runName:I,configurable:a,runId:c}={}){let i=dr(t);return e!==void 0&&(delete i.runName,i.callbacks=e),l!==void 0&&(i.recursionLimit=l),n!==void 0&&(i.maxConcurrency=n),I!==void 0&&(i.runName=I),a!==void 0&&(i.configurable={...i.configurable,...a}),c!==void 0&&delete i.runId,i}var lZe,spI,mSe=B(()=>{kP();xP();lZe=25;spI=new Set(["string","number","boolean"])});var Mln,IZe,upI,dpI,Vw,aZe=B(()=>{Mln=$(CH(),1),IZe=$(jH(),1),upI=[400,401,402,403,404,405,406,407,409],dpI=t=>{if(t.message.startsWith("Cancel")||t.message.startsWith("AbortError")||t.name==="AbortError"||t?.code==="ECONNABORTED")throw t;let e=t?.response?.status??t?.status;if(e&&upI.includes(+e))throw t;if(t?.error?.code==="insufficient_quota"){let n=new Error(t?.message);throw n.name="InsufficientQuotaError",n}},Vw=class{constructor(e){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedAttempt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,this.onFailedAttempt=e.onFailedAttempt??dpI;let n="default"in IZe.default?IZe.default.default:IZe.default;this.queue=new n({concurrency:this.maxConcurrency})}call(e,...n){return this.queue.add(()=>(0,Mln.default)(()=>e(...n).catch(l=>{throw l instanceof Error?l:new Error(l)}),{onFailedAttempt:this.onFailedAttempt,retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,n,...l){return e.signal?Promise.race([this.call(n,...l),new Promise((I,a)=>{e.signal?.addEventListener("abort",()=>{a(new Error("AbortError"))})})]):this.call(n,...l)}fetch(...e){return this.call(()=>fetch(...e).then(n=>n.ok?n:Promise.reject(n)))}}});var zP,Tln=B(()=>{HJ();zP=class extends lN{constructor({config:e,onStart:n,onEnd:l,onError:I}){super({_awaitHandler:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RootListenersTracer"}),Object.defineProperty(this,"rootId",{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,"argOnStart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"argOnEnd",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"argOnError",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.config=e,this.argOnStart=n,this.argOnEnd=l,this.argOnError=I}persistRun(e){return Promise.resolve()}async onRunCreate(e){this.rootId||(this.rootId=e.id,this.argOnStart&&(this.argOnStart.length===1?await this.argOnStart(e):this.argOnStart.length===2&&await this.argOnStart(e,this.config)))}async onRunUpdate(e){e.id===this.rootId&&(e.error?this.argOnError&&(this.argOnError.length===1?await this.argOnError(e):this.argOnError.length===2&&await this.argOnError(e,this.config)):this.argOnEnd&&(this.argOnEnd.length===1?await this.argOnEnd(e):this.argOnEnd.length===2&&await this.argOnEnd(e,this.config)))}}});function BP(t){return t?t.lc_runnable:!1}var rZe,pSe=B(()=>{rZe=class{constructor(e){Object.defineProperty(this,"includeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"excludeTags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.includeNames=e.includeNames,this.includeTypes=e.includeTypes,this.includeTags=e.includeTags,this.excludeNames=e.excludeNames,this.excludeTypes=e.excludeTypes,this.excludeTags=e.excludeTags}includeEvent(e,n){let l=this.includeNames===void 0&&this.includeTypes===void 0&&this.includeTags===void 0,I=e.tags??[];return this.includeNames!==void 0&&(l=l||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(l=l||this.includeTypes.includes(n)),this.includeTags!==void 0&&(l=l||I.some(a=>this.includeTags?.includes(a))),this.excludeNames!==void 0&&(l=l&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(l=l&&!this.excludeTypes.includes(n)),this.excludeTags!==void 0&&(l=l&&I.every(a=>!this.excludeTags?.includes(a))),l}}});function hSe(t){return t.replace(/[^a-zA-Z-_0-9]/g,"_")}function GpI(t,e){let n=e[t.source]??t.source,l=e[t.target]??t.target;return[n,l]}function bpI(t){let e="";for(let[n,l]of Object.entries(t))e+=` classDef ${n}class fill:${l}; +`;return e}function Dln(t,e,n){let{firstNodeLabel:l,lastNodeLabel:I,nodeColors:a,withStyles:c=!0,curveStyle:i="linear",wrapLabelNWords:s=9}=n??{},r=c?`%%{init: {'flowchart': {'curve': '${i}'}}}%% +graph TD; +`:`graph TD; +`;if(c){let o="default",d={[o]:"{0}([{1}]):::otherclass"};l!==void 0&&(d[l]="{0}[{0}]:::startclass"),I!==void 0&&(d[I]="{0}[{0}]:::endclass");for(let b of Object.values(t)){let h=d[b]??d[o],Z=hSe(b),N=b.split(":"),g=N[N.length-1];r+=` ${h.replace(/\{0\}/g,Z).replace(/\{1\}/g,g)}; +`}}let u="";for(let o of e){let d=o.source.includes(":")?o.source.split(":")[0]:void 0,b=o.target.includes(":")?o.target.split(":")[0]:void 0;u!==""&&(u!==d||u!==b)&&(r+=` end +`,u=""),u===""&&d!==void 0&&d===b&&(r=` subgraph ${d} +`,u=d);let[h,Z]=GpI(o,t),N="";if(o.data!==void 0){let g=o.data,y=g.split(" ");y.length>s&&(g=y.reduce((X,v,H)=>(H%s===0&&X.push(""),X[X.length-1]+=` ${v}`,X),[]).join("
")),o.conditional?N=` -. ${g} .-> `:N=` -- ${g} --> `}else o.conditional?N=" -.-> ":N=" --> ";r+=` ${hSe(h)}${N}${hSe(Z)}; +`}return u!==""&&(r+=`end +`),c&&a!==void 0&&(r+=bpI(a)),r}async function Kln(t,e){let{backgroundColor:n="white"}=e??{},l=btoa(t);n!==void 0&&(/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(n)||(n=`!${n}`));let I=`https://mermaid.ink/img/${l}?bgColor=${n}`,a=await fetch(I);if(!a.ok)throw new Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${a.status}`,`Status text: ${a.statusText}`].join(` +`));return await a.blob()}var _ln=B(()=>{});function ZSe(t){if(zm(t.id))if(BP(t.data))try{let e=t.data.getName();return e=e.startsWith("Runnable")?e.slice(8):e,e.length>Pln&&(e=`${e.substring(0,Pln)}...`),e}catch{return t.data.getName()}else return t.data.name??"UnknownSchema";else return t.id}function mpI(t){return BP(t.data)?{type:"runnable",data:{id:t.data.lc_id,name:t.data.getName()}}:{type:"schema",data:{...JN(t.data.schema),title:t.data.name}}}var Pln,SP,qln=B(()=>{v5();uG();pSe();_ln();Pln=42;SP=class{constructor(){Object.defineProperty(this,"nodes",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"edges",{enumerable:!0,configurable:!0,writable:!0,value:[]})}toJSON(){let e={};return Object.values(this.nodes).forEach((n,l)=>{e[n.id]=zm(n.id)?l:n.id}),{nodes:Object.values(this.nodes).map(n=>({id:e[n.id],...mpI(n)})),edges:this.edges.map(n=>{let l={source:e[n.source],target:e[n.target]};return typeof n.data<"u"&&(l.data=n.data),typeof n.conditional<"u"&&(l.conditional=n.conditional),l})}}addNode(e,n){if(n!==void 0&&this.nodes[n]!==void 0)throw new Error(`Node with id ${n} already exists`);let l=n||$n(),I={id:l,data:e};return this.nodes[l]=I,I}removeNode(e){delete this.nodes[e.id],this.edges=this.edges.filter(n=>n.source!==e.id&&n.target!==e.id)}addEdge(e,n,l,I){if(this.nodes[e.id]===void 0)throw new Error(`Source node ${e.id} not in graph`);if(this.nodes[n.id]===void 0)throw new Error(`Target node ${n.id} not in graph`);let a={source:e.id,target:n.id,data:l,conditional:I};return this.edges.push(a),a}firstNode(){let e=new Set(this.edges.map(l=>l.target)),n=[];return Object.values(this.nodes).forEach(l=>{e.has(l.id)||n.push(l)}),n[0]}lastNode(){let e=new Set(this.edges.map(l=>l.source)),n=[];return Object.values(this.nodes).forEach(l=>{e.has(l.id)||n.push(l)}),n[0]}extend(e,n=""){let l=n;Object.values(e.nodes).map(r=>r.id).every(zm)&&(l="");let a=r=>l?`${l}:${r}`:r;Object.entries(e.nodes).forEach(([r,u])=>{this.nodes[a(r)]={...u,id:a(r)}});let c=e.edges.map(r=>({...r,source:a(r.source),target:a(r.target)}));this.edges=[...this.edges,...c];let i=e.firstNode(),s=e.lastNode();return[i?{id:a(i.id),data:i.data}:void 0,s?{id:a(s.id),data:s.data}:void 0]}trimFirstNode(){let e=this.firstNode();if(e){let n=this.edges.filter(l=>l.source===e.id);(Object.keys(this.nodes).length===1||n.length===1)&&this.removeNode(e)}}trimLastNode(){let e=this.lastNode();if(e){let n=this.edges.filter(l=>l.target===e.id);(Object.keys(this.nodes).length===1||n.length===1)&&this.removeNode(e)}}drawMermaid(e){let{withStyles:n,curveStyle:l,nodeColors:I={start:"#ffdfba",end:"#baffc9",other:"#fad7de"},wrapLabelNWords:a}=e??{},c={};for(let o of Object.values(this.nodes))c[o.id]=ZSe(o);let i=this.firstNode(),s=i?ZSe(i):void 0,r=this.lastNode(),u=r?ZSe(r):void 0;return Dln(c,this.edges,{firstNodeLabel:s,lastNodeLabel:u,withStyles:n,curveStyle:l,nodeColors:I,wrapLabelNWords:a})}async drawMermaidPng(e){let n=this.drawMermaid(e);return Kln(n,{backgroundColor:e?.backgroundColor})}}});function $ln(t){let e=new TextEncoder,n=new ReadableStream({async start(l){for await(let I of t)l.enqueue(e.encode(`event: data +data: ${JSON.stringify(I)} + +`));l.enqueue(e.encode(`event: end + +`)),l.close()}});return jd.fromReadableStream(n)}var eIn=B(()=>{jF()});function WSe(t){return typeof t=="object"&&t!==null&&typeof t[Symbol.iterator]=="function"&&typeof t.next=="function"}function cZe(t){return typeof t=="object"&&t!==null&&typeof t[Symbol.asyncIterator]=="function"}function*NSe(t,e){for(;;){let{value:n,done:l}=eY.runWithConfig(t,e.next.bind(e),!0);if(l)break;yield n}}async function*VSe(t,e){let n=e[Symbol.asyncIterator]();for(;;){let{value:l,done:I}=await eY.runWithConfig(t,n.next.bind(e),!0);if(I)break;yield l}}var tIn,nIn=B(()=>{xP();tIn=t=>t!=null&&typeof t=="object"&&"next"in t&&typeof t.next=="function"});function Od(t,e){return t&&!Array.isArray(t)&&!(t instanceof Date)&&typeof t=="object"?t:{[e]:t}}function ppI(t){if(Bhe(t))throw new Error("RunnableLambda requires a function that is not wrapped in traceable higher-order function. This shouldn't happen.")}function QJ(t){if(typeof t=="function")return new CJ({func:t});if(Uu.isRunnable(t))return t;if(!Array.isArray(t)&&typeof t=="object"){let e={};for(let[n,l]of Object.entries(t))e[n]=QJ(l);return new JJ({steps:e})}else throw new Error(`Expected a Runnable, function or object. +Instead got an unsupported type.`)}function hpI(t,e){let n=e.name??t.getName(),l=e.description??e.schema?.description;return e.schema.constructor===St.ZodString?new oZe({name:n,description:l,schema:St.object({input:St.string()}).transform(I=>I.input),bound:t}):new oZe({name:n,description:l,schema:e.schema,bound:t})}var YSe,Uu,EJ,gSe,RSe,CO,JJ,ySe,CJ,ASe,MP,FSe,oZe,TP=B(()=>{ab();YSe=$(CH(),1);uG();KBe();$he();nZe();FP();jF();dSe();mSe();aZe();Tln();pSe();xP();qln();eIn();nIn();wBe();Uu=class extends qV{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 n=this.name??this.constructor.lc_name()??this.constructor.name;return e?`${n}${e}`:n}bind(e){return new EJ({bound:this,kwargs:e,config:{}})}map(){return new gSe({bound:this})}withRetry(e){return new RSe({bound:this,kwargs:{},config:{},maxAttemptNumber:e?.stopAfterAttempt,...e})}withConfig(e){return new EJ({bound:this,config:e,kwargs:{}})}withFallbacks(e){let n=Array.isArray(e)?e:e.fallbacks;return new ASe({runnable:this,fallbacks:n})}_getOptionsList(e,n=0){if(Array.isArray(e)&&e.length!==n)throw new Error(`Passed "options" must be an array with the same length as the inputs, but got ${e.length} options for ${n} inputs`);if(Array.isArray(e))return e.map(dr);if(n>1&&!Array.isArray(e)&&e.runId){console.warn("Provided runId will be used only for the first element of the batch.");let l=Object.fromEntries(Object.entries(e).filter(([I])=>I!=="runId"));return Array.from({length:n},(I,a)=>dr(a===0?e:l))}return Array.from({length:n},()=>dr(e))}async batch(e,n,l){let I=this._getOptionsList(n??{},e.length),a=I[0]?.maxConcurrency??l?.maxConcurrency,c=new Vw({maxConcurrency:a,onFailedAttempt:s=>{throw s}}),i=e.map((s,r)=>c.call(async()=>{try{return await this.invoke(s,I[r])}catch(u){if(l?.returnExceptions)return u;throw u}}));return Promise.all(i)}async*_streamIterator(e,n){yield this.invoke(e,n)}async stream(e,n){let l=dr(n),I=new xF({generator:this._streamIterator(e,l),config:l});return await I.setup,jd.fromAsyncGenerator(I)}_separateRunnableConfigFromCallOptions(e){let n;e===void 0?n=dr(e):n=dr({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 l={...e};return delete l.callbacks,delete l.tags,delete l.metadata,delete l.runName,delete l.configurable,delete l.recursionLimit,delete l.maxConcurrency,delete l.runId,delete l.timeout,delete l.signal,[n,l]}async _callWithConfig(e,n,l){let I=dr(l),c=await(await aN(I))?.handleChainStart(this.toJSON(),Od(n,"input"),I.runId,I?.runType,void 0,void 0,I?.runName??this.getName());delete I.runId;let i;try{let s=e.call(this,n,I,c);i=await wR(s,l?.signal)}catch(s){throw await c?.handleChainError(s),s}return await c?.handleChainEnd(Od(i,"output")),i}async _batchWithConfig(e,n,l,I){let a=this._getOptionsList(l??{},n.length),c=await Promise.all(a.map(aN)),i=await Promise.all(c.map(async(r,u)=>{let o=await r?.handleChainStart(this.toJSON(),Od(n[u],"input"),a[u].runId,a[u].runType,void 0,void 0,a[u].runName??this.getName());return delete a[u].runId,o})),s;try{let r=e.call(this,n,a,i,I);s=await wR(r,a?.[0]?.signal)}catch(r){throw await Promise.all(i.map(u=>u?.handleChainError(r))),r}return await Promise.all(i.map(r=>r?.handleChainEnd(Od(s,"output")))),s}async*_transformStreamWithConfig(e,n,l){let I,a=!0,c,i=!0,s=dr(l),r=await aN(s);async function*u(){for await(let d of e){if(a)if(I===void 0)I=d;else try{I=jb(I,d)}catch{I=void 0,a=!1}yield d}}let o;try{let d=await zln(n.bind(this),u(),async()=>r?.handleChainStart(this.toJSON(),{input:""},s.runId,s.runType,void 0,void 0,s.runName??this.getName()),l?.signal,s);delete s.runId,o=d.setup;let b=o?.handlers.find(JO),h=d.output;b!==void 0&&o!==void 0&&(h=b.tapOutputIterable(o.runId,h));let Z=o?.handlers.find(QO);Z!==void 0&&o!==void 0&&(h=Z.tapOutputIterable(o.runId,h));for await(let N of h)if(yield N,i)if(c===void 0)c=N;else try{c=jb(c,N)}catch{c=void 0,i=!1}}catch(d){throw await o?.handleChainError(d,void 0,void 0,void 0,{inputs:Od(I,"input")}),d}await o?.handleChainEnd(c??{},void 0,void 0,void 0,{inputs:Od(I,"input")})}getGraph(e){let n=new SP,l=n.addNode({name:`${this.getName()}Input`,schema:St.any()}),I=n.addNode(this),a=n.addNode({name:`${this.getName()}Output`,schema:St.any()});return n.addEdge(l,I),n.addEdge(I,a),n}pipe(e){return new CO({first:this,last:QJ(e)})}pick(e){return this.pipe(new FSe(e))}assign(e){return this.pipe(new MP(new JJ({steps:e})))}async*transform(e,n){let l;for await(let I of e)l===void 0?l=I:l=jb(l,I);yield*this._streamIterator(l,dr(n))}async*streamLog(e,n,l){let I=new OP({...l,autoClose:!1,_schemaFormat:"original"}),a=dr(n);yield*this._streamLog(e,I,a)}async*_streamLog(e,n,l){let{callbacks:I}=l;if(I===void 0)l.callbacks=[n];else if(Array.isArray(I))l.callbacks=I.concat([n]);else{let s=I.copy();s.addHandler(n,!0),l.callbacks=s}let a=this.stream(e,l);async function c(){try{let s=await a;for await(let r of s){let u=new tY({ops:[{op:"add",path:"/streamed_output/-",value:r}]});await n.writer.write(u)}}finally{await n.writer.close()}}let i=c();try{for await(let s of n)yield s}finally{await i}}streamEvents(e,n,l){let I;if(n.version==="v1")I=this._streamEventsV1(e,n,l);else if(n.version==="v2")I=this._streamEventsV2(e,n,l);else throw new Error('Only versions "v1" and "v2" of the schema are currently supported.');return n.encoding==="text/event-stream"?$ln(I):jd.fromAsyncGenerator(I)}async*_streamEventsV2(e,n,l){let I=new tZe({...l,autoClose:!1}),a=dr(n),c=a.runId??$n();a.runId=c;let i=a.callbacks;if(i===void 0)a.callbacks=[I];else if(Array.isArray(i))a.callbacks=i.concat(I);else{let b=i.copy();b.addHandler(I,!0),a.callbacks=b}let s=this;async function r(){try{let b=await s.stream(e,a),h=I.tapOutputIterable(c,b);for await(let Z of h);}finally{await I.finish()}}let u=r(),o=!1,d;try{for await(let b of I){if(!o){b.data.input=e,o=!0,d=b.run_id,yield b;continue}b.run_id===d&&b.event.endsWith("_end")&&b.data?.input&&delete b.data.input,yield b}}finally{await u}}async*_streamEventsV1(e,n,l){let I,a=!1,c=dr(n),i=c.tags??[],s=c.metadata??{},r=c.runName??this.getName(),u=new OP({...l,autoClose:!1,_schemaFormat:"streaming_events"}),o=new rZe({...l}),d=this._streamLog(e,u,c);for await(let h of d){if(I?I=I.concat(h):I=jP.fromRunLogPatch(h),I.state===void 0)throw new Error('Internal error: "streamEvents" state is missing. Please open a bug report.');if(!a){a=!0;let y={...I.state},X={run_id:y.id,event:`on_${y.type}_start`,name:r,tags:i,metadata:s,data:{input:e}};o.includeEvent(X,y.type)&&(yield X)}let Z=h.ops.filter(y=>y.path.startsWith("/logs/")).map(y=>y.path.split("/")[2]),N=[...new Set(Z)];for(let y of N){let X,v={},H=I.state.logs[y];if(H.end_time===void 0?H.streamed_output.length>0?X="stream":X="start":X="end",X==="start")H.inputs!==void 0&&(v.input=H.inputs);else if(X==="end")H.inputs!==void 0&&(v.input=H.inputs),v.output=H.final_output;else if(X==="stream"){let Q=H.streamed_output.length;if(Q!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${Q} instead. Encountered in: "${H.name}"`);v={chunk:H.streamed_output[0]},H.streamed_output=[]}yield{event:`on_${H.type}_${X}`,name:H.name,run_id:H.id,tags:H.tags,metadata:H.metadata,data:v}}let{state:g}=I;if(g.streamed_output.length>0){let y=g.streamed_output.length;if(y!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${y} instead. Encountered in: "${g.name}"`);let X={chunk:g.streamed_output[0]};g.streamed_output=[];let v={event:`on_${g.type}_stream`,run_id:g.id,tags:i,metadata:s,name:r,data:X};o.includeEvent(v,g.type)&&(yield v)}}let b=I?.state;if(b!==void 0){let h={event:`on_${b.type}_end`,name:r,run_id:b.id,tags:i,metadata:s,data:{output:b.final_output}};o.includeEvent(h,b.type)&&(yield h)}}static isRunnable(e){return BP(e)}withListeners({onStart:e,onEnd:n,onError:l}){return new EJ({bound:this,config:{},configFactories:[I=>({callbacks:[new zP({config:I,onStart:e,onEnd:n,onError:l})]})]})}asTool(e){return hpI(this,e)}},EJ=class t extends Uu{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 n=bSe(this.config,...e);return bSe(n,...this.configFactories?await Promise.all(this.configFactories.map(async l=>await l(n))):[])}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 this.constructor({bound:this.bound.withRetry(e),kwargs:this.kwargs,config:this.config})}async invoke(e,n){return this.bound.invoke(e,await this._mergeConfig(dr(n),this.kwargs))}async batch(e,n,l){let I=Array.isArray(n)?await Promise.all(n.map(async a=>this._mergeConfig(dr(a),this.kwargs))):await this._mergeConfig(dr(n),this.kwargs);return this.bound.batch(e,I,l)}async*_streamIterator(e,n){yield*this.bound._streamIterator(e,await this._mergeConfig(dr(n),this.kwargs))}async stream(e,n){return this.bound.stream(e,await this._mergeConfig(dr(n),this.kwargs))}async*transform(e,n){yield*this.bound.transform(e,await this._mergeConfig(dr(n),this.kwargs))}streamEvents(e,n,l){let I=this,a=async function*(){yield*I.bound.streamEvents(e,{...await I._mergeConfig(dr(n),I.kwargs),version:n.version},l)};return jd.fromAsyncGenerator(a())}static isRunnableBinding(e){return e.bound&&Uu.isRunnable(e.bound)}withListeners({onStart:e,onEnd:n,onError:l}){return new t({bound:this.bound,kwargs:this.kwargs,config:this.config,configFactories:[I=>({callbacks:[new zP({config:I,onStart:e,onEnd:n,onError:l})]})]})}},gSe=class t extends Uu{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 t({bound:this.bound.bind(e)})}async invoke(e,n){return this._callWithConfig(this._invoke,e,n)}async _invoke(e,n,l){return this.bound.batch(e,LG(n,{callbacks:l?.getChild()}))}withListeners({onStart:e,onEnd:n,onError:l}){return new t({bound:this.bound.withListeners({onStart:e,onEnd:n,onError:l})})}},RSe=class extends EJ{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,n,l){let I=e>1?`retry:attempt:${e}`:void 0;return LG(n,{callbacks:l?.getChild(I)})}async _invoke(e,n,l){return(0,YSe.default)(I=>super.invoke(e,this._patchConfigForRetry(I,n,l)),{onFailedAttempt:I=>this.onFailedAttempt(I,e),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}async invoke(e,n){return this._callWithConfig(this._invoke,e,n)}async _batch(e,n,l,I){let a={};try{await(0,YSe.default)(async c=>{let i=e.map((d,b)=>b).filter(d=>a[d.toString()]===void 0||a[d.toString()]instanceof Error),s=i.map(d=>e[d]),r=i.map(d=>this._patchConfigForRetry(c,n?.[d],l?.[d])),u=await super.batch(s,r,{...I,returnExceptions:!0}),o;for(let d=0;dthis.onFailedAttempt(c,c.input),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}catch(c){if(I?.returnExceptions!==!0)throw c}return Object.keys(a).sort((c,i)=>parseInt(c,10)-parseInt(i,10)).map(c=>a[parseInt(c,10)])}async batch(e,n,l){return this._batchWithConfig(this._batch.bind(this),e,n,l)}},CO=class t extends Uu{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,"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}get steps(){return[this.first,...this.middle,this.last]}async invoke(e,n){let l=dr(n),a=await(await aN(l))?.handleChainStart(this.toJSON(),Od(e,"input"),l.runId,void 0,void 0,void 0,l?.runName);delete l.runId;let c=e,i;try{let s=[this.first,...this.middle];for(let r=0;r{let u=await s?.handleChainStart(this.toJSON(),Od(e[r],"input"),I[r].runId,void 0,void 0,void 0,I[r].runName);return delete I[r].runId,u})),i=e;try{for(let s=0;s{let b=o?.getChild(`seq:step:${s+1}`);return LG(I[d],{callbacks:b})}),l);i=await wR(u,I[0]?.signal)}}catch(s){throw await Promise.all(c.map(r=>r?.handleChainError(s))),s}return await Promise.all(c.map(s=>s?.handleChainEnd(Od(i,"output")))),i}async*_streamIterator(e,n){let l=await aN(n),{runId:I,...a}=n??{},c=await l?.handleChainStart(this.toJSON(),Od(e,"input"),I,void 0,void 0,void 0,a?.runName),i=[this.first,...this.middle,this.last],s=!0,r;async function*u(){yield e}try{let o=i[0].transform(u(),LG(a,{callbacks:c?.getChild("seq:step:1")}));for(let d=1;d{let c=I.getGraph(e);a!==0&&c.trimFirstNode(),a!==this.steps.length-1&&c.trimLastNode(),n.extend(c);let i=c.firstNode();if(!i)throw new Error(`Runnable ${I} has no first node`);l&&n.addEdge(l,i),l=c.lastNode()}),n}pipe(e){return t.isRunnableSequence(e)?new t({first:this.first,middle:this.middle.concat([this.last,e.first,...e.middle]),last:e.last,name:this.name??e.name}):new t({first:this.first,middle:[...this.middle,this.last],last:QJ(e),name:this.name})}static isRunnableSequence(e){return Array.isArray(e.middle)&&Uu.isRunnable(e)}static from([e,...n],l){return new t({first:QJ(e),middle:n.slice(0,-1).map(QJ),last:QJ(n[n.length-1]),name:l})}},JJ=class t extends Uu{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[n,l]of Object.entries(e.steps))this.steps[n]=QJ(l)}static from(e){return new t({steps:e})}async invoke(e,n){let l=dr(n),a=await(await aN(l))?.handleChainStart(this.toJSON(),{input:e},l.runId,void 0,void 0,void 0,l?.runName);delete l.runId;let c={};try{let i=Object.entries(this.steps).map(async([s,r])=>{c[s]=await r.invoke(e,LG(l,{callbacks:a?.getChild(`map:key:${s}`)}))});await wR(Promise.all(i),n?.signal)}catch(i){throw await a?.handleChainError(i),i}return await a?.handleChainEnd(c),c}async*_transform(e,n,l){let I={...this.steps},a=GSe(e,Object.keys(I).length),c=new Map(Object.entries(I).map(([i,s],r)=>{let u=s.transform(a[r],LG(l,{callbacks:n?.getChild(`map:key:${i}`)}));return[i,u.next().then(o=>({key:i,gen:u,result:o}))]}));for(;c.size;){let i=Promise.race(c.values()),{key:s,result:r,gen:u}=await wR(i,l?.signal);c.delete(s),r.done||(yield{[s]:r.value},c.set(s,u.next().then(o=>({key:s,gen:u,result:o}))))}}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=dr(n),a=new xF({generator:this.transform(l(),I),config:I});return await a.setup,jd.fromAsyncGenerator(a)}},ySe=class t extends Uu{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}),!Bhe(e.func))throw new Error("RunnableTraceable requires a function that is wrapped in traceable higher-order function");this.func=e.func}async invoke(e,n){let[l]=this._getOptionsList(n??{},1),I=await aN(l),a=this.func(LG(l,{callbacks:I}),e);return wR(a,l?.signal)}async*_streamIterator(e,n){let[l]=this._getOptionsList(n??{},1),I=await this.invoke(e,n);if(cZe(I)){for await(let a of I)l?.signal?.throwIfAborted(),yield a;return}if(tIn(I)){for(;;){l?.signal?.throwIfAborted();let a=I.next();if(a.done)break;yield a.value}return}yield I}static from(e){return new t({func:e})}};CJ=class t extends Uu{static lc_name(){return"RunnableLambda"}constructor(e){if(Bhe(e.func))return ySe.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}),ppI(e.func),this.func=e.func}static from(e){return new t({func:e})}async _invoke(e,n,l){return new Promise((I,a)=>{let c=LG(n,{callbacks:l?.getChild(),recursionLimit:(n?.recursionLimit??lZe)-1});eY.runWithConfig(c,async()=>{try{let i=await this.func(e,{...c,config:c});if(i&&Uu.isRunnable(i)){if(n?.recursionLimit===0)throw new Error("Recursion limit reached.");i=await i.invoke(e,{...c,recursionLimit:(c.recursionLimit??lZe)-1})}else if(cZe(i)){let s;for await(let r of VSe(c,i))if(n?.signal?.throwIfAborted(),s===void 0)s=r;else try{s=jb(s,r)}catch{s=r}i=s}else if(WSe(i)){let s;for(let r of NSe(c,i))if(n?.signal?.throwIfAborted(),s===void 0)s=r;else try{s=jb(s,r)}catch{s=r}i=s}I(i)}catch(i){a(i)}})})}async invoke(e,n){return this._callWithConfig(this._invoke,e,n)}async*_transform(e,n,l){let I;for await(let i of e)if(I===void 0)I=i;else try{I=jb(I,i)}catch{I=i}let a=LG(l,{callbacks:n?.getChild(),recursionLimit:(l?.recursionLimit??lZe)-1}),c=await new Promise((i,s)=>{eY.runWithConfig(a,async()=>{try{let r=await this.func(I,{...a,config:a});i(r)}catch(r){s(r)}})});if(c&&Uu.isRunnable(c)){if(l?.recursionLimit===0)throw new Error("Recursion limit reached.");let i=await c.stream(I,a);for await(let s of i)yield s}else if(cZe(c))for await(let i of VSe(a,c))l?.signal?.throwIfAborted(),yield i;else if(WSe(c))for(let i of NSe(a,c))l?.signal?.throwIfAborted(),yield i;else yield c}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=dr(n),a=new xF({generator:this.transform(l(),I),config:I});return await a.setup,jd.fromAsyncGenerator(a)}},ASe=class extends Uu{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,n){let l=dr(n),I=await aN(n),{runId:a,...c}=l,i=await I?.handleChainStart(this.toJSON(),Od(e,"input"),a,void 0,void 0,void 0,c?.runName),s;for(let r of this.runnables()){l?.signal?.throwIfAborted();try{let u=await r.invoke(e,LG(c,{callbacks:i?.getChild()}));return await i?.handleChainEnd(Od(u,"output")),u}catch(u){s===void 0&&(s=u)}}throw s===void 0?new Error("No error stored at end of fallback."):(await i?.handleChainError(s),s)}async*_streamIterator(e,n){let l=dr(n),I=await aN(n),{runId:a,...c}=l,i=await I?.handleChainStart(this.toJSON(),Od(e,"input"),a,void 0,void 0,void 0,c?.runName),s,r;for(let o of this.runnables()){l?.signal?.throwIfAborted();let d=LG(c,{callbacks:i?.getChild()});try{r=await o.stream(e,d);break}catch(b){s===void 0&&(s=b)}}if(r===void 0){let o=s??new Error("No error stored at end of fallback.");throw await i?.handleChainError(o),o}let u;try{for await(let o of r){yield o;try{u=u===void 0?u:jb(u,o)}catch{u=void 0}}}catch(o){throw await i?.handleChainError(o),o}await i?.handleChainEnd(Od(u,"output"))}async batch(e,n,l){if(l?.returnExceptions)throw new Error("Not implemented.");let I=this._getOptionsList(n??{},e.length),a=await Promise.all(I.map(s=>aN(s))),c=await Promise.all(a.map(async(s,r)=>{let u=await s?.handleChainStart(this.toJSON(),Od(e[r],"input"),I[r].runId,void 0,void 0,void 0,I[r].runName);return delete I[r].runId,u})),i;for(let s of this.runnables()){I[0].signal?.throwIfAborted();try{let r=await s.batch(e,c.map((u,o)=>LG(I[o],{callbacks:u?.getChild()})),l);return await Promise.all(c.map((u,o)=>u?.handleChainEnd(Od(r[o],"output")))),r}catch(r){i===void 0&&(i=r)}}throw i?(await Promise.all(c.map(s=>s?.handleChainError(i))),i):new Error("No error stored at end of fallbacks.")}};MP=class extends Uu{static lc_name(){return"RunnableAssign"}constructor(e){e instanceof JJ&&(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,n){let l=await this.mapper.invoke(e,n);return{...e,...l}}async*_transform(e,n,l){let I=this.mapper.getStepsKeys(),[a,c]=GSe(e),i=this.mapper.transform(c,LG(l,{callbacks:n?.getChild()})),s=i.next();for await(let r of a){if(typeof r!="object"||Array.isArray(r))throw new Error(`RunnableAssign can only be used with objects as input, got ${typeof r}`);let u=Object.fromEntries(Object.entries(r).filter(([o])=>!I.includes(o)));Object.keys(u).length>0&&(yield u)}yield(await s).value;for await(let r of i)yield r}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=dr(n),a=new xF({generator:this.transform(l(),I),config:I});return await a.setup,jd.fromAsyncGenerator(a)}},FSe=class extends Uu{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 n=this.keys.map(l=>[l,e[l]]).filter(l=>l[1]!==void 0);return n.length===0?void 0:Object.fromEntries(n)}}async invoke(e,n){return this._callWithConfig(this._pick.bind(this),e,n)}async*_transform(e){for await(let n of e){let l=await this._pick(n);l!==void 0&&(yield l)}}transform(e,n){return this._transformStreamWithConfig(e,this._transform.bind(this),n)}async stream(e,n){async function*l(){yield e}let I=dr(n),a=new xF({generator:this.transform(l(),I),config:I});return await a.setup,jd.fromAsyncGenerator(a)}},oZe=class extends EJ{constructor(e){let n=CO.from([CJ.from(async l=>{let I;if(Hhe(l))try{I=await this.schema.parseAsync(l.args)}catch{throw new whe("Received tool input did not match expected schema",JSON.stringify(l.args))}else I=l;return I}).withConfig({runName:`${e.name}:parse_input`}),e.bound]).withConfig({runName:e.name});super({bound:n,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"}}});var vSe=B(()=>{fR()});var lIn=B(()=>{TP();RO();vhe();fhe();XP();vSe();Xhe();fP();yJ()});var iZe=B(()=>{RO();fR();vhe();fhe();XP();Xhe();yJ();lIn();vSe();fP()});function lY(t){t?(Ud[0]=Ud[16]=Ud[1]=Ud[2]=Ud[3]=Ud[4]=Ud[5]=Ud[6]=Ud[7]=Ud[8]=Ud[9]=Ud[10]=Ud[11]=Ud[12]=Ud[13]=Ud[14]=Ud[15]=0,this.blocks=Ud):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var WpI,Pl,NpI,nY,Ud,fSe,IIn=B(()=>{"use strict";WpI=typeof window=="object"?window:{},Pl="0123456789abcdef".split(""),NpI=[-2147483648,8388608,32768,128],nY=[24,16,8,0],Ud=[];lY.prototype.update=function(t){if(!this.finalized){var e=typeof t!="string";e&&t.constructor===WpI.ArrayBuffer&&(t=new Uint8Array(t));for(var n,l=0,I,a=t.length||0,c=this.blocks;l>2]|=t[l]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|n&63)<=57344?(c[I>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|n&63)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|n&63)<=64?(this.block=c[16],this.start=I-64,this.hash(),this.hashed=!0):this.start=I}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};lY.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=NpI[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}};lY.prototype.hash=function(){var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4,a,c,i,s=this.blocks;for(c=16;c<80;++c)i=s[c-3]^s[c-8]^s[c-14]^s[c-16],s[c]=i<<1|i>>>31;for(c=0;c<20;c+=5)a=e&n|~e&l,i=t<<5|t>>>27,I=i+a+I+1518500249+s[c]<<0,e=e<<30|e>>>2,a=t&e|~t&n,i=I<<5|I>>>27,l=i+a+l+1518500249+s[c+1]<<0,t=t<<30|t>>>2,a=I&t|~I&e,i=l<<5|l>>>27,n=i+a+n+1518500249+s[c+2]<<0,I=I<<30|I>>>2,a=l&I|~l&t,i=n<<5|n>>>27,e=i+a+e+1518500249+s[c+3]<<0,l=l<<30|l>>>2,a=n&l|~n&I,i=e<<5|e>>>27,t=i+a+t+1518500249+s[c+4]<<0,n=n<<30|n>>>2;for(;c<40;c+=5)a=e^n^l,i=t<<5|t>>>27,I=i+a+I+1859775393+s[c]<<0,e=e<<30|e>>>2,a=t^e^n,i=I<<5|I>>>27,l=i+a+l+1859775393+s[c+1]<<0,t=t<<30|t>>>2,a=I^t^e,i=l<<5|l>>>27,n=i+a+n+1859775393+s[c+2]<<0,I=I<<30|I>>>2,a=l^I^t,i=n<<5|n>>>27,e=i+a+e+1859775393+s[c+3]<<0,l=l<<30|l>>>2,a=n^l^I,i=e<<5|e>>>27,t=i+a+t+1859775393+s[c+4]<<0,n=n<<30|n>>>2;for(;c<60;c+=5)a=e&n|e&l|n&l,i=t<<5|t>>>27,I=i+a+I-1894007588+s[c]<<0,e=e<<30|e>>>2,a=t&e|t&n|e&n,i=I<<5|I>>>27,l=i+a+l-1894007588+s[c+1]<<0,t=t<<30|t>>>2,a=I&t|I&e|t&e,i=l<<5|l>>>27,n=i+a+n-1894007588+s[c+2]<<0,I=I<<30|I>>>2,a=l&I|l&t|I&t,i=n<<5|n>>>27,e=i+a+e-1894007588+s[c+3]<<0,l=l<<30|l>>>2,a=n&l|n&I|l&I,i=e<<5|e>>>27,t=i+a+t-1894007588+s[c+4]<<0,n=n<<30|n>>>2;for(;c<80;c+=5)a=e^n^l,i=t<<5|t>>>27,I=i+a+I-899497514+s[c]<<0,e=e<<30|e>>>2,a=t^e^n,i=I<<5|I>>>27,l=i+a+l-899497514+s[c+1]<<0,t=t<<30|t>>>2,a=I^t^e,i=l<<5|l>>>27,n=i+a+n-899497514+s[c+2]<<0,I=I<<30|I>>>2,a=l^I^t,i=n<<5|n>>>27,e=i+a+e-899497514+s[c+3]<<0,l=l<<30|l>>>2,a=n^l^I,i=e<<5|e>>>27,t=i+a+t-899497514+s[c+4]<<0,n=n<<30|n>>>2;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+n<<0,this.h3=this.h3+l<<0,this.h4=this.h4+I<<0};lY.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4;return Pl[t>>28&15]+Pl[t>>24&15]+Pl[t>>20&15]+Pl[t>>16&15]+Pl[t>>12&15]+Pl[t>>8&15]+Pl[t>>4&15]+Pl[t&15]+Pl[e>>28&15]+Pl[e>>24&15]+Pl[e>>20&15]+Pl[e>>16&15]+Pl[e>>12&15]+Pl[e>>8&15]+Pl[e>>4&15]+Pl[e&15]+Pl[n>>28&15]+Pl[n>>24&15]+Pl[n>>20&15]+Pl[n>>16&15]+Pl[n>>12&15]+Pl[n>>8&15]+Pl[n>>4&15]+Pl[n&15]+Pl[l>>28&15]+Pl[l>>24&15]+Pl[l>>20&15]+Pl[l>>16&15]+Pl[l>>12&15]+Pl[l>>8&15]+Pl[l>>4&15]+Pl[l&15]+Pl[I>>28&15]+Pl[I>>24&15]+Pl[I>>20&15]+Pl[I>>16&15]+Pl[I>>12&15]+Pl[I>>8&15]+Pl[I>>4&15]+Pl[I&15]};lY.prototype.toString=lY.prototype.hex;lY.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,l=this.h3,I=this.h4;return[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,l>>24&255,l>>16&255,l>>8&255,l&255,I>>24&255,I>>16&255,I>>8&255,I&255]};lY.prototype.array=lY.prototype.digest;lY.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(20),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),t};fSe=t=>new lY(!0).update(t).hex()});var aIn=B(()=>{IIn()});var rIn,XSe,VpI,sZe,cIn=B(()=>{aIn();yJ();rIn=(...t)=>fSe(t.join("_")),XSe=class{},VpI=new Map,sZe=class t extends XSe{constructor(e){super(),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cache=e??new Map}lookup(e,n){return Promise.resolve(this.cache.get(rIn(e,n))??null)}async update(e,n,l){this.cache.set(rIn(e,n),l)}static global(){return new t(VpI)}}});var uZe,dZe,GZe,oIn=B(()=>{FP();XP();yJ();uZe=class extends qV{},dZe=class extends uZe{static lc_name(){return"StringPromptValue"}constructor(e){super({value:e}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompt_values"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.value=e}toString(){return this.value}toChatMessages(){return[new XR(this.value)]}},GZe=class extends uZe{static lc_name(){return"ChatPromptValue"}constructor(e){Array.isArray(e)&&(e={messages:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompt_values"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.messages=e.messages}toString(){return AO(this.messages)}toChatMessages(){return this.messages}}});async function gpI(t){return t in bZe||(bZe[t]=YpI.fetch(`https://tiktoken.pages.dev/js/${t}.json`).then(e=>e.json()).then(e=>new IL(e)).catch(e=>{throw delete bZe[t],e})),await bZe[t]}async function iIn(t){return gpI(WB(t))}var bZe,YpI,sIn=B(()=>{uve();aZe();bZe={},YpI=new Vw({})});var RpI,ypI,wSe,LO,HSe=B(()=>{cIn();oIn();yJ();aZe();sIn();TP();RpI=t=>t.startsWith("gpt-3.5-turbo-16k")?"gpt-3.5-turbo-16k":t.startsWith("gpt-3.5-turbo-")?"gpt-3.5-turbo":t.startsWith("gpt-4-32k")?"gpt-4-32k":t.startsWith("gpt-4-")?"gpt-4":t.startsWith("gpt-4o")?"gpt-4o":t,ypI=()=>!1,wSe=class extends Uu{get lc_attributes(){return{callbacks:void 0,verbose:void 0}}constructor(e){super(e),Object.defineProperty(this,"verbose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"callbacks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.verbose=e.verbose??ypI(),this.callbacks=e.callbacks,this.tags=e.tags??[],this.metadata=e.metadata??{}}},LO=class extends wSe{get callKeys(){return["stop","timeout","signal","tags","metadata","callbacks"]}constructor({callbacks:e,callbackManager:n,...l}){super({callbacks:e??n,...l}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_encoding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),typeof l.cache=="object"?this.cache=l.cache:l.cache?this.cache=sZe.global():this.cache=void 0,this.caller=new Vw(l??{})}async getNumTokens(e){if(typeof e!="string")return 0;let n=Math.ceil(e.length/4);if(!this._encoding)try{this._encoding=await iIn("modelName"in this?RpI(this.modelName):"gpt2")}catch(l){console.warn("Failed to calculate number of tokens, falling back to approximate count",l)}if(this._encoding)try{n=this._encoding.encode(e).length}catch(l){console.warn("Failed to calculate number of tokens, falling back to approximate count",l)}return n}static _convertInputToPromptValue(e){return typeof e=="string"?new dZe(e):Array.isArray(e)?new GZe(e.map(RJ)):e}_identifyingParams(){return{}}_getSerializedCacheKeyParametersForCall({config:e,...n}){let l={...this._identifyingParams(),...n,_type:this._llmType(),_model:this._modelType()};return Object.entries(l).filter(([c,i])=>i!==void 0).map(([c,i])=>`${c}:${JSON.stringify(i)}`).sort().join(",")}serialize(){return{...this._identifyingParams(),_type:this._llmType(),_model:this._modelType()}}static async deserialize(e){throw new Error("Use .toJSON() instead")}}});var QSe,kO,uIn=B(()=>{iZe();UP();kP();HSe();nZe();$he();jF();QSe=class t extends LO{constructor({concurrency:e,...n}){super(e?{maxConcurrency:e,...n}:n),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","llms",this._llmType()]})}async invoke(e,n){let l=t._convertInputToPromptValue(e);return(await this.generatePrompt([l],n,n?.callbacks)).generations[0][0].text}async*_streamResponseChunks(e,n,l){throw new Error("Not implemented.")}_separateRunnableConfigFromCallOptionsCompat(e){let[n,l]=super._separateRunnableConfigFromCallOptions(e);return l.signal=n.signal,[n,l]}async*_streamIterator(e,n){if(this._streamResponseChunks===t.prototype._streamResponseChunks)yield this.invoke(e,n);else{let l=t._convertInputToPromptValue(e),[I,a]=this._separateRunnableConfigFromCallOptionsCompat(n),c=await xd.configure(I.callbacks,this.callbacks,I.tags,this.tags,I.metadata,this.metadata,{verbose:this.verbose}),i={options:a,invocation_params:this?.invocationParams(a),batch_size:1},s=await c?.handleLLMStart(this.toJSON(),[l.toString()],I.runId,void 0,i,void 0,void 0,I.runName),r=new cZ({text:""});try{for await(let u of this._streamResponseChunks(l.toString(),a,s?.[0]))r?r=r.concat(u):r=u,typeof u.text=="string"&&(yield u.text)}catch(u){throw await Promise.all((s??[]).map(o=>o?.handleLLMError(u))),u}await Promise.all((s??[]).map(u=>u?.handleLLMEnd({generations:[[r]]})))}}async generatePrompt(e,n,l){let I=e.map(a=>a.toString());return this.generate(I,n,l)}invocationParams(e){return{}}_flattenLLMResult(e){let n=[];for(let l=0;lJO(u)||QO(u)),s;if(i&&e.length===1&&this._streamResponseChunks!==t.prototype._streamResponseChunks)try{let u=await this._streamResponseChunks(e[0],n,c?.[0]),o;for await(let d of u)o===void 0?o=d:o=jb(o,d);if(o===void 0)throw new Error("Received empty response from chat model call.");s={generations:[[o]],llmOutput:{}},await c?.[0].handleLLMEnd(s)}catch(u){throw await c?.[0].handleLLMError(u),u}else{try{s=await this._generate(e,n,c?.[0])}catch(o){throw await Promise.all((c??[]).map(d=>d?.handleLLMError(o))),o}let u=this._flattenLLMResult(s);await Promise.all((c??[]).map((o,d)=>o?.handleLLMEnd(u[d])))}let r=c?.map(u=>u.runId)||void 0;return Object.defineProperty(s,EO,{value:r?{runIds:r}:void 0,configurable:!0}),s}async _generateCached({prompts:e,cache:n,llmStringKey:l,parsedOptions:I,handledOptions:a,runId:c}){let i=await xd.configure(a.callbacks,this.callbacks,a.tags,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),s={options:I,invocation_params:this?.invocationParams(I),batch_size:e.length,cached:!0},r=await i?.handleLLMStart(this.toJSON(),e,c,void 0,s,void 0,void 0,a?.runName),u=[],d=(await Promise.allSettled(e.map(async(Z,N)=>{let g=await n.lookup(Z,l);return g==null&&u.push(N),g}))).map((Z,N)=>({result:Z,runManager:r?.[N]})).filter(({result:Z})=>Z.status==="fulfilled"&&Z.value!=null||Z.status==="rejected"),b=[];await Promise.all(d.map(async({result:Z,runManager:N},g)=>{if(Z.status==="fulfilled"){let y=Z.value;return b[g]=y,y.length&&await N?.handleLLMNewToken(y[0].text),N?.handleLLMEnd({generations:[y]})}else return await N?.handleLLMError(Z.reason),Promise.reject(Z.reason)}));let h={generations:b,missingPromptIndices:u};return Object.defineProperty(h,EO,{value:r?{runIds:r?.map(Z=>Z.runId)}:void 0,configurable:!0}),h}async generate(e,n,l){if(!Array.isArray(e))throw new Error("Argument 'prompts' is expected to be a string[]");let I;Array.isArray(n)?I={stop:n}:I=n;let[a,c]=this._separateRunnableConfigFromCallOptionsCompat(I);if(a.callbacks=a.callbacks??l,!this.cache)return this._generateUncached(e,c,a);let{cache:i}=this,s=this._getSerializedCacheKeyParametersForCall(c),{generations:r,missingPromptIndices:u}=await this._generateCached({prompts:e,cache:i,llmStringKey:s,parsedOptions:c,handledOptions:a,runId:a.runId}),o={};if(u.length>0){let d=await this._generateUncached(u.map(b=>e[b]),c,a);await Promise.all(d.generations.map(async(b,h)=>{let Z=u[h];return r[Z]=b,i.update(e[Z],s,b)})),o=d.llmOutput??{}}return{generations:r,llmOutput:o}}async call(e,n,l){let{generations:I}=await this.generate([e],n,l);return I[0][0].text}async predict(e,n,l){return this.call(e,n,l)}async predictMessages(e,n,l){let I=AO(e),a=await this.call(I,n,l);return new $V(a)}_identifyingParams(){return{}}serialize(){return{...this._identifyingParams(),_type:this._llmType(),_model:this._modelType()}}_modelType(){return"base_llm"}},kO=class extends QSe{async _generate(e,n,l){return{generations:await Promise.all(e.map((a,c)=>this._call(a,{...n,promptIndex:c},l).then(i=>[{text:i}])))}}}});var ESe=B(()=>{uIn()});var JSe=B(()=>{UP()});var CSe=B(()=>{fO()});var TIn={};Xe(TIn,{HfInference:()=>CpI,HfInferenceEndpoint:()=>MIn,InferenceOutputError:()=>Dr,audioClassification:()=>hIn,audioToAudio:()=>NIn,automaticSpeechRecognition:()=>ZIn,chatCompletion:()=>jIn,chatCompletionStream:()=>OIn,documentQuestionAnswering:()=>UIn,featureExtraction:()=>vIn,fillMask:()=>fIn,imageClassification:()=>VIn,imageSegmentation:()=>YIn,imageToImage:()=>AIn,imageToText:()=>gIn,objectDetection:()=>RIn,questionAnswering:()=>XIn,request:()=>Ar,sentenceSimilarity:()=>wIn,streamingRequest:()=>DP,summarization:()=>HIn,tableQuestionAnswering:()=>QIn,tabularClassification:()=>SIn,tabularRegression:()=>BIn,textClassification:()=>EIn,textGeneration:()=>JIn,textGenerationStream:()=>CIn,textToImage:()=>yIn,textToSpeech:()=>WIn,tokenClassification:()=>LIn,translation:()=>kIn,visualQuestionAnswering:()=>zIn,zeroShotClassification:()=>xIn,zeroShotImageClassification:()=>FIn});function vpI(t,e){return Object.assign({},...e.map(n=>{if(t[n]!==void 0)return{[n]:t[n]}}))}function fpI(t,e){return t.includes(e)}function XpI(t,e){let n=Array.isArray(e)?e:[e],l=Object.keys(t).filter(I=>!fpI(n,I));return vpI(t,l)}function pZe(t){return/^http(s?):/.test(t)||t.startsWith("/")}async function mIn(t,e,n){if(pZe(t))return null;let l=`${t}:${e}`,I=xO.get(l);if(I&&I.datec.json()).then(c=>c.pipeline_tag).catch(()=>null);if(!a)return null;I={task:a,date:new Date},xO.set(l,{task:a,date:new Date}),xO.size>HpI&&xO.delete(xO.keys().next().value)}return I.task}async function pIn(t,e){let{accessToken:n,endpointUrl:l,...I}=t,{model:a}=t,{forceTask:c,includeCredentials:i,taskHint:s,wait_for_model:r,use_cache:u,dont_load_model:o,chatCompletion:d}=e??{},b={};if(n&&(b.Authorization=`Bearer ${n}`),!a&&!mZe&&s){let y=await fetch(`${bIn}/api/tasks`);y.ok&&(mZe=await y.json())}if(!a&&mZe&&s){let y=mZe[s];y&&(a=y.models[0].id)}if(!a)throw new Error("No model provided, and no default model found for this task");let h="data"in t&&!!t.data;h||(b["Content-Type"]="application/json"),r&&(b["X-Wait-For-Model"]="true"),u===!1&&(b["X-Use-Cache"]="false"),o&&(b["X-Load-Model"]="0");let Z=(()=>{if(l&&pZe(a))throw new TypeError("Both model and endpointUrl cannot be URLs");return pZe(a)?(console.warn("Using a model URL is deprecated, please use the `endpointUrl` parameter instead"),a):l||(c?`${dIn}/pipeline/${c}/${a}`:`${dIn}/models/${a}`)})();d&&!Z.endsWith("/chat/completions")&&(Z+="/v1/chat/completions");let N;typeof i=="string"?N=i:i===!0&&(N="include");let g={headers:b,method:"POST",body:h?t.data:JSON.stringify({...I.model&&pZe(I.model)?XpI(I,"model"):I}),...N&&{credentials:N},signal:e?.signal};return{url:Z,info:g}}async function Ar(t,e){let{url:n,info:l}=await pIn(t,e),I=await(e?.fetch??fetch)(n,l);if(e?.retry_on_error!==!1&&I.status===503&&!e?.wait_for_model)return Ar(t,{...e,wait_for_model:!0});if(!I.ok){if(I.headers.get("Content-Type")?.startsWith("application/json")){let a=await I.json();if([400,422,404,500].includes(I.status)&&e?.chatCompletion)throw new Error(`Server ${t.model} does not seem to support chat completion. Error: ${a.error}`);if(a.error)throw new Error(a.error)}throw new Error("An error occurred while fetching the blob")}return I.headers.get("Content-Type")?.startsWith("application/json")?await I.json():await I.blob()}function QpI(t){let e,n,l,I=!1;return function(c){e===void 0?(e=c,n=0,l=-1):e=JpI(e,c);let i=e.length,s=0;for(;n0){let s=I.decode(c.subarray(0,i)),r=i+(c[i+1]===32?2:1),u=I.decode(c.subarray(r));switch(s){case"data":l.data=l.data?l.data+` +`+u:u;break;case"event":l.event=u;break;case"id":t(l.id=u);break;case"retry":let o=parseInt(u,10);isNaN(o)||e(l.retry=o);break}}}}function JpI(t,e){let n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function GIn(){return{data:"",event:"",id:"",retry:void 0}}async function*DP(t,e){let{url:n,info:l}=await pIn({...t,stream:!0},e),I=await(e?.fetch??fetch)(n,l);if(e?.retry_on_error!==!1&&I.status===503&&!e?.wait_for_model)return yield*DP(t,{...e,wait_for_model:!0});if(!I.ok){if(I.headers.get("Content-Type")?.startsWith("application/json")){let r=await I.json();if([400,422,404,500].includes(I.status)&&e?.chatCompletion)throw new Error(`Server ${t.model} does not seem to support chat completion. Error: ${r.error}`);if(r.error)throw new Error(r.error)}throw new Error(`Server response contains error: ${I.status}`)}if(!I.headers.get("content-type")?.startsWith("text/event-stream"))throw new Error("Server does not support event stream content type, it returned "+I.headers.get("content-type"));if(!I.body)return;let a=I.body.getReader(),c=[],s=QpI(EpI(()=>{},()=>{},r=>{c.push(r)}));try{for(;;){let{done:r,value:u}=await a.read();if(r)return;s(u);for(let o of c)if(o.data.length>0){if(o.data==="[DONE]")return;let d=JSON.parse(o.data);if(typeof d=="object"&&d!==null&&"error"in d)throw new Error(d.error);yield d}c=[]}}finally{a.releaseLock()}}async function hIn(t,e){let n=await Ar(t,{...e,taskHint:"audio-classification"});if(!(Array.isArray(n)&&n.every(I=>typeof I.label=="string"&&typeof I.score=="number")))throw new Dr("Expected Array<{label: string, score: number}>");return n}async function ZIn(t,e){let n=await Ar(t,{...e,taskHint:"automatic-speech-recognition"});if(!(typeof n?.text=="string"))throw new Dr("Expected {text: string}");return n}async function WIn(t,e){let n=await Ar(t,{...e,taskHint:"text-to-speech"});if(!(n&&n instanceof Blob))throw new Dr("Expected Blob");return n}async function NIn(t,e){let n=await Ar(t,{...e,taskHint:"audio-to-audio"});if(!(Array.isArray(n)&&n.every(I=>typeof I.label=="string"&&typeof I.blob=="string"&&typeof I["content-type"]=="string")))throw new Dr("Expected Array<{label: string, blob: string, content-type: string}>");return n}async function VIn(t,e){let n=await Ar(t,{...e,taskHint:"image-classification"});if(!(Array.isArray(n)&&n.every(I=>typeof I.label=="string"&&typeof I.score=="number")))throw new Dr("Expected Array<{label: string, score: number}>");return n}async function YIn(t,e){let n=await Ar(t,{...e,taskHint:"image-segmentation"});if(!(Array.isArray(n)&&n.every(I=>typeof I.label=="string"&&typeof I.mask=="string"&&typeof I.score=="number")))throw new Dr("Expected Array<{label: string, mask: string, score: number}>");return n}async function gIn(t,e){let n=(await Ar(t,{...e,taskHint:"image-to-text"}))?.[0];if(typeof n?.generated_text!="string")throw new Dr("Expected {generated_text: string}");return n}async function RIn(t,e){let n=await Ar(t,{...e,taskHint:"object-detection"});if(!(Array.isArray(n)&&n.every(I=>typeof I.label=="string"&&typeof I.score=="number"&&typeof I.box.xmin=="number"&&typeof I.box.ymin=="number"&&typeof I.box.xmax=="number"&&typeof I.box.ymax=="number")))throw new Dr("Expected Array<{label:string; score:number; box:{xmin:number; ymin:number; xmax:number; ymax:number}}>");return n}async function yIn(t,e){let n=await Ar(t,{...e,taskHint:"text-to-image"});if(!(n&&n instanceof Blob))throw new Dr("Expected Blob");return n}function hZe(t){if(globalThis.Buffer)return globalThis.Buffer.from(t).toString("base64");{let e=[];return t.forEach(n=>{e.push(String.fromCharCode(n))}),globalThis.btoa(e.join(""))}}async function AIn(t,e){let n;t.parameters?n={...t,inputs:hZe(new Uint8Array(t.inputs instanceof ArrayBuffer?t.inputs:await t.inputs.arrayBuffer()))}:n={accessToken:t.accessToken,model:t.model,data:t.inputs};let l=await Ar(n,{...e,taskHint:"image-to-image"});if(!(l&&l instanceof Blob))throw new Dr("Expected Blob");return l}async function FIn(t,e){let n={...t,inputs:{image:hZe(new Uint8Array(t.inputs.image instanceof ArrayBuffer?t.inputs.image:await t.inputs.image.arrayBuffer()))}},l=await Ar(n,{...e,taskHint:"zero-shot-image-classification"});if(!(Array.isArray(l)&&l.every(a=>typeof a.label=="string"&&typeof a.score=="number")))throw new Dr("Expected Array<{label: string, score: number}>");return l}async function vIn(t,e){let n=t.model?await mIn(t.model,t.accessToken,e):void 0,l=await Ar(t,{...e,taskHint:"feature-extraction",...n==="sentence-similarity"&&{forceTask:"feature-extraction"}}),I=!0,a=(c,i,s=0)=>s>i?!1:c.every(r=>Array.isArray(r))?c.every(r=>a(r,i,s+1)):c.every(r=>typeof r=="number");if(I=Array.isArray(l)&&a(l,3,0),!I)throw new Dr("Expected Array");return l}async function fIn(t,e){let n=await Ar(t,{...e,taskHint:"fill-mask"});if(!(Array.isArray(n)&&n.every(I=>typeof I.score=="number"&&typeof I.sequence=="string"&&typeof I.token=="number"&&typeof I.token_str=="string")))throw new Dr("Expected Array<{score: number, sequence: string, token: number, token_str: string}>");return n}async function XIn(t,e){let n=await Ar(t,{...e,taskHint:"question-answering"});if(!(typeof n=="object"&&!!n&&typeof n.answer=="string"&&typeof n.end=="number"&&typeof n.score=="number"&&typeof n.start=="number"))throw new Dr("Expected {answer: string, end: number, score: number, start: number}");return n}async function wIn(t,e){let n=t.model?await mIn(t.model,t.accessToken,e):void 0,l=await Ar(t,{...e,taskHint:"sentence-similarity",...n==="feature-extraction"&&{forceTask:"sentence-similarity"}});if(!(Array.isArray(l)&&l.every(a=>typeof a=="number")))throw new Dr("Expected number[]");return l}async function HIn(t,e){let n=await Ar(t,{...e,taskHint:"summarization"});if(!(Array.isArray(n)&&n.every(I=>typeof I?.summary_text=="string")))throw new Dr("Expected Array<{summary_text: string}>");return n?.[0]}async function QIn(t,e){let n=await Ar(t,{...e,taskHint:"table-question-answering"});if(!(typeof n?.aggregator=="string"&&typeof n.answer=="string"&&Array.isArray(n.cells)&&n.cells.every(I=>typeof I=="string")&&Array.isArray(n.coordinates)&&n.coordinates.every(I=>Array.isArray(I)&&I.every(a=>typeof a=="number"))))throw new Dr("Expected {aggregator: string, answer: string, cells: string[], coordinates: number[][]}");return n}async function EIn(t,e){let n=(await Ar(t,{...e,taskHint:"text-classification"}))?.[0];if(!(Array.isArray(n)&&n.every(I=>typeof I?.label=="string"&&typeof I.score=="number")))throw new Dr("Expected Array<{label: string, score: number}>");return n}async function JIn(t,e){let n=await Ar(t,{...e,taskHint:"text-generation"});if(!(Array.isArray(n)&&n.every(I=>typeof I?.generated_text=="string")))throw new Dr("Expected Array<{generated_text: string}>");return n?.[0]}async function*CIn(t,e){yield*DP(t,{...e,taskHint:"text-generation"})}function kSe(t){return Array.isArray(t)?t:[t]}async function LIn(t,e){let n=kSe(await Ar(t,{...e,taskHint:"token-classification"}));if(!(Array.isArray(n)&&n.every(I=>typeof I.end=="number"&&typeof I.entity_group=="string"&&typeof I.score=="number"&&typeof I.start=="number"&&typeof I.word=="string")))throw new Dr("Expected Array<{end: number, entity_group: string, score: number, start: number, word: string}>");return n}async function kIn(t,e){let n=await Ar(t,{...e,taskHint:"translation"});if(!(Array.isArray(n)&&n.every(I=>typeof I?.translation_text=="string")))throw new Dr("Expected type Array<{translation_text: string}>");return n?.length===1?n?.[0]:n}async function xIn(t,e){let n=kSe(await Ar(t,{...e,taskHint:"zero-shot-classification"}));if(!(Array.isArray(n)&&n.every(I=>Array.isArray(I.labels)&&I.labels.every(a=>typeof a=="string")&&Array.isArray(I.scores)&&I.scores.every(a=>typeof a=="number")&&typeof I.sequence=="string")))throw new Dr("Expected Array<{labels: string[], scores: number[], sequence: string}>");return n}async function jIn(t,e){let n=await Ar(t,{...e,taskHint:"text-generation",chatCompletion:!0});if(!(typeof n=="object"&&Array.isArray(n?.choices)&&typeof n?.created=="number"&&typeof n?.id=="string"&&typeof n?.model=="string"&&typeof n?.system_fingerprint=="string"&&typeof n?.usage=="object"))throw new Dr("Expected ChatCompletionOutput");return n}async function*OIn(t,e){yield*DP(t,{...e,taskHint:"text-generation",chatCompletion:!0})}async function UIn(t,e){let n={...t,inputs:{question:t.inputs.question,image:hZe(new Uint8Array(t.inputs.image instanceof ArrayBuffer?t.inputs.image:await t.inputs.image.arrayBuffer()))}},l=kSe(await Ar(n,{...e,taskHint:"document-question-answering"}))?.[0];if(!(typeof l?.answer=="string"&&(typeof l.end=="number"||typeof l.end>"u")&&(typeof l.score=="number"||typeof l.score>"u")&&(typeof l.start=="number"||typeof l.start>"u")))throw new Dr("Expected Array<{answer: string, end?: number, score?: number, start?: number}>");return l}async function zIn(t,e){let n={...t,inputs:{question:t.inputs.question,image:hZe(new Uint8Array(t.inputs.image instanceof ArrayBuffer?t.inputs.image:await t.inputs.image.arrayBuffer()))}},l=(await Ar(n,{...e,taskHint:"visual-question-answering"}))?.[0];if(!(typeof l?.answer=="string"&&typeof l.score=="number"))throw new Dr("Expected Array<{answer: string, score: number}>");return l}async function BIn(t,e){let n=await Ar(t,{...e,taskHint:"tabular-regression"});if(!(Array.isArray(n)&&n.every(I=>typeof I=="number")))throw new Dr("Expected number[]");return n}async function SIn(t,e){let n=await Ar(t,{...e,taskHint:"tabular-classification"});if(!(Array.isArray(n)&&n.every(I=>typeof I=="number")))throw new Dr("Expected number[]");return n}var ApI,FpI,LSe,xO,wpI,HpI,bIn,dIn,mZe,Dr,CpI,MIn,DIn=B(()=>{ApI=Object.defineProperty,FpI=(t,e)=>{for(var n in e)ApI(t,n,{get:e[n],enumerable:!0})},LSe={};FpI(LSe,{audioClassification:()=>hIn,audioToAudio:()=>NIn,automaticSpeechRecognition:()=>ZIn,chatCompletion:()=>jIn,chatCompletionStream:()=>OIn,documentQuestionAnswering:()=>UIn,featureExtraction:()=>vIn,fillMask:()=>fIn,imageClassification:()=>VIn,imageSegmentation:()=>YIn,imageToImage:()=>AIn,imageToText:()=>gIn,objectDetection:()=>RIn,questionAnswering:()=>XIn,request:()=>Ar,sentenceSimilarity:()=>wIn,streamingRequest:()=>DP,summarization:()=>HIn,tableQuestionAnswering:()=>QIn,tabularClassification:()=>SIn,tabularRegression:()=>BIn,textClassification:()=>EIn,textGeneration:()=>JIn,textGenerationStream:()=>CIn,textToImage:()=>yIn,textToSpeech:()=>WIn,tokenClassification:()=>LIn,translation:()=>kIn,visualQuestionAnswering:()=>zIn,zeroShotClassification:()=>xIn,zeroShotImageClassification:()=>FIn});xO=new Map,wpI=10*60*1e3,HpI=1e3,bIn="https://huggingface.co";dIn="https://api-inference.huggingface.co",mZe=null;Dr=class extends TypeError{constructor(t){super(`Invalid inference output: ${t}. Use the 'request' method with the same parameters to do a custom call with no type checking.`),this.name="InferenceOutputError"}};CpI=class{accessToken;defaultOptions;constructor(t="",e={}){this.accessToken=t,this.defaultOptions=e;for(let[n,l]of Object.entries(LSe))Object.defineProperty(this,n,{enumerable:!1,value:(I,a)=>l({...I,accessToken:t},{...e,...a})})}endpoint(t){return new MIn(t,this.accessToken,this.defaultOptions)}},MIn=class{constructor(t,e="",n={}){for(let[l,I]of Object.entries(LSe))Object.defineProperty(this,l,{enumerable:!1,value:(a,c)=>I({...a,accessToken:e,endpointUrl:t},{...n,...c})})}}});var xSe,KIn=B(()=>{ESe();JSe();CSe();xSe=class t extends kO{get lc_secrets(){return{apiKey:"HUGGINGFACEHUB_API_KEY"}}constructor(e){if(super(e??{}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"gpt2"}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stopSequences",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topK",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"frequencyPenalty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endpointUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"includeCredentials",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.model=e?.model??this.model,this.temperature=e?.temperature??this.temperature,this.maxTokens=e?.maxTokens??this.maxTokens,this.stopSequences=e?.stopSequences??this.stopSequences,this.topP=e?.topP??this.topP,this.topK=e?.topK??this.topK,this.frequencyPenalty=e?.frequencyPenalty??this.frequencyPenalty,this.apiKey=e?.apiKey??Hm("HUGGINGFACEHUB_API_KEY"),this.endpointUrl=e?.endpointUrl,this.includeCredentials=e?.includeCredentials,!this.apiKey)throw new Error('Please set an API key for HuggingFace Hub in the environment variable "HUGGINGFACEHUB_API_KEY" or in the apiKey field of the HuggingFaceInference constructor.')}_llmType(){return"hf"}invocationParams(e){return{model:this.model,parameters:{return_full_text:!1,temperature:this.temperature,max_new_tokens:this.maxTokens,stop:e?.stop??this.stopSequences,top_p:this.topP,top_k:this.topK,repetition_penalty:this.frequencyPenalty}}}async*_streamResponseChunks(e,n,l){let I=await this._prepareHFInference(),a=await this.caller.call(async()=>I.textGenerationStream({...this.invocationParams(n),inputs:e}));for await(let c of a){let i=c.token.text;yield new cZ({text:i,generationInfo:c}),await l?.handleLLMNewToken(i??""),c.generated_text&&(yield new cZ({text:"",generationInfo:{finished:!0}}))}}async _call(e,n){let l=await this._prepareHFInference(),I={...this.invocationParams(n),inputs:e};return(await this.caller.callWithOptions({signal:n.signal},l.textGeneration.bind(l),I)).generated_text}async _prepareHFInference(){let{HfInference:e}=await t.imports(),n=new e(this.apiKey,{includeCredentials:this.includeCredentials});return this.endpointUrl?n.endpoint(this.endpointUrl):n}static async imports(){try{let{HfInference:e}=await Promise.resolve().then(()=>(DIn(),TIn));return{HfInference:e}}catch{throw new Error("Please install huggingface as a dependency with, e.g. `yarn add @huggingface/inference`")}}}});var _In={};Xe(_In,{HuggingFaceInference:()=>xSe});var PIn=B(()=>{KIn()});function An(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n}function je(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)}var Yw=B(()=>{});var jSe,$In=B(()=>{jSe=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return jSe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),n=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,l=>(+l^n()&15>>+l/4).toString(16))}});function OF(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var _P,jO=B(()=>{_P=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)}});var Yn,Bd,kG,gw,OO,UO,zO,BO,SO,MO,TO,DO,KO,HR=B(()=>{jO();Yn=class extends Error{},Bd=class t extends Yn{constructor(e,n,l,I){super(`${t.makeMessage(e,n,l)}`),this.status=e,this.headers=I,this.requestID=I?.get("request-id"),this.error=n}static makeMessage(e,n,l){let I=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):l;return e&&I?`${e} ${I}`:e?`${e} status code (no body)`:I||"(no status code or body)"}static generate(e,n,l,I){if(!e||!I)return new gw({message:l,cause:_P(n)});let a=n;return e===400?new UO(e,a,l,I):e===401?new zO(e,a,l,I):e===403?new BO(e,a,l,I):e===404?new SO(e,a,l,I):e===409?new MO(e,a,l,I):e===422?new TO(e,a,l,I):e===429?new DO(e,a,l,I):e>=500?new KO(e,a,l,I):new t(e,a,l,I)}},kG=class extends Bd{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},gw=class extends Bd{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}},OO=class extends gw{constructor({message:e}={}){super({message:e??"Request timed out."})}},UO=class extends Bd{},zO=class extends Bd{},BO=class extends Bd{},SO=class extends Bd{},MO=class extends Bd{},TO=class extends Bd{},DO=class extends Bd{},KO=class extends Bd{}});function zSe(t){return typeof t!="object"?{}:t??{}}function tan(t){if(!t)return!0;for(let e in t)return!1;return!0}function nan(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var kpI,ean,OSe,USe,lan,ZZe,LJ=B(()=>{HR();kpI=/^[a-z][a-z0-9+.-]*:/i,ean=t=>kpI.test(t),OSe=t=>(OSe=Array.isArray,OSe(t)),USe=OSe;lan=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Yn(`${t} must be an integer`);if(e<0)throw new Yn(`${t} must be a positive integer`);return e},ZZe=t=>{try{return JSON.parse(t)}catch{return}}});var Ian,aan=B(()=>{Ian=t=>new Promise(e=>setTimeout(e,t))});var Rw,BSe=B(()=>{Rw="0.56.0"});function xpI(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function OpI(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:n}of t){let l=n.exec(navigator.userAgent);if(l){let I=l[1]||0,a=l[2]||0,c=l[3]||0;return{browser:e,version:`${I}.${a}.${c}`}}}return null}var ian,jpI,ran,can,oan,san,SSe=B(()=>{BSe();ian=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";jpI=()=>{let t=xpI();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Rw,"X-Stainless-OS":can(Deno.build.os),"X-Stainless-Arch":ran(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Rw,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Rw,"X-Stainless-OS":can(globalThis.process.platform??"unknown"),"X-Stainless-Arch":ran(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=OpI();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Rw,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Rw,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};ran=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",can=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),san=()=>oan??(oan=jpI())});function uan(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function MSe(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function WZe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return MSe({start(){},async pull(n){let{done:l,value:I}=await e.next();l?n.close():n.enqueue(I)},async cancel(){await e.return?.()}})}function PP(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let n=await e.read();return n?.done&&e.releaseLock(),n}catch(n){throw e.releaseLock(),n}},async return(){let n=e.cancel();return e.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function dan(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),n=e.cancel();e.releaseLock(),await n}var _O=B(()=>{});var Gan,ban=B(()=>{Gan=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)})});function han(t){let e=0;for(let I of t)e+=I.length;let n=new Uint8Array(e),l=0;for(let I of t)n.set(I,l),l+=I.length;return n}function qP(t){let e;return(man??(e=new globalThis.TextEncoder,man=e.encode.bind(e)))(t)}function TSe(t){let e;return(pan??(e=new globalThis.TextDecoder,pan=e.decode.bind(e)))(t)}var man,pan,DSe=B(()=>{});function BpI(t,e){for(let I=e??0;I{Yw();DSe();UF=class{constructor(){oZ.set(this,void 0),iZ.set(this,void 0),An(this,oZ,new Uint8Array,"f"),An(this,iZ,null,"f")}decode(e){if(e==null)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?qP(e):e;An(this,oZ,han([je(this,oZ,"f"),n]),"f");let l=[],I;for(;(I=BpI(je(this,oZ,"f"),je(this,iZ,"f")))!=null;){if(I.carriage&&je(this,iZ,"f")==null){An(this,iZ,I.index,"f");continue}if(je(this,iZ,"f")!=null&&(I.index!==je(this,iZ,"f")+1||I.carriage)){l.push(TSe(je(this,oZ,"f").subarray(0,je(this,iZ,"f")-1))),An(this,oZ,je(this,oZ,"f").subarray(je(this,iZ,"f")),"f"),An(this,iZ,null,"f");continue}let a=je(this,iZ,"f")!==null?I.preceding-1:I.preceding,c=TSe(je(this,oZ,"f").subarray(0,a));l.push(c),An(this,oZ,je(this,oZ,"f").subarray(I.index),"f"),An(this,iZ,null,"f")}return l}flush(){return je(this,oZ,"f").length?this.decode(` +`):[]}};oZ=new WeakMap,iZ=new WeakMap;UF.NEWLINE_CHARS=new Set([` +`,"\r"]);UF.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function $P(){}function NZe(t,e,n){return!e||VZe[t]>VZe[n]?$P:e[t].bind(e)}function Sd(t){let e=t.logger,n=t.logLevel??"off";if(!e)return SpI;let l=Wan.get(e);if(l&&l[0]===n)return l[1];let I={error:NZe("error",e,n),warn:NZe("warn",e,n),info:NZe("info",e,n),debug:NZe("debug",e,n)};return Wan.set(e,[n,I]),I}var VZe,_Se,SpI,Wan,zF,YZe=B(()=>{LJ();VZe={off:0,error:200,warn:300,info:400,debug:500},_Se=(t,e,n)=>{if(t){if(nan(VZe,t))return t;Sd(n).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(VZe))}`)}};SpI={error:$P,warn:$P,info:$P,debug:$P},Wan=new WeakMap;zF=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,n])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t)});async function*MpI(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Yn("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Yn("Attempted to iterate over a response with no body");let n=new PSe,l=new UF,I=PP(t.body);for await(let a of TpI(I))for(let c of l.decode(a)){let i=n.decode(c);i&&(yield i)}for(let a of l.flush()){let c=n.decode(a);c&&(yield c)}}async function*TpI(t){let e=new Uint8Array;for await(let n of t){if(n==null)continue;let l=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?qP(n):n,I=new Uint8Array(e.length+l.length);I.set(e),I.set(l,e.length),e=I;let a;for(;(a=Zan(e))!==-1;)yield e.slice(0,a),e=e.slice(a)}e.length>0&&(yield e)}function DpI(t,e){let n=t.indexOf(e);return n!==-1?[t.substring(0,n),e,t.substring(n+e.length)]:[t,"",""]}var e6,QR,PSe,qSe=B(()=>{Yw();HR();_O();KSe();_O();jO();LJ();DSe();YZe();HR();QR=class t{constructor(e,n,l){this.iterator=e,e6.set(this,void 0),this.controller=n,An(this,e6,l,"f")}static fromSSEResponse(e,n,l){let I=!1,a=l?Sd(l):console;async function*c(){if(I)throw new Yn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");I=!0;let i=!1;try{for await(let s of MpI(e,n)){if(s.event==="completion")try{yield JSON.parse(s.data)}catch(r){throw a.error("Could not parse message into JSON:",s.data),a.error("From chunk:",s.raw),r}if(s.event==="message_start"||s.event==="message_delta"||s.event==="message_stop"||s.event==="content_block_start"||s.event==="content_block_delta"||s.event==="content_block_stop")try{yield JSON.parse(s.data)}catch(r){throw a.error("Could not parse message into JSON:",s.data),a.error("From chunk:",s.raw),r}if(s.event!=="ping"&&s.event==="error")throw new Bd(void 0,ZZe(s.data)??s.data,void 0,e.headers)}i=!0}catch(s){if(OF(s))return;throw s}finally{i||n.abort()}}return new t(c,n,l)}static fromReadableStream(e,n,l){let I=!1;async function*a(){let i=new UF,s=PP(e);for await(let r of s)for(let u of i.decode(r))yield u;for(let r of i.flush())yield r}async function*c(){if(I)throw new Yn("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");I=!0;let i=!1;try{for await(let s of a())i||s&&(yield JSON.parse(s));i=!0}catch(s){if(OF(s))return;throw s}finally{i||n.abort()}}return new t(c,n,l)}[(e6=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],n=[],l=this.iterator(),I=a=>({next:()=>{if(a.length===0){let c=l.next();e.push(c),n.push(c)}return a.shift()}});return[new t(()=>I(e),this.controller,je(this,e6,"f")),new t(()=>I(n),this.controller,je(this,e6,"f"))]}toReadableStream(){let e=this,n;return MSe({async start(){n=e[Symbol.asyncIterator]()},async pull(l){try{let{value:I,done:a}=await n.next();if(a)return l.close();let c=qP(JSON.stringify(I)+` +`);l.enqueue(c)}catch(I){l.error(I)}},async cancel(){await n.return?.()}})}};PSe=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let a={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],a}if(this.chunks.push(e),e.startsWith(":"))return null;let[n,l,I]=DpI(e,":");return I.startsWith(" ")&&(I=I.substring(1)),n==="event"?this.event=I:n==="data"&&this.data.push(I),null}}});async function gZe(t,e){let{response:n,requestLogID:l,retryOfRequestLogID:I,startTime:a}=e,c=await(async()=>{if(e.options.stream)return Sd(t).debug("response",n.status,n.url,n.headers,n.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(n,e.controller,t):QR.fromSSEResponse(n,e.controller,t);if(n.status===204)return null;if(e.options.__binaryResponse)return n;let s=n.headers.get("content-type")?.split(";")[0]?.trim();if(s?.includes("application/json")||s?.endsWith("+json")){let o=await n.json();return $Se(o,n)}return await n.text()})();return Sd(t).debug(`[${l}] response parsed`,zF({retryOfRequestLogID:I,url:n.url,status:n.status,body:c,durationMs:Date.now()-a})),c}function $Se(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var eMe=B(()=>{qSe();YZe()});var t6,kJ,RZe=B(()=>{Yw();eMe();kJ=class t extends Promise{constructor(e,n,l=gZe){super(I=>{I(null)}),this.responsePromise=n,this.parseResponse=l,t6.set(this,void 0),An(this,t6,e,"f")}_thenUnwrap(e){return new t(je(this,t6,"f"),this.responsePromise,async(n,l)=>$Se(e(await this.parseResponse(n,l),l),l.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:n,request_id:n.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(je(this,t6,"f"),e))),this.parsedPromise}then(e,n){return this.parse().then(e,n)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};t6=new WeakMap});var yZe,tMe,n6,rN,yw=B(()=>{Yw();HR();eMe();RZe();LJ();tMe=class{constructor(e,n,l,I){yZe.set(this,void 0),An(this,yZe,e,"f"),this.options=I,this.response=n,this.body=l}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Yn("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await je(this,yZe,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(yZe=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let n of e.getPaginatedItems())yield n}},n6=class extends kJ{constructor(e,n,l){super(e,n,async(I,a)=>new l(I,a.response,await gZe(I,a),a.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let n of e)yield n}},rN=class extends tMe{constructor(e,n,l,I){super(e,n,l,I),this.data=l.data||[],this.has_more=l.has_more||!1,this.first_id=l.first_id||null,this.last_id=l.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...zSe(this.options.query),before_id:n}}:null}let e=this.last_id;return e?{...this.options,query:{...zSe(this.options.query),after_id:e}}:null}}});function xJ(t,e,n){return lMe(),new File(t,e??"unknown_file",n)}function l6(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}function _pI(t){let e=typeof t=="function"?t:t.fetch,n=Nan.get(e);if(n)return n;let l=(async()=>{try{let I="Response"in e?e.Response:(await e("data:,")).constructor,a=new FormData;return a.toString()!==await new I(a).text()}catch{return!0}})();return Nan.set(e,l),l}var lMe,IMe,Van,Nan,PpI,qpI,nMe,AZe=B(()=>{_O();lMe=()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};IMe=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",Van=async(t,e)=>({...t,body:await PpI(t.body,e)}),Nan=new WeakMap;PpI=async(t,e)=>{if(!await _pI(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([l,I])=>nMe(n,l,I))),n},qpI=t=>t instanceof Blob&&"name"in t,nMe=async(t,e,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")t.append(e,String(n));else if(n instanceof Response){let l={},I=n.headers.get("Content-Type");I&&(l={type:I}),t.append(e,xJ([await n.blob()],l6(n),l))}else if(IMe(n))t.append(e,xJ([await new Response(WZe(n)).blob()],l6(n)));else if(qpI(n))t.append(e,xJ([n],l6(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(l=>nMe(t,e+"[]",l)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([l,I])=>nMe(t,`${e}[${l}]`,I)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}});async function FZe(t,e,n){if(lMe(),t=await t,e||(e=l6(t)),$pI(t))return t instanceof File&&e==null&&n==null?t:xJ([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...n});if(ehI(t)){let I=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),xJ(await aMe(I),e,n)}let l=await aMe(t);if(!n?.type){let I=l.find(a=>typeof a=="object"&&"type"in a&&a.type);typeof I=="string"&&(n={...n,type:I})}return xJ(l,e,n)}async function aMe(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(Yan(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(IMe(t))for await(let n of t)e.push(...await aMe(n));else{let n=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${n?`; constructor: ${n}`:""}${thI(t)}`)}return e}function thI(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(n=>`"${n}"`).join(", ")}]`}var Yan,$pI,ehI,gan=B(()=>{AZe();AZe();Yan=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",$pI=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&Yan(t),ehI=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function"});var rMe=B(()=>{gan()});var Ran=B(()=>{});var zu,ER=B(()=>{zu=class{constructor(e){this._client=e}}});function*lhI(t){if(!t)return;if(yan in t){let{values:l,nulls:I}=t;yield*l.entries();for(let a of I)yield[a,null];return}let e=!1,n;t instanceof Headers?n=t.entries():USe(t)?n=t:(e=!0,n=Object.entries(t??{}));for(let l of n){let I=l[0];if(typeof I!="string")throw new TypeError("expected header name to be a string");let a=USe(l[1])?l[1]:[l[1]],c=!1;for(let i of a)i!==void 0&&(e&&!c&&(c=!0,yield[I,null]),yield[I,i])}}var yan,Gr,BF=B(()=>{LJ();yan=Symbol.for("brand.privateNullableHeaders");Gr=t=>{let e=new Headers,n=new Set;for(let l of t){let I=new Set;for(let[a,c]of lhI(l)){let i=a.toLowerCase();I.has(i)||(e.delete(a),I.add(i)),c===null?(e.delete(a),n.add(i)):(e.append(a,c),n.delete(i))}}return{[yan]:!0,values:e,nulls:n}}});function Fan(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Aan,IhI,Ob,PO=B(()=>{HR();Aan=Object.freeze(Object.create(null)),IhI=(t=Fan)=>function(n,...l){if(n.length===1)return n[0];let I=!1,a=[],c=n.reduce((u,o,d)=>{/[?#]/.test(o)&&(I=!0);let b=l[d],h=(I?encodeURIComponent:t)(""+b);return d!==l.length&&(b==null||typeof b=="object"&&b.toString===Object.getPrototypeOf(Object.getPrototypeOf(b.hasOwnProperty??Aan)??Aan)?.toString)&&(h=b+"",a.push({start:u.length+o.length,length:h.length,error:`Value of type ${Object.prototype.toString.call(b).slice(8,-1)} is not a valid path parameter`})),u+o+(d===l.length?"":h)},""),i=c.split(/[?#]/,1)[0],s=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,r;for(;(r=s.exec(i))!==null;)a.push({start:r.index,length:r[0].length,error:`Value "${r[0]}" can't be safely passed as a path parameter`});if(a.sort((u,o)=>u.start-o.start),a.length>0){let u=0,o=a.reduce((d,b)=>{let h=" ".repeat(b.start-u),Z="^".repeat(b.length);return u=b.start+b.length,d+h+Z},"");throw new Yn(`Path parameters result in path with invalid segments: +${a.map(d=>d.error).join(` +`)} +${c} +${o}`)}return c},Ob=IhI(Fan)});var qO,cMe=B(()=>{ER();yw();BF();AZe();PO();qO=class extends zu{list(e={},n){let{betas:l,...I}=e??{};return this._client.getAPIList("/v1/files",rN,{query:I,...n,headers:Gr([{"anthropic-beta":[...l??[],"files-api-2025-04-14"].toString()},n?.headers])})}delete(e,n={},l){let{betas:I}=n??{};return this._client.delete(Ob`/v1/files/${e}`,{...l,headers:Gr([{"anthropic-beta":[...I??[],"files-api-2025-04-14"].toString()},l?.headers])})}download(e,n={},l){let{betas:I}=n??{};return this._client.get(Ob`/v1/files/${e}/content`,{...l,headers:Gr([{"anthropic-beta":[...I??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},l?.headers]),__binaryResponse:!0})}retrieveMetadata(e,n={},l){let{betas:I}=n??{};return this._client.get(Ob`/v1/files/${e}`,{...l,headers:Gr([{"anthropic-beta":[...I??[],"files-api-2025-04-14"].toString()},l?.headers])})}upload(e,n){let{betas:l,...I}=e;return this._client.post("/v1/files",Van({body:I,...n,headers:Gr([{"anthropic-beta":[...l??[],"files-api-2025-04-14"].toString()},n?.headers])},this._client))}}});var $O,oMe=B(()=>{ER();yw();BF();PO();$O=class extends zu{retrieve(e,n={},l){let{betas:I}=n??{};return this._client.get(Ob`/v1/models/${e}?beta=true`,{...l,headers:Gr([{...I?.toString()!=null?{"anthropic-beta":I?.toString()}:void 0},l?.headers])})}list(e={},n){let{betas:l,...I}=e??{};return this._client.getAPIList("/v1/models?beta=true",rN,{query:I,...n,headers:Gr([{...l?.toString()!=null?{"anthropic-beta":l?.toString()}:void 0},n?.headers])})}}});var eU,iMe=B(()=>{HR();_O();KSe();eU=class t{constructor(e,n){this.iterator=e,this.controller=n}async*decoder(){let e=new UF;for await(let n of this.iterator)for(let l of e.decode(n))yield JSON.parse(l);for(let n of e.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Yn("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Yn("Attempted to iterate over a response with no body");return new t(PP(e.body),n)}}});var I6=B(()=>{HR()});var tU,sMe=B(()=>{ER();yw();BF();iMe();I6();PO();tU=class extends zu{create(e,n){let{betas:l,...I}=e;return this._client.post("/v1/messages/batches?beta=true",{body:I,...n,headers:Gr([{"anthropic-beta":[...l??[],"message-batches-2024-09-24"].toString()},n?.headers])})}retrieve(e,n={},l){let{betas:I}=n??{};return this._client.get(Ob`/v1/messages/batches/${e}?beta=true`,{...l,headers:Gr([{"anthropic-beta":[...I??[],"message-batches-2024-09-24"].toString()},l?.headers])})}list(e={},n){let{betas:l,...I}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",rN,{query:I,...n,headers:Gr([{"anthropic-beta":[...l??[],"message-batches-2024-09-24"].toString()},n?.headers])})}delete(e,n={},l){let{betas:I}=n??{};return this._client.delete(Ob`/v1/messages/batches/${e}?beta=true`,{...l,headers:Gr([{"anthropic-beta":[...I??[],"message-batches-2024-09-24"].toString()},l?.headers])})}cancel(e,n={},l){let{betas:I}=n??{};return this._client.post(Ob`/v1/messages/batches/${e}/cancel?beta=true`,{...l,headers:Gr([{"anthropic-beta":[...I??[],"message-batches-2024-09-24"].toString()},l?.headers])})}async results(e,n={},l){let I=await this.retrieve(e);if(!I.results_url)throw new Yn(`No batch \`results_url\`; Has it finished processing? ${I.processing_status} - ${I.id}`);let{betas:a}=n??{};return this._client.get(I.results_url,{...l,headers:Gr([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},l?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,i)=>eU.fromResponse(i.response,i.controller))}}});var uMe=B(()=>{qSe()});var ohI,nU,ihI,shI,vZe,dMe=B(()=>{ohI=t=>{let e=0,n=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),nU(t);break;case"number":let n=e.value[e.value.length-1];if(n==="."||n==="-")return t=t.slice(0,t.length-1),nU(t);case"string":let l=t[t.length-2];if(l?.type==="delimiter")return t=t.slice(0,t.length-1),nU(t);if(l?.type==="brace"&&l.value==="{")return t=t.slice(0,t.length-1),nU(t);break;case"delimiter":return t=t.slice(0,t.length-1),nU(t);break}return t},ihI=t=>{let e=[];return t.map(n=>{n.type==="brace"&&(n.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(n=>{n==="}"?t.push({type:"brace",value:"}"}):n==="]"&&t.push({type:"paren",value:"]"})}),t},shI=t=>{let e="";return t.map(n=>{switch(n.type){case"string":e+='"'+n.value+'"';break;default:e+=n.value;break}}),e},vZe=t=>JSON.parse(shI(ihI(nU(ohI(t)))))});function wan(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var cN,Aw,a6,fZe,r6,c6,XZe,o6,SF,i6,wZe,HZe,lU,QZe,EZe,GMe,van,JZe,bMe,mMe,pMe,fan,Xan,CZe,Han=B(()=>{Yw();jO();I6();uMe();dMe();Xan="__json_buf";CZe=class t{constructor(){cN.add(this),this.messages=[],this.receivedMessages=[],Aw.set(this,void 0),this.controller=new AbortController,a6.set(this,void 0),fZe.set(this,()=>{}),r6.set(this,()=>{}),c6.set(this,void 0),XZe.set(this,()=>{}),o6.set(this,()=>{}),SF.set(this,{}),i6.set(this,!1),wZe.set(this,!1),HZe.set(this,!1),lU.set(this,!1),QZe.set(this,void 0),EZe.set(this,void 0),JZe.set(this,e=>{if(An(this,wZe,!0,"f"),OF(e)&&(e=new kG),e instanceof kG)return An(this,HZe,!0,"f"),this._emit("abort",e);if(e instanceof Yn)return this._emit("error",e);if(e instanceof Error){let n=new Yn(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new Yn(String(e)))}),An(this,a6,new Promise((e,n)=>{An(this,fZe,e,"f"),An(this,r6,n,"f")}),"f"),An(this,c6,new Promise((e,n)=>{An(this,XZe,e,"f"),An(this,o6,n,"f")}),"f"),je(this,a6,"f").catch(()=>{}),je(this,c6,"f").catch(()=>{})}get response(){return je(this,QZe,"f")}get request_id(){return je(this,EZe,"f")}async withResponse(){let e=await je(this,a6,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let n=new t;return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,l){let I=new t;for(let a of n.messages)I._addMessageParam(a);return I._run(()=>I._createMessage(e,{...n,stream:!0},{...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"stream"}})),I}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},je(this,JZe,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,l){let I=l?.signal,a;I&&(I.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),I.addEventListener("abort",a));try{je(this,cN,"m",bMe).call(this);let{response:c,data:i}=await e.create({...n,stream:!0},{...l,signal:this.controller.signal}).withResponse();this._connected(c);for await(let s of i)je(this,cN,"m",mMe).call(this,s);if(i.controller.signal?.aborted)throw new kG;je(this,cN,"m",pMe).call(this)}finally{I&&a&&I.removeEventListener("abort",a)}}_connected(e){this.ended||(An(this,QZe,e,"f"),An(this,EZe,e?.headers.get("request-id"),"f"),je(this,fZe,"f").call(this,e),this._emit("connect"))}get ended(){return je(this,i6,"f")}get errored(){return je(this,wZe,"f")}get aborted(){return je(this,HZe,"f")}abort(){this.controller.abort()}on(e,n){return(je(this,SF,"f")[e]||(je(this,SF,"f")[e]=[])).push({listener:n}),this}off(e,n){let l=je(this,SF,"f")[e];if(!l)return this;let I=l.findIndex(a=>a.listener===n);return I>=0&&l.splice(I,1),this}once(e,n){return(je(this,SF,"f")[e]||(je(this,SF,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,l)=>{An(this,lU,!0,"f"),e!=="error"&&this.once("error",l),this.once(e,n)})}async done(){An(this,lU,!0,"f"),await je(this,c6,"f")}get currentMessage(){return je(this,Aw,"f")}async finalMessage(){return await this.done(),je(this,cN,"m",GMe).call(this)}async finalText(){return await this.done(),je(this,cN,"m",van).call(this)}_emit(e,...n){if(je(this,i6,"f"))return;e==="end"&&(An(this,i6,!0,"f"),je(this,XZe,"f").call(this));let l=je(this,SF,"f")[e];if(l&&(je(this,SF,"f")[e]=l.filter(I=>!I.once),l.forEach(({listener:I})=>I(...n))),e==="abort"){let I=n[0];!je(this,lU,"f")&&!l?.length&&Promise.reject(I),je(this,r6,"f").call(this,I),je(this,o6,"f").call(this,I),this._emit("end");return}if(e==="error"){let I=n[0];!je(this,lU,"f")&&!l?.length&&Promise.reject(I),je(this,r6,"f").call(this,I),je(this,o6,"f").call(this,I),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",je(this,cN,"m",GMe).call(this))}async _fromReadableStream(e,n){let l=n?.signal,I;l&&(l.aborted&&this.controller.abort(),I=this.controller.abort.bind(this.controller),l.addEventListener("abort",I));try{je(this,cN,"m",bMe).call(this),this._connected(null);let a=QR.fromReadableStream(e,this.controller);for await(let c of a)je(this,cN,"m",mMe).call(this,c);if(a.controller.signal?.aborted)throw new kG;je(this,cN,"m",pMe).call(this)}finally{l&&I&&l.removeEventListener("abort",I)}}[(Aw=new WeakMap,a6=new WeakMap,fZe=new WeakMap,r6=new WeakMap,c6=new WeakMap,XZe=new WeakMap,o6=new WeakMap,SF=new WeakMap,i6=new WeakMap,wZe=new WeakMap,HZe=new WeakMap,lU=new WeakMap,QZe=new WeakMap,EZe=new WeakMap,JZe=new WeakMap,cN=new WeakSet,GMe=function(){if(this.receivedMessages.length===0)throw new Yn("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},van=function(){if(this.receivedMessages.length===0)throw new Yn("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(l=>l.type==="text").map(l=>l.text);if(n.length===0)throw new Yn("stream ended without producing a content block with type=text");return n.join(" ")},bMe=function(){this.ended||An(this,Aw,void 0,"f")},mMe=function(n){if(this.ended)return;let l=je(this,cN,"m",fan).call(this,n);switch(this._emit("streamEvent",n,l),n.type){case"content_block_delta":{let I=l.content.at(-1);switch(n.delta.type){case"text_delta":{I.type==="text"&&this._emit("text",n.delta.text,I.text||"");break}case"citations_delta":{I.type==="text"&&this._emit("citation",n.delta.citation,I.citations??[]);break}case"input_json_delta":{wan(I)&&I.input&&this._emit("inputJson",n.delta.partial_json,I.input);break}case"thinking_delta":{I.type==="thinking"&&this._emit("thinking",n.delta.thinking,I.thinking);break}case"signature_delta":{I.type==="thinking"&&this._emit("signature",I.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(l),this._addMessage(l,!0);break}case"content_block_stop":{this._emit("contentBlock",l.content.at(-1));break}case"message_start":{An(this,Aw,l,"f");break}case"content_block_start":case"message_delta":break}},pMe=function(){if(this.ended)throw new Yn("stream has ended, this shouldn't happen");let n=je(this,Aw,"f");if(!n)throw new Yn("request ended without sending any chunks");return An(this,Aw,void 0,"f"),n},fan=function(n){let l=je(this,Aw,"f");if(n.type==="message_start"){if(l)throw new Yn(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!l)throw new Yn(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return l;case"message_delta":return l.container=n.delta.container,l.stop_reason=n.delta.stop_reason,l.stop_sequence=n.delta.stop_sequence,l.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(l.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(l.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(l.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(l.usage.server_tool_use=n.usage.server_tool_use),l;case"content_block_start":return l.content.push(n.content_block),l;case"content_block_delta":{let I=l.content.at(n.index);switch(n.delta.type){case"text_delta":{I?.type==="text"&&(l.content[n.index]={...I,text:(I.text||"")+n.delta.text});break}case"citations_delta":{I?.type==="text"&&(l.content[n.index]={...I,citations:[...I.citations??[],n.delta.citation]});break}case"input_json_delta":{if(I&&wan(I)){let a=I[Xan]||"";a+=n.delta.partial_json;let c={...I};if(Object.defineProperty(c,Xan,{value:a,enumerable:!1,writable:!0}),a)try{c.input=vZe(a)}catch(i){let s=new Yn(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${a}`);je(this,JZe,"f").call(this,s)}l.content[n.index]=c}break}case"thinking_delta":{I?.type==="thinking"&&(l.content[n.index]={...I,thinking:I.thinking+n.delta.thinking});break}case"signature_delta":{I?.type==="thinking"&&(l.content[n.index]={...I,signature:n.delta.signature});break}default:n.delta}return l}case"content_block_stop":return l}},Symbol.asyncIterator)](){let e=[],n=[],l=!1;return this.on("streamEvent",I=>{let a=n.shift();a?a.resolve(I):e.push(I)}),this.on("end",()=>{l=!0;for(let I of n)I.resolve(void 0);n.length=0}),this.on("abort",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),this.on("error",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:l?{value:void 0,done:!0}:new Promise((a,c)=>n.push({resolve:a,reject:c})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new QR(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var LZe,hMe=B(()=>{LZe={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192}});var Qan,jJ,ZMe=B(()=>{ER();sMe();sMe();BF();Han();hMe();Qan={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"},jJ=class extends zu{constructor(){super(...arguments),this.batches=new tU(this._client)}create(e,n){let{betas:l,...I}=e;I.model in Qan&&console.warn(`The model '${I.model}' is deprecated and will reach end-of-life on ${Qan[I.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!I.stream&&a==null){let c=LZe[I.model]??void 0;a=this._client.calculateNonstreamingTimeout(I.max_tokens,c)}return this._client.post("/v1/messages?beta=true",{body:I,timeout:a??6e5,...n,headers:Gr([{...l?.toString()!=null?{"anthropic-beta":l?.toString()}:void 0},n?.headers]),stream:e.stream??!1})}stream(e,n){return CZe.createMessage(this,e,n)}countTokens(e,n){let{betas:l,...I}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:I,...n,headers:Gr([{"anthropic-beta":[...l??[],"token-counting-2024-11-01"].toString()},n?.headers])})}};jJ.Batches=tU});var JR,WMe=B(()=>{ER();cMe();cMe();oMe();oMe();ZMe();ZMe();JR=class extends zu{constructor(){super(...arguments),this.models=new $O(this._client),this.messages=new jJ(this._client),this.files=new qO(this._client)}};JR.Models=$O;JR.Messages=jJ;JR.Files=qO});var OJ,NMe=B(()=>{ER();BF();OJ=class extends zu{create(e,n){let{betas:l,...I}=e;return this._client.post("/v1/complete",{body:I,timeout:this._client._options.timeout??6e5,...n,headers:Gr([{...l?.toString()!=null?{"anthropic-beta":l?.toString()}:void 0},n?.headers]),stream:e.stream??!1})}}});function Lan(t){return t.type==="tool_use"||t.type==="server_tool_use"}var oN,Fw,s6,kZe,u6,d6,xZe,G6,MF,b6,jZe,OZe,IU,UZe,zZe,VMe,Ean,YMe,gMe,RMe,yMe,Jan,Can,BZe,kan=B(()=>{Yw();jO();I6();uMe();dMe();Can="__json_buf";BZe=class t{constructor(){oN.add(this),this.messages=[],this.receivedMessages=[],Fw.set(this,void 0),this.controller=new AbortController,s6.set(this,void 0),kZe.set(this,()=>{}),u6.set(this,()=>{}),d6.set(this,void 0),xZe.set(this,()=>{}),G6.set(this,()=>{}),MF.set(this,{}),b6.set(this,!1),jZe.set(this,!1),OZe.set(this,!1),IU.set(this,!1),UZe.set(this,void 0),zZe.set(this,void 0),YMe.set(this,e=>{if(An(this,jZe,!0,"f"),OF(e)&&(e=new kG),e instanceof kG)return An(this,OZe,!0,"f"),this._emit("abort",e);if(e instanceof Yn)return this._emit("error",e);if(e instanceof Error){let n=new Yn(e.message);return n.cause=e,this._emit("error",n)}return this._emit("error",new Yn(String(e)))}),An(this,s6,new Promise((e,n)=>{An(this,kZe,e,"f"),An(this,u6,n,"f")}),"f"),An(this,d6,new Promise((e,n)=>{An(this,xZe,e,"f"),An(this,G6,n,"f")}),"f"),je(this,s6,"f").catch(()=>{}),je(this,d6,"f").catch(()=>{})}get response(){return je(this,UZe,"f")}get request_id(){return je(this,zZe,"f")}async withResponse(){let e=await je(this,s6,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let n=new t;return n._run(()=>n._fromReadableStream(e)),n}static createMessage(e,n,l){let I=new t;for(let a of n.messages)I._addMessageParam(a);return I._run(()=>I._createMessage(e,{...n,stream:!0},{...l,headers:{...l?.headers,"X-Stainless-Helper-Method":"stream"}})),I}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},je(this,YMe,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,n=!0){this.receivedMessages.push(e),n&&this._emit("message",e)}async _createMessage(e,n,l){let I=l?.signal,a;I&&(I.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),I.addEventListener("abort",a));try{je(this,oN,"m",gMe).call(this);let{response:c,data:i}=await e.create({...n,stream:!0},{...l,signal:this.controller.signal}).withResponse();this._connected(c);for await(let s of i)je(this,oN,"m",RMe).call(this,s);if(i.controller.signal?.aborted)throw new kG;je(this,oN,"m",yMe).call(this)}finally{I&&a&&I.removeEventListener("abort",a)}}_connected(e){this.ended||(An(this,UZe,e,"f"),An(this,zZe,e?.headers.get("request-id"),"f"),je(this,kZe,"f").call(this,e),this._emit("connect"))}get ended(){return je(this,b6,"f")}get errored(){return je(this,jZe,"f")}get aborted(){return je(this,OZe,"f")}abort(){this.controller.abort()}on(e,n){return(je(this,MF,"f")[e]||(je(this,MF,"f")[e]=[])).push({listener:n}),this}off(e,n){let l=je(this,MF,"f")[e];if(!l)return this;let I=l.findIndex(a=>a.listener===n);return I>=0&&l.splice(I,1),this}once(e,n){return(je(this,MF,"f")[e]||(je(this,MF,"f")[e]=[])).push({listener:n,once:!0}),this}emitted(e){return new Promise((n,l)=>{An(this,IU,!0,"f"),e!=="error"&&this.once("error",l),this.once(e,n)})}async done(){An(this,IU,!0,"f"),await je(this,d6,"f")}get currentMessage(){return je(this,Fw,"f")}async finalMessage(){return await this.done(),je(this,oN,"m",VMe).call(this)}async finalText(){return await this.done(),je(this,oN,"m",Ean).call(this)}_emit(e,...n){if(je(this,b6,"f"))return;e==="end"&&(An(this,b6,!0,"f"),je(this,xZe,"f").call(this));let l=je(this,MF,"f")[e];if(l&&(je(this,MF,"f")[e]=l.filter(I=>!I.once),l.forEach(({listener:I})=>I(...n))),e==="abort"){let I=n[0];!je(this,IU,"f")&&!l?.length&&Promise.reject(I),je(this,u6,"f").call(this,I),je(this,G6,"f").call(this,I),this._emit("end");return}if(e==="error"){let I=n[0];!je(this,IU,"f")&&!l?.length&&Promise.reject(I),je(this,u6,"f").call(this,I),je(this,G6,"f").call(this,I),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",je(this,oN,"m",VMe).call(this))}async _fromReadableStream(e,n){let l=n?.signal,I;l&&(l.aborted&&this.controller.abort(),I=this.controller.abort.bind(this.controller),l.addEventListener("abort",I));try{je(this,oN,"m",gMe).call(this),this._connected(null);let a=QR.fromReadableStream(e,this.controller);for await(let c of a)je(this,oN,"m",RMe).call(this,c);if(a.controller.signal?.aborted)throw new kG;je(this,oN,"m",yMe).call(this)}finally{l&&I&&l.removeEventListener("abort",I)}}[(Fw=new WeakMap,s6=new WeakMap,kZe=new WeakMap,u6=new WeakMap,d6=new WeakMap,xZe=new WeakMap,G6=new WeakMap,MF=new WeakMap,b6=new WeakMap,jZe=new WeakMap,OZe=new WeakMap,IU=new WeakMap,UZe=new WeakMap,zZe=new WeakMap,YMe=new WeakMap,oN=new WeakSet,VMe=function(){if(this.receivedMessages.length===0)throw new Yn("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Ean=function(){if(this.receivedMessages.length===0)throw new Yn("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(l=>l.type==="text").map(l=>l.text);if(n.length===0)throw new Yn("stream ended without producing a content block with type=text");return n.join(" ")},gMe=function(){this.ended||An(this,Fw,void 0,"f")},RMe=function(n){if(this.ended)return;let l=je(this,oN,"m",Jan).call(this,n);switch(this._emit("streamEvent",n,l),n.type){case"content_block_delta":{let I=l.content.at(-1);switch(n.delta.type){case"text_delta":{I.type==="text"&&this._emit("text",n.delta.text,I.text||"");break}case"citations_delta":{I.type==="text"&&this._emit("citation",n.delta.citation,I.citations??[]);break}case"input_json_delta":{Lan(I)&&I.input&&this._emit("inputJson",n.delta.partial_json,I.input);break}case"thinking_delta":{I.type==="thinking"&&this._emit("thinking",n.delta.thinking,I.thinking);break}case"signature_delta":{I.type==="thinking"&&this._emit("signature",I.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(l),this._addMessage(l,!0);break}case"content_block_stop":{this._emit("contentBlock",l.content.at(-1));break}case"message_start":{An(this,Fw,l,"f");break}case"content_block_start":case"message_delta":break}},yMe=function(){if(this.ended)throw new Yn("stream has ended, this shouldn't happen");let n=je(this,Fw,"f");if(!n)throw new Yn("request ended without sending any chunks");return An(this,Fw,void 0,"f"),n},Jan=function(n){let l=je(this,Fw,"f");if(n.type==="message_start"){if(l)throw new Yn(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!l)throw new Yn(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return l;case"message_delta":return l.stop_reason=n.delta.stop_reason,l.stop_sequence=n.delta.stop_sequence,l.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(l.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(l.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(l.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(l.usage.server_tool_use=n.usage.server_tool_use),l;case"content_block_start":return l.content.push({...n.content_block}),l;case"content_block_delta":{let I=l.content.at(n.index);switch(n.delta.type){case"text_delta":{I?.type==="text"&&(l.content[n.index]={...I,text:(I.text||"")+n.delta.text});break}case"citations_delta":{I?.type==="text"&&(l.content[n.index]={...I,citations:[...I.citations??[],n.delta.citation]});break}case"input_json_delta":{if(I&&Lan(I)){let a=I[Can]||"";a+=n.delta.partial_json;let c={...I};Object.defineProperty(c,Can,{value:a,enumerable:!1,writable:!0}),a&&(c.input=vZe(a)),l.content[n.index]=c}break}case"thinking_delta":{I?.type==="thinking"&&(l.content[n.index]={...I,thinking:I.thinking+n.delta.thinking});break}case"signature_delta":{I?.type==="thinking"&&(l.content[n.index]={...I,signature:n.delta.signature});break}default:n.delta}return l}case"content_block_stop":return l}},Symbol.asyncIterator)](){let e=[],n=[],l=!1;return this.on("streamEvent",I=>{let a=n.shift();a?a.resolve(I):e.push(I)}),this.on("end",()=>{l=!0;for(let I of n)I.resolve(void 0);n.length=0}),this.on("abort",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),this.on("error",I=>{l=!0;for(let a of n)a.reject(I);n.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:l?{value:void 0,done:!0}:new Promise((a,c)=>n.push({resolve:a,reject:c})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new QR(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var aU,AMe=B(()=>{ER();yw();BF();iMe();I6();PO();aU=class extends zu{create(e,n){return this._client.post("/v1/messages/batches",{body:e,...n})}retrieve(e,n){return this._client.get(Ob`/v1/messages/batches/${e}`,n)}list(e={},n){return this._client.getAPIList("/v1/messages/batches",rN,{query:e,...n})}delete(e,n){return this._client.delete(Ob`/v1/messages/batches/${e}`,n)}cancel(e,n){return this._client.post(Ob`/v1/messages/batches/${e}/cancel`,n)}async results(e,n){let l=await this.retrieve(e);if(!l.results_url)throw new Yn(`No batch \`results_url\`; Has it finished processing? ${l.processing_status} - ${l.id}`);return this._client.get(l.results_url,{...n,headers:Gr([{Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((I,a)=>eU.fromResponse(a.response,a.controller))}}});var vw,xan,FMe=B(()=>{ER();kan();AMe();AMe();hMe();vw=class extends zu{constructor(){super(...arguments),this.batches=new aU(this._client)}create(e,n){e.model in xan&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${xan[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let l=this._client._options.timeout;if(!e.stream&&l==null){let I=LZe[e.model]??void 0;l=this._client.calculateNonstreamingTimeout(e.max_tokens,I)}return this._client.post("/v1/messages",{body:e,timeout:l??6e5,...n,stream:e.stream??!1})}stream(e,n){return BZe.createMessage(this,e,n)}countTokens(e,n){return this._client.post("/v1/messages/count_tokens",{body:e,...n})}},xan={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};vw.Batches=aU});var UJ,vMe=B(()=>{ER();yw();BF();PO();UJ=class extends zu{retrieve(e,n={},l){let{betas:I}=n??{};return this._client.get(Ob`/v1/models/${e}`,{...l,headers:Gr([{...I?.toString()!=null?{"anthropic-beta":I?.toString()}:void 0},l?.headers])})}list(e={},n){let{betas:l,...I}=e??{};return this._client.getAPIList("/v1/models",rN,{query:I,...n,headers:Gr([{...l?.toString()!=null?{"anthropic-beta":l?.toString()}:void 0},n?.headers])})}}});var jan=B(()=>{Ran();WMe();NMe();FMe();vMe()});var m6,Oan=B(()=>{m6=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()}});var fMe,XMe,SZe,Uan,Wo,IY,bhI,mhI,wMe=B(()=>{Yw();$In();LJ();aan();jO();SSe();_O();ban();BSe();HR();yw();rMe();jan();RZe();NMe();vMe();WMe();FMe();SSe();BF();Oan();YZe();LJ();Wo=class{constructor({baseURL:e=m6("ANTHROPIC_BASE_URL"),apiKey:n=m6("ANTHROPIC_API_KEY")??null,authToken:l=m6("ANTHROPIC_AUTH_TOKEN")??null,...I}={}){fMe.add(this),SZe.set(this,void 0);let a={apiKey:n,authToken:l,...I,baseURL:e||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&ian())throw new Yn(`It looks like you're running in a browser-like environment. + +This is disabled by default, as it risks exposing your secret API credentials to attackers. +If you understand the risks and have appropriate mitigations in place, +you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., + +new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); +`);this.baseURL=a.baseURL,this.timeout=a.timeout??XMe.DEFAULT_TIMEOUT,this.logger=a.logger??console;let c="warn";this.logLevel=c,this.logLevel=_Se(a.logLevel,"ClientOptions.logLevel",this)??_Se(m6("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??uan(),An(this,SZe,Gan,"f"),this._options=a,this.apiKey=n,this.authToken=l}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:n}){if(!(this.apiKey&&e.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}authHeaders(e){return Gr([this.apiKeyAuth(e),this.bearerAuth(e)])}apiKeyAuth(e){if(this.apiKey!=null)return Gr([{"X-Api-Key":this.apiKey}])}bearerAuth(e){if(this.authToken!=null)return Gr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Object.entries(e).filter(([n,l])=>typeof l<"u").map(([n,l])=>{if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(l)}`;if(l===null)return`${encodeURIComponent(n)}=`;throw new Yn(`Cannot stringify type ${typeof l}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Rw}`}defaultIdempotencyKey(){return`stainless-node-retry-${jSe()}`}makeStatusError(e,n,l,I){return Bd.generate(e,n,l,I)}buildURL(e,n,l){let I=!je(this,fMe,"m",Uan).call(this)&&l||this.baseURL,a=ean(e)?new URL(e):new URL(I+(I.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery();return tan(c)||(n={...c,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(a.search=this.stringifyQuery(n)),a.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new Yn("Streaming is strongly recommended for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:n,options:l}){}get(e,n){return this.methodRequest("get",e,n)}post(e,n){return this.methodRequest("post",e,n)}patch(e,n){return this.methodRequest("patch",e,n)}put(e,n){return this.methodRequest("put",e,n)}delete(e,n){return this.methodRequest("delete",e,n)}methodRequest(e,n,l){return this.request(Promise.resolve(l).then(I=>({method:e,path:n,...I})))}request(e,n=null){return new kJ(this,this.makeRequest(e,n,void 0))}async makeRequest(e,n,l){let I=await e,a=I.maxRetries??this.maxRetries;n==null&&(n=a),await this.prepareOptions(I);let{req:c,url:i,timeout:s}=this.buildRequest(I,{retryCount:a-n});await this.prepareRequest(c,{url:i,options:I});let r="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=l===void 0?"":`, retryOf: ${l}`,o=Date.now();if(Sd(this).debug(`[${r}] sending request`,zF({retryOfRequestLogID:l,method:I.method,url:i,options:I,headers:c.headers})),I.signal?.aborted)throw new kG;let d=new AbortController,b=await this.fetchWithTimeout(i,c,s,d).catch(_P),h=Date.now();if(b instanceof Error){let g=`retrying, ${n} attempts remaining`;if(I.signal?.aborted)throw new kG;let y=OF(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(n)return Sd(this).info(`[${r}] connection ${y?"timed out":"failed"} - ${g}`),Sd(this).debug(`[${r}] connection ${y?"timed out":"failed"} (${g})`,zF({retryOfRequestLogID:l,url:i,durationMs:h-o,message:b.message})),this.retryRequest(I,n,l??r);throw Sd(this).info(`[${r}] connection ${y?"timed out":"failed"} - error; no more retries left`),Sd(this).debug(`[${r}] connection ${y?"timed out":"failed"} (error; no more retries left)`,zF({retryOfRequestLogID:l,url:i,durationMs:h-o,message:b.message})),y?new OO:new gw({cause:b})}let Z=[...b.headers.entries()].filter(([g])=>g==="request-id").map(([g,y])=>", "+g+": "+JSON.stringify(y)).join(""),N=`[${r}${u}${Z}] ${c.method} ${i} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${h-o}ms`;if(!b.ok){let g=this.shouldRetry(b);if(n&&g){let L=`retrying, ${n} attempts remaining`;return await dan(b.body),Sd(this).info(`${N} - ${L}`),Sd(this).debug(`[${r}] response error (${L})`,zF({retryOfRequestLogID:l,url:b.url,status:b.status,headers:b.headers,durationMs:h-o})),this.retryRequest(I,n,l??r,b.headers)}let y=g?"error; no more retries left":"error; not retryable";Sd(this).info(`${N} - ${y}`);let X=await b.text().catch(L=>_P(L).message),v=ZZe(X),H=v?void 0:X;throw Sd(this).debug(`[${r}] response error (${y})`,zF({retryOfRequestLogID:l,url:b.url,status:b.status,headers:b.headers,message:H,durationMs:Date.now()-o})),this.makeStatusError(b.status,v,H,b.headers)}return Sd(this).info(N),Sd(this).debug(`[${r}] response start`,zF({retryOfRequestLogID:l,url:b.url,status:b.status,headers:b.headers,durationMs:h-o})),{response:b,options:I,controller:d,requestLogID:r,retryOfRequestLogID:l,startTime:o}}getAPIList(e,n,l){return this.requestAPIList(n,{method:"get",path:e,...l})}requestAPIList(e,n){let l=this.makeRequest(n,null,void 0);return new n6(this,l,e)}async fetchWithTimeout(e,n,l,I){let{signal:a,method:c,...i}=n||{};a&&a.addEventListener("abort",()=>I.abort());let s=setTimeout(()=>I.abort(),l),r=globalThis.ReadableStream&&i.body instanceof globalThis.ReadableStream||typeof i.body=="object"&&i.body!==null&&Symbol.asyncIterator in i.body,u={signal:I.signal,...r?{duplex:"half"}:{},method:"GET",...i};c&&(u.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,u)}finally{clearTimeout(s)}}shouldRetry(e){let n=e.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,n,l,I){let a,c=I?.get("retry-after-ms");if(c){let s=parseFloat(c);Number.isNaN(s)||(a=s)}let i=I?.get("retry-after");if(i&&!a){let s=parseFloat(i);Number.isNaN(s)?a=Date.parse(i)-Date.now():a=s*1e3}if(!(a&&0<=a&&a<60*1e3)){let s=e.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(n,s)}return await Ian(a),this.makeRequest(e,n-1,l)}calculateDefaultRetryTimeoutMillis(e,n){let a=n-e,c=Math.min(.5*Math.pow(2,a),8),i=1-Math.random()*.25;return c*i*1e3}calculateNonstreamingTimeout(e,n){if(36e5*e/128e3>6e5||n!=null&&e>n)throw new Yn("Streaming is strongly recommended for operations that may token longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}buildRequest(e,{retryCount:n=0}={}){let l={...e},{method:I,path:a,query:c,defaultBaseURL:i}=l,s=this.buildURL(a,c,i);"timeout"in l&&lan("timeout",l.timeout),l.timeout=l.timeout??this.timeout;let{bodyHeaders:r,body:u}=this.buildBody({options:l}),o=this.buildHeaders({options:e,method:I,bodyHeaders:r,retryCount:n});return{req:{method:I,headers:o,...l.signal&&{signal:l.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...l.fetchOptions??{}},url:s,timeout:l.timeout}}buildHeaders({options:e,method:n,bodyHeaders:l,retryCount:I}){let a={};this.idempotencyHeader&&n!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=e.idempotencyKey);let c=Gr([a,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(I),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...san(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},this.authHeaders(e),this._options.defaultHeaders,l,e.headers]);return this.validateHeaders(c),c.values}buildBody({options:{body:e,headers:n}}){if(!e)return{bodyHeaders:void 0,body:void 0};let l=Gr([n]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&l.values.has("content-type")||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:WZe(e)}:je(this,SZe,"f").call(this,{body:e,headers:l})}};XMe=Wo,SZe=new WeakMap,fMe=new WeakSet,Uan=function(){return this.baseURL!=="https://api.anthropic.com"};Wo.Anthropic=XMe;Wo.HUMAN_PROMPT=` + +Human:`;Wo.AI_PROMPT=` + +Assistant:`;Wo.DEFAULT_TIMEOUT=6e5;Wo.AnthropicError=Yn;Wo.APIError=Bd;Wo.APIConnectionError=gw;Wo.APIConnectionTimeoutError=OO;Wo.APIUserAbortError=kG;Wo.NotFoundError=SO;Wo.ConflictError=MO;Wo.RateLimitError=DO;Wo.BadRequestError=UO;Wo.AuthenticationError=zO;Wo.InternalServerError=KO;Wo.PermissionDeniedError=BO;Wo.UnprocessableEntityError=TO;Wo.toFile=FZe;IY=class extends Wo{constructor(){super(...arguments),this.completions=new OJ(this),this.messages=new vw(this),this.models=new UJ(this),this.beta=new JR(this)}};IY.Completions=OJ;IY.Messages=vw;IY.Models=UJ;IY.Beta=JR;({HUMAN_PROMPT:bhI,AI_PROMPT:mhI}=IY)});var zan=B(()=>{wMe();rMe();RZe();wMe();yw();HR()});function HMe(t){let e=[];for(let n of t)n.type==="tool_use"?e.push({name:n.name,args:n.input,id:n.id,type:"tool_call"}):n.type==="server_tool_use"&&n.name==="web_search"&&e.push({name:n.name,args:n.input,id:n.id,type:"tool_call"});return e}var p6,QMe=B(()=>{Ul();ep();p6=class extends vo{static lc_name(){return"AnthropicToolsOutputParser"}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","anthropic","output_parsers"]}),Object.defineProperty(this,"returnId",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"keyName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnSingle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"zodSchema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.keyName=e.keyName,this.returnSingle=e.returnSingle??this.returnSingle,this.zodSchema=e.zodSchema}async _validateResult(e){let n=e;if(typeof e=="string")try{n=JSON.parse(e)}catch(I){throw new $t(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(I.message)}`,e)}else n=e;if(this.zodSchema===void 0)return n;let l=await Cy(this.zodSchema,n);if(l.success)return l.data;throw new $t(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(l.error.issues)}`,JSON.stringify(n,null,2))}async parseResult(e){let n=e.flatMap(a=>{let{message:c}=a;return Array.isArray(c.content)?HMe(c.content)[0]:[]});if(n[0]===void 0)throw new Error("No parseable tool calls provided to AnthropicToolsOutputParser.");let[l]=n;return await this._validateResult(l.args)}}});function Ban(t){if(t)return t==="any"?{type:"any"}:t==="auto"?{type:"auto"}:typeof t=="string"?{type:"tool",name:t}:t}var San=B(()=>{});function Man(t){return t==null||typeof t!="object"||!("type"in t)||t.type!=="image"||!("source"in t)||typeof t.source!="object"||t.source==null||!("type"in t.source)?!1:t.source.type==="base64"?!(!("media_type"in t.source)||typeof t.source.media_type!="string"||!("data"in t.source)||typeof t.source.data!="string"):t.source.type==="url"?!(!("url"in t.source)||typeof t.source.url!="string"):!1}var Tan=B(()=>{});function Dan(t){let e=y2({dataUrl:t});if(e)return{type:"base64",media_type:e.mime_type,data:e.data};let n;try{n=new URL(t)}catch{throw new Error([`Malformed image URL: ${JSON.stringify(t)}. Content blocks of type 'image_url' must be a valid http, https, or base64-encoded data URL.`,"Example: data:image/png;base64,/9j/4AAQSk...","Example: https://example.com/image.jpg"].join(` + +`))}if(n.protocol==="http:"||n.protocol==="https:")return{type:"url",url:t};throw new Error([`Invalid image URL protocol: ${JSON.stringify(n.protocol)}. Anthropic only supports images as http, https, or base64-encoded data URLs on 'image_url' content blocks.`,"Example: data:image/png;base64,/9j/4AAQSk...","Example: https://example.com/image.jpg"].join(` + +`))}function phI(t){let e=[];for(let n of t)if(n._getType()==="tool")if(typeof n.content=="string"){let l=e[e.length-1];l?._getType()==="human"&&Array.isArray(l.content)&&"type"in l.content[0]&&l.content[0].type==="tool_result"?l.content.push({type:"tool_result",content:n.content,tool_use_id:n.tool_call_id}):e.push(new Qn({content:[{type:"tool_result",content:n.content,tool_use_id:n.tool_call_id}]}))}else e.push(new Qn({content:[{type:"tool_result",...n.content!=null?{content:EMe(n.content)}:{},tool_use_id:n.tool_call_id}]}));else e.push(n);return e}function Kan(t){if(t.id===void 0)throw new Error('Anthropic requires all tool calls to have an "id".');return{type:"tool_use",id:t.id,name:t.name,input:t.args}}function EMe(t){let e=["tool_use","tool_result","input_json_delta","server_tool_use","web_search_tool_result","web_search_result"],n=["text","text_delta"];return typeof t=="string"?t:t.map(I=>{if(uh(I))return az(I,hhI);let a="cache_control"in I?I.cache_control:void 0;if(I.type==="image_url"){let c;return typeof I.image_url=="string"?c=Dan(I.image_url):c=Dan(I.image_url.url),{type:"image",source:c,...a?{cache_control:a}:{}}}else{if(Man(I))return I;if(I.type==="document")return{...I,...a?{cache_control:a}:{}};if(I.type==="thinking")return{type:"thinking",thinking:I.thinking,signature:I.signature,...a?{cache_control:a}:{}};if(I.type==="redacted_thinking")return{type:"redacted_thinking",data:I.data,...a?{cache_control:a}:{}};if(I.type==="search_result")return{type:"search_result",title:I.title,source:I.source,..."cache_control"in I&&I.cache_control?{cache_control:I.cache_control}:{},..."citations"in I&&I.citations?{citations:I.citations}:{},content:I.content};if(n.find(c=>c===I.type)&&"text"in I)return{type:"text",text:I.text,...a?{cache_control:a}:{},..."citations"in I&&I.citations?{citations:I.citations}:{}};if(e.find(c=>c===I.type)){let c={...I};if("index"in c&&delete c.index,c.type==="input_json_delta"&&(c.type="tool_use"),"input"in c&&typeof c.input=="string")try{c.input=JSON.parse(c.input)}catch{c.input={}}return{...c,...a?{cache_control:a}:{}}}else throw new Error("Unsupported message content format")}})}function h6(t){let e=phI(t),n;e.length>0&&e[0]._getType()==="system"&&(n=t[0].content);let I=(n!==void 0?e.slice(1):e).map(a=>{let c;if(a._getType()==="human")c="user";else if(a._getType()==="ai")c="assistant";else if(a._getType()==="tool")c="user";else throw a._getType()==="system"?new Error("System messages are only permitted as the first passed message."):new Error(`Message type "${a._getType()}" is not supported.`);if(qG(a)&&a.tool_calls?.length){if(typeof a.content=="string")return a.content===""?{role:c,content:a.tool_calls.map(Kan)}:{role:c,content:[{type:"text",text:a.content},...a.tool_calls.map(Kan)]};{let{content:i}=a;return!a.tool_calls.every(r=>i.find(u=>(u.type==="tool_use"||u.type==="input_json_delta"||u.type==="server_tool_use")&&u.id===r.id))&&console.warn('The "tool_calls" field on a message is only respected if content is a string.'),{role:c,content:EMe(a.content)}}}else return{role:c,content:EMe(a.content)}});return{messages:ZhI(I),system:n}}function ZhI(t){if(!t||t.length<=1)return t;let e=[],n=t[0],l=a=>typeof a=="string"?[{type:"text",text:a}]:a,I=a=>a.role!=="user"||typeof a.content=="string"?!1:Array.isArray(a.content)&&a.content.every(c=>c.type==="tool_result");for(let a=1;a{Vr();Tan();hhI={providerName:"anthropic",fromStandardTextBlock(t){return{type:"text",text:t.text,..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}},fromStandardImageBlock(t){if(t.source_type==="url"){let e=y2({dataUrl:t.url,asTypedArray:!1});return e?{type:"image",source:{type:"base64",data:e.data,media_type:e.mime_type},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}:{type:"image",source:{type:"url",url:t.url,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}}}else{if(t.source_type==="base64")return{type:"image",source:{type:"base64",data:t.data,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{}};throw new Error(`Unsupported image source type: ${t.source_type}`)}},fromStandardFileBlock(t){let e=(t.mime_type??"").split(";")[0];if(t.source_type==="url"){if(e==="application/pdf"||e==="")return{type:"document",source:{type:"url",url:t.url,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file url source: ${t.mime_type}`)}else if(t.source_type==="text"){if(e==="text/plain"||e==="")return{type:"document",source:{type:"text",data:t.text,media_type:t.mime_type??""},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file text source: ${t.mime_type}`)}else if(t.source_type==="base64"){if(e==="application/pdf"||e==="")return{type:"document",source:{type:"base64",data:t.data,media_type:"application/pdf"},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};if(["image/jpeg","image/png","image/gif","image/webp"].includes(e))return{type:"document",source:{type:"content",content:[{type:"image",source:{type:"base64",data:t.data,media_type:e}}]},..."cache_control"in(t.metadata??{})?{cache_control:t.metadata.cache_control}:{},..."citations"in(t.metadata??{})?{citations:t.metadata.citations}:{},..."context"in(t.metadata??{})?{context:t.metadata.context}:{},..."title"in(t.metadata??{})?{title:t.metadata.title}:{}};throw new Error(`Unsupported file mime type for file base64 source: ${t.mime_type}`)}else throw new Error(`Unsupported file source type: ${t.source_type}`)}}});function _an(t,e){if(t.type==="message_start"){let{content:n,usage:l,...I}=t.message,a={};for(let[u,o]of Object.entries(I))o!=null&&(a[u]=o);let{input_tokens:c,output_tokens:i,...s}=l??{},r={input_tokens:c,output_tokens:i,total_tokens:c+i,input_token_details:{cache_creation:s.cache_creation_input_tokens,cache_read:s.cache_read_input_tokens}};return{chunk:new Jl({content:e.coerceContentToString?"":[],additional_kwargs:a,usage_metadata:e.streamUsage?r:void 0,response_metadata:{usage:{...s}},id:t.message.id})}}else if(t.type==="message_delta"){let n={input_tokens:0,output_tokens:t.usage.output_tokens,total_tokens:t.usage.output_tokens,input_token_details:{cache_creation:t.usage.cache_creation_input_tokens,cache_read:t.usage.cache_read_input_tokens}};return{chunk:new Jl({content:e.coerceContentToString?"":[],additional_kwargs:{...t.delta},usage_metadata:e.streamUsage?n:void 0})}}else if(t.type==="content_block_start"&&["tool_use","document","server_tool_use","web_search_tool_result"].includes(t.content_block.type)){let n=t.content_block,l;return n.type==="tool_use"?l=[{id:n.id,index:t.index,name:n.name,args:""}]:n.type==="server_tool_use"?l=[{id:n.id,index:t.index,name:n.name,args:""}]:l=[],{chunk:new Jl({content:e.coerceContentToString?"":[{index:t.index,...t.content_block,input:n.type==="server_tool_use"||n.type==="tool_use"?"":void 0}],additional_kwargs:{},tool_call_chunks:l})}}else if(t.type==="content_block_delta"&&["text_delta","citations_delta","thinking_delta","signature_delta"].includes(t.delta.type)){if(e.coerceContentToString&&"text"in t.delta)return{chunk:new Jl({content:t.delta.text})};{let n=t.delta;return"citation"in n&&(n.citations=[n.citation],delete n.citation),n.type==="thinking_delta"||n.type==="signature_delta"?{chunk:new Jl({content:[{index:t.index,...n,type:"thinking"}]})}:{chunk:new Jl({content:[{index:t.index,...n,type:"text"}]})}}}else{if(t.type==="content_block_delta"&&t.delta.type==="input_json_delta")return{chunk:new Jl({content:e.coerceContentToString?"":[{index:t.index,input:t.delta.partial_json,type:t.delta.type}],additional_kwargs:{},tool_call_chunks:[{index:t.index,args:t.delta.partial_json}]})};if(t.type==="content_block_start"&&t.content_block.type==="text"){let n=t.content_block?.text;if(n!==void 0)return{chunk:new Jl({content:e.coerceContentToString?n:[{index:t.index,...t.content_block}],additional_kwargs:{}})}}else{if(t.type==="content_block_start"&&t.content_block.type==="redacted_thinking")return{chunk:new Jl({content:e.coerceContentToString?"":[{index:t.index,...t.content_block}]})};if(t.type==="content_block_start"&&t.content_block.type==="thinking"){let n=t.content_block.thinking;return{chunk:new Jl({content:e.coerceContentToString?n:[{index:t.index,...t.content_block}]})}}}}return null}function Pan(t,e){let n=e.usage,l=n!=null?{input_tokens:n.input_tokens??0,output_tokens:n.output_tokens??0,total_tokens:(n.input_tokens??0)+(n.output_tokens??0),input_token_details:{cache_creation:n.cache_creation_input_tokens,cache_read:n.cache_read_input_tokens}}:void 0;if(t.length===1&&t[0].type==="text")return[{text:t[0].text,message:new _t({content:t[0].text,additional_kwargs:e,usage_metadata:l,response_metadata:e,id:e.id})}];{let I=HMe(t);return[{text:"",message:new _t({content:t,additional_kwargs:e,tool_calls:I,usage_metadata:l,response_metadata:e,id:e.id})}]}}var qan=B(()=>{Vr();QMe()});function MZe(t,e){return t.lc_error_code=e,t.message=`${t.message} + +Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${e}/ +`,t}function CMe(t){let e;return t.status===400&&t.message.includes("tool")?e=MZe(t,"INVALID_TOOL_RESULTS"):t.status===401?e=MZe(t,"MODEL_AUTHENTICATION"):t.status===404?e=MZe(t,"MODEL_NOT_FOUND"):t.status===429?e=MZe(t,"MODEL_RATE_LIMIT"):e=t,e}var $an=B(()=>{});function WhI(t){return!!(t.tools&&t.tools.length>0)}function NhI(t){for(let e of t.messages??[])if(typeof e.content!="string"){for(let n of e.content??[])if(typeof n=="object"&&n!=null&&n.type==="document"&&typeof n.citations=="object"&&n.citations.enabled)return!0}return!1}function VhI(t){return!!(t.thinking&&t.thinking.type==="enabled")}function YhI(t){return"input_schema"in t}function ghI(t){let e=["web_search"];return typeof t=="object"&&t!==null&&"type"in t&&"name"in t&&typeof t.type=="string"&&typeof t.name=="string"&&e.includes(t.name)}function RhI(t){if(typeof t.content=="string")return t.content;if(Array.isArray(t.content)&&t.content.length>=1&&"input"in t.content[0])return typeof t.content[0].input=="string"?t.content[0].input:JSON.stringify(t.content[0].input);if(Array.isArray(t.content)&&t.content.length>=1&&"text"in t.content[0])return t.content[0].text}var TZe,LMe,ern=B(()=>{zan();Vr();gh();Xh();Xk();DN();tp();Bo();ep();_N();QMe();San();JMe();qan();$an();TZe=class extends Vd{static lc_name(){return"ChatAnthropic"}get lc_secrets(){return{anthropicApiKey:"ANTHROPIC_API_KEY",apiKey:"ANTHROPIC_API_KEY"}}get lc_aliases(){return{modelName:"model"}}constructor(e){if(super(e??{}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"anthropicApiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"topK",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:2048}),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"claude-2.1"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"claude-2.1"}),Object.defineProperty(this,"invocationKwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stopSequences",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streaming",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clientOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thinking",{enumerable:!0,configurable:!0,writable:!0,value:{type:"disabled"}}),Object.defineProperty(this,"batchClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streamingClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streamUsage",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"createClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.anthropicApiKey=e?.apiKey??e?.anthropicApiKey??yt("ANTHROPIC_API_KEY"),!this.anthropicApiKey&&!e?.createClient)throw new Error("Anthropic API key not found");this.clientOptions=e?.clientOptions??{},this.apiKey=this.anthropicApiKey,this.apiUrl=e?.anthropicApiUrl,this.modelName=e?.model??e?.modelName??this.model,this.model=this.modelName,this.invocationKwargs=e?.invocationKwargs??{},this.temperature=e?.temperature??this.temperature,this.topK=e?.topK??this.topK,this.topP=e?.topP??this.topP,this.maxTokens=e?.maxTokensToSample??e?.maxTokens??this.maxTokens,this.stopSequences=e?.stopSequences??this.stopSequences,this.streaming=e?.streaming??!1,this.streamUsage=e?.streamUsage??this.streamUsage,this.thinking=e?.thinking??this.thinking,this.createClient=e?.createClient??(n=>new IY(n))}getLsParams(e){let n=this.invocationParams(e);return{ls_provider:"anthropic",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:n.temperature??void 0,ls_max_tokens:n.max_tokens??void 0,ls_stop:e.stop}}formatStructuredToolToAnthropic(e){if(!(!e||!e.length))return e.map(n=>{if(ghI(n)||YhI(n))return n;if(qm(n))return{name:n.function.name,description:n.function.description,input_schema:n.function.parameters};if(cb(n))return{name:n.name,description:n.description,input_schema:wr(n.schema)?Wl(n.schema):n.schema};throw new Error(`Unknown tool type passed to ChatAnthropic: ${JSON.stringify(n,null,2)}`)})}bindTools(e,n){return this.withConfig({tools:this.formatStructuredToolToAnthropic(e),...n})}invocationParams(e){let n=Ban(e?.tool_choice);if(this.thinking.type==="enabled"){if(this.topK!==-1)throw new Error("topK is not supported when thinking is enabled");if(this.topP!==-1)throw new Error("topP is not supported when thinking is enabled");if(this.temperature!==1)throw new Error("temperature is not supported when thinking is enabled");return{model:this.model,stop_sequences:e?.stop??this.stopSequences,stream:this.streaming,max_tokens:this.maxTokens,tools:this.formatStructuredToolToAnthropic(e?.tools),tool_choice:n,thinking:this.thinking,...this.invocationKwargs}}return{model:this.model,temperature:this.temperature,top_k:this.topK,top_p:this.topP,stop_sequences:e?.stop??this.stopSequences,stream:this.streaming,max_tokens:this.maxTokens,tools:this.formatStructuredToolToAnthropic(e?.tools),tool_choice:n,thinking:this.thinking,...this.invocationKwargs}}_identifyingParams(){return{model_name:this.model,...this.invocationParams()}}identifyingParams(){return{model_name:this.model,...this.invocationParams()}}async*_streamResponseChunks(e,n,l){let I=this.invocationParams(n),a=h6(e),c={...I,...a,stream:!0},i=!WhI(c)&&!NhI(c)&&!VhI(c),s=await this.createStreamWithRetry(c,{headers:n.headers});for await(let r of s){if(n.signal?.aborted)throw s.controller.abort(),new Error("AbortError: User aborted the request.");let u=this.streamUsage??n.streamUsage,o=_an(r,{streamUsage:u,coerceContentToString:i});if(!o)continue;let{chunk:d}=o,b=RhI(d),h=new Io({message:new Jl({content:d.content,additional_kwargs:d.additional_kwargs,tool_call_chunks:d.tool_call_chunks,usage_metadata:u?d.usage_metadata:void 0,response_metadata:d.response_metadata,id:d.id}),text:b??""});yield h,await l?.handleLLMNewToken(b??"",void 0,void 0,void 0,void 0,{chunk:h})}}async _generateNonStreaming(e,n,l){let I=await this.completionWithRetry({...n,stream:!1,...h6(e)},l),{content:a,...c}=I,i=Pan(a,c),{role:s,type:r,...u}=c;return{generations:i,llmOutput:u}}async _generate(e,n,l){if(this.stopSequences&&n.stop)throw new Error('"stopSequence" parameter found in input and default params');let I=this.invocationParams(n);if(I.stream){let a,c=this._streamResponseChunks(e,n,l);for await(let i of c)a===void 0?a=i:a=a.concat(i);if(a===void 0)throw new Error("No chunks returned from Anthropic API.");return{generations:[{text:a.text,message:a.message}]}}else return this._generateNonStreaming(e,I,{signal:n.signal,headers:n.headers})}async createStreamWithRetry(e,n){if(!this.streamingClient){let I=this.apiUrl?{baseURL:this.apiUrl}:void 0;this.streamingClient=this.createClient({dangerouslyAllowBrowser:!0,...this.clientOptions,...I,apiKey:this.apiKey,maxRetries:0})}let l=async()=>{try{return await this.streamingClient.messages.create({...e,...this.invocationKwargs,stream:!0},n)}catch(I){throw CMe(I)}};return this.caller.call(l)}async completionWithRetry(e,n){if(!this.batchClient){let I=this.apiUrl?{baseURL:this.apiUrl}:void 0;this.batchClient=this.createClient({dangerouslyAllowBrowser:!0,...this.clientOptions,...I,apiKey:this.apiKey,maxRetries:0})}let l=async()=>{try{return await this.batchClient.messages.create({...e,...this.invocationKwargs},n)}catch(I){throw CMe(I)}};return this.caller.callWithOptions({signal:n.signal??void 0},l)}_llmType(){return"anthropic"}withStructuredOutput(e,n){let l=e,I=n?.name,a=n?.method,c=n?.includeRaw;if(a==="jsonMode")throw new Error('Anthropic only supports "functionCalling" as a method.');let i=I??"extract",s,r;if(wr(l)){let h=Wl(l);r=[{name:i,description:h.description??"A function available to call.",input_schema:h}],s=new p6({returnSingle:!0,keyName:i,zodSchema:l})}else{let h;typeof l.name=="string"&&typeof l.description=="string"&&typeof l.input_schema=="object"&&l.input_schema!=null?(h=l,i=l.name):h={name:i,description:l.description??"",input_schema:l},r=[h],s=new p6({returnSingle:!0,keyName:i})}let u;if(this.thinking?.type==="enabled"){let h="Anthropic structured output relies on forced tool calling, which is not supported when `thinking` is enabled. This method will raise OutputParserException if tool calls are not generated. Consider disabling `thinking` or adjust your prompt to ensure the tool is called.";console.warn(h),u=this.withConfig({tools:r,ls_structured_output_format:{kwargs:{method:"functionCalling"},schema:Wl(l)}});let Z=N=>{if(!N.tool_calls||N.tool_calls.length===0)throw new Error(h);return N};u=u.pipe(Z)}else u=this.withConfig({tools:r,tool_choice:{type:"tool",name:i},ls_structured_output_format:{kwargs:{method:"functionCalling"},schema:Wl(l)}});if(!c)return u.pipe(s).withConfig({runName:"ChatAnthropicStructuredOutput"});let o=Tl.assign({parsed:(h,Z)=>s.invoke(h.raw,Z)}),d=Tl.assign({parsed:()=>null}),b=o.withFallbacks({fallbacks:[d]});return Hr.from([{raw:u},b]).withConfig({runName:"StructuredOutputRunnable"})}},LMe=class extends TZe{}});function trn(t){let e=t.toChatMessages(),n=h6(e);return n.messages===void 0&&(n.messages=[]),n}var nrn=B(()=>{JMe()});var lrn=B(()=>{ern();nrn()});var Irn={};Xe(Irn,{ChatAnthropic:()=>LMe,ChatAnthropicMessages:()=>TZe,convertPromptToAnthropic:()=>trn});var arn=B(()=>{lrn()});var crn=B(()=>{jF()});async function*yhI(t,e,n){let l=t;l.startsWith("http://localhost:")&&(l=l.replace("http://localhost:","http://127.0.0.1:"));let I=await fetch(l,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",...n.headers},signal:n.signal});if(!I.ok){let s,r=await I.text();try{let u=JSON.parse(r);s=new Error(`Ollama call failed with status code ${I.status}: ${u.error}`)}catch{s=new Error(`Ollama call failed with status code ${I.status}: ${r}`)}throw s.response=I,s}if(!I.body)throw new Error("Could not begin Ollama stream. Please check the given URL and try again.");let a=jd.fromReadableStream(I.body),c=new TextDecoder,i="";for await(let s of a){let u=(i+c.decode(s)).split(` +`);i=u.pop()||"";for(let o of u)try{yield JSON.parse(o)}catch{console.warn(`Received a non-JSON parseable chunk: ${o}`)}}}async function*orn(t,e,n){yield*yhI(`${t}/api/generate`,e,n)}var irn=B(()=>{crn()});var xMe,srn=B(()=>{JSe();ESe();irn();xMe=class extends kO{static lc_name(){return"Ollama"}constructor(e){super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"llama2"}),Object.defineProperty(this,"baseUrl",{enumerable:!0,configurable:!0,writable:!0,value:"http://localhost:11434"}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,writable:!0,value:"5m"}),Object.defineProperty(this,"embeddingOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"f16KV",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"frequencyPenalty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logitsAll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lowVram",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mainGpu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mirostat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mirostatEta",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mirostatTau",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numBatch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numCtx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numGpu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numGqa",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numKeep",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numPredict",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numThread",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"penalizeNewline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"presencePenalty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"repeatLastN",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"repeatPenalty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ropeFrequencyBase",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ropeFrequencyScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stop",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tfsZ",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topK",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"typicalP",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"useMLock",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"useMMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"vocabOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"format",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.model=e.model??this.model,this.baseUrl=e.baseUrl?.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl??this.baseUrl,this.keepAlive=e.keepAlive??this.keepAlive,this.headers=e.headers??this.headers,this.embeddingOnly=e.embeddingOnly,this.f16KV=e.f16KV,this.frequencyPenalty=e.frequencyPenalty,this.logitsAll=e.logitsAll,this.lowVram=e.lowVram,this.mainGpu=e.mainGpu,this.mirostat=e.mirostat,this.mirostatEta=e.mirostatEta,this.mirostatTau=e.mirostatTau,this.numBatch=e.numBatch,this.numCtx=e.numCtx,this.numGpu=e.numGpu,this.numGqa=e.numGqa,this.numKeep=e.numKeep,this.numPredict=e.numPredict,this.numThread=e.numThread,this.penalizeNewline=e.penalizeNewline,this.presencePenalty=e.presencePenalty,this.repeatLastN=e.repeatLastN,this.repeatPenalty=e.repeatPenalty,this.ropeFrequencyBase=e.ropeFrequencyBase,this.ropeFrequencyScale=e.ropeFrequencyScale,this.temperature=e.temperature,this.stop=e.stop,this.tfsZ=e.tfsZ,this.topK=e.topK,this.topP=e.topP,this.typicalP=e.typicalP,this.useMLock=e.useMLock,this.useMMap=e.useMMap,this.vocabOnly=e.vocabOnly,this.format=e.format}_llmType(){return"ollama"}invocationParams(e){return{model:this.model,format:this.format,keep_alive:this.keepAlive,images:e?.images,options:{embedding_only:this.embeddingOnly,f16_kv:this.f16KV,frequency_penalty:this.frequencyPenalty,logits_all:this.logitsAll,low_vram:this.lowVram,main_gpu:this.mainGpu,mirostat:this.mirostat,mirostat_eta:this.mirostatEta,mirostat_tau:this.mirostatTau,num_batch:this.numBatch,num_ctx:this.numCtx,num_gpu:this.numGpu,num_gqa:this.numGqa,num_keep:this.numKeep,num_predict:this.numPredict,num_thread:this.numThread,penalize_newline:this.penalizeNewline,presence_penalty:this.presencePenalty,repeat_last_n:this.repeatLastN,repeat_penalty:this.repeatPenalty,rope_frequency_base:this.ropeFrequencyBase,rope_frequency_scale:this.ropeFrequencyScale,temperature:this.temperature,stop:e?.stop??this.stop,tfs_z:this.tfsZ,top_k:this.topK,top_p:this.topP,typical_p:this.typicalP,use_mlock:this.useMLock,use_mmap:this.useMMap,vocab_only:this.vocabOnly}}}async*_streamResponseChunks(e,n,l){let I=await this.caller.call(async()=>orn(this.baseUrl,{...this.invocationParams(n),prompt:e},{...n,headers:this.headers}));for await(let a of I)a.done?yield new cZ({text:"",generationInfo:{model:a.model,total_duration:a.total_duration,load_duration:a.load_duration,prompt_eval_count:a.prompt_eval_count,prompt_eval_duration:a.prompt_eval_duration,eval_count:a.eval_count,eval_duration:a.eval_duration}}):(yield new cZ({text:a.response,generationInfo:{...a,response:void 0}}),await l?.handleLLMNewToken(a.response??""))}async _call(e,n,l){let I=[];for await(let a of this._streamResponseChunks(e,n,l))I.push(a.text);return I.join("")}}});var urn={};Xe(urn,{Ollama:()=>xMe});var drn=B(()=>{srn()});var fw=f((lZr,AhI)=>{AhI.exports={nested:{google:{nested:{ai:{nested:{generativelanguage:{nested:{v1beta2:{options:{go_package:"cloud.google.com/go/ai/generativelanguage/apiv1beta2/generativelanguagepb;generativelanguagepb",java_multiple_files:!0,java_outer_classname:"TextServiceProto",java_package:"com.google.ai.generativelanguage.v1beta2"},nested:{CitationMetadata:{fields:{citationSources:{rule:"repeated",type:"CitationSource",id:1}}},CitationSource:{oneofs:{_startIndex:{oneof:["startIndex"]},_endIndex:{oneof:["endIndex"]},_uri:{oneof:["uri"]},_license:{oneof:["license"]}},fields:{startIndex:{type:"int32",id:1,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},endIndex:{type:"int32",id:2,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},uri:{type:"string",id:3,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},license:{type:"string",id:4,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}}}},DiscussService:{options:{"(google.api.default_host)":"generativelanguage.googleapis.com"},methods:{GenerateMessage:{requestType:"GenerateMessageRequest",responseType:"GenerateMessageResponse",options:{"(google.api.http).post":"/v1beta2/{model=models/*}:generateMessage","(google.api.http).body":"*","(google.api.method_signature)":"model,prompt,temperature,candidate_count,top_p,top_k"},parsedOptions:[{"(google.api.http)":{post:"/v1beta2/{model=models/*}:generateMessage",body:"*"}},{"(google.api.method_signature)":"model,prompt,temperature,candidate_count,top_p,top_k"}]},CountMessageTokens:{requestType:"CountMessageTokensRequest",responseType:"CountMessageTokensResponse",options:{"(google.api.http).post":"/v1beta2/{model=models/*}:countMessageTokens","(google.api.http).body":"*","(google.api.method_signature)":"model,prompt"},parsedOptions:[{"(google.api.http)":{post:"/v1beta2/{model=models/*}:countMessageTokens",body:"*"}},{"(google.api.method_signature)":"model,prompt"}]}}},GenerateMessageRequest:{oneofs:{_temperature:{oneof:["temperature"]},_candidateCount:{oneof:["candidateCount"]},_topP:{oneof:["topP"]},_topK:{oneof:["topK"]}},fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},prompt:{type:"MessagePrompt",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},temperature:{type:"float",id:3,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},candidateCount:{type:"int32",id:4,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topP:{type:"float",id:5,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topK:{type:"int32",id:6,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}}}},GenerateMessageResponse:{fields:{candidates:{rule:"repeated",type:"Message",id:1},messages:{rule:"repeated",type:"Message",id:2},filters:{rule:"repeated",type:"ContentFilter",id:3}}},Message:{oneofs:{_citationMetadata:{oneof:["citationMetadata"]}},fields:{author:{type:"string",id:1,options:{"(google.api.field_behavior)":"OPTIONAL"}},content:{type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},citationMetadata:{type:"CitationMetadata",id:3,options:{"(google.api.field_behavior)":"OUTPUT_ONLY",proto3_optional:!0}}}},MessagePrompt:{fields:{context:{type:"string",id:1,options:{"(google.api.field_behavior)":"OPTIONAL"}},examples:{rule:"repeated",type:"Example",id:2,options:{"(google.api.field_behavior)":"OPTIONAL"}},messages:{rule:"repeated",type:"Message",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}}}},Example:{fields:{input:{type:"Message",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}},output:{type:"Message",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},CountMessageTokensRequest:{fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},prompt:{type:"MessagePrompt",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},CountMessageTokensResponse:{fields:{tokenCount:{type:"int32",id:1}}},HarmCategory:{values:{HARM_CATEGORY_UNSPECIFIED:0,HARM_CATEGORY_DEROGATORY:1,HARM_CATEGORY_TOXICITY:2,HARM_CATEGORY_VIOLENCE:3,HARM_CATEGORY_SEXUAL:4,HARM_CATEGORY_MEDICAL:5,HARM_CATEGORY_DANGEROUS:6}},ContentFilter:{oneofs:{_message:{oneof:["message"]}},fields:{reason:{type:"BlockedReason",id:1},message:{type:"string",id:2,options:{proto3_optional:!0}}},nested:{BlockedReason:{values:{BLOCKED_REASON_UNSPECIFIED:0,SAFETY:1,OTHER:2}}}},SafetyFeedback:{fields:{rating:{type:"SafetyRating",id:1},setting:{type:"SafetySetting",id:2}}},SafetyRating:{fields:{category:{type:"HarmCategory",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}},probability:{type:"HarmProbability",id:4,options:{"(google.api.field_behavior)":"REQUIRED"}}},nested:{HarmProbability:{values:{HARM_PROBABILITY_UNSPECIFIED:0,NEGLIGIBLE:1,LOW:2,MEDIUM:3,HIGH:4}}}},SafetySetting:{fields:{category:{type:"HarmCategory",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}},threshold:{type:"HarmBlockThreshold",id:4,options:{"(google.api.field_behavior)":"REQUIRED"}}},nested:{HarmBlockThreshold:{values:{HARM_BLOCK_THRESHOLD_UNSPECIFIED:0,BLOCK_LOW_AND_ABOVE:1,BLOCK_MEDIUM_AND_ABOVE:2,BLOCK_ONLY_HIGH:3}}}},Model:{options:{"(google.api.resource).type":"generativelanguage.googleapis.com/Model","(google.api.resource).pattern":"models/{model}"},oneofs:{_temperature:{oneof:["temperature"]},_topP:{oneof:["topP"]},_topK:{oneof:["topK"]}},fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}},baseModelId:{type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},version:{type:"string",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}},displayName:{type:"string",id:4},description:{type:"string",id:5},inputTokenLimit:{type:"int32",id:6},outputTokenLimit:{type:"int32",id:7},supportedGenerationMethods:{rule:"repeated",type:"string",id:8},temperature:{type:"float",id:9,options:{proto3_optional:!0}},topP:{type:"float",id:10,options:{proto3_optional:!0}},topK:{type:"int32",id:11,options:{proto3_optional:!0}}}},ModelService:{options:{"(google.api.default_host)":"generativelanguage.googleapis.com"},methods:{GetModel:{requestType:"GetModelRequest",responseType:"Model",options:{"(google.api.http).get":"/v1beta2/{name=models/*}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1beta2/{name=models/*}"}},{"(google.api.method_signature)":"name"}]},ListModels:{requestType:"ListModelsRequest",responseType:"ListModelsResponse",options:{"(google.api.http).get":"/v1beta2/models","(google.api.method_signature)":"page_size,page_token"},parsedOptions:[{"(google.api.http)":{get:"/v1beta2/models"}},{"(google.api.method_signature)":"page_size,page_token"}]}}},GetModelRequest:{fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}}}},ListModelsRequest:{fields:{pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListModelsResponse:{fields:{models:{rule:"repeated",type:"Model",id:1},nextPageToken:{type:"string",id:2}}},TextService:{options:{"(google.api.default_host)":"generativelanguage.googleapis.com"},methods:{GenerateText:{requestType:"GenerateTextRequest",responseType:"GenerateTextResponse",options:{"(google.api.http).post":"/v1beta2/{model=models/*}:generateText","(google.api.http).body":"*","(google.api.method_signature)":"model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k"},parsedOptions:[{"(google.api.http)":{post:"/v1beta2/{model=models/*}:generateText",body:"*"}},{"(google.api.method_signature)":"model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k"}]},EmbedText:{requestType:"EmbedTextRequest",responseType:"EmbedTextResponse",options:{"(google.api.http).post":"/v1beta2/{model=models/*}:embedText","(google.api.http).body":"*","(google.api.method_signature)":"model,text"},parsedOptions:[{"(google.api.http)":{post:"/v1beta2/{model=models/*}:embedText",body:"*"}},{"(google.api.method_signature)":"model,text"}]}}},GenerateTextRequest:{oneofs:{_temperature:{oneof:["temperature"]},_candidateCount:{oneof:["candidateCount"]},_maxOutputTokens:{oneof:["maxOutputTokens"]},_topP:{oneof:["topP"]},_topK:{oneof:["topK"]}},fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},prompt:{type:"TextPrompt",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},temperature:{type:"float",id:3,options:{proto3_optional:!0}},candidateCount:{type:"int32",id:4,options:{proto3_optional:!0}},maxOutputTokens:{type:"int32",id:5,options:{proto3_optional:!0}},topP:{type:"float",id:6,options:{proto3_optional:!0}},topK:{type:"int32",id:7,options:{proto3_optional:!0}},safetySettings:{rule:"repeated",type:"SafetySetting",id:8},stopSequences:{rule:"repeated",type:"string",id:9}}},GenerateTextResponse:{fields:{candidates:{rule:"repeated",type:"TextCompletion",id:1},filters:{rule:"repeated",type:"ContentFilter",id:3},safetyFeedback:{rule:"repeated",type:"SafetyFeedback",id:4}}},TextPrompt:{fields:{text:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TextCompletion:{oneofs:{_citationMetadata:{oneof:["citationMetadata"]}},fields:{output:{type:"string",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},safetyRatings:{rule:"repeated",type:"SafetyRating",id:2},citationMetadata:{type:"CitationMetadata",id:3,options:{"(google.api.field_behavior)":"OUTPUT_ONLY",proto3_optional:!0}}}},EmbedTextRequest:{fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},text:{type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},EmbedTextResponse:{oneofs:{_embedding:{oneof:["embedding"]}},fields:{embedding:{type:"Embedding",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY",proto3_optional:!0}}}},Embedding:{fields:{value:{rule:"repeated",type:"float",id:1}}}}},v1beta3:{options:{go_package:"cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb",java_multiple_files:!0,java_outer_classname:"TextServiceProto",java_package:"com.google.ai.generativelanguage.v1beta3"},nested:{CitationMetadata:{fields:{citationSources:{rule:"repeated",type:"CitationSource",id:1}}},CitationSource:{oneofs:{_startIndex:{oneof:["startIndex"]},_endIndex:{oneof:["endIndex"]},_uri:{oneof:["uri"]},_license:{oneof:["license"]}},fields:{startIndex:{type:"int32",id:1,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},endIndex:{type:"int32",id:2,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},uri:{type:"string",id:3,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},license:{type:"string",id:4,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}}}},DiscussService:{options:{"(google.api.default_host)":"generativelanguage.googleapis.com"},methods:{GenerateMessage:{requestType:"GenerateMessageRequest",responseType:"GenerateMessageResponse",options:{"(google.api.http).post":"/v1beta3/{model=models/*}:generateMessage","(google.api.http).body":"*","(google.api.method_signature)":"model,prompt,temperature,candidate_count,top_p,top_k"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{model=models/*}:generateMessage",body:"*"}},{"(google.api.method_signature)":"model,prompt,temperature,candidate_count,top_p,top_k"}]},CountMessageTokens:{requestType:"CountMessageTokensRequest",responseType:"CountMessageTokensResponse",options:{"(google.api.http).post":"/v1beta3/{model=models/*}:countMessageTokens","(google.api.http).body":"*","(google.api.method_signature)":"model,prompt"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{model=models/*}:countMessageTokens",body:"*"}},{"(google.api.method_signature)":"model,prompt"}]}}},GenerateMessageRequest:{oneofs:{_temperature:{oneof:["temperature"]},_candidateCount:{oneof:["candidateCount"]},_topP:{oneof:["topP"]},_topK:{oneof:["topK"]}},fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},prompt:{type:"MessagePrompt",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},temperature:{type:"float",id:3,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},candidateCount:{type:"int32",id:4,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topP:{type:"float",id:5,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topK:{type:"int32",id:6,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}}}},GenerateMessageResponse:{fields:{candidates:{rule:"repeated",type:"Message",id:1},messages:{rule:"repeated",type:"Message",id:2},filters:{rule:"repeated",type:"ContentFilter",id:3}}},Message:{oneofs:{_citationMetadata:{oneof:["citationMetadata"]}},fields:{author:{type:"string",id:1,options:{"(google.api.field_behavior)":"OPTIONAL"}},content:{type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},citationMetadata:{type:"CitationMetadata",id:3,options:{"(google.api.field_behavior)":"OUTPUT_ONLY",proto3_optional:!0}}}},MessagePrompt:{fields:{context:{type:"string",id:1,options:{"(google.api.field_behavior)":"OPTIONAL"}},examples:{rule:"repeated",type:"Example",id:2,options:{"(google.api.field_behavior)":"OPTIONAL"}},messages:{rule:"repeated",type:"Message",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}}}},Example:{fields:{input:{type:"Message",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}},output:{type:"Message",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},CountMessageTokensRequest:{fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},prompt:{type:"MessagePrompt",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},CountMessageTokensResponse:{fields:{tokenCount:{type:"int32",id:1}}},HarmCategory:{values:{HARM_CATEGORY_UNSPECIFIED:0,HARM_CATEGORY_DEROGATORY:1,HARM_CATEGORY_TOXICITY:2,HARM_CATEGORY_VIOLENCE:3,HARM_CATEGORY_SEXUAL:4,HARM_CATEGORY_MEDICAL:5,HARM_CATEGORY_DANGEROUS:6}},ContentFilter:{oneofs:{_message:{oneof:["message"]}},fields:{reason:{type:"BlockedReason",id:1},message:{type:"string",id:2,options:{proto3_optional:!0}}},nested:{BlockedReason:{values:{BLOCKED_REASON_UNSPECIFIED:0,SAFETY:1,OTHER:2}}}},SafetyFeedback:{fields:{rating:{type:"SafetyRating",id:1},setting:{type:"SafetySetting",id:2}}},SafetyRating:{fields:{category:{type:"HarmCategory",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}},probability:{type:"HarmProbability",id:4,options:{"(google.api.field_behavior)":"REQUIRED"}}},nested:{HarmProbability:{values:{HARM_PROBABILITY_UNSPECIFIED:0,NEGLIGIBLE:1,LOW:2,MEDIUM:3,HIGH:4}}}},SafetySetting:{fields:{category:{type:"HarmCategory",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}},threshold:{type:"HarmBlockThreshold",id:4,options:{"(google.api.field_behavior)":"REQUIRED"}}},nested:{HarmBlockThreshold:{values:{HARM_BLOCK_THRESHOLD_UNSPECIFIED:0,BLOCK_LOW_AND_ABOVE:1,BLOCK_MEDIUM_AND_ABOVE:2,BLOCK_ONLY_HIGH:3,BLOCK_NONE:4}}}},Model:{options:{"(google.api.resource).type":"generativelanguage.googleapis.com/Model","(google.api.resource).pattern":"models/{model}"},oneofs:{_temperature:{oneof:["temperature"]},_topP:{oneof:["topP"]},_topK:{oneof:["topK"]}},fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}},baseModelId:{type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},version:{type:"string",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}},displayName:{type:"string",id:4},description:{type:"string",id:5},inputTokenLimit:{type:"int32",id:6},outputTokenLimit:{type:"int32",id:7},supportedGenerationMethods:{rule:"repeated",type:"string",id:8},temperature:{type:"float",id:9,options:{proto3_optional:!0}},topP:{type:"float",id:10,options:{proto3_optional:!0}},topK:{type:"int32",id:11,options:{proto3_optional:!0}}}},ModelService:{options:{"(google.api.default_host)":"generativelanguage.googleapis.com"},methods:{GetModel:{requestType:"GetModelRequest",responseType:"Model",options:{"(google.api.http).get":"/v1beta3/{name=models/*}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1beta3/{name=models/*}"}},{"(google.api.method_signature)":"name"}]},ListModels:{requestType:"ListModelsRequest",responseType:"ListModelsResponse",options:{"(google.api.http).get":"/v1beta3/models","(google.api.method_signature)":"page_size,page_token"},parsedOptions:[{"(google.api.http)":{get:"/v1beta3/models"}},{"(google.api.method_signature)":"page_size,page_token"}]},GetTunedModel:{requestType:"GetTunedModelRequest",responseType:"TunedModel",options:{"(google.api.http).get":"/v1beta3/{name=tunedModels/*}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1beta3/{name=tunedModels/*}"}},{"(google.api.method_signature)":"name"}]},ListTunedModels:{requestType:"ListTunedModelsRequest",responseType:"ListTunedModelsResponse",options:{"(google.api.http).get":"/v1beta3/tunedModels","(google.api.method_signature)":"page_size,page_token"},parsedOptions:[{"(google.api.http)":{get:"/v1beta3/tunedModels"}},{"(google.api.method_signature)":"page_size,page_token"}]},CreateTunedModel:{requestType:"CreateTunedModelRequest",responseType:"google.longrunning.Operation",options:{"(google.api.http).post":"/v1beta3/tunedModels","(google.api.http).body":"tuned_model","(google.api.method_signature)":"tuned_model_id,tuned_model","(google.longrunning.operation_info).response_type":"TunedModel","(google.longrunning.operation_info).metadata_type":"CreateTunedModelMetadata"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/tunedModels",body:"tuned_model"}},{"(google.api.method_signature)":"tuned_model"},{"(google.api.method_signature)":"tuned_model_id,tuned_model"},{"(google.longrunning.operation_info)":{response_type:"TunedModel",metadata_type:"CreateTunedModelMetadata"}}]},UpdateTunedModel:{requestType:"UpdateTunedModelRequest",responseType:"TunedModel",options:{"(google.api.http).patch":"/v1beta3/{tuned_model.name=tunedModels/*}","(google.api.http).body":"tuned_model","(google.api.method_signature)":"tuned_model,update_mask"},parsedOptions:[{"(google.api.http)":{patch:"/v1beta3/{tuned_model.name=tunedModels/*}",body:"tuned_model"}},{"(google.api.method_signature)":"tuned_model,update_mask"}]},DeleteTunedModel:{requestType:"DeleteTunedModelRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1beta3/{name=tunedModels/*}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1beta3/{name=tunedModels/*}"}},{"(google.api.method_signature)":"name"}]}}},GetModelRequest:{fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}}}},ListModelsRequest:{fields:{pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListModelsResponse:{fields:{models:{rule:"repeated",type:"Model",id:1},nextPageToken:{type:"string",id:2}}},GetTunedModelRequest:{fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/TunedModel"}}}},ListTunedModelsRequest:{fields:{pageSize:{type:"int32",id:1,options:{"(google.api.field_behavior)":"OPTIONAL"}},pageToken:{type:"string",id:2,options:{"(google.api.field_behavior)":"OPTIONAL"}}}},ListTunedModelsResponse:{fields:{tunedModels:{rule:"repeated",type:"TunedModel",id:1},nextPageToken:{type:"string",id:2}}},CreateTunedModelRequest:{oneofs:{_tunedModelId:{oneof:["tunedModelId"]}},fields:{tunedModelId:{type:"string",id:1,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},tunedModel:{type:"TunedModel",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},CreateTunedModelMetadata:{fields:{tunedModel:{type:"string",id:5,options:{"(google.api.resource_reference).type":"generativelanguage.googleapis.com/TunedModel"}},totalSteps:{type:"int32",id:1},completedSteps:{type:"int32",id:2},completedPercent:{type:"float",id:3},snapshots:{rule:"repeated",type:"TuningSnapshot",id:4}}},UpdateTunedModelRequest:{fields:{tunedModel:{type:"TunedModel",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}},updateMask:{type:"google.protobuf.FieldMask",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},DeleteTunedModelRequest:{fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/TunedModel"}}}},TunedModel:{options:{"(google.api.resource).type":"generativelanguage.googleapis.com/TunedModel","(google.api.resource).pattern":"tunedModels/{tuned_model}","(google.api.resource).plural":"tunedModels","(google.api.resource).singular":"tunedModel"},oneofs:{sourceModel:{oneof:["tunedModelSource","baseModel"]},_temperature:{oneof:["temperature"]},_topP:{oneof:["topP"]},_topK:{oneof:["topK"]}},fields:{tunedModelSource:{type:"TunedModelSource",id:3,options:{"(google.api.field_behavior)":"OPTIONAL"}},baseModel:{type:"string",id:4,options:{"(google.api.field_behavior)":"IMMUTABLE","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},name:{type:"string",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},displayName:{type:"string",id:5,options:{"(google.api.field_behavior)":"OPTIONAL"}},description:{type:"string",id:6,options:{"(google.api.field_behavior)":"OPTIONAL"}},temperature:{type:"float",id:11,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topP:{type:"float",id:12,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topK:{type:"int32",id:13,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},state:{type:"State",id:7,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},createTime:{type:"google.protobuf.Timestamp",id:8,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},updateTime:{type:"google.protobuf.Timestamp",id:9,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},tuningTask:{type:"TuningTask",id:10,options:{"(google.api.field_behavior)":"REQUIRED"}}},nested:{State:{values:{STATE_UNSPECIFIED:0,CREATING:1,ACTIVE:2,FAILED:3}}}},TunedModelSource:{fields:{tunedModel:{type:"string",id:1,options:{"(google.api.field_behavior)":"IMMUTABLE","(google.api.resource_reference).type":"generativelanguage.googleapis.com/TunedModel"}},baseModel:{type:"string",id:2,options:{"(google.api.field_behavior)":"OUTPUT_ONLY","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}}}},TuningTask:{fields:{startTime:{type:"google.protobuf.Timestamp",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},completeTime:{type:"google.protobuf.Timestamp",id:2,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},snapshots:{rule:"repeated",type:"TuningSnapshot",id:3,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},trainingData:{type:"Dataset",id:4,options:{"(google.api.field_behavior)":"IMMUTABLE"}},hyperparameters:{type:"Hyperparameters",id:5,options:{"(google.api.field_behavior)":"IMMUTABLE"}}}},Hyperparameters:{oneofs:{_epochCount:{oneof:["epochCount"]},_batchSize:{oneof:["batchSize"]},_learningRate:{oneof:["learningRate"]}},fields:{epochCount:{type:"int32",id:14,options:{"(google.api.field_behavior)":"IMMUTABLE",proto3_optional:!0}},batchSize:{type:"int32",id:15,options:{"(google.api.field_behavior)":"IMMUTABLE",proto3_optional:!0}},learningRate:{type:"float",id:16,options:{"(google.api.field_behavior)":"IMMUTABLE",proto3_optional:!0}}}},Dataset:{oneofs:{dataset:{oneof:["examples"]}},fields:{examples:{type:"TuningExamples",id:1,options:{"(google.api.field_behavior)":"OPTIONAL"}}}},TuningExamples:{fields:{examples:{rule:"repeated",type:"TuningExample",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TuningExample:{oneofs:{modelInput:{oneof:["textInput"]}},fields:{textInput:{type:"string",id:1,options:{"(google.api.field_behavior)":"OPTIONAL"}},output:{type:"string",id:3,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TuningSnapshot:{fields:{step:{type:"int32",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},epoch:{type:"int32",id:2,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},meanLoss:{type:"float",id:3,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},computeTime:{type:"google.protobuf.Timestamp",id:4,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}}}},Permission:{options:{"(google.api.resource).type":"generativelanguage.googleapis.com/Permission","(google.api.resource).pattern":"tunedModels/{tuned_model}/permissions/{permission}","(google.api.resource).plural":"permissions","(google.api.resource).singular":"permission"},oneofs:{_granteeType:{oneof:["granteeType"]},_emailAddress:{oneof:["emailAddress"]},_role:{oneof:["role"]}},fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},granteeType:{type:"GranteeType",id:2,options:{"(google.api.field_behavior)":"IMMUTABLE",proto3_optional:!0}},emailAddress:{type:"string",id:3,options:{"(google.api.field_behavior)":"IMMUTABLE",proto3_optional:!0}},role:{type:"Role",id:4,options:{"(google.api.field_behavior)":"REQUIRED",proto3_optional:!0}}},nested:{GranteeType:{values:{GRANTEE_TYPE_UNSPECIFIED:0,USER:1,GROUP:2,EVERYONE:3}},Role:{values:{ROLE_UNSPECIFIED:0,OWNER:1,WRITER:2,READER:3}}}},PermissionService:{options:{"(google.api.default_host)":"generativelanguage.googleapis.com"},methods:{CreatePermission:{requestType:"CreatePermissionRequest",responseType:"Permission",options:{"(google.api.http).post":"/v1beta3/{parent=tunedModels/*}/permissions","(google.api.http).body":"permission","(google.api.method_signature)":"parent,permission"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{parent=tunedModels/*}/permissions",body:"permission"}},{"(google.api.method_signature)":"parent,permission"}]},GetPermission:{requestType:"GetPermissionRequest",responseType:"Permission",options:{"(google.api.http).get":"/v1beta3/{name=tunedModels/*/permissions/*}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1beta3/{name=tunedModels/*/permissions/*}"}},{"(google.api.method_signature)":"name"}]},ListPermissions:{requestType:"ListPermissionsRequest",responseType:"ListPermissionsResponse",options:{"(google.api.http).get":"/v1beta3/{parent=tunedModels/*}/permissions","(google.api.method_signature)":"parent"},parsedOptions:[{"(google.api.http)":{get:"/v1beta3/{parent=tunedModels/*}/permissions"}},{"(google.api.method_signature)":"parent"}]},UpdatePermission:{requestType:"UpdatePermissionRequest",responseType:"Permission",options:{"(google.api.http).patch":"/v1beta3/{permission.name=tunedModels/*/permissions/*}","(google.api.http).body":"permission","(google.api.method_signature)":"permission,update_mask"},parsedOptions:[{"(google.api.http)":{patch:"/v1beta3/{permission.name=tunedModels/*/permissions/*}",body:"permission"}},{"(google.api.method_signature)":"permission,update_mask"}]},DeletePermission:{requestType:"DeletePermissionRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1beta3/{name=tunedModels/*/permissions/*}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1beta3/{name=tunedModels/*/permissions/*}"}},{"(google.api.method_signature)":"name"}]},TransferOwnership:{requestType:"TransferOwnershipRequest",responseType:"TransferOwnershipResponse",options:{"(google.api.http).post":"/v1beta3/{name=tunedModels/*}:transferOwnership","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{name=tunedModels/*}:transferOwnership",body:"*"}}]}}},CreatePermissionRequest:{fields:{parent:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).child_type":"generativelanguage.googleapis.com/Permission"}},permission:{type:"Permission",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},GetPermissionRequest:{fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Permission"}}}},ListPermissionsRequest:{fields:{parent:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},pageSize:{type:"int32",id:2,options:{"(google.api.field_behavior)":"OPTIONAL"}},pageToken:{type:"string",id:3,options:{"(google.api.field_behavior)":"OPTIONAL"}}}},ListPermissionsResponse:{fields:{permissions:{rule:"repeated",type:"Permission",id:1},nextPageToken:{type:"string",id:2}}},UpdatePermissionRequest:{fields:{permission:{type:"Permission",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}},updateMask:{type:"google.protobuf.FieldMask",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},DeletePermissionRequest:{fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Permission"}}}},TransferOwnershipRequest:{fields:{name:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/TunedModel"}},emailAddress:{type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TransferOwnershipResponse:{fields:{}},TextService:{options:{"(google.api.default_host)":"generativelanguage.googleapis.com"},methods:{GenerateText:{requestType:"GenerateTextRequest",responseType:"GenerateTextResponse",options:{"(google.api.http).post":"/v1beta3/{model=models/*}:generateText","(google.api.http).body":"*","(google.api.http).additional_bindings.post":"/v1beta3/{model=tunedModels/*}:generateText","(google.api.http).additional_bindings.body":"*","(google.api.method_signature)":"model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{model=models/*}:generateText",body:"*",additional_bindings:{post:"/v1beta3/{model=tunedModels/*}:generateText",body:"*"}}},{"(google.api.method_signature)":"model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k"}]},EmbedText:{requestType:"EmbedTextRequest",responseType:"EmbedTextResponse",options:{"(google.api.http).post":"/v1beta3/{model=models/*}:embedText","(google.api.http).body":"*","(google.api.method_signature)":"model,text"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{model=models/*}:embedText",body:"*"}},{"(google.api.method_signature)":"model,text"}]},BatchEmbedText:{requestType:"BatchEmbedTextRequest",responseType:"BatchEmbedTextResponse",options:{"(google.api.http).post":"/v1beta3/{model=models/*}:batchEmbedText","(google.api.http).body":"*","(google.api.method_signature)":"model,texts"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{model=models/*}:batchEmbedText",body:"*"}},{"(google.api.method_signature)":"model,texts"}]},CountTextTokens:{requestType:"CountTextTokensRequest",responseType:"CountTextTokensResponse",options:{"(google.api.http).post":"/v1beta3/{model=models/*}:countTextTokens","(google.api.http).body":"*","(google.api.method_signature)":"model,prompt"},parsedOptions:[{"(google.api.http)":{post:"/v1beta3/{model=models/*}:countTextTokens",body:"*"}},{"(google.api.method_signature)":"model,prompt"}]}}},GenerateTextRequest:{oneofs:{_temperature:{oneof:["temperature"]},_candidateCount:{oneof:["candidateCount"]},_maxOutputTokens:{oneof:["maxOutputTokens"]},_topP:{oneof:["topP"]},_topK:{oneof:["topK"]}},fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}},prompt:{type:"TextPrompt",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}},temperature:{type:"float",id:3,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},candidateCount:{type:"int32",id:4,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},maxOutputTokens:{type:"int32",id:5,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topP:{type:"float",id:6,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},topK:{type:"int32",id:7,options:{"(google.api.field_behavior)":"OPTIONAL",proto3_optional:!0}},safetySettings:{rule:"repeated",type:"SafetySetting",id:8},stopSequences:{rule:"repeated",type:"string",id:9}}},GenerateTextResponse:{fields:{candidates:{rule:"repeated",type:"TextCompletion",id:1},filters:{rule:"repeated",type:"ContentFilter",id:3},safetyFeedback:{rule:"repeated",type:"SafetyFeedback",id:4}}},TextPrompt:{fields:{text:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TextCompletion:{oneofs:{_citationMetadata:{oneof:["citationMetadata"]}},fields:{output:{type:"string",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}},safetyRatings:{rule:"repeated",type:"SafetyRating",id:2},citationMetadata:{type:"CitationMetadata",id:3,options:{"(google.api.field_behavior)":"OUTPUT_ONLY",proto3_optional:!0}}}},EmbedTextRequest:{fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},text:{type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},EmbedTextResponse:{oneofs:{_embedding:{oneof:["embedding"]}},fields:{embedding:{type:"Embedding",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY",proto3_optional:!0}}}},BatchEmbedTextRequest:{fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},texts:{rule:"repeated",type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},BatchEmbedTextResponse:{fields:{embeddings:{rule:"repeated",type:"Embedding",id:1,options:{"(google.api.field_behavior)":"OUTPUT_ONLY"}}}},Embedding:{fields:{value:{rule:"repeated",type:"float",id:1}}},CountTextTokensRequest:{fields:{model:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"generativelanguage.googleapis.com/Model"}},prompt:{type:"TextPrompt",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},CountTextTokensResponse:{fields:{tokenCount:{type:"int32",id:1}}}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ResourceProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{fieldBehavior:{rule:"repeated",type:"google.api.FieldBehavior",id:1052,extend:"google.protobuf.FieldOptions"},FieldBehavior:{values:{FIELD_BEHAVIOR_UNSPECIFIED:0,OPTIONAL:1,REQUIRED:2,OUTPUT_ONLY:3,INPUT_ONLY:4,IMMUTABLE:5,UNORDERED_LIST:6,NON_EMPTY_DEFAULT:7}},http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"},CommonLanguageSettings:{fields:{referenceDocsUri:{type:"string",id:1,options:{deprecated:!0}},destinations:{rule:"repeated",type:"ClientLibraryDestination",id:2}}},ClientLibrarySettings:{fields:{version:{type:"string",id:1},launchStage:{type:"LaunchStage",id:2},restNumericEnums:{type:"bool",id:3},javaSettings:{type:"JavaSettings",id:21},cppSettings:{type:"CppSettings",id:22},phpSettings:{type:"PhpSettings",id:23},pythonSettings:{type:"PythonSettings",id:24},nodeSettings:{type:"NodeSettings",id:25},dotnetSettings:{type:"DotnetSettings",id:26},rubySettings:{type:"RubySettings",id:27},goSettings:{type:"GoSettings",id:28}}},Publishing:{fields:{methodSettings:{rule:"repeated",type:"MethodSettings",id:2},newIssueUri:{type:"string",id:101},documentationUri:{type:"string",id:102},apiShortName:{type:"string",id:103},githubLabel:{type:"string",id:104},codeownerGithubTeams:{rule:"repeated",type:"string",id:105},docTagPrefix:{type:"string",id:106},organization:{type:"ClientLibraryOrganization",id:107},librarySettings:{rule:"repeated",type:"ClientLibrarySettings",id:109},protoReferenceDocumentationUri:{type:"string",id:110}}},JavaSettings:{fields:{libraryPackage:{type:"string",id:1},serviceClassNames:{keyType:"string",type:"string",id:2},common:{type:"CommonLanguageSettings",id:3}}},CppSettings:{fields:{common:{type:"CommonLanguageSettings",id:1}}},PhpSettings:{fields:{common:{type:"CommonLanguageSettings",id:1}}},PythonSettings:{fields:{common:{type:"CommonLanguageSettings",id:1}}},NodeSettings:{fields:{common:{type:"CommonLanguageSettings",id:1}}},DotnetSettings:{fields:{common:{type:"CommonLanguageSettings",id:1},renamedServices:{keyType:"string",type:"string",id:2},renamedResources:{keyType:"string",type:"string",id:3},ignoredResources:{rule:"repeated",type:"string",id:4},forcedNamespaceAliases:{rule:"repeated",type:"string",id:5},handwrittenSignatures:{rule:"repeated",type:"string",id:6}}},RubySettings:{fields:{common:{type:"CommonLanguageSettings",id:1}}},GoSettings:{fields:{common:{type:"CommonLanguageSettings",id:1}}},MethodSettings:{fields:{selector:{type:"string",id:1},longRunning:{type:"LongRunning",id:2}},nested:{LongRunning:{fields:{initialPollDelay:{type:"google.protobuf.Duration",id:1},pollDelayMultiplier:{type:"float",id:2},maxPollDelay:{type:"google.protobuf.Duration",id:3},totalPollTimeout:{type:"google.protobuf.Duration",id:4}}}}},ClientLibraryOrganization:{values:{CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED:0,CLOUD:1,ADS:2,PHOTOS:3,STREET_VIEW:4,SHOPPING:5,GEO:6,GENERATIVE_AI:7}},ClientLibraryDestination:{values:{CLIENT_LIBRARY_DESTINATION_UNSPECIFIED:0,GITHUB:10,PACKAGE_MANAGER:20}},LaunchStage:{values:{LAUNCH_STAGE_UNSPECIFIED:0,UNIMPLEMENTED:6,PRELAUNCH:7,EARLY_ACCESS:1,ALPHA:2,BETA:3,GA:4,DEPRECATED:5}},resourceReference:{type:"google.api.ResourceReference",id:1055,extend:"google.protobuf.FieldOptions"},resourceDefinition:{rule:"repeated",type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.FileOptions"},resource:{type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.MessageOptions"},ResourceDescriptor:{fields:{type:{type:"string",id:1},pattern:{rule:"repeated",type:"string",id:2},nameField:{type:"string",id:3},history:{type:"History",id:4},plural:{type:"string",id:5},singular:{type:"string",id:6},style:{rule:"repeated",type:"Style",id:10}},nested:{History:{values:{HISTORY_UNSPECIFIED:0,ORIGINALLY_SINGLE_PATTERN:1,FUTURE_MULTI_PATTERN:2}},Style:{values:{STYLE_UNSPECIFIED:0,DECLARATIVE_FRIENDLY:1}}}},ResourceReference:{fields:{type:{type:"string",id:1},childType:{type:"string",id:2}}}}},protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"string",id:13}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},unverifiedLazy:{type:"bool",id:15,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},debugRedact:{type:"bool",id:16,options:{default:!1}},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19,options:{packed:!1}},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"string",id:1},value:{type:"string",id:2}}}}},OneofOptions:{fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","edition_defaults.edition":"2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","edition_defaults.edition":"2023","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","edition_defaults.edition":"2023","edition_defaults.value":"PACKED"}},stringFieldValidation:{type:"StringFieldValidation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","edition_defaults.edition":"2023","edition_defaults.value":"MANDATORY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","edition_defaults.edition":"2023","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","edition_defaults.edition":"2023","edition_defaults.value":"ALLOW"}},rawFeatures:{type:"FeatureSet",id:999,options:{targets:"TARGET_TYPE_UNKNOWN"}}},extensions:[[1e3,1e3],[1001,1001],[9995,9999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},StringFieldValidation:{values:{STRING_FIELD_VALIDATION_UNKNOWN:0,MANDATORY:1,HINT:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}},Timestamp:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Empty:{fields:{}},FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}},longrunning:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.LongRunning",go_package:"cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb",java_multiple_files:!0,java_outer_classname:"OperationsProto",java_package:"com.google.longrunning",php_namespace:"Google\\LongRunning"},nested:{operationInfo:{type:"google.longrunning.OperationInfo",id:1049,extend:"google.protobuf.MethodOptions"},Operations:{options:{"(google.api.default_host)":"longrunning.googleapis.com"},methods:{ListOperations:{requestType:"ListOperationsRequest",responseType:"ListOperationsResponse",options:{"(google.api.http).get":"/v1/{name=operations}","(google.api.method_signature)":"name,filter"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=operations}"}},{"(google.api.method_signature)":"name,filter"}]},GetOperation:{requestType:"GetOperationRequest",responseType:"Operation",options:{"(google.api.http).get":"/v1/{name=operations/**}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=operations/**}"}},{"(google.api.method_signature)":"name"}]},DeleteOperation:{requestType:"DeleteOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1/{name=operations/**}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1/{name=operations/**}"}},{"(google.api.method_signature)":"name"}]},CancelOperation:{requestType:"CancelOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).post":"/v1/{name=operations/**}:cancel","(google.api.http).body":"*","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{post:"/v1/{name=operations/**}:cancel",body:"*"}},{"(google.api.method_signature)":"name"}]},WaitOperation:{requestType:"WaitOperationRequest",responseType:"Operation"}}},Operation:{oneofs:{result:{oneof:["error","response"]}},fields:{name:{type:"string",id:1},metadata:{type:"google.protobuf.Any",id:2},done:{type:"bool",id:3},error:{type:"google.rpc.Status",id:4},response:{type:"google.protobuf.Any",id:5}}},GetOperationRequest:{fields:{name:{type:"string",id:1}}},ListOperationsRequest:{fields:{name:{type:"string",id:4},filter:{type:"string",id:1},pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListOperationsResponse:{fields:{operations:{rule:"repeated",type:"Operation",id:1},nextPageToken:{type:"string",id:2}}},CancelOperationRequest:{fields:{name:{type:"string",id:1}}},DeleteOperationRequest:{fields:{name:{type:"string",id:1}}},WaitOperationRequest:{fields:{name:{type:"string",id:1},timeout:{type:"google.protobuf.Duration",id:2}}},OperationInfo:{fields:{responseType:{type:"string",id:1},metadataType:{type:"string",id:2}}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/status;status",java_multiple_files:!0,java_outer_classname:"StatusProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}}}}}}}}});var prn=f((IZr,FhI)=>{FhI.exports={interfaces:{"google.ai.generativelanguage.v1beta2.DiscussService":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{GenerateMessage:{retry_codes_name:"non_idempotent",retry_params_name:"default"},CountMessageTokens:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var Xw=f((aZr,vhI)=>{vhI.exports={name:"@google-ai/generativelanguage",version:"1.1.0",description:"Generative Language API client for Node.js",repository:{type:"git",url:"https://github.com/googleapis/google-cloud-node.git",directory:"packages/google-ai-generativelanguage"},license:"Apache-2.0",author:"Google LLC",main:"build/src/index.js",files:["build/src","build/protos"],homepage:"https://github.com/googleapis/google-cloud-node/tree/main/packages/google-ai-generativelanguage",keywords:["google apis client","google api client","google apis","google api","google","google cloud platform","google cloud","cloud","google generativelanguage","generativelanguage","Generative Language API"],scripts:{clean:"gts clean",compile:"tsc -p . && cp -r protos build/","compile-protos":"compileProtos src",docs:"jsdoc -c .jsdoc.js","predocs-test":"npm run docs","docs-test":"linkinator docs",fix:"gts fix",lint:"gts check",prepare:"npm run compile-protos && npm run compile","system-test":"npm run compile && c8 mocha build/system-test",test:"c8 mocha build/test","samples-test":"npm run compile && cd samples/ && npm link ../ && npm i && npm test",prelint:"cd samples; npm link ../; npm i"},dependencies:{"google-gax":"^4.0.3"},devDependencies:{"@types/mocha":"^9.0.0","@types/node":"^20.4.5","@types/sinon":"^10.0.0",c8:"^8.0.1","gapic-tools":"^0.1.8",gts:"^5.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^3.0.0","jsdoc-region-tag":"^3.0.0",linkinator:"4.1.2",long:"^5.2.3",mocha:"^9.2.2","pack-n-play":"^1.0.0-2",sinon:"^15.0.0",typescript:"^5.1.6"},engines:{node:">=14.0.0"}}});var Wrn=f((hrn,Zrn)=>{(function(t){var e;typeof hrn=="object"?Zrn.exports=t():typeof define=="function"&&define.amd?define(t):(typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"&&(e=self),e.objectHash=t())})(function(){return function t(e,n,l){function I(i,s){if(!n[i]){if(!e[i]){var r=typeof require=="function"&&require;if(!s&&r)return r(i,!0);if(a)return a(i,!0);throw new Error("Cannot find module '"+i+"'")}s=n[i]={exports:{}},e[i][0].call(s.exports,function(u){var o=e[i][1][u];return I(o||u)},s,s.exports,t,e,n,l)}return n[i].exports}for(var a=typeof require=="function"&&require,c=0;c>16),_((65280&J)>>8),_(255&J);return O==2?_(255&(J=H(Q.charAt(L))<<2|H(Q.charAt(L+1))>>4)):O==1&&(_((J=H(Q.charAt(L))<<10|H(Q.charAt(L+1))<<4|H(Q.charAt(L+2))>>2)>>8&255),_(255&J)),U},d.fromByteArray=function(Q){var L,J,O,U,K=Q.length%3,D="";function _(P){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P)}for(L=0,O=Q.length-K;L>18&63)+_(U>>12&63)+_(U>>6&63)+_(63&U);switch(K){case 1:D=(D+=_((J=Q[Q.length-1])>>2))+_(J<<4&63)+"==";break;case 2:D=(D=(D+=_((J=(Q[Q.length-2]<<8)+Q[Q.length-1])>>10))+_(J>>4&63))+_(J<<2&63)+"="}return D}})(n===void 0?this.base64js={}:n)}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,e,n){(function(l,I,h,c,i,s,r,u,o){var d=t("base64-js"),b=t("ieee754");function h(E,S,m){if(!(this instanceof h))return new h(E,S,m);var Y,R,C,M,te=typeof E;if(S==="base64"&&te=="string")for(E=(M=E).trim?M.trim():M.replace(/^\s+|\s+$/g,"");E.length%4!=0;)E+="=";if(te=="number")Y=q(E);else if(te=="string")Y=h.byteLength(E,S);else{if(te!="object")throw new Error("First argument needs to be a number, array or string.");Y=q(E.length)}if(h._useTypedArrays?R=h._augment(new Uint8Array(Y)):((R=this).length=Y,R._isBuffer=!0),h._useTypedArrays&&typeof E.byteLength=="number")R._set(E);else if(ee(M=E)||h.isBuffer(M)||M&&typeof M=="object"&&typeof M.length=="number")for(C=0;C>8,M=M%256,te.push(M),te.push(C);return te}(S),E,m,Y)}function g(E,S,m){var Y="";m=Math.min(E.length,m);for(var R=S;R>>0)):(S+1>>0),R}function v(E,S,m,Y){if(Y||(j(typeof m=="boolean","missing or invalid endian"),j(S!=null,"missing offset"),j(S+1>>8*(Y?C:1-C)}function O(E,S,m,Y,R){if(R||(j(S!=null,"missing value"),j(typeof Y=="boolean","missing or invalid endian"),j(m!=null,"missing offset"),j(m+3>>8*(Y?C:3-C)&255}function U(E,S,m,Y,R){R||(j(S!=null,"missing value"),j(typeof Y=="boolean","missing or invalid endian"),j(m!=null,"missing offset"),j(m+1this.length&&(Y=this.length);var R=(Y=E.length-S=this.length))return this[E]},h.prototype.readUInt16LE=function(E,S){return y(this,E,!0,S)},h.prototype.readUInt16BE=function(E,S){return y(this,E,!1,S)},h.prototype.readUInt32LE=function(E,S){return X(this,E,!0,S)},h.prototype.readUInt32BE=function(E,S){return X(this,E,!1,S)},h.prototype.readInt8=function(E,S){if(S||(j(E!=null,"missing offset"),j(E=this.length))return 128&this[E]?-1*(255-this[E]+1):this[E]},h.prototype.readInt16LE=function(E,S){return v(this,E,!0,S)},h.prototype.readInt16BE=function(E,S){return v(this,E,!1,S)},h.prototype.readInt32LE=function(E,S){return H(this,E,!0,S)},h.prototype.readInt32BE=function(E,S){return H(this,E,!1,S)},h.prototype.readFloatLE=function(E,S){return Q(this,E,!0,S)},h.prototype.readFloatBE=function(E,S){return Q(this,E,!1,S)},h.prototype.readDoubleLE=function(E,S){return L(this,E,!0,S)},h.prototype.readDoubleBE=function(E,S){return L(this,E,!1,S)},h.prototype.writeUInt8=function(E,S,m){m||(j(E!=null,"missing value"),j(S!=null,"missing offset"),j(S=this.length||(this[S]=E)},h.prototype.writeUInt16LE=function(E,S,m){J(this,E,S,!0,m)},h.prototype.writeUInt16BE=function(E,S,m){J(this,E,S,!1,m)},h.prototype.writeUInt32LE=function(E,S,m){O(this,E,S,!0,m)},h.prototype.writeUInt32BE=function(E,S,m){O(this,E,S,!1,m)},h.prototype.writeInt8=function(E,S,m){m||(j(E!=null,"missing value"),j(S!=null,"missing offset"),j(S=this.length||(0<=E?this.writeUInt8(E,S,m):this.writeUInt8(255+E+1,S,m))},h.prototype.writeInt16LE=function(E,S,m){U(this,E,S,!0,m)},h.prototype.writeInt16BE=function(E,S,m){U(this,E,S,!1,m)},h.prototype.writeInt32LE=function(E,S,m){K(this,E,S,!0,m)},h.prototype.writeInt32BE=function(E,S,m){K(this,E,S,!1,m)},h.prototype.writeFloatLE=function(E,S,m){D(this,E,S,!0,m)},h.prototype.writeFloatBE=function(E,S,m){D(this,E,S,!1,m)},h.prototype.writeDoubleLE=function(E,S,m){_(this,E,S,!0,m)},h.prototype.writeDoubleBE=function(E,S,m){_(this,E,S,!1,m)},h.prototype.fill=function(E,S,m){if(S=S||0,m=m||this.length,j(typeof(E=typeof(E=E||0)=="string"?E.charCodeAt(0):E)=="number"&&!isNaN(E),"value is not a number"),j(S<=m,"end < start"),m!==S&&this.length!==0){j(0<=S&&S"},h.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(h._useTypedArrays)return new h(this).buffer;for(var E=new Uint8Array(this.length),S=0,m=E.length;S=S.length||R>=E.length);R++)S[R+m]=E[R];return R}function Fe(E){try{return decodeURIComponent(E)}catch{return"\uFFFD"}}function ce(E,S){j(typeof E=="number","cannot write a non-number as a number"),j(0<=E,"specified a negative value for writing an unsigned value"),j(E<=S,"value is larger than maximum value for type"),j(Math.floor(E)===E,"value has a fractional component")}function fe(E,S,m){j(typeof E=="number","cannot write a non-number as a number"),j(E<=S,"value larger than maximum allowed value"),j(m<=E,"value smaller than minimum allowed value"),j(Math.floor(E)===E,"value has a fractional component")}function ke(E,S,m){j(typeof E=="number","cannot write a non-number as a number"),j(E<=S,"value larger than maximum allowed value"),j(m<=E,"value smaller than minimum allowed value")}function j(E,S){if(!E)throw new Error(S||"Failed assertion")}h._augment=function(E){return E._isBuffer=!0,E._get=E.get,E._set=E.set,E.get=P.get,E.set=P.set,E.write=P.write,E.toString=P.toString,E.toLocaleString=P.toString,E.toJSON=P.toJSON,E.copy=P.copy,E.slice=P.slice,E.readUInt8=P.readUInt8,E.readUInt16LE=P.readUInt16LE,E.readUInt16BE=P.readUInt16BE,E.readUInt32LE=P.readUInt32LE,E.readUInt32BE=P.readUInt32BE,E.readInt8=P.readInt8,E.readInt16LE=P.readInt16LE,E.readInt16BE=P.readInt16BE,E.readInt32LE=P.readInt32LE,E.readInt32BE=P.readInt32BE,E.readFloatLE=P.readFloatLE,E.readFloatBE=P.readFloatBE,E.readDoubleLE=P.readDoubleLE,E.readDoubleBE=P.readDoubleBE,E.writeUInt8=P.writeUInt8,E.writeUInt16LE=P.writeUInt16LE,E.writeUInt16BE=P.writeUInt16BE,E.writeUInt32LE=P.writeUInt32LE,E.writeUInt32BE=P.writeUInt32BE,E.writeInt8=P.writeInt8,E.writeInt16LE=P.writeInt16LE,E.writeInt16BE=P.writeInt16BE,E.writeInt32LE=P.writeInt32LE,E.writeInt32BE=P.writeInt32BE,E.writeFloatLE=P.writeFloatLE,E.writeFloatBE=P.writeFloatBE,E.writeDoubleLE=P.writeDoubleLE,E.writeDoubleBE=P.writeDoubleBE,E.fill=P.fill,E.inspect=P.inspect,E.toArrayBuffer=P.toArrayBuffer,E}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,e,n){(function(l,I,d,c,i,s,r,u,o){var d=t("buffer").Buffer,b=4,h=new d(b);h.fill(0),e.exports={hash:function(Z,N,g,y){for(var X=N(function(J,O){J.length%b!=0&&(U=J.length+(b-J.length%b),J=d.concat([J,h],U));for(var U,K=[],D=O?J.readInt32BE:J.readInt32LE,_=0;_g?le=P(le):le.length>5]|=128<>>9<<4)]=H;for(var Q=1732584193,L=-271733879,J=-1732584194,O=271733878,U=0;U>>32-J,Q)}function Z(v,H,Q,L,J,O,U){return h(H&Q|~H&L,v,H,J,O,U)}function N(v,H,Q,L,J,O,U){return h(H&L|Q&~L,v,H,J,O,U)}function g(v,H,Q,L,J,O,U){return h(H^Q^L,v,H,J,O,U)}function y(v,H,Q,L,J,O,U){return h(Q^(H|~L),v,H,J,O,U)}function X(v,H){var Q=(65535&v)+(65535&H);return(v>>16)+(H>>16)+(Q>>16)<<16|65535&Q}e.exports=function(v){return d.hash(v,b,16)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,e,n){(function(l,I,a,c,i,s,r,u,o){var d;e.exports=d||function(b){for(var h,Z=new Array(b),N=0;N>>((3&N)<<3)&255;return Z}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,e,n){(function(l,I,a,c,i,s,r,u,o){var d=t("./helpers");function b(N,g){N[g>>5]|=128<<24-g%32,N[15+(g+64>>9<<4)]=g;for(var y,X,v,H=Array(80),Q=1732584193,L=-271733879,J=-1732584194,O=271733878,U=-1009589776,K=0;K>16)+(g>>16)+(y>>16)<<16|65535&y}function Z(N,g){return N<>>32-g}e.exports=function(N){return d.hash(N,b,20,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,e,n){(function(l,I,a,c,i,s,r,u,o){function d(g,y){var X=(65535&g)+(65535&y);return(g>>16)+(y>>16)+(X>>16)<<16|65535&X}function b(g,y){var X,v=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),H=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),Q=new Array(64);g[y>>5]|=128<<24-y%32,g[15+(y+64>>9<<4)]=y;for(var L,J,O=0;O>>y|g<<32-y},N=function(g,y){return g>>>y};e.exports=function(g){return h.hash(g,b,32,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,e,n){(function(l,I,a,c,i,s,r,u,o){n.read=function(d,b,h,Z,O){var g,y,X=8*O-Z-1,v=(1<>1,Q=-7,L=h?O-1:0,J=h?-1:1,O=d[b+L];for(L+=J,g=O&(1<<-Q)-1,O>>=-Q,Q+=X;0>=-Q,Q+=Z;0>1,L=N===23?Math.pow(2,-24)-Math.pow(2,-77):0,J=Z?0:U-1,O=Z?1:-1,U=b<0||b===0&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(X=isNaN(b)?1:0,y=H):(y=Math.floor(Math.log(b)/Math.LN2),b*(Z=Math.pow(2,-y))<1&&(y--,Z*=2),2<=(b+=1<=y+Q?L/Z:L*Math.pow(2,1-Q))*Z&&(y++,Z/=2),H<=y+Q?(X=0,y=H):1<=y+Q?(X=(b*Z-1)*Math.pow(2,N),y+=Q):(X=b*Math.pow(2,Q-1)*Math.pow(2,N),y=0));8<=N;d[h+J]=255&X,J+=O,X/=256,N-=8);for(y=y<{"use strict";Nrn.exports=fhI;function fhI(t,e){for(var n=new Array(arguments.length-1),l=0,I=2,a=!0;I{"use strict";var DZe=grn;DZe.length=function(e){var n=e.length;if(!n)return 0;for(var l=0;--n%4>1&&e.charAt(n)==="=";)++l;return Math.ceil(e.length*3)/4-l};var rU=new Array(64),Yrn=new Array(123);for(aY=0;aY<64;)Yrn[rU[aY]=aY<26?aY+65:aY<52?aY+71:aY<62?aY-4:aY-59|43]=aY++;var aY;DZe.encode=function(e,n,l){for(var I=null,a=[],c=0,i=0,s;n>2],s=(r&3)<<4,i=1;break;case 1:a[c++]=rU[s|r>>4],s=(r&15)<<2,i=2;break;case 2:a[c++]=rU[s|r>>6],a[c++]=rU[r&63],i=0;break}c>8191&&((I||(I=[])).push(String.fromCharCode.apply(String,a)),c=0)}return i&&(a[c++]=rU[s],a[c++]=61,i===1&&(a[c++]=61)),I?(c&&I.push(String.fromCharCode.apply(String,a.slice(0,c))),I.join("")):String.fromCharCode.apply(String,a.slice(0,c))};var Vrn="invalid encoding";DZe.decode=function(e,n,l){for(var I=l,a=0,c,i=0;i1)break;if((s=Yrn[s])===void 0)throw Error(Vrn);switch(a){case 0:c=s,a=1;break;case 1:n[l++]=c<<2|(s&48)>>4,c=s,a=2;break;case 2:n[l++]=(c&15)<<4|(s&60)>>2,c=s,a=3;break;case 3:n[l++]=(c&3)<<6|s,a=0;break}}if(a===1)throw Error(Vrn);return l-I};DZe.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Arn=f((oZr,yrn)=>{"use strict";yrn.exports=KZe;function KZe(){this._listeners={}}KZe.prototype.on=function(e,n,l){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:n,ctx:l||this}),this};KZe.prototype.off=function(e,n){if(e===void 0)this._listeners={};else if(n===void 0)this._listeners[e]=[];else for(var l=this._listeners[e],I=0;I{"use strict";Hrn.exports=Frn(Frn);function Frn(t){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),l=n[3]===128;function I(s,r,u){e[0]=s,r[u]=n[0],r[u+1]=n[1],r[u+2]=n[2],r[u+3]=n[3]}function a(s,r,u){e[0]=s,r[u]=n[3],r[u+1]=n[2],r[u+2]=n[1],r[u+3]=n[0]}t.writeFloatLE=l?I:a,t.writeFloatBE=l?a:I;function c(s,r){return n[0]=s[r],n[1]=s[r+1],n[2]=s[r+2],n[3]=s[r+3],e[0]}function i(s,r){return n[3]=s[r],n[2]=s[r+1],n[1]=s[r+2],n[0]=s[r+3],e[0]}t.readFloatLE=l?c:i,t.readFloatBE=l?i:c}():function(){function e(l,I,a,c){var i=I<0?1:0;if(i&&(I=-I),I===0)l(1/I>0?0:2147483648,a,c);else if(isNaN(I))l(2143289344,a,c);else if(I>34028234663852886e22)l((i<<31|2139095040)>>>0,a,c);else if(I<11754943508222875e-54)l((i<<31|Math.round(I/1401298464324817e-60))>>>0,a,c);else{var s=Math.floor(Math.log(I)/Math.LN2),r=Math.round(I*Math.pow(2,-s)*8388608)&8388607;l((i<<31|s+127<<23|r)>>>0,a,c)}}t.writeFloatLE=e.bind(null,vrn),t.writeFloatBE=e.bind(null,frn);function n(l,I,a){var c=l(I,a),i=(c>>31)*2+1,s=c>>>23&255,r=c&8388607;return s===255?r?NaN:i*(1/0):s===0?i*1401298464324817e-60*r:i*Math.pow(2,s-150)*(r+8388608)}t.readFloatLE=n.bind(null,Xrn),t.readFloatBE=n.bind(null,wrn)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),l=n[7]===128;function I(s,r,u){e[0]=s,r[u]=n[0],r[u+1]=n[1],r[u+2]=n[2],r[u+3]=n[3],r[u+4]=n[4],r[u+5]=n[5],r[u+6]=n[6],r[u+7]=n[7]}function a(s,r,u){e[0]=s,r[u]=n[7],r[u+1]=n[6],r[u+2]=n[5],r[u+3]=n[4],r[u+4]=n[3],r[u+5]=n[2],r[u+6]=n[1],r[u+7]=n[0]}t.writeDoubleLE=l?I:a,t.writeDoubleBE=l?a:I;function c(s,r){return n[0]=s[r],n[1]=s[r+1],n[2]=s[r+2],n[3]=s[r+3],n[4]=s[r+4],n[5]=s[r+5],n[6]=s[r+6],n[7]=s[r+7],e[0]}function i(s,r){return n[7]=s[r],n[6]=s[r+1],n[5]=s[r+2],n[4]=s[r+3],n[3]=s[r+4],n[2]=s[r+5],n[1]=s[r+6],n[0]=s[r+7],e[0]}t.readDoubleLE=l?c:i,t.readDoubleBE=l?i:c}():function(){function e(l,I,a,c,i,s){var r=c<0?1:0;if(r&&(c=-c),c===0)l(0,i,s+I),l(1/c>0?0:2147483648,i,s+a);else if(isNaN(c))l(0,i,s+I),l(2146959360,i,s+a);else if(c>17976931348623157e292)l(0,i,s+I),l((r<<31|2146435072)>>>0,i,s+a);else{var u;if(c<22250738585072014e-324)u=c/5e-324,l(u>>>0,i,s+I),l((r<<31|u/4294967296)>>>0,i,s+a);else{var o=Math.floor(Math.log(c)/Math.LN2);o===1024&&(o=1023),u=c*Math.pow(2,-o),l(u*4503599627370496>>>0,i,s+I),l((r<<31|o+1023<<20|u*1048576&1048575)>>>0,i,s+a)}}}t.writeDoubleLE=e.bind(null,vrn,0,4),t.writeDoubleBE=e.bind(null,frn,4,0);function n(l,I,a,c,i){var s=l(c,i+I),r=l(c,i+a),u=(r>>31)*2+1,o=r>>>20&2047,d=4294967296*(r&1048575)+s;return o===2047?d?NaN:u*(1/0):o===0?u*5e-324*d:u*Math.pow(2,o-1075)*(d+4503599627370496)}t.readDoubleLE=n.bind(null,Xrn,0,4),t.readDoubleBE=n.bind(null,wrn,4,0)}(),t}function vrn(t,e,n){e[n]=t&255,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function frn(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=t&255}function Xrn(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function wrn(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var OMe=f((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}});var Jrn=f(Ern=>{"use strict";var UMe=Ern;UMe.length=function(e){for(var n=0,l=0,I=0;I191&&s<224?c[i++]=(s&31)<<6|e[n++]&63:s>239&&s<365?(s=((s&7)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,c[i++]=55296+(s>>10),c[i++]=56320+(s&1023)):c[i++]=(s&15)<<12|(e[n++]&63)<<6|e[n++]&63,i>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,c)),i=0);return a?(i&&a.push(String.fromCharCode.apply(String,c.slice(0,i))),a.join("")):String.fromCharCode.apply(String,c.slice(0,i))};UMe.write=function(e,n,l){for(var I=l,a,c,i=0;i>6|192,n[l++]=a&63|128):(a&64512)===55296&&((c=e.charCodeAt(i+1))&64512)===56320?(a=65536+((a&1023)<<10)+(c&1023),++i,n[l++]=a>>18|240,n[l++]=a>>12&63|128,n[l++]=a>>6&63|128,n[l++]=a&63|128):(n[l++]=a>>12|224,n[l++]=a>>6&63|128,n[l++]=a&63|128);return l-I}});var Lrn=f((uZr,Crn)=>{"use strict";Crn.exports=XhI;function XhI(t,e,n){var l=n||8192,I=l>>>1,a=null,c=l;return function(s){if(s<1||s>I)return t(s);c+s>l&&(a=t(l),c=0);var r=e.call(a,c,c+=s);return c&7&&(c=(c|7)+1),r}}});var xrn=f((dZr,krn)=>{"use strict";krn.exports=Md;var Y6=CR();function Md(t,e){this.lo=t>>>0,this.hi=e>>>0}var zJ=Md.zero=new Md(0,0);zJ.toNumber=function(){return 0};zJ.zzEncode=zJ.zzDecode=function(){return this};zJ.length=function(){return 1};var whI=Md.zeroHash="\0\0\0\0\0\0\0\0";Md.fromNumber=function(e){if(e===0)return zJ;var n=e<0;n&&(e=-e);var l=e>>>0,I=(e-l)/4294967296>>>0;return n&&(I=~I>>>0,l=~l>>>0,++l>4294967295&&(l=0,++I>4294967295&&(I=0))),new Md(l,I)};Md.from=function(e){if(typeof e=="number")return Md.fromNumber(e);if(Y6.isString(e))if(Y6.Long)e=Y6.Long.fromString(e);else return Md.fromNumber(parseInt(e,10));return e.low||e.high?new Md(e.low>>>0,e.high>>>0):zJ};Md.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var n=~this.lo+1>>>0,l=~this.hi>>>0;return n||(l=l+1>>>0),-(n+l*4294967296)}return this.lo+this.hi*4294967296};Md.prototype.toLong=function(e){return Y6.Long?new Y6.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var ww=String.prototype.charCodeAt;Md.fromHash=function(e){return e===whI?zJ:new Md((ww.call(e,0)|ww.call(e,1)<<8|ww.call(e,2)<<16|ww.call(e,3)<<24)>>>0,(ww.call(e,4)|ww.call(e,5)<<8|ww.call(e,6)<<16|ww.call(e,7)<<24)>>>0)};Md.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Md.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};Md.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};Md.prototype.length=function(){var e=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,l=this.hi>>>24;return l===0?n===0?e<16384?e<128?1:2:e<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:l<128?9:10}});var CR=f(zMe=>{"use strict";var an=zMe;an.asPromise=jMe();an.base64=Rrn();an.EventEmitter=Arn();an.float=Qrn();an.inquire=OMe();an.utf8=Jrn();an.pool=Lrn();an.LongBits=xrn();an.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);an.global=an.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||zMe;an.emptyArray=Object.freeze?Object.freeze([]):[];an.emptyObject=Object.freeze?Object.freeze({}):{};an.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};an.isString=function(e){return typeof e=="string"||e instanceof String};an.isObject=function(e){return e&&typeof e=="object"};an.isset=an.isSet=function(e,n){var l=e[n];return l!=null&&e.hasOwnProperty(n)?typeof l!="object"||(Array.isArray(l)?l.length:Object.keys(l).length)>0:!1};an.Buffer=function(){try{var t=an.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch{return null}}();an._Buffer_from=null;an._Buffer_allocUnsafe=null;an.newBuffer=function(e){return typeof e=="number"?an.Buffer?an._Buffer_allocUnsafe(e):new an.Array(e):an.Buffer?an._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};an.Array=typeof Uint8Array<"u"?Uint8Array:Array;an.Long=an.global.dcodeIO&&an.global.dcodeIO.Long||an.global.Long||an.inquire("long");an.key2Re=/^true|false|0|1$/;an.key32Re=/^-?(?:0|[1-9][0-9]*)$/;an.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;an.longToHash=function(e){return e?an.LongBits.from(e).toHash():an.LongBits.zeroHash};an.longFromHash=function(e,n){var l=an.LongBits.fromHash(e);return an.Long?an.Long.fromBits(l.lo,l.hi,n):l.toNumber(!!n)};function jrn(t,e,n){for(var l=Object.keys(e),I=0;I-1;--a)if(n[I[a]]===1&&this[I[a]]!==void 0&&this[I[a]]!==null)return I[a]}};an.oneOfSetter=function(e){return function(n){for(var l=0;l{"use strict";Srn.exports=fa;var sN=CR(),BMe,_Ze=sN.LongBits,Urn=sN.base64,zrn=sN.utf8;function g6(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function MMe(){}function HhI(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function fa(){this.len=0,this.head=new g6(MMe,0,0),this.tail=this.head,this.states=null}var Brn=function(){return sN.Buffer?function(){return(fa.create=function(){return new BMe})()}:function(){return new fa}};fa.create=Brn();fa.alloc=function(e){return new sN.Array(e)};sN.Array!==Array&&(fa.alloc=sN.pool(fa.alloc,sN.Array.prototype.subarray));fa.prototype._push=function(e,n,l){return this.tail=this.tail.next=new g6(e,n,l),this.len+=n,this};function TMe(t,e,n){e[n]=t&255}function QhI(t,e,n){for(;t>127;)e[n++]=t&127|128,t>>>=7;e[n]=t}function DMe(t,e){this.len=t,this.next=void 0,this.val=e}DMe.prototype=Object.create(g6.prototype);DMe.prototype.fn=QhI;fa.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new DMe((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};fa.prototype.int32=function(e){return e<0?this._push(KMe,10,_Ze.fromNumber(e)):this.uint32(e)};fa.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function KMe(t,e,n){for(;t.hi;)e[n++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=t.lo&127|128,t.lo=t.lo>>>7;e[n++]=t.lo}fa.prototype.uint64=function(e){var n=_Ze.from(e);return this._push(KMe,n.length(),n)};fa.prototype.int64=fa.prototype.uint64;fa.prototype.sint64=function(e){var n=_Ze.from(e).zzEncode();return this._push(KMe,n.length(),n)};fa.prototype.bool=function(e){return this._push(TMe,1,e?1:0)};function SMe(t,e,n){e[n]=t&255,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}fa.prototype.fixed32=function(e){return this._push(SMe,4,e>>>0)};fa.prototype.sfixed32=fa.prototype.fixed32;fa.prototype.fixed64=function(e){var n=_Ze.from(e);return this._push(SMe,4,n.lo)._push(SMe,4,n.hi)};fa.prototype.sfixed64=fa.prototype.fixed64;fa.prototype.float=function(e){return this._push(sN.float.writeFloatLE,4,e)};fa.prototype.double=function(e){return this._push(sN.float.writeDoubleLE,8,e)};var EhI=sN.Array.prototype.set?function(e,n,l){n.set(e,l)}:function(e,n,l){for(var I=0;I>>0;if(!n)return this._push(TMe,1,0);if(sN.isString(e)){var l=fa.alloc(n=Urn.length(e));Urn.decode(e,l,0),e=l}return this.uint32(n)._push(EhI,n,e)};fa.prototype.string=function(e){var n=zrn.length(e);return n?this.uint32(n)._push(zrn.write,n,e):this._push(TMe,1,0)};fa.prototype.fork=function(){return this.states=new HhI(this),this.head=this.tail=new g6(MMe,0,0),this.len=0,this};fa.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new g6(MMe,0,0),this.len=0),this};fa.prototype.ldelim=function(){var e=this.head,n=this.tail,l=this.len;return this.reset().uint32(l),l&&(this.tail.next=e.next,this.tail=n,this.len+=l),this};fa.prototype.finish=function(){for(var e=this.head.next,n=this.constructor.alloc(this.len),l=0;e;)e.fn(e.val,n,l),l+=e.len,e=e.next;return n};fa._configure=function(t){BMe=t,fa.create=Brn(),BMe._configure()}});var Drn=f((mZr,Trn)=>{"use strict";Trn.exports=LR;var Mrn=PZe();(LR.prototype=Object.create(Mrn.prototype)).constructor=LR;var Hw=CR();function LR(){Mrn.call(this)}LR._configure=function(){LR.alloc=Hw._Buffer_allocUnsafe,LR.writeBytesBuffer=Hw.Buffer&&Hw.Buffer.prototype instanceof Uint8Array&&Hw.Buffer.prototype.set.name==="set"?function(e,n,l){n.set(e,l)}:function(e,n,l){if(e.copy)e.copy(n,l,0,e.length);else for(var I=0;I>>0;return this.uint32(n),n&&this._push(LR.writeBytesBuffer,n,e),this};function JhI(t,e,n){t.length<40?Hw.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}LR.prototype.string=function(e){var n=Hw.Buffer.byteLength(e);return this.uint32(n),n&&this._push(JhI,n,e),this};LR._configure()});var $Ze=f((pZr,$rn)=>{"use strict";$rn.exports=Po;var rY=CR(),PMe,Prn=rY.LongBits,ChI=rY.utf8;function cY(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Po(t){this.buf=t,this.pos=0,this.len=t.length}var Krn=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Po(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Po(e);throw Error("illegal buffer")},qrn=function(){return rY.Buffer?function(n){return(Po.create=function(I){return rY.Buffer.isBuffer(I)?new PMe(I):Krn(I)})(n)}:Krn};Po.create=qrn();Po.prototype._slice=rY.Array.prototype.subarray||rY.Array.prototype.slice;Po.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,cY(this,10);return e}}();Po.prototype.int32=function(){return this.uint32()|0};Po.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function _Me(){var t=new Prn(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw cY(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw cY(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}Po.prototype.bool=function(){return this.uint32()!==0};function qZe(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Po.prototype.fixed32=function(){if(this.pos+4>this.len)throw cY(this,4);return qZe(this.buf,this.pos+=4)};Po.prototype.sfixed32=function(){if(this.pos+4>this.len)throw cY(this,4);return qZe(this.buf,this.pos+=4)|0};function _rn(){if(this.pos+8>this.len)throw cY(this,8);return new Prn(qZe(this.buf,this.pos+=4),qZe(this.buf,this.pos+=4))}Po.prototype.float=function(){if(this.pos+4>this.len)throw cY(this,4);var e=rY.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Po.prototype.double=function(){if(this.pos+8>this.len)throw cY(this,4);var e=rY.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Po.prototype.bytes=function(){var e=this.uint32(),n=this.pos,l=this.pos+e;if(l>this.len)throw cY(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(n,l);if(n===l){var I=rY.Buffer;return I?I.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,n,l)};Po.prototype.string=function(){var e=this.bytes();return ChI.read(e,0,e.length)};Po.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw cY(this,e);this.pos+=e}else do if(this.pos>=this.len)throw cY(this);while(this.buf[this.pos++]&128);return this};Po.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Po._configure=function(t){PMe=t,Po.create=qrn(),PMe._configure();var e=rY.Long?"toLong":"toNumber";rY.merge(Po.prototype,{int64:function(){return _Me.call(this)[e](!1)},uint64:function(){return _Me.call(this)[e](!0)},sint64:function(){return _Me.call(this).zzDecode()[e](!1)},fixed64:function(){return _rn.call(this)[e](!0)},sfixed64:function(){return _rn.call(this)[e](!1)}})}});var lcn=f((hZr,ncn)=>{"use strict";ncn.exports=BJ;var tcn=$Ze();(BJ.prototype=Object.create(tcn.prototype)).constructor=BJ;var ecn=CR();function BJ(t){tcn.call(this,t)}BJ._configure=function(){ecn.Buffer&&(BJ.prototype._slice=ecn.Buffer.prototype.slice)};BJ.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};BJ._configure()});var acn=f((ZZr,Icn)=>{"use strict";Icn.exports=R6;var qMe=CR();(R6.prototype=Object.create(qMe.EventEmitter.prototype)).constructor=R6;function R6(t,e,n){if(typeof t!="function")throw TypeError("rpcImpl must be a function");qMe.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!n}R6.prototype.rpcCall=function t(e,n,l,I,a){if(!I)throw TypeError("request must be specified");var c=this;if(!a)return qMe.asPromise(t,c,e,n,l,I);if(!c.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return c.rpcImpl(e,n[c.requestDelimited?"encodeDelimited":"encode"](I).finish(),function(s,r){if(s)return c.emit("error",s,e),a(s);if(r===null){c.end(!0);return}if(!(r instanceof l))try{r=l[c.responseDelimited?"decodeDelimited":"decode"](r)}catch(u){return c.emit("error",u,e),a(u)}return c.emit("data",r,e),a(null,r)})}catch(i){c.emit("error",i,e),setTimeout(function(){a(i)},0);return}};R6.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var $Me=f(rcn=>{"use strict";var LhI=rcn;LhI.Service=acn()});var eTe=f((NZr,ccn)=>{"use strict";ccn.exports={}});var tTe=f(icn=>{"use strict";var Sp=icn;Sp.build="minimal";Sp.Writer=PZe();Sp.BufferWriter=Drn();Sp.Reader=$Ze();Sp.BufferReader=lcn();Sp.util=CR();Sp.rpc=$Me();Sp.roots=eTe();Sp.configure=ocn;function ocn(){Sp.util._configure(),Sp.Writer._configure(Sp.BufferWriter),Sp.Reader._configure(Sp.BufferReader)}ocn()});var ucn=f((YZr,scn)=>{"use strict";scn.exports=nTe;function nTe(t,e){typeof t=="string"&&(e=t,t=void 0);var n=[];function l(a){if(typeof a!="string"){var c=I();if(nTe.verbose&&console.log("codegen: "+c),c="return "+c,a){for(var i=Object.keys(a),s=new Array(i.length+1),r=new Array(i.length),u=0;u{"use strict";dcn.exports=y6;var khI=jMe(),xhI=OMe(),lTe=xhI("fs");function y6(t,e,n){return typeof e=="function"?(n=e,e={}):e||(e={}),n?!e.xhr&&lTe&&lTe.readFile?lTe.readFile(t,function(I,a){return I&&typeof XMLHttpRequest<"u"?y6.xhr(t,e,n):I?n(I):n(null,e.binary?a:a.toString("utf8"))}):y6.xhr(t,e,n):khI(y6,this,t,e)}y6.xhr=function(e,n,l){var I=new XMLHttpRequest;I.onreadystatechange=function(){if(I.readyState===4){if(I.status!==0&&I.status!==200)return l(Error("status "+I.status));if(n.binary){var c=I.response;if(!c){c=[];for(var i=0;i{"use strict";var aTe=mcn,bcn=aTe.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},ITe=aTe.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var n=e.split("/"),l=bcn(e),I="";l&&(I=n.shift()+"/");for(var a=0;a0&&n[a-1]!==".."?n.splice(--a,2):l?n.splice(a,1):++a:n[a]==="."?n.splice(a,1):++a;return I+n.join("/")};aTe.resolve=function(e,n,l){return l||(n=ITe(n)),bcn(n)?n:(l||(e=ITe(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?ITe(e+"/"+n):n)}});var oU=f((yZr,Wcn)=>{"use strict";Wcn.exports=Ya;var eWe=Ew();((Ya.prototype=Object.create(eWe.prototype)).constructor=Ya).className="Namespace";var rTe=Qw(),tWe=Td(),jhI=TJ(),SJ,cU,MJ;Ya.fromJSON=function(e,n){return new Ya(e,n.options).addJSON(n.nested)};function hcn(t,e){if(t&&t.length){for(var n={},l=0;ln)return!0}return!1};Ya.isReservedName=function(e,n){if(e){for(var l=0;l0;){var I=e.shift();if(l.nested&&l.nested[I]){if(l=l.nested[I],!(l instanceof Ya))throw Error("path conflicts with non-namespace objects")}else l.add(l=new Ya(I))}return n&&l.addJSON(n),l};Ya.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,n=0;for(this.resolve();n{n._resolveFeaturesRecursive(e)}),this):this};Ya.prototype.lookup=function(e,n,l){if(typeof n=="boolean"?(l=n,n=void 0):n&&!Array.isArray(n)&&(n=[n]),tWe.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var I=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),n);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+I];if(a&&(!n||n.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,I),a&&(!n||n.indexOf(a.constructor)>-1)))return a;if(l)return null;for(var c=this;c.parent;){if(a=c.parent._lookupImpl(e,I),a&&(!n||n.indexOf(a.constructor)>-1))return a;c=c.parent}return null};Ya.prototype._lookupImpl=function(e,n){if(Object.prototype.hasOwnProperty.call(this._lookupCache,n))return this._lookupCache[n];var l=this.get(e[0]),I=null;if(l)e.length===1?I=l:l instanceof Ya&&(e=e.slice(1),I=l._lookupImpl(e,e.join(".")));else for(var a=0;a{"use strict";Ncn.exports=TF;var cTe=Qw();((TF.prototype=Object.create(cTe.prototype)).constructor=TF).className="MapField";var OhI=DJ(),A6=Td();function TF(t,e,n,l,I,a){if(cTe.call(this,t,e,l,void 0,void 0,I,a),!A6.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}TF.fromJSON=function(e,n){return new TF(e,n.id,n.keyType,n.type,n.options,n.comment)};TF.prototype.toJSON=function(e){var n=e?!!e.keepComments:!1;return A6.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",n?this.comment:void 0])};TF.prototype.resolve=function(){if(this.resolved)return this;if(OhI.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return cTe.prototype.resolve.call(this)};TF.d=function(e,n,l){return typeof l=="function"?l=A6.decorateType(l).name:l&&typeof l=="object"&&(l=A6.decorateEnum(l).name),function(a,c){A6.decorateType(a.constructor).add(new TF(c,e,n,l))}}});var lWe=f((FZr,Vcn)=>{"use strict";Vcn.exports=KJ;var oTe=Ew();((KJ.prototype=Object.create(oTe.prototype)).constructor=KJ).className="Method";var iU=Td();function KJ(t,e,n,l,I,a,c,i,s){if(iU.isObject(I)?(c=I,I=a=void 0):iU.isObject(a)&&(c=a,a=void 0),!(e===void 0||iU.isString(e)))throw TypeError("type must be a string");if(!iU.isString(n))throw TypeError("requestType must be a string");if(!iU.isString(l))throw TypeError("responseType must be a string");oTe.call(this,t,c),this.type=e||"rpc",this.requestType=n,this.requestStream=I?!0:void 0,this.responseType=l,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=i,this.parsedOptions=s}KJ.fromJSON=function(e,n){return new KJ(e,n.type,n.requestType,n.responseType,n.requestStream,n.responseStream,n.options,n.comment,n.parsedOptions)};KJ.prototype.toJSON=function(e){var n=e?!!e.keepComments:!1;return iU.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",n?this.comment:void 0,"parsedOptions",this.parsedOptions])};KJ.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),oTe.prototype.resolve.call(this))}});var IWe=f((vZr,gcn)=>{"use strict";gcn.exports=sZ;var DF=oU();((sZ.prototype=Object.create(DF.prototype)).constructor=sZ).className="Service";var iTe=lWe(),F6=Td(),UhI=$Me();function sZ(t,e){DF.call(this,t,e),this.methods={},this._methodsArray=null}sZ.fromJSON=function(e,n){var l=new sZ(e,n.options);if(n.methods)for(var I=Object.keys(n.methods),a=0;a{n._resolveFeaturesRecursive(e)}),this):this};sZ.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof iTe?(this.methods[e.name]=e,e.parent=this,Ycn(this)):DF.prototype.add.call(this,e)};sZ.prototype.remove=function(e){if(e instanceof iTe){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,Ycn(this)}return DF.prototype.remove.call(this,e)};sZ.prototype.create=function(e,n,l){for(var I=new UhI.Service(e,n,l),a=0,c;a{"use strict";Rcn.exports=kR;var zhI=CR();function kR(t){if(t)for(var e=Object.keys(t),n=0;n{"use strict";Acn.exports=MhI;var BhI=oY(),KF=DJ(),ycn=Td();function ShI(t){return"missing required '"+t.name+"'"}function MhI(t){for(var e=ycn.codegen(["r","l","e"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(i){return i.map}).length?",k,value":""))("while(r.pos>>3){"),n=0;n>>3){")("case 1: k=r.%s(); break",l.keyType)("case 2:"),KF.basic[I]===void 0?e("value=types[%i].decode(r,r.uint32())",n):e("value=r.%s()",I),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),KF.long[l.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',a):e("%s[k]=value",a)):l.repeated?(e("if(!(%s&&%s.length))",a,a)("%s=[]",a),KF.packed[I]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos{"use strict";Fcn.exports=KhI;var ThI=oY(),uTe=Td();function uN(t,e){return t.name+": "+e+(t.repeated&&e!=="array"?"[]":t.map&&e!=="object"?"{k:"+t.keyType+"}":"")+" expected"}function dTe(t,e,n,l){if(e.resolvedType)if(e.resolvedType instanceof ThI){t("switch(%s){",l)("default:")("return%j",uN(e,"enum value"));for(var I=Object.keys(e.resolvedType.values),a=0;a{"use strict";var vcn=fcn,v6=oY(),xR=Td();function bTe(t,e,n,l){var I=!1;if(e.resolvedType)if(e.resolvedType instanceof v6){t("switch(d%s){",l);for(var a=e.resolvedType.values,c=Object.keys(a),i=0;i>>0",l,l);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",l,l);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",l,l,s)('else if(typeof d%s==="string")',l)("m%s=parseInt(d%s,10)",l,l)('else if(typeof d%s==="number")',l)("m%s=d%s",l,l)('else if(typeof d%s==="object")',l)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",l,l,l,s?"true":"");break;case"bytes":t('if(typeof d%s==="string")',l)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",l,l,l)("else if(d%s.length >= 0)",l)("m%s=d%s",l,l);break;case"string":t("m%s=String(d%s)",l,l);break;case"bool":t("m%s=Boolean(d%s)",l,l);break}}return t}vcn.fromObject=function(e){var n=e.fieldsArray,l=xR.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!n.length)return l("return new this.ctor");l("var m=new this.ctor");for(var I=0;I>>0,m%s.high>>>0).toNumber(%s):m%s",l,l,l,l,I?"true":"",l);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",l,l,l,l,l);break;default:t("d%s=m%s",l,l);break}}return t}vcn.toObject=function(e){var n=e.fieldsArray.slice().sort(xR.compareFieldsById);if(!n.length)return xR.codegen()("return {}");for(var l=xR.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),I=[],a=[],c=[],i=0;i{"use strict";var _hI=Xcn,PhI=aWe();_hI[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var e=t["@type"].substring(t["@type"].lastIndexOf("/")+1),n=this.lookup(e);if(n){var l=t["@type"].charAt(0)==="."?t["@type"].slice(1):t["@type"];return l.indexOf("/")===-1&&(l="/"+l),this.create({type_url:l,value:n.encode(n.fromObject(t)).finish()})}}return this.fromObject(t)},toObject:function(t,e){var n="type.googleapis.com/",l="",I="";if(e&&e.json&&t.type_url&&t.value){I=t.type_url.substring(t.type_url.lastIndexOf("/")+1),l=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var a=this.lookup(I);a&&(t=a.decode(t.value))}if(!(t instanceof this.ctor)&&t instanceof PhI){var c=t.$type.toObject(t,e),i=t.$type.fullName[0]==="."?t.$type.fullName.slice(1):t.$type.fullName;return l===""&&(l=n),I=l+i,c["@type"]=I,c}return this.toObject(t,e)}}});var oWe=f((EZr,Hcn)=>{"use strict";Hcn.exports=ac;var dN=oU();((ac.prototype=Object.create(dN.prototype)).constructor=ac).className="Type";var qhI=oY(),NTe=TJ(),rWe=Qw(),$hI=nWe(),eZI=IWe(),ZTe=aWe(),WTe=$Ze(),tZI=PZe(),Ub=Td(),nZI=VTe(),lZI=sTe(),IZI=GTe(),wcn=pTe(),aZI=hTe();function ac(t,e){dN.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(ac.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var t=Object.keys(this.fields),e=0;e{n._resolveFeatures(e)}),this.fieldsArray.forEach(n=>{n._resolveFeatures(e)}),this):this};ac.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null};ac.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof rWe&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),cWe(this)}return e instanceof NTe?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),cWe(this)):dN.prototype.add.call(this,e)};ac.prototype.remove=function(e){if(e instanceof rWe&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),cWe(this)}if(e instanceof NTe){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),cWe(this)}return dN.prototype.remove.call(this,e)};ac.prototype.isReservedId=function(e){return dN.isReservedId(this.reserved,e)};ac.prototype.isReservedName=function(e){return dN.isReservedName(this.reserved,e)};ac.prototype.create=function(e){return new this.ctor(e)};ac.prototype.setup=function(){for(var e=this.fullName,n=[],l=0;l{"use strict";Jcn.exports=uZ;var uWe=oU();((uZ.prototype=Object.create(uWe.prototype)).constructor=uZ).className="Root";var iWe=Qw(),YTe=oY(),rZI=TJ(),Jw=Td(),gTe,RTe,f6;function uZ(t){uWe.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}uZ.fromJSON=function(e,n){return n||(n=new uZ),e.options&&n.setOptions(e.options),n.addJSON(e.nested).resolveAll()};uZ.prototype.resolvePath=Jw.path.resolve;uZ.prototype.fetch=Jw.fetch;function Ecn(){}uZ.prototype.load=function t(e,n,l){typeof n=="function"&&(l=n,n=void 0);var I=this;if(!l)return Jw.asPromise(t,I,e,n);var a=l===Ecn;function c(b,h){if(l){if(a)throw b;h&&h.resolveAll();var Z=l;l=null,Z(b,h)}}function i(b){var h=b.lastIndexOf("google/protobuf/");if(h>-1){var Z=b.substring(h);if(Z in f6)return Z}return null}function s(b,h){try{if(Jw.isString(h)&&h.charAt(0)==="{"&&(h=JSON.parse(h)),!Jw.isString(h))I.setOptions(h.options).addJSON(h.nested);else{RTe.filename=b;var Z=RTe(h,I,n),N,g=0;if(Z.imports)for(;g-1)){if(I.files.push(b),b in f6){a?s(b,f6[b]):(++u,setTimeout(function(){--u,s(b,f6[b])}));return}if(a){var Z;try{Z=Jw.fs.readFileSync(b).toString("utf8")}catch(N){h||c(N);return}s(b,Z)}else++u,I.fetch(b,function(N,g){if(--u,!!l){if(N){h?u||c(null,I):c(N);return}s(b,g)}})}}var u=0;Jw.isString(e)&&(e=[e]);for(var o=0,d;o-1&&this.deferred.splice(n,1)}}else if(e instanceof YTe)sWe.test(e.name)&&delete e.parent[e.name];else if(e instanceof uWe){for(var l=0;l{"use strict";var qo=Lcn.exports=CR(),Ccn=eTe(),yTe,ATe;qo.codegen=ucn();qo.fetch=Gcn();qo.path=pcn();qo.fs=qo.inquire("fs");qo.toArray=function(e){if(e){for(var n=Object.keys(e),l=new Array(n.length),I=0;I0)c[r]=a(c[r]||{},i,s);else{var u=c[r];if(u&&I)return c;u&&(s=[].concat(u).concat(s)),c[r]=s}return c}if(typeof e!="object")throw TypeError("dst must be an object");if(!n)throw TypeError("path must be specified");return n=n.split("."),a(e,n,l)};Object.defineProperty(qo,"decorateRoot",{get:function(){return Ccn.decorated||(Ccn.decorated=new(dWe()))}})});var DJ=f(kcn=>{"use strict";var X6=kcn,uZI=Td(),dZI=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function w6(t,e){var n=0,l={};for(e|=0;n{"use strict";jcn.exports=Dd;var Q6=Ew();((Dd.prototype=Object.create(Q6.prototype)).constructor=Dd).className="Field";var xcn=oY(),FTe=DJ(),Bu=Td(),H6,GZI=/^required|optional|repeated$/;Dd.fromJSON=function(e,n){var l=new Dd(e,n.id,n.type,n.rule,n.extend,n.options,n.comment);return n.edition&&(l._edition=n.edition),l._defaultEdition="proto3",l};function Dd(t,e,n,l,I,a,c){if(Bu.isObject(l)?(c=I,a=l,l=I=void 0):Bu.isObject(I)&&(c=a,a=I,I=void 0),Q6.call(this,t,a),!Bu.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Bu.isString(n))throw TypeError("type must be a string");if(l!==void 0&&!GZI.test(l=l.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(I!==void 0&&!Bu.isString(I))throw TypeError("extend must be a string");l==="proto3_optional"&&(l="optional"),this.rule=l&&l!=="optional"?l:void 0,this.type=n,this.id=e,this.extend=I||void 0,this.repeated=l==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Bu.Long?FTe.long[n]!==void 0:!1,this.bytes=n==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=c}Object.defineProperty(Dd.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(Dd.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(Dd.prototype,"delimited",{get:function(){return this.resolvedType instanceof H6&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(Dd.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(Dd.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});Dd.prototype.setOption=function(e,n,l){return Q6.prototype.setOption.call(this,e,n,l)};Dd.prototype.toJSON=function(e){var n=e?!!e.keepComments:!1;return Bu.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",n?this.comment:void 0])};Dd.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=FTe.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof H6?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof xcn&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof xcn)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Bu.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;Bu.base64.test(this.typeDefault)?Bu.base64.decode(this.typeDefault,e=Bu.newBuffer(Bu.base64.length(this.typeDefault)),0):Bu.utf8.write(this.typeDefault,e=Bu.newBuffer(Bu.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Bu.emptyObject:this.repeated?this.defaultValue=Bu.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof H6&&(this.parent.ctor.prototype[this.name]=this.defaultValue),Q6.prototype.resolve.call(this)};Dd.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var n={};if(this.rule==="required"&&(n.field_presence="LEGACY_REQUIRED"),this.parent&&FTe.defaults[this.type]===void 0){var l=this.parent.get(this.type.split(".").pop());l&&l instanceof H6&&l.group&&(n.message_encoding="DELIMITED")}return this.getOption("packed")===!0?n.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(n.repeated_field_encoding="EXPANDED"),n};Dd.prototype._resolveFeatures=function(e){return Q6.prototype._resolveFeatures.call(this,this._edition||e)};Dd.d=function(e,n,l,I){return typeof n=="function"?n=Bu.decorateType(n).name:n&&typeof n=="object"&&(n=Bu.decorateEnum(n).name),function(c,i){Bu.decorateType(c.constructor).add(new Dd(i,e,n,l,{default:I}))}};Dd._configure=function(e){H6=e}});var TJ=f((xZr,zcn)=>{"use strict";zcn.exports=dZ;var bWe=Ew();((dZ.prototype=Object.create(bWe.prototype)).constructor=dZ).className="OneOf";var Ocn=Qw(),GWe=Td();function dZ(t,e,n,l){if(Array.isArray(e)||(n=e,e=void 0),bWe.call(this,t,n),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=l}dZ.fromJSON=function(e,n){return new dZ(e,n.oneof,n.options,n.comment)};dZ.prototype.toJSON=function(e){var n=e?!!e.keepComments:!1;return GWe.toObject(["options",this.options,"oneof",this.oneof,"comment",n?this.comment:void 0])};function Ucn(t){if(t.parent)for(var e=0;e-1&&this.oneof.splice(n,1),e.partOf=null,this};dZ.prototype.onAdd=function(e){bWe.prototype.onAdd.call(this,e);for(var n=this,l=0;l{"use strict";Bcn.exports=jG;jG.className="ReflectionObject";var bZI=TJ(),E6=Td(),mWe,mZI={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},pZI={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},hZI={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function jG(t,e){if(!E6.isString(t))throw TypeError("name must be a string");if(e&&!E6.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=t,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(jG.prototype,{root:{get:function(){for(var t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],e=this.parent;e;)t.unshift(e.name),e=e.parent;return t.join(".")}}});jG.prototype.toJSON=function(){throw Error()};jG.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var n=e.root;n instanceof mWe&&n._handleAdd(this)};jG.prototype.onRemove=function(e){var n=e.root;n instanceof mWe&&n._handleRemove(this),this.parent=null,this.resolved=!1};jG.prototype.resolve=function(){return this.resolved?this:(this.root instanceof mWe&&(this.resolved=!0),this)};jG.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};jG.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var n={};if(!e)throw new Error("Unknown edition for "+this.fullName);var l=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")n=Object.assign({},pZI);else if(e==="proto3")n=Object.assign({},hZI);else if(e==="2023")n=Object.assign({},mZI);else throw new Error("Unknown edition: "+e);this._features=Object.assign(n,l||{}),this._featuresResolved=!0;return}if(this.partOf instanceof bZI){var I=Object.assign({},this.partOf._features);this._features=Object.assign(I,l||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,l||{})}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};jG.prototype._inferLegacyProtoFeatures=function(){return{}};jG.prototype.getOption=function(e){if(this.options)return this.options[e]};jG.prototype.setOption=function(e,n,l){return this.options||(this.options={}),/^features\./.test(e)?E6.setProperty(this.options,e,n,l):(!l||this.options[e]===void 0)&&(this.getOption(e)!==n&&(this.resolved=!1),this.options[e]=n),this};jG.prototype.setParsedOption=function(e,n,l){this.parsedOptions||(this.parsedOptions=[]);var I=this.parsedOptions;if(l){var a=I.find(function(s){return Object.prototype.hasOwnProperty.call(s,e)});if(a){var c=a[e];E6.setProperty(c,l,n)}else a={},a[e]=E6.setProperty({},l,n),I.push(a)}else{var i={};i[e]=n,I.push(i)}return this};jG.prototype.setOptions=function(e,n){if(e)for(var l=Object.keys(e),I=0;I{"use strict";Mcn.exports=iY;var vTe=Ew();((iY.prototype=Object.create(vTe.prototype)).constructor=iY).className="Enum";var Scn=oU(),pWe=Td();function iY(t,e,n,l,I,a){if(vTe.call(this,t,n),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=l,this.comments=I||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var c=Object.keys(e),i=0;i{var l=Object.assign({},this._features);this._valuesFeatures[n]=Object.assign(l,this.valuesOptions&&this.valuesOptions[n]&&this.valuesOptions[n].features)}),this};iY.fromJSON=function(e,n){var l=new iY(e,n.values,n.options,n.comment,n.comments);return l.reserved=n.reserved,n.edition&&(l._edition=n.edition),l._defaultEdition="proto3",l};iY.prototype.toJSON=function(e){var n=e?!!e.keepComments:!1;return pWe.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",n?this.comment:void 0,"comments",n?this.comments:void 0])};iY.prototype.add=function(e,n,l,I){if(!pWe.isString(e))throw TypeError("name must be a string");if(!pWe.isInteger(n))throw TypeError("id must be an integer");if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(n))throw Error("id "+n+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[n]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+n+" in "+this);this.values[e]=n}else this.valuesById[this.values[e]=n]=e;return I&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=I||null),this.comments[e]=l||null,this};iY.prototype.remove=function(e){if(!pWe.isString(e))throw TypeError("name must be a string");var n=this.values[e];if(n==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[n],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};iY.prototype.isReservedId=function(e){return Scn.isReservedId(this.reserved,e)};iY.prototype.isReservedName=function(e){return Scn.isReservedName(this.reserved,e)}});var VTe=f((UZr,Dcn)=>{"use strict";Dcn.exports=WZI;var ZZI=oY(),fTe=DJ(),XTe=Td();function Tcn(t,e,n,l){return e.delimited?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,l,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,l,(e.id<<3|2)>>>0)}function WZI(t){for(var e=XTe.codegen(["m","w"],t.name+"$encode")("if(!w)")("w=Writer.create()"),n,l,I=t.fieldsArray.slice().sort(XTe.compareFieldsById),n=0;n>>0,8|fTe.mapKey[a.keyType],a.keyType),s===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,l):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|s,i,l),e("}")("}")):a.repeated?(e("if(%s!=null&&%s.length){",l,l),a.packed&&fTe.packed[i]!==void 0?e("w.uint32(%i).fork()",(a.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",l)("w.%s(%s[i])",i,l)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",l),s===void 0?Tcn(e,a,c,l+"[i]"):e("w.uint32(%i).%s(%s[i])",(a.id<<3|s)>>>0,i,l)),e("}")):(a.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",l,a.name),s===void 0?Tcn(e,a,c,l):e("w.uint32(%i).%s(%s)",(a.id<<3|s)>>>0,i,l))}return e("return w")}});var _cn=f((zZr,Kcn)=>{"use strict";var ga=Kcn.exports=tTe();ga.build="light";function NZI(t,e,n){return typeof e=="function"?(n=e,e=new ga.Root):e||(e=new ga.Root),e.load(t,n)}ga.load=NZI;function VZI(t,e){return e||(e=new ga.Root),e.loadSync(t)}ga.loadSync=VZI;ga.encoder=VTe();ga.decoder=sTe();ga.verifier=GTe();ga.converter=pTe();ga.ReflectionObject=Ew();ga.Namespace=oU();ga.Root=dWe();ga.Enum=oY();ga.Type=oWe();ga.Field=Qw();ga.OneOf=TJ();ga.MapField=nWe();ga.Service=IWe();ga.Method=lWe();ga.Message=aWe();ga.wrappers=hTe();ga.types=DJ();ga.util=Td();ga.ReflectionObject._configure(ga.Root);ga.Namespace._configure(ga.Type,ga.Service,ga.Enum);ga.Root._configure(ga.Type);ga.Field._configure(ga.Type)});var HTe=f((BZr,$cn)=>{"use strict";$cn.exports=qcn;var wTe=/[\s{}=;:[\],'"()<>]/g,YZI=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,gZI=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,RZI=/^ *[*/]+ */,yZI=/^\s*\*?\/*/,AZI=/\n/g,FZI=/\s/,vZI=/\\(.?)/g,fZI={0:"\0",r:"\r",n:` +`,t:" "};function Pcn(t){return t.replace(vZI,function(e,n){switch(n){case"\\":case"":return n;default:return fZI[n]||""}})}qcn.unescape=Pcn;function qcn(t,e){t=t.toString();var n=0,l=t.length,I=1,a=0,c={},i=[],s=null;function r(v){return Error("illegal "+v+" (line "+I+")")}function u(){var v=s==="'"?gZI:YZI;v.lastIndex=n-1;var H=v.exec(t);if(!H)throw r("string");return n=v.lastIndex,N(s),s=null,Pcn(H[1])}function o(v){return t.charAt(v)}function d(v,H,Q){var L={type:t.charAt(v++),lineEmpty:!1,leading:Q},J;e?J=2:J=3;var O=v-J,U;do if(--O<0||(U=t.charAt(O))===` +`){L.lineEmpty=!0;break}while(U===" "||U===" ");for(var K=t.substring(v,H).split(AZI),D=0;D0)return i.shift();if(s)return u();var v,H,Q,L,J,O=n===0;do{if(n===l)return null;for(v=!1;FZI.test(Q=o(n));)if(Q===` +`&&(O=!0,++I),++n===l)return null;if(o(n)==="/"){if(++n===l)throw r("comment");if(o(n)==="/")if(e){if(L=n,J=!1,b(n-1)){J=!0;do if(n=h(n),n===l||(n++,!O))break;while(b(n))}else n=Math.min(l,h(n)+1);J&&(d(L,n,O),O=!0),I++,v=!0}else{for(J=o(L=n+1)==="/";o(++n)!==` +`;)if(n===l)return null;++n,J&&(d(L,n-1,O),O=!0),++I,v=!0}else if((Q=o(n))==="*"){L=n+1,J=e||o(L)==="*";do{if(Q===` +`&&++I,++n===l)throw r("comment");H=Q,Q=o(n)}while(H!=="*"||Q!=="/");++n,J&&(d(L,n-2,O),O=!0),v=!0}else return"/"}}while(v);var U=n;wTe.lastIndex=0;var K=wTe.test(o(U++));if(!K)for(;U{"use strict";Ion.exports=_F;_F.filename=null;_F.defaults={keepCase:!1};var XZI=HTe(),eon=dWe(),ton=oWe(),non=Qw(),wZI=nWe(),lon=TJ(),HZI=oY(),QZI=IWe(),EZI=lWe(),JZI=Ew(),CZI=DJ(),QTe=Td(),LZI=/^[1-9][0-9]*$/,kZI=/^-?[1-9][0-9]*$/,xZI=/^0[x][0-9a-fA-F]+$/,jZI=/^-?0[x][0-9a-fA-F]+$/,OZI=/^0[0-7]+$/,UZI=/^-?0[0-7]+$/,zZI=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,jR=/^[a-zA-Z_][a-zA-Z_0-9]*$/,OR=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function _F(t,e,n){e instanceof eon||(n=e,e=new eon),n||(n=_F.defaults);var l=n.preferTrailingComment||!1,I=XZI(t,n.alternateCommentMode||!1),a=I.next,c=I.push,i=I.peek,s=I.skip,r=I.cmnt,u=!0,o,d,b,h="proto2",Z=e,N=[],g={},y=n.keepCase?function(C){return C}:QTe.camelCase;function X(){N.forEach(C=>{C._edition=h,Object.keys(g).forEach(M=>{C.getOption(M)===void 0&&C.setOption(M,g[M],!0)})})}function v(C,M,te){var ae=_F.filename;return te||(_F.filename=null),Error("illegal "+(M||"token")+" '"+C+"' ("+(ae?ae+", ":"")+"line "+I.line+")")}function H(){var C=[],M;do{if((M=a())!=='"'&&M!=="'")throw v(M);C.push(a()),s(M),M=i()}while(M==='"'||M==="'");return C.join("")}function Q(C){var M=a();switch(M){case"'":case'"':return c(M),H();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return J(M,!0)}catch{if(C&&OR.test(M))return M;throw v(M,"value")}}function L(C,M){var te,ae;do if(M&&((te=i())==='"'||te==="'")){var p=H();if(C.push(p),h>=2023)throw v(p,"id")}else try{C.push([ae=O(a()),s("to",!0)?O(a()):ae])}catch(F){if(M&&OR.test(te)&&h>=2023)C.push(te);else throw F}while(s(",",!0));var V={options:void 0};V.setOption=function(F,G){this.options===void 0&&(this.options={}),this.options[F]=G},le(V,function(G){if(G==="option")ce(V,G),s(";");else throw v(G)},function(){E(V)})}function J(C,M){var te=1;switch(C.charAt(0)==="-"&&(te=-1,C=C.substring(1)),C){case"inf":case"INF":case"Inf":return te*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(LZI.test(C))return te*parseInt(C,10);if(xZI.test(C))return te*parseInt(C,16);if(OZI.test(C))return te*parseInt(C,8);if(zZI.test(C))return te*parseFloat(C);throw v(C,"number",M)}function O(C,M){switch(C){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!M&&C.charAt(0)==="-")throw v(C,"id");if(kZI.test(C))return parseInt(C,10);if(jZI.test(C))return parseInt(C,16);if(UZI.test(C))return parseInt(C,8);throw v(C,"id")}function U(){if(o!==void 0)throw v("package");if(o=a(),!OR.test(o))throw v(o,"name");Z=Z.define(o),s(";")}function K(){var C=i(),M;switch(C){case"weak":M=b||(b=[]),a();break;case"public":a();default:M=d||(d=[]);break}C=H(),s(";"),M.push(C)}function D(){if(s("="),h=H(),h<2023)throw v(h,"syntax");s(";")}function _(){if(s("="),h=H(),!["2023"].includes(h))throw v(h,"edition");s(";")}function P(C,M){switch(M){case"option":return ce(C,M),s(";"),!0;case"message":return q(C,M),!0;case"enum":return Ze(C,M),!0;case"service":return S(C,M),!0;case"extend":return Y(C,M),!0}return!1}function le(C,M,te){var ae=I.line;if(C&&(typeof C.comment!="string"&&(C.comment=r()),C.filename=_F.filename),s("{",!0)){for(var p;(p=a())!=="}";)M(p);s(";",!0)}else te&&te(),s(";"),C&&(typeof C.comment!="string"||l)&&(C.comment=r(ae)||C.comment)}function q(C,M){if(!jR.test(M=a()))throw v(M,"type name");var te=new ton(M);le(te,function(p){if(!P(te,p))switch(p){case"map":ie(te,p);break;case"required":if(h!=="proto2")throw v(p);case"repeated":ee(te,p);break;case"optional":if(h==="proto3")ee(te,"proto3_optional");else{if(h!=="proto2")throw v(p);ee(te,"optional")}break;case"oneof":me(te,p);break;case"extensions":L(te.extensions||(te.extensions=[]));break;case"reserved":L(te.reserved||(te.reserved=[]),!0);break;default:if(h==="proto2"||!OR.test(p))throw v(p);c(p),ee(te,"optional");break}}),C.add(te),C===Z&&N.push(te)}function ee(C,M,te){var ae=a();if(ae==="group"){ne(C,M);return}for(;ae.endsWith(".")||i().startsWith(".");)ae+=a();if(!OR.test(ae))throw v(ae,"type");var p=a();if(!jR.test(p))throw v(p,"name");p=y(p),s("=");var V=new non(p,O(a()),ae,M,te);if(le(V,function(W){if(W==="option")ce(V,W),s(";");else throw v(W)},function(){E(V)}),M==="proto3_optional"){var F=new lon("_"+p);V.setOption("proto3_optional",!0),F.add(V),C.add(F)}else C.add(V);C===Z&&N.push(V)}function ne(C,M){if(h>=2023)throw v("group");var te=a();if(!jR.test(te))throw v(te,"name");var ae=QTe.lcFirst(te);te===ae&&(te=QTe.ucFirst(te)),s("=");var p=O(a()),V=new ton(te);V.group=!0;var F=new non(ae,p,te,M);F.filename=_F.filename,le(V,function(W){switch(W){case"option":ce(V,W),s(";");break;case"required":case"repeated":ee(V,W);break;case"optional":h==="proto3"?ee(V,"proto3_optional"):ee(V,"optional");break;case"message":q(V,W);break;case"enum":Ze(V,W);break;case"reserved":L(V.reserved||(V.reserved=[]),!0);break;default:throw v(W)}}),C.add(V).add(F)}function ie(C){s("<");var M=a();if(CZI.mapKey[M]===void 0)throw v(M,"type");s(",");var te=a();if(!OR.test(te))throw v(te,"type");s(">");var ae=a();if(!jR.test(ae))throw v(ae,"name");s("=");var p=new wZI(y(ae),O(a()),M,te);le(p,function(F){if(F==="option")ce(p,F),s(";");else throw v(F)},function(){E(p)}),C.add(p)}function me(C,M){if(!jR.test(M=a()))throw v(M,"name");var te=new lon(y(M));le(te,function(p){p==="option"?(ce(te,p),s(";")):(c(p),ee(te,"optional"))}),C.add(te)}function Ze(C,M){if(!jR.test(M=a()))throw v(M,"name");var te=new HZI(M);le(te,function(p){switch(p){case"option":ce(te,p),s(";");break;case"reserved":L(te.reserved||(te.reserved=[]),!0),te.reserved===void 0&&(te.reserved=[]);break;default:Fe(te,p)}}),C.add(te),C===Z&&N.push(te)}function Fe(C,M){if(!jR.test(M))throw v(M,"name");s("=");var te=O(a(),!0),ae={options:void 0};ae.getOption=function(p){return this.options[p]},ae.setOption=function(p,V){JZI.prototype.setOption.call(ae,p,V)},ae.setParsedOption=function(){},le(ae,function(V){if(V==="option")ce(ae,V),s(";");else throw v(V)},function(){E(ae)}),C.add(M,te,ae.comment,ae.parsedOptions||ae.options)}function ce(C,M){var te,ae,p=!0;for(M==="option"&&(M=a());M!=="=";){if(M==="("){var V=a();s(")"),M="("+V+")"}if(p){if(p=!1,M.includes(".")&&!M.includes("(")){var F=M.split(".");te=F[0]+".",M=F[1];continue}te=M}else ae=ae?ae+=M:M;M=a()}var G=ae?te.concat(ae):te,W=fe(C,G);ae=ae&&ae[0]==="."?ae.slice(1):ae,te=te&&te[te.length-1]==="."?te.slice(0,-1):te,j(C,te,W,ae)}function fe(C,M){if(s("{",!0)){for(var te={};!s("}",!0);){if(!jR.test(R=a()))throw v(R,"name");if(R===null)throw v(R,"end of input");var ae,p=R;if(s(":",!0),i()==="{")ae=fe(C,M+"."+R);else if(i()==="["){ae=[];var V;if(s("[",!0)){do V=Q(!0),ae.push(V);while(s(",",!0));s("]"),typeof V<"u"&&ke(C,M+"."+R,V)}}else ae=Q(!0),ke(C,M+"."+R,ae);var F=te[p];F&&(ae=[].concat(F).concat(ae)),te[p]=ae,s(",",!0),s(";",!0)}return te}var G=Q(!0);return ke(C,M,G),G}function ke(C,M,te){if(Z===C&&/^features\./.test(M)){g[M]=te;return}C.setOption&&C.setOption(M,te)}function j(C,M,te,ae){C.setParsedOption&&C.setParsedOption(M,te,ae)}function E(C){if(s("[",!0)){do ce(C,"option");while(s(",",!0));s("]")}return C}function S(C,M){if(!jR.test(M=a()))throw v(M,"service name");var te=new QZI(M);le(te,function(p){if(!P(te,p))if(p==="rpc")m(te,p);else throw v(p)}),C.add(te),C===Z&&N.push(te)}function m(C,M){var te=r(),ae=M;if(!jR.test(M=a()))throw v(M,"name");var p=M,V,F,G,W;if(s("("),s("stream",!0)&&(F=!0),!OR.test(M=a())||(V=M,s(")"),s("returns"),s("("),s("stream",!0)&&(W=!0),!OR.test(M=a())))throw v(M);G=M,s(")");var A=new EZI(p,ae,V,G,F,W);A.comment=te,le(A,function(ue){if(ue==="option")ce(A,ue),s(";");else throw v(ue)}),C.add(A)}function Y(C,M){if(!OR.test(M=a()))throw v(M,"reference");var te=M;le(null,function(p){switch(p){case"required":case"repeated":ee(C,p,te);break;case"optional":h==="proto3"?ee(C,"proto3_optional",te):ee(C,"optional",te);break;default:if(h==="proto2"||!OR.test(p))throw v(p);c(p),ee(C,"optional",te);break}})}for(var R;(R=a())!==null;)switch(R){case"package":if(!u)throw v(R);U();break;case"import":if(!u)throw v(R);K();break;case"syntax":if(!u)throw v(R);D();break;case"edition":if(!u)throw v(R);_();break;case"option":ce(Z,R),s(";",!0);break;default:if(P(Z,R)){u=!1;continue}throw v(R)}return X(),_F.filename=null,{package:o,imports:d,weakImports:b,root:e}}});var oon=f((MZr,con)=>{"use strict";con.exports=sY;var BZI=/\/|\./;function sY(t,e){BZI.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),sY[t]=e}sY("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var ron;sY("duration",{Duration:ron={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});sY("timestamp",{Timestamp:ron});sY("empty",{Empty:{fields:{}}});sY("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});sY("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});sY("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});sY.get=function(e){return sY[e]||null}});var son=f((TZr,ion)=>{"use strict";var Cw=ion.exports=_cn();Cw.build="full";Cw.tokenize=HTe();Cw.parse=aon();Cw.common=oon();Cw.Root._configure(Cw.Type,Cw.parse,Cw.common)});var ETe=f((DZr,uon)=>{"use strict";uon.exports=son()});var C6=f(J6=>{"use strict";var JTe;Object.defineProperty(J6,"__esModule",{value:!0});J6.hasWindowFetch=SZI;J6.isNodeJS=MZI;J6.hasAbortController=TZI;var CTe={windowFetch:typeof window<"u"&&window?.fetch&&typeof window?.fetch=="function",textEncoder:typeof TextEncoder<"u",textDecoder:typeof TextDecoder<"u",nodeJS:typeof process<"u"&&((JTe=process==null?void 0:process.versions)===null||JTe===void 0?void 0:JTe.node),abortController:typeof AbortController<"u"};function SZI(){return CTe.windowFetch}function MZI(){return CTe.nodeJS}function TZI(){return CTe.abortController}});var PF=f(LTe=>{"use strict";Object.defineProperty(LTe,"__esModule",{value:!0});LTe.warn=KZI;var DZI=C6(),don=new Set;function KZI(t,e,n){don.has(t)||(don.add(t),(0,DZI.isNodeJS)()?typeof n<"u"?process.emitWarning(e,{type:n}):process.emitWarning(e):console.warn(e))}});var xTe=f(kTe=>{"use strict";Object.defineProperty(kTe,"__esModule",{value:!0});kTe.default=PZI;var hWe,_ZI=new Uint8Array(16);function PZI(){if(!hWe&&(hWe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hWe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hWe(_ZI)}});var Gon=f(ZWe=>{"use strict";Object.defineProperty(ZWe,"__esModule",{value:!0});ZWe.default=void 0;var qZI=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;ZWe.default=qZI});var L6=f(WWe=>{"use strict";Object.defineProperty(WWe,"__esModule",{value:!0});WWe.default=void 0;var $ZI=eWI(Gon());function eWI(t){return t&&t.__esModule?t:{default:t}}function tWI(t){return typeof t=="string"&&$ZI.default.test(t)}var nWI=tWI;WWe.default=nWI});var x6=f(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});k6.default=void 0;k6.unsafeStringify=bon;var lWI=IWI(L6());function IWI(t){return t&&t.__esModule?t:{default:t}}var OG=[];for(let t=0;t<256;++t)OG.push((t+256).toString(16).slice(1));function bon(t,e=0){return OG[t[e+0]]+OG[t[e+1]]+OG[t[e+2]]+OG[t[e+3]]+"-"+OG[t[e+4]]+OG[t[e+5]]+"-"+OG[t[e+6]]+OG[t[e+7]]+"-"+OG[t[e+8]]+OG[t[e+9]]+"-"+OG[t[e+10]]+OG[t[e+11]]+OG[t[e+12]]+OG[t[e+13]]+OG[t[e+14]]+OG[t[e+15]]}function aWI(t,e=0){let n=bon(t,e);if(!(0,lWI.default)(n))throw TypeError("Stringified UUID is invalid");return n}var rWI=aWI;k6.default=rWI});var pon=f(NWe=>{"use strict";Object.defineProperty(NWe,"__esModule",{value:!0});NWe.default=void 0;var cWI=iWI(xTe()),oWI=x6();function iWI(t){return t&&t.__esModule?t:{default:t}}var mon,jTe,OTe=0,UTe=0;function sWI(t,e,n){let l=e&&n||0,I=e||new Array(16);t=t||{};let a=t.node||mon,c=t.clockseq!==void 0?t.clockseq:jTe;if(a==null||c==null){let d=t.random||(t.rng||cWI.default)();a==null&&(a=mon=[d[0]|1,d[1],d[2],d[3],d[4],d[5]]),c==null&&(c=jTe=(d[6]<<8|d[7])&16383)}let i=t.msecs!==void 0?t.msecs:Date.now(),s=t.nsecs!==void 0?t.nsecs:UTe+1,r=i-OTe+(s-UTe)/1e4;if(r<0&&t.clockseq===void 0&&(c=c+1&16383),(r<0||i>OTe)&&t.nsecs===void 0&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");OTe=i,UTe=s,jTe=c,i+=122192928e5;let u=((i&268435455)*1e4+s)%4294967296;I[l++]=u>>>24&255,I[l++]=u>>>16&255,I[l++]=u>>>8&255,I[l++]=u&255;let o=i/4294967296*1e4&268435455;I[l++]=o>>>8&255,I[l++]=o&255,I[l++]=o>>>24&15|16,I[l++]=o>>>16&255,I[l++]=c>>>8|128,I[l++]=c&255;for(let d=0;d<6;++d)I[l+d]=a[d];return e||(0,oWI.unsafeStringify)(I)}var uWI=sWI;NWe.default=uWI});var zTe=f(VWe=>{"use strict";Object.defineProperty(VWe,"__esModule",{value:!0});VWe.default=void 0;var dWI=GWI(L6());function GWI(t){return t&&t.__esModule?t:{default:t}}function bWI(t){if(!(0,dWI.default)(t))throw TypeError("Invalid UUID");let e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}var mWI=bWI;VWe.default=mWI});var BTe=f(_J=>{"use strict";Object.defineProperty(_J,"__esModule",{value:!0});_J.URL=_J.DNS=void 0;_J.default=NWI;var pWI=x6(),hWI=ZWI(zTe());function ZWI(t){return t&&t.__esModule?t:{default:t}}function WWI(t){t=unescape(encodeURIComponent(t));let e=[];for(let n=0;n{"use strict";Object.defineProperty(gWe,"__esModule",{value:!0});gWe.default=void 0;function VWI(t){if(typeof t=="string"){let e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n>5]>>>I%32&255,c=parseInt(l.charAt(a>>>4&15)+l.charAt(a&15),16);e.push(c)}return e}function Won(t){return(t+64>>>9<<4)+14+1}function gWI(t,e){t[e>>5]|=128<>5]|=(t[l/8]&255)<>16)+(e>>16)+(n>>16)<<16|n&65535}function yWI(t,e){return t<>>32-e}function YWe(t,e,n,l,I,a){return Lw(yWI(Lw(Lw(e,t),Lw(l,a)),I),n)}function zb(t,e,n,l,I,a,c){return YWe(e&n|~e&l,t,e,I,a,c)}function Bb(t,e,n,l,I,a,c){return YWe(e&l|n&~l,t,e,I,a,c)}function Sb(t,e,n,l,I,a,c){return YWe(e^n^l,t,e,I,a,c)}function Mb(t,e,n,l,I,a,c){return YWe(n^(e|~l),t,e,I,a,c)}var AWI=VWI;gWe.default=AWI});var Yon=f(RWe=>{"use strict";Object.defineProperty(RWe,"__esModule",{value:!0});RWe.default=void 0;var FWI=Von(BTe()),vWI=Von(Non());function Von(t){return t&&t.__esModule?t:{default:t}}var fWI=(0,FWI.default)("v3",48,vWI.default),XWI=fWI;RWe.default=XWI});var gon=f(yWe=>{"use strict";Object.defineProperty(yWe,"__esModule",{value:!0});yWe.default=void 0;var wWI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),HWI={randomUUID:wWI};yWe.default=HWI});var Aon=f(AWe=>{"use strict";Object.defineProperty(AWe,"__esModule",{value:!0});AWe.default=void 0;var Ron=yon(gon()),QWI=yon(xTe()),EWI=x6();function yon(t){return t&&t.__esModule?t:{default:t}}function JWI(t,e,n){if(Ron.default.randomUUID&&!e&&!t)return Ron.default.randomUUID();t=t||{};let l=t.random||(t.rng||QWI.default)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,e){n=n||0;for(let I=0;I<16;++I)e[n+I]=l[I];return e}return(0,EWI.unsafeStringify)(l)}var CWI=JWI;AWe.default=CWI});var Fon=f(FWe=>{"use strict";Object.defineProperty(FWe,"__esModule",{value:!0});FWe.default=void 0;function LWI(t,e,n,l){switch(t){case 0:return e&n^~e&l;case 1:return e^n^l;case 2:return e&n^e&l^n&l;case 3:return e^n^l}}function STe(t,e){return t<>>32-e}function kWI(t){let e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){let c=unescape(encodeURIComponent(t));t=[];for(let i=0;i>>0;d=o,o=u,u=STe(r,30)>>>0,r=s,s=Z}n[0]=n[0]+s>>>0,n[1]=n[1]+r>>>0,n[2]=n[2]+u>>>0,n[3]=n[3]+o>>>0,n[4]=n[4]+d>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var xWI=kWI;FWe.default=xWI});var fon=f(vWe=>{"use strict";Object.defineProperty(vWe,"__esModule",{value:!0});vWe.default=void 0;var jWI=von(BTe()),OWI=von(Fon());function von(t){return t&&t.__esModule?t:{default:t}}var UWI=(0,jWI.default)("v5",80,OWI.default),zWI=UWI;vWe.default=zWI});var Xon=f(fWe=>{"use strict";Object.defineProperty(fWe,"__esModule",{value:!0});fWe.default=void 0;var BWI="00000000-0000-0000-0000-000000000000";fWe.default=BWI});var won=f(XWe=>{"use strict";Object.defineProperty(XWe,"__esModule",{value:!0});XWe.default=void 0;var SWI=MWI(L6());function MWI(t){return t&&t.__esModule?t:{default:t}}function TWI(t){if(!(0,SWI.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var DWI=TWI;XWe.default=DWI});var MTe=f(uY=>{"use strict";Object.defineProperty(uY,"__esModule",{value:!0});Object.defineProperty(uY,"NIL",{enumerable:!0,get:function(){return $WI.default}});Object.defineProperty(uY,"parse",{enumerable:!0,get:function(){return lNI.default}});Object.defineProperty(uY,"stringify",{enumerable:!0,get:function(){return nNI.default}});Object.defineProperty(uY,"v1",{enumerable:!0,get:function(){return KWI.default}});Object.defineProperty(uY,"v3",{enumerable:!0,get:function(){return _WI.default}});Object.defineProperty(uY,"v4",{enumerable:!0,get:function(){return PWI.default}});Object.defineProperty(uY,"v5",{enumerable:!0,get:function(){return qWI.default}});Object.defineProperty(uY,"validate",{enumerable:!0,get:function(){return tNI.default}});Object.defineProperty(uY,"version",{enumerable:!0,get:function(){return eNI.default}});var KWI=qF(pon()),_WI=qF(Yon()),PWI=qF(Aon()),qWI=qF(fon()),$WI=qF(Xon()),eNI=qF(won()),tNI=qF(L6()),nNI=qF(x6()),lNI=qF(zTe());function qF(t){return t&&t.__esModule?t:{default:t}}});var uU=f(sU=>{"use strict";Object.defineProperty(sU,"__esModule",{value:!0});sU.camelToSnakeCase=rNI;sU.toCamelCase=Qon;sU.toLowerCamelCase=oNI;sU.makeUUID=iNI;var INI=MTe();function Hon(t,e=!1){return e&&(t=t.replace(/([A-Z])([A-Z]+)([A-Z])/g,n=>n[0]+n.slice(1,n.length-1).toLowerCase()+n[n.length-1])),t.split(/(?=[A-Z])|[^A-Za-z0-9.]+/).filter(n=>n.length>0).map((n,l)=>l===0?n:n.toLowerCase())}function aNI(t){return t.length===0?t:t[0].toLowerCase()+t.slice(1)}function rNI(t){let e=Hon(t);if(e.length===0)return t;let n=[e[0]];return n.push(...e.slice(1).map(aNI)),n.join("_")}function cNI(t){return t.length===0?t:t[0].toUpperCase()+t.slice(1)}function Qon(t){let e=Hon(t,!0);if(e.length===0)return t;let n=[e[0]];return n.push(...e.slice(1).map(l=>l.match(/^\d+$/)?"_"+l:cNI(l))),n.join("")}function oNI(t){let e=Qon(t);return e.length===0?e:e[0].toLowerCase()+e.slice(1)}function iNI(){return(0,INI.v4)()}});var UR=f($F=>{"use strict";Object.defineProperty($F,"__esModule",{value:!0});$F.HttpCodeToRpcCodeMap=$F.Status=void 0;$F.rpcCodeFromHttpStatusCode=sNI;var UG;(function(t){t[t.OK=0]="OK",t[t.CANCELLED=1]="CANCELLED",t[t.UNKNOWN=2]="UNKNOWN",t[t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",t[t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",t[t.NOT_FOUND=5]="NOT_FOUND",t[t.ALREADY_EXISTS=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",t[t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",t[t.ABORTED=10]="ABORTED",t[t.OUT_OF_RANGE=11]="OUT_OF_RANGE",t[t.UNIMPLEMENTED=12]="UNIMPLEMENTED",t[t.INTERNAL=13]="INTERNAL",t[t.UNAVAILABLE=14]="UNAVAILABLE",t[t.DATA_LOSS=15]="DATA_LOSS",t[t.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(UG||($F.Status=UG={}));$F.HttpCodeToRpcCodeMap=new Map([[400,UG.INVALID_ARGUMENT],[401,UG.UNAUTHENTICATED],[403,UG.PERMISSION_DENIED],[404,UG.NOT_FOUND],[409,UG.ABORTED],[416,UG.OUT_OF_RANGE],[429,UG.RESOURCE_EXHAUSTED],[499,UG.CANCELLED],[501,UG.UNIMPLEMENTED],[503,UG.UNAVAILABLE],[504,UG.DEADLINE_EXCEEDED]]);function sNI(t){return $F.HttpCodeToRpcCodeMap.has(t)?$F.HttpCodeToRpcCodeMap.get(t):t>=200&&t<300?UG.OK:t>=400&&t<500?UG.FAILED_PRECONDITION:t>=500&&t<600?UG.INTERNAL:UG.UNKNOWN}});var kw=f(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.CallSettings=Mp.RetryOptions=void 0;Mp.convertRetryOptions=GNI;Mp.createRetryOptions=HWe;Mp.createBackoffSettings=DTe;Mp.createDefaultBackoffSettings=Jon;Mp.createMaxRetriesBackoffSettings=bNI;Mp.createBundleOptions=Con;Mp.constructSettings=mNI;Mp.createByteLengthFunction=pNI;var dU=PF(),uNI=uU(),dNI=UR(),TTe=class{constructor(e,n,l,I){this.retryCodes=e,this.backoffSettings=n,this.shouldRetryFn=l,this.getResumptionRequestFn=I}};Mp.RetryOptions=TTe;var wWe=class t{constructor(e){var n;e=e||{},this.timeout=e.timeout||30*1e3,this.retry=e.retry,this.autoPaginate="autoPaginate"in e?e.autoPaginate:!0,this.maxResults=e.maxResults,this.otherArgs=e.otherArgs||{},this.bundleOptions=e.bundleOptions,this.isBundling="isBundling"in e?e.isBundling:!0,this.longrunning="longrunning"in e?e.longrunning:void 0,this.apiName=(n=e.apiName)!==null&&n!==void 0?n:void 0,this.retryRequestOptions=e.retryRequestOptions}merge(e){if(!e)return new t(this);let n=this.timeout,l=this.retry,I=this.autoPaginate,a=this.maxResults,c=this.otherArgs,i=this.isBundling,s=this.longrunning,r=this.apiName,u=this.retryRequestOptions;if("timeout"in e&&(n=e.timeout),l?.retryCodes&&(l.backoffSettings.initialRpcTimeoutMillis=n,l.backoffSettings.maxRpcTimeoutMillis=n,l.backoffSettings.totalTimeoutMillis=n),"retry"in e&&(l=Lon(l||{},e.retry)),"autoPaginate"in e&&!e.autoPaginate&&(I=!1),"maxResults"in e&&(a=e.maxResults),"otherArgs"in e){c={};for(let o in this.otherArgs)c[o]=this.otherArgs[o];for(let o in e.otherArgs)c[o]=e.otherArgs[o]}return"isBundling"in e&&(i=e.isBundling),"maxRetries"in e&&e.maxRetries!==void 0&&(l.backoffSettings.maxRetries=e.maxRetries,delete l.backoffSettings.totalTimeoutMillis),"longrunning"in e&&(s=e.longrunning),"apiName"in e&&(r=e.apiName),"retryRequestOptions"in e&&(u=e.retryRequestOptions),new t({timeout:n,retry:l,bundleOptions:this.bundleOptions,longrunning:s,autoPaginate:I,maxResults:a,otherArgs:c,isBundling:i,apiName:r,retryRequestOptions:u})}};Mp.CallSettings=wWe;function GNI(t,e){var n,l,I,a;if(!t||!e)return t;if(t.retry&&t.retryRequestOptions)throw new Error("Only one of retry or retryRequestOptions may be set");if(t.retryRequestOptions){t.retryRequestOptions.objectMode!==void 0&&(0,dU.warn)("retry_request_options","objectMode override is not supported. It is set to true internally by default in gax.","UnsupportedParameterWarning"),t.retryRequestOptions.noResponseRetries!==void 0&&(0,dU.warn)("retry_request_options","noResponseRetries override is not supported. Please specify retry codes or a function to determine retry eligibility.","UnsupportedParameterWarning"),t.retryRequestOptions.currentRetryAttempt!==void 0&&(0,dU.warn)("retry_request_options","currentRetryAttempt override is not supported. Retry attempts are tracked internally.","UnsupportedParameterWarning");let c=[dNI.Status.UNAVAILABLE],i;t.retryRequestOptions.shouldRetryFn&&(c=[],i=t.retryRequestOptions.shouldRetryFn),t.maxRetries=(l=(n=t?.retryRequestOptions)===null||n===void 0?void 0:n.retries)!==null&&l!==void 0?l:t.maxRetries;let s=Jon(),r,u;t.retryRequestOptions.maxRetryDelay!==void 0&&(r=t.retryRequestOptions.maxRetryDelay*1e3);let o=(a=(I=t?.retryRequestOptions)===null||I===void 0?void 0:I.retryDelayMultiplier)!==null&&a!==void 0?a:s.retryDelayMultiplier;t.retryRequestOptions.totalTimeout!==void 0?u=t.retryRequestOptions.totalTimeout*1e3:t.maxRetries===void 0&&(u=3e4,(0,dU.warn)("retry_request_options_no_max_retries_timeout","Neither maxRetries nor totalTimeout were passed. Defaulting to totalTimeout of 30000ms.","MissingParameterWarning")),s.maxRetryDelayMillis=r??s.maxRetryDelayMillis,s.retryDelayMultiplier=o??s.retryDelayMultiplier,s.totalTimeoutMillis=u??s.totalTimeoutMillis;let d=HWe(c,s,i);t.retry=d,delete t.retryRequestOptions,(0,dU.warn)("retry_request_options","retryRequestOptions will be deprecated in a future release. Please use retryOptions to pass retry options at call time","DeprecationWarning")}return t}function HWe(t,e,n,l){return{retryCodes:t,backoffSettings:e,shouldRetryFn:n,getResumptionRequestFn:l}}function DTe(t,e,n,l,I,a,c){return{initialRetryDelayMillis:t,retryDelayMultiplier:e,maxRetryDelayMillis:n,initialRpcTimeoutMillis:l,rpcTimeoutMultiplier:I,maxRpcTimeoutMillis:a,totalTimeoutMillis:c}}function Jon(){return DTe(100,1.3,6e4,null,null,null,null)}function bNI(t,e,n,l,I,a,c){return{initialRetryDelayMillis:t,retryDelayMultiplier:e,maxRetryDelayMillis:n,initialRpcTimeoutMillis:l,rpcTimeoutMultiplier:I,maxRpcTimeoutMillis:a,maxRetries:c}}function Con(t){["element_count_threshold","element_count_limit","request_byte_threshold","request_byte_limit","delay_threshold_millis"].forEach(i=>{if(i in t&&typeof t[i]!="number")throw new Error(`${i} should be a number`)});let n=t.element_count_threshold||0,l=t.element_count_limit||0,I=t.request_byte_threshold||0,a=t.request_byte_limit||0,c=t.delay_threshold_millis||0;if(n===0&&I===0&&c===0)throw new Error("one threshold should be > 0");return{elementCountThreshold:n,elementCountLimit:l,requestByteThreshold:I,requestByteLimit:a,delayThreshold:c}}function Eon(t,e,n,l){if(!t)return null;let I=null;if(e&&"retry_codes_name"in t){let c=t.retry_codes_name;I=(e[c]||[]).map(i=>Number(l[i]))}let a=null;if(n&&"retry_params_name"in t){let c=n[t.retry_params_name];a=DTe(c.initial_retry_delay_millis,c.retry_delay_multiplier,c.max_retry_delay_millis,c.initial_rpc_timeout_millis,c.rpc_timeout_multiplier,c.max_rpc_timeout_millis,c.total_timeout_millis)}return HWe(I,a)}function Lon(t,e){if(!e)return null;if(!e.retryCodes&&!e.backoffSettings&&!e.shouldRetryFn&&!e.getResumptionRequestFn)return t;let n=e.retryCodes?e.retryCodes:t.retryCodes,l=e.backoffSettings?e.backoffSettings:t.backoffSettings,I=e.shouldRetryFn?e.shouldRetryFn:t.shouldRetryFn,a=e.getResumptionRequestFn?e.getResumptionRequestFn:t.getResumptionRequestFn;return HWe(n,l,I,a)}function mNI(t,e,n,l,I){I=I||{};let a={},c=(e.interfaces||{})[t];if(!c)return null;let i=(n.interfaces||{})[t]||{},s=c.methods,r=i.methods||{};for(let u in s){let o=s[u],d=(0,uNI.toLowerCamelCase)(u),b=Eon(o,c.retry_codes,c.retry_params,l),h=o.bundling,Z=o.timeout_millis;if(u in r){let g=r[u];g&&("bundling"in g&&(h=g.bundling),"timeout_millis"in g&&(Z=g.timeout_millis)),b=Lon(b,Eon(g,i.retry_codes,i.retry_params,l))}let N=t;a[d]=new wWe({timeout:Z,retry:b,bundleOptions:h?Con(h):null,otherArgs:I,apiName:N})}return a}function pNI(t){return function(n){try{return t.encode(n).finish().length}catch(l){let I=JSON.stringify(n);return(0,dU.warn)("error_encoding_protobufjs_object",`Cannot encode protobuf.js object: ${I}: ${l}`),I.length}}}});var QWe=f(KTe=>{"use strict";Object.defineProperty(KTe,"__esModule",{value:!0});KTe.fromParams=ZNI;var hNI=require("querystring");function ZNI(t){return hNI.stringify(t)}});var JWe=f((hWr,Son)=>{"use strict";var EWe=Object.prototype.hasOwnProperty,Bon=Object.prototype.toString,kon=Object.defineProperty,xon=Object.getOwnPropertyDescriptor,jon=function(e){return typeof Array.isArray=="function"?Array.isArray(e):Bon.call(e)==="[object Array]"},Oon=function(e){if(!e||Bon.call(e)!=="[object Object]")return!1;var n=EWe.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&EWe.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!l)return!1;var I;for(I in e);return typeof I>"u"||EWe.call(e,I)},Uon=function(e,n){kon&&n.name==="__proto__"?kon(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},zon=function(e,n){if(n==="__proto__")if(EWe.call(e,n)){if(xon)return xon(e,n).value}else return;return e[n]};Son.exports=function t(){var e,n,l,I,a,c,i=arguments[0],s=1,r=arguments.length,u=!1;for(typeof i=="boolean"&&(u=i,i=arguments[1]||{},s=2),(i==null||typeof i!="object"&&typeof i!="function")&&(i={});s{Mon.exports=fetch});var Don=f((WWr,Ton)=>{"use strict";var zR=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";zR.writable=t=>zR(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";zR.readable=t=>zR(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";zR.duplex=t=>zR.writable(t)&&zR.readable(t);zR.transform=t=>zR.duplex(t)&&typeof t._transform=="function";Ton.exports=zR});var Kon=f((NWr,WNI)=>{WNI.exports={name:"gaxios",version:"6.7.1",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/src/index.js",types:"build/src/index.d.ts",files:["build/src"],scripts:{lint:"gts check",test:"c8 mocha build/test","presystem-test":"npm run compile","system-test":"mocha build/system-test --timeout 80000",compile:"tsc -p .",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"compodoc src/","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},repository:"googleapis/gaxios",keywords:["google"],engines:{node:">=14"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@compodoc/compodoc":"1.1.19","@types/cors":"^2.8.6","@types/express":"^4.16.1","@types/extend":"^3.0.1","@types/mocha":"^9.0.0","@types/multiparty":"0.0.36","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^20.0.0","@types/node-fetch":"^2.5.7","@types/sinon":"^17.0.0","@types/tmp":"0.2.6","@types/uuid":"^10.0.0","abort-controller":"^3.0.0",assert:"^2.0.0",browserify:"^17.0.0",c8:"^8.0.0",cheerio:"1.0.0-rc.10",cors:"^2.8.5",execa:"^5.0.0",express:"^4.16.4","form-data":"^4.0.0",gts:"^5.0.0","is-docker":"^2.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"5.0.0",linkinator:"^3.0.0",mocha:"^8.0.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^13.0.0","null-loader":"^4.0.0",puppeteer:"^19.0.0",sinon:"^18.0.0","stream-browserify":"^3.0.0",tmp:"0.2.3","ts-loader":"^8.0.0",typescript:"^5.1.6",webpack:"^5.35.0","webpack-cli":"^4.0.0"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","is-stream":"^2.0.0","node-fetch":"^2.6.9",uuid:"^9.0.1"}}});var _on=f(CWe=>{"use strict";Object.defineProperty(CWe,"__esModule",{value:!0});CWe.pkg=void 0;CWe.pkg=Kon()});var $Te=f(GN=>{"use strict";var NNI=GN&&GN.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Pon;Object.defineProperty(GN,"__esModule",{value:!0});GN.GaxiosError=GN.GAXIOS_ERROR_SYMBOL=void 0;GN.defaultErrorRedactor=$on;var VNI=require("url"),PTe=_on(),qon=NNI(JWe());GN.GAXIOS_ERROR_SYMBOL=Symbol.for(`${PTe.pkg.name}-gaxios-error`);var qTe=class t extends Error{static[(Pon=GN.GAXIOS_ERROR_SYMBOL,Symbol.hasInstance)](e){return e&&typeof e=="object"&&GN.GAXIOS_ERROR_SYMBOL in e&&e[GN.GAXIOS_ERROR_SYMBOL]===PTe.pkg.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,n,l,I){var a;if(super(e),this.config=n,this.response=l,this.error=I,this[Pon]=PTe.pkg.version,this.config=(0,qon.default)(!0,{},n),this.response&&(this.response.config=(0,qon.default)(!0,{},this.response.config)),this.response){try{this.response.data=YNI(this.config.responseType,(a=this.response)===null||a===void 0?void 0:a.data)}catch{}this.status=this.response.status}I&&"code"in I&&I.code&&(this.code=I.code),n.errorRedactor&&n.errorRedactor({config:this.config,response:this.response})}};GN.GaxiosError=qTe;function YNI(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}function $on(t){let e="< - See `errorRedactor` option in `gaxios` for configuration>.";function n(a){if(a)for(let c of Object.keys(a))/^authentication$/i.test(c)&&(a[c]=e),/^authorization$/i.test(c)&&(a[c]=e),/secret/i.test(c)&&(a[c]=e)}function l(a,c){if(typeof a=="object"&&a!==null&&typeof a[c]=="string"){let i=a[c];(/grant_type=/i.test(i)||/assertion=/i.test(i)||/secret/i.test(i))&&(a[c]=e)}}function I(a){typeof a=="object"&&a!==null&&("grant_type"in a&&(a.grant_type=e),"assertion"in a&&(a.assertion=e),"client_secret"in a&&(a.client_secret=e))}if(t.config){n(t.config.headers),l(t.config,"data"),I(t.config.data),l(t.config,"body"),I(t.config.body);try{let a=new VNI.URL("",t.config.url);a.searchParams.has("token")&&a.searchParams.set("token",e),a.searchParams.has("client_secret")&&a.searchParams.set("client_secret",e),t.config.url=a.toString()}catch{}}return t.response&&($on({config:t.response.config}),n(t.response.headers),l(t.response,"data"),I(t.response.data)),t}});var tin=f(eDe=>{"use strict";Object.defineProperty(eDe,"__esModule",{value:!0});eDe.getRetryConfig=gNI;async function gNI(t){let e=ein(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let n=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||n,t.config.retryConfig=e,!await(e.shouldRetry||RNI)(t))return{shouldRetry:!1,config:t.config};let I=yNI(e);t.config.retryConfig.currentRetryAttempt+=1;let a=e.retryBackoff?e.retryBackoff(t,I):new Promise(c=>{setTimeout(c,I)});return e.onRetryAttempt&&e.onRetryAttempt(t),await a,{shouldRetry:!0,config:t.config}}function RNI(t){var e;let n=ein(t);if(t.name==="AbortError"||((e=t.error)===null||e===void 0?void 0:e.name)==="AbortError"||!n||n.retry===0||!t.response&&(n.currentRetryAttempt||0)>=n.noResponseRetries||!t.config.method||n.httpMethodsToRetry.indexOf(t.config.method.toUpperCase())<0)return!1;if(t.response&&t.response.status){let l=!1;for(let[I,a]of n.statusCodesToRetry){let c=t.response.status;if(c>=I&&c<=a){l=!0;break}}if(!l)return!1}return n.currentRetryAttempt=n.currentRetryAttempt||0,!(n.currentRetryAttempt>=n.retry)}function ein(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}function yNI(t){var e;let l=(t.currentRetryAttempt?0:(e=t.retryDelay)!==null&&e!==void 0?e:100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,I=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(l,I,t.maxRetryDelay)}});var nDe=f(LWe=>{"use strict";Object.defineProperty(LWe,"__esModule",{value:!0});LWe.GaxiosInterceptorManager=void 0;var tDe=class extends Set{};LWe.GaxiosInterceptorManager=tDe});var lin=f((yWr,nin)=>{var GU=1e3,bU=GU*60,mU=bU*60,PJ=mU*24,ANI=PJ*7,FNI=PJ*365.25;nin.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return vNI(t);if(n==="number"&&isFinite(t))return e.long?XNI(t):fNI(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function vNI(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),l=(e[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return n*FNI;case"weeks":case"week":case"w":return n*ANI;case"days":case"day":case"d":return n*PJ;case"hours":case"hour":case"hrs":case"hr":case"h":return n*mU;case"minutes":case"minute":case"mins":case"min":case"m":return n*bU;case"seconds":case"second":case"secs":case"sec":case"s":return n*GU;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fNI(t){var e=Math.abs(t);return e>=PJ?Math.round(t/PJ)+"d":e>=mU?Math.round(t/mU)+"h":e>=bU?Math.round(t/bU)+"m":e>=GU?Math.round(t/GU)+"s":t+"ms"}function XNI(t){var e=Math.abs(t);return e>=PJ?kWe(t,e,PJ,"day"):e>=mU?kWe(t,e,mU,"hour"):e>=bU?kWe(t,e,bU,"minute"):e>=GU?kWe(t,e,GU,"second"):t+" ms"}function kWe(t,e,n,l){var I=e>=n*1.5;return Math.round(t/n)+" "+l+(I?"s":"")}});var ain=f((AWr,Iin)=>{function wNI(t){n.debug=n,n.default=n,n.coerce=s,n.disable=c,n.enable=I,n.enabled=i,n.humanize=lin(),n.destroy=r,Object.keys(t).forEach(u=>{n[u]=t[u]}),n.names=[],n.skips=[],n.formatters={};function e(u){let o=0;for(let d=0;d{if(Q==="%%")return"%";v++;let J=n.formatters[L];if(typeof J=="function"){let O=N[v];Q=J.call(g,O),N.splice(v,1),v--}return Q}),n.formatArgs.call(g,N),(g.log||n.log).apply(g,N)}return Z.namespace=u,Z.useColors=n.useColors(),Z.color=n.selectColor(u),Z.extend=l,Z.destroy=n.destroy,Object.defineProperty(Z,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(b!==n.namespaces&&(b=n.namespaces,h=n.enabled(u)),h),set:N=>{d=N}}),typeof n.init=="function"&&n.init(Z),Z}function l(u,o){let d=n(this.namespace+(typeof o>"u"?":":o)+u);return d.log=this.log,d}function I(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let o=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of o)d[0]==="-"?n.skips.push(d.slice(1)):n.names.push(d)}function a(u,o){let d=0,b=0,h=-1,Z=0;for(;d"-"+o)].join(",");return n.enable(""),u}function i(u){for(let o of n.skips)if(a(u,o))return!1;for(let o of n.names)if(a(u,o))return!0;return!1}function s(u){return u instanceof Error?u.stack||u.message:u}function r(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Iin.exports=wNI});var jWe=f((Tp,xWe)=>{Tp.formatArgs=QNI;Tp.save=ENI;Tp.load=JNI;Tp.useColors=HNI;Tp.storage=CNI();Tp.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Tp.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function HNI(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function QNI(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+xWe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,l=0;t[0].replace(/%[a-zA-Z%]/g,I=>{I!=="%%"&&(n++,I==="%c"&&(l=n))}),t.splice(l,0,e)}Tp.log=console.debug||console.log||(()=>{});function ENI(t){try{t?Tp.storage.setItem("debug",t):Tp.storage.removeItem("debug")}catch{}}function JNI(){let t;try{t=Tp.storage.getItem("debug")||Tp.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function CNI(){try{return localStorage}catch{}}xWe.exports=ain()(Tp);var{formatters:LNI}=xWe.exports;LNI.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var oin=f(Dp=>{"use strict";var kNI=Dp&&Dp.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),xNI=Dp&&Dp.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rin=Dp&&Dp.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&kNI(e,t,n);return xNI(e,t),e};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.req=Dp.json=Dp.toBuffer=void 0;var jNI=rin(require("http")),ONI=rin(require("https"));async function cin(t){let e=0,n=[];for await(let l of t)e+=l.length,n.push(l);return Buffer.concat(n,e)}Dp.toBuffer=cin;async function UNI(t){let n=(await cin(t)).toString("utf8");try{return JSON.parse(n)}catch(l){let I=l;throw I.message+=` (input: ${n})`,I}}Dp.json=UNI;function zNI(t,e={}){let l=((typeof t=="string"?t:t.href).startsWith("https:")?ONI:jNI).request(t,e),I=new Promise((a,c)=>{l.once("response",a).once("error",c).end()});return l.then=I.then.bind(I),l}Dp.req=zNI});var din=f(GZ=>{"use strict";var sin=GZ&&GZ.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),BNI=GZ&&GZ.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uin=GZ&&GZ.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&sin(e,t,n);return BNI(e,t),e},SNI=GZ&&GZ.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&sin(e,t,n)};Object.defineProperty(GZ,"__esModule",{value:!0});GZ.Agent=void 0;var MNI=uin(require("net")),iin=uin(require("http")),TNI=require("https");SNI(oin(),GZ);var BR=Symbol("AgentBaseInternalState"),lDe=class extends iin.Agent{constructor(e){super(e),this[BR]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(` +`).some(l=>l.indexOf("(https.js:")!==-1||l.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let n=new MNI.Socket({writable:!1});return this.sockets[e].push(n),this.totalSocketCount++,n}decrementSockets(e,n){if(!this.sockets[e]||n===null)return;let l=this.sockets[e],I=l.indexOf(n);I!==-1&&(l.splice(I,1),this.totalSocketCount--,l.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?TNI.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,n,l){let I={...n,secureEndpoint:this.isSecureEndpoint(n)},a=this.getName(I),c=this.incrementSockets(a);Promise.resolve().then(()=>this.connect(e,I)).then(i=>{if(this.decrementSockets(a,c),i instanceof iin.Agent)try{return i.addRequest(e,I)}catch(s){return l(s)}this[BR].currentSocket=i,super.createSocket(e,n,l)},i=>{this.decrementSockets(a,c),l(i)})}createConnection(){let e=this[BR].currentSocket;if(this[BR].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[BR].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[BR]&&(this[BR].defaultPort=e)}get protocol(){return this[BR].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[BR]&&(this[BR].protocol=e)}};GZ.Agent=lDe});var Gin=f(pU=>{"use strict";var DNI=pU&&pU.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pU,"__esModule",{value:!0});pU.parseProxyResponse=void 0;var KNI=DNI(jWe()),OWe=(0,KNI.default)("https-proxy-agent:parse-proxy-response");function _NI(t){return new Promise((e,n)=>{let l=0,I=[];function a(){let u=t.read();u?r(u):t.once("readable",a)}function c(){t.removeListener("end",i),t.removeListener("error",s),t.removeListener("readable",a)}function i(){c(),OWe("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function s(u){c(),OWe("onerror %o",u),n(u)}function r(u){I.push(u),l+=u.length;let o=Buffer.concat(I,l),d=o.indexOf(`\r +\r +`);if(d===-1){OWe("have not received end of HTTP headers yet..."),a();return}let b=o.slice(0,d).toString("ascii").split(`\r +`),h=b.shift();if(!h)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let Z=h.split(" "),N=+Z[1],g=Z.slice(2).join(" "),y={};for(let X of b){if(!X)continue;let v=X.indexOf(":");if(v===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${X}"`));let H=X.slice(0,v).toLowerCase(),Q=X.slice(v+1).trimStart(),L=y[H];typeof L=="string"?y[H]=[L,Q]:Array.isArray(L)?L.push(Q):y[H]=Q}OWe("got proxy server response: %o %o",h,y),c(),e({connect:{statusCode:N,statusText:g,headers:y},buffered:o})}t.on("error",s),t.on("end",i),a()})}pU.parseProxyResponse=_NI});var Win=f(bN=>{"use strict";var PNI=bN&&bN.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),qNI=bN&&bN.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),hin=bN&&bN.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&PNI(e,t,n);return qNI(e,t),e},Zin=bN&&bN.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bN,"__esModule",{value:!0});bN.HttpsProxyAgent=void 0;var UWe=hin(require("net")),bin=hin(require("tls")),$NI=Zin(require("assert")),eVI=Zin(jWe()),tVI=din(),nVI=require("url"),lVI=Gin(),j6=(0,eVI.default)("https-proxy-agent"),min=t=>t.servername===void 0&&t.host&&!UWe.isIP(t.host)?{...t,servername:t.host}:t,zWe=class extends tVI.Agent{constructor(e,n){super(n),this.options={path:void 0},this.proxy=typeof e=="string"?new nVI.URL(e):e,this.proxyHeaders=n?.headers??{},j6("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let l=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),I=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?pin(n,"headers"):null,host:l,port:I}}async connect(e,n){let{proxy:l}=this;if(!n.host)throw new TypeError('No "host" provided');let I;l.protocol==="https:"?(j6("Creating `tls.Socket`: %o",this.connectOpts),I=bin.connect(min(this.connectOpts))):(j6("Creating `net.Socket`: %o",this.connectOpts),I=UWe.connect(this.connectOpts));let a=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=UWe.isIPv6(n.host)?`[${n.host}]`:n.host,i=`CONNECT ${c}:${n.port} HTTP/1.1\r +`;if(l.username||l.password){let d=`${decodeURIComponent(l.username)}:${decodeURIComponent(l.password)}`;a["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}a.Host=`${c}:${n.port}`,a["Proxy-Connection"]||(a["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(a))i+=`${d}: ${a[d]}\r +`;let s=(0,lVI.parseProxyResponse)(I);I.write(`${i}\r +`);let{connect:r,buffered:u}=await s;if(e.emit("proxyConnect",r),this.emit("proxyConnect",r,e),r.statusCode===200)return e.once("socket",IVI),n.secureEndpoint?(j6("Upgrading socket connection to TLS"),bin.connect({...pin(min(n),"host","path","port"),socket:I})):I;I.destroy();let o=new UWe.Socket({writable:!1});return o.readable=!0,e.once("socket",d=>{j6("Replaying proxy buffer for failed request"),(0,$NI.default)(d.listenerCount("data")>0),d.push(u),d.push(null)}),o}};zWe.protocols=["http","https"];bN.HttpsProxyAgent=zWe;function IVI(t){t.resume()}function pin(t,...e){let n={},l;for(l in t)e.includes(l)||(n[l]=t[l]);return n}});var Xin=f(Tb=>{"use strict";var aVI=Tb&&Tb.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),rVI=Tb&&Tb.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cVI=Tb&&Tb.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&aVI(e,t,n);return rVI(e,t),e},$J=Tb&&Tb.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},oVI=Tb&&Tb.__classPrivateFieldSet||function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},TWe=Tb&&Tb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},hU,qJ,Nin,Ain,Fin,vin,BWe,Vin;Object.defineProperty(Tb,"__esModule",{value:!0});Tb.Gaxios=void 0;var iVI=TWe(JWe()),sVI=require("https"),uVI=TWe(_Te()),dVI=TWe(require("querystring")),GVI=TWe(Don()),Yin=require("url"),SWe=$Te(),bVI=tin(),gin=require("stream"),mVI=MTe(),Rin=nDe(),pVI=ZVI()?window.fetch:uVI.default;function hVI(){return typeof window<"u"&&!!window}function ZVI(){return hVI()&&!!window.fetch}function WVI(){return typeof Buffer<"u"}function yin(t,e){return!!fin(t,e)}function fin(t,e){e=e.toLowerCase();for(let n of Object.keys(t?.headers||{}))if(e===n.toLowerCase())return t.headers[n]}var MWe=class{constructor(e){hU.add(this),this.agentCache=new Map,this.defaults=e||{},this.interceptors={request:new Rin.GaxiosInterceptorManager,response:new Rin.GaxiosInterceptorManager}}async request(e={}){return e=await $J(this,hU,"m",vin).call(this,e),e=await $J(this,hU,"m",Ain).call(this,e),$J(this,hU,"m",Fin).call(this,this._request(e))}async _defaultAdapter(e){let l=await(e.fetchImplementation||pVI)(e.url,e),I=await this.getResponseData(e,l);return this.translateResponse(e,l,I)}async _request(e={}){var n;try{let l;if(e.adapter?l=await e.adapter(e,this._defaultAdapter.bind(this)):l=await this._defaultAdapter(e),!e.validateStatus(l.status)){if(e.responseType==="stream"){let I="";await new Promise(a=>{(l?.data).on("data",c=>{I+=c}),(l?.data).on("end",a)}),l.data=I}throw new SWe.GaxiosError(`Request failed with status code ${l.status}`,e,l)}return l}catch(l){let I=l instanceof SWe.GaxiosError?l:new SWe.GaxiosError(l.message,e,void 0,l),{shouldRetry:a,config:c}=await(0,bVI.getRetryConfig)(I);if(a&&c)return I.config.retryConfig.currentRetryAttempt=c.retryConfig.currentRetryAttempt,e.retryConfig=(n=I.config)===null||n===void 0?void 0:n.retryConfig,this._request(e);throw I}}async getResponseData(e,n){switch(e.responseType){case"stream":return n.body;case"json":{let l=await n.text();try{l=JSON.parse(l)}catch{}return l}case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"text":return n.text();default:return this.getResponseDataFromContentType(n)}}validateStatus(e){return e>=200&&e<300}paramsSerializer(e){return dVI.default.stringify(e)}translateResponse(e,n,l){let I={};return n.headers.forEach((a,c)=>{I[c]=a}),{config:e,data:l,headers:I,status:n.status,statusText:n.statusText,request:{responseURL:n.url}}}async getResponseDataFromContentType(e){let n=e.headers.get("Content-Type");if(n===null)return e.text();if(n=n.toLowerCase(),n.includes("application/json")){let l=await e.text();try{l=JSON.parse(l)}catch{}return l}else return n.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,n){let l=`--${n}--`;for(let I of e){let a=I.headers["Content-Type"]||"application/octet-stream";yield`--${n}\r +Content-Type: ${a}\r +\r +`,typeof I.content=="string"?yield I.content:yield*I.content,yield`\r +`}yield l}};Tb.Gaxios=MWe;qJ=MWe,hU=new WeakSet,Nin=function(e,n=[]){var l,I;let a=new Yin.URL(e),c=[...n],i=((I=(l=process.env.NO_PROXY)!==null&&l!==void 0?l:process.env.no_proxy)===null||I===void 0?void 0:I.split(","))||[];for(let s of i)c.push(s.trim());for(let s of c)if(s instanceof RegExp){if(s.test(a.toString()))return!1}else if(s instanceof Yin.URL){if(s.origin===a.origin)return!1}else if(s.startsWith("*.")||s.startsWith(".")){let r=s.replace(/^\*\./,".");if(a.hostname.endsWith(r))return!1}else if(s===a.origin||s===a.hostname||s===a.href)return!1;return!0},Ain=async function(e){let n=Promise.resolve(e);for(let l of this.interceptors.request.values())l&&(n=n.then(l.resolved,l.rejected));return n},Fin=async function(e){let n=Promise.resolve(e);for(let l of this.interceptors.response.values())l&&(n=n.then(l.resolved,l.rejected));return n},vin=async function(e){var n,l,I,a;let c=(0,iVI.default)(!0,{},this.defaults,e);if(!c.url)throw new Error("URL is required.");let i=c.baseUrl||c.baseURL;if(i&&(c.url=i.toString()+c.url),c.paramsSerializer=c.paramsSerializer||this.paramsSerializer,c.params&&Object.keys(c.params).length>0){let u=c.paramsSerializer(c.params);u.startsWith("?")&&(u=u.slice(1));let o=c.url.toString().includes("?")?"&":"?";c.url=c.url+o+u}if(typeof e.maxContentLength=="number"&&(c.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(c.follow=e.maxRedirects),c.headers=c.headers||{},c.multipart===void 0&&c.data){let u=typeof FormData>"u"?!1:c?.data instanceof FormData;GVI.default.readable(c.data)?c.body=c.data:WVI()&&Buffer.isBuffer(c.data)?(c.body=c.data,yin(c,"Content-Type")||(c.headers["Content-Type"]="application/json")):typeof c.data=="object"?u||(fin(c,"content-type")==="application/x-www-form-urlencoded"?c.body=c.paramsSerializer(c.data):(yin(c,"Content-Type")||(c.headers["Content-Type"]="application/json"),c.body=JSON.stringify(c.data))):c.body=c.data}else if(c.multipart&&c.multipart.length>0){let u=(0,mVI.v4)();c.headers["Content-Type"]=`multipart/related; boundary=${u}`;let o=new gin.PassThrough;c.body=o,(0,gin.pipeline)(this.getMultipartRequest(c.multipart,u),o,()=>{})}c.validateStatus=c.validateStatus||this.validateStatus,c.responseType=c.responseType||"unknown",!c.headers.Accept&&c.responseType==="json"&&(c.headers.Accept="application/json"),c.method=c.method||"GET";let s=c.proxy||((n=process==null?void 0:process.env)===null||n===void 0?void 0:n.HTTPS_PROXY)||((l=process==null?void 0:process.env)===null||l===void 0?void 0:l.https_proxy)||((I=process==null?void 0:process.env)===null||I===void 0?void 0:I.HTTP_PROXY)||((a=process==null?void 0:process.env)===null||a===void 0?void 0:a.http_proxy),r=$J(this,hU,"m",Nin).call(this,c.url,c.noProxy);if(!c.agent)if(s&&r){let u=await $J(qJ,qJ,"m",Vin).call(qJ);this.agentCache.has(s)?c.agent=this.agentCache.get(s):(c.agent=new u(s,{cert:c.cert,key:c.key}),this.agentCache.set(s,c.agent))}else c.cert&&c.key&&(this.agentCache.has(c.key)?c.agent=this.agentCache.get(c.key):(c.agent=new sVI.Agent({cert:c.cert,key:c.key}),this.agentCache.set(c.key,c.agent)));return typeof c.errorRedactor!="function"&&c.errorRedactor!==!1&&(c.errorRedactor=SWe.defaultErrorRedactor),c},Vin=async function(){return oVI(this,qJ,$J(this,qJ,"f",BWe)||(await Promise.resolve().then(()=>cVI(Win()))).HttpsProxyAgent,"f",BWe),$J(this,qJ,"f",BWe)};BWe={value:void 0}});var dY=f(Em=>{"use strict";var NVI=Em&&Em.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),VVI=Em&&Em.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&NVI(e,t,n)};Object.defineProperty(Em,"__esModule",{value:!0});Em.instance=Em.Gaxios=Em.GaxiosError=void 0;Em.request=gVI;var win=Xin();Object.defineProperty(Em,"Gaxios",{enumerable:!0,get:function(){return win.Gaxios}});var YVI=$Te();Object.defineProperty(Em,"GaxiosError",{enumerable:!0,get:function(){return YVI.GaxiosError}});VVI(nDe(),Em);Em.instance=new win.Gaxios;async function gVI(t){return Em.instance.request(t)}});var IDe=f((Hin,DWe)=>{(function(t){"use strict";var e,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,l=Math.ceil,I=Math.floor,a="[BigNumber Error] ",c=a+"Number primitive has more than 15 significant digits: ",i=1e14,s=14,r=9007199254740991,u=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],o=1e7,d=1e9;function b(H){var Q,L,J,O=ce.prototype={constructor:ce,toString:null,valueOf:null},U=new ce(1),K=20,D=4,_=-7,P=21,le=-1e7,q=1e7,ee=!1,ne=1,ie=0,me={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ze="0123456789abcdefghijklmnopqrstuvwxyz",Fe=!0;function ce(m,Y){var R,C,M,te,ae,p,V,F,G=this;if(!(G instanceof ce))return new ce(m,Y);if(Y==null){if(m&&m._isBigNumber===!0){G.s=m.s,!m.c||m.e>q?G.c=G.e=null:m.e=10;ae/=10,te++);te>q?G.c=G.e=null:(G.e=te,G.c=[m]);return}F=String(m)}else{if(!n.test(F=String(m)))return J(G,F,p);G.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(te=F.indexOf("."))>-1&&(F=F.replace(".","")),(ae=F.search(/e/i))>0?(te<0&&(te=ae),te+=+F.slice(ae+1),F=F.substring(0,ae)):te<0&&(te=F.length)}else{if(g(Y,2,Ze.length,"Base"),Y==10&&Fe)return G=new ce(m),E(G,K+G.e+1,D);if(F=String(m),p=typeof m=="number"){if(m*0!=0)return J(G,F,p,Y);if(G.s=1/m<0?(F=F.slice(1),-1):1,ce.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(c+m)}else G.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(R=Ze.slice(0,Y),te=ae=0,V=F.length;aete){te=V;continue}}else if(!M&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){M=!0,ae=-1,te=0;continue}return J(G,String(m),p,Y)}p=!1,F=L(F,Y,10,G.s),(te=F.indexOf("."))>-1?F=F.replace(".",""):te=F.length}for(ae=0;F.charCodeAt(ae)===48;ae++);for(V=F.length;F.charCodeAt(--V)===48;);if(F=F.slice(ae,++V)){if(V-=ae,p&&ce.DEBUG&&V>15&&(m>r||m!==I(m)))throw Error(c+G.s*m);if((te=te-ae-1)>q)G.c=G.e=null;else if(te=-d&&M<=d&&M===I(M)){if(C[0]===0){if(M===0&&C.length===1)return!0;break e}if(Y=(M+1)%s,Y<1&&(Y+=s),String(C[0]).length==Y){for(Y=0;Y=i||R!==I(R))break e;if(R!==0)return!0}}}else if(C===null&&M===null&&(te===null||te===1||te===-1))return!0;throw Error(a+"Invalid BigNumber: "+m)},ce.maximum=ce.max=function(){return ke(arguments,-1)},ce.minimum=ce.min=function(){return ke(arguments,1)},ce.random=function(){var m=9007199254740992,Y=Math.random()*m&2097151?function(){return I(Math.random()*m)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(R){var C,M,te,ae,p,V=0,F=[],G=new ce(U);if(R==null?R=K:g(R,0,d),ae=l(R/s),ee)if(crypto.getRandomValues){for(C=crypto.getRandomValues(new Uint32Array(ae*=2));V>>11),p>=9e15?(M=crypto.getRandomValues(new Uint32Array(2)),C[V]=M[0],C[V+1]=M[1]):(F.push(p%1e14),V+=2);V=ae/2}else if(crypto.randomBytes){for(C=crypto.randomBytes(ae*=7);V=9e15?crypto.randomBytes(7).copy(C,V):(F.push(p%1e14),V+=7);V=ae/7}else throw ee=!1,Error(a+"crypto unavailable");if(!ee)for(;V=10;p/=10,V++);VM-1&&(p[ae+1]==null&&(p[ae+1]=0),p[ae+1]+=p[ae]/M|0,p[ae]%=M)}return p.reverse()}return function(R,C,M,te,ae){var p,V,F,G,W,A,x,ue,Ue=R.indexOf("."),He=K,Re=D;for(Ue>=0&&(G=ie,ie=0,R=R.replace(".",""),ue=new ce(C),A=ue.pow(R.length-Ue),ie=G,ue.c=Y(v(Z(A.c),A.e,"0"),10,M,m),ue.e=ue.c.length),x=Y(R,C,M,ae?(p=Ze,m):(p=m,Ze)),F=G=x.length;x[--G]==0;x.pop());if(!x[0])return p.charAt(0);if(Ue<0?--F:(A.c=x,A.e=F,A.s=te,A=Q(A,ue,He,Re,M),x=A.c,W=A.r,F=A.e),V=F+He+1,Ue=x[V],G=M/2,W=W||V<0||x[V+1]!=null,W=Re<4?(Ue!=null||W)&&(Re==0||Re==(A.s<0?3:2)):Ue>G||Ue==G&&(Re==4||W||Re==6&&x[V-1]&1||Re==(A.s<0?8:7)),V<1||!x[0])R=W?v(p.charAt(1),-He,p.charAt(0)):p.charAt(0);else{if(x.length=V,W)for(--M;++x[--V]>M;)x[V]=0,V||(++F,x=[1].concat(x));for(G=x.length;!x[--G];);for(Ue=0,R="";Ue<=G;R+=p.charAt(x[Ue++]));R=v(R,F,p.charAt(0))}return R}}(),Q=function(){function m(C,M,te){var ae,p,V,F,G=0,W=C.length,A=M%o,x=M/o|0;for(C=C.slice();W--;)V=C[W]%o,F=C[W]/o|0,ae=x*V+F*A,p=A*V+ae%o*o+G,G=(p/te|0)+(ae/o|0)+x*F,C[W]=p%te;return G&&(C=[G].concat(C)),C}function Y(C,M,te,ae){var p,V;if(te!=ae)V=te>ae?1:-1;else for(p=V=0;pM[p]?1:-1;break}return V}function R(C,M,te,ae){for(var p=0;te--;)C[te]-=p,p=C[te]1;C.splice(0,1));}return function(C,M,te,ae,p){var V,F,G,W,A,x,ue,Ue,He,Re,et,Oe,Mt,ch,no,Je,_G,xn=C.s==M.s?1:-1,br=C.c,vr=M.c;if(!br||!br[0]||!vr||!vr[0])return new ce(!C.s||!M.s||(br?vr&&br[0]==vr[0]:!vr)?NaN:br&&br[0]==0||!vr?xn*0:xn/0);for(Ue=new ce(xn),He=Ue.c=[],F=C.e-M.e,xn=te+F+1,p||(p=i,F=h(C.e/s)-h(M.e/s),xn=xn/s|0),G=0;vr[G]==(br[G]||0);G++);if(vr[G]>(br[G]||0)&&F--,xn<0)He.push(1),W=!0;else{for(ch=br.length,Je=vr.length,G=0,xn+=2,A=I(p/(vr[0]+1)),A>1&&(vr=m(vr,A,p),br=m(br,A,p),Je=vr.length,ch=br.length),Mt=Je,Re=br.slice(0,Je),et=Re.length;et=p/2&&no++;do{if(A=0,V=Y(vr,Re,Je,et),V<0){if(Oe=Re[0],Je!=et&&(Oe=Oe*p+(Re[1]||0)),A=I(Oe/no),A>1)for(A>=p&&(A=p-1),x=m(vr,A,p),ue=x.length,et=Re.length;Y(x,Re,ue,et)==1;)A--,R(x,Je=10;xn/=10,G++);E(Ue,te+(Ue.e=G+F*s-1)+1,ae,W)}else Ue.e=F,Ue.r=+W;return Ue}}();function fe(m,Y,R,C){var M,te,ae,p,V;if(R==null?R=D:g(R,0,8),!m.c)return m.toString();if(M=m.c[0],ae=m.e,Y==null)V=Z(m.c),V=C==1||C==2&&(ae<=_||ae>=P)?X(V,ae):v(V,ae,"0");else if(m=E(new ce(m),Y,R),te=m.e,V=Z(m.c),p=V.length,C==1||C==2&&(Y<=te||te<=_)){for(;pae),V=v(V,te,"0"),te+1>p){if(--Y>0)for(V+=".";Y--;V+="0");}else if(Y+=te-p,Y>0)for(te+1==p&&(V+=".");Y--;V+="0");return m.s<0&&M?"-"+V:V}function ke(m,Y){for(var R,C,M=1,te=new ce(m[0]);M=10;M/=10,C++);return(R=C+R*s-1)>q?m.c=m.e=null:R=10;p/=10,M++);if(te=Y-M,te<0)te+=s,ae=Y,V=W[F=0],G=I(V/A[M-ae-1]%10);else if(F=l((te+1)/s),F>=W.length)if(C){for(;W.length<=F;W.push(0));V=G=0,M=1,te%=s,ae=te-s+1}else break e;else{for(V=p=W[F],M=1;p>=10;p/=10,M++);te%=s,ae=te-s+M,G=ae<0?0:I(V/A[M-ae-1]%10)}if(C=C||Y<0||W[F+1]!=null||(ae<0?V:V%A[M-ae-1]),C=R<4?(G||C)&&(R==0||R==(m.s<0?3:2)):G>5||G==5&&(R==4||C||R==6&&(te>0?ae>0?V/A[M-ae]:0:W[F-1])%10&1||R==(m.s<0?8:7)),Y<1||!W[0])return W.length=0,C?(Y-=m.e+1,W[0]=A[(s-Y%s)%s],m.e=-Y||0):W[0]=m.e=0,m;if(te==0?(W.length=F,p=1,F--):(W.length=F+1,p=A[s-te],W[F]=ae>0?I(V/A[M-ae]%A[ae])*p:0),C)for(;;)if(F==0){for(te=1,ae=W[0];ae>=10;ae/=10,te++);for(ae=W[0]+=p,p=1;ae>=10;ae/=10,p++);te!=p&&(m.e++,W[0]==i&&(W[0]=1));break}else{if(W[F]+=p,W[F]!=i)break;W[F--]=0,p=1}for(te=W.length;W[--te]===0;W.pop());}m.e>q?m.c=m.e=null:m.e=P?X(Y,R):v(Y,R,"0"),m.s<0?"-"+Y:Y)}return O.absoluteValue=O.abs=function(){var m=new ce(this);return m.s<0&&(m.s=1),m},O.comparedTo=function(m,Y){return N(this,new ce(m,Y))},O.decimalPlaces=O.dp=function(m,Y){var R,C,M,te=this;if(m!=null)return g(m,0,d),Y==null?Y=D:g(Y,0,8),E(new ce(te),m+te.e+1,Y);if(!(R=te.c))return null;if(C=((M=R.length-1)-h(this.e/s))*s,M=R[M])for(;M%10==0;M/=10,C--);return C<0&&(C=0),C},O.dividedBy=O.div=function(m,Y){return Q(this,new ce(m,Y),K,D)},O.dividedToIntegerBy=O.idiv=function(m,Y){return Q(this,new ce(m,Y),0,1)},O.exponentiatedBy=O.pow=function(m,Y){var R,C,M,te,ae,p,V,F,G,W=this;if(m=new ce(m),m.c&&!m.isInteger())throw Error(a+"Exponent not an integer: "+S(m));if(Y!=null&&(Y=new ce(Y)),p=m.e>14,!W.c||!W.c[0]||W.c[0]==1&&!W.e&&W.c.length==1||!m.c||!m.c[0])return G=new ce(Math.pow(+S(W),p?m.s*(2-y(m)):+S(m))),Y?G.mod(Y):G;if(V=m.s<0,Y){if(Y.c?!Y.c[0]:!Y.s)return new ce(NaN);C=!V&&W.isInteger()&&Y.isInteger(),C&&(W=W.mod(Y))}else{if(m.e>9&&(W.e>0||W.e<-1||(W.e==0?W.c[0]>1||p&&W.c[1]>=24e7:W.c[0]<8e13||p&&W.c[0]<=9999975e7)))return te=W.s<0&&y(m)?-0:0,W.e>-1&&(te=1/te),new ce(V?1/te:te);ie&&(te=l(ie/s+2))}for(p?(R=new ce(.5),V&&(m.s=1),F=y(m)):(M=Math.abs(+S(m)),F=M%2),G=new ce(U);;){if(F){if(G=G.times(W),!G.c)break;te?G.c.length>te&&(G.c.length=te):C&&(G=G.mod(Y))}if(M){if(M=I(M/2),M===0)break;F=M%2}else if(m=m.times(R),E(m,m.e+1,1),m.e>14)F=y(m);else{if(M=+S(m),M===0)break;F=M%2}W=W.times(W),te?W.c&&W.c.length>te&&(W.c.length=te):C&&(W=W.mod(Y))}return C?G:(V&&(G=U.div(G)),Y?G.mod(Y):te?E(G,ie,D,ae):G)},O.integerValue=function(m){var Y=new ce(this);return m==null?m=D:g(m,0,8),E(Y,Y.e+1,m)},O.isEqualTo=O.eq=function(m,Y){return N(this,new ce(m,Y))===0},O.isFinite=function(){return!!this.c},O.isGreaterThan=O.gt=function(m,Y){return N(this,new ce(m,Y))>0},O.isGreaterThanOrEqualTo=O.gte=function(m,Y){return(Y=N(this,new ce(m,Y)))===1||Y===0},O.isInteger=function(){return!!this.c&&h(this.e/s)>this.c.length-2},O.isLessThan=O.lt=function(m,Y){return N(this,new ce(m,Y))<0},O.isLessThanOrEqualTo=O.lte=function(m,Y){return(Y=N(this,new ce(m,Y)))===-1||Y===0},O.isNaN=function(){return!this.s},O.isNegative=function(){return this.s<0},O.isPositive=function(){return this.s>0},O.isZero=function(){return!!this.c&&this.c[0]==0},O.minus=function(m,Y){var R,C,M,te,ae=this,p=ae.s;if(m=new ce(m,Y),Y=m.s,!p||!Y)return new ce(NaN);if(p!=Y)return m.s=-Y,ae.plus(m);var V=ae.e/s,F=m.e/s,G=ae.c,W=m.c;if(!V||!F){if(!G||!W)return G?(m.s=-Y,m):new ce(W?ae:NaN);if(!G[0]||!W[0])return W[0]?(m.s=-Y,m):new ce(G[0]?ae:D==3?-0:0)}if(V=h(V),F=h(F),G=G.slice(),p=V-F){for((te=p<0)?(p=-p,M=G):(F=V,M=W),M.reverse(),Y=p;Y--;M.push(0));M.reverse()}else for(C=(te=(p=G.length)<(Y=W.length))?p:Y,p=Y=0;Y0)for(;Y--;G[R++]=0);for(Y=i-1;C>p;){if(G[--C]=0;){for(R=0,A=Oe[M]%He,x=Oe[M]/He|0,ae=V,te=M+ae;te>M;)F=et[--ae]%He,G=et[ae]/He|0,p=x*F+G*A,F=A*F+p%He*He+ue[te]+R,R=(F/Ue|0)+(p/He|0)+x*G,ue[te--]=F%Ue;ue[te]=R}return R?++C:ue.splice(0,1),j(m,ue,C)},O.negated=function(){var m=new ce(this);return m.s=-m.s||null,m},O.plus=function(m,Y){var R,C=this,M=C.s;if(m=new ce(m,Y),Y=m.s,!M||!Y)return new ce(NaN);if(M!=Y)return m.s=-Y,C.minus(m);var te=C.e/s,ae=m.e/s,p=C.c,V=m.c;if(!te||!ae){if(!p||!V)return new ce(M/0);if(!p[0]||!V[0])return V[0]?m:new ce(p[0]?C:M*0)}if(te=h(te),ae=h(ae),p=p.slice(),M=te-ae){for(M>0?(ae=te,R=V):(M=-M,R=p),R.reverse();M--;R.push(0));R.reverse()}for(M=p.length,Y=V.length,M-Y<0&&(R=V,V=p,p=R,Y=M),M=0;Y;)M=(p[--Y]=p[Y]+V[Y]+M)/i|0,p[Y]=i===p[Y]?0:p[Y]%i;return M&&(p=[M].concat(p),++ae),j(m,p,ae)},O.precision=O.sd=function(m,Y){var R,C,M,te=this;if(m!=null&&m!==!!m)return g(m,1,d),Y==null?Y=D:g(Y,0,8),E(new ce(te),m,Y);if(!(R=te.c))return null;if(M=R.length-1,C=M*s+1,M=R[M]){for(;M%10==0;M/=10,C--);for(M=R[0];M>=10;M/=10,C++);}return m&&te.e+1>C&&(C=te.e+1),C},O.shiftedBy=function(m){return g(m,-r,r),this.times("1e"+m)},O.squareRoot=O.sqrt=function(){var m,Y,R,C,M,te=this,ae=te.c,p=te.s,V=te.e,F=K+4,G=new ce("0.5");if(p!==1||!ae||!ae[0])return new ce(!p||p<0&&(!ae||ae[0])?NaN:ae?te:1/0);if(p=Math.sqrt(+S(te)),p==0||p==1/0?(Y=Z(ae),(Y.length+V)%2==0&&(Y+="0"),p=Math.sqrt(+Y),V=h((V+1)/2)-(V<0||V%2),p==1/0?Y="5e"+V:(Y=p.toExponential(),Y=Y.slice(0,Y.indexOf("e")+1)+V),R=new ce(Y)):R=new ce(p+""),R.c[0]){for(V=R.e,p=V+F,p<3&&(p=0);;)if(M=R,R=G.times(M.plus(Q(te,M,F,1))),Z(M.c).slice(0,p)===(Y=Z(R.c)).slice(0,p))if(R.e0&&ue>0){for(te=ue%p||p,G=x.substr(0,te);te0&&(G+=F+x.slice(te)),A&&(G="-"+G)}C=W?G+(R.decimalSeparator||"")+((V=+R.fractionGroupSize)?W.replace(new RegExp("\\d{"+V+"}\\B","g"),"$&"+(R.fractionGroupSeparator||"")):W):G}return(R.prefix||"")+C+(R.suffix||"")},O.toFraction=function(m){var Y,R,C,M,te,ae,p,V,F,G,W,A,x=this,ue=x.c;if(m!=null&&(p=new ce(m),!p.isInteger()&&(p.c||p.s!==1)||p.lt(U)))throw Error(a+"Argument "+(p.isInteger()?"out of range: ":"not an integer: ")+S(p));if(!ue)return new ce(x);for(Y=new ce(U),F=R=new ce(U),C=V=new ce(U),A=Z(ue),te=Y.e=A.length-x.e-1,Y.c[0]=u[(ae=te%s)<0?s+ae:ae],m=!m||p.comparedTo(Y)>0?te>0?Y:F:p,ae=q,q=1/0,p=new ce(A),V.c[0]=0;G=Q(p,Y,0,1),M=R.plus(G.times(C)),M.comparedTo(m)!=1;)R=C,C=M,F=V.plus(G.times(M=F)),V=M,Y=p.minus(G.times(M=Y)),p=M;return M=Q(m.minus(R),C,0,1),V=V.plus(M.times(F)),R=R.plus(M.times(C)),V.s=F.s=x.s,te=te*2,W=Q(F,C,te,D).minus(x).abs().comparedTo(Q(V,R,te,D).minus(x).abs())<1?[F,C]:[V,R],q=ae,W},O.toNumber=function(){return+S(this)},O.toPrecision=function(m,Y){return m!=null&&g(m,1,d),fe(this,m,Y,2)},O.toString=function(m){var Y,R=this,C=R.s,M=R.e;return M===null?C?(Y="Infinity",C<0&&(Y="-"+Y)):Y="NaN":(m==null?Y=M<=_||M>=P?X(Z(R.c),M):v(Z(R.c),M,"0"):m===10&&Fe?(R=E(new ce(R),K+M+1,D),Y=v(Z(R.c),R.e,"0")):(g(m,2,Ze.length,"Base"),Y=L(v(Z(R.c),M,"0"),10,m,C,!0)),C<0&&R.c[0]&&(Y="-"+Y)),Y},O.valueOf=O.toJSON=function(){return S(this)},O._isBigNumber=!0,H!=null&&ce.set(H),ce}function h(H){var Q=H|0;return H>0||H===Q?Q:Q-1}function Z(H){for(var Q,L,J=1,O=H.length,U=H[0]+"";JP^L?1:-1;for(D=(_=O.length)<(P=U.length)?_:P,K=0;KU[K]^L?1:-1;return _==P?0:_>P^L?1:-1}function g(H,Q,L,J){if(HL||H!==I(H))throw Error(a+(J||"Argument")+(typeof H=="number"?HL?" out of range: ":" not an integer: ":" not a primitive number: ")+String(H))}function y(H){var Q=H.c.length-1;return h(H.e/s)==Q&&H.c[Q]%2!=0}function X(H,Q){return(H.length>1?H.charAt(0)+"."+H.slice(1):H)+(Q<0?"e":"e+")+Q}function v(H,Q,L){var J,O;if(Q<0){for(O=L+".";++Q;O+=L);H=O+H}else if(J=H.length,++Q>J){for(O=L,Q-=J;--Q;O+=L);H+=O}else Q{var Qin=IDe(),Ein=Jin.exports;(function(){"use strict";function t(r){return r<10?"0"+r:r}var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l,I,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function i(r){return n.lastIndex=0,n.test(r)?'"'+r.replace(n,function(u){var o=a[u];return typeof o=="string"?o:"\\u"+("0000"+u.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+r+'"'}function s(r,u){var o,d,b,h,Z=l,N,g=u[r],y=g!=null&&(g instanceof Qin||Qin.isBigNumber(g));switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(r)),typeof c=="function"&&(g=c.call(u,r,g)),typeof g){case"string":return y?g:i(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":case"bigint":return String(g);case"object":if(!g)return"null";if(l+=I,N=[],Object.prototype.toString.apply(g)==="[object Array]"){for(h=g.length,o=0;o{var KWe=null,RVI=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,yVI=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,AVI=function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var n,l,I={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` +`,r:"\r",t:" "},a,c=function(Z){throw{name:"SyntaxError",message:Z,at:n,text:a}},i=function(Z){return Z&&Z!==l&&c("Expected '"+Z+"' instead of '"+l+"'"),l=a.charAt(n),n+=1,l},s=function(){var Z,N="";for(l==="-"&&(N="-",i("-"));l>="0"&&l<="9";)N+=l,i();if(l===".")for(N+=".";i()&&l>="0"&&l<="9";)N+=l;if(l==="e"||l==="E")for(N+=l,i(),(l==="-"||l==="+")&&(N+=l,i());l>="0"&&l<="9";)N+=l,i();if(Z=+N,!isFinite(Z))c("Bad number");else return KWe==null&&(KWe=IDe()),N.length>15?e.storeAsString?N:e.useNativeBigInt?BigInt(N):new KWe(N):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(Z):new KWe(Z):Z},r=function(){var Z,N,g="",y;if(l==='"')for(var X=n;i();){if(l==='"')return n-1>X&&(g+=a.substring(X,n-1)),i(),g;if(l==="\\"){if(n-1>X&&(g+=a.substring(X,n-1)),i(),l==="u"){for(y=0,N=0;N<4&&(Z=parseInt(i(),16),!!isFinite(Z));N+=1)y=y*16+Z;g+=String.fromCharCode(y)}else if(typeof I[l]=="string")g+=I[l];else break;X=n}}c("Bad string")},u=function(){for(;l&&l<=" ";)i()},o=function(){switch(l){case"t":return i("t"),i("r"),i("u"),i("e"),!0;case"f":return i("f"),i("a"),i("l"),i("s"),i("e"),!1;case"n":return i("n"),i("u"),i("l"),i("l"),null}c("Unexpected '"+l+"'")},d,b=function(){var Z=[];if(l==="["){if(i("["),u(),l==="]")return i("]"),Z;for(;l;){if(Z.push(d()),u(),l==="]")return i("]"),Z;i(","),u()}}c("Bad array")},h=function(){var Z,N=Object.create(null);if(l==="{"){if(i("{"),u(),l==="}")return i("}"),N;for(;l;){if(Z=r(),u(),i(":"),e.strict===!0&&Object.hasOwnProperty.call(N,Z)&&c('Duplicate key "'+Z+'"'),RVI.test(Z)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?d():N[Z]=d():yVI.test(Z)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?d():N[Z]=d():N[Z]=d(),u(),l==="}")return i("}"),N;i(","),u()}}c("Bad object")};return d=function(){switch(u(),l){case"{":return h();case"[":return b();case'"':return r();case"-":return s();default:return l>="0"&&l<="9"?s():o()}},function(Z,N){var g;return a=Z+"",n=0,l=" ",g=d(),u(),l&&c("Syntax error"),typeof N=="function"?function y(X,v){var H,Q,L=X[v];return L&&typeof L=="object"&&Object.keys(L).forEach(function(J){Q=y(L,J),Q!==void 0?L[J]=Q:delete L[J]}),N.call(X,v,L)}({"":g},""):g}};Lin.exports=AVI});var Oin=f((JWr,_We)=>{var xin=Cin().stringify,jin=kin();_We.exports=function(t){return{parse:jin(t),stringify:xin}};_We.exports.parse=jin();_We.exports.stringify=xin});var aDe=f(GY=>{"use strict";Object.defineProperty(GY,"__esModule",{value:!0});GY.GCE_LINUX_BIOS_PATHS=void 0;GY.isGoogleCloudServerless=Bin;GY.isGoogleComputeEngineLinux=Sin;GY.isGoogleComputeEngineMACAddress=Min;GY.isGoogleComputeEngine=Tin;GY.detectGCPResidency=vVI;var Uin=co(),zin=require("os");GY.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var FVI=/^42:01/;function Bin(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}function Sin(){if((0,zin.platform)()!=="linux")return!1;try{(0,Uin.statSync)(GY.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,Uin.readFileSync)(GY.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}function Min(){let t=(0,zin.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:n}of e)if(FVI.test(n))return!0}return!1}function Tin(){return Sin()||Min()}function vVI(){return Bin()||Tin()}});var Kin=f((LWr,Din)=>{var rDe=class{constructor(){this._events={},this._maxListeners=10}on(e,n){return this._events[e]||(this._events[e]=[]),this._events[e].push(n),this}emit(e,...n){if(!this._events[e])return!1;let l=this._events[e].slice();for(let I of l)I.apply(this,n);return!0}removeListener(e,n){if(!this._events[e])return this;let l=this._events[e].indexOf(n);return l!==-1&&this._events[e].splice(l,1),this}once(e,n){let l=(...I)=>{this.removeListener(e,l),n.apply(this,I)};return this.on(e,l)}removeAllListeners(e){return e?this._events[e]=[]:this._events={},this}setMaxListeners(e){return this._maxListeners=e,this}getMaxListeners(){return this._maxListeners}listenerCount(e){return this._events[e]?this._events[e].length:0}},fVI={EventEmitter:rDe,isUsingObsidian:!0};Din.exports=fVI});var Pin=f((kWr,_in)=>{var XVI={inspect:(t,e)=>JSON.stringify(t,null,2),format:(...t)=>{if(t.length===0)return"";let e=t[0],n=1;return e.replace(/%[sdj%]/g,l=>{if(l==="%%")return"%";if(n>=t.length)return l;let I=t[n++];switch(l){case"%s":return String(I);case"%d":return Number(I).toString();case"%j":return JSON.stringify(I);default:return l}})},promisify:t=>(...e)=>new Promise((n,l)=>{t(...e,(I,...a)=>{if(I)return l(I);if(a.length===1)return n(a[0]);n(a)})}),types:{isDate:t=>Object.prototype.toString.call(t)==="[object Date]",isRegExp:t=>Object.prototype.toString.call(t)==="[object RegExp]",isArray:Array.isArray,isObject:t=>t!==null&&typeof t=="object",isFunction:t=>typeof t=="function"},isUsingObsidian:!0};_in.exports=XVI});var qin=f(PWe=>{"use strict";Object.defineProperty(PWe,"__esModule",{value:!0});PWe.Colours=void 0;var Db=class t{static isEnabled(e){return e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};PWe.Colours=Db;Db.enabled=!1;Db.reset="";Db.bright="";Db.dim="";Db.red="";Db.green="";Db.yellow="";Db.blue="";Db.magenta="";Db.cyan="";Db.white="";Db.grey="";Db.refresh()});var nsn=f(Kr=>{"use strict";var wVI=Kr&&Kr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),HVI=Kr&&Kr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$in=Kr&&Kr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&wVI(e,t,n);return HVI(e,t),e};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.env=Kr.DebugLogBackendBase=Kr.placeholder=Kr.AdhocDebugLogger=Kr.LogSeverity=void 0;Kr.getNodeBackend=cDe;Kr.getDebugBackend=EVI;Kr.getStructuredBackend=JVI;Kr.setBackend=CVI;Kr.log=tsn;var QVI=Kin(),O6=$in(d8()),esn=$in(Pin()),bZ=qin(),bY;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(bY||(Kr.LogSeverity=bY={}));var U6=class extends QVI.EventEmitter{constructor(e,n){super(),this.namespace=e,this.upstream=n,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:(l,I)=>this.on(l,I)}),this.func.debug=(...l)=>this.invokeSeverity(bY.DEBUG,...l),this.func.info=(...l)=>this.invokeSeverity(bY.INFO,...l),this.func.warn=(...l)=>this.invokeSeverity(bY.WARNING,...l),this.func.error=(...l)=>this.invokeSeverity(bY.ERROR,...l),this.func.sublog=l=>tsn(l,this.func)}invoke(e,...n){this.upstream&&this.upstream(e,...n),this.emit("log",e,n)}invokeSeverity(e,...n){this.invoke({severity:e},...n)}};Kr.AdhocDebugLogger=U6;Kr.placeholder=new U6("",()=>{}).func;var ZU=class{constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let n=(e=O6.env[Kr.env.nodeEnables])!==null&&e!==void 0?e:"*";n==="all"&&(n="*"),this.filters=n.split(",")}log(e,n,...l){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let I=this.cached.get(e);I||(I=this.makeLogger(e),this.cached.set(e,I)),I(n,...l)}catch(I){console.error(I)}}};Kr.DebugLogBackendBase=ZU;var qWe=class extends ZU{constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(n,...l)=>{var I;let a=`${bZ.Colours.green}${e}${bZ.Colours.reset}`,c=`${bZ.Colours.yellow}${O6.pid}${bZ.Colours.reset}`,i;switch(n.severity){case bY.ERROR:i=`${bZ.Colours.red}${n.severity}${bZ.Colours.reset}`;break;case bY.INFO:i=`${bZ.Colours.magenta}${n.severity}${bZ.Colours.reset}`;break;case bY.WARNING:i=`${bZ.Colours.yellow}${n.severity}${bZ.Colours.reset}`;break;default:i=(I=n.severity)!==null&&I!==void 0?I:bY.DEFAULT;break}let s=esn.formatWithOptions({colors:bZ.Colours.enabled},...l),r=Object.assign({},n);delete r.severity;let u=Object.getOwnPropertyNames(r).length?JSON.stringify(r):"",o=u?`${bZ.Colours.grey}${u}${bZ.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,a,i,s,u?` ${o}`:"")}:()=>{}}setFilters(){let n=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${n}$`,"i")}};function cDe(){return new qWe}var oDe=class extends ZU{constructor(e){super(),this.debugPkg=e}makeLogger(e){let n=this.debugPkg(e);return(l,...I)=>{n(I[0],...I.slice(1))}}setFilters(){var e;let n=(e=O6.env.NODE_DEBUG)!==null&&e!==void 0?e:"";O6.env.NODE_DEBUG=`${n}${n?",":""}${this.filters.join(",")}`}};function EVI(t){return new oDe(t)}var iDe=class extends ZU{constructor(e){var n;super(),this.upstream=(n=e)!==null&&n!==void 0?n:new qWe}makeLogger(e){let n=this.upstream.makeLogger(e);return(l,...I)=>{var a;let c=(a=l.severity)!==null&&a!==void 0?a:bY.INFO,i=Object.assign({severity:c,message:esn.format(...I)},l),s=JSON.stringify(i);n(l,s)}}setFilters(){this.upstream.setFilters()}};function JVI(t){return new iDe(t)}Kr.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var sDe=new Map,mN;function CVI(t){mN=t,sDe.clear()}function tsn(t,e){if(!O6.env[Kr.env.nodeEnables]||!t)return Kr.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let l=sDe.get(t);if(l)return l.func;if(mN===null)return Kr.placeholder;mN===void 0&&(mN=cDe());let I=(()=>{let a;return new U6(t,(i,...s)=>{if(a!==mN){if(mN===null)return;mN===void 0&&(mN=cDe()),a=mN}mN?.log(t,i,...s)})})();return sDe.set(t,I),I.func}});var lsn=f(eC=>{"use strict";var LVI=eC&&eC.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),kVI=eC&&eC.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&LVI(e,t,n)};Object.defineProperty(eC,"__esModule",{value:!0});kVI(nsn(),eC)});var B6=f(kn=>{"use strict";var xVI=kn&&kn.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),jVI=kn&&kn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&xVI(e,t,n)};Object.defineProperty(kn,"__esModule",{value:!0});kn.gcpResidencyCache=kn.METADATA_SERVER_DETECTION=kn.HEADERS=kn.HEADER_VALUE=kn.HEADER_NAME=kn.SECONDARY_HOST_ADDRESS=kn.HOST_ADDRESS=kn.BASE_PATH=void 0;kn.instance=MVI;kn.project=TVI;kn.universe=DVI;kn.bulk=KVI;kn.isAvailable=PVI;kn.resetIsAvailableCache=qVI;kn.getGCPResidency=GDe;kn.setGCPResidency=asn;kn.requestTimeout=rsn;var uDe=dY(),OVI=Oin(),UVI=aDe(),zVI=lsn();kn.BASE_PATH="/computeMetadata/v1";kn.HOST_ADDRESS="http://169.254.169.254";kn.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";kn.HEADER_NAME="Metadata-Flavor";kn.HEADER_VALUE="Google";kn.HEADERS=Object.freeze({[kn.HEADER_NAME]:kn.HEADER_VALUE});var Isn=zVI.log("gcp metadata");kn.METADATA_SERVER_DETECTION=Object.freeze({"assume-present":"don't try to ping the metadata server, but assume it's present",none:"don't try to ping the metadata server, but don't try to use it either","bios-only":"treat the result of a BIOS probe as canonical (don't fall back to pinging)","ping-only":"skip the BIOS probe, and go straight to pinging"});function dDe(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||kn.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(kn.BASE_PATH,t).href}function BVI(t){Object.keys(t).forEach(e=>{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}async function z6(t,e={},n=3,l=!1){let I="",a={},c={};if(typeof t=="object"){let u=t;I=u.metadataKey,a=u.params||a,c=u.headers||c,n=u.noResponseRetries||n,l=u.fastFail||l}else I=t;typeof e=="string"?I+=`/${e}`:(BVI(e),e.property&&(I+=`/${e.property}`),c=e.headers||c,a=e.params||a);let i=l?SVI:uDe.request,s={url:`${dDe()}/${I}`,headers:{...kn.HEADERS,...c},retryConfig:{noResponseRetries:n},params:a,responseType:"text",timeout:rsn()};Isn.info("instance request %j",s);let r=await i(s);if(Isn.info("instance metadata is %s",r.data),r.headers[kn.HEADER_NAME.toLowerCase()]!==kn.HEADER_VALUE)throw new Error(`Invalid response from metadata service: incorrect ${kn.HEADER_NAME} header. Expected '${kn.HEADER_VALUE}', got ${r.headers[kn.HEADER_NAME.toLowerCase()]?`'${r.headers[kn.HEADER_NAME.toLowerCase()]}'`:"no header"}`);if(typeof r.data=="string")try{return OVI.parse(r.data)}catch{}return r.data}async function SVI(t){var e;let n={...t,url:(e=t.url)===null||e===void 0?void 0:e.toString().replace(dDe(),dDe(kn.SECONDARY_HOST_ADDRESS))},l=!1,I=(0,uDe.request)(t).then(c=>(l=!0,c)).catch(c=>{if(l)return a;throw l=!0,c}),a=(0,uDe.request)(n).then(c=>(l=!0,c)).catch(c=>{if(l)return I;throw l=!0,c});return Promise.race([I,a])}function MVI(t){return z6("instance",t)}function TVI(t){return z6("project",t)}function DVI(t){return z6("universe",t)}async function KVI(t){let e={};return await Promise.all(t.map(n=>(async()=>{let l=await z6(n),I=n.metadataKey;e[I]=l})())),e}function _VI(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}var $We;async function PVI(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in kn.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(kn.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return GDe();case"ping-only":}}try{return $We===void 0&&($We=z6("instance",void 0,_VI(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await $We,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code))){let n="UNKNOWN";e.code&&(n=e.code),process.emitWarning(`received unexpected error = ${e.message} code = ${n}`,"MetadataLookupWarning")}return!1}}function qVI(){$We=void 0}kn.gcpResidencyCache=null;function GDe(){return kn.gcpResidencyCache===null&&asn(),kn.gcpResidencyCache}function asn(t=null){kn.gcpResidencyCache=t!==null?t:(0,UVI.detectGCPResidency)()}function rsn(){return GDe()?0:3e3}jVI(aDe(),kn)});var csn=f(eNe=>{"use strict";Object.defineProperty(eNe,"__esModule",{value:!0});eNe.BrowserCrypto=void 0;var WU=ive(),$VI=NU(),bDe=class t{constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let n=new TextEncoder().encode(e),l=await window.crypto.subtle.digest("SHA-256",n);return WU.fromByteArray(new Uint8Array(l))}randomBytesBase64(e){let n=new Uint8Array(e);return window.crypto.getRandomValues(n),WU.fromByteArray(n)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,n,l){let I={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},a=new TextEncoder().encode(n),c=WU.toByteArray(t.padBase64(l)),i=await window.crypto.subtle.importKey("jwk",e,I,!0,["verify"]);return await window.crypto.subtle.verify(I,i,c,a)}async sign(e,n){let l={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},I=new TextEncoder().encode(n),a=await window.crypto.subtle.importKey("jwk",e,l,!0,["sign"]),c=await window.crypto.subtle.sign(l,a,I);return WU.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let n=WU.toByteArray(t.padBase64(e));return new TextDecoder().decode(n)}encodeBase64StringUtf8(e){let n=new TextEncoder().encode(e);return WU.fromByteArray(n)}async sha256DigestHex(e){let n=new TextEncoder().encode(e),l=await window.crypto.subtle.digest("SHA-256",n);return(0,$VI.fromArrayBufferToHex)(l)}async signWithHmacSha256(e,n){let l=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),I=new TextEncoder,a=await window.crypto.subtle.importKey("raw",I.encode(l),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",a,I.encode(n))}};eNe.BrowserCrypto=bDe});var osn=f(tNe=>{"use strict";Object.defineProperty(tNe,"__esModule",{value:!0});tNe.NodeCrypto=void 0;var VU=require("crypto"),mDe=class{async sha256DigestBase64(e){return VU.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return VU.randomBytes(e).toString("base64")}async verify(e,n,l){let I=VU.createVerify("RSA-SHA256");return I.update(n),I.end(),I.verify(e,l,"base64")}async sign(e,n){let l=VU.createSign("RSA-SHA256");return l.update(n),l.end(),l.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return VU.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,n){let l=typeof e=="string"?e:tYI(e);return eYI(VU.createHmac("sha256",l).update(n).digest())}};tNe.NodeCrypto=mDe;function eYI(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function tYI(t){return Buffer.from(t)}});var NU=f(S6=>{"use strict";Object.defineProperty(S6,"__esModule",{value:!0});S6.createCrypto=IYI;S6.hasBrowserCrypto=isn;S6.fromArrayBufferToHex=aYI;var nYI=csn(),lYI=osn();function IYI(){return isn()?new nYI.BrowserCrypto:new lYI.NodeCrypto}function isn(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}function aYI(t){return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}});var ssn=f(pDe=>{"use strict";Object.defineProperty(pDe,"__esModule",{value:!0});pDe.validate=rYI;function rYI(t){let e=[{invalid:"uri",expected:"url"},{invalid:"json",expected:"data"},{invalid:"qs",expected:"params"}];for(let n of e)if(t[n.invalid]){let l=`'${n.invalid}' is not a valid configuration option. Please use '${n.expected}' instead. This library is using Axios for requests. Please see https://github.com/axios/axios to learn more about the valid request options.`;throw new Error(l)}}});var hDe=f((TWr,cYI)=>{cYI.exports={name:"google-auth-library",version:"9.15.1",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=14"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^6.1.1","gcp-metadata":"^6.1.0",gtoken:"^7.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/chai":"^4.1.7","@types/jws":"^3.1.0","@types/mocha":"^9.0.0","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^20.4.2","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^8.0.0",chai:"^4.2.0",cheerio:"1.0.0-rc.12",codecov:"^3.0.2","engine.io":"6.6.2",gts:"^5.0.0","is-docker":"^2.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^3.0.0","jsdoc-region-tag":"^3.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"5.0.0",keypair:"^1.0.4",linkinator:"^4.0.0",mocha:"^9.2.2",mv:"^2.1.1",ncp:"^2.0.0",nock:"^13.0.0","null-loader":"^4.0.0",pdfmake:"0.2.12",puppeteer:"^21.0.0",sinon:"^18.0.0","ts-loader":"^8.0.0",typescript:"^5.1.6",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.json","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"linkinator docs","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install",precompile:"gts clean"},license:"Apache-2.0"}});var M6=f(lNe=>{"use strict";Object.defineProperty(lNe,"__esModule",{value:!0});lNe.DefaultTransporter=void 0;var oYI=dY(),iYI=ssn(),sYI=hDe(),usn="google-api-nodejs-client",nNe=class t{constructor(){this.instance=new oYI.Gaxios}configure(e={}){if(e.headers=e.headers||{},typeof window>"u"){let n=e.headers["User-Agent"];if(n?n.includes(`${usn}/`)||(e.headers["User-Agent"]=`${n} ${t.USER_AGENT}`):e.headers["User-Agent"]=t.USER_AGENT,!e.headers["x-goog-api-client"]){let l=process.version.replace(/^v/,"");e.headers["x-goog-api-client"]=`gl-node/${l}`}}return e}request(e){return e=this.configure(e),(0,iYI.validate)(e),this.instance.request(e).catch(n=>{throw this.processError(n)})}get defaults(){return this.instance.defaults}set defaults(e){this.instance.defaults=e}processError(e){let n=e.response,l=e,I=n?n.data:null;return n&&I&&I.error&&n.status!==200?typeof I.error=="string"?(l.message=I.error,l.status=n.status):Array.isArray(I.error.errors)?(l.message=I.error.errors.map(a=>a.message).join(` +`),l.code=I.error.code,l.errors=I.error.errors):(l.message=I.error.message,l.code=I.error.code):n&&n.status>=400&&(l.message=I,l.status=n.status),l}};lNe.DefaultTransporter=nNe;nNe.USER_AGENT=`${usn}/${sYI.version}`});var nC=f((ZDe,Gsn)=>{var INe=require("buffer"),SR=INe.Buffer;function dsn(t,e){for(var n in t)e[n]=t[n]}SR.from&&SR.alloc&&SR.allocUnsafe&&SR.allocUnsafeSlow?Gsn.exports=INe:(dsn(INe,ZDe),ZDe.Buffer=tC);function tC(t,e,n){return SR(t,e,n)}tC.prototype=Object.create(SR.prototype);dsn(SR,tC);tC.from=function(t,e,n){if(typeof t=="number")throw new TypeError("Argument must not be a number");return SR(t,e,n)};tC.alloc=function(t,e,n){if(typeof t!="number")throw new TypeError("Argument must be a number");var l=SR(t);return e!==void 0?typeof n=="string"?l.fill(e,n):l.fill(e):l.fill(0),l};tC.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return SR(t)};tC.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return INe.SlowBuffer(t)}});var msn=f((KWr,bsn)=>{"use strict";function WDe(t){var e=(t/8|0)+(t%8===0?0:1);return e}var uYI={ES256:WDe(256),ES384:WDe(384),ES512:WDe(521)};function dYI(t){var e=uYI[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}bsn.exports=dYI});var NDe=f((_Wr,Vsn)=>{"use strict";var aNe=nC().Buffer,hsn=msn(),rNe=128,Zsn=0,GYI=32,bYI=16,mYI=2,Wsn=bYI|GYI|Zsn<<6,cNe=mYI|Zsn<<6;function pYI(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Nsn(t){if(aNe.isBuffer(t))return t;if(typeof t=="string")return aNe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function hYI(t,e){t=Nsn(t);var n=hsn(e),l=n+1,I=t.length,a=0;if(t[a++]!==Wsn)throw new Error('Could not find expected "seq"');var c=t[a++];if(c===(rNe|1)&&(c=t[a++]),I-a=rNe;return I&&--l,l}function ZYI(t,e){t=Nsn(t);var n=hsn(e),l=t.length;if(l!==n*2)throw new TypeError('"'+e+'" signatures must be "'+n*2+'" bytes, saw "'+l+'"');var I=psn(t,0,n),a=psn(t,n,t.length),c=n-I,i=n-a,s=2+c+1+1+i,r=s{"use strict";var mY=xw&&xw.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},YU,e2,VDe,YDe;Object.defineProperty(xw,"__esModule",{value:!0});xw.LRUCache=void 0;xw.snakeToCamel=Ysn;xw.originalOrCamelOptions=WYI;function Ysn(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}function WYI(t){function e(n){var l;let I=t||{};return(l=I[n])!==null&&l!==void 0?l:I[Ysn(n)]}return{get:e}}var gDe=class{constructor(e){YU.add(this),e2.set(this,new Map),this.capacity=e.capacity,this.maxAge=e.maxAge}set(e,n){mY(this,YU,"m",VDe).call(this,e,n),mY(this,YU,"m",YDe).call(this)}get(e){let n=mY(this,e2,"f").get(e);if(n)return mY(this,YU,"m",VDe).call(this,e,n.value),mY(this,YU,"m",YDe).call(this),n.value}};xw.LRUCache=gDe;e2=new WeakMap,YU=new WeakSet,VDe=function(e,n){mY(this,e2,"f").delete(e),mY(this,e2,"f").set(e,{value:n,lastAccessed:Date.now()})},YDe=function(){let e=this.maxAge?Date.now()-this.maxAge:0,n=mY(this,e2,"f").entries().next();for(;!n.done&&(mY(this,e2,"f").size>this.capacity||n.value[1].lastAccessed{"use strict";Object.defineProperty(pY,"__esModule",{value:!0});pY.AuthClient=pY.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=pY.DEFAULT_UNIVERSE=void 0;var NYI=require("events"),gsn=dY(),Rsn=M6(),VYI=jw();pY.DEFAULT_UNIVERSE="googleapis.com";pY.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=5*60*1e3;var RDe=class extends NYI.EventEmitter{constructor(e={}){var n,l,I,a,c;super(),this.credentials={},this.eagerRefreshThresholdMillis=pY.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS,this.forceRefreshOnFailure=!1,this.universeDomain=pY.DEFAULT_UNIVERSE;let i=(0,VYI.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=(n=i.get("project_id"))!==null&&n!==void 0?n:null,this.quotaProjectId=i.get("quota_project_id"),this.credentials=(l=i.get("credentials"))!==null&&l!==void 0?l:{},this.universeDomain=(I=i.get("universe_domain"))!==null&&I!==void 0?I:pY.DEFAULT_UNIVERSE,this.transporter=(a=e.transporter)!==null&&a!==void 0?a:new Rsn.DefaultTransporter,e.transporterOptions&&(this.transporter.defaults=e.transporterOptions),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=(c=e.forceRefreshOnFailure)!==null&&c!==void 0?c:!1}get gaxios(){return this.transporter instanceof gsn.Gaxios?this.transporter:this.transporter instanceof Rsn.DefaultTransporter?this.transporter.instance:"instance"in this.transporter&&this.transporter.instance instanceof gsn.Gaxios?this.transporter.instance:null}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e["x-goog-user-project"]&&this.quotaProjectId&&(e["x-goog-user-project"]=this.quotaProjectId),e}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};pY.AuthClient=RDe});var ADe=f(oNe=>{"use strict";Object.defineProperty(oNe,"__esModule",{value:!0});oNe.LoginTicket=void 0;var yDe=class{constructor(e,n){this.envelope=e,this.payload=n}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};oNe.LoginTicket=yDe});var lC=f(TR=>{"use strict";Object.defineProperty(TR,"__esModule",{value:!0});TR.OAuth2Client=TR.ClientAuthentication=TR.CertificateFormat=TR.CodeChallengeMethod=void 0;var YYI=dY(),FDe=require("querystring"),gYI=require("stream"),RYI=NDe(),vDe=NU(),yYI=MR(),AYI=ADe(),ysn;(function(t){t.Plain="plain",t.S256="S256"})(ysn||(TR.CodeChallengeMethod=ysn={}));var t2;(function(t){t.PEM="PEM",t.JWK="JWK"})(t2||(TR.CertificateFormat=t2={}));var T6;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(T6||(TR.ClientAuthentication=T6={}));var gU=class t extends yYI.AuthClient{constructor(e,n,l){let I=e&&typeof e=="object"?e:{clientId:e,clientSecret:n,redirectUri:l};super(I),this.certificateCache={},this.certificateExpiry=null,this.certificateCacheFormat=t2.PEM,this.refreshTokenPromises=new Map,this._clientId=I.clientId,this._clientSecret=I.clientSecret,this.redirectUri=I.redirectUri,this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...I.endpoints},this.clientAuthentication=I.clientAuthentication||T6.ClientSecretPost,this.issuers=I.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+FDe.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,vDe.createCrypto)(),l=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),a=(await e.sha256DigestBase64(l)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:l,codeChallenge:a}}getToken(e,n){let l=typeof e=="string"?{code:e}:e;if(n)this.getTokenAsync(l).then(I=>n(null,I.tokens,I.res),I=>n(I,null,I.response));else return this.getTokenAsync(l)}async getTokenAsync(e){let n=this.endpoints.oauth2TokenUrl.toString(),l={"Content-Type":"application/x-www-form-urlencoded"},I={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===T6.ClientSecretBasic){let i=Buffer.from(`${this._clientId}:${this._clientSecret}`);l.Authorization=`Basic ${i.toString("base64")}`}this.clientAuthentication===T6.ClientSecretPost&&(I.client_secret=this._clientSecret);let a=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",url:n,data:FDe.stringify(I),headers:l}),c=a.data;return a.data&&a.data.expires_in&&(c.expiry_date=new Date().getTime()+a.data.expires_in*1e3,delete c.expires_in),this.emit("tokens",c),{tokens:c,res:a}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let n=this.refreshTokenNoCache(e).then(l=>(this.refreshTokenPromises.delete(e),l),l=>{throw this.refreshTokenPromises.delete(e),l});return this.refreshTokenPromises.set(e,n),n}async refreshTokenNoCache(e){var n;if(!e)throw new Error("No refresh token is set.");let l=this.endpoints.oauth2TokenUrl.toString(),I={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},a;try{a=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",url:l,data:FDe.stringify(I),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}catch(i){throw i instanceof YYI.GaxiosError&&i.message==="invalid_grant"&&(!((n=i.response)===null||n===void 0)&&n.data)&&/ReAuth/i.test(i.response.data.error_description)&&(i.message=JSON.stringify(i.response.data)),i}let c=a.data;return a.data&&a.data.expires_in&&(c.expiry_date=new Date().getTime()+a.data.expires_in*1e3,delete c.expires_in),this.emit("tokens",c),{tokens:c,res:a}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(n=>e(null,n.credentials,n.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),n=e.tokens;return n.refresh_token=this.credentials.refresh_token,this.credentials=n,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(n=>e(null,n.token,n.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let l=await this.processAndValidateRefreshHandler();if(l?.access_token)return this.setCredentials(l),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let n=await this.refreshAccessTokenAsync();if(!n.credentials||n.credentials&&!n.credentials.access_token)throw new Error("Could not refresh access token.");return{token:n.credentials.access_token,res:n.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let n=this.credentials;if(!n.access_token&&!n.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(n.access_token&&!this.isTokenExpiring()){n.token_type=n.token_type||"Bearer";let i={Authorization:n.token_type+" "+n.access_token};return{headers:this.addSharedMetadataHeaders(i)}}if(this.refreshHandler){let i=await this.processAndValidateRefreshHandler();if(i?.access_token){this.setCredentials(i);let s={Authorization:"Bearer "+this.credentials.access_token};return{headers:this.addSharedMetadataHeaders(s)}}}if(this.apiKey)return{headers:{"X-Goog-Api-Key":this.apiKey}};let l=null,I=null;try{l=await this.refreshToken(n.refresh_token),I=l.tokens}catch(i){let s=i;throw s.response&&(s.response.status===403||s.response.status===404)&&(s.message=`Could not refresh access token: ${s.message}`),s}let a=this.credentials;a.token_type=a.token_type||"Bearer",I.refresh_token=a.refresh_token,this.credentials=I;let c={Authorization:a.token_type+" "+I.access_token};return{headers:this.addSharedMetadataHeaders(c),res:l.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let n=new URL(this.endpoints.oauth2RevokeUrl);return n.searchParams.append("token",e),n}revokeToken(e,n){let l={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(n)this.transporter.request(l).then(I=>n(null,I),n);else return this.transporter.request(l)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(n=>e(null,n),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,n){if(n)this.requestAsync(e).then(l=>n(null,l),l=>n(l,l.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){let l;try{let I=await this.getRequestMetadataAsync(e.url);e.headers=e.headers||{},I.headers&&I.headers["x-goog-user-project"]&&(e.headers["x-goog-user-project"]=I.headers["x-goog-user-project"]),I.headers&&I.headers.Authorization&&(e.headers.Authorization=I.headers.Authorization),this.apiKey&&(e.headers["X-Goog-Api-Key"]=this.apiKey),l=await this.transporter.request(e)}catch(I){let a=I.response;if(a){let c=a.status,i=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),s=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,r=a.config.data instanceof gYI.Readable,u=c===401||c===403;if(!n&&u&&!r&&i)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!n&&u&&!r&&s){let o=await this.processAndValidateRefreshHandler();return o?.access_token&&this.setCredentials(o),this.requestAsync(e,!0)}}throw I}return l}verifyIdToken(e,n){if(n&&typeof n!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(n)this.verifyIdTokenAsync(e).then(l=>n(null,l),n);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let n=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,n.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:n}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),l=Object.assign({expiry_date:new Date().getTime()+n.expires_in*1e3,scopes:n.scope.split(" ")},n);return delete l.expires_in,delete l.scope,l}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(n=>e(null,n.certs,n.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),n=(0,vDe.hasBrowserCrypto)()?t2.JWK:t2.PEM;if(this.certificateExpiry&&ee(null,n.pubkeys,n.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,n=this.endpoints.oauth2IapPublicKeyUrl.toString();try{e=await this.transporter.request({...t.RETRY_CONFIG,url:n})}catch(l){throw l instanceof Error&&(l.message=`Failed to retrieve verification certificates: ${l.message}`),l}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,n,l,I,a){let c=(0,vDe.createCrypto)();a||(a=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let i=e.split(".");if(i.length!==3)throw new Error("Wrong number of segments in token: "+e);let s=i[0]+"."+i[1],r=i[2],u,o;try{u=JSON.parse(c.decodeBase64StringUtf8(i[0]))}catch(X){throw X instanceof Error&&(X.message=`Can't parse token envelope: ${i[0]}': ${X.message}`),X}if(!u)throw new Error("Can't parse token envelope: "+i[0]);try{o=JSON.parse(c.decodeBase64StringUtf8(i[1]))}catch(X){throw X instanceof Error&&(X.message=`Can't parse token payload '${i[0]}`),X}if(!o)throw new Error("Can't parse token payload: "+i[1]);if(!Object.prototype.hasOwnProperty.call(n,u.kid))throw new Error("No pem found for envelope: "+JSON.stringify(u));let d=n[u.kid];if(u.alg==="ES256"&&(r=RYI.joseToDer(r,"ES256").toString("base64")),!await c.verify(d,s,r))throw new Error("Invalid token signature: "+e);if(!o.iat)throw new Error("No issue time in token: "+JSON.stringify(o));if(!o.exp)throw new Error("No expiration time in token: "+JSON.stringify(o));let h=Number(o.iat);if(isNaN(h))throw new Error("iat field using invalid format");let Z=Number(o.exp);if(isNaN(Z))throw new Error("exp field using invalid format");let N=new Date().getTime()/1e3;if(Z>=N+a)throw new Error("Expiration time too far in future: "+JSON.stringify(o));let g=h-t.CLOCK_SKEW_SECS_,y=Z+t.CLOCK_SKEW_SECS_;if(Ny)throw new Error("Token used too late, "+N+" > "+y+": "+JSON.stringify(o));if(I&&I.indexOf(o.iss)<0)throw new Error("Invalid issuer, expected one of ["+I+"], but got "+o.iss);if(typeof l<"u"&&l!==null){let X=o.aud,v=!1;if(l.constructor===Array?v=l.indexOf(X)>-1:v=X===l,!v)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new AYI.LoginTicket(u,o)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};TR.OAuth2Client=gU;gU.GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";gU.CLOCK_SKEW_SECS_=300;gU.DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400});var XDe=f(iNe=>{"use strict";Object.defineProperty(iNe,"__esModule",{value:!0});iNe.Compute=void 0;var FYI=dY(),Asn=B6(),vYI=lC(),fDe=class extends vYI.OAuth2Client{constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(e){let n=`service-accounts/${this.serviceAccountEmail}/token`,l;try{let a={property:n};this.scopes.length>0&&(a.params={scopes:this.scopes.join(",")}),l=await Asn.instance(a)}catch(a){throw a instanceof FYI.GaxiosError&&(a.message=`Could not refresh access token: ${a.message}`,this.wrapError(a)),a}let I=l;return l&&l.expires_in&&(I.expiry_date=new Date().getTime()+l.expires_in*1e3,delete I.expires_in),this.emit("tokens",I),{tokens:I,res:null}}async fetchIdToken(e){let n=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,l;try{let I={property:n};l=await Asn.instance(I)}catch(I){throw I instanceof Error&&(I.message=`Could not fetch ID token: ${I.message}`),I}return l}wrapError(e){let n=e.response;n&&n.status&&(e.status=n.status,n.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:n.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};iNe.Compute=fDe});var HDe=f(sNe=>{"use strict";Object.defineProperty(sNe,"__esModule",{value:!0});sNe.IdTokenClient=void 0;var fYI=lC(),wDe=class extends fYI.OAuth2Client{constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(e){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let l=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:l,expiry_date:this.getIdTokenExpiryDate(l)}}return{headers:{Authorization:"Bearer "+this.credentials.id_token}}}getIdTokenExpiryDate(e){let n=e.split(".")[1];if(n)return JSON.parse(Buffer.from(n,"base64").toString("ascii")).exp*1e3}};sNe.IdTokenClient=wDe});var QDe=f(RU=>{"use strict";Object.defineProperty(RU,"__esModule",{value:!0});RU.GCPEnv=void 0;RU.clear=XYI;RU.getEnv=wYI;var Fsn=B6(),n2;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.NONE="NONE"})(n2||(RU.GCPEnv=n2={}));var D6;function XYI(){D6=void 0}async function wYI(){return D6||(D6=HYI(),D6)}async function HYI(){let t=n2.NONE;return QYI()?t=n2.APP_ENGINE:EYI()?t=n2.CLOUD_FUNCTIONS:await LYI()?await CYI()?t=n2.KUBERNETES_ENGINE:JYI()?t=n2.CLOUD_RUN:t=n2.COMPUTE_ENGINE:t=n2.NONE,t}function QYI(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}function EYI(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}function JYI(){return!!process.env.K_CONFIGURATION}async function CYI(){try{return await Fsn.instance("attributes/cluster-name"),!0}catch{return!1}}async function LYI(){return Fsn.isAvailable()}});var EDe=f((INr,vsn)=>{var uNe=nC().Buffer,kYI=require("stream"),xYI=require("util");function dNe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=uNe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=uNe.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}xYI.inherits(dNe,kYI);dNe.prototype.write=function(e){this.buffer=uNe.concat([this.buffer,uNe.from(e)]),this.emit("data",e)};dNe.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};vsn.exports=dNe});var Xsn=f((aNr,fsn)=>{"use strict";var K6=require("buffer").Buffer,JDe=require("buffer").SlowBuffer;fsn.exports=GNe;function GNe(t,e){if(!K6.isBuffer(t)||!K6.isBuffer(e)||t.length!==e.length)return!1;for(var n=0,l=0;l{var AU=nC().Buffer,pN=require("crypto"),Hsn=NDe(),wsn=require("util"),UYI=`"%s" is not a valid algorithm. + Supported algorithms are: + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,_6="secret must be a string or buffer",yU="key must be a string or a buffer",zYI="key must be a string, a buffer or an object",LDe=typeof pN.createPublicKey=="function";LDe&&(yU+=" or a KeyObject",_6+="or a KeyObject");function Qsn(t){if(!AU.isBuffer(t)&&typeof t!="string"&&(!LDe||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw hY(yU)}function Esn(t){if(!AU.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw hY(zYI)}function BYI(t){if(!AU.isBuffer(t)){if(typeof t=="string")return t;if(!LDe||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw hY(_6)}}function kDe(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Jsn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var n=0;n{var egI=require("buffer").Buffer;jsn.exports=function(e){return typeof e=="string"?e:typeof e=="number"||egI.isBuffer(e)?e.toString():JSON.stringify(e)}});var Msn=f((oNr,Ssn)=>{var tgI=nC().Buffer,Osn=EDe(),ngI=xDe(),lgI=require("stream"),Usn=jDe(),ODe=require("util");function zsn(t,e){return tgI.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function IgI(t,e,n){n=n||"utf8";var l=zsn(Usn(t),"binary"),I=zsn(Usn(e),n);return ODe.format("%s.%s",l,I)}function Bsn(t){var e=t.header,n=t.payload,l=t.secret||t.privateKey,I=t.encoding,a=ngI(e.alg),c=IgI(e,n,I),i=a.sign(c,l);return ODe.format("%s.%s",c,i)}function bNe(t){var e=t.secret||t.privateKey||t.key,n=new Osn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=n,this.payload=new Osn(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}ODe.inherits(bNe,lgI);bNe.prototype.sign=function(){try{var e=Bsn({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};bNe.sign=Bsn;Ssn.exports=bNe});var nun=f((iNr,tun)=>{var Dsn=nC().Buffer,Tsn=EDe(),agI=xDe(),rgI=require("stream"),Ksn=jDe(),cgI=require("util"),ogI=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function igI(t){return Object.prototype.toString.call(t)==="[object Object]"}function sgI(t){if(igI(t))return t;try{return JSON.parse(t)}catch{return}}function _sn(t){var e=t.split(".",1)[0];return sgI(Dsn.from(e,"base64").toString("binary"))}function ugI(t){return t.split(".",2).join(".")}function Psn(t){return t.split(".")[2]}function dgI(t,e){e=e||"utf8";var n=t.split(".")[1];return Dsn.from(n,"base64").toString(e)}function qsn(t){return ogI.test(t)&&!!_sn(t)}function $sn(t,e,n){if(!e){var l=new Error("Missing algorithm parameter for jws.verify");throw l.code="MISSING_ALGORITHM",l}t=Ksn(t);var I=Psn(t),a=ugI(t),c=agI(e);return c.verify(a,I,n)}function eun(t,e){if(e=e||{},t=Ksn(t),!qsn(t))return null;var n=_sn(t);if(!n)return null;var l=dgI(t);return(n.typ==="JWT"||e.json)&&(l=JSON.parse(l,e.encoding)),{header:n,payload:l,signature:Psn(t)}}function FU(t){t=t||{};var e=t.secret||t.publicKey||t.key,n=new Tsn(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=n,this.signature=new Tsn(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}cgI.inherits(FU,rgI);FU.prototype.verify=function(){try{var e=$sn(this.signature.buffer,this.algorithm,this.key.buffer),n=eun(this.signature.buffer,this.encoding);return this.emit("done",e,n),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(l){this.readable=!1,this.emit("error",l),this.emit("close")}};FU.decode=eun;FU.isValid=qsn;FU.verify=$sn;tun.exports=FU});var UDe=f(Ow=>{var lun=Msn(),mNe=nun(),GgI=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ow.ALGORITHMS=GgI;Ow.sign=lun.sign;Ow.verify=mNe.verify;Ow.decode=mNe.decode;Ow.isValid=mNe.isValid;Ow.createSign=function(e){return new lun(e)};Ow.createVerify=function(e){return new mNe(e)}});var uun=f(Uw=>{"use strict";var ZY=Uw&&Uw.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},Iun=Uw&&Uw.__classPrivateFieldSet||function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},WY,vU,zDe,aun,run,BDe,SDe,cun;Object.defineProperty(Uw,"__esModule",{value:!0});Uw.GoogleToken=void 0;var oun=co(),bgI=dY(),mgI=UDe(),pgI=Ca(),hgI=require("util"),iun=oun.readFile?(0,hgI.promisify)(oun.readFile):async()=>{throw new IC("use key rather than keyFile.","MISSING_CREDENTIALS")},sun="https://www.googleapis.com/oauth2/v4/token",ZgI="https://accounts.google.com/o/oauth2/revoke?token=",IC=class extends Error{constructor(e,n){super(e),this.code=n}},MDe=class{get accessToken(){return this.rawToken?this.rawToken.access_token:void 0}get idToken(){return this.rawToken?this.rawToken.id_token:void 0}get tokenType(){return this.rawToken?this.rawToken.token_type:void 0}get refreshToken(){return this.rawToken?this.rawToken.refresh_token:void 0}constructor(e){WY.add(this),this.transporter={request:n=>(0,bgI.request)(n)},vU.set(this,void 0),ZY(this,WY,"m",SDe).call(this,e)}hasExpired(){let e=new Date().getTime();return this.rawToken&&this.expiresAt?e>=this.expiresAt:!0}isTokenExpiring(){var e;let n=new Date().getTime(),l=(e=this.eagerRefreshThresholdMillis)!==null&&e!==void 0?e:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+l:!0}getToken(e,n={}){if(typeof e=="object"&&(n=e,e=void 0),n=Object.assign({forceRefresh:!1},n),e){let l=e;ZY(this,WY,"m",zDe).call(this,n).then(I=>l(null,I),e);return}return ZY(this,WY,"m",zDe).call(this,n)}async getCredentials(e){switch(pgI.extname(e)){case".json":{let l=await iun(e,"utf8"),I=JSON.parse(l),a=I.private_key,c=I.client_email;if(!a||!c)throw new IC("private_key and client_email are required.","MISSING_CREDENTIALS");return{privateKey:a,clientEmail:c}}case".der":case".crt":case".pem":return{privateKey:await iun(e,"utf8")};case".p12":case".pfx":throw new IC("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE");default:throw new IC("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE")}}revokeToken(e){if(e){ZY(this,WY,"m",BDe).call(this).then(()=>e(),e);return}return ZY(this,WY,"m",BDe).call(this)}};Uw.GoogleToken=MDe;vU=new WeakMap,WY=new WeakSet,zDe=async function(e){if(ZY(this,vU,"f")&&!e.forceRefresh)return ZY(this,vU,"f");try{return await Iun(this,vU,ZY(this,WY,"m",aun).call(this,e),"f")}finally{Iun(this,vU,void 0,"f")}},aun=async function(e){if(this.isTokenExpiring()===!1&&e.forceRefresh===!1)return Promise.resolve(this.rawToken);if(!this.key&&!this.keyFile)throw new Error("No key or keyFile set.");if(!this.key&&this.keyFile){let n=await this.getCredentials(this.keyFile);this.key=n.privateKey,this.iss=n.clientEmail||this.iss,n.clientEmail||ZY(this,WY,"m",run).call(this)}return ZY(this,WY,"m",cun).call(this)},run=function(){if(!this.iss)throw new IC("email is required.","MISSING_CREDENTIALS")},BDe=async function(){if(!this.accessToken)throw new Error("No token to revoke.");let e=ZgI+this.accessToken;await this.transporter.request({url:e,retry:!0}),ZY(this,WY,"m",SDe).call(this,{email:this.iss,sub:this.sub,key:this.key,keyFile:this.keyFile,scope:this.scope,additionalClaims:this.additionalClaims})},SDe=function(e={}){this.keyFile=e.keyFile,this.key=e.key,this.rawToken=void 0,this.iss=e.email||e.iss,this.sub=e.sub,this.additionalClaims=e.additionalClaims,typeof e.scope=="object"?this.scope=e.scope.join(" "):this.scope=e.scope,this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,e.transporter&&(this.transporter=e.transporter)},cun=async function(){var e,n;let l=Math.floor(new Date().getTime()/1e3),I=this.additionalClaims||{},a=Object.assign({iss:this.iss,scope:this.scope,aud:sun,exp:l+3600,iat:l,sub:this.sub},I),c=mgI.sign({header:{alg:"RS256"},payload:a,secret:this.key});try{let i=await this.transporter.request({method:"POST",url:sun,data:{grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:c},headers:{"Content-Type":"application/x-www-form-urlencoded"},responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});return this.rawToken=i.data,this.expiresAt=i.data.expires_in===null||i.data.expires_in===void 0?void 0:(l+i.data.expires_in)*1e3,this.rawToken}catch(i){this.rawToken=void 0,this.tokenExpires=void 0;let s=i.response&&(!((e=i.response)===null||e===void 0)&&e.data)?(n=i.response)===null||n===void 0?void 0:n.data:{};if(s.error){let r=s.error_description?`: ${s.error_description}`:"";i.message=`${s.error}${r}`}throw i}}});var DDe=f(pNe=>{"use strict";Object.defineProperty(pNe,"__esModule",{value:!0});pNe.JWTAccess=void 0;var WgI=UDe(),NgI=jw(),dun={alg:"RS256",typ:"JWT"},TDe=class t{constructor(e,n,l,I){this.cache=new NgI.LRUCache({capacity:500,maxAge:60*60*1e3}),this.email=e,this.key=n,this.keyId=l,this.eagerRefreshThresholdMillis=I??5*60*1e3}getCachedKey(e,n){let l=e;if(n&&Array.isArray(n)&&n.length?l=e?`${e}_${n.join("_")}`:`${n.join("_")}`:typeof n=="string"&&(l=e?`${e}_${n}`:n),!l)throw Error("Scopes or url must be provided");return l}getRequestHeaders(e,n,l){let I=this.getCachedKey(e,l),a=this.cache.get(I),c=Date.now();if(a&&a.expiration-c>this.eagerRefreshThresholdMillis)return a.headers;let i=Math.floor(Date.now()/1e3),s=t.getExpirationTime(i),r;if(Array.isArray(l)&&(l=l.join(" ")),l?r={iss:this.email,sub:this.email,scope:l,exp:s,iat:i}:r={iss:this.email,sub:this.email,aud:e,exp:s,iat:i},n){for(let h in r)if(n[h])throw new Error(`The '${h}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let u=this.keyId?{...dun,kid:this.keyId}:dun,o=Object.assign(r,n),b={Authorization:`Bearer ${WgI.sign({header:u,payload:o,secret:this.key})}`};return this.cache.set(I,{expiration:s*1e3,headers:b}),b}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((n,l)=>{e||l(new Error("Must pass in a stream containing the service account auth settings."));let I="";e.setEncoding("utf8").on("data",a=>I+=a).on("error",l).on("end",()=>{try{let a=JSON.parse(I);this.fromJSON(a),n()}catch(a){l(a)}})})}};pNe.JWTAccess=TDe});var _De=f(ZNe=>{"use strict";Object.defineProperty(ZNe,"__esModule",{value:!0});ZNe.JWT=void 0;var Gun=uun(),VgI=DDe(),YgI=lC(),hNe=MR(),KDe=class t extends YgI.OAuth2Client{constructor(e,n,l,I,a,c){let i=e&&typeof e=="object"?e:{email:e,keyFile:n,key:l,keyId:c,scopes:I,subject:a};super(i),this.email=i.email,this.keyFile=i.keyFile,this.key=i.key,this.keyId=i.keyId,this.scopes=i.scopes,this.subject=i.subject,this.additionalClaims=i.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let n=new t(this);return n.scopes=e,n}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let n=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==hNe.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==hNe.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${hNe.DEFAULT_UNIVERSE}`);if(!this.apiKey&&n)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:l}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders({Authorization:`Bearer ${l.id_token}`})}}else{this.access||(this.access=new VgI.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let l;this.hasUserScopes()?l=this.scopes:e||(l=this.defaultScopes);let I=this.useJWTAccessWithScope||this.universeDomain!==hNe.DEFAULT_UNIVERSE,a=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,I?l:void 0);return{headers:this.addSharedMetadataHeaders(a)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:{}}}async fetchIdToken(e){let n=new Gun.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await n.getToken({forceRefresh:!0}),!n.idToken)throw new Error("Unknown error: Failed to fetch ID token");return n.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(n=>e(null,n),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,e.tokens}async refreshTokenNoCache(e){let n=this.createGToken(),I={access_token:(await n.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:n.expiresAt,id_token:n.idToken};return this.emit("tokens",I),{res:null,tokens:I}}createGToken(){return this.gtoken||(this.gtoken=new Gun.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((n,l)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let I="";e.setEncoding("utf8").on("error",l).on("data",a=>I+=a).on("end",()=>{try{let a=JSON.parse(I);this.fromJSON(a),n()}catch(a){l(a)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let n=await this.createGToken().getCredentials(this.keyFile);return{private_key:n.privateKey,client_email:n.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};ZNe.JWT=KDe});var qDe=f(fU=>{"use strict";Object.defineProperty(fU,"__esModule",{value:!0});fU.UserRefreshClient=fU.USER_REFRESH_ACCOUNT_TYPE=void 0;var ggI=lC(),RgI=require("querystring");fU.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var PDe=class t extends ggI.OAuth2Client{constructor(e,n,l,I,a){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:n,refreshToken:l,eagerRefreshThresholdMillis:I,forceRefreshOnFailure:a};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(e){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){return(await this.transporter.request({...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"POST",data:(0,RgI.stringify)({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})})).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,n){if(n)this.fromStreamAsync(e).then(()=>n(),n);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((n,l)=>{if(!e)return l(new Error("Must pass in a stream containing the user refresh token."));let I="";e.setEncoding("utf8").on("error",l).on("data",a=>I+=a).on("end",()=>{try{let a=JSON.parse(I);return this.fromJSON(a),n()}catch(a){return l(a)}})})}static fromJSON(e){let n=new t;return n.fromJSON(e),n}};fU.UserRefreshClient=PDe});var eKe=f(XU=>{"use strict";Object.defineProperty(XU,"__esModule",{value:!0});XU.Impersonated=XU.IMPERSONATED_ACCOUNT_TYPE=void 0;var bun=lC(),ygI=dY(),AgI=jw();XU.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var $De=class t extends bun.OAuth2Client{constructor(e={}){var n,l,I,a,c,i;if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=(n=e.sourceClient)!==null&&n!==void 0?n:new bun.OAuth2Client,this.targetPrincipal=(l=e.targetPrincipal)!==null&&l!==void 0?l:"",this.delegates=(I=e.delegates)!==null&&I!==void 0?I:[],this.targetScopes=(a=e.targetScopes)!==null&&a!==void 0?a:[],this.lifetime=(c=e.lifetime)!==null&&c!==void 0?c:3600,!!!(0,AgI.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=(i=e.endpoint)!==null&&i!==void 0?i:`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,l=`${this.endpoint}/v1/${n}:signBlob`,I={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:l,data:I,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){var e,n,l,I,a,c;try{await this.sourceClient.getAccessToken();let i="projects/-/serviceAccounts/"+this.targetPrincipal,s=`${this.endpoint}/v1/${i}:generateAccessToken`,r={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},u=await this.sourceClient.request({...t.RETRY_CONFIG,url:s,data:r,method:"POST"}),o=u.data;return this.credentials.access_token=o.accessToken,this.credentials.expiry_date=Date.parse(o.expireTime),{tokens:this.credentials,res:u}}catch(i){if(!(i instanceof Error))throw i;let s=0,r="";throw i instanceof ygI.GaxiosError&&(s=(l=(n=(e=i?.response)===null||e===void 0?void 0:e.data)===null||n===void 0?void 0:n.error)===null||l===void 0?void 0:l.status,r=(c=(a=(I=i?.response)===null||I===void 0?void 0:I.data)===null||a===void 0?void 0:a.error)===null||c===void 0?void 0:c.message),s&&r?(i.message=`${s}: unable to impersonate: ${r}`,i):(i.message=`unable to impersonate: ${i}`,i)}}async fetchIdToken(e,n){var l,I;await this.sourceClient.getAccessToken();let a=`projects/-/serviceAccounts/${this.targetPrincipal}`,c=`${this.endpoint}/v1/${a}:generateIdToken`,i={delegates:this.delegates,audience:e,includeEmail:(l=n?.includeEmail)!==null&&l!==void 0?l:!0,useEmailAzp:(I=n?.includeEmail)!==null&&I!==void 0?I:!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:c,data:i,method:"POST"})).data.token}};XU.Impersonated=$De});var nKe=f(q6=>{"use strict";Object.defineProperty(q6,"__esModule",{value:!0});q6.OAuthClientAuthHandler=void 0;q6.getErrorFromOAuthErrorResponse=fgI;var mun=require("querystring"),FgI=NU(),vgI=["PUT","POST","PATCH"],tKe=class{constructor(e){this.clientAuthentication=e,this.crypto=(0,FgI.createCrypto)()}applyClientAuthenticationOptions(e,n){this.injectAuthenticatedHeaders(e,n),n||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,n){var l;if(n)e.headers=e.headers||{},Object.assign(e.headers,{Authorization:`Bearer ${n}}`});else if(((l=this.clientAuthentication)===null||l===void 0?void 0:l.confidentialClientType)==="basic"){e.headers=e.headers||{};let I=this.clientAuthentication.clientId,a=this.clientAuthentication.clientSecret||"",c=this.crypto.encodeBase64StringUtf8(`${I}:${a}`);Object.assign(e.headers,{Authorization:`Basic ${c}`})}}injectAuthenticatedRequestBody(e){var n;if(((n=this.clientAuthentication)===null||n===void 0?void 0:n.confidentialClientType)==="request-body"){let l=(e.method||"GET").toUpperCase();if(vgI.indexOf(l)!==-1){let I,a=e.headers||{};for(let c in a)if(c.toLowerCase()==="content-type"&&a[c]){I=a[c].toLowerCase();break}if(I==="application/x-www-form-urlencoded"){e.data=e.data||"";let c=mun.parse(e.data);Object.assign(c,{client_id:this.clientAuthentication.clientId,client_secret:this.clientAuthentication.clientSecret||""}),e.data=mun.stringify(c)}else if(I==="application/json")e.data=e.data||{},Object.assign(e.data,{client_id:this.clientAuthentication.clientId,client_secret:this.clientAuthentication.clientSecret||""});else throw new Error(`${I} content-types are not supported with ${this.clientAuthentication.confidentialClientType} client authentication`)}else throw new Error(`${l} HTTP method does not support ${this.clientAuthentication.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};q6.OAuthClientAuthHandler=tKe;function fgI(t,e){let n=t.error,l=t.error_description,I=t.error_uri,a=`Error code ${n}`;typeof l<"u"&&(a+=`: ${l}`),typeof I<"u"&&(a+=` - ${I}`);let c=new Error(a);if(e){let i=Object.keys(e);e.stack&&i.push("stack"),i.forEach(s=>{s!=="message"&&Object.defineProperty(c,s,{value:e[s],writable:!1,enumerable:!0})})}return c}});var IKe=f(WNe=>{"use strict";Object.defineProperty(WNe,"__esModule",{value:!0});WNe.StsCredentials=void 0;var XgI=dY(),wgI=require("querystring"),HgI=M6(),pun=nKe(),lKe=class t extends pun.OAuthClientAuthHandler{constructor(e,n){super(n),this.tokenExchangeEndpoint=e,this.transporter=new HgI.DefaultTransporter}async exchangeToken(e,n,l){var I,a,c;let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:(I=e.scope)===null||I===void 0?void 0:I.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:(a=e.actingParty)===null||a===void 0?void 0:a.actorToken,actor_token_type:(c=e.actingParty)===null||c===void 0?void 0:c.actorTokenType,options:l&&JSON.stringify(l)};Object.keys(i).forEach(u=>{typeof i[u]>"u"&&delete i[u]});let s={"Content-Type":"application/x-www-form-urlencoded"};Object.assign(s,n||{});let r={...t.RETRY_CONFIG,url:this.tokenExchangeEndpoint.toString(),method:"POST",headers:s,data:wgI.stringify(i),responseType:"json"};this.applyClientAuthenticationOptions(r);try{let u=await this.transporter.request(r),o=u.data;return o.res=u,o}catch(u){throw u instanceof XgI.GaxiosError&&u.response?(0,pun.getErrorFromOAuthErrorResponse)(u.response.data,u):u}}};WNe.StsCredentials=lKe});var zw=f(Kd=>{"use strict";var aKe=Kd&&Kd.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},hun=Kd&&Kd.__classPrivateFieldSet||function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},rKe,wU,Wun;Object.defineProperty(Kd,"__esModule",{value:!0});Kd.BaseExternalAccountClient=Kd.DEFAULT_UNIVERSE=Kd.CLOUD_RESOURCE_MANAGER=Kd.EXTERNAL_ACCOUNT_TYPE=Kd.EXPIRATION_TIME_OFFSET=void 0;var QgI=require("stream"),EgI=MR(),JgI=IKe(),Zun=jw(),CgI="urn:ietf:params:oauth:grant-type:token-exchange",LgI="urn:ietf:params:oauth:token-type:access_token",cKe="https://www.googleapis.com/auth/cloud-platform",kgI=3600;Kd.EXPIRATION_TIME_OFFSET=5*60*1e3;Kd.EXTERNAL_ACCOUNT_TYPE="external_account";Kd.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var xgI="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",jgI="https://sts.{universeDomain}/v1/token",OgI=hDe(),UgI=MR();Object.defineProperty(Kd,"DEFAULT_UNIVERSE",{enumerable:!0,get:function(){return UgI.DEFAULT_UNIVERSE}});var oKe=class t extends EgI.AuthClient{constructor(e,n){var l;super({...e,...n}),rKe.add(this),wU.set(this,null);let I=(0,Zun.originalOrCamelOptions)(e),a=I.get("type");if(a&&a!==Kd.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${Kd.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let c=I.get("client_id"),i=I.get("client_secret"),s=(l=I.get("token_url"))!==null&&l!==void 0?l:jgI.replace("{universeDomain}",this.universeDomain),r=I.get("subject_token_type"),u=I.get("workforce_pool_user_project"),o=I.get("service_account_impersonation_url"),d=I.get("service_account_impersonation"),b=(0,Zun.originalOrCamelOptions)(d).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(I.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),c&&(this.clientAuth={confidentialClientType:"basic",clientId:c,clientSecret:i}),this.stsCredential=new JgI.StsCredentials(s,this.clientAuth),this.scopes=I.get("scopes")||[cKe],this.cachedAccessToken=null,this.audience=I.get("audience"),this.subjectTokenType=r,this.workforcePoolUserProject=u;let h=new RegExp(xgI);if(this.workforcePoolUserProject&&!this.audience.match(h))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=o,this.serviceAccountImpersonationLifetime=b,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=kgI),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){var e;if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);let l=/serviceAccounts\/(?[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl);return((e=l?.groups)===null||e===void 0?void 0:e.email)||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let n={Authorization:`Bearer ${(await this.getAccessToken()).token}`};return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(l=>n(null,l),l=>n(l,l.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let n=await this.getRequestHeaders(),l=await this.transporter.request({...t.RETRY_CONFIG,headers:n,url:`${this.cloudResourceManagerURL.toString()}${e}`,responseType:"json"});return this.projectId=l.data.projectId,this.projectId}return null}async requestAsync(e,n=!1){let l;try{let I=await this.getRequestHeaders();e.headers=e.headers||{},I&&I["x-goog-user-project"]&&(e.headers["x-goog-user-project"]=I["x-goog-user-project"]),I&&I.Authorization&&(e.headers.Authorization=I.Authorization),l=await this.transporter.request(e)}catch(I){let a=I.response;if(a){let c=a.status,i=a.config.data instanceof QgI.Readable;if(!n&&(c===401||c===403)&&!i&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw I}return l}async refreshAccessTokenAsync(){hun(this,wU,aKe(this,wU,"f")||aKe(this,rKe,"m",Wun).call(this),"f");try{return await aKe(this,wU,"f")}finally{hun(this,wU,null,"f")}}getProjectNumber(e){let n=e.match(/\/projects\/([^/]+)/);return n?n[1]:null}async getImpersonatedAccessToken(e){let n={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"},responseType:"json"},l=await this.transporter.request(n),I=l.data;return{access_token:I.accessToken,expiry_date:new Date(I.expireTime).getTime(),res:l}}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[cKe]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),n=this.serviceAccountImpersonationUrl!==void 0,l=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${OgI.version} google-byoid-sdk source/${l} sa-impersonation/${n} config-lifetime/${this.configLifetimeRequested}`}};Kd.BaseExternalAccountClient=oKe;wU=new WeakMap,rKe=new WeakSet,Wun=async function(){let e=await this.retrieveSubjectToken(),n={grantType:CgI,audience:this.audience,requestedTokenType:LgI,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[cKe]:this.getScopesArray()},l=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,I={"x-goog-api-client":this.getMetricsHeaderValue()},a=await this.stsCredential.exchangeToken(n,I,l);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(a.access_token):a.expires_in?this.cachedAccessToken={access_token:a.access_token,expiry_date:new Date().getTime()+a.expires_in*1e3,res:a.res}:this.cachedAccessToken={access_token:a.access_token,res:a.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}});var Nun=f(NNe=>{"use strict";var iKe,sKe,uKe;Object.defineProperty(NNe,"__esModule",{value:!0});NNe.FileSubjectTokenSupplier=void 0;var GKe=require("util"),bKe=co(),zgI=(0,GKe.promisify)((iKe=bKe.readFile)!==null&&iKe!==void 0?iKe:()=>{}),BgI=(0,GKe.promisify)((sKe=bKe.realpath)!==null&&sKe!==void 0?sKe:()=>{}),SgI=(0,GKe.promisify)((uKe=bKe.lstat)!==null&&uKe!==void 0?uKe:()=>{}),dKe=class{constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(e){let n=this.filePath;try{if(n=await BgI(n),!(await SgI(n)).isFile())throw new Error}catch(a){throw a instanceof Error&&(a.message=`The file at ${n} does not exist, or it is not a file. ${a.message}`),a}let l,I=await zgI(n,{encoding:"utf8"});if(this.formatType==="text"?l=I:this.formatType==="json"&&this.subjectTokenFieldName&&(l=JSON.parse(I)[this.subjectTokenFieldName]),!l)throw new Error("Unable to parse the subject_token from the credential_source file");return l}};NNe.FileSubjectTokenSupplier=dKe});var Vun=f(VNe=>{"use strict";Object.defineProperty(VNe,"__esModule",{value:!0});VNe.UrlSubjectTokenSupplier=void 0;var mKe=class{constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let n={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers,responseType:this.formatType},l;if(this.formatType==="text"?l=(await e.transporter.request(n)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(l=(await e.transporter.request(n)).data[this.subjectTokenFieldName]),!l)throw new Error("Unable to parse the subject_token from the credential_source URL");return l}};VNe.UrlSubjectTokenSupplier=mKe});var ZKe=f(YNe=>{"use strict";Object.defineProperty(YNe,"__esModule",{value:!0});YNe.IdentityPoolClient=void 0;var MgI=zw(),pKe=jw(),TgI=Nun(),DgI=Vun(),hKe=class t extends MgI.BaseExternalAccountClient{constructor(e,n){super(e,n);let l=(0,pKe.originalOrCamelOptions)(e),I=l.get("credential_source"),a=l.get("subject_token_supplier");if(!I&&!a)throw new Error("A credential source or subject token supplier must be specified.");if(I&&a)throw new Error("Only one of credential source or subject token supplier can be specified.");if(a)this.subjectTokenSupplier=a,this.credentialSourceType="programmatic";else{let c=(0,pKe.originalOrCamelOptions)(I),i=(0,pKe.originalOrCamelOptions)(c.get("format")),s=i.get("type")||"text",r=i.get("subject_token_field_name");if(s!=="json"&&s!=="text")throw new Error(`Invalid credential_source format "${s}"`);if(s==="json"&&!r)throw new Error("Missing subject_token_field_name for JSON credential_source format");let u=c.get("file"),o=c.get("url"),d=c.get("headers");if(u&&o)throw new Error('No valid Identity Pool "credential_source" provided, must be either file or url.');if(u&&!o)this.credentialSourceType="file",this.subjectTokenSupplier=new TgI.FileSubjectTokenSupplier({filePath:u,formatType:s,subjectTokenFieldName:r});else if(!u&&o)this.credentialSourceType="url",this.subjectTokenSupplier=new DgI.UrlSubjectTokenSupplier({url:o,formatType:s,subjectTokenFieldName:r,headers:d,additionalGaxiosOptions:t.RETRY_CONFIG});else throw new Error('No valid Identity Pool "credential_source" provided, must be either file or url.')}}async retrieveSubjectToken(){return this.subjectTokenSupplier.getSubjectToken(this.supplierContext)}};YNe.IdentityPoolClient=hKe});var NKe=f(gNe=>{"use strict";Object.defineProperty(gNe,"__esModule",{value:!0});gNe.AwsRequestSigner=void 0;var gun=NU(),Yun="AWS4-HMAC-SHA256",KgI="aws4_request",WKe=class{constructor(e,n){this.getCredentials=e,this.region=n,this.crypto=(0,gun.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new Error('"url" is required in "amzOptions"');let n=typeof e.data=="object"?JSON.stringify(e.data):e.data,l=e.url,I=e.method||"GET",a=e.body||n,c=e.headers,i=await this.getCredentials(),s=new URL(l),r=await PgI({crypto:this.crypto,host:s.host,canonicalUri:s.pathname,canonicalQuerystring:s.search.substr(1),method:I,region:this.region,securityCredentials:i,requestPayload:a,additionalAmzHeaders:c}),u=Object.assign(r.amzDate?{"x-amz-date":r.amzDate}:{},{Authorization:r.authorizationHeader,host:s.host},c||{});i.token&&Object.assign(u,{"x-amz-security-token":i.token});let o={url:l,method:I,headers:u};return typeof a<"u"&&(o.body=a),o}};gNe.AwsRequestSigner=WKe;async function $6(t,e,n){return await t.signWithHmacSha256(e,n)}async function _gI(t,e,n,l,I){let a=await $6(t,`AWS4${e}`,n),c=await $6(t,a,l),i=await $6(t,c,I);return await $6(t,i,"aws4_request")}async function PgI(t){let e=t.additionalAmzHeaders||{},n=t.requestPayload||"",l=t.host.split(".")[0],I=new Date,a=I.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=I.toISOString().replace(/[-]/g,"").replace(/T.*/,""),i={};Object.keys(e).forEach(X=>{i[X.toLowerCase()]=e[X]}),t.securityCredentials.token&&(i["x-amz-security-token"]=t.securityCredentials.token);let s=Object.assign({host:t.host},i.date?{}:{"x-amz-date":a},i),r="",u=Object.keys(s).sort();u.forEach(X=>{r+=`${X}:${s[X]} +`});let o=u.join(";"),d=await t.crypto.sha256DigestHex(n),b=`${t.method} +${t.canonicalUri} +${t.canonicalQuerystring} +${r} +${o} +${d}`,h=`${c}/${t.region}/${l}/${KgI}`,Z=`${Yun} +${a} +${h} +`+await t.crypto.sha256DigestHex(b),N=await _gI(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,l),g=await $6(t.crypto,N,Z),y=`${Yun} Credential=${t.securityCredentials.accessKeyId}/${h}, SignedHeaders=${o}, Signature=${(0,gun.fromArrayBufferToHex)(g)}`;return{amzDate:i.date?void 0:a,authorizationHeader:y,canonicalQuerystring:t.canonicalQuerystring}}});var Aun=f(HU=>{"use strict";var l2=HU&&HU.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},NY,VKe,Run,yun,RNe,YKe;Object.defineProperty(HU,"__esModule",{value:!0});HU.DefaultAwsSecurityCredentialsSupplier=void 0;var gKe=class{constructor(e){NY.add(this),this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(l2(this,NY,"a",RNe))return l2(this,NY,"a",RNe);let n={};if(!l2(this,NY,"a",RNe)&&this.imdsV2SessionTokenUrl&&(n["x-aws-ec2-metadata-token"]=await l2(this,NY,"m",VKe).call(this,e.transporter)),!this.regionUrl)throw new Error('Unable to determine AWS region due to missing "options.credential_source.region_url"');let l={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",responseType:"text",headers:n},I=await e.transporter.request(l);return I.data.substr(0,I.data.length-1)}async getAwsSecurityCredentials(e){if(l2(this,NY,"a",YKe))return l2(this,NY,"a",YKe);let n={};this.imdsV2SessionTokenUrl&&(n["x-aws-ec2-metadata-token"]=await l2(this,NY,"m",VKe).call(this,e.transporter));let l=await l2(this,NY,"m",Run).call(this,n,e.transporter),I=await l2(this,NY,"m",yun).call(this,l,n,e.transporter);return{accessKeyId:I.AccessKeyId,secretAccessKey:I.SecretAccessKey,token:I.Token}}};HU.DefaultAwsSecurityCredentialsSupplier=gKe;NY=new WeakSet,VKe=async function(e){let n={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return(await e.request(n)).data},Run=async function(e,n){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let l={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:e};return(await n.request(l)).data},yun=async function(e,n,l){return(await l.request({...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,responseType:"json",headers:n})).data},RNe=function(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null},YKe=function(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}});var RKe=f(EU=>{"use strict";var qgI=EU&&EU.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},yNe,vun;Object.defineProperty(EU,"__esModule",{value:!0});EU.AwsClient=void 0;var $gI=NKe(),eRI=zw(),tRI=Aun(),Fun=jw(),QU=class extends eRI.BaseExternalAccountClient{constructor(e,n){super(e,n);let l=(0,Fun.originalOrCamelOptions)(e),I=l.get("credential_source"),a=l.get("aws_security_credentials_supplier");if(!I&&!a)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(I&&a)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(a)this.awsSecurityCredentialsSupplier=a,this.regionalCredVerificationUrl=qgI(yNe,yNe,"f",vun),this.credentialSourceType="programmatic";else{let c=(0,Fun.originalOrCamelOptions)(I);this.environmentId=c.get("environment_id");let i=c.get("region_url"),s=c.get("url"),r=c.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new tRI.DefaultAwsSecurityCredentialsSupplier({regionUrl:i,securityCredentialsUrl:s,imdsV2SessionTokenUrl:r}),this.regionalCredVerificationUrl=c.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){var e;let n=(e=this.environmentId)===null||e===void 0?void 0:e.match(/^(aws)(\d+)$/);if(!n||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(n[2],10)!==1)throw new Error(`aws version "${n[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new $gI.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...yNe.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),n=[],l=Object.assign({"x-goog-cloud-target-resource":this.audience},e.headers);for(let I in l)n.push({key:I,value:l[I]});return encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:n}))}};EU.AwsClient=QU;yNe=QU;vun={value:"https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15"};QU.AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";QU.AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254"});var fKe=f(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.InvalidSubjectTokenError=Su.InvalidMessageFieldError=Su.InvalidCodeFieldError=Su.InvalidTokenTypeFieldError=Su.InvalidExpirationTimeFieldError=Su.InvalidSuccessFieldError=Su.InvalidVersionFieldError=Su.ExecutableResponseError=Su.ExecutableResponse=void 0;var ANe="urn:ietf:params:oauth:token-type:saml2",yKe="urn:ietf:params:oauth:token-type:id_token",AKe="urn:ietf:params:oauth:token-type:jwt",FKe=class{constructor(e){if(!e.version)throw new FNe("Executable response must contain a 'version' field.");if(e.success===void 0)throw new vNe("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==ANe&&this.tokenType!==yKe&&this.tokenType!==AKe)throw new fNe(`Executable response must contain a 'token_type' field when successful and it must be one of ${yKe}, ${AKe}, or ${ANe}.`);if(this.tokenType===ANe){if(!e.saml_response)throw new eq(`Executable response must contain a 'saml_response' field when token_type=${ANe}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new eq(`Executable response must contain a 'id_token' field when token_type=${yKe} or ${AKe}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new XNe("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new wNe("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime{"use strict";Object.defineProperty(HNe,"__esModule",{value:!0});HNe.PluggableAuthHandler=void 0;var nRI=QNe(),aC=fKe(),lRI=require("child_process"),XKe=co(),wKe=class t{constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((n,l)=>{let I=lRI.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),a="";I.stdout.on("data",i=>{a+=i}),I.stderr.on("data",i=>{a+=i});let c=setTimeout(()=>(I.removeAllListeners(),I.kill(),l(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);I.on("close",i=>{if(clearTimeout(c),i===0)try{let s=JSON.parse(a),r=new aC.ExecutableResponse(s);return n(r)}catch(s){return s instanceof aC.ExecutableResponseError?l(s):l(new aC.ExecutableResponseError(`The executable returned an invalid response: ${a}`))}else return l(new nRI.ExecutableError(a,i.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await XKe.promises.realpath(this.outputFile)}catch{return}if(!(await XKe.promises.lstat(e)).isFile())return;let n=await XKe.promises.readFile(e,{encoding:"utf8"});if(n!=="")try{let l=JSON.parse(n);return new aC.ExecutableResponse(l).isValid()?new aC.ExecutableResponse(l):void 0}catch(l){throw l instanceof aC.ExecutableResponseError?l:new aC.ExecutableResponseError(`The output file contained an invalid response: ${n}`)}}static parseCommand(e){let n=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!n)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let l=0;l{"use strict";Object.defineProperty(JU,"__esModule",{value:!0});JU.PluggableAuthClient=JU.ExecutableError=void 0;var IRI=zw(),aRI=fKe(),rRI=fun(),ENe=class extends Error{constructor(e,n){super(`The executable failed with exit code: ${n} and error message: ${e}.`),this.code=n,Object.setPrototypeOf(this,new.target.prototype)}};JU.ExecutableError=ENe;var cRI=30*1e3,Xun=5*1e3,wun=120*1e3,oRI="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",Hun=1,HKe=class extends IRI.BaseExternalAccountClient{constructor(e,n){if(super(e,n),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=cRI;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMilliswun)throw new Error(`Timeout must be between ${Xun} and ${wun} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new rRI.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[oRI]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let n=new Map;n.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),n.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),n.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&n.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let l=this.getServiceAccountEmail();l&&n.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",l),e=await this.handler.retrieveResponseFromExecutable(n)}if(e.version>Hun)throw new Error(`Version of executable is not currently supported, maximum supported version is ${Hun}.`);if(!e.success)throw new ENe(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new aRI.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};JU.PluggableAuthClient=HKe});var EKe=f(JNe=>{"use strict";Object.defineProperty(JNe,"__esModule",{value:!0});JNe.ExternalAccountClient=void 0;var iRI=zw(),sRI=ZKe(),uRI=RKe(),dRI=QNe(),QKe=class{constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e,n){var l,I;return e&&e.type===iRI.EXTERNAL_ACCOUNT_TYPE?!((l=e.credential_source)===null||l===void 0)&&l.environment_id?new uRI.AwsClient(e,n):!((I=e.credential_source)===null||I===void 0)&&I.executable?new dRI.PluggableAuthClient(e,n):new sRI.IdentityPoolClient(e,n):null}};JNe.ExternalAccountClient=QKe});var Eun=f(CU=>{"use strict";Object.defineProperty(CU,"__esModule",{value:!0});CU.ExternalAccountAuthorizedUserClient=CU.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var GRI=MR(),Qun=nKe(),bRI=dY(),mRI=require("stream"),pRI=zw();CU.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var hRI="https://sts.{universeDomain}/v1/oauthtoken",JKe=class t extends Qun.OAuthClientAuthHandler{constructor(e,n,l){super(l),this.url=e,this.transporter=n}async refreshToken(e,n){let l=new URLSearchParams({grant_type:"refresh_token",refresh_token:e}),I={"Content-Type":"application/x-www-form-urlencoded",...n},a={...t.RETRY_CONFIG,url:this.url,method:"POST",headers:I,data:l.toString(),responseType:"json"};this.applyClientAuthenticationOptions(a);try{let c=await this.transporter.request(a),i=c.data;return i.res=c,i}catch(c){throw c instanceof bRI.GaxiosError&&c.response?(0,Qun.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}},CKe=class extends GRI.AuthClient{constructor(e,n){var l;super({...e,...n}),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let I={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new JKe((l=e.token_url)!==null&&l!==void 0?l:hRI.replace("{universeDomain}",this.universeDomain),this.transporter,I),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof n?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=pRI.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=n.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!n?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let n={Authorization:`Bearer ${(await this.getAccessToken()).token}`};return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(l=>n(null,l),l=>n(l,l.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){let l;try{let I=await this.getRequestHeaders();e.headers=e.headers||{},I&&I["x-goog-user-project"]&&(e.headers["x-goog-user-project"]=I["x-goog-user-project"]),I&&I.Authorization&&(e.headers.Authorization=I.Authorization),l=await this.transporter.request(e)}catch(I){let a=I.response;if(a){let c=a.status,i=a.config.data instanceof mRI.Readable;if(!n&&(c===401||c===403)&&!i&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw I}return l}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};CU.ExternalAccountAuthorizedUserClient=CKe});var jun=f(zG=>{"use strict";var Bw=zG&&zG.__classPrivateFieldGet||function(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)},Jun=zG&&zG.__classPrivateFieldSet||function(t,e,n,l,I){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!I:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?I.call(t,n):I?I.value=n:e.set(t,n),n},Sw,xU,jU,xun;Object.defineProperty(zG,"__esModule",{value:!0});zG.GoogleAuth=zG.GoogleAuthExceptionMessages=zG.CLOUD_SDK_CLIENT_ID=void 0;var ZRI=require("child_process"),lq=co(),tq=B6(),WRI=require("os"),kKe=Ca(),NRI=NU(),VRI=M6(),YRI=XDe(),gRI=HDe(),RRI=QDe(),LU=_De(),Cun=qDe(),kU=eKe(),yRI=EKe(),nq=zw(),LKe=MR(),Lun=Eun(),kun=jw();zG.CLOUD_SDK_CLIENT_ID="764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com";zG.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment. +To learn more about authentication and Google APIs, visit: +https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment. +To learn more about authentication and Google APIs, visit: +https://cloud.google.com/docs/authentication/getting-started`,NO_ADC_FOUND:"Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.",NO_UNIVERSE_DOMAIN_FOUND:`Unable to detect a Universe Domain in the current environment. +To learn more about Universe Domain retrieval, visit: +https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var CNe=class{get isGCE(){return this.checkIsGCE}constructor(e={}){if(Sw.add(this),this.checkIsGCE=void 0,this.jsonContent=null,this.cachedCredential=null,xU.set(this,null),this.clientOptions={},this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(zG.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(n=>e(null,n),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===zG.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||(e=await this.getProductionProjectId()),e||(e=await this.getFileProjectId()),e||(e=await this.getDefaultServiceProjectId()),e||(e=await this.getGCEProjectId()),e||(e=await this.getExternalAccountClientProjectId()),e)return this._cachedProjectId=e,e;throw new Error(zG.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){var e;let n;try{n=await tq.universe("universe-domain"),n||(n=LKe.DEFAULT_UNIVERSE)}catch(l){if(l&&((e=l?.response)===null||e===void 0?void 0:e.status)===404)n=LKe.DEFAULT_UNIVERSE;else throw l}return n}async getUniverseDomain(){let e=(0,kun.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??(e=(await this.getClient()).universeDomain)}catch{e??(e=LKe.DEFAULT_UNIVERSE)}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},n){let l;if(typeof e=="function"?n=e:l=e,n)this.getApplicationDefaultAsync(l).then(I=>n(null,I.credential,I.projectId),n);else return this.getApplicationDefaultAsync(l)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await Bw(this,Sw,"m",jU).call(this,this.cachedCredential,null);let n;if(n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),n)return n instanceof LU.JWT?n.scopes=this.scopes:n instanceof nq.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await Bw(this,Sw,"m",jU).call(this,n);if(n=await this._tryGetApplicationCredentialsFromWellKnownFile(e),n)return n instanceof LU.JWT?n.scopes=this.scopes:n instanceof nq.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await Bw(this,Sw,"m",jU).call(this,n);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await Bw(this,Sw,"m",jU).call(this,new YRI.Compute(e));throw new Error(zG.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=tq.getGCPResidency()||await tq.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let n=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!n||n.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(n,e)}catch(l){throw l instanceof Error&&(l.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${l.message}`),l}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let n=null;if(this._isWindows())n=process.env.APPDATA;else{let I=process.env.HOME;I&&(n=kKe.join(I,".config"))}return n&&(n=kKe.join(n,"gcloud","application_default_credentials.json"),lq.existsSync(n)||(n=null)),n?await this._getApplicationCredentialsFromFilePath(n,e):null}async _getApplicationCredentialsFromFilePath(e,n={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=lq.realpathSync(e),!lq.lstatSync(e).isFile())throw new Error}catch(I){throw I instanceof Error&&(I.message=`The file at ${e} does not exist, or it is not a file. ${I.message}`),I}let l=lq.createReadStream(e);return this.fromStream(l,n)}fromImpersonatedJSON(e){var n,l,I,a;if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==kU.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${kU.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let c=this.fromJSON(e.source_credentials);if(((n=e.service_account_impersonation_url)===null||n===void 0?void 0:n.length)>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let i=(I=(l=/(?[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url))===null||l===void 0?void 0:l.groups)===null||I===void 0?void 0:I.target;if(!i)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let s=(a=this.getAnyScopes())!==null&&a!==void 0?a:[];return new kU.Impersonated({...e,sourceClient:c,targetPrincipal:i,targetScopes:Array.isArray(s)?s:[s]})}fromJSON(e,n={}){let l,I=(0,kun.originalOrCamelOptions)(n).get("universe_domain");return e.type===Cun.USER_REFRESH_ACCOUNT_TYPE?(l=new Cun.UserRefreshClient(n),l.fromJSON(e)):e.type===kU.IMPERSONATED_ACCOUNT_TYPE?l=this.fromImpersonatedJSON(e):e.type===nq.EXTERNAL_ACCOUNT_TYPE?(l=yRI.ExternalAccountClient.fromJSON(e,n),l.scopes=this.getAnyScopes()):e.type===Lun.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?l=new Lun.ExternalAccountAuthorizedUserClient(e,n):(n.scopes=this.scopes,l=new LU.JWT(n),this.setGapicJWTValues(l),l.fromJSON(e)),I&&(l.universeDomain=I),l}_cacheClientFromJSON(e,n){let l=this.fromJSON(e,n);return this.jsonContent=e,this.cachedCredential=l,l}fromStream(e,n={},l){let I={};if(typeof n=="function"?l=n:I=n,l)this.fromStreamAsync(e,I).then(a=>l(null,a),l);else return this.fromStreamAsync(e,I)}fromStreamAsync(e,n){return new Promise((l,I)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let a=[];e.setEncoding("utf8").on("error",I).on("data",c=>a.push(c)).on("end",()=>{try{try{let c=JSON.parse(a.join("")),i=this._cacheClientFromJSON(c,n);return l(i)}catch(c){if(!this.keyFilename)throw c;let i=new LU.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=i,this.setGapicJWTValues(i),l(i)}}catch(c){return I(c)}})})}fromAPIKey(e,n={}){return new LU.JWT({...n,apiKey:e})}_isWindows(){let e=WRI.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,ZRI.exec)("gcloud config config-helper --format json",(n,l)=>{if(!n&&l)try{let I=JSON.parse(l).configuration.properties.core.project;e(I);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let n=await this.getClient();if(n&&n.projectId)return n.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==nq.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await tq.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(n=>e(null,n),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof kU.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof nq.BaseExternalAccountClient){let n=e.getServiceAccountEmail();if(n)return{client_email:n,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[n,l]=await Promise.all([tq.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:n,universe_domain:l}}throw new Error(zG.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;Jun(this,xU,Bw(this,xU,"f")||Bw(this,Sw,"m",xun).call(this),"f");try{return await Bw(this,xU,"f")}finally{Jun(this,xU,null,"f")}}async getIdTokenClient(e){let n=await this.getClient();if(!("fetchIdToken"in n))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new gRI.IdTokenClient({targetAudience:e,idTokenProvider:n})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e){e=e||{};let n=e.url||e.uri,I=await(await this.getClient()).getRequestHeaders(n);return e.headers=Object.assign(e.headers||{},I),e}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,RRI.getEnv)()}async sign(e,n){let l=await this.getClient(),I=await this.getUniverseDomain();if(n=n||`https://iamcredentials.${I}/v1/projects/-/serviceAccounts/`,l instanceof kU.Impersonated)return(await l.sign(e)).signedBlob;let a=(0,NRI.createCrypto)();if(l instanceof LU.JWT&&l.key)return await a.sign(l.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(a,c.client_email,e,n)}async signBlob(e,n,l,I){let a=new URL(I+`${n}:signBlob`);return(await this.request({method:"POST",url:a.href,data:{payload:e.encodeBase64StringUtf8(l)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};zG.GoogleAuth=CNe;xU=new WeakMap,Sw=new WeakSet,jU=async function(e,n=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let l=await this.getProjectIdOptional();return n&&(e.quotaProjectId=n),this.cachedCredential=e,{credential:e,projectId:l}},xun=async function(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=kKe.resolve(this.keyFilename),n=lq.createReadStream(e);return await this.fromStreamAsync(n,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:n}=await Bw(this,Sw,"m",jU).call(this,e);return n}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}};CNe.DefaultTransporter=VRI.DefaultTransporter});var Oun=f(LNe=>{"use strict";Object.defineProperty(LNe,"__esModule",{value:!0});LNe.IAMAuth=void 0;var xKe=class{constructor(e,n){this.selector=e,this.token=n,this.selector=e,this.token=n}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};LNe.IAMAuth=xKe});var Uun=f(KR=>{"use strict";Object.defineProperty(KR,"__esModule",{value:!0});KR.DownscopedClient=KR.EXPIRATION_TIME_OFFSET=KR.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var ARI=require("stream"),FRI=MR(),vRI=IKe(),fRI="urn:ietf:params:oauth:grant-type:token-exchange",XRI="urn:ietf:params:oauth:token-type:access_token",wRI="urn:ietf:params:oauth:token-type:access_token";KR.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;KR.EXPIRATION_TIME_OFFSET=5*60*1e3;var jKe=class extends FRI.AuthClient{constructor(e,n,l,I){if(super({...l,quotaProjectId:I}),this.authClient=e,this.credentialAccessBoundary=n,n.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(n.accessBoundary.accessBoundaryRules.length>KR.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${KR.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let a of n.accessBoundary.accessBoundaryRules)if(a.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new vRI.StsCredentials(`https://sts.${this.universeDomain}/v1/token`),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let n={Authorization:`Bearer ${(await this.getAccessToken()).token}`};return this.addSharedMetadataHeaders(n)}request(e,n){if(n)this.requestAsync(e).then(l=>n(null,l),l=>n(l,l.response));else return this.requestAsync(e)}async requestAsync(e,n=!1){let l;try{let I=await this.getRequestHeaders();e.headers=e.headers||{},I&&I["x-goog-user-project"]&&(e.headers["x-goog-user-project"]=I["x-goog-user-project"]),I&&I.Authorization&&(e.headers.Authorization=I.Authorization),l=await this.transporter.request(e)}catch(I){let a=I.response;if(a){let c=a.status,i=a.config.data instanceof ARI.Readable;if(!n&&(c===401||c===403)&&!i&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw I}return l}async refreshAccessTokenAsync(){var e;let n=(await this.authClient.getAccessToken()).token,l={grantType:fRI,requestedTokenType:XRI,subjectToken:n,subjectTokenType:wRI},I=await this.stsCredential.exchangeToken(l,void 0,this.credentialAccessBoundary),a=((e=this.authClient.credentials)===null||e===void 0?void 0:e.expiry_date)||null,c=I.expires_in?new Date().getTime()+I.expires_in*1e3:a;return this.cachedDownscopedAccessToken={access_token:I.access_token,expiry_date:c,res:I.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let n=new Date().getTime();return e.expiry_date?n>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};KR.DownscopedClient=jKe});var zun=f(xNe=>{"use strict";Object.defineProperty(xNe,"__esModule",{value:!0});xNe.PassThroughClient=void 0;var HRI=MR(),kNe=class extends HRI.AuthClient{async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return{}}};xNe.PassThroughClient=kNe;var QRI=new kNe;QRI.getAccessToken()});var UKe=f(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.GoogleAuth=nn.auth=nn.DefaultTransporter=nn.PassThroughClient=nn.ExecutableError=nn.PluggableAuthClient=nn.DownscopedClient=nn.BaseExternalAccountClient=nn.ExternalAccountClient=nn.IdentityPoolClient=nn.AwsRequestSigner=nn.AwsClient=nn.UserRefreshClient=nn.LoginTicket=nn.ClientAuthentication=nn.OAuth2Client=nn.CodeChallengeMethod=nn.Impersonated=nn.JWT=nn.JWTAccess=nn.IdTokenClient=nn.IAMAuth=nn.GCPEnv=nn.Compute=nn.DEFAULT_UNIVERSE=nn.AuthClient=nn.gaxios=nn.gcpMetadata=void 0;var Bun=jun();Object.defineProperty(nn,"GoogleAuth",{enumerable:!0,get:function(){return Bun.GoogleAuth}});nn.gcpMetadata=B6();nn.gaxios=dY();var Sun=MR();Object.defineProperty(nn,"AuthClient",{enumerable:!0,get:function(){return Sun.AuthClient}});Object.defineProperty(nn,"DEFAULT_UNIVERSE",{enumerable:!0,get:function(){return Sun.DEFAULT_UNIVERSE}});var ERI=XDe();Object.defineProperty(nn,"Compute",{enumerable:!0,get:function(){return ERI.Compute}});var JRI=QDe();Object.defineProperty(nn,"GCPEnv",{enumerable:!0,get:function(){return JRI.GCPEnv}});var CRI=Oun();Object.defineProperty(nn,"IAMAuth",{enumerable:!0,get:function(){return CRI.IAMAuth}});var LRI=HDe();Object.defineProperty(nn,"IdTokenClient",{enumerable:!0,get:function(){return LRI.IdTokenClient}});var kRI=DDe();Object.defineProperty(nn,"JWTAccess",{enumerable:!0,get:function(){return kRI.JWTAccess}});var xRI=_De();Object.defineProperty(nn,"JWT",{enumerable:!0,get:function(){return xRI.JWT}});var jRI=eKe();Object.defineProperty(nn,"Impersonated",{enumerable:!0,get:function(){return jRI.Impersonated}});var OKe=lC();Object.defineProperty(nn,"CodeChallengeMethod",{enumerable:!0,get:function(){return OKe.CodeChallengeMethod}});Object.defineProperty(nn,"OAuth2Client",{enumerable:!0,get:function(){return OKe.OAuth2Client}});Object.defineProperty(nn,"ClientAuthentication",{enumerable:!0,get:function(){return OKe.ClientAuthentication}});var ORI=ADe();Object.defineProperty(nn,"LoginTicket",{enumerable:!0,get:function(){return ORI.LoginTicket}});var URI=qDe();Object.defineProperty(nn,"UserRefreshClient",{enumerable:!0,get:function(){return URI.UserRefreshClient}});var zRI=RKe();Object.defineProperty(nn,"AwsClient",{enumerable:!0,get:function(){return zRI.AwsClient}});var BRI=NKe();Object.defineProperty(nn,"AwsRequestSigner",{enumerable:!0,get:function(){return BRI.AwsRequestSigner}});var SRI=ZKe();Object.defineProperty(nn,"IdentityPoolClient",{enumerable:!0,get:function(){return SRI.IdentityPoolClient}});var MRI=EKe();Object.defineProperty(nn,"ExternalAccountClient",{enumerable:!0,get:function(){return MRI.ExternalAccountClient}});var TRI=zw();Object.defineProperty(nn,"BaseExternalAccountClient",{enumerable:!0,get:function(){return TRI.BaseExternalAccountClient}});var DRI=Uun();Object.defineProperty(nn,"DownscopedClient",{enumerable:!0,get:function(){return DRI.DownscopedClient}});var Mun=QNe();Object.defineProperty(nn,"PluggableAuthClient",{enumerable:!0,get:function(){return Mun.PluggableAuthClient}});Object.defineProperty(nn,"ExecutableError",{enumerable:!0,get:function(){return Mun.ExecutableError}});var KRI=zun();Object.defineProperty(nn,"PassThroughClient",{enumerable:!0,get:function(){return KRI.PassThroughClient}});var _RI=M6();Object.defineProperty(nn,"DefaultTransporter",{enumerable:!0,get:function(){return _RI.DefaultTransporter}});var PRI=new Bun.GoogleAuth;nn.auth=PRI});var jNe=f(OU=>{"use strict";Object.defineProperty(OU,"__esModule",{value:!0});OU.bytesFromProto3JSON=OU.bytesToProto3JSON=void 0;function qRI(t){return Buffer.isBuffer(t)?t.toString("base64"):Buffer.from(t.buffer,0,t.byteLength).toString("base64")}OU.bytesToProto3JSON=qRI;function $RI(t){return Buffer.from(t,"base64")}OU.bytesFromProto3JSON=$RI});var zKe=f(UU=>{"use strict";Object.defineProperty(UU,"__esModule",{value:!0});UU.resolveEnumValueToNumber=UU.resolveEnumValueToString=void 0;function eyI(t,e){if(typeof e=="number"){let n=t.valuesById[e];return typeof n>"u"?e:n}if(typeof e=="string")return e;throw new Error("resolveEnumValueToString: enum value must be a string or a number")}UU.resolveEnumValueToString=eyI;function tyI(t,e){if(typeof e=="number")return e;if(typeof e=="string"){let n=t.values[e];return typeof n>"u"?e:n}throw new Error("resolveEnumValueToNumber: enum value must be a string or a number")}UU.resolveEnumValueToNumber=tyI});var Iq=f(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});Mw.assert=Mw.wrapperTypes=Mw.getFullyQualifiedTypeName=void 0;function nyI(t){let e="";for(;t.parent;)e=`.${t.name}${e}`,t=t.parent;return e}Mw.getFullyQualifiedTypeName=nyI;Mw.wrapperTypes=new Set([".google.protobuf.DoubleValue",".google.protobuf.FloatValue",".google.protobuf.Int64Value",".google.protobuf.UInt64Value",".google.protobuf.Int32Value",".google.protobuf.UInt32Value",".google.protobuf.BoolValue",".google.protobuf.StringValue",".google.protobuf.BytesValue"]);function lyI(t,e){if(!t)throw new Error(e)}Mw.assert=lyI});var MKe=f(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.googleProtobufValueFromProto3JSON=Kp.googleProtobufListValueFromProto3JSON=Kp.googleProtobufStructFromProto3JSON=Kp.googleProtobufValueToProto3JSON=Kp.googleProtobufListValueToProto3JSON=Kp.googleProtobufStructToProto3JSON=void 0;var IyI=Iq();function Tun(t){let e={},n=t.fields;for(let[l,I]of Object.entries(n))e[l]=BKe(I);return e}Kp.googleProtobufStructToProto3JSON=Tun;function Dun(t){return(0,IyI.assert)(Array.isArray(t.values),"ListValue internal representation must contain array of values"),t.values.map(BKe)}Kp.googleProtobufListValueToProto3JSON=Dun;function BKe(t){return Object.prototype.hasOwnProperty.call(t,"nullValue")?null:Object.prototype.hasOwnProperty.call(t,"numberValue")&&typeof t.numberValue=="number"?Number.isFinite(t.numberValue)?t.numberValue:t.numberValue.toString():Object.prototype.hasOwnProperty.call(t,"stringValue")&&typeof t.stringValue=="string"?t.stringValue:Object.prototype.hasOwnProperty.call(t,"boolValue")&&typeof t.boolValue=="boolean"?t.boolValue:Object.prototype.hasOwnProperty.call(t,"structValue")&&typeof t.structValue=="object"?Tun(t.structValue):Object.prototype.hasOwnProperty.call(t,"listValue")&&typeof t=="object"&&typeof t.listValue=="object"?Dun(t.listValue):null}Kp.googleProtobufValueToProto3JSON=BKe;function Kun(t){let e={};for(let[n,l]of Object.entries(t))e[n]=SKe(l);return{fields:e}}Kp.googleProtobufStructFromProto3JSON=Kun;function _un(t){return{values:t.map(e=>SKe(e))}}Kp.googleProtobufListValueFromProto3JSON=_un;function SKe(t){if(t===null)return{nullValue:"NULL_VALUE"};if(typeof t=="number")return{numberValue:t};if(typeof t=="string")return{stringValue:t};if(typeof t=="boolean")return{boolValue:t};if(Array.isArray(t))return{listValue:_un(t)};if(typeof t=="object")return{structValue:Kun(t)};throw new Error(`googleProtobufValueFromProto3JSON: incorrect parameter type: ${typeof t}`)}Kp.googleProtobufValueFromProto3JSON=SKe});var TKe=f(zU=>{"use strict";Object.defineProperty(zU,"__esModule",{value:!0});zU.googleProtobufDurationFromProto3JSON=zU.googleProtobufDurationToProto3JSON=void 0;function ayI(t){let e=t.seconds.toString();if(typeof t.nanos=="number"&&t.nanos>0){let n=t.nanos.toString().padStart(9,"0").replace(/^((?:\d\d\d)+?)(?:0*)$/,"$1");e+="."+n}return e+="s",e}zU.googleProtobufDurationToProto3JSON=ayI;function ryI(t){let e=t.match(/^(\d*)(?:\.(\d*))?s$/);if(!e)throw new Error(`googleProtobufDurationFromProto3JSON: incorrect value ${t} passed as google.protobuf.Duration`);let n=0,l=0;typeof e[1]=="string"&&e[1].length>0&&(n=parseInt(e[1])),typeof e[2]=="string"&&e[2].length>0&&(l=parseInt(e[2].padEnd(9,"0")));let I={};return n!==0&&(I.seconds=n),l!==0&&(I.nanos=l),I}zU.googleProtobufDurationFromProto3JSON=ryI});var DKe=f(BU=>{"use strict";Object.defineProperty(BU,"__esModule",{value:!0});BU.googleProtobufTimestampFromProto3JSON=BU.googleProtobufTimestampToProto3JSON=void 0;function cyI(t){var e;let n=t.seconds,l=new Date(n*1e3).toISOString(),I=(e=t.nanos)===null||e===void 0?void 0:e.toString().padStart(9,"0");for(;I&&I.length>3&&I.endsWith("000");)I=I.slice(0,-3);return l.replace(/(?:\.\d{0,9})/,"."+I)}BU.googleProtobufTimestampToProto3JSON=cyI;function oyI(t){if(!t.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?/))throw new Error(`googleProtobufDurationFromProto3JSON: incorrect value ${t} passed as google.protobuf.Duration`);let l=new Date(t).getTime(),I=Math.floor(l/1e3),a=0,c=t.split(".")[1];c&&(a=parseInt(c.slice(0,-1).padEnd(9,"0")));let i={};return I!==0&&(i.seconds=I),a!==0&&(i.nanos=a),i}BU.googleProtobufTimestampFromProto3JSON=oyI});var KKe=f(SU=>{"use strict";Object.defineProperty(SU,"__esModule",{value:!0});SU.wrapperFromProto3JSON=SU.wrapperToProto3JSON=void 0;var Pun=jNe(),iyI=Iq();function syI(t){return Object.prototype.hasOwnProperty.call(t,"value")?Buffer.isBuffer(t.value)||t.value instanceof Uint8Array?(0,Pun.bytesToProto3JSON)(t.value):typeof t.value=="object"?((0,iyI.assert)(t.value.constructor.name==="Long",`wrapperToProto3JSON: expected to see a number, a string, a boolean, or a Long, but got ${t.value}`),t.value.toString()):typeof t.value=="number"&&!Number.isFinite(t.value)?t.value.toString():t.value:null}SU.wrapperToProto3JSON=syI;function uyI(t,e){if(e===null)return{value:null};if(t===".google.protobuf.BytesValue"){if(typeof e!="string")throw new Error(`numberWrapperFromProto3JSON: expected to get a string for google.protobuf.BytesValue but got ${typeof e}`);return{value:(0,Pun.bytesFromProto3JSON)(e)}}return{value:e}}SU.wrapperFromProto3JSON=uyI});var _Ke=f(MU=>{"use strict";Object.defineProperty(MU,"__esModule",{value:!0});MU.googleProtobufFieldMaskFromProto3JSON=MU.googleProtobufFieldMaskToProto3JSON=void 0;function dyI(t){return t.paths.join(",")}MU.googleProtobufFieldMaskToProto3JSON=dyI;function GyI(t){return{paths:t.split(",")}}MU.googleProtobufFieldMaskFromProto3JSON=GyI});var qKe=f(TU=>{"use strict";Object.defineProperty(TU,"__esModule",{value:!0});TU.fromProto3JSON=TU.fromProto3JSONToInternalRepresentation=void 0;var byI=$Ke(),myI=jNe(),pyI=zKe(),PKe=MKe(),ONe=Iq(),hyI=TKe(),ZyI=DKe(),WyI=KKe(),NyI=_Ke();function aq(t,e){let n=typeof t=="string"?t:(0,ONe.getFullyQualifiedTypeName)(t);if(typeof t!="string"&&"values"in t)return n===".google.protobuf.NullValue"?"NULL_VALUE":(0,pyI.resolveEnumValueToString)(t,e);if(typeof t!="string"&&t.resolveAll(),typeof t=="string")return e;if(n===".google.protobuf.Value")return(0,PKe.googleProtobufValueFromProto3JSON)(e);if(ONe.wrapperTypes.has(n)){if(e!==null&&typeof e=="object"||Array.isArray(e))throw new Error(`fromProto3JSONToInternalRepresentation: JSON representation for ${n} expects a string, a number, or a boolean, but got ${typeof e}`);return(0,WyI.wrapperFromProto3JSON)(n,e)}if(e===null)return null;if(n===".google.protobuf.Any")return(0,byI.googleProtobufAnyFromProto3JSON)(t.root,e);if(n===".google.protobuf.Struct"){if(typeof e!="object")throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Struct must be an object but got ${typeof e}`);if(Array.isArray(e))throw new Error("fromProto3JSONToInternalRepresentation: google.protobuf.Struct must be an object but got an array");return(0,PKe.googleProtobufStructFromProto3JSON)(e)}if(n===".google.protobuf.ListValue"){if(!Array.isArray(e))throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.ListValue must be an array but got ${typeof e}`);return(0,PKe.googleProtobufListValueFromProto3JSON)(e)}if(n===".google.protobuf.Duration"){if(typeof e!="string")throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Duration must be a string but got ${typeof e}`);return(0,hyI.googleProtobufDurationFromProto3JSON)(e)}if(n===".google.protobuf.Timestamp"){if(typeof e!="string")throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Timestamp must be a string but got ${typeof e}`);return(0,ZyI.googleProtobufTimestampFromProto3JSON)(e)}if(n===".google.protobuf.FieldMask"){if(typeof e!="string")throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.FieldMask must be a string but got ${typeof e}`);return(0,NyI.googleProtobufFieldMaskFromProto3JSON)(e)}let l={};for(let[I,a]of Object.entries(e)){let c=t.fields[I];if(!c)continue;let i=c.resolvedType,s=c.type;if(c.repeated)if(a===null)l[I]=[];else{if(!Array.isArray(a))throw new Error(`fromProto3JSONToInternalRepresentation: expected an array for field ${I}`);l[I]=a.map(r=>aq(i||s,r))}else if(c.map){let r={};for(let[u,o]of Object.entries(a))r[u]=aq(i||s,o);l[I]=r}else if(s.match(/^(?:(?:(?:u?int|fixed)(?:32|64))|float|double)$/)){if(typeof a!="number"&&typeof a!="string")throw new Error(`fromProto3JSONToInternalRepresentation: field ${I} of type ${c.type} cannot contain value ${a}`);l[I]=a}else if(s==="string"){if(typeof a!="string")throw new Error(`fromProto3JSONToInternalRepresentation: field ${I} of type ${c.type} cannot contain value ${a}`);l[I]=a}else if(s==="bool"){if(typeof a!="boolean")throw new Error(`fromProto3JSONToInternalRepresentation: field ${I} of type ${c.type} cannot contain value ${a}`);l[I]=a}else if(s==="bytes"){if(typeof a!="string")throw new Error(`fromProto3JSONToInternalRepresentation: field ${I} of type ${c.type} cannot contain value ${a}`);l[I]=(0,myI.bytesFromProto3JSON)(a)}else{(0,ONe.assert)(i!==null,`Expected to be able to resolve type for field ${c.name}`);let r=aq(i,a);l[I]=r}}return l}TU.fromProto3JSONToInternalRepresentation=aq;function VyI(t,e){let n=aq(t,e);return n===null?null:((0,ONe.assert)(typeof n=="object"&&!Array.isArray(n),`fromProto3JSON: expected an object, not ${e}`),t.fromObject(n))}TU.fromProto3JSON=VyI});var $Ke=f(DU=>{"use strict";Object.defineProperty(DU,"__esModule",{value:!0});DU.googleProtobufAnyFromProto3JSON=DU.googleProtobufAnyToProto3JSON=void 0;var YyI=qKe(),gyI=e_e(),qun=new Set(["google.protobuf.Any","google.protobuf.Duration","google.protobuf.FieldMask","google.protobuf.ListValue","google.protobuf.Struct","google.protobuf.Timestamp","google.protobuf.Value"]);function RyI(t,e){let n=t.type_url.replace(/^.*\//,""),l;try{l=t.$type.root.lookupType(n)}catch(c){throw new Error(`googleProtobufAnyToProto3JSON: cannot find type ${n}: ${c}`)}let I=l.decode(t.value),a=(0,gyI.toProto3JSON)(I,e);return qun.has(n)?{"@type":t.type_url,value:a}:(a["@type"]=t.type_url,a)}DU.googleProtobufAnyToProto3JSON=RyI;function yyI(t,e){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error("googleProtobufAnyFromProto3JSON: must be an object to decode google.protobuf.Any");let n=e["@type"];if(!n||typeof n!="string")throw new Error("googleProtobufAnyFromProto3JSON: JSON serialization of google.protobuf.Any must contain @type field");let l=n.replace(/^.*\//,""),I;try{I=t.lookupType(l)}catch(u){throw new Error(`googleProtobufAnyFromProto3JSON: cannot find type ${l}: ${u}`)}let a=e;if(qun.has(l)){if(!("value"in e))throw new Error(`googleProtobufAnyFromProto3JSON: JSON representation of google.protobuf.Any with type ${l} must contain the value field`);a=e.value}let c=(0,YyI.fromProto3JSON)(I,a);if(c===null)return{type_url:n,value:null};let i=I.encode(c).finish(),r=Buffer.from(i,0,i.byteLength).toString("base64");return{type_url:n,value:r}}DU.googleProtobufAnyFromProto3JSON=yyI});var e_e=f(zNe=>{"use strict";Object.defineProperty(zNe,"__esModule",{value:!0});zNe.toProto3JSON=void 0;var AyI=$Ke(),FyI=jNe(),t_e=Iq(),$un=zKe(),n_e=MKe(),vyI=TKe(),fyI=DKe(),XyI=KKe(),wyI=_Ke();function l_e(t){var e;if(typeof t=="object"){if(((e=t?.constructor)===null||e===void 0?void 0:e.name)==="Long")return t.toString();throw new Error(`toProto3JSON: don't know how to convert value ${t}`)}return t}function UNe(t,e){let n=t.$type;if(!n)throw new Error("Cannot serialize object to proto3 JSON since its .$type is unknown. Use Type.fromObject(obj) before calling toProto3JSON.");n.resolveAll();let l=(0,t_e.getFullyQualifiedTypeName)(n);if(l===".google.protobuf.Any")return(0,AyI.googleProtobufAnyToProto3JSON)(t,e);if(l===".google.protobuf.Value")return(0,n_e.googleProtobufValueToProto3JSON)(t);if(l===".google.protobuf.Struct")return(0,n_e.googleProtobufStructToProto3JSON)(t);if(l===".google.protobuf.ListValue")return(0,n_e.googleProtobufListValueToProto3JSON)(t);if(l===".google.protobuf.Duration")return(0,vyI.googleProtobufDurationToProto3JSON)(t);if(l===".google.protobuf.Timestamp")return(0,fyI.googleProtobufTimestampToProto3JSON)(t);if(l===".google.protobuf.FieldMask")return(0,wyI.googleProtobufFieldMaskToProto3JSON)(t);if(t_e.wrapperTypes.has(l))return(0,XyI.wrapperToProto3JSON)(t);let I={};for(let[a,c]of Object.entries(t)){let i=n.fields[a],s=i.resolvedType,r=s?(0,t_e.getFullyQualifiedTypeName)(s):null;if(c===null){I[a]=null;continue}if(Array.isArray(c)){if(c.length===0)continue;I[a]=c.map(s?u=>UNe(u,e):l_e);continue}if(i.map){let u={};for(let[o,d]of Object.entries(c))u[o]=s?UNe(d,e):l_e(d);I[a]=u;continue}if(r===".google.protobuf.NullValue"){I[a]=null;continue}if(s&&"values"in s&&c!==null){e?.numericEnums?I[a]=(0,$un.resolveEnumValueToNumber)(s,c):I[a]=(0,$un.resolveEnumValueToString)(s,c);continue}if(s){I[a]=UNe(c,e);continue}if(typeof c=="string"||typeof c=="number"||typeof c=="boolean"||c===null){if(typeof c=="number"&&!Number.isFinite(c)){I[a]=c.toString();continue}I[a]=c;continue}if(Buffer.isBuffer(c)||c instanceof Uint8Array){I[a]=(0,FyI.bytesToProto3JSON)(c);continue}I[a]=l_e(c)}return I}zNe.toProto3JSON=UNe});var I_e=f(KU=>{"use strict";Object.defineProperty(KU,"__esModule",{value:!0});KU.fromProto3JSON=KU.toProto3JSON=void 0;var HyI=e_e();Object.defineProperty(KU,"toProto3JSON",{enumerable:!0,get:function(){return HyI.toProto3JSON}});var QyI=qKe();Object.defineProperty(KU,"fromProto3JSON",{enumerable:!0,get:function(){return QyI.fromProto3JSON}})});var edn=f((TNr,EyI)=>{EyI.exports={nested:{google:{nested:{protobuf:{nested:{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/errdetails;errdetails",java_multiple_files:!0,java_outer_classname:"ErrorDetailsProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}},RetryInfo:{fields:{retryDelay:{type:"google.protobuf.Duration",id:1}}},DebugInfo:{fields:{stackEntries:{rule:"repeated",type:"string",id:1},detail:{type:"string",id:2}}},QuotaFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{subject:{type:"string",id:1},description:{type:"string",id:2}}}}},ErrorInfo:{fields:{reason:{type:"string",id:1},domain:{type:"string",id:2},metadata:{keyType:"string",type:"string",id:3}}},PreconditionFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{type:{type:"string",id:1},subject:{type:"string",id:2},description:{type:"string",id:3}}}}},BadRequest:{fields:{fieldViolations:{rule:"repeated",type:"FieldViolation",id:1}},nested:{FieldViolation:{fields:{field:{type:"string",id:1},description:{type:"string",id:2}}}}},RequestInfo:{fields:{requestId:{type:"string",id:1},servingData:{type:"string",id:2}}},ResourceInfo:{fields:{resourceType:{type:"string",id:1},resourceName:{type:"string",id:2},owner:{type:"string",id:3},description:{type:"string",id:4}}},Help:{fields:{links:{rule:"repeated",type:"Link",id:1}},nested:{Link:{fields:{description:{type:"string",id:1},url:{type:"string",id:2}}}}},LocalizedMessage:{fields:{locale:{type:"string",id:1},message:{type:"string",id:2}}}}}}}}}});var VY=f(_U=>{"use strict";Object.defineProperty(_U,"__esModule",{value:!0});_U.GoogleErrorDecoder=_U.GoogleError=void 0;var tdn=UR(),JyI=ETe(),CyI=I_e(),LyI=YY(),BNe=class t extends Error{static parseGRPCStatusDetails(e){let n=new rq;try{if(e.metadata&&e.metadata.get("grpc-status-details-bin")){let l=n.decodeGRPCStatusDetails(e.metadata.get("grpc-status-details-bin"));l&&l.details&&l.details.length>0&&(e.statusDetails=l.details),l&&l.errorInfo&&(e.reason=l.errorInfo.reason,e.domain=l.errorInfo.domain,e.errorInfoMetadata=l.errorInfo.metadata)}}catch{}return e}static parseHttpError(e){Array.isArray(e)&&(e=e.find(a=>"error"in a)),e.error||(e.error={},Object.keys(e).filter(a=>a!=="error").forEach(a=>{e.error[a]=e[a],delete e[a]}));let n=new rq,l=n.decodeHTTPError(e.error),I=Object.assign(new t(e.error.message),l);if(e.error.code?I.code=(0,tdn.rpcCodeFromHttpStatusCode)(e.error.code):delete I.code,I.details)try{let a=n.decodeHttpStatusDetails(I.details);a&&a.details&&a.details.length>0&&(I.statusDetails=a.details),a&&a.errorInfo&&(I.reason=a.errorInfo.reason,I.domain=a.errorInfo.domain,I.errorInfoMetadata=a.errorInfo.metadata)}catch{}return I}};_U.GoogleError=BNe;var rq=class{constructor(){let e=edn();this.root=JyI.Root.fromJSON(e),this.anyType=this.root.lookupType("google.protobuf.Any"),this.statusType=this.root.lookupType("google.rpc.Status")}decodeProtobufAny(e){let n=e.type_url.match(/^type.googleapis.com\/(.*)/);if(!n)throw new Error(`Unknown type encoded in google.protobuf.any: ${e.type_url}`);let l=n[1],I=this.root.lookupType(l);if(!I)throw new Error(`Cannot lookup type ${l}`);return I.decode(e.value)}decodeRpcStatus(e){let n=new Uint8Array(e),l=this.statusType.decode(n),I=[],a;for(let i of l.details)try{let s=this.decodeProtobufAny(i);I.push(s),i.type_url==="type.googleapis.com/google.rpc.ErrorInfo"&&(a=s)}catch{}return{code:l.code,message:l.message,statusDetails:I,reason:a?.reason,domain:a?.domain,errorInfoMetadata:a?.metadata}}callErrorFromStatus(e){return e.message=`${e.code} ${tdn.Status[e.code]}: ${e.message}`,Object.assign(new BNe(e.message),e)}decodeErrorFromBuffer(e){return this.callErrorFromStatus(this.decodeRpcStatus(e))}decodeGRPCStatusDetails(e){let n=[],l;return e.forEach(a=>{let c=new Uint8Array(a),i=this.statusType.decode(c);for(let s of i.details)try{let r=this.decodeProtobufAny(s);n.push(r),s.type_url==="type.googleapis.com/google.rpc.ErrorInfo"&&(l=r)}catch{}}),{details:n,errorInfo:l}}decodeHTTPError(e){let n=CyI.fromProto3JSON(this.statusType,e);if(!n)throw new Error(`Received error message ${e}, but failed to serialize as proto3 message`);return this.statusType.toObject(n,LyI.defaultToObjectOptions)}decodeHttpStatusDetails(e){let n=[],l;for(let I of e)try{let a=this.decodeProtobufAny(I);n.push(a),I.type_url==="type.googleapis.com/google.rpc.ErrorInfo"&&(l=a)}catch{}return{details:n,errorInfo:l}}};_U.GoogleErrorDecoder=rq});var cq=f(PU=>{"use strict";Object.defineProperty(PU,"__esModule",{value:!0});PU.OngoingCallPromise=PU.OngoingCall=void 0;var kyI=UR(),SNe=VY(),MNe=class{constructor(e){this.callback=e,this.completed=!1}cancel(){if(!this.completed)if(this.completed=!0,this.cancelFunc)this.cancelFunc();else{let e=new SNe.GoogleError("cancelled");e.code=kyI.Status.CANCELLED,this.callback(e)}}call(e,n){if(this.completed)return;let l=e(n,(I,a,c,i)=>{this.completed=!0,setImmediate(this.callback,I,a,c,i)});l instanceof Promise&&l.catch(I=>{setImmediate(this.callback,new SNe.GoogleError(I),null,null,null)}),this.cancelFunc=()=>l.cancel()}};PU.OngoingCall=MNe;var a_e=class extends MNe{constructor(){let e,n,l=(a,c,i,s)=>{if(a)a.metadata?n(SNe.GoogleError.parseGRPCStatusDetails(a)):n(a);else if(c!==void 0)e([c,i||null,s||null]);else throw new SNe.GoogleError("Neither error nor response are defined")},I=new Promise((a,c)=>{e=a,n=c});super(l),this.promise=I,this.promise.cancel=()=>{this.cancel()}}};PU.OngoingCallPromise=a_e});var DNe=f(TNe=>{"use strict";Object.defineProperty(TNe,"__esModule",{value:!0});TNe.NormalApiCaller=void 0;var ndn=cq(),r_e=class{init(e){return e?new ndn.OngoingCall(e):new ndn.OngoingCallPromise}wrap(e){return e}call(e,n,l,I){I.call(e,n)}fail(e,n){e.callback(n)}result(e){return e.promise}};TNe.NormalApiCaller=r_e});var ldn=f(c_e=>{"use strict";Object.defineProperty(c_e,"__esModule",{value:!0});c_e.createAPICaller=jyI;var xyI=DNe();function jyI(t,e){return e?e.getApiCaller(t):new xyI.NormalApiCaller}});var i_e=f(o_e=>{"use strict";Object.defineProperty(o_e,"__esModule",{value:!0});o_e.addTimeoutArg=OyI;function OyI(t,e,n,l){return(I,a)=>{let c=new Date,i=n.options||{};i.deadline=new Date(c.getTime()+e);let s=n.metadataBuilder?n.metadataBuilder(l,n.headers||{}):null;return t(I,s,i,a)}}});var Idn=f(s_e=>{"use strict";Object.defineProperty(s_e,"__esModule",{value:!0});s_e.retryable=zyI;var KNe=UR(),oq=VY(),UyI=i_e();function zyI(t,e,n,l){let I=e.backoffSettings.retryDelayMultiplier,a=e.backoffSettings.maxRetryDelayMillis,c=e.backoffSettings.rpcTimeoutMultiplier,i=e.backoffSettings.maxRpcTimeoutMillis,s=e.backoffSettings.initialRetryDelayMillis,r=e.backoffSettings.initialRpcTimeoutMillis;return(u,o)=>{let d,b,h=new Date,Z;e.backoffSettings.totalTimeoutMillis&&(Z=h.getTime()+e.backoffSettings.totalTimeoutMillis);let N=0,g=e.backoffSettings.maxRetries;function y(X){if(b=null,Z&&h.getTime()>=Z){let Q=new oq.GoogleError(`Total timeout of API ${l} exceeded ${e.backoffSettings.totalTimeoutMillis} milliseconds ${X?`retrying error ${X} `:""} before any response was received.`);Q.code=KNe.Status.DEADLINE_EXCEEDED,o(Q);return}if(N&&N>=g){let Q=new oq.GoogleError("Exceeded maximum number of retries "+(X?`retrying error ${X} `:"")+"before any response was received");Q.code=KNe.Status.DEADLINE_EXCEEDED,o(Q);return}N++;let v=X;d=(0,UyI.addTimeoutArg)(t,r,n)(u,(Q,L,J,O)=>{if(Q&&Q.code!==4&&(v=Q),!Q){o(null,L,J,O);return}if(d=null,e.retryCodes.length>0&&e.retryCodes.indexOf(Q.code)<0)Q.note="Exception occurred in retry method that was not classified as transient",o(Q);else{let U=Math.random()*s;b=setTimeout(()=>{h=new Date,s=Math.min(s*I,a);let K=r&&c?r*c:0,D=i||0,_=Z?Z-h.getTime():0;r=Math.min(K,D,_),y(v)},U)}}),d instanceof Promise&&d.catch(Q=>{o(new oq.GoogleError(Q))})}if(g&&Z){let X=new oq.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");X.code=KNe.Status.INVALID_ARGUMENT,o(X)}else y();return{cancel(){if(b&&clearTimeout(b),d)d.cancel();else{let X=new oq.GoogleError("cancelled");X.code=KNe.Status.CANCELLED,o(X)}}}}}});var u_e=f((eVr,adn)=>{adn.exports=require("events").EventEmitter});var udn=f((tVr,sdn)=>{"use strict";function rdn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);e&&(l=l.filter(function(I){return Object.getOwnPropertyDescriptor(t,I).enumerable})),n.push.apply(n,l)}return n}function cdn(t){for(var e=1;e0?this.tail.next=l:this.head=l,this.tail=l,++this.length}},{key:"unshift",value:function(n){var l={data:n,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}},{key:"shift",value:function(){if(this.length!==0){var n=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,n}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(n){if(this.length===0)return"";for(var l=this.head,I=""+l.data;l=l.next;)I+=n+l.data;return I}},{key:"concat",value:function(n){if(this.length===0)return _Ne.alloc(0);for(var l=_Ne.allocUnsafe(n>>>0),I=this.head,a=0;I;)PyI(I.data,l,a),a+=I.data.length,I=I.next;return l}},{key:"consume",value:function(n,l){var I;return nc.length?c.length:n;if(i===c.length?a+=c:a+=c.slice(0,n),n-=i,n===0){i===c.length?(++I,l.next?this.head=l.next:this.head=this.tail=null):(this.head=l,l.data=c.slice(i));break}++I}return this.length-=I,a}},{key:"_getBuffer",value:function(n){var l=_Ne.allocUnsafe(n),I=this.head,a=1;for(I.data.copy(l),n-=I.data.length;I=I.next;){var c=I.data,i=n>c.length?c.length:n;if(c.copy(l,l.length-n,0,i),n-=i,n===0){i===c.length?(++a,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=c.slice(i));break}++a}return this.length-=a,l}},{key:_yI,value:function(n,l){return d_e(this,cdn(cdn({},l),{},{depth:0,customInspect:!1}))}}]),t}()});var b_e=f((nVr,Gdn)=>{"use strict";function qyI(t,e){var n=this,l=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;return l||I?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(G_e,this,t)):process.nextTick(G_e,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(a){!e&&a?n._writableState?n._writableState.errorEmitted?process.nextTick(PNe,n):(n._writableState.errorEmitted=!0,process.nextTick(ddn,n,a)):process.nextTick(ddn,n,a):e?(process.nextTick(PNe,n),e(a)):process.nextTick(PNe,n)}),this)}function ddn(t,e){G_e(t,e),PNe(t)}function PNe(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function $yI(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function G_e(t,e){t.emit("error",e)}function eAI(t,e){var n=t._readableState,l=t._writableState;n&&n.autoDestroy||l&&l.autoDestroy?t.destroy(e):t.emit("error",e)}Gdn.exports={destroy:qyI,undestroy:$yI,errorOrDestroy:eAI}});var rC=f((lVr,pdn)=>{"use strict";function tAI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var mdn={};function hN(t,e,n){n||(n=Error);function l(a,c,i){return typeof e=="string"?e:e(a,c,i)}var I=function(a){tAI(c,a);function c(i,s,r){return a.call(this,l(i,s,r))||this}return c}(n);I.prototype.name=n.name,I.prototype.code=t,mdn[t]=I}function bdn(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map(function(l){return String(l)}),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:n===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function nAI(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}function lAI(t,e,n){return(n===void 0||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}function IAI(t,e,n){return typeof n!="number"&&(n=0),n+e.length>t.length?!1:t.indexOf(e,n)!==-1}hN("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);hN("ERR_INVALID_ARG_TYPE",function(t,e,n){var l;typeof e=="string"&&nAI(e,"not ")?(l="must not be",e=e.replace(/^not /,"")):l="must be";var I;if(lAI(t," argument"))I="The ".concat(t," ").concat(l," ").concat(bdn(e,"type"));else{var a=IAI(t,".")?"property":"argument";I='The "'.concat(t,'" ').concat(a," ").concat(l," ").concat(bdn(e,"type"))}return I+=". Received type ".concat(typeof n),I},TypeError);hN("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");hN("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});hN("ERR_STREAM_PREMATURE_CLOSE","Premature close");hN("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});hN("ERR_MULTIPLE_CALLBACK","Callback called multiple times");hN("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");hN("ERR_STREAM_WRITE_AFTER_END","write after end");hN("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);hN("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);hN("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");pdn.exports.codes=mdn});var m_e=f((IVr,hdn)=>{"use strict";var aAI=rC().codes.ERR_INVALID_OPT_VALUE;function rAI(t,e,n){return t.highWaterMark!=null?t.highWaterMark:e?t[n]:null}function cAI(t,e,n,l){var I=rAI(e,l,n);if(I!=null){if(!(isFinite(I)&&Math.floor(I)===I)||I<0){var a=l?n:"highWaterMark";throw new aAI(a,I)}return Math.floor(I)}return t.objectMode?16:16*1024}hdn.exports={getHighWaterMark:cAI}});var Tw=f((aVr,p_e)=>{typeof Object.create=="function"?p_e.exports=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:p_e.exports=function(e,n){if(n){e.super_=n;var l=function(){};l.prototype=n.prototype,e.prototype=new l,e.prototype.constructor=e}}});var Wdn=f((rVr,Zdn)=>{Zdn.exports=oAI;function oAI(t,e){if(h_e("noDeprecation"))return t;var n=!1;function l(){if(!n){if(h_e("throwDeprecation"))throw new Error(e);h_e("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}return l}function h_e(t){try{if(!global.localStorage)return!1}catch{return!1}var e=global.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var N_e=f((cVr,ydn)=>{"use strict";ydn.exports=ko;function Vdn(t){var e=this;this.next=null,this.entry=null,this.finish=function(){JAI(e,t)}}var qU;ko.WritableState=sq;var iAI={deprecate:Wdn()},Ydn=u_e(),$Ne=require("buffer").Buffer,sAI=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function uAI(t){return $Ne.from(t)}function dAI(t){return $Ne.isBuffer(t)||t instanceof sAI}var W_e=b_e(),GAI=m_e(),bAI=GAI.getHighWaterMark,Dw=rC().codes,mAI=Dw.ERR_INVALID_ARG_TYPE,pAI=Dw.ERR_METHOD_NOT_IMPLEMENTED,hAI=Dw.ERR_MULTIPLE_CALLBACK,ZAI=Dw.ERR_STREAM_CANNOT_PIPE,WAI=Dw.ERR_STREAM_DESTROYED,NAI=Dw.ERR_STREAM_NULL_VALUES,VAI=Dw.ERR_STREAM_WRITE_AFTER_END,YAI=Dw.ERR_UNKNOWN_ENCODING,$U=W_e.errorOrDestroy;Tw()(ko,Ydn);function gAI(){}function sq(t,e,n){qU=qU||cC(),t=t||{},typeof n!="boolean"&&(n=e instanceof qU),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=bAI(this,t,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=t.decodeStrings===!1;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(I){XAI(e,I)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Vdn(this)}sq.prototype.getBuffer=function(){for(var e=this.bufferedRequest,n=[];e;)n.push(e),e=e.next;return n};(function(){try{Object.defineProperty(sq.prototype,"buffer",{get:iAI.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var qNe;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(qNe=Function.prototype[Symbol.hasInstance],Object.defineProperty(ko,Symbol.hasInstance,{value:function(e){return qNe.call(this,e)?!0:this!==ko?!1:e&&e._writableState instanceof sq}})):qNe=function(e){return e instanceof this};function ko(t){qU=qU||cC();var e=this instanceof qU;if(!e&&!qNe.call(ko,this))return new ko(t);this._writableState=new sq(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Ydn.call(this)}ko.prototype.pipe=function(){$U(this,new ZAI)};function RAI(t,e){var n=new VAI;$U(t,n),process.nextTick(e,n)}function yAI(t,e,n,l){var I;return n===null?I=new NAI:typeof n!="string"&&!e.objectMode&&(I=new mAI("chunk",["string","Buffer"],n)),I?($U(t,I),process.nextTick(l,I),!1):!0}ko.prototype.write=function(t,e,n){var l=this._writableState,I=!1,a=!l.objectMode&&dAI(t);return a&&!$Ne.isBuffer(t)&&(t=uAI(t)),typeof e=="function"&&(n=e,e=null),a?e="buffer":e||(e=l.defaultEncoding),typeof n!="function"&&(n=gAI),l.ending?RAI(this,n):(a||yAI(this,l,t,n))&&(l.pendingcb++,I=FAI(this,l,a,t,e,n)),I};ko.prototype.cork=function(){this._writableState.corked++};ko.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&gdn(this,t))};ko.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new YAI(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(ko.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function AAI(t,e,n){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=$Ne.from(e,n)),e}Object.defineProperty(ko.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function FAI(t,e,n,l,I,a){if(!n){var c=AAI(e,l,I);l!==c&&(n=!0,I="buffer",l=c)}var i=e.objectMode?1:l.length;e.length+=i;var s=e.length{"use strict";var CAI=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};Fdn.exports=_R;var Adn=g_e(),Y_e=N_e();Tw()(_R,Adn);for(V_e=CAI(Y_e.prototype),eVe=0;eVe{"use strict";var vdn=rC().codes.ERR_STREAM_PREMATURE_CLOSE;function xAI(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,l=new Array(n),I=0;I{"use strict";var lVe;function Kw(t,e,n){return e=UAI(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UAI(t){var e=zAI(t,"string");return typeof e=="symbol"?e:String(e)}function zAI(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var l=n.call(t,e||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var BAI=nVe(),_w=Symbol("lastResolve"),oC=Symbol("lastReject"),uq=Symbol("error"),IVe=Symbol("ended"),iC=Symbol("lastPromise"),R_e=Symbol("handlePromise"),sC=Symbol("stream");function Pw(t,e){return{value:t,done:e}}function SAI(t){var e=t[_w];if(e!==null){var n=t[sC].read();n!==null&&(t[iC]=null,t[_w]=null,t[oC]=null,e(Pw(n,!1)))}}function MAI(t){process.nextTick(SAI,t)}function TAI(t,e){return function(n,l){t.then(function(){if(e[IVe]){n(Pw(void 0,!0));return}e[R_e](n,l)},l)}}var DAI=Object.getPrototypeOf(function(){}),KAI=Object.setPrototypeOf((lVe={get stream(){return this[sC]},next:function(){var e=this,n=this[uq];if(n!==null)return Promise.reject(n);if(this[IVe])return Promise.resolve(Pw(void 0,!0));if(this[sC].destroyed)return new Promise(function(c,i){process.nextTick(function(){e[uq]?i(e[uq]):c(Pw(void 0,!0))})});var l=this[iC],I;if(l)I=new Promise(TAI(l,this));else{var a=this[sC].read();if(a!==null)return Promise.resolve(Pw(a,!1));I=new Promise(this[R_e])}return this[iC]=I,I}},Kw(lVe,Symbol.asyncIterator,function(){return this}),Kw(lVe,"return",function(){var e=this;return new Promise(function(n,l){e[sC].destroy(null,function(I){if(I){l(I);return}n(Pw(void 0,!0))})})}),lVe),DAI),_AI=function(e){var n,l=Object.create(KAI,(n={},Kw(n,sC,{value:e,writable:!0}),Kw(n,_w,{value:null,writable:!0}),Kw(n,oC,{value:null,writable:!0}),Kw(n,uq,{value:null,writable:!0}),Kw(n,IVe,{value:e._readableState.endEmitted,writable:!0}),Kw(n,R_e,{value:function(a,c){var i=l[sC].read();i?(l[iC]=null,l[_w]=null,l[oC]=null,a(Pw(i,!1))):(l[_w]=a,l[oC]=c)},writable:!0}),n));return l[iC]=null,BAI(e,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=l[oC];a!==null&&(l[iC]=null,l[_w]=null,l[oC]=null,a(I)),l[uq]=I;return}var c=l[_w];c!==null&&(l[iC]=null,l[_w]=null,l[oC]=null,c(Pw(void 0,!0))),l[IVe]=!0}),e.on("readable",MAI.bind(null,l)),l};wdn.exports=_AI});var Edn=f((uVr,Qdn)=>{Qdn.exports=function(){throw new Error("Readable.from is not available in the browser")}});var g_e=f((GVr,Bdn)=>{"use strict";Bdn.exports=Xa;var e9;Xa.ReadableState=kdn;var dVr=require("events").EventEmitter,Ldn=function(e,n){return e.listeners(n).length},Gq=u_e(),aVe=require("buffer").Buffer,PAI=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function qAI(t){return aVe.from(t)}function $AI(t){return aVe.isBuffer(t)||t instanceof PAI}var y_e=require("util"),iI;y_e&&y_e.debuglog?iI=y_e.debuglog("stream"):iI=function(){};var e0I=udn(),H_e=b_e(),t0I=m_e(),n0I=t0I.getHighWaterMark,rVe=rC().codes,l0I=rVe.ERR_INVALID_ARG_TYPE,I0I=rVe.ERR_STREAM_PUSH_AFTER_EOF,a0I=rVe.ERR_METHOD_NOT_IMPLEMENTED,r0I=rVe.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,t9,A_e,F_e;Tw()(Xa,Gq);var dq=H_e.errorOrDestroy,v_e=["error","close","destroy","pause","resume"];function c0I(t,e,n){if(typeof t.prependListener=="function")return t.prependListener(e,n);!t._events||!t._events[e]?t.on(e,n):Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]}function kdn(t,e,n){e9=e9||cC(),t=t||{},typeof n!="boolean"&&(n=e instanceof e9),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=n0I(this,t,"readableHighWaterMark",n),this.buffer=new e0I,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(t9||(t9=require("string_decoder/").StringDecoder),this.decoder=new t9(t.encoding),this.encoding=t.encoding)}function Xa(t){if(e9=e9||cC(),!(this instanceof Xa))return new Xa(t);var e=this instanceof e9;this._readableState=new kdn(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Gq.call(this)}Object.defineProperty(Xa.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Xa.prototype.destroy=H_e.destroy;Xa.prototype._undestroy=H_e.undestroy;Xa.prototype._destroy=function(t,e){e(t)};Xa.prototype.push=function(t,e){var n=this._readableState,l;return n.objectMode?l=!0:typeof t=="string"&&(e=e||n.defaultEncoding,e!==n.encoding&&(t=aVe.from(t,e),e=""),l=!0),xdn(this,t,e,!1,l)};Xa.prototype.unshift=function(t){return xdn(this,t,null,!0,!1)};function xdn(t,e,n,l,I){iI("readableAddChunk",e);var a=t._readableState;if(e===null)a.reading=!1,s0I(t,a);else{var c;if(I||(c=o0I(a,e)),c)dq(t,c);else if(a.objectMode||e&&e.length>0)if(typeof e!="string"&&!a.objectMode&&Object.getPrototypeOf(e)!==aVe.prototype&&(e=qAI(e)),l)a.endEmitted?dq(t,new r0I):f_e(t,a,e,!0);else if(a.ended)dq(t,new I0I);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(e=a.decoder.write(e),a.objectMode||e.length!==0?f_e(t,a,e,!1):w_e(t,a)):f_e(t,a,e,!1)}else l||(a.reading=!1,w_e(t,a))}return!a.ended&&(a.length=Jdn?t=Jdn:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Cdn(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=i0I(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Xa.prototype.read=function(t){iI("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return iI("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?X_e(this):cVe(this),null;if(t=Cdn(t,e),t===0&&e.ended)return e.length===0&&X_e(this),null;var l=e.needReadable;iI("need readable",l),(e.length===0||e.length-t0?I=Udn(t,e):I=null,I===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&X_e(this)),I!==null&&this.emit("data",I),I};function s0I(t,e){if(iI("onEofChunk"),!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?cVe(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,jdn(t)))}}function cVe(t){var e=t._readableState;iI("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(iI("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(jdn,t))}function jdn(t){var e=t._readableState;iI("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Q_e(t)}function w_e(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(u0I,t,e))}function u0I(t,e){for(;!e.reading&&!e.ended&&(e.length1&&zdn(l.pipes,t)!==-1)&&!r&&(iI("false write response, pause",l.awaitDrain),l.awaitDrain++),n.pause())}function d(N){iI("onerror",N),Z(),t.removeListener("error",d),Ldn(t,"error")===0&&dq(t,N)}c0I(t,"error",d);function b(){t.removeListener("finish",h),Z()}t.once("close",b);function h(){iI("onfinish"),t.removeListener("close",b),Z()}t.once("finish",h);function Z(){iI("unpipe"),n.unpipe(t)}return t.emit("pipe",n),l.flowing||(iI("pipe resume"),n.resume()),t};function d0I(t){return function(){var n=t._readableState;iI("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,n.awaitDrain===0&&Ldn(t,"data")&&(n.flowing=!0,Q_e(t))}}Xa.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var l=e.pipes,I=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,l.flowing!==!1&&this.resume()):t==="readable"&&!l.endEmitted&&!l.readableListening&&(l.readableListening=l.needReadable=!0,l.flowing=!1,l.emittedReadable=!1,iI("on readable",l.length,l.reading),l.length?cVe(this):l.reading||process.nextTick(G0I,this)),n};Xa.prototype.addListener=Xa.prototype.on;Xa.prototype.removeListener=function(t,e){var n=Gq.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Odn,this),n};Xa.prototype.removeAllListeners=function(t){var e=Gq.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Odn,this),e};function Odn(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function G0I(t){iI("readable nexttick read 0"),t.read(0)}Xa.prototype.resume=function(){var t=this._readableState;return t.flowing||(iI("resume"),t.flowing=!t.readableListening,b0I(this,t)),t.paused=!1,this};function b0I(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(m0I,t,e))}function m0I(t,e){iI("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Q_e(t),e.flowing&&!e.reading&&t.read(0)}Xa.prototype.pause=function(){return iI("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(iI("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Q_e(t){var e=t._readableState;for(iI("flow",e.flowing);e.flowing&&t.read()!==null;);}Xa.prototype.wrap=function(t){var e=this,n=this._readableState,l=!1;t.on("end",function(){if(iI("wrapped end"),n.decoder&&!n.ended){var c=n.decoder.end();c&&c.length&&e.push(c)}e.push(null)}),t.on("data",function(c){if(iI("wrapped data"),n.decoder&&(c=n.decoder.write(c)),!(n.objectMode&&c==null)&&!(!n.objectMode&&(!c||!c.length))){var i=e.push(c);i||(l=!0,t.pause())}});for(var I in t)this[I]===void 0&&typeof t[I]=="function"&&(this[I]=function(i){return function(){return t[i].apply(t,arguments)}}(I));for(var a=0;a=e.length?(e.decoder?n=e.buffer.join(""):e.buffer.length===1?n=e.buffer.first():n=e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n}function X_e(t){var e=t._readableState;iI("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(p0I,e,t))}function p0I(t,e){if(iI("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}typeof Symbol=="function"&&(Xa.from=function(t,e){return F_e===void 0&&(F_e=Edn()),F_e(Xa,t,e)});function zdn(t,e){for(var n=0,l=t.length;n{"use strict";Mdn.exports=I2;var oVe=rC().codes,h0I=oVe.ERR_METHOD_NOT_IMPLEMENTED,Z0I=oVe.ERR_MULTIPLE_CALLBACK,W0I=oVe.ERR_TRANSFORM_ALREADY_TRANSFORMING,N0I=oVe.ERR_TRANSFORM_WITH_LENGTH_0,iVe=cC();Tw()(I2,iVe);function V0I(t,e){var n=this._transformState;n.transforming=!1;var l=n.writecb;if(l===null)return this.emit("error",new Z0I);n.writechunk=null,n.writecb=null,e!=null&&this.push(e),l(t);var I=this._readableState;I.reading=!1,(I.needReadable||I.length{"use strict";Ddn.exports=bq;var Tdn=E_e();Tw()(bq,Tdn);function bq(t){if(!(this instanceof bq))return new bq(t);Tdn.call(this,t)}bq.prototype._transform=function(t,e,n){n(null,t)}});var eGn=f((pVr,$dn)=>{"use strict";var J_e;function g0I(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var qdn=rC().codes,R0I=qdn.ERR_MISSING_ARGS,y0I=qdn.ERR_STREAM_DESTROYED;function _dn(t){if(t)throw t}function A0I(t){return t.setHeader&&typeof t.abort=="function"}function F0I(t,e,n,l){l=g0I(l);var I=!1;t.on("close",function(){I=!0}),J_e===void 0&&(J_e=nVe()),J_e(t,{readable:e,writable:n},function(c){if(c)return l(c);I=!0,l()});var a=!1;return function(c){if(!I&&!a){if(a=!0,A0I(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();l(c||new y0I("pipe"))}}}function Pdn(t){t()}function v0I(t,e){return t.pipe(e)}function f0I(t){return!t.length||typeof t[t.length-1]!="function"?_dn:t.pop()}function X0I(){for(var t=arguments.length,e=new Array(t),n=0;n0;return F0I(c,s,r,function(u){I||(I=u),u&&a.forEach(Pdn),!s&&(a.forEach(Pdn),l(I))})});return e.reduce(v0I)}$dn.exports=X0I});var nGn=f((ZN,tGn)=>{ZN=tGn.exports=g_e();ZN.Stream=ZN;ZN.Readable=ZN;ZN.Writable=N_e();ZN.Duplex=cC();ZN.Transform=E_e();ZN.PassThrough=Kdn();ZN.finished=nVe();ZN.pipeline=eGn()});var aGn=f((hVr,IGn)=>{IGn.exports=lGn;function lGn(t,e){if(t&&e)return lGn(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(l){n[l]=t[l]}),n;function n(){for(var l=new Array(arguments.length),I=0;I{var rGn=aGn();C_e.exports=rGn(sVe);C_e.exports.strict=rGn(cGn);sVe.proto=sVe(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return sVe(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return cGn(this)},configurable:!0})});function sVe(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function cGn(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},n=t.name||"Function wrapped with `once`";return e.onceError=n+" shouldn't be called more than once",e.called=!1,e}});var uGn=f((WVr,sGn)=>{var w0I=oGn(),H0I=function(){},Q0I=global.Bare?queueMicrotask:process.nextTick.bind(process),E0I=function(t){return t.setHeader&&typeof t.abort=="function"},J0I=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},iGn=function(t,e,n){if(typeof e=="function")return iGn(t,null,e);e||(e={}),n=w0I(n||H0I);var l=t._writableState,I=t._readableState,a=e.readable||e.readable!==!1&&t.readable,c=e.writable||e.writable!==!1&&t.writable,i=!1,s=function(){t.writable||r()},r=function(){c=!1,a||n.call(t)},u=function(){a=!1,c||n.call(t)},o=function(N){n.call(t,N?new Error("exited with error code: "+N):null)},d=function(N){n.call(t,N)},b=function(){Q0I(h)},h=function(){if(!i){if(a&&!(I&&I.ended&&!I.destroyed))return n.call(t,new Error("premature close"));if(c&&!(l&&l.ended&&!l.destroyed))return n.call(t,new Error("premature close"))}},Z=function(){t.req.on("finish",r)};return E0I(t)?(t.on("complete",r),t.on("abort",b),t.req?Z():t.on("request",Z)):c&&!l&&(t.on("end",s),t.on("close",s)),J0I(t)&&t.on("exit",o),t.on("end",u),t.on("finish",r),e.error!==!1&&t.on("error",d),t.on("close",b),function(){i=!0,t.removeListener("complete",r),t.removeListener("abort",b),t.removeListener("request",Z),t.req&&t.req.removeListener("finish",r),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",r),t.removeListener("exit",o),t.removeListener("end",u),t.removeListener("error",d),t.removeListener("close",b)}};sGn.exports=iGn});var GGn=f((NVr,dGn)=>{dGn.exports=C0I;function C0I(t){var e=t._readableState;return e?e.objectMode||typeof t._duplexState=="number"?t.read():t.read(L0I(e)):null}function L0I(t){if(t.buffer.length){var e=t.bufferIndex||0;if(t.buffer.head)return t.buffer.head.data.length;if(t.buffer.length-e>0&&t.buffer[e])return t.buffer[e].length}return t.length}});var ZGn=f((VVr,hGn)=>{var uVe=nGn(),bGn=uGn(),k0I=Tw(),x0I=GGn(),mGn=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),L_e=function(t,e){t._corked?t.once("uncork",e):e()},j0I=function(t,e){t._autoDestroy&&t.destroy(e)},pGn=function(t,e){return function(n){n?j0I(t,n.message==="premature close"?null:n):e&&!t._ended&&t.end()}},O0I=function(t,e){if(!t||t._writableState&&t._writableState.finished)return e();if(t._writableState)return t.end(e);t.end(),e()},U0I=function(){},z0I=function(t){return new uVe.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},BG=function(t,e,n){if(!(this instanceof BG))return new BG(t,e,n);uVe.Duplex.call(this,n),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!n||n.autoDestroy!==!1,this._forwardDestroy=!n||n.destroy!==!1,this._forwardEnd=!n||n.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};k0I(BG,uVe.Duplex);BG.obj=function(t,e,n){return n||(n={}),n.objectMode=!0,n.highWaterMark=16,new BG(t,e,n)};BG.prototype.cork=function(){++this._corked===1&&this.emit("cork")};BG.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};BG.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.end();return}var e=this,n=bGn(t,{writable:!0,readable:!1},pGn(this,this._forwardEnd)),l=function(){var a=e._ondrain;e._ondrain=null,a&&a()},I=function(){e._writable.removeListener("drain",l),n()};this._unwrite&&process.nextTick(l),this._writable=t,this._writable.on("drain",l),this._unwrite=I,this.uncork()};BG.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.push(null),this.resume();return}var e=this,n=bGn(t,{writable:!1,readable:!0},pGn(this)),l=function(){e._forward()},I=function(){e.push(null)},a=function(){e._readable2.removeListener("readable",l),e._readable2.removeListener("end",I),n()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:z0I(t),this._readable2.on("readable",l),this._readable2.on("end",I),this._unread=a,this._forward()};BG.prototype._read=function(){this._drained=!0,this._forward()};BG.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var t;this._drained&&(t=x0I(this._readable2))!==null;)this.destroyed||(this._drained=this.push(t));this._forwarding=!1}};BG.prototype.destroy=function(t,e){if(e||(e=U0I),this.destroyed)return e(null);this.destroyed=!0;var n=this;process.nextTick(function(){n._destroy(t),e(null)})};BG.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};BG.prototype._write=function(t,e,n){if(!this.destroyed){if(this._corked)return L_e(this,this._write.bind(this,t,e,n));if(t===mGn)return this._finish(n);if(!this._writable)return n();this._writable.write(t)===!1?this._ondrain=n:this.destroyed||n()}};BG.prototype._finish=function(t){var e=this;this.emit("preend"),L_e(this,function(){O0I(e._forwardEnd&&e._writable,function(){e._writableState.prefinished===!1&&(e._writableState.prefinished=!0),e.emit("prefinish"),L_e(e,t)})})};BG.prototype.end=function(t,e,n){return typeof t=="function"?this.end(null,null,t):typeof e=="function"?this.end(t,null,e):(this._ended=!0,t&&this.write(t),!this._writableState.ending&&!this._writableState.destroyed&&this.write(mGn),uVe.Writable.prototype.end.call(this,n))};hGn.exports=BG});var YGn=f((YVr,GVe)=>{"use strict";var{PassThrough:WGn}=require("stream"),B0I=JWe(),dVe=()=>{};typeof process<"u"&&"env"in process&&typeof process.env=="object"&&process.env.DEBUG==="retry-request"&&(dVe=t=>{console.log("retry-request:",t)});var NGn={objectMode:!1,retries:2,maxRetryDelay:64,retryDelayMultiplier:2,totalTimeout:600,noResponseRetries:2,currentRetryAttempt:0,shouldRetryFn:function(t){let e=[[100,199],[429,429],[500,599]],n=t.statusCode;dVe(`Response status: ${n}`);let l;for(;l=e.shift();)if(n>=l[0]&&n<=l[1])return!0}};function S0I(t,e,n){typeof t=="string"&&(t={url:t});let l=typeof arguments[arguments.length-1]!="function";typeof e=="function"&&(n=e);let I=e&&typeof e.currentRetryAttempt=="number";if(e=B0I({},NGn,e),typeof e.request>"u")throw new Error("A request library must be provided to retry-request.");let a=e.currentRetryAttempt,c=0,i=!1,s,r,u,o,d={abort:function(){o&&o.abort&&o.abort()}};l&&(s=new WGn({objectMode:e.objectMode}),s.abort=h);let b=Date.now();if(a>0?N(a):Z(),l)return s;return d;function h(){u=null,r&&(r.abort&&r.abort(),r.cancel&&r.cancel(),r.destroy?r.destroy():r.end&&r.end())}function Z(){let y=!1;a++,dVe(`Current retry attempt: ${a}`);function X(v=[]){y||(y=!0,s.emit("complete",...v))}l?(i=!1,u=new WGn({objectMode:e.objectMode}),r=e.request(t),setImmediate(()=>{s.emit("request")}),r.on("error",v=>{i||(i=!0,g(v))}).on("response",(v,H)=>{i||(i=!0,g(null,v,H))}).on("complete",(...v)=>X(v)).on("finish",(...v)=>X(v)),r.pipe(u)):o=e.request(t,g)}function N(y){l&&h();let X=VGn({maxRetryDelay:e.maxRetryDelay,retryDelayMultiplier:e.retryDelayMultiplier,retryNumber:y,timeOfFirstRequest:b,totalTimeout:e.totalTimeout});if(dVe(`Next retry delay: ${X}`),X<=0){c=e.noResponseRetries+1;return}setTimeout(Z,X)}function g(y,X,v){if(y){c++,c<=e.noResponseRetries?N(c):l?(s.emit("error",y),s.end()):n(y,X,v);return}if((I?a:a-1){s.destroy(Q)})):n(y,X,v)}}GVe.exports=S0I;function VGn(t){let{maxRetryDelay:e,retryDelayMultiplier:n,retryNumber:l,timeOfFirstRequest:I,totalTimeout:a}=t,c=e*1e3,i=a*1e3,s=Math.floor(Math.random()*1e3),r=Math.pow(n,l)*1e3+s,u=i-(Date.now()-I);return Math.min(r,u,c)}GVe.exports.defaults=NGn;GVe.exports.getNextRetryDelay=VGn});var bVe=f(n9=>{"use strict";Object.defineProperty(n9,"__esModule",{value:!0});n9.StreamProxy=n9.StreamType=void 0;var M0I=kw(),uC=VY(),k_e=UR(),T0I=require("stream"),D0I=ZGn(),K0I=YGn(),dC;(function(t){t[t.SERVER_STREAMING=1]="SERVER_STREAMING",t[t.CLIENT_STREAMING=2]="CLIENT_STREAMING",t[t.BIDI_STREAMING=3]="BIDI_STREAMING"})(dC||(n9.StreamType=dC={}));var _0I=null,x_e=class extends D0I{constructor(e,n,l,I){super(void 0,void 0,{objectMode:!0,readable:e!==dC.CLIENT_STREAMING,writable:e!==dC.SERVER_STREAMING}),this.type=e,this._callback=n,this._isCancelCalled=!1,this._responseHasSent=!1,this.rest=l,this.gaxServerStreamingRetries=I}shouldRetryRequest(e,n){let l=uC.GoogleError.parseGRPCStatusDetails(e),I=this.defaultShouldRetry(l,n);return n.shouldRetryFn&&(I=n.shouldRetryFn(l)),I}cancel(){this.stream?this.stream.cancel():this._isCancelCalled=!0}throwIfMaxRetriesOrTotalTimeoutExceeded(e,n,l,I,a,c){let s=new Date().getTime();if(a&&(l===0||l<0||e&&s>=e)){let r=new uC.GoogleError(`Total timeout of API exceeded ${a} milliseconds ${I?`retrying error ${I} `:""} before any response was received.`);throw r.code=k_e.Status.DEADLINE_EXCEEDED,r}if(n===0){let r=I;throw r.note="Max retries is set to zero.",r}if(c&&c>=n){let r=new uC.GoogleError("Exceeded maximum number of retries "+(I?`retrying error ${I} `:"")+"before any response was received");throw r.code=k_e.Status.DEADLINE_EXCEEDED,r}}eventForwardHelper(e){["metadata","response","status"].forEach(l=>{e.on(l,this.emit.bind(this,l))})}statusMetadataHelper(e){e.on("status",()=>{this._responseHasSent||e.emit("response",{code:200,details:"",message:"OK"})}),e.on("metadata",n=>{e.emit("response",{code:200,details:"",message:"OK",metadata:n}),this._responseHasSent=!0})}forwardEvents(e){this.eventForwardHelper(e),this.statusMetadataHelper(e),e.on("error",n=>{uC.GoogleError.parseGRPCStatusDetails(n)})}defaultShouldRetry(e,n){return!(n.retryCodes.length>0&&n.retryCodes.indexOf(e.code)<0||n.retryCodes.length===0)}setStream(e,n,l={},I){if(this.apiCall=e,this.argument=n,this.type===dC.SERVER_STREAMING){if(this.rest){let c=e(n,this._callback);this.stream=c,this.setReadable(c)}else if(this.gaxServerStreamingRetries){let c=()=>{if(this._isCancelCalled){this.stream&&this.stream.cancel();return}return e(n,this._callback)},i=this.newStreamingRetryRequest({request:c,retry:I});this.stream=i,this.eventForwardHelper(i),this.setReadable(i)}else{let c=K0I(null,{objectMode:!0,request:()=>{if(this._isCancelCalled){this.stream&&this.stream.cancel();return}let i=e(n,this._callback);return this.stream=i,this.forwardEvents(i),i},retries:l.retries,currentRetryAttempt:l.currentRetryAttempt,noResponseRetries:l.noResponseRetries,shouldRetryFn:l.shouldRetryFn});this.setReadable(c)}return}let a=e(n,this._callback);this.stream=a,this.forwardEvents(a),this.type===dC.CLIENT_STREAMING&&this.setWritable(a),this.type===dC.BIDI_STREAMING&&(this.setReadable(a),this.setWritable(a)),this._isCancelCalled&&this.stream&&this.stream.cancel()}newStreamingRetryRequest(e){var n,l,I,a;let c=(n=e.retry)!==null&&n!==void 0?n:{retryCodes:[],backoffSettings:(0,M0I.createDefaultBackoffSettings)()},i=0,s=new T0I.PassThrough({objectMode:!0}),r=(l=c.backoffSettings.totalTimeoutMillis)!==null&&l!==void 0?l:void 0,u=(I=c.backoffSettings.maxRetries)!==null&&I!==void 0?I:void 0,o=(a=c.backoffSettings.initialRpcTimeoutMillis)!==null&&a!==void 0?a:void 0,d=new Date,b=0;r&&(b=d.getTime()+r);let h=(N,g)=>{let y=uC.GoogleError.parseGRPCStatusDetails(N);return y.note="Exception occurred in retry method that was not classified as transient",g.destroy(),s.destroy(y),s},Z=N=>{let g=!1,y=!1,X=!1,v=N.request(_0I);return s.cancel=v.cancel,["metadata","response","status"].forEach(Q=>{v.on(Q,s.emit.bind(s,Q))}),this.statusMetadataHelper(v),v.on("data",Q=>{i=0,this.emit.bind(this,"data")(Q)}),v.on("status",()=>(y=!0,g&&s.end(),s)),v.on("end",()=>(X||(g=!0,y&&s.end()),s)),v.on("error",Q=>{if(X=!0,typeof u!==void 0||typeof r!==void 0)if(this.shouldRetryRequest(Q,c))if(u&&r){let L=new uC.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");return L.code=k_e.Status.INVALID_ARGUMENT,v.destroy(),s.destroy(L),s}else{try{this.throwIfMaxRetriesOrTotalTimeoutExceeded(b,u,o,Q,r,i)}catch(P){let le=uC.GoogleError.parseGRPCStatusDetails(P);return v.destroy(),s.destroy(le),s}let L=c.backoffSettings.retryDelayMultiplier,J=c.backoffSettings.maxRetryDelayMillis,O=c.backoffSettings.rpcTimeoutMultiplier,U=c.backoffSettings.maxRpcTimeoutMillis,K=c.backoffSettings.initialRetryDelayMillis,D=Math.random()*K;return(()=>{setTimeout(()=>{if(o){d=new Date,K=Math.min(K*L,J);let q=o&&O?o*O:0,ee=U||0,ne=b?b-d.getTime():0;o=Math.min(q,ee,ne)}i++;let P=this.argument;c.getResumptionRequestFn!==void 0&&(P=c.getResumptionRequestFn(P));let le=()=>{if(this._isCancelCalled){this.stream&&this.stream.cancel();return}return this.apiCall(P,this._callback)};return e.request=le,Z(e)},D)})()}else return h(Q,v);else return h(Q,v)}),s};return Z(e)}};n9.StreamProxy=x_e});var O_e=f(pVe=>{"use strict";Object.defineProperty(pVe,"__esModule",{value:!0});pVe.StreamingApiCaller=void 0;var P0I=PF(),mVe=bVe(),j_e=class{constructor(e){this.descriptor=e}init(e){return new mVe.StreamProxy(this.descriptor.type,e,this.descriptor.rest,this.descriptor.gaxStreamingRetries)}wrap(e){switch(this.descriptor.type){case mVe.StreamType.SERVER_STREAMING:return(n,l,I)=>e(n,l,I);case mVe.StreamType.CLIENT_STREAMING:return(n,l,I,a)=>e(l,I,a);case mVe.StreamType.BIDI_STREAMING:return(n,l,I)=>e(l,I);default:(0,P0I.warn)("streaming_wrap_unknown_stream_type",`Unknown stream type: ${this.descriptor.type}`)}return e}call(e,n,l,I){I.setStream(e,n,l.retryRequestOptions,l.retry)}fail(e,n){e.emit("error",n)}result(e){return e}};pVe.StreamingApiCaller=j_e});var mq=f(U_e=>{"use strict";Object.defineProperty(U_e,"__esModule",{value:!0});U_e.createApiCall=lFI;var gGn=ldn(),q0I=kw(),$0I=Idn(),eFI=i_e(),tFI=O_e(),nFI=PF();function lFI(t,e,n,l){let I=typeof t=="function"?Promise.resolve(t):t,a=(0,gGn.createAPICaller)(e,n);return(c,i,s)=>{var r,u;let o=a,d;if(o instanceof tFI.StreamingApiCaller){let h=(u=(r=o.descriptor)===null||r===void 0?void 0:r.gaxStreamingRetries)!==null&&u!==void 0?u:!1,Z=(0,q0I.convertRetryOptions)(i,h);d=e.merge(Z)}else d=e.merge(i);e.isBundling&&!d.isBundling&&(o=(0,gGn.createAPICaller)(e,void 0));let b=o.init(s);return I.then(h=>{var Z,N,g;h=o.wrap(h);let y=(Z=o.descriptor)===null||Z===void 0?void 0:Z.streaming,X=d.retry;if(y&&X&&(X.retryCodes.length>0&&X.shouldRetryFn&&((0,nFI.warn)("either_retrycodes_or_shouldretryfn","Only one of retryCodes or shouldRetryFn may be defined. Ignoring retryCodes."),X.retryCodes=[]),!o.descriptor.gaxStreamingRetries&&X.getResumptionRequestFn))throw new Error("getResumptionRequestFn can only be used when gaxStreamingRetries is set to true.");if(!y&&X){if(X.shouldRetryFn)throw new Error("Using a function to determine retry eligibility is only supported with server streaming calls");if(X.getResumptionRequestFn)throw new Error("Resumption strategy can only be used with server streaming retries");if(X.retryCodes&&X.retryCodes.length>0)return(N=(g=X.backoffSettings).initialRpcTimeoutMillis)!==null&&N!==void 0||(g.initialRpcTimeoutMillis=d.timeout),(0,$0I.retryable)(h,d.retry,d.otherArgs,d.apiName)}return(0,eFI.addTimeoutArg)(h,d.timeout,d.otherArgs)}).then(h=>{o.call(h,c,d,b)}).catch(h=>{o.fail(b,h)}),o.result(b)}}});var l9=f((AVr,RGn)=>{"use strict";RGn.exports=tTe()});var z_e=f((FVr,pq)=>{(t=>{typeof define=="function"&&define.amd?define(["protobufjs/minimal"],t):typeof require=="function"&&typeof pq=="object"&&pq&&pq.exports&&(pq.exports=t(l9()))})(function(t){var e,n,l,I,a=t.Reader,c=t.Writer,i=t.util,s=t.roots.operations_protos||(t.roots.operations_protos={});function r(p,V,F){t.rpc.Service.call(this,p,V,F)}function u(p){if(p)for(var V=Object.keys(p),F=0;F>>3){case 1:G.name=p.string();break;case 2:G.metadata=s.google.protobuf.Any.decode(p,p.uint32());break;case 3:G.done=p.bool();break;case 4:G.error=s.google.rpc.Status.decode(p,p.uint32());break;case 5:G.response=s.google.protobuf.Any.decode(p,p.uint32());break;default:p.skipType(7&W)}}return G},u.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},u.verify=function(p){if(typeof p!="object"||p===null)return"object expected";var V,F={};if(p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name))return"name: string expected";if(p.metadata!=null&&p.hasOwnProperty("metadata")&&(V=s.google.protobuf.Any.verify(p.metadata)))return"metadata."+V;if(p.done!=null&&p.hasOwnProperty("done")&&typeof p.done!="boolean")return"done: boolean expected";if(p.error!=null&&p.hasOwnProperty("error")&&(F.result=1,V=s.google.rpc.Status.verify(p.error)))return"error."+V;if(p.response!=null&&p.hasOwnProperty("response")){if(F.result===1)return"result: multiple values";if(F.result=1,V=s.google.protobuf.Any.verify(p.response))return"response."+V}return null},u.fromObject=function(p){if(p instanceof s.google.longrunning.Operation)return p;var V=new s.google.longrunning.Operation;if(p.name!=null&&(V.name=String(p.name)),p.metadata!=null){if(typeof p.metadata!="object")throw TypeError(".google.longrunning.Operation.metadata: object expected");V.metadata=s.google.protobuf.Any.fromObject(p.metadata)}if(p.done!=null&&(V.done=!!p.done),p.error!=null){if(typeof p.error!="object")throw TypeError(".google.longrunning.Operation.error: object expected");V.error=s.google.rpc.Status.fromObject(p.error)}if(p.response!=null){if(typeof p.response!="object")throw TypeError(".google.longrunning.Operation.response: object expected");V.response=s.google.protobuf.Any.fromObject(p.response)}return V},u.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name="",F.metadata=null,F.done=!1),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),p.metadata!=null&&p.hasOwnProperty("metadata")&&(F.metadata=s.google.protobuf.Any.toObject(p.metadata,V)),p.done!=null&&p.hasOwnProperty("done")&&(F.done=p.done),p.error!=null&&p.hasOwnProperty("error")&&(F.error=s.google.rpc.Status.toObject(p.error,V),V.oneofs)&&(F.result="error"),p.response!=null&&p.hasOwnProperty("response")&&(F.response=s.google.protobuf.Any.toObject(p.response,V),V.oneofs)&&(F.result="response"),F},u.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},u),n.GetOperationRequest=(o.prototype.name="",o.create=function(p){return new o(p)},o.encode=function(p,V){return V=V||c.create(),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(10).string(p.name),V},o.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},o.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.longrunning.GetOperationRequest;p.pos>>3==1?G.name=p.string():p.skipType(7&W)}return G},o.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},o.verify=function(p){return typeof p!="object"||p===null?"object expected":p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name)?"name: string expected":null},o.fromObject=function(p){var V;return p instanceof s.google.longrunning.GetOperationRequest?p:(V=new s.google.longrunning.GetOperationRequest,p.name!=null&&(V.name=String(p.name)),V)},o.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name=""),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),F},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o),n.ListOperationsRequest=(d.prototype.name="",d.prototype.filter="",d.prototype.pageSize=0,d.prototype.pageToken="",d.create=function(p){return new d(p)},d.encode=function(p,V){return V=V||c.create(),p.filter!=null&&Object.hasOwnProperty.call(p,"filter")&&V.uint32(10).string(p.filter),p.pageSize!=null&&Object.hasOwnProperty.call(p,"pageSize")&&V.uint32(16).int32(p.pageSize),p.pageToken!=null&&Object.hasOwnProperty.call(p,"pageToken")&&V.uint32(26).string(p.pageToken),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(34).string(p.name),V},d.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},d.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.longrunning.ListOperationsRequest;p.pos>>3){case 4:G.name=p.string();break;case 1:G.filter=p.string();break;case 2:G.pageSize=p.int32();break;case 3:G.pageToken=p.string();break;default:p.skipType(7&W)}}return G},d.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},d.verify=function(p){return typeof p!="object"||p===null?"object expected":p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name)?"name: string expected":p.filter!=null&&p.hasOwnProperty("filter")&&!i.isString(p.filter)?"filter: string expected":p.pageSize!=null&&p.hasOwnProperty("pageSize")&&!i.isInteger(p.pageSize)?"pageSize: integer expected":p.pageToken!=null&&p.hasOwnProperty("pageToken")&&!i.isString(p.pageToken)?"pageToken: string expected":null},d.fromObject=function(p){var V;return p instanceof s.google.longrunning.ListOperationsRequest?p:(V=new s.google.longrunning.ListOperationsRequest,p.name!=null&&(V.name=String(p.name)),p.filter!=null&&(V.filter=String(p.filter)),p.pageSize!=null&&(V.pageSize=0|p.pageSize),p.pageToken!=null&&(V.pageToken=String(p.pageToken)),V)},d.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.filter="",F.pageSize=0,F.pageToken="",F.name=""),p.filter!=null&&p.hasOwnProperty("filter")&&(F.filter=p.filter),p.pageSize!=null&&p.hasOwnProperty("pageSize")&&(F.pageSize=p.pageSize),p.pageToken!=null&&p.hasOwnProperty("pageToken")&&(F.pageToken=p.pageToken),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),F},d.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},d),n.ListOperationsResponse=(b.prototype.operations=i.emptyArray,b.prototype.nextPageToken="",b.create=function(p){return new b(p)},b.encode=function(p,V){if(V=V||c.create(),p.operations!=null&&p.operations.length)for(var F=0;F>>3){case 1:G.operations&&G.operations.length||(G.operations=[]),G.operations.push(s.google.longrunning.Operation.decode(p,p.uint32()));break;case 2:G.nextPageToken=p.string();break;default:p.skipType(7&W)}}return G},b.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},b.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.operations!=null&&p.hasOwnProperty("operations")){if(!Array.isArray(p.operations))return"operations: array expected";for(var V=0;V>>3==1?G.name=p.string():p.skipType(7&W)}return G},h.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},h.verify=function(p){return typeof p!="object"||p===null?"object expected":p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name)?"name: string expected":null},h.fromObject=function(p){var V;return p instanceof s.google.longrunning.CancelOperationRequest?p:(V=new s.google.longrunning.CancelOperationRequest,p.name!=null&&(V.name=String(p.name)),V)},h.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name=""),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),F},h.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},h),n.DeleteOperationRequest=(Z.prototype.name="",Z.create=function(p){return new Z(p)},Z.encode=function(p,V){return V=V||c.create(),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(10).string(p.name),V},Z.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},Z.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.longrunning.DeleteOperationRequest;p.pos>>3==1?G.name=p.string():p.skipType(7&W)}return G},Z.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},Z.verify=function(p){return typeof p!="object"||p===null?"object expected":p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name)?"name: string expected":null},Z.fromObject=function(p){var V;return p instanceof s.google.longrunning.DeleteOperationRequest?p:(V=new s.google.longrunning.DeleteOperationRequest,p.name!=null&&(V.name=String(p.name)),V)},Z.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name=""),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),F},Z.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},Z),n.WaitOperationRequest=(N.prototype.name="",N.prototype.timeout=null,N.create=function(p){return new N(p)},N.encode=function(p,V){return V=V||c.create(),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(10).string(p.name),p.timeout!=null&&Object.hasOwnProperty.call(p,"timeout")&&s.google.protobuf.Duration.encode(p.timeout,V.uint32(18).fork()).ldelim(),V},N.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},N.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.longrunning.WaitOperationRequest;p.pos>>3){case 1:G.name=p.string();break;case 2:G.timeout=s.google.protobuf.Duration.decode(p,p.uint32());break;default:p.skipType(7&W)}}return G},N.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},N.verify=function(p){return typeof p!="object"||p===null?"object expected":p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name)?"name: string expected":p.timeout!=null&&p.hasOwnProperty("timeout")&&(p=s.google.protobuf.Duration.verify(p.timeout),p)?"timeout."+p:null},N.fromObject=function(p){if(p instanceof s.google.longrunning.WaitOperationRequest)return p;var V=new s.google.longrunning.WaitOperationRequest;if(p.name!=null&&(V.name=String(p.name)),p.timeout!=null){if(typeof p.timeout!="object")throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected");V.timeout=s.google.protobuf.Duration.fromObject(p.timeout)}return V},N.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name="",F.timeout=null),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),p.timeout!=null&&p.hasOwnProperty("timeout")&&(F.timeout=s.google.protobuf.Duration.toObject(p.timeout,V)),F},N.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},N),n.OperationInfo=(g.prototype.responseType="",g.prototype.metadataType="",g.create=function(p){return new g(p)},g.encode=function(p,V){return V=V||c.create(),p.responseType!=null&&Object.hasOwnProperty.call(p,"responseType")&&V.uint32(10).string(p.responseType),p.metadataType!=null&&Object.hasOwnProperty.call(p,"metadataType")&&V.uint32(18).string(p.metadataType),V},g.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},g.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.longrunning.OperationInfo;p.pos>>3){case 1:G.responseType=p.string();break;case 2:G.metadataType=p.string();break;default:p.skipType(7&W)}}return G},g.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},g.verify=function(p){return typeof p!="object"||p===null?"object expected":p.responseType!=null&&p.hasOwnProperty("responseType")&&!i.isString(p.responseType)?"responseType: string expected":p.metadataType!=null&&p.hasOwnProperty("metadataType")&&!i.isString(p.metadataType)?"metadataType: string expected":null},g.fromObject=function(p){var V;return p instanceof s.google.longrunning.OperationInfo?p:(V=new s.google.longrunning.OperationInfo,p.responseType!=null&&(V.responseType=String(p.responseType)),p.metadataType!=null&&(V.metadataType=String(p.metadataType)),V)},g.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.responseType="",F.metadataType=""),p.responseType!=null&&p.hasOwnProperty("responseType")&&(F.responseType=p.responseType),p.metadataType!=null&&p.hasOwnProperty("metadataType")&&(F.metadataType=p.metadataType),F},g.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},g),n),I.api=((l={}).Http=(y.prototype.rules=i.emptyArray,y.prototype.fullyDecodeReservedExpansion=!1,y.create=function(p){return new y(p)},y.encode=function(p,V){if(V=V||c.create(),p.rules!=null&&p.rules.length)for(var F=0;F>>3){case 1:G.rules&&G.rules.length||(G.rules=[]),G.rules.push(s.google.api.HttpRule.decode(p,p.uint32()));break;case 2:G.fullyDecodeReservedExpansion=p.bool();break;default:p.skipType(7&W)}}return G},y.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},y.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.rules!=null&&p.hasOwnProperty("rules")){if(!Array.isArray(p.rules))return"rules: array expected";for(var V=0;V>>3){case 1:G.selector=p.string();break;case 2:G.get=p.string();break;case 3:G.put=p.string();break;case 4:G.post=p.string();break;case 5:G.delete=p.string();break;case 6:G.patch=p.string();break;case 8:G.custom=s.google.api.CustomHttpPattern.decode(p,p.uint32());break;case 7:G.body=p.string();break;case 12:G.responseBody=p.string();break;case 11:G.additionalBindings&&G.additionalBindings.length||(G.additionalBindings=[]),G.additionalBindings.push(s.google.api.HttpRule.decode(p,p.uint32()));break;default:p.skipType(7&W)}}return G},X.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},X.verify=function(p){if(typeof p!="object"||p===null)return"object expected";var V={};if(p.selector!=null&&p.hasOwnProperty("selector")&&!i.isString(p.selector))return"selector: string expected";if(p.get!=null&&p.hasOwnProperty("get")&&(V.pattern=1,!i.isString(p.get)))return"get: string expected";if(p.put!=null&&p.hasOwnProperty("put")){if(V.pattern===1)return"pattern: multiple values";if(V.pattern=1,!i.isString(p.put))return"put: string expected"}if(p.post!=null&&p.hasOwnProperty("post")){if(V.pattern===1)return"pattern: multiple values";if(V.pattern=1,!i.isString(p.post))return"post: string expected"}if(p.delete!=null&&p.hasOwnProperty("delete")){if(V.pattern===1)return"pattern: multiple values";if(V.pattern=1,!i.isString(p.delete))return"delete: string expected"}if(p.patch!=null&&p.hasOwnProperty("patch")){if(V.pattern===1)return"pattern: multiple values";if(V.pattern=1,!i.isString(p.patch))return"patch: string expected"}if(p.custom!=null&&p.hasOwnProperty("custom")){if(V.pattern===1)return"pattern: multiple values";if(V.pattern=1,F=s.google.api.CustomHttpPattern.verify(p.custom))return"custom."+F}if(p.body!=null&&p.hasOwnProperty("body")&&!i.isString(p.body))return"body: string expected";if(p.responseBody!=null&&p.hasOwnProperty("responseBody")&&!i.isString(p.responseBody))return"responseBody: string expected";if(p.additionalBindings!=null&&p.hasOwnProperty("additionalBindings")){if(!Array.isArray(p.additionalBindings))return"additionalBindings: array expected";for(var F,G=0;G>>3){case 1:G.kind=p.string();break;case 2:G.path=p.string();break;default:p.skipType(7&W)}}return G},v.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},v.verify=function(p){return typeof p!="object"||p===null?"object expected":p.kind!=null&&p.hasOwnProperty("kind")&&!i.isString(p.kind)?"kind: string expected":p.path!=null&&p.hasOwnProperty("path")&&!i.isString(p.path)?"path: string expected":null},v.fromObject=function(p){var V;return p instanceof s.google.api.CustomHttpPattern?p:(V=new s.google.api.CustomHttpPattern,p.kind!=null&&(V.kind=String(p.kind)),p.path!=null&&(V.path=String(p.path)),V)},v.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.kind="",F.path=""),p.kind!=null&&p.hasOwnProperty("kind")&&(F.kind=p.kind),p.path!=null&&p.hasOwnProperty("path")&&(F.path=p.path),F},v.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},v),l),I.protobuf=((n={}).FileDescriptorSet=(H.prototype.file=i.emptyArray,H.create=function(p){return new H(p)},H.encode=function(p,V){if(V=V||c.create(),p.file!=null&&p.file.length)for(var F=0;F>>3==1?(G.file&&G.file.length||(G.file=[]),G.file.push(s.google.protobuf.FileDescriptorProto.decode(p,p.uint32()))):p.skipType(7&W)}return G},H.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},H.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.file!=null&&p.hasOwnProperty("file")){if(!Array.isArray(p.file))return"file: array expected";for(var V=0;V>>3){case 1:G.name=p.string();break;case 2:G.package=p.string();break;case 3:G.dependency&&G.dependency.length||(G.dependency=[]),G.dependency.push(p.string());break;case 10:if(G.publicDependency&&G.publicDependency.length||(G.publicDependency=[]),(7&W)==2)for(var A=p.uint32()+p.pos;p.pos>>3){case 1:G.name=p.string();break;case 2:G.field&&G.field.length||(G.field=[]),G.field.push(s.google.protobuf.FieldDescriptorProto.decode(p,p.uint32()));break;case 6:G.extension&&G.extension.length||(G.extension=[]),G.extension.push(s.google.protobuf.FieldDescriptorProto.decode(p,p.uint32()));break;case 3:G.nestedType&&G.nestedType.length||(G.nestedType=[]),G.nestedType.push(s.google.protobuf.DescriptorProto.decode(p,p.uint32()));break;case 4:G.enumType&&G.enumType.length||(G.enumType=[]),G.enumType.push(s.google.protobuf.EnumDescriptorProto.decode(p,p.uint32()));break;case 5:G.extensionRange&&G.extensionRange.length||(G.extensionRange=[]),G.extensionRange.push(s.google.protobuf.DescriptorProto.ExtensionRange.decode(p,p.uint32()));break;case 8:G.oneofDecl&&G.oneofDecl.length||(G.oneofDecl=[]),G.oneofDecl.push(s.google.protobuf.OneofDescriptorProto.decode(p,p.uint32()));break;case 7:G.options=s.google.protobuf.MessageOptions.decode(p,p.uint32());break;case 9:G.reservedRange&&G.reservedRange.length||(G.reservedRange=[]),G.reservedRange.push(s.google.protobuf.DescriptorProto.ReservedRange.decode(p,p.uint32()));break;case 10:G.reservedName&&G.reservedName.length||(G.reservedName=[]),G.reservedName.push(p.string());break;default:p.skipType(7&W)}}return G},L.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},L.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name))return"name: string expected";if(p.field!=null&&p.hasOwnProperty("field")){if(!Array.isArray(p.field))return"field: array expected";for(var V=0;V>>3){case 1:G.start=p.int32();break;case 2:G.end=p.int32();break;case 3:G.options=s.google.protobuf.ExtensionRangeOptions.decode(p,p.uint32());break;default:p.skipType(7&W)}}return G},J.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},J.verify=function(p){return typeof p!="object"||p===null?"object expected":p.start!=null&&p.hasOwnProperty("start")&&!i.isInteger(p.start)?"start: integer expected":p.end!=null&&p.hasOwnProperty("end")&&!i.isInteger(p.end)?"end: integer expected":p.options!=null&&p.hasOwnProperty("options")&&(p=s.google.protobuf.ExtensionRangeOptions.verify(p.options),p)?"options."+p:null},J.fromObject=function(p){if(p instanceof s.google.protobuf.DescriptorProto.ExtensionRange)return p;var V=new s.google.protobuf.DescriptorProto.ExtensionRange;if(p.start!=null&&(V.start=0|p.start),p.end!=null&&(V.end=0|p.end),p.options!=null){if(typeof p.options!="object")throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");V.options=s.google.protobuf.ExtensionRangeOptions.fromObject(p.options)}return V},J.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.start=0,F.end=0,F.options=null),p.start!=null&&p.hasOwnProperty("start")&&(F.start=p.start),p.end!=null&&p.hasOwnProperty("end")&&(F.end=p.end),p.options!=null&&p.hasOwnProperty("options")&&(F.options=s.google.protobuf.ExtensionRangeOptions.toObject(p.options,V)),F},J.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},J),L.ReservedRange=(O.prototype.start=0,O.prototype.end=0,O.create=function(p){return new O(p)},O.encode=function(p,V){return V=V||c.create(),p.start!=null&&Object.hasOwnProperty.call(p,"start")&&V.uint32(8).int32(p.start),p.end!=null&&Object.hasOwnProperty.call(p,"end")&&V.uint32(16).int32(p.end),V},O.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},O.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.protobuf.DescriptorProto.ReservedRange;p.pos>>3){case 1:G.start=p.int32();break;case 2:G.end=p.int32();break;default:p.skipType(7&W)}}return G},O.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},O.verify=function(p){return typeof p!="object"||p===null?"object expected":p.start!=null&&p.hasOwnProperty("start")&&!i.isInteger(p.start)?"start: integer expected":p.end!=null&&p.hasOwnProperty("end")&&!i.isInteger(p.end)?"end: integer expected":null},O.fromObject=function(p){var V;return p instanceof s.google.protobuf.DescriptorProto.ReservedRange?p:(V=new s.google.protobuf.DescriptorProto.ReservedRange,p.start!=null&&(V.start=0|p.start),p.end!=null&&(V.end=0|p.end),V)},O.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.start=0,F.end=0),p.start!=null&&p.hasOwnProperty("start")&&(F.start=p.start),p.end!=null&&p.hasOwnProperty("end")&&(F.end=p.end),F},O.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},O),L),n.ExtensionRangeOptions=(U.prototype.uninterpretedOption=i.emptyArray,U.create=function(p){return new U(p)},U.encode=function(p,V){if(V=V||c.create(),p.uninterpretedOption!=null&&p.uninterpretedOption.length)for(var F=0;F>>3==999?(G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()))):p.skipType(7&W)}return G},U.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},U.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 1:G.name=p.string();break;case 3:G.number=p.int32();break;case 4:G.label=p.int32();break;case 5:G.type=p.int32();break;case 6:G.typeName=p.string();break;case 2:G.extendee=p.string();break;case 7:G.defaultValue=p.string();break;case 9:G.oneofIndex=p.int32();break;case 10:G.jsonName=p.string();break;case 8:G.options=s.google.protobuf.FieldOptions.decode(p,p.uint32());break;case 17:G.proto3Optional=p.bool();break;default:p.skipType(7&W)}}return G},K.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},K.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name))return"name: string expected";if(p.number!=null&&p.hasOwnProperty("number")&&!i.isInteger(p.number))return"number: integer expected";if(p.label!=null&&p.hasOwnProperty("label"))switch(p.label){default:return"label: enum value expected";case 1:case 2:case 3:}if(p.type!=null&&p.hasOwnProperty("type"))switch(p.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(p.typeName!=null&&p.hasOwnProperty("typeName")&&!i.isString(p.typeName))return"typeName: string expected";if(p.extendee!=null&&p.hasOwnProperty("extendee")&&!i.isString(p.extendee))return"extendee: string expected";if(p.defaultValue!=null&&p.hasOwnProperty("defaultValue")&&!i.isString(p.defaultValue))return"defaultValue: string expected";if(p.oneofIndex!=null&&p.hasOwnProperty("oneofIndex")&&!i.isInteger(p.oneofIndex))return"oneofIndex: integer expected";if(p.jsonName!=null&&p.hasOwnProperty("jsonName")&&!i.isString(p.jsonName))return"jsonName: string expected";if(p.options!=null&&p.hasOwnProperty("options")){var V=s.google.protobuf.FieldOptions.verify(p.options);if(V)return"options."+V}return p.proto3Optional!=null&&p.hasOwnProperty("proto3Optional")&&typeof p.proto3Optional!="boolean"?"proto3Optional: boolean expected":null},K.fromObject=function(p){if(p instanceof s.google.protobuf.FieldDescriptorProto)return p;var V=new s.google.protobuf.FieldDescriptorProto;switch(p.name!=null&&(V.name=String(p.name)),p.number!=null&&(V.number=0|p.number),p.label){case"LABEL_OPTIONAL":case 1:V.label=1;break;case"LABEL_REQUIRED":case 2:V.label=2;break;case"LABEL_REPEATED":case 3:V.label=3}switch(p.type){case"TYPE_DOUBLE":case 1:V.type=1;break;case"TYPE_FLOAT":case 2:V.type=2;break;case"TYPE_INT64":case 3:V.type=3;break;case"TYPE_UINT64":case 4:V.type=4;break;case"TYPE_INT32":case 5:V.type=5;break;case"TYPE_FIXED64":case 6:V.type=6;break;case"TYPE_FIXED32":case 7:V.type=7;break;case"TYPE_BOOL":case 8:V.type=8;break;case"TYPE_STRING":case 9:V.type=9;break;case"TYPE_GROUP":case 10:V.type=10;break;case"TYPE_MESSAGE":case 11:V.type=11;break;case"TYPE_BYTES":case 12:V.type=12;break;case"TYPE_UINT32":case 13:V.type=13;break;case"TYPE_ENUM":case 14:V.type=14;break;case"TYPE_SFIXED32":case 15:V.type=15;break;case"TYPE_SFIXED64":case 16:V.type=16;break;case"TYPE_SINT32":case 17:V.type=17;break;case"TYPE_SINT64":case 18:V.type=18}if(p.typeName!=null&&(V.typeName=String(p.typeName)),p.extendee!=null&&(V.extendee=String(p.extendee)),p.defaultValue!=null&&(V.defaultValue=String(p.defaultValue)),p.oneofIndex!=null&&(V.oneofIndex=0|p.oneofIndex),p.jsonName!=null&&(V.jsonName=String(p.jsonName)),p.options!=null){if(typeof p.options!="object")throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");V.options=s.google.protobuf.FieldOptions.fromObject(p.options)}return p.proto3Optional!=null&&(V.proto3Optional=!!p.proto3Optional),V},K.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name="",F.extendee="",F.number=0,F.label=V.enums===String?"LABEL_OPTIONAL":1,F.type=V.enums===String?"TYPE_DOUBLE":1,F.typeName="",F.defaultValue="",F.options=null,F.oneofIndex=0,F.jsonName="",F.proto3Optional=!1),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),p.extendee!=null&&p.hasOwnProperty("extendee")&&(F.extendee=p.extendee),p.number!=null&&p.hasOwnProperty("number")&&(F.number=p.number),p.label!=null&&p.hasOwnProperty("label")&&(F.label=V.enums===String?s.google.protobuf.FieldDescriptorProto.Label[p.label]:p.label),p.type!=null&&p.hasOwnProperty("type")&&(F.type=V.enums===String?s.google.protobuf.FieldDescriptorProto.Type[p.type]:p.type),p.typeName!=null&&p.hasOwnProperty("typeName")&&(F.typeName=p.typeName),p.defaultValue!=null&&p.hasOwnProperty("defaultValue")&&(F.defaultValue=p.defaultValue),p.options!=null&&p.hasOwnProperty("options")&&(F.options=s.google.protobuf.FieldOptions.toObject(p.options,V)),p.oneofIndex!=null&&p.hasOwnProperty("oneofIndex")&&(F.oneofIndex=p.oneofIndex),p.jsonName!=null&&p.hasOwnProperty("jsonName")&&(F.jsonName=p.jsonName),p.proto3Optional!=null&&p.hasOwnProperty("proto3Optional")&&(F.proto3Optional=p.proto3Optional),F},K.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},K.Type=(l={},(e=Object.create(l))[l[1]="TYPE_DOUBLE"]=1,e[l[2]="TYPE_FLOAT"]=2,e[l[3]="TYPE_INT64"]=3,e[l[4]="TYPE_UINT64"]=4,e[l[5]="TYPE_INT32"]=5,e[l[6]="TYPE_FIXED64"]=6,e[l[7]="TYPE_FIXED32"]=7,e[l[8]="TYPE_BOOL"]=8,e[l[9]="TYPE_STRING"]=9,e[l[10]="TYPE_GROUP"]=10,e[l[11]="TYPE_MESSAGE"]=11,e[l[12]="TYPE_BYTES"]=12,e[l[13]="TYPE_UINT32"]=13,e[l[14]="TYPE_ENUM"]=14,e[l[15]="TYPE_SFIXED32"]=15,e[l[16]="TYPE_SFIXED64"]=16,e[l[17]="TYPE_SINT32"]=17,e[l[18]="TYPE_SINT64"]=18,e),K.Label=(l={},(e=Object.create(l))[l[1]="LABEL_OPTIONAL"]=1,e[l[2]="LABEL_REQUIRED"]=2,e[l[3]="LABEL_REPEATED"]=3,e),K),n.OneofDescriptorProto=(D.prototype.name="",D.prototype.options=null,D.create=function(p){return new D(p)},D.encode=function(p,V){return V=V||c.create(),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(10).string(p.name),p.options!=null&&Object.hasOwnProperty.call(p,"options")&&s.google.protobuf.OneofOptions.encode(p.options,V.uint32(18).fork()).ldelim(),V},D.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},D.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.protobuf.OneofDescriptorProto;p.pos>>3){case 1:G.name=p.string();break;case 2:G.options=s.google.protobuf.OneofOptions.decode(p,p.uint32());break;default:p.skipType(7&W)}}return G},D.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},D.verify=function(p){return typeof p!="object"||p===null?"object expected":p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name)?"name: string expected":p.options!=null&&p.hasOwnProperty("options")&&(p=s.google.protobuf.OneofOptions.verify(p.options),p)?"options."+p:null},D.fromObject=function(p){if(p instanceof s.google.protobuf.OneofDescriptorProto)return p;var V=new s.google.protobuf.OneofDescriptorProto;if(p.name!=null&&(V.name=String(p.name)),p.options!=null){if(typeof p.options!="object")throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");V.options=s.google.protobuf.OneofOptions.fromObject(p.options)}return V},D.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name="",F.options=null),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),p.options!=null&&p.hasOwnProperty("options")&&(F.options=s.google.protobuf.OneofOptions.toObject(p.options,V)),F},D.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},D),n.EnumDescriptorProto=(_.prototype.name="",_.prototype.value=i.emptyArray,_.prototype.options=null,_.prototype.reservedRange=i.emptyArray,_.prototype.reservedName=i.emptyArray,_.create=function(p){return new _(p)},_.encode=function(p,V){if(V=V||c.create(),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(10).string(p.name),p.value!=null&&p.value.length)for(var F=0;F>>3){case 1:G.name=p.string();break;case 2:G.value&&G.value.length||(G.value=[]),G.value.push(s.google.protobuf.EnumValueDescriptorProto.decode(p,p.uint32()));break;case 3:G.options=s.google.protobuf.EnumOptions.decode(p,p.uint32());break;case 4:G.reservedRange&&G.reservedRange.length||(G.reservedRange=[]),G.reservedRange.push(s.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(p,p.uint32()));break;case 5:G.reservedName&&G.reservedName.length||(G.reservedName=[]),G.reservedName.push(p.string());break;default:p.skipType(7&W)}}return G},_.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},_.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name))return"name: string expected";if(p.value!=null&&p.hasOwnProperty("value")){if(!Array.isArray(p.value))return"value: array expected";for(var V=0;V>>3){case 1:G.start=p.int32();break;case 2:G.end=p.int32();break;default:p.skipType(7&W)}}return G},P.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},P.verify=function(p){return typeof p!="object"||p===null?"object expected":p.start!=null&&p.hasOwnProperty("start")&&!i.isInteger(p.start)?"start: integer expected":p.end!=null&&p.hasOwnProperty("end")&&!i.isInteger(p.end)?"end: integer expected":null},P.fromObject=function(p){var V;return p instanceof s.google.protobuf.EnumDescriptorProto.EnumReservedRange?p:(V=new s.google.protobuf.EnumDescriptorProto.EnumReservedRange,p.start!=null&&(V.start=0|p.start),p.end!=null&&(V.end=0|p.end),V)},P.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.start=0,F.end=0),p.start!=null&&p.hasOwnProperty("start")&&(F.start=p.start),p.end!=null&&p.hasOwnProperty("end")&&(F.end=p.end),F},P.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},P),_),n.EnumValueDescriptorProto=(le.prototype.name="",le.prototype.number=0,le.prototype.options=null,le.create=function(p){return new le(p)},le.encode=function(p,V){return V=V||c.create(),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(10).string(p.name),p.number!=null&&Object.hasOwnProperty.call(p,"number")&&V.uint32(16).int32(p.number),p.options!=null&&Object.hasOwnProperty.call(p,"options")&&s.google.protobuf.EnumValueOptions.encode(p.options,V.uint32(26).fork()).ldelim(),V},le.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},le.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.protobuf.EnumValueDescriptorProto;p.pos>>3){case 1:G.name=p.string();break;case 2:G.number=p.int32();break;case 3:G.options=s.google.protobuf.EnumValueOptions.decode(p,p.uint32());break;default:p.skipType(7&W)}}return G},le.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},le.verify=function(p){return typeof p!="object"||p===null?"object expected":p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name)?"name: string expected":p.number!=null&&p.hasOwnProperty("number")&&!i.isInteger(p.number)?"number: integer expected":p.options!=null&&p.hasOwnProperty("options")&&(p=s.google.protobuf.EnumValueOptions.verify(p.options),p)?"options."+p:null},le.fromObject=function(p){if(p instanceof s.google.protobuf.EnumValueDescriptorProto)return p;var V=new s.google.protobuf.EnumValueDescriptorProto;if(p.name!=null&&(V.name=String(p.name)),p.number!=null&&(V.number=0|p.number),p.options!=null){if(typeof p.options!="object")throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");V.options=s.google.protobuf.EnumValueOptions.fromObject(p.options)}return V},le.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name="",F.number=0,F.options=null),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),p.number!=null&&p.hasOwnProperty("number")&&(F.number=p.number),p.options!=null&&p.hasOwnProperty("options")&&(F.options=s.google.protobuf.EnumValueOptions.toObject(p.options,V)),F},le.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},le),n.ServiceDescriptorProto=(q.prototype.name="",q.prototype.method=i.emptyArray,q.prototype.options=null,q.create=function(p){return new q(p)},q.encode=function(p,V){if(V=V||c.create(),p.name!=null&&Object.hasOwnProperty.call(p,"name")&&V.uint32(10).string(p.name),p.method!=null&&p.method.length)for(var F=0;F>>3){case 1:G.name=p.string();break;case 2:G.method&&G.method.length||(G.method=[]),G.method.push(s.google.protobuf.MethodDescriptorProto.decode(p,p.uint32()));break;case 3:G.options=s.google.protobuf.ServiceOptions.decode(p,p.uint32());break;default:p.skipType(7&W)}}return G},q.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},q.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name))return"name: string expected";if(p.method!=null&&p.hasOwnProperty("method")){if(!Array.isArray(p.method))return"method: array expected";for(var V=0;V>>3){case 1:G.name=p.string();break;case 2:G.inputType=p.string();break;case 3:G.outputType=p.string();break;case 4:G.options=s.google.protobuf.MethodOptions.decode(p,p.uint32());break;case 5:G.clientStreaming=p.bool();break;case 6:G.serverStreaming=p.bool();break;default:p.skipType(7&W)}}return G},ee.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},ee.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.name!=null&&p.hasOwnProperty("name")&&!i.isString(p.name))return"name: string expected";if(p.inputType!=null&&p.hasOwnProperty("inputType")&&!i.isString(p.inputType))return"inputType: string expected";if(p.outputType!=null&&p.hasOwnProperty("outputType")&&!i.isString(p.outputType))return"outputType: string expected";if(p.options!=null&&p.hasOwnProperty("options")){var V=s.google.protobuf.MethodOptions.verify(p.options);if(V)return"options."+V}return p.clientStreaming!=null&&p.hasOwnProperty("clientStreaming")&&typeof p.clientStreaming!="boolean"?"clientStreaming: boolean expected":p.serverStreaming!=null&&p.hasOwnProperty("serverStreaming")&&typeof p.serverStreaming!="boolean"?"serverStreaming: boolean expected":null},ee.fromObject=function(p){if(p instanceof s.google.protobuf.MethodDescriptorProto)return p;var V=new s.google.protobuf.MethodDescriptorProto;if(p.name!=null&&(V.name=String(p.name)),p.inputType!=null&&(V.inputType=String(p.inputType)),p.outputType!=null&&(V.outputType=String(p.outputType)),p.options!=null){if(typeof p.options!="object")throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");V.options=s.google.protobuf.MethodOptions.fromObject(p.options)}return p.clientStreaming!=null&&(V.clientStreaming=!!p.clientStreaming),p.serverStreaming!=null&&(V.serverStreaming=!!p.serverStreaming),V},ee.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.name="",F.inputType="",F.outputType="",F.options=null,F.clientStreaming=!1,F.serverStreaming=!1),p.name!=null&&p.hasOwnProperty("name")&&(F.name=p.name),p.inputType!=null&&p.hasOwnProperty("inputType")&&(F.inputType=p.inputType),p.outputType!=null&&p.hasOwnProperty("outputType")&&(F.outputType=p.outputType),p.options!=null&&p.hasOwnProperty("options")&&(F.options=s.google.protobuf.MethodOptions.toObject(p.options,V)),p.clientStreaming!=null&&p.hasOwnProperty("clientStreaming")&&(F.clientStreaming=p.clientStreaming),p.serverStreaming!=null&&p.hasOwnProperty("serverStreaming")&&(F.serverStreaming=p.serverStreaming),F},ee.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},ee),n.FileOptions=(ne.prototype.javaPackage="",ne.prototype.javaOuterClassname="",ne.prototype.javaMultipleFiles=!1,ne.prototype.javaGenerateEqualsAndHash=!1,ne.prototype.javaStringCheckUtf8=!1,ne.prototype.optimizeFor=1,ne.prototype.goPackage="",ne.prototype.ccGenericServices=!1,ne.prototype.javaGenericServices=!1,ne.prototype.pyGenericServices=!1,ne.prototype.phpGenericServices=!1,ne.prototype.deprecated=!1,ne.prototype.ccEnableArenas=!0,ne.prototype.objcClassPrefix="",ne.prototype.csharpNamespace="",ne.prototype.swiftPrefix="",ne.prototype.phpClassPrefix="",ne.prototype.phpNamespace="",ne.prototype.phpMetadataNamespace="",ne.prototype.rubyPackage="",ne.prototype.uninterpretedOption=i.emptyArray,ne.create=function(p){return new ne(p)},ne.encode=function(p,V){if(V=V||c.create(),p.javaPackage!=null&&Object.hasOwnProperty.call(p,"javaPackage")&&V.uint32(10).string(p.javaPackage),p.javaOuterClassname!=null&&Object.hasOwnProperty.call(p,"javaOuterClassname")&&V.uint32(66).string(p.javaOuterClassname),p.optimizeFor!=null&&Object.hasOwnProperty.call(p,"optimizeFor")&&V.uint32(72).int32(p.optimizeFor),p.javaMultipleFiles!=null&&Object.hasOwnProperty.call(p,"javaMultipleFiles")&&V.uint32(80).bool(p.javaMultipleFiles),p.goPackage!=null&&Object.hasOwnProperty.call(p,"goPackage")&&V.uint32(90).string(p.goPackage),p.ccGenericServices!=null&&Object.hasOwnProperty.call(p,"ccGenericServices")&&V.uint32(128).bool(p.ccGenericServices),p.javaGenericServices!=null&&Object.hasOwnProperty.call(p,"javaGenericServices")&&V.uint32(136).bool(p.javaGenericServices),p.pyGenericServices!=null&&Object.hasOwnProperty.call(p,"pyGenericServices")&&V.uint32(144).bool(p.pyGenericServices),p.javaGenerateEqualsAndHash!=null&&Object.hasOwnProperty.call(p,"javaGenerateEqualsAndHash")&&V.uint32(160).bool(p.javaGenerateEqualsAndHash),p.deprecated!=null&&Object.hasOwnProperty.call(p,"deprecated")&&V.uint32(184).bool(p.deprecated),p.javaStringCheckUtf8!=null&&Object.hasOwnProperty.call(p,"javaStringCheckUtf8")&&V.uint32(216).bool(p.javaStringCheckUtf8),p.ccEnableArenas!=null&&Object.hasOwnProperty.call(p,"ccEnableArenas")&&V.uint32(248).bool(p.ccEnableArenas),p.objcClassPrefix!=null&&Object.hasOwnProperty.call(p,"objcClassPrefix")&&V.uint32(290).string(p.objcClassPrefix),p.csharpNamespace!=null&&Object.hasOwnProperty.call(p,"csharpNamespace")&&V.uint32(298).string(p.csharpNamespace),p.swiftPrefix!=null&&Object.hasOwnProperty.call(p,"swiftPrefix")&&V.uint32(314).string(p.swiftPrefix),p.phpClassPrefix!=null&&Object.hasOwnProperty.call(p,"phpClassPrefix")&&V.uint32(322).string(p.phpClassPrefix),p.phpNamespace!=null&&Object.hasOwnProperty.call(p,"phpNamespace")&&V.uint32(330).string(p.phpNamespace),p.phpGenericServices!=null&&Object.hasOwnProperty.call(p,"phpGenericServices")&&V.uint32(336).bool(p.phpGenericServices),p.phpMetadataNamespace!=null&&Object.hasOwnProperty.call(p,"phpMetadataNamespace")&&V.uint32(354).string(p.phpMetadataNamespace),p.rubyPackage!=null&&Object.hasOwnProperty.call(p,"rubyPackage")&&V.uint32(362).string(p.rubyPackage),p.uninterpretedOption!=null&&p.uninterpretedOption.length)for(var F=0;F>>3){case 1:G.javaPackage=p.string();break;case 8:G.javaOuterClassname=p.string();break;case 10:G.javaMultipleFiles=p.bool();break;case 20:G.javaGenerateEqualsAndHash=p.bool();break;case 27:G.javaStringCheckUtf8=p.bool();break;case 9:G.optimizeFor=p.int32();break;case 11:G.goPackage=p.string();break;case 16:G.ccGenericServices=p.bool();break;case 17:G.javaGenericServices=p.bool();break;case 18:G.pyGenericServices=p.bool();break;case 42:G.phpGenericServices=p.bool();break;case 23:G.deprecated=p.bool();break;case 31:G.ccEnableArenas=p.bool();break;case 36:G.objcClassPrefix=p.string();break;case 37:G.csharpNamespace=p.string();break;case 39:G.swiftPrefix=p.string();break;case 40:G.phpClassPrefix=p.string();break;case 41:G.phpNamespace=p.string();break;case 44:G.phpMetadataNamespace=p.string();break;case 45:G.rubyPackage=p.string();break;case 999:G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()));break;default:p.skipType(7&W)}}return G},ne.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},ne.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.javaPackage!=null&&p.hasOwnProperty("javaPackage")&&!i.isString(p.javaPackage))return"javaPackage: string expected";if(p.javaOuterClassname!=null&&p.hasOwnProperty("javaOuterClassname")&&!i.isString(p.javaOuterClassname))return"javaOuterClassname: string expected";if(p.javaMultipleFiles!=null&&p.hasOwnProperty("javaMultipleFiles")&&typeof p.javaMultipleFiles!="boolean")return"javaMultipleFiles: boolean expected";if(p.javaGenerateEqualsAndHash!=null&&p.hasOwnProperty("javaGenerateEqualsAndHash")&&typeof p.javaGenerateEqualsAndHash!="boolean")return"javaGenerateEqualsAndHash: boolean expected";if(p.javaStringCheckUtf8!=null&&p.hasOwnProperty("javaStringCheckUtf8")&&typeof p.javaStringCheckUtf8!="boolean")return"javaStringCheckUtf8: boolean expected";if(p.optimizeFor!=null&&p.hasOwnProperty("optimizeFor"))switch(p.optimizeFor){default:return"optimizeFor: enum value expected";case 1:case 2:case 3:}if(p.goPackage!=null&&p.hasOwnProperty("goPackage")&&!i.isString(p.goPackage))return"goPackage: string expected";if(p.ccGenericServices!=null&&p.hasOwnProperty("ccGenericServices")&&typeof p.ccGenericServices!="boolean")return"ccGenericServices: boolean expected";if(p.javaGenericServices!=null&&p.hasOwnProperty("javaGenericServices")&&typeof p.javaGenericServices!="boolean")return"javaGenericServices: boolean expected";if(p.pyGenericServices!=null&&p.hasOwnProperty("pyGenericServices")&&typeof p.pyGenericServices!="boolean")return"pyGenericServices: boolean expected";if(p.phpGenericServices!=null&&p.hasOwnProperty("phpGenericServices")&&typeof p.phpGenericServices!="boolean")return"phpGenericServices: boolean expected";if(p.deprecated!=null&&p.hasOwnProperty("deprecated")&&typeof p.deprecated!="boolean")return"deprecated: boolean expected";if(p.ccEnableArenas!=null&&p.hasOwnProperty("ccEnableArenas")&&typeof p.ccEnableArenas!="boolean")return"ccEnableArenas: boolean expected";if(p.objcClassPrefix!=null&&p.hasOwnProperty("objcClassPrefix")&&!i.isString(p.objcClassPrefix))return"objcClassPrefix: string expected";if(p.csharpNamespace!=null&&p.hasOwnProperty("csharpNamespace")&&!i.isString(p.csharpNamespace))return"csharpNamespace: string expected";if(p.swiftPrefix!=null&&p.hasOwnProperty("swiftPrefix")&&!i.isString(p.swiftPrefix))return"swiftPrefix: string expected";if(p.phpClassPrefix!=null&&p.hasOwnProperty("phpClassPrefix")&&!i.isString(p.phpClassPrefix))return"phpClassPrefix: string expected";if(p.phpNamespace!=null&&p.hasOwnProperty("phpNamespace")&&!i.isString(p.phpNamespace))return"phpNamespace: string expected";if(p.phpMetadataNamespace!=null&&p.hasOwnProperty("phpMetadataNamespace")&&!i.isString(p.phpMetadataNamespace))return"phpMetadataNamespace: string expected";if(p.rubyPackage!=null&&p.hasOwnProperty("rubyPackage")&&!i.isString(p.rubyPackage))return"rubyPackage: string expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 1:G.messageSetWireFormat=p.bool();break;case 2:G.noStandardDescriptorAccessor=p.bool();break;case 3:G.deprecated=p.bool();break;case 7:G.mapEntry=p.bool();break;case 999:G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()));break;default:p.skipType(7&W)}}return G},ie.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},ie.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.messageSetWireFormat!=null&&p.hasOwnProperty("messageSetWireFormat")&&typeof p.messageSetWireFormat!="boolean")return"messageSetWireFormat: boolean expected";if(p.noStandardDescriptorAccessor!=null&&p.hasOwnProperty("noStandardDescriptorAccessor")&&typeof p.noStandardDescriptorAccessor!="boolean")return"noStandardDescriptorAccessor: boolean expected";if(p.deprecated!=null&&p.hasOwnProperty("deprecated")&&typeof p.deprecated!="boolean")return"deprecated: boolean expected";if(p.mapEntry!=null&&p.hasOwnProperty("mapEntry")&&typeof p.mapEntry!="boolean")return"mapEntry: boolean expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 1:G.ctype=p.int32();break;case 2:G.packed=p.bool();break;case 6:G.jstype=p.int32();break;case 5:G.lazy=p.bool();break;case 3:G.deprecated=p.bool();break;case 10:G.weak=p.bool();break;case 999:G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()));break;default:p.skipType(7&W)}}return G},me.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},me.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.ctype!=null&&p.hasOwnProperty("ctype"))switch(p.ctype){default:return"ctype: enum value expected";case 0:case 1:case 2:}if(p.packed!=null&&p.hasOwnProperty("packed")&&typeof p.packed!="boolean")return"packed: boolean expected";if(p.jstype!=null&&p.hasOwnProperty("jstype"))switch(p.jstype){default:return"jstype: enum value expected";case 0:case 1:case 2:}if(p.lazy!=null&&p.hasOwnProperty("lazy")&&typeof p.lazy!="boolean")return"lazy: boolean expected";if(p.deprecated!=null&&p.hasOwnProperty("deprecated")&&typeof p.deprecated!="boolean")return"deprecated: boolean expected";if(p.weak!=null&&p.hasOwnProperty("weak")&&typeof p.weak!="boolean")return"weak: boolean expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3==999?(G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()))):p.skipType(7&W)}return G},Ze.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},Ze.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 2:G.allowAlias=p.bool();break;case 3:G.deprecated=p.bool();break;case 999:G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()));break;default:p.skipType(7&W)}}return G},Fe.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},Fe.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.allowAlias!=null&&p.hasOwnProperty("allowAlias")&&typeof p.allowAlias!="boolean")return"allowAlias: boolean expected";if(p.deprecated!=null&&p.hasOwnProperty("deprecated")&&typeof p.deprecated!="boolean")return"deprecated: boolean expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 1:G.deprecated=p.bool();break;case 999:G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()));break;default:p.skipType(7&W)}}return G},ce.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},ce.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.deprecated!=null&&p.hasOwnProperty("deprecated")&&typeof p.deprecated!="boolean")return"deprecated: boolean expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 33:G.deprecated=p.bool();break;case 999:G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()));break;case 1049:G[".google.api.defaultHost"]=p.string();break;case 1050:G[".google.api.oauthScopes"]=p.string();break;default:p.skipType(7&W)}}return G},fe.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},fe.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.deprecated!=null&&p.hasOwnProperty("deprecated")&&typeof p.deprecated!="boolean")return"deprecated: boolean expected";if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 33:G.deprecated=p.bool();break;case 34:G.idempotencyLevel=p.int32();break;case 999:G.uninterpretedOption&&G.uninterpretedOption.length||(G.uninterpretedOption=[]),G.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(p,p.uint32()));break;case 1049:G[".google.longrunning.operationInfo"]=s.google.longrunning.OperationInfo.decode(p,p.uint32());break;case 72295728:G[".google.api.http"]=s.google.api.HttpRule.decode(p,p.uint32());break;case 1051:G[".google.api.methodSignature"]&&G[".google.api.methodSignature"].length||(G[".google.api.methodSignature"]=[]),G[".google.api.methodSignature"].push(p.string());break;default:p.skipType(7&W)}}return G},ke.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},ke.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.deprecated!=null&&p.hasOwnProperty("deprecated")&&typeof p.deprecated!="boolean")return"deprecated: boolean expected";if(p.idempotencyLevel!=null&&p.hasOwnProperty("idempotencyLevel"))switch(p.idempotencyLevel){default:return"idempotencyLevel: enum value expected";case 0:case 1:case 2:}if(p.uninterpretedOption!=null&&p.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(p.uninterpretedOption))return"uninterpretedOption: array expected";for(var V=0;V>>3){case 2:G.name&&G.name.length||(G.name=[]),G.name.push(s.google.protobuf.UninterpretedOption.NamePart.decode(p,p.uint32()));break;case 3:G.identifierValue=p.string();break;case 4:G.positiveIntValue=p.uint64();break;case 5:G.negativeIntValue=p.int64();break;case 6:G.doubleValue=p.double();break;case 7:G.stringValue=p.bytes();break;case 8:G.aggregateValue=p.string();break;default:p.skipType(7&W)}}return G},j.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},j.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.name!=null&&p.hasOwnProperty("name")){if(!Array.isArray(p.name))return"name: array expected";for(var V=0;V>>0,p.positiveIntValue.high>>>0).toNumber(!0))),p.negativeIntValue!=null&&(i.Long?(V.negativeIntValue=i.Long.fromValue(p.negativeIntValue)).unsigned=!1:typeof p.negativeIntValue=="string"?V.negativeIntValue=parseInt(p.negativeIntValue,10):typeof p.negativeIntValue=="number"?V.negativeIntValue=p.negativeIntValue:typeof p.negativeIntValue=="object"&&(V.negativeIntValue=new i.LongBits(p.negativeIntValue.low>>>0,p.negativeIntValue.high>>>0).toNumber())),p.doubleValue!=null&&(V.doubleValue=Number(p.doubleValue)),p.stringValue!=null&&(typeof p.stringValue=="string"?i.base64.decode(p.stringValue,V.stringValue=i.newBuffer(i.base64.length(p.stringValue)),0):p.stringValue.length&&(V.stringValue=p.stringValue)),p.aggregateValue!=null&&(V.aggregateValue=String(p.aggregateValue)),V},j.toObject=function(p,V){var F,G={};if(((V=V||{}).arrays||V.defaults)&&(G.name=[]),V.defaults&&(G.identifierValue="",i.Long?(F=new i.Long(0,0,!0),G.positiveIntValue=V.longs===String?F.toString():V.longs===Number?F.toNumber():F):G.positiveIntValue=V.longs===String?"0":0,i.Long?(F=new i.Long(0,0,!1),G.negativeIntValue=V.longs===String?F.toString():V.longs===Number?F.toNumber():F):G.negativeIntValue=V.longs===String?"0":0,G.doubleValue=0,V.bytes===String?G.stringValue="":(G.stringValue=[],V.bytes!==Array&&(G.stringValue=i.newBuffer(G.stringValue))),G.aggregateValue=""),p.name&&p.name.length){G.name=[];for(var W=0;W>>0,p.positiveIntValue.high>>>0).toNumber(!0):p.positiveIntValue),p.negativeIntValue!=null&&p.hasOwnProperty("negativeIntValue")&&(typeof p.negativeIntValue=="number"?G.negativeIntValue=V.longs===String?String(p.negativeIntValue):p.negativeIntValue:G.negativeIntValue=V.longs===String?i.Long.prototype.toString.call(p.negativeIntValue):V.longs===Number?new i.LongBits(p.negativeIntValue.low>>>0,p.negativeIntValue.high>>>0).toNumber():p.negativeIntValue),p.doubleValue!=null&&p.hasOwnProperty("doubleValue")&&(G.doubleValue=V.json&&!isFinite(p.doubleValue)?String(p.doubleValue):p.doubleValue),p.stringValue!=null&&p.hasOwnProperty("stringValue")&&(G.stringValue=V.bytes===String?i.base64.encode(p.stringValue,0,p.stringValue.length):V.bytes===Array?Array.prototype.slice.call(p.stringValue):p.stringValue),p.aggregateValue!=null&&p.hasOwnProperty("aggregateValue")&&(G.aggregateValue=p.aggregateValue),G},j.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},j.NamePart=(E.prototype.namePart="",E.prototype.isExtension=!1,E.create=function(p){return new E(p)},E.encode=function(p,V){return(V=V||c.create()).uint32(10).string(p.namePart),V.uint32(16).bool(p.isExtension),V},E.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},E.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.protobuf.UninterpretedOption.NamePart;p.pos>>3){case 1:G.namePart=p.string();break;case 2:G.isExtension=p.bool();break;default:p.skipType(7&W)}}if(!G.hasOwnProperty("namePart"))throw i.ProtocolError("missing required 'namePart'",{instance:G});if(G.hasOwnProperty("isExtension"))return G;throw i.ProtocolError("missing required 'isExtension'",{instance:G})},E.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},E.verify=function(p){return typeof p!="object"||p===null?"object expected":i.isString(p.namePart)?typeof p.isExtension!="boolean"?"isExtension: boolean expected":null:"namePart: string expected"},E.fromObject=function(p){var V;return p instanceof s.google.protobuf.UninterpretedOption.NamePart?p:(V=new s.google.protobuf.UninterpretedOption.NamePart,p.namePart!=null&&(V.namePart=String(p.namePart)),p.isExtension!=null&&(V.isExtension=!!p.isExtension),V)},E.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.namePart="",F.isExtension=!1),p.namePart!=null&&p.hasOwnProperty("namePart")&&(F.namePart=p.namePart),p.isExtension!=null&&p.hasOwnProperty("isExtension")&&(F.isExtension=p.isExtension),F},E.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},E),j),n.SourceCodeInfo=(S.prototype.location=i.emptyArray,S.create=function(p){return new S(p)},S.encode=function(p,V){if(V=V||c.create(),p.location!=null&&p.location.length)for(var F=0;F>>3==1?(G.location&&G.location.length||(G.location=[]),G.location.push(s.google.protobuf.SourceCodeInfo.Location.decode(p,p.uint32()))):p.skipType(7&W)}return G},S.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},S.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.location!=null&&p.hasOwnProperty("location")){if(!Array.isArray(p.location))return"location: array expected";for(var V=0;V>>3){case 1:if(G.path&&G.path.length||(G.path=[]),(7&W)==2)for(var A=p.uint32()+p.pos;p.pos>>3==1?(G.annotation&&G.annotation.length||(G.annotation=[]),G.annotation.push(s.google.protobuf.GeneratedCodeInfo.Annotation.decode(p,p.uint32()))):p.skipType(7&W)}return G},Y.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},Y.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.annotation!=null&&p.hasOwnProperty("annotation")){if(!Array.isArray(p.annotation))return"annotation: array expected";for(var V=0;V>>3){case 1:if(G.path&&G.path.length||(G.path=[]),(7&W)==2)for(var A=p.uint32()+p.pos;p.pos>>3){case 1:G.type_url=p.string();break;case 2:G.value=p.bytes();break;default:p.skipType(7&W)}}return G},C.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},C.verify=function(p){return typeof p!="object"||p===null?"object expected":p.type_url!=null&&p.hasOwnProperty("type_url")&&!i.isString(p.type_url)?"type_url: string expected":p.value!=null&&p.hasOwnProperty("value")&&!(p.value&&typeof p.value.length=="number"||i.isString(p.value))?"value: buffer expected":null},C.fromObject=function(p){var V;return p instanceof s.google.protobuf.Any?p:(V=new s.google.protobuf.Any,p.type_url!=null&&(V.type_url=String(p.type_url)),p.value!=null&&(typeof p.value=="string"?i.base64.decode(p.value,V.value=i.newBuffer(i.base64.length(p.value)),0):p.value.length&&(V.value=p.value)),V)},C.toObject=function(p,V){var F={};return(V=V||{}).defaults&&(F.type_url="",V.bytes===String?F.value="":(F.value=[],V.bytes!==Array&&(F.value=i.newBuffer(F.value)))),p.type_url!=null&&p.hasOwnProperty("type_url")&&(F.type_url=p.type_url),p.value!=null&&p.hasOwnProperty("value")&&(F.value=V.bytes===String?i.base64.encode(p.value,0,p.value.length):V.bytes===Array?Array.prototype.slice.call(p.value):p.value),F},C.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},C),n.Duration=(M.prototype.seconds=i.Long?i.Long.fromBits(0,0,!1):0,M.prototype.nanos=0,M.create=function(p){return new M(p)},M.encode=function(p,V){return V=V||c.create(),p.seconds!=null&&Object.hasOwnProperty.call(p,"seconds")&&V.uint32(8).int64(p.seconds),p.nanos!=null&&Object.hasOwnProperty.call(p,"nanos")&&V.uint32(16).int32(p.nanos),V},M.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},M.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,G=new s.google.protobuf.Duration;p.pos>>3){case 1:G.seconds=p.int64();break;case 2:G.nanos=p.int32();break;default:p.skipType(7&W)}}return G},M.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},M.verify=function(p){return typeof p!="object"||p===null?"object expected":p.seconds!=null&&p.hasOwnProperty("seconds")&&!(i.isInteger(p.seconds)||p.seconds&&i.isInteger(p.seconds.low)&&i.isInteger(p.seconds.high))?"seconds: integer|Long expected":p.nanos!=null&&p.hasOwnProperty("nanos")&&!i.isInteger(p.nanos)?"nanos: integer expected":null},M.fromObject=function(p){var V;return p instanceof s.google.protobuf.Duration?p:(V=new s.google.protobuf.Duration,p.seconds!=null&&(i.Long?(V.seconds=i.Long.fromValue(p.seconds)).unsigned=!1:typeof p.seconds=="string"?V.seconds=parseInt(p.seconds,10):typeof p.seconds=="number"?V.seconds=p.seconds:typeof p.seconds=="object"&&(V.seconds=new i.LongBits(p.seconds.low>>>0,p.seconds.high>>>0).toNumber())),p.nanos!=null&&(V.nanos=0|p.nanos),V)},M.toObject=function(p,V){var F,G={};return(V=V||{}).defaults&&(i.Long?(F=new i.Long(0,0,!1),G.seconds=V.longs===String?F.toString():V.longs===Number?F.toNumber():F):G.seconds=V.longs===String?"0":0,G.nanos=0),p.seconds!=null&&p.hasOwnProperty("seconds")&&(typeof p.seconds=="number"?G.seconds=V.longs===String?String(p.seconds):p.seconds:G.seconds=V.longs===String?i.Long.prototype.toString.call(p.seconds):V.longs===Number?new i.LongBits(p.seconds.low>>>0,p.seconds.high>>>0).toNumber():p.seconds),p.nanos!=null&&p.hasOwnProperty("nanos")&&(G.nanos=p.nanos),G},M.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},M),n.Empty=(te.create=function(p){return new te(p)},te.encode=function(p,V){return V=V||c.create()},te.encodeDelimited=function(p,V){return this.encode(p,V).ldelim()},te.decode=function(p,V){p instanceof a||(p=a.create(p));for(var F=V===void 0?p.len:p.pos+V,V=new s.google.protobuf.Empty;p.pos>>3){case 1:G.code=p.int32();break;case 2:G.message=p.string();break;case 3:G.details&&G.details.length||(G.details=[]),G.details.push(s.google.protobuf.Any.decode(p,p.uint32()));break;default:p.skipType(7&W)}}return G},ae.decodeDelimited=function(p){return p instanceof a||(p=new a(p)),this.decode(p,p.uint32())},ae.verify=function(p){if(typeof p!="object"||p===null)return"object expected";if(p.code!=null&&p.hasOwnProperty("code")&&!i.isInteger(p.code))return"code: integer expected";if(p.message!=null&&p.hasOwnProperty("message")&&!i.isString(p.message))return"message: string expected";if(p.details!=null&&p.hasOwnProperty("details")){if(!Array.isArray(p.details))return"details: array expected";for(var V=0;V{"use strict";Object.defineProperty(hq,"__esModule",{value:!0});hq.Operation=void 0;hq.operation=rFI;var IFI=require("events"),aFI=UR(),B_e=VY(),yGn=z_e(),hVe=class extends IFI.EventEmitter{constructor(e,n,l,I){super(),this.completeListeners=0,this.hasActiveListeners=!1,this.latestResponse=e,this.name=this.latestResponse.name,this.done=this.latestResponse.done,this.error=this.latestResponse.error,this.longrunningDescriptor=n,this.result=null,this.metadata=null,this.backoffSettings=l,this._unpackResponse(e),this._listenForEvents(),this._callOptions=I}_listenForEvents(){this.on("newListener",e=>{e==="complete"&&(this.completeListeners++,this.hasActiveListeners||(this.hasActiveListeners=!0,this.startPolling_()))}),this.on("removeListener",e=>{e==="complete"&&--this.completeListeners===0&&(this.hasActiveListeners=!1)})}cancel(){this.currentCallPromise_&&this.currentCallPromise_.cancel();let e=this.longrunningDescriptor.operationsClient,n=new yGn.google.longrunning.CancelOperationRequest;return n.name=this.latestResponse.name,e.cancelOperation(n)}getOperation(e){let n=this,l=this.longrunningDescriptor.operationsClient;function I(){if(!e)return new Promise((i,s)=>{if(n.latestResponse.error){let r=new B_e.GoogleError(n.latestResponse.error.message);r.code=n.latestResponse.error.code,s(r)}else i([n.result,n.metadata,n.latestResponse])})}if(this.latestResponse.done)return this._unpackResponse(this.latestResponse,e),I();let a=new yGn.google.longrunning.GetOperationRequest;a.name=this.latestResponse.name,this.currentCallPromise_=l.getOperationInternal(a,this._callOptions);let c=this.currentCallPromise_.then(i=>(n.latestResponse=i[0],n._unpackResponse(i[0],e),I()),i=>{if(e){e(i);return}return Promise.reject(i)});if(!e)return c}_unpackResponse(e,n){let l=this.longrunningDescriptor.responseDecoder,I=this.longrunningDescriptor.metadataDecoder,a,c;if(e.done){if(e.result==="error"){let i=new B_e.GoogleError(e.error.message);i.code=e.error.code,this.error=i,n&&n(i);return}l&&e.response&&(this.response=e.response,a=l(e.response.value),this.result=a,this.done=!0)}I&&e.metadata&&(c=I(e.metadata.value),this.metadata=c),n&&n(null,a,c,e)}startPolling_(){let e=this,n=new Date,l=this.backoffSettings.retryDelayMultiplier,I=this.backoffSettings.maxRetryDelayMillis,a=this.backoffSettings.initialRetryDelayMillis,c=1/0;this.backoffSettings.totalTimeoutMillis&&(c=n.getTime()+this.backoffSettings.totalTimeoutMillis);let i;this.latestResponse.metadata&&(i=this.latestResponse.metadata.value);function s(o,...d){e.emit(o,...d)}function r(o,d){if(o.byteLength!==d.byteLength)return!1;for(let b=0;b=c){let o=new B_e.GoogleError("Total timeout exceeded before any response was received");o.code=aFI.Status.DEADLINE_EXCEEDED,setImmediate(s,"error",o);return}e.getOperation((o,d,b,h)=>{if(o){setImmediate(s,"error",o);return}if(!d){if(h.metadata&&(!i||h&&!r(h.metadata.value,i))&&(setImmediate(s,"progress",b,h),i=h.metadata.value),h.done){setImmediate(s,"complete",{},b,h);return}setTimeout(()=>{n=new Date,a=Math.min(a*l,I),u()},a);return}setImmediate(s,"complete",d,b,h)})}}u()}promise(){return new Promise((e,n)=>{this.on("error",n).on("complete",(l,I,a)=>{e([l,I,a])})})}};hq.Operation=hVe;function rFI(t,e,n,l){return new hVe(t,e,n,l)}});var FGn=f(ZVe=>{"use strict";Object.defineProperty(ZVe,"__esModule",{value:!0});ZVe.LongrunningApiCaller=void 0;var AGn=cq(),cFI=kw(),oFI=S_e(),M_e=class{constructor(e){this.longrunningDescriptor=e}init(e){return e?new AGn.OngoingCall(e):new AGn.OngoingCallPromise}wrap(e){return e}call(e,n,l,I){I.call((a,c)=>this._wrapOperation(e,l,a,c),n)}_wrapOperation(e,n,l,I){let a=n.longrunning;a||(a=(0,cFI.createDefaultBackoffSettings)());let c=this.longrunningDescriptor;return e(l,(i,s)=>{if(i){I(i,null,null,s);return}let r=new oFI.Operation(s,c,a,n);I(null,r,s)})}fail(e,n){e.callback(n)}result(e){return e.promise}};ZVe.LongrunningApiCaller=M_e});var vGn=f(WVe=>{"use strict";Object.defineProperty(WVe,"__esModule",{value:!0});WVe.LongRunningDescriptor=void 0;var iFI=FGn(),T_e=class{constructor(e,n,l){this.operationsClient=e,this.responseDecoder=n,this.metadataDecoder=l}getApiCaller(){return new iFI.LongrunningApiCaller(this)}};WVe.LongRunningDescriptor=T_e});var fGn=f(NVe=>{"use strict";Object.defineProperty(NVe,"__esModule",{value:!0});NVe.ResourceCollector=void 0;var D_e=class{constructor(e,n=-1){this.apiCall=e,this.resources=[],this.maxResults=n}callback(e,n,l){if(e){this.rejectCallback(e);return}for(let a of n)if(this.resources.push(a),this.resources.length===this.maxResults){l=null;break}if(!l){this.resolveCallback(this.resources);return}let I=(...a)=>this.callback(...a);setImmediate(this.apiCall,l,I)}processAllPages(e){return new Promise((n,l)=>{this.resolveCallback=n,this.rejectCallback=l;let I=(...a)=>this.callback(...a);setImmediate(this.apiCall,e,I)})}};NVe.ResourceCollector=D_e});var HGn=f(VVe=>{"use strict";Object.defineProperty(VVe,"__esModule",{value:!0});VVe.PagedApiCaller=void 0;var XGn=cq(),wGn=VY(),sFI=fGn(),uFI=PF(),K_e=class{constructor(e){this.pageDescriptor=e}generateParseResponseCallback(e,n){let l=this.pageDescriptor.resourceField,I=this.pageDescriptor.responsePageTokenField,a=this.pageDescriptor.requestPageTokenField;return(c,i)=>{if(c){n(c);return}if(!e){n(new wGn.GoogleError("Undefined request in pagination method callback."));return}if(!i){n(new wGn.GoogleError("Undefined response in pagination method callback."));return}let s=i[l]||[],r=i[I],u=null;r&&(u=Object.assign({},e),u[a]=r),n(c,s,u,i)}}wrap(e){let n=this;return function(I,a,c,i){return e(I,a,c,n.generateParseResponseCallback(I,i))}}init(e){return e?new XGn.OngoingCall(e):new XGn.OngoingCallPromise}call(e,n,l,I){if(n=Object.assign({},n),!l.autoPaginate){I.call(e,n);return}n.pageSize&&l.autoPaginate&&(0,uFI.warn)("autoPaginate true","Providing a pageSize without setting autoPaginate to false will still return all results. See https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure manual paging","AutopaginateTrueWarning");let a=l.maxResults||-1;new sFI.ResourceCollector(e,a).processAllPages(n).then(i=>I.callback(null,i),i=>I.callback(i))}fail(e,n){e.callback(n)}result(e){return e.promise}};VVe.PagedApiCaller=K_e});var q_e=f(YVe=>{"use strict";Object.defineProperty(YVe,"__esModule",{value:!0});YVe.PageDescriptor=void 0;var dFI=require("stream"),GFI=DNe(),QGn=PF(),bFI=HGn(),mFI=10,P_e=class{constructor(e,n,l){this.requestPageTokenField=e,this.responsePageTokenField=n,this.resourceField=l}createStream(e,n,l){l?.autoPaginate&&(0,QGn.warn)("autoPaginate true","Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning");let I=new dFI.PassThrough({objectMode:!0});l=Object.assign({},l,{autoPaginate:!1});let a="maxResults"in l?l.maxResults:-1,c=0,i=!1;function s(r,u,o,d){if(r){I.emit("error",r);return}I.emit("response",d);for(let b=0;b{i||(i=!0,e(n,l,s))}),I}asyncIterate(e,n,l){return l?.autoPaginate&&(0,QGn.warn)("autoPaginate true","Autopaginate will always be set to false in Async paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning"),l=Object.assign({},l,{autoPaginate:!1}),this.createIterator(e,n,l)}createIterator(e,n,l){return{[Symbol.asyncIterator](){let a=n,c=[];return{async next(){if(c.length>0)return Promise.resolve({done:!1,value:c.shift()});let i=0;for(;c.length===0&&a;){let s;if([s,a]=await e(a,l),s&&!Array.isArray(s))for(let[r,u]of Object.entries(s))c.push([r,u]);else c.push(...s);if(c.length===0&&(++i,i>mFI))break}return c.length===0?Promise.resolve({done:!0,value:void 0}):Promise.resolve({done:!1,value:c.shift()})}}}}}getApiCaller(e){return e.autoPaginate?new bFI.PagedApiCaller(this):new GFI.NormalApiCaller}};YVe.PageDescriptor=P_e});var EGn=f(gVe=>{"use strict";Object.defineProperty(gVe,"__esModule",{value:!0});gVe.StreamDescriptor=void 0;var pFI=O_e(),$_e=class{constructor(e,n,l){this.type=e,this.streaming=!0,this.rest=n,this.gaxStreamingRetries=l}getApiCaller(){return new pFI.StreamingApiCaller(this)}};gVe.StreamDescriptor=$_e});var CGn=f(RVe=>{"use strict";Object.defineProperty(RVe,"__esModule",{value:!0});RVe.BundleApiCaller=void 0;var JGn=cq(),hFI=VY(),ePe=class{constructor(e){this.bundler=e}init(e){return e?new JGn.OngoingCall(e):new JGn.OngoingCallPromise}wrap(e){return e}call(e,n,l,I){if(!l.isBundling)throw new hFI.GoogleError("Bundling enabled with no isBundling!");I.call((a,c)=>(this.bundler.schedule(e,a,c),I),n)}fail(e,n){e.callback(n)}result(e){return e.promise}};RVe.BundleApiCaller=ePe});var LGn=f(tPe=>{"use strict";Object.defineProperty(tPe,"__esModule",{value:!0});tPe.computeBundleId=ZFI;function ZFI(t,e){let n=[],l=!1;for(let I of e){let a=WFI(t,I);a===void 0?n.push(null):(l=!0,n.push(a))}if(l)return JSON.stringify(n)}function WFI(t,e){let n=e.split("."),l=t;for(let I of n)l=l?.[I];return l}});var jGn=f(Zq=>{"use strict";Object.defineProperty(Zq,"__esModule",{value:!0});Zq.Task=void 0;Zq.deepCopyForResponse=yVe;var kGn=UR(),xGn=VY();function yVe(t,e){let n;if(t===null)return null;if(t!==void 0)return Array.isArray(t)?(n=[],t.forEach(l=>{n.push(yVe(l,null))}),n):t.copy!==void 0?t.copy():t instanceof ArrayBuffer?t.slice(0):typeof t=="object"?(n={},Object.keys(t).forEach(l=>{e&&l===e.field&&Array.isArray(t[l])?n[l]=t[l].slice(e.start,e.end):n[l]=yVe(t[l],null)}),n):t}var nPe=class{constructor(e,n,l,I){this._apiCall=e,this._request=n,this._bundledField=l,this._subresponseField=I,this._data=[]}getElementCount(){let e=0;for(let n=0;n{let i=[];if(a)I._data.forEach(()=>{i.push(void 0)});else{let s=null;I._subresponseField&&(s={field:I._subresponseField,start:0}),I._data.forEach(r=>{s&&(s.end=s.start+r.elements.length),i.push(yVe(c,s)),s&&(s.start=s.end)})}for(let s=0;s{l.callback.id===e&&(l.cancelled=!0),l.cancelled||(n=!1)}),n&&this.callCanceller.cancel(),n}for(let n=0;n{"use strict";Object.defineProperty(AVe,"__esModule",{value:!0});AVe.BundleExecutor=void 0;var NFI=UR(),VFI=VY(),lPe=PF(),YFI=LGn(),OGn=jGn();function UGn(){}var IPe=class{constructor(e,n){this._options=e,this._descriptor=n,this._tasks={},this._timers={},this._invocations={},this._invocationId=0}schedule(e,n,l){let I=(0,YFI.computeBundleId)(n,this._descriptor.requestDiscriminatorFields);if(l=l||UGn,I===void 0)return(0,lPe.warn)("bundling_schedule_bundleid_undefined",`The request does not have enough information for request bundling. Invoking immediately. Request: ${JSON.stringify(n)} discriminator fields: ${this._descriptor.requestDiscriminatorFields}`),e(n,l);if(n[this._descriptor.bundledField]===void 0)return(0,lPe.warn)("bundling_no_bundled_field",`Request does not contain field ${this._descriptor.bundledField} that must present for bundling. Invoking immediately. Request: ${JSON.stringify(n)}`),e(n,l);I in this._tasks||(this._tasks[I]=new OGn.Task(e,n,this._descriptor.bundledField,this._descriptor.subresponseField));let a=this._tasks[I];l.id=String(this._invocationId++),this._invocations[l.id]=I;let c=n[this._descriptor.bundledField],i=c.length,s=0,r=this;c.forEach(g=>{s+=this._descriptor.byteLengthFunction(g)});let u=this._options.elementCountLimit||0,o=this._options.requestByteLimit||0;if(u>0&&i>u||o>0&&s>=o){let g;u>0&&i>u?g="The number of elements "+i+" exceeds the limit "+this._options.elementCountLimit:g="The required bytes "+s+" exceeds the limit "+this._options.requestByteLimit;let y=new VFI.GoogleError(g);return y.code=NFI.Status.INVALID_ARGUMENT,l(y),{cancel:UGn}}let d=a.getElementCount(),b=a.getRequestByteSize();(u>0&&i+d>=u||o>0&&s+b>=o)&&(this._runNow(I),this._tasks[I]=new OGn.Task(e,n,this._descriptor.bundledField,this._descriptor.subresponseField),a=this._tasks[I]),a.extend(c,s,l);let h={cancel(){r._cancel(l.id)}},Z=this._options.elementCountThreshold||0,N=this._options.requestByteThreshold||0;return Z>0&&a.getElementCount()>=Z||N>0&&a.getRequestByteSize()>=N?(this._runNow(I),h):(!(I in this._timers)&&this._options.delayThreshold>0&&(this._timers[I]=setTimeout(()=>{delete this._timers[I],this._runNow(I)},this._options.delayThreshold)),h)}_maybeClearTimeout(e){if(e in this._timers){let n=this._timers[e];delete this._timers[e],clearTimeout(n)}}_cancel(e){if(!(e in this._invocations))return;let n=this._invocations[e];if(!(n in this._tasks))return;let l=this._tasks[n];delete this._invocations[e],l.cancel(e)&&(this._maybeClearTimeout(n),delete this._tasks[n])}_runNow(e){if(!(e in this._tasks)){(0,lPe.warn)("bundle_runnow_bundleid_unknown",`No such bundleid: ${e}`);return}this._maybeClearTimeout(e);let n=this._tasks[e];delete this._tasks[e],n.run().forEach(l=>{delete this._invocations[l]})}};AVe.BundleExecutor=IPe});var BGn=f(FVe=>{"use strict";Object.defineProperty(FVe,"__esModule",{value:!0});FVe.BundleDescriptor=void 0;var gFI=DNe(),RFI=CGn(),yFI=zGn(),AFI=uU(),aPe=class{constructor(e,n,l,I){!I&&typeof l=="function"&&(I=l,l=null),this.bundledField=e,this.requestDiscriminatorFields=n.map(AFI.toCamelCase),this.subresponseField=l,this.byteLengthFunction=I}getApiCaller(e){return e.isBundling===!1?new gFI.NormalApiCaller:new RFI.BundleApiCaller(new yFI.BundleExecutor(e.bundleOptions,this))}};FVe.BundleDescriptor=aPe});var rPe=f(PR=>{"use strict";Object.defineProperty(PR,"__esModule",{value:!0});PR.BundleDescriptor=PR.StreamDescriptor=PR.PageDescriptor=PR.LongrunningDescriptor=void 0;var FFI=vGn();Object.defineProperty(PR,"LongrunningDescriptor",{enumerable:!0,get:function(){return FFI.LongRunningDescriptor}});var vFI=q_e();Object.defineProperty(PR,"PageDescriptor",{enumerable:!0,get:function(){return vFI.PageDescriptor}});var fFI=EGn();Object.defineProperty(PR,"StreamDescriptor",{enumerable:!0,get:function(){return fFI.StreamDescriptor}});var XFI=BGn();Object.defineProperty(PR,"BundleDescriptor",{enumerable:!0,get:function(){return XFI.BundleDescriptor}})});var SGn=f((OVr,wFI)=>{wFI.exports={interfaces:{"google.longrunning.Operations":{retry_codes:{idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"],non_idempotent:[]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:9e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:9e4,total_timeout_millis:6e5}},methods:{GetOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},ListOperations:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},CancelOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},DeleteOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"}}}}}});var MGn=f((UVr,HFI)=>{HFI.exports={nested:{google:{nested:{longrunning:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.LongRunning",go_package:"google.golang.org/genproto/googleapis/longrunning;longrunning",java_multiple_files:!0,java_outer_classname:"OperationsProto",java_package:"com.google.longrunning",php_namespace:"Google\\LongRunning"},nested:{operationInfo:{type:"google.longrunning.OperationInfo",id:1049,extend:"google.protobuf.MethodOptions"},Operations:{options:{"(google.api.default_host)":"longrunning.googleapis.com"},methods:{ListOperations:{requestType:"ListOperationsRequest",responseType:"ListOperationsResponse",options:{"(google.api.http).get":"/v1/{name=operations}","(google.api.method_signature)":"name,filter"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=operations}"}},{"(google.api.method_signature)":"name,filter"}]},GetOperation:{requestType:"GetOperationRequest",responseType:"Operation",options:{"(google.api.http).get":"/v1/operations/{name}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1/operations/{name}"}},{"(google.api.method_signature)":"name"}]},DeleteOperation:{requestType:"DeleteOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1/{name=operations/**}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1/{name=operations/**}"}},{"(google.api.method_signature)":"name"}]},CancelOperation:{requestType:"CancelOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).post":"/v1/{name=operations/**}:cancel","(google.api.http).body":"*","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{post:"/v1/{name=operations/**}:cancel",body:"*"}},{"(google.api.method_signature)":"name"}]},WaitOperation:{requestType:"WaitOperationRequest",responseType:"Operation"}}},Operation:{oneofs:{result:{oneof:["error","response"]}},fields:{name:{type:"string",id:1},metadata:{type:"google.protobuf.Any",id:2},done:{type:"bool",id:3},error:{type:"google.rpc.Status",id:4},response:{type:"google.protobuf.Any",id:5}}},GetOperationRequest:{fields:{name:{type:"string",id:1}}},ListOperationsRequest:{fields:{name:{type:"string",id:4},filter:{type:"string",id:1},pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListOperationsResponse:{fields:{operations:{rule:"repeated",type:"Operation",id:1},nextPageToken:{type:"string",id:2}}},CancelOperationRequest:{fields:{name:{type:"string",id:1}}},DeleteOperationRequest:{fields:{name:{type:"string",id:1}}},WaitOperationRequest:{fields:{name:{type:"string",id:1},timeout:{type:"google.protobuf.Duration",id:2}}},OperationInfo:{fields:{responseType:{type:"string",id:1},metadataType:{type:"string",id:2}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}},Empty:{fields:{}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/status;status",java_multiple_files:!0,java_outer_classname:"StatusProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}}}}}}}}});var iPe=f(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.getField=cPe;_p.deepCopyWithoutMatchedFields=fVe;_p.deleteField=TGn;_p.buildQueryStringComponents=oPe;_p.encodeWithSlashes=DGn;_p.encodeWithoutSlashes=I9;_p.applyPattern=KGn;_p.match=_Gn;_p.flattenObject=PGn;_p.isProto3OptionalField=LFI;_p.transcode=kFI;_p.overrideHttpRules=xFI;var QFI=uU(),vVe="(google.api.http)",EFI="proto3_optional",JFI=["get","post","put","patch","delete"];function cPe(t,e,n=!1){let l=e.split("."),I=t;for(let a of l){if(typeof I!="object")return;I=I[a]}if(!(!n&&typeof I=="object"&&!Array.isArray(I)&&I!==null))return I}function fVe(t,e,n=""){if(typeof t!="object"||t===null)return t;let l=Object.assign({},t);for(let I in l){if(e.has(`${n}${I}`)){delete l[I];continue}let a=`${n}${I}.`;Array.isArray(l[I])?l[I]=l[I].map(c=>fVe(c,new Set)):typeof l[I]=="object"&&l[I]!==null&&(l[I]=fVe(l[I],e,a))}return l}function TGn(t,e){let n=e.split(".");for(;n.length>1;){if(typeof t!="object")return;let I=n.shift();t=t[I]}let l=n.shift();typeof t=="object"&&delete t[l]}function oPe(t,e=""){let n=[];for(let l in t)if(Array.isArray(t[l]))for(let I of t[l])n.push(`${e}${I9(l)}=${I9(I.toString())}`);else typeof t[l]=="object"&&t[l]!==null?n.push(...oPe(t[l],`${l}.`)):n.push(`${e}${I9(l)}=${I9(t[l]===null?"null":t[l].toString())}`);return n}function DGn(t){return t.split("").map(e=>e.match(/[-_.~0-9a-zA-Z]/)?e:encodeURIComponent(e)).join("")}function I9(t){return t.split("").map(e=>e.match(/[-_.~0-9a-zA-Z/]/)?e:encodeURIComponent(e)).join("")}function CFI(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function KGn(t,e){if(!t||t==="*")return DGn(e);if(!t.includes("*")&&t!==e)return;let n=new RegExp("^"+CFI(t).replace(/\\\*\\\*/g,"(.+)").replace(/\\\*/g,"([^/]+)")+"$");if(e.match(n))return I9(e)}function XVe(t){return t.split(".").map(n=>(0,QFI.toCamelCase)(n)).join(".")}function _Gn(t,e){let n=e,l=[];for(;;){let I=n.match(/^(.*)\{([^}=]+)(?:=([^}]*))?\}(.*)/);if(!I)break;let[,a,c,i,s]=I,r=XVe(c);l.push(XVe(r));let u=cPe(t,r);if(u===void 0)return;let o=KGn(i,u===null?"null":u.toString());if(o===void 0)return;n=a+o+s}return{matchedFields:l,url:n}}function PGn(t){let e={};for(let n in t)if(t[n]!==void 0){if(Array.isArray(t[n])){e[n]=t[n];continue}if(typeof t[n]=="object"&&t[n]!==null){let l=PGn(t[n]);for(let I in l)e[`${n}.${I}`]=l[I];continue}e[n]=t[n]}return e}function LFI(t){return t&&t.options&&t.options[EFI]}function kFI(t,e){let n=[];for(let l of e){if(!(vVe in l))continue;let I=l[vVe];if(n.push(I),I?.additional_bindings){let a=Array.isArray(I.additional_bindings)?I.additional_bindings:[I.additional_bindings];n.push(...a)}}for(let l of n)for(let I of JFI){if(!(I in l))continue;let a=l[I],c=_Gn(t,a);if(c===void 0)continue;let{url:i,matchedFields:s}=c,r=fVe(t,new Set(s));if(l.body==="*")return{httpMethod:I,url:i,queryString:"",data:r};let u=r;l.body?(r=cPe(u,XVe(l.body),!0),TGn(u,XVe(l.body))):r="";let d=oPe(u).join("&");return(!r||typeof r=="object"&&Object.keys(r).length===0)&&(r=""),{httpMethod:I,url:i,queryString:d,data:r}}}function xFI(t,e){for(let n of t){if(!n.selector)continue;let l=e.lookup(n.selector);if(!(!l||!l.parsedOptions))for(let I of l.parsedOptions){if(!(vVe in I))continue;let a=I[vVe];for(let c in a){if(c in n){if(c==="additional_bindings")continue;a[c]=n[c]}n.additional_bindings&&(a.additional_bindings=a.additional_bindings?Array.isArray(a.additional_bindings)?a.additional_bindings:[a.additional_bindings]:[],a.additional_bindings.push(...n.additional_bindings))}}}}});var a9=f((BVr,jFI)=>{jFI.exports={name:"google-gax",version:"4.6.1",description:"Google API Extensions",main:"build/src/index.js",types:"build/src/index.d.ts",files:["build/src","build/protos/","!build/src/**/*.map"],dependencies:{"@grpc/grpc-js":"^1.10.9","@grpc/proto-loader":"^0.7.13","@types/long":"^4.0.0","abort-controller":"^3.0.0",duplexify:"^4.0.0","google-auth-library":"^9.3.0","node-fetch":"^2.7.0","object-hash":"^3.0.0","proto3-json-serializer":"^2.0.2","retry-request":"^7.0.0",uuid:"^9.0.1",protobufjs:"^7.3.2"},devDependencies:{"@types/uuid":"^9.0.7","@babel/plugin-proposal-private-methods":"^7.18.6","@types/mocha":"^9.0.0","@types/ncp":"^2.0.1","@types/node":"^20.5.0","@types/node-fetch":"^2.6.11","@types/object-hash":"^3.0.0","@types/proxyquire":"^1.3.28","@types/pumpify":"^1.4.1","@types/sinon":"^17.0.0","@types/uglify-js":"^3.17.0",c8:"^9.0.0",cheerio:"1.0.0-rc.12",codecov:"^3.1.0",execa:"^5.0.0",glob:"10.4.5","google-proto-files":"^4.2.0",gts:"^5.0.0",jackspeak:"3.4.3",jsdoc:"^4.0.0","jsdoc-fresh":"^3.0.0","jsdoc-region-tag":"^3.0.0",linkinator:"^4.0.0","lru-cache":"10.4.3",long:"^4.0.0",mkdirp:"^2.0.0",mocha:"^9.0.0",ncp:"^2.0.0","null-loader":"^4.0.0",pdfmake:"0.2.12","protobufjs-cli":"1.1.3",proxyquire:"^2.0.1",pumpify:"^2.0.0",sinon:"^18.0.0","stream-events":"^1.0.4","ts-loader":"^8.0.0",typescript:"^5.1.6","uglify-js":"^3.17.0",walkdir:"^0.4.0",webpack:"^4.0.0","webpack-cli":"^4.0.0"},scripts:{docs:"jsdoc -c .jsdoc.js",pretest:"npm run prepare",test:"c8 mocha build/test/unit",lint:"gts check src samples test",clean:"gts clean",compile:"tsc -p . && cp src/*.json build/src && cp -r test/fixtures build/test && cp -r protos build/","compile-operation-protos":"pbjs -t json google/longrunning/operations.proto -p ./protos > protos/operations.json && pbjs -t static-module -r operations_protos google/longrunning/operations.proto -p ./protos > protos/operations.js && pbts protos/operations.js -o protos/operations.d.ts","compile-compute-operations-protos":"pbjs -t json google/longrunning/compute_operations.proto -p ./protos > protos/compute_operations.json && pbjs -t static-module -r compute_operations_protos google/longrunning/compute_operations.proto -p ./protos > protos/compute_operations.js && pbts protos/compute_operations.js -o protos/compute_operations.d.ts","compile-iam-protos":"pbjs -t json google/iam/v1/iam_policy.proto google/iam/v1/options.proto google/iam/v1/policy.proto google/iam/v1/logging/audit_data.proto -p ./protos > protos/iam_service.json && pbjs -t static-module -r iam_protos google/iam/v1/iam_policy.proto google/iam/v1/options.proto google/iam/v1/policy.proto google/iam/v1/logging/audit_data.proto -p ./protos > protos/iam_service.js && pbts protos/iam_service.js -o protos/iam_service.d.ts","compile-location-protos":"pbjs -t json google/cloud/location/locations.proto -p ./protos > protos/locations.json && pbjs -t static-module -r locations_protos google/cloud/location/locations.proto -p ./protos > protos/locations.js && pbts protos/locations.js -o protos/locations.d.ts","compile-status-protos":"pbjs -t json google/rpc/status.proto google/rpc/error_details.proto -p ./protos > protos/status.json","compile-http-protos":"pbjs -t static-module -r http_proto --keep-case google/api/http.proto -p ./protos > protos/http.js && pbts protos/http.js -o protos/http.d.ts",fix:"gts fix",prepare:"npm run compile && cd ../tools && npm i && npm run compile && cd ../gax && pwd && node ../tools/build/src/prepublish.js . && mkdirp build/protos && cp -r protos/* build/protos/ && npm run minify-proto-json","system-test":"c8 mocha build/test/system-test --timeout 600000 && npm run test-application","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","docs-test":"linkinator docs","predocs-test":"npm run docs","browser-test":"cd test/browser-test && npm run prefetch && npm install && npm test","test-application":"cd test/test-application && npm run prefetch && npm install && npm start",prelint:"cd samples; npm link ../; npm install",precompile:"gts clean","update-protos":"cd ../tools && npm i && npm run compile && cd ../gax && node ../tools/build/src/listProtos.js .","minify-proto-json":"cd ../tools && npm i && npm run compile && cd ../gax && node ../tools/build/src/minify.js"},keywords:["grpc"],repository:{type:"git",url:"https://github.com/googleapis/gax-nodejs.git",directory:"gax"},author:"Google API Authors",license:"Apache-2.0",bugs:{url:"https://github.com/googleapis/gax-nodejs/issues"},homepage:"https://github.com/googleapis/gax-nodejs#readme",engines:{node:">=14"},browser:"build/src/fallback.js"}});var uPe=f(gY=>{"use strict";Object.defineProperty(gY,"__esModule",{value:!0});gY.OperationsClientBuilder=gY.OperationsClient=gY.ALL_SCOPES=gY.SERVICE_ADDRESS=void 0;var OFI=mq(),UFI=rPe(),qGn=kw(),zFI=SGn(),BFI=MGn(),SFI=iPe();gY.SERVICE_ADDRESS="longrunning.googleapis.com";var $Gn=a9().version,MFI=443,TFI="gapic/0.7.1";gY.ALL_SCOPES=[];var Wq=class{constructor(e,n,l){let I=Object.assign({servicePath:gY.SERVICE_ADDRESS,port:MFI,clientConfig:{}},l),a=["gl-node/"+process.versions.node];I.libName&&I.libVersion&&a.push(I.libName+"/"+I.libVersion),a.push(TFI,"gax/"+$Gn),I.fallback?a.push("gl-web/"+$Gn):a.push("grpc/"+e.grpcVersion);let c=e.constructSettings("google.longrunning.Operations",zFI,I.clientConfig||{},{"x-goog-api-client":a.join(" ")});this.auth=e.auth,this.innerApiCalls={},this.descriptor={listOperations:new UFI.PageDescriptor("pageToken","nextPageToken","operations")},this.operationsStub=e.createStub(I.fallback?n.lookupService("google.longrunning.Operations"):n.google.longrunning.Operations,I);let i=["getOperation","listOperations","cancelOperation","deleteOperation"];for(let s of i){let r=this.operationsStub.then(u=>(...o)=>u[s].apply(u,o),u=>()=>{throw u});this.innerApiCalls[s]=(0,OFI.createApiCall)(r,c[s],this.descriptor[s])}}close(){this.operationsStub.then(e=>e.close())}getProjectId(e){if(this.auth&&"getProjectId"in this.auth)return this.auth.getProjectId(e);if(e)e(new Error("Cannot determine project ID."));else return Promise.reject("Cannot determine project ID.")}getOperationInternal(e,n,l){return e=e||{},n=n||{},this.innerApiCalls.getOperation(e,n,l)}getOperation(e,n,l){let I;return n instanceof Function&&l===void 0?(l=n,I={}):I=n,e=e||{},I=I||{},this.innerApiCalls.getOperation(e,I,l)}listOperations(e,n,l){let I;return n instanceof Function&&l===void 0?(l=n,I={}):I=n,e=e||{},I=I||{},this.innerApiCalls.listOperations(e,I,l)}listOperationsStream(e,n){let l=new qGn.CallSettings(n);return this.descriptor.listOperations.createStream(this.innerApiCalls.listOperations,e,l)}listOperationsAsync(e,n){e=e||{},n=n||{};let l=new qGn.CallSettings(n);return this.descriptor.listOperations.asyncIterate(this.innerApiCalls.listOperations,e,l)}cancelOperation(e,n,l){let I;return n instanceof Function&&l===void 0?(l=n,I={}):I=n,e=e||{},I=I||{},this.innerApiCalls.cancelOperation(e,I,l)}deleteOperation(e,n,l){let I;return n instanceof Function&&l===void 0?(l=n,I={}):I=n,e=e||{},I=I||{},this.innerApiCalls.deleteOperation(e,I,l)}};gY.OperationsClient=Wq;var sPe=class{constructor(e,n){n&&e.httpRules&&(0,SFI.overrideHttpRules)(e.httpRules,n);let l=n??e.loadProtoJSON(BFI);this.operationsClient=I=>(e.fallback&&(I.fallback=e.fallback),new Wq(e,l,I)),Object.assign(this.operationsClient,Wq)}};gY.OperationsClientBuilder=sPe});var dPe=f(wVe=>{"use strict";Object.defineProperty(wVe,"__esModule",{value:!0});wVe.encodeRequest=PFI;wVe.decodeResponse=qFI;var ebn=I_e(),DFI=YY(),KFI=VY(),_FI=iPe();function PFI(t,e,n,l,I,a){let c={"Content-Type":"application/json"},i=t.resolvedRequestType.fromObject(I),s=ebn.toProto3JSON(i,{numericEnums:a});if(!s)throw new Error(`Cannot send null request to RPC ${t.name}.`);if(typeof s!="object"||Array.isArray(s))throw new Error(`Request to RPC ${t.name} must be an object.`);let r=(0,_FI.transcode)(s,t.parsedOptions);if(!r)throw new Error(`Cannot build HTTP request for ${JSON.stringify(s)}, method: ${t.name}`);a&&(r.queryString=(r.queryString?`${r.queryString}&`:"")+"$alt=json%3Benum-encoding=int");let u=r.httpMethod.toUpperCase(),o=JSON.stringify(r.data),d=`${e}://${n}:${l}/${r.url.replace(/^\//,"")}?${r.queryString}`;return{method:u,url:d,headers:c,body:o}}function qFI(t,e,n){let l=new TextDecoder().decode(n);if(!l)throw new Error(`Received null response from RPC ${t.name}`);let I=JSON.parse(l);if(!e)throw KFI.GoogleError.parseHttpError(I);let a=ebn.fromProto3JSON(t.resolvedResponseType,I);if(!a)throw new Error(`Received null or malformed response from JSON serializer from RPC ${t.name}`);return t.resolvedResponseType.toObject(a,DFI.defaultToObjectOptions)}});var GPe=f((TVr,HVe)=>{"use strict";var{AbortController:tbn,AbortSignal:$FI}=typeof self<"u"?self:typeof window<"u"?window:void 0;HVe.exports=tbn;HVe.exports.AbortSignal=$FI;HVe.exports.default=tbn});var nbn=f(QVe=>{"use strict";Object.defineProperty(QVe,"__esModule",{value:!0});QVe.StreamArrayParser=void 0;var e2I=GPe(),t2I=require("stream"),n2I=dPe(),l2I=C6(),bPe=class extends t2I.Transform{constructor(e,n){super(Object.assign({},n,{readableObjectMode:!0})),this._done=!1,this._prevBlock=Buffer.from(""),this._isInString=!1,this._isSkipped=!1,this._level=0,this.rpc=e,this.cancelController=(0,l2I.hasAbortController)()?new AbortController:new e2I.AbortController,this.cancelSignal=this.cancelController.signal,this.cancelRequested=!1}_transform(e,n,l){let I=0,a=0;for(this._level===0&&a===0&&(String.fromCharCode(e[0])!=="["&&this.emit("error",new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(e[0])}`)),a++,this._level++);a1&&(this._prevBlock=Buffer.concat([this._prevBlock,e.slice(I,a)])),l()}_flush(e){e()}cancel(){this._done=!0,this.cancelRequested=!0,this.cancelController.abort(),this.end()}};QVe.StreamArrayParser=bPe});var Ibn=f(mPe=>{"use strict";Object.defineProperty(mPe,"__esModule",{value:!0});mPe.generateServiceStub=o2I;var I2I=_Te(),a2I=GPe(),lbn=C6(),r2I=nbn(),c2I=require("stream");function o2I(t,e,n,l,I,a,c,i){let s=(0,lbn.hasWindowFetch)()?window.fetch:I2I.default,r={close:()=>({cancel:()=>{}})};for(let[u,o]of Object.entries(t))r[u]=(d,b,h,Z)=>{b??(b={});let N;try{N=a(o,e,n,l,d,i)}catch(L){return Z&&Z(L),{cancel(){}}}let g=(0,lbn.hasAbortController)()?new AbortController:new a2I.AbortController,y=g.signal,X=!1,v=N.url,H=N.headers;for(let L of Object.keys(b))H[L]=b[L][0];let Q=new r2I.StreamArrayParser(o);return I.getRequestHeaders().then(L=>{let J={headers:{...L,...H},body:N.body,method:N.method,signal:y};return(N.method==="GET"||N.method==="DELETE")&&delete J.body,s(v,J)}).then(L=>{if(L.ok&&o.responseStream){(0,c2I.pipeline)(L.body,Q,J=>{J&&(!X||J instanceof Error&&J.name!=="AbortError")&&(Z&&Z(J),Q.emit("error",J))});return}else return Promise.all([Promise.resolve(L.ok),L.arrayBuffer()]).then(([J,O])=>{let U=c(o,J,O);Z(null,U)}).catch(J=>{if(!X||J.name!=="AbortError")if(o.responseStream)Z&&Z(J),Q.emit("error",J);else if(Z)Z(J);else throw J})}).catch(L=>{if(o.responseStream)Z&&Z(L),Q.emit("error",L);else if(Z)Z(L);else throw L}),o.responseStream?Q:{cancel:()=>{X=!0,g.abort()}}};return r}});var abn=f((_Vr,Nq)=>{(t=>{typeof define=="function"&&define.amd?define(["protobufjs/minimal"],t):typeof require=="function"&&typeof Nq=="object"&&Nq&&Nq.exports&&(Nq.exports=t(l9()))})(function(t){var e,n,l,I,a,c=t.Reader,i=t.Writer,s=t.util,r=t.roots.iam_protos||(t.roots.iam_protos={});function u(G,W,A){t.rpc.Service.call(this,G,W,A)}function o(G){if(G)for(var W=Object.keys(G),A=0;A>>3){case 1:x.resource=G.string();break;case 2:x.policy=r.google.iam.v1.Policy.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},o.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},o.verify=function(G){return typeof G!="object"||G===null?"object expected":G.resource!=null&&G.hasOwnProperty("resource")&&!s.isString(G.resource)?"resource: string expected":G.policy!=null&&G.hasOwnProperty("policy")&&(G=r.google.iam.v1.Policy.verify(G.policy),G)?"policy."+G:null},o.fromObject=function(G){if(G instanceof r.google.iam.v1.SetIamPolicyRequest)return G;var W=new r.google.iam.v1.SetIamPolicyRequest;if(G.resource!=null&&(W.resource=String(G.resource)),G.policy!=null){if(typeof G.policy!="object")throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected");W.policy=r.google.iam.v1.Policy.fromObject(G.policy)}return W},o.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.resource="",A.policy=null),G.resource!=null&&G.hasOwnProperty("resource")&&(A.resource=G.resource),G.policy!=null&&G.hasOwnProperty("policy")&&(A.policy=r.google.iam.v1.Policy.toObject(G.policy,W)),A},o.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},o),n.GetIamPolicyRequest=(d.prototype.resource="",d.prototype.options=null,d.create=function(G){return new d(G)},d.encode=function(G,W){return W=W||i.create(),G.resource!=null&&Object.hasOwnProperty.call(G,"resource")&&W.uint32(10).string(G.resource),G.options!=null&&Object.hasOwnProperty.call(G,"options")&&r.google.iam.v1.GetPolicyOptions.encode(G.options,W.uint32(18).fork()).ldelim(),W},d.encodeDelimited=function(G,W){return this.encode(G,W).ldelim()},d.decode=function(G,W){G instanceof c||(G=c.create(G));for(var A=W===void 0?G.len:G.pos+W,x=new r.google.iam.v1.GetIamPolicyRequest;G.pos>>3){case 1:x.resource=G.string();break;case 2:x.options=r.google.iam.v1.GetPolicyOptions.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},d.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},d.verify=function(G){return typeof G!="object"||G===null?"object expected":G.resource!=null&&G.hasOwnProperty("resource")&&!s.isString(G.resource)?"resource: string expected":G.options!=null&&G.hasOwnProperty("options")&&(G=r.google.iam.v1.GetPolicyOptions.verify(G.options),G)?"options."+G:null},d.fromObject=function(G){if(G instanceof r.google.iam.v1.GetIamPolicyRequest)return G;var W=new r.google.iam.v1.GetIamPolicyRequest;if(G.resource!=null&&(W.resource=String(G.resource)),G.options!=null){if(typeof G.options!="object")throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected");W.options=r.google.iam.v1.GetPolicyOptions.fromObject(G.options)}return W},d.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.resource="",A.options=null),G.resource!=null&&G.hasOwnProperty("resource")&&(A.resource=G.resource),G.options!=null&&G.hasOwnProperty("options")&&(A.options=r.google.iam.v1.GetPolicyOptions.toObject(G.options,W)),A},d.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},d),n.TestIamPermissionsRequest=(b.prototype.resource="",b.prototype.permissions=s.emptyArray,b.create=function(G){return new b(G)},b.encode=function(G,W){if(W=W||i.create(),G.resource!=null&&Object.hasOwnProperty.call(G,"resource")&&W.uint32(10).string(G.resource),G.permissions!=null&&G.permissions.length)for(var A=0;A>>3){case 1:x.resource=G.string();break;case 2:x.permissions&&x.permissions.length||(x.permissions=[]),x.permissions.push(G.string());break;default:G.skipType(7&ue)}}return x},b.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},b.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.resource!=null&&G.hasOwnProperty("resource")&&!s.isString(G.resource))return"resource: string expected";if(G.permissions!=null&&G.hasOwnProperty("permissions")){if(!Array.isArray(G.permissions))return"permissions: array expected";for(var W=0;W>>3==1?(x.permissions&&x.permissions.length||(x.permissions=[]),x.permissions.push(G.string())):G.skipType(7&ue)}return x},h.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},h.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.permissions!=null&&G.hasOwnProperty("permissions")){if(!Array.isArray(G.permissions))return"permissions: array expected";for(var W=0;W>>3==1?x.requestedPolicyVersion=G.int32():G.skipType(7&ue)}return x},Z.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},Z.verify=function(G){return typeof G!="object"||G===null?"object expected":G.requestedPolicyVersion!=null&&G.hasOwnProperty("requestedPolicyVersion")&&!s.isInteger(G.requestedPolicyVersion)?"requestedPolicyVersion: integer expected":null},Z.fromObject=function(G){var W;return G instanceof r.google.iam.v1.GetPolicyOptions?G:(W=new r.google.iam.v1.GetPolicyOptions,G.requestedPolicyVersion!=null&&(W.requestedPolicyVersion=0|G.requestedPolicyVersion),W)},Z.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.requestedPolicyVersion=0),G.requestedPolicyVersion!=null&&G.hasOwnProperty("requestedPolicyVersion")&&(A.requestedPolicyVersion=G.requestedPolicyVersion),A},Z.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},Z),n.Policy=(N.prototype.version=0,N.prototype.bindings=s.emptyArray,N.prototype.etag=s.newBuffer([]),N.create=function(G){return new N(G)},N.encode=function(G,W){if(W=W||i.create(),G.version!=null&&Object.hasOwnProperty.call(G,"version")&&W.uint32(8).int32(G.version),G.etag!=null&&Object.hasOwnProperty.call(G,"etag")&&W.uint32(26).bytes(G.etag),G.bindings!=null&&G.bindings.length)for(var A=0;A>>3){case 1:x.version=G.int32();break;case 4:x.bindings&&x.bindings.length||(x.bindings=[]),x.bindings.push(r.google.iam.v1.Binding.decode(G,G.uint32()));break;case 3:x.etag=G.bytes();break;default:G.skipType(7&ue)}}return x},N.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},N.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.version!=null&&G.hasOwnProperty("version")&&!s.isInteger(G.version))return"version: integer expected";if(G.bindings!=null&&G.hasOwnProperty("bindings")){if(!Array.isArray(G.bindings))return"bindings: array expected";for(var W=0;W>>3){case 1:x.role=G.string();break;case 2:x.members&&x.members.length||(x.members=[]),x.members.push(G.string());break;case 3:x.condition=r.google.type.Expr.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},g.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},g.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.role!=null&&G.hasOwnProperty("role")&&!s.isString(G.role))return"role: string expected";if(G.members!=null&&G.hasOwnProperty("members")){if(!Array.isArray(G.members))return"members: array expected";for(var W=0;W>>3){case 1:x.bindingDeltas&&x.bindingDeltas.length||(x.bindingDeltas=[]),x.bindingDeltas.push(r.google.iam.v1.BindingDelta.decode(G,G.uint32()));break;case 2:x.auditConfigDeltas&&x.auditConfigDeltas.length||(x.auditConfigDeltas=[]),x.auditConfigDeltas.push(r.google.iam.v1.AuditConfigDelta.decode(G,G.uint32()));break;default:G.skipType(7&ue)}}return x},y.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},y.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.bindingDeltas!=null&&G.hasOwnProperty("bindingDeltas")){if(!Array.isArray(G.bindingDeltas))return"bindingDeltas: array expected";for(var W=0;W>>3){case 1:x.action=G.int32();break;case 2:x.role=G.string();break;case 3:x.member=G.string();break;case 4:x.condition=r.google.type.Expr.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},X.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},X.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.action!=null&&G.hasOwnProperty("action"))switch(G.action){default:return"action: enum value expected";case 0:case 1:case 2:}return G.role!=null&&G.hasOwnProperty("role")&&!s.isString(G.role)?"role: string expected":G.member!=null&&G.hasOwnProperty("member")&&!s.isString(G.member)?"member: string expected":G.condition!=null&&G.hasOwnProperty("condition")&&(G=r.google.type.Expr.verify(G.condition),G)?"condition."+G:null},X.fromObject=function(G){if(G instanceof r.google.iam.v1.BindingDelta)return G;var W=new r.google.iam.v1.BindingDelta;switch(G.action){case"ACTION_UNSPECIFIED":case 0:W.action=0;break;case"ADD":case 1:W.action=1;break;case"REMOVE":case 2:W.action=2}if(G.role!=null&&(W.role=String(G.role)),G.member!=null&&(W.member=String(G.member)),G.condition!=null){if(typeof G.condition!="object")throw TypeError(".google.iam.v1.BindingDelta.condition: object expected");W.condition=r.google.type.Expr.fromObject(G.condition)}return W},X.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.action=W.enums===String?"ACTION_UNSPECIFIED":0,A.role="",A.member="",A.condition=null),G.action!=null&&G.hasOwnProperty("action")&&(A.action=W.enums===String?r.google.iam.v1.BindingDelta.Action[G.action]:G.action),G.role!=null&&G.hasOwnProperty("role")&&(A.role=G.role),G.member!=null&&G.hasOwnProperty("member")&&(A.member=G.member),G.condition!=null&&G.hasOwnProperty("condition")&&(A.condition=r.google.type.Expr.toObject(G.condition,W)),A},X.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},X.Action=(e={},(I=Object.create(e))[e[0]="ACTION_UNSPECIFIED"]=0,I[e[1]="ADD"]=1,I[e[2]="REMOVE"]=2,I),X),n.AuditConfigDelta=(v.prototype.action=0,v.prototype.service="",v.prototype.exemptedMember="",v.prototype.logType="",v.create=function(G){return new v(G)},v.encode=function(G,W){return W=W||i.create(),G.action!=null&&Object.hasOwnProperty.call(G,"action")&&W.uint32(8).int32(G.action),G.service!=null&&Object.hasOwnProperty.call(G,"service")&&W.uint32(18).string(G.service),G.exemptedMember!=null&&Object.hasOwnProperty.call(G,"exemptedMember")&&W.uint32(26).string(G.exemptedMember),G.logType!=null&&Object.hasOwnProperty.call(G,"logType")&&W.uint32(34).string(G.logType),W},v.encodeDelimited=function(G,W){return this.encode(G,W).ldelim()},v.decode=function(G,W){G instanceof c||(G=c.create(G));for(var A=W===void 0?G.len:G.pos+W,x=new r.google.iam.v1.AuditConfigDelta;G.pos>>3){case 1:x.action=G.int32();break;case 2:x.service=G.string();break;case 3:x.exemptedMember=G.string();break;case 4:x.logType=G.string();break;default:G.skipType(7&ue)}}return x},v.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},v.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.action!=null&&G.hasOwnProperty("action"))switch(G.action){default:return"action: enum value expected";case 0:case 1:case 2:}return G.service!=null&&G.hasOwnProperty("service")&&!s.isString(G.service)?"service: string expected":G.exemptedMember!=null&&G.hasOwnProperty("exemptedMember")&&!s.isString(G.exemptedMember)?"exemptedMember: string expected":G.logType!=null&&G.hasOwnProperty("logType")&&!s.isString(G.logType)?"logType: string expected":null},v.fromObject=function(G){if(G instanceof r.google.iam.v1.AuditConfigDelta)return G;var W=new r.google.iam.v1.AuditConfigDelta;switch(G.action){case"ACTION_UNSPECIFIED":case 0:W.action=0;break;case"ADD":case 1:W.action=1;break;case"REMOVE":case 2:W.action=2}return G.service!=null&&(W.service=String(G.service)),G.exemptedMember!=null&&(W.exemptedMember=String(G.exemptedMember)),G.logType!=null&&(W.logType=String(G.logType)),W},v.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.action=W.enums===String?"ACTION_UNSPECIFIED":0,A.service="",A.exemptedMember="",A.logType=""),G.action!=null&&G.hasOwnProperty("action")&&(A.action=W.enums===String?r.google.iam.v1.AuditConfigDelta.Action[G.action]:G.action),G.service!=null&&G.hasOwnProperty("service")&&(A.service=G.service),G.exemptedMember!=null&&G.hasOwnProperty("exemptedMember")&&(A.exemptedMember=G.exemptedMember),G.logType!=null&&G.hasOwnProperty("logType")&&(A.logType=G.logType),A},v.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},v.Action=(e={},(I=Object.create(e))[e[0]="ACTION_UNSPECIFIED"]=0,I[e[1]="ADD"]=1,I[e[2]="REMOVE"]=2,I),v),n.logging=((e={}).AuditData=(H.prototype.policyDelta=null,H.create=function(G){return new H(G)},H.encode=function(G,W){return W=W||i.create(),G.policyDelta!=null&&Object.hasOwnProperty.call(G,"policyDelta")&&r.google.iam.v1.PolicyDelta.encode(G.policyDelta,W.uint32(18).fork()).ldelim(),W},H.encodeDelimited=function(G,W){return this.encode(G,W).ldelim()},H.decode=function(G,W){G instanceof c||(G=c.create(G));for(var A=W===void 0?G.len:G.pos+W,x=new r.google.iam.v1.logging.AuditData;G.pos>>3==2?x.policyDelta=r.google.iam.v1.PolicyDelta.decode(G,G.uint32()):G.skipType(7&ue)}return x},H.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},H.verify=function(G){return typeof G!="object"||G===null?"object expected":G.policyDelta!=null&&G.hasOwnProperty("policyDelta")&&(G=r.google.iam.v1.PolicyDelta.verify(G.policyDelta),G)?"policyDelta."+G:null},H.fromObject=function(G){if(G instanceof r.google.iam.v1.logging.AuditData)return G;var W=new r.google.iam.v1.logging.AuditData;if(G.policyDelta!=null){if(typeof G.policyDelta!="object")throw TypeError(".google.iam.v1.logging.AuditData.policyDelta: object expected");W.policyDelta=r.google.iam.v1.PolicyDelta.fromObject(G.policyDelta)}return W},H.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.policyDelta=null),G.policyDelta!=null&&G.hasOwnProperty("policyDelta")&&(A.policyDelta=r.google.iam.v1.PolicyDelta.toObject(G.policyDelta,W)),A},H.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},H),e),n),l),a.api=((I={}).Http=(Q.prototype.rules=s.emptyArray,Q.prototype.fullyDecodeReservedExpansion=!1,Q.create=function(G){return new Q(G)},Q.encode=function(G,W){if(W=W||i.create(),G.rules!=null&&G.rules.length)for(var A=0;A>>3){case 1:x.rules&&x.rules.length||(x.rules=[]),x.rules.push(r.google.api.HttpRule.decode(G,G.uint32()));break;case 2:x.fullyDecodeReservedExpansion=G.bool();break;default:G.skipType(7&ue)}}return x},Q.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},Q.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.rules!=null&&G.hasOwnProperty("rules")){if(!Array.isArray(G.rules))return"rules: array expected";for(var W=0;W>>3){case 1:x.selector=G.string();break;case 2:x.get=G.string();break;case 3:x.put=G.string();break;case 4:x.post=G.string();break;case 5:x.delete=G.string();break;case 6:x.patch=G.string();break;case 8:x.custom=r.google.api.CustomHttpPattern.decode(G,G.uint32());break;case 7:x.body=G.string();break;case 12:x.responseBody=G.string();break;case 11:x.additionalBindings&&x.additionalBindings.length||(x.additionalBindings=[]),x.additionalBindings.push(r.google.api.HttpRule.decode(G,G.uint32()));break;default:G.skipType(7&ue)}}return x},L.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},L.verify=function(G){if(typeof G!="object"||G===null)return"object expected";var W={};if(G.selector!=null&&G.hasOwnProperty("selector")&&!s.isString(G.selector))return"selector: string expected";if(G.get!=null&&G.hasOwnProperty("get")&&(W.pattern=1,!s.isString(G.get)))return"get: string expected";if(G.put!=null&&G.hasOwnProperty("put")){if(W.pattern===1)return"pattern: multiple values";if(W.pattern=1,!s.isString(G.put))return"put: string expected"}if(G.post!=null&&G.hasOwnProperty("post")){if(W.pattern===1)return"pattern: multiple values";if(W.pattern=1,!s.isString(G.post))return"post: string expected"}if(G.delete!=null&&G.hasOwnProperty("delete")){if(W.pattern===1)return"pattern: multiple values";if(W.pattern=1,!s.isString(G.delete))return"delete: string expected"}if(G.patch!=null&&G.hasOwnProperty("patch")){if(W.pattern===1)return"pattern: multiple values";if(W.pattern=1,!s.isString(G.patch))return"patch: string expected"}if(G.custom!=null&&G.hasOwnProperty("custom")){if(W.pattern===1)return"pattern: multiple values";if(W.pattern=1,A=r.google.api.CustomHttpPattern.verify(G.custom))return"custom."+A}if(G.body!=null&&G.hasOwnProperty("body")&&!s.isString(G.body))return"body: string expected";if(G.responseBody!=null&&G.hasOwnProperty("responseBody")&&!s.isString(G.responseBody))return"responseBody: string expected";if(G.additionalBindings!=null&&G.hasOwnProperty("additionalBindings")){if(!Array.isArray(G.additionalBindings))return"additionalBindings: array expected";for(var A,x=0;x>>3){case 1:x.kind=G.string();break;case 2:x.path=G.string();break;default:G.skipType(7&ue)}}return x},J.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},J.verify=function(G){return typeof G!="object"||G===null?"object expected":G.kind!=null&&G.hasOwnProperty("kind")&&!s.isString(G.kind)?"kind: string expected":G.path!=null&&G.hasOwnProperty("path")&&!s.isString(G.path)?"path: string expected":null},J.fromObject=function(G){var W;return G instanceof r.google.api.CustomHttpPattern?G:(W=new r.google.api.CustomHttpPattern,G.kind!=null&&(W.kind=String(G.kind)),G.path!=null&&(W.path=String(G.path)),W)},J.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.kind="",A.path=""),G.kind!=null&&G.hasOwnProperty("kind")&&(A.kind=G.kind),G.path!=null&&G.hasOwnProperty("path")&&(A.path=G.path),A},J.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},J),I.FieldBehavior=(e={},(n=Object.create(e))[e[0]="FIELD_BEHAVIOR_UNSPECIFIED"]=0,n[e[1]="OPTIONAL"]=1,n[e[2]="REQUIRED"]=2,n[e[3]="OUTPUT_ONLY"]=3,n[e[4]="INPUT_ONLY"]=4,n[e[5]="IMMUTABLE"]=5,n),I.ResourceDescriptor=(O.prototype.type="",O.prototype.pattern=s.emptyArray,O.prototype.nameField="",O.prototype.history=0,O.prototype.plural="",O.prototype.singular="",O.create=function(G){return new O(G)},O.encode=function(G,W){if(W=W||i.create(),G.type!=null&&Object.hasOwnProperty.call(G,"type")&&W.uint32(10).string(G.type),G.pattern!=null&&G.pattern.length)for(var A=0;A>>3){case 1:x.type=G.string();break;case 2:x.pattern&&x.pattern.length||(x.pattern=[]),x.pattern.push(G.string());break;case 3:x.nameField=G.string();break;case 4:x.history=G.int32();break;case 5:x.plural=G.string();break;case 6:x.singular=G.string();break;default:G.skipType(7&ue)}}return x},O.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},O.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.type!=null&&G.hasOwnProperty("type")&&!s.isString(G.type))return"type: string expected";if(G.pattern!=null&&G.hasOwnProperty("pattern")){if(!Array.isArray(G.pattern))return"pattern: array expected";for(var W=0;W>>3){case 1:x.type=G.string();break;case 2:x.childType=G.string();break;default:G.skipType(7&ue)}}return x},U.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},U.verify=function(G){return typeof G!="object"||G===null?"object expected":G.type!=null&&G.hasOwnProperty("type")&&!s.isString(G.type)?"type: string expected":G.childType!=null&&G.hasOwnProperty("childType")&&!s.isString(G.childType)?"childType: string expected":null},U.fromObject=function(G){var W;return G instanceof r.google.api.ResourceReference?G:(W=new r.google.api.ResourceReference,G.type!=null&&(W.type=String(G.type)),G.childType!=null&&(W.childType=String(G.childType)),W)},U.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.type="",A.childType=""),G.type!=null&&G.hasOwnProperty("type")&&(A.type=G.type),G.childType!=null&&G.hasOwnProperty("childType")&&(A.childType=G.childType),A},U.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},U),I),a.protobuf=((l={}).FileDescriptorSet=(K.prototype.file=s.emptyArray,K.create=function(G){return new K(G)},K.encode=function(G,W){if(W=W||i.create(),G.file!=null&&G.file.length)for(var A=0;A>>3==1?(x.file&&x.file.length||(x.file=[]),x.file.push(r.google.protobuf.FileDescriptorProto.decode(G,G.uint32()))):G.skipType(7&ue)}return x},K.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},K.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.file!=null&&G.hasOwnProperty("file")){if(!Array.isArray(G.file))return"file: array expected";for(var W=0;W>>3){case 1:x.name=G.string();break;case 2:x.package=G.string();break;case 3:x.dependency&&x.dependency.length||(x.dependency=[]),x.dependency.push(G.string());break;case 10:if(x.publicDependency&&x.publicDependency.length||(x.publicDependency=[]),(7&ue)==2)for(var Ue=G.uint32()+G.pos;G.pos>>3){case 1:x.name=G.string();break;case 2:x.field&&x.field.length||(x.field=[]),x.field.push(r.google.protobuf.FieldDescriptorProto.decode(G,G.uint32()));break;case 6:x.extension&&x.extension.length||(x.extension=[]),x.extension.push(r.google.protobuf.FieldDescriptorProto.decode(G,G.uint32()));break;case 3:x.nestedType&&x.nestedType.length||(x.nestedType=[]),x.nestedType.push(r.google.protobuf.DescriptorProto.decode(G,G.uint32()));break;case 4:x.enumType&&x.enumType.length||(x.enumType=[]),x.enumType.push(r.google.protobuf.EnumDescriptorProto.decode(G,G.uint32()));break;case 5:x.extensionRange&&x.extensionRange.length||(x.extensionRange=[]),x.extensionRange.push(r.google.protobuf.DescriptorProto.ExtensionRange.decode(G,G.uint32()));break;case 8:x.oneofDecl&&x.oneofDecl.length||(x.oneofDecl=[]),x.oneofDecl.push(r.google.protobuf.OneofDescriptorProto.decode(G,G.uint32()));break;case 7:x.options=r.google.protobuf.MessageOptions.decode(G,G.uint32());break;case 9:x.reservedRange&&x.reservedRange.length||(x.reservedRange=[]),x.reservedRange.push(r.google.protobuf.DescriptorProto.ReservedRange.decode(G,G.uint32()));break;case 10:x.reservedName&&x.reservedName.length||(x.reservedName=[]),x.reservedName.push(G.string());break;default:G.skipType(7&ue)}}return x},_.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},_.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.name!=null&&G.hasOwnProperty("name")&&!s.isString(G.name))return"name: string expected";if(G.field!=null&&G.hasOwnProperty("field")){if(!Array.isArray(G.field))return"field: array expected";for(var W=0;W>>3){case 1:x.start=G.int32();break;case 2:x.end=G.int32();break;case 3:x.options=r.google.protobuf.ExtensionRangeOptions.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},P.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},P.verify=function(G){return typeof G!="object"||G===null?"object expected":G.start!=null&&G.hasOwnProperty("start")&&!s.isInteger(G.start)?"start: integer expected":G.end!=null&&G.hasOwnProperty("end")&&!s.isInteger(G.end)?"end: integer expected":G.options!=null&&G.hasOwnProperty("options")&&(G=r.google.protobuf.ExtensionRangeOptions.verify(G.options),G)?"options."+G:null},P.fromObject=function(G){if(G instanceof r.google.protobuf.DescriptorProto.ExtensionRange)return G;var W=new r.google.protobuf.DescriptorProto.ExtensionRange;if(G.start!=null&&(W.start=0|G.start),G.end!=null&&(W.end=0|G.end),G.options!=null){if(typeof G.options!="object")throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");W.options=r.google.protobuf.ExtensionRangeOptions.fromObject(G.options)}return W},P.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.start=0,A.end=0,A.options=null),G.start!=null&&G.hasOwnProperty("start")&&(A.start=G.start),G.end!=null&&G.hasOwnProperty("end")&&(A.end=G.end),G.options!=null&&G.hasOwnProperty("options")&&(A.options=r.google.protobuf.ExtensionRangeOptions.toObject(G.options,W)),A},P.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},P),_.ReservedRange=(le.prototype.start=0,le.prototype.end=0,le.create=function(G){return new le(G)},le.encode=function(G,W){return W=W||i.create(),G.start!=null&&Object.hasOwnProperty.call(G,"start")&&W.uint32(8).int32(G.start),G.end!=null&&Object.hasOwnProperty.call(G,"end")&&W.uint32(16).int32(G.end),W},le.encodeDelimited=function(G,W){return this.encode(G,W).ldelim()},le.decode=function(G,W){G instanceof c||(G=c.create(G));for(var A=W===void 0?G.len:G.pos+W,x=new r.google.protobuf.DescriptorProto.ReservedRange;G.pos>>3){case 1:x.start=G.int32();break;case 2:x.end=G.int32();break;default:G.skipType(7&ue)}}return x},le.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},le.verify=function(G){return typeof G!="object"||G===null?"object expected":G.start!=null&&G.hasOwnProperty("start")&&!s.isInteger(G.start)?"start: integer expected":G.end!=null&&G.hasOwnProperty("end")&&!s.isInteger(G.end)?"end: integer expected":null},le.fromObject=function(G){var W;return G instanceof r.google.protobuf.DescriptorProto.ReservedRange?G:(W=new r.google.protobuf.DescriptorProto.ReservedRange,G.start!=null&&(W.start=0|G.start),G.end!=null&&(W.end=0|G.end),W)},le.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.start=0,A.end=0),G.start!=null&&G.hasOwnProperty("start")&&(A.start=G.start),G.end!=null&&G.hasOwnProperty("end")&&(A.end=G.end),A},le.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},le),_),l.ExtensionRangeOptions=(q.prototype.uninterpretedOption=s.emptyArray,q.create=function(G){return new q(G)},q.encode=function(G,W){if(W=W||i.create(),G.uninterpretedOption!=null&&G.uninterpretedOption.length)for(var A=0;A>>3==999?(x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()))):G.skipType(7&ue)}return x},q.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},q.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 1:x.name=G.string();break;case 3:x.number=G.int32();break;case 4:x.label=G.int32();break;case 5:x.type=G.int32();break;case 6:x.typeName=G.string();break;case 2:x.extendee=G.string();break;case 7:x.defaultValue=G.string();break;case 9:x.oneofIndex=G.int32();break;case 10:x.jsonName=G.string();break;case 8:x.options=r.google.protobuf.FieldOptions.decode(G,G.uint32());break;case 17:x.proto3Optional=G.bool();break;default:G.skipType(7&ue)}}return x},ee.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},ee.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.name!=null&&G.hasOwnProperty("name")&&!s.isString(G.name))return"name: string expected";if(G.number!=null&&G.hasOwnProperty("number")&&!s.isInteger(G.number))return"number: integer expected";if(G.label!=null&&G.hasOwnProperty("label"))switch(G.label){default:return"label: enum value expected";case 1:case 2:case 3:}if(G.type!=null&&G.hasOwnProperty("type"))switch(G.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(G.typeName!=null&&G.hasOwnProperty("typeName")&&!s.isString(G.typeName))return"typeName: string expected";if(G.extendee!=null&&G.hasOwnProperty("extendee")&&!s.isString(G.extendee))return"extendee: string expected";if(G.defaultValue!=null&&G.hasOwnProperty("defaultValue")&&!s.isString(G.defaultValue))return"defaultValue: string expected";if(G.oneofIndex!=null&&G.hasOwnProperty("oneofIndex")&&!s.isInteger(G.oneofIndex))return"oneofIndex: integer expected";if(G.jsonName!=null&&G.hasOwnProperty("jsonName")&&!s.isString(G.jsonName))return"jsonName: string expected";if(G.options!=null&&G.hasOwnProperty("options")){var W=r.google.protobuf.FieldOptions.verify(G.options);if(W)return"options."+W}return G.proto3Optional!=null&&G.hasOwnProperty("proto3Optional")&&typeof G.proto3Optional!="boolean"?"proto3Optional: boolean expected":null},ee.fromObject=function(G){if(G instanceof r.google.protobuf.FieldDescriptorProto)return G;var W=new r.google.protobuf.FieldDescriptorProto;switch(G.name!=null&&(W.name=String(G.name)),G.number!=null&&(W.number=0|G.number),G.label){case"LABEL_OPTIONAL":case 1:W.label=1;break;case"LABEL_REQUIRED":case 2:W.label=2;break;case"LABEL_REPEATED":case 3:W.label=3}switch(G.type){case"TYPE_DOUBLE":case 1:W.type=1;break;case"TYPE_FLOAT":case 2:W.type=2;break;case"TYPE_INT64":case 3:W.type=3;break;case"TYPE_UINT64":case 4:W.type=4;break;case"TYPE_INT32":case 5:W.type=5;break;case"TYPE_FIXED64":case 6:W.type=6;break;case"TYPE_FIXED32":case 7:W.type=7;break;case"TYPE_BOOL":case 8:W.type=8;break;case"TYPE_STRING":case 9:W.type=9;break;case"TYPE_GROUP":case 10:W.type=10;break;case"TYPE_MESSAGE":case 11:W.type=11;break;case"TYPE_BYTES":case 12:W.type=12;break;case"TYPE_UINT32":case 13:W.type=13;break;case"TYPE_ENUM":case 14:W.type=14;break;case"TYPE_SFIXED32":case 15:W.type=15;break;case"TYPE_SFIXED64":case 16:W.type=16;break;case"TYPE_SINT32":case 17:W.type=17;break;case"TYPE_SINT64":case 18:W.type=18}if(G.typeName!=null&&(W.typeName=String(G.typeName)),G.extendee!=null&&(W.extendee=String(G.extendee)),G.defaultValue!=null&&(W.defaultValue=String(G.defaultValue)),G.oneofIndex!=null&&(W.oneofIndex=0|G.oneofIndex),G.jsonName!=null&&(W.jsonName=String(G.jsonName)),G.options!=null){if(typeof G.options!="object")throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");W.options=r.google.protobuf.FieldOptions.fromObject(G.options)}return G.proto3Optional!=null&&(W.proto3Optional=!!G.proto3Optional),W},ee.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.name="",A.extendee="",A.number=0,A.label=W.enums===String?"LABEL_OPTIONAL":1,A.type=W.enums===String?"TYPE_DOUBLE":1,A.typeName="",A.defaultValue="",A.options=null,A.oneofIndex=0,A.jsonName="",A.proto3Optional=!1),G.name!=null&&G.hasOwnProperty("name")&&(A.name=G.name),G.extendee!=null&&G.hasOwnProperty("extendee")&&(A.extendee=G.extendee),G.number!=null&&G.hasOwnProperty("number")&&(A.number=G.number),G.label!=null&&G.hasOwnProperty("label")&&(A.label=W.enums===String?r.google.protobuf.FieldDescriptorProto.Label[G.label]:G.label),G.type!=null&&G.hasOwnProperty("type")&&(A.type=W.enums===String?r.google.protobuf.FieldDescriptorProto.Type[G.type]:G.type),G.typeName!=null&&G.hasOwnProperty("typeName")&&(A.typeName=G.typeName),G.defaultValue!=null&&G.hasOwnProperty("defaultValue")&&(A.defaultValue=G.defaultValue),G.options!=null&&G.hasOwnProperty("options")&&(A.options=r.google.protobuf.FieldOptions.toObject(G.options,W)),G.oneofIndex!=null&&G.hasOwnProperty("oneofIndex")&&(A.oneofIndex=G.oneofIndex),G.jsonName!=null&&G.hasOwnProperty("jsonName")&&(A.jsonName=G.jsonName),G.proto3Optional!=null&&G.hasOwnProperty("proto3Optional")&&(A.proto3Optional=G.proto3Optional),A},ee.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},ee.Type=(e={},(n=Object.create(e))[e[1]="TYPE_DOUBLE"]=1,n[e[2]="TYPE_FLOAT"]=2,n[e[3]="TYPE_INT64"]=3,n[e[4]="TYPE_UINT64"]=4,n[e[5]="TYPE_INT32"]=5,n[e[6]="TYPE_FIXED64"]=6,n[e[7]="TYPE_FIXED32"]=7,n[e[8]="TYPE_BOOL"]=8,n[e[9]="TYPE_STRING"]=9,n[e[10]="TYPE_GROUP"]=10,n[e[11]="TYPE_MESSAGE"]=11,n[e[12]="TYPE_BYTES"]=12,n[e[13]="TYPE_UINT32"]=13,n[e[14]="TYPE_ENUM"]=14,n[e[15]="TYPE_SFIXED32"]=15,n[e[16]="TYPE_SFIXED64"]=16,n[e[17]="TYPE_SINT32"]=17,n[e[18]="TYPE_SINT64"]=18,n),ee.Label=(e={},(n=Object.create(e))[e[1]="LABEL_OPTIONAL"]=1,n[e[2]="LABEL_REQUIRED"]=2,n[e[3]="LABEL_REPEATED"]=3,n),ee),l.OneofDescriptorProto=(ne.prototype.name="",ne.prototype.options=null,ne.create=function(G){return new ne(G)},ne.encode=function(G,W){return W=W||i.create(),G.name!=null&&Object.hasOwnProperty.call(G,"name")&&W.uint32(10).string(G.name),G.options!=null&&Object.hasOwnProperty.call(G,"options")&&r.google.protobuf.OneofOptions.encode(G.options,W.uint32(18).fork()).ldelim(),W},ne.encodeDelimited=function(G,W){return this.encode(G,W).ldelim()},ne.decode=function(G,W){G instanceof c||(G=c.create(G));for(var A=W===void 0?G.len:G.pos+W,x=new r.google.protobuf.OneofDescriptorProto;G.pos>>3){case 1:x.name=G.string();break;case 2:x.options=r.google.protobuf.OneofOptions.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},ne.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},ne.verify=function(G){return typeof G!="object"||G===null?"object expected":G.name!=null&&G.hasOwnProperty("name")&&!s.isString(G.name)?"name: string expected":G.options!=null&&G.hasOwnProperty("options")&&(G=r.google.protobuf.OneofOptions.verify(G.options),G)?"options."+G:null},ne.fromObject=function(G){if(G instanceof r.google.protobuf.OneofDescriptorProto)return G;var W=new r.google.protobuf.OneofDescriptorProto;if(G.name!=null&&(W.name=String(G.name)),G.options!=null){if(typeof G.options!="object")throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");W.options=r.google.protobuf.OneofOptions.fromObject(G.options)}return W},ne.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.name="",A.options=null),G.name!=null&&G.hasOwnProperty("name")&&(A.name=G.name),G.options!=null&&G.hasOwnProperty("options")&&(A.options=r.google.protobuf.OneofOptions.toObject(G.options,W)),A},ne.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},ne),l.EnumDescriptorProto=(ie.prototype.name="",ie.prototype.value=s.emptyArray,ie.prototype.options=null,ie.prototype.reservedRange=s.emptyArray,ie.prototype.reservedName=s.emptyArray,ie.create=function(G){return new ie(G)},ie.encode=function(G,W){if(W=W||i.create(),G.name!=null&&Object.hasOwnProperty.call(G,"name")&&W.uint32(10).string(G.name),G.value!=null&&G.value.length)for(var A=0;A>>3){case 1:x.name=G.string();break;case 2:x.value&&x.value.length||(x.value=[]),x.value.push(r.google.protobuf.EnumValueDescriptorProto.decode(G,G.uint32()));break;case 3:x.options=r.google.protobuf.EnumOptions.decode(G,G.uint32());break;case 4:x.reservedRange&&x.reservedRange.length||(x.reservedRange=[]),x.reservedRange.push(r.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(G,G.uint32()));break;case 5:x.reservedName&&x.reservedName.length||(x.reservedName=[]),x.reservedName.push(G.string());break;default:G.skipType(7&ue)}}return x},ie.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},ie.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.name!=null&&G.hasOwnProperty("name")&&!s.isString(G.name))return"name: string expected";if(G.value!=null&&G.hasOwnProperty("value")){if(!Array.isArray(G.value))return"value: array expected";for(var W=0;W>>3){case 1:x.start=G.int32();break;case 2:x.end=G.int32();break;default:G.skipType(7&ue)}}return x},me.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},me.verify=function(G){return typeof G!="object"||G===null?"object expected":G.start!=null&&G.hasOwnProperty("start")&&!s.isInteger(G.start)?"start: integer expected":G.end!=null&&G.hasOwnProperty("end")&&!s.isInteger(G.end)?"end: integer expected":null},me.fromObject=function(G){var W;return G instanceof r.google.protobuf.EnumDescriptorProto.EnumReservedRange?G:(W=new r.google.protobuf.EnumDescriptorProto.EnumReservedRange,G.start!=null&&(W.start=0|G.start),G.end!=null&&(W.end=0|G.end),W)},me.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.start=0,A.end=0),G.start!=null&&G.hasOwnProperty("start")&&(A.start=G.start),G.end!=null&&G.hasOwnProperty("end")&&(A.end=G.end),A},me.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},me),ie),l.EnumValueDescriptorProto=(Ze.prototype.name="",Ze.prototype.number=0,Ze.prototype.options=null,Ze.create=function(G){return new Ze(G)},Ze.encode=function(G,W){return W=W||i.create(),G.name!=null&&Object.hasOwnProperty.call(G,"name")&&W.uint32(10).string(G.name),G.number!=null&&Object.hasOwnProperty.call(G,"number")&&W.uint32(16).int32(G.number),G.options!=null&&Object.hasOwnProperty.call(G,"options")&&r.google.protobuf.EnumValueOptions.encode(G.options,W.uint32(26).fork()).ldelim(),W},Ze.encodeDelimited=function(G,W){return this.encode(G,W).ldelim()},Ze.decode=function(G,W){G instanceof c||(G=c.create(G));for(var A=W===void 0?G.len:G.pos+W,x=new r.google.protobuf.EnumValueDescriptorProto;G.pos>>3){case 1:x.name=G.string();break;case 2:x.number=G.int32();break;case 3:x.options=r.google.protobuf.EnumValueOptions.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},Ze.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},Ze.verify=function(G){return typeof G!="object"||G===null?"object expected":G.name!=null&&G.hasOwnProperty("name")&&!s.isString(G.name)?"name: string expected":G.number!=null&&G.hasOwnProperty("number")&&!s.isInteger(G.number)?"number: integer expected":G.options!=null&&G.hasOwnProperty("options")&&(G=r.google.protobuf.EnumValueOptions.verify(G.options),G)?"options."+G:null},Ze.fromObject=function(G){if(G instanceof r.google.protobuf.EnumValueDescriptorProto)return G;var W=new r.google.protobuf.EnumValueDescriptorProto;if(G.name!=null&&(W.name=String(G.name)),G.number!=null&&(W.number=0|G.number),G.options!=null){if(typeof G.options!="object")throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");W.options=r.google.protobuf.EnumValueOptions.fromObject(G.options)}return W},Ze.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.name="",A.number=0,A.options=null),G.name!=null&&G.hasOwnProperty("name")&&(A.name=G.name),G.number!=null&&G.hasOwnProperty("number")&&(A.number=G.number),G.options!=null&&G.hasOwnProperty("options")&&(A.options=r.google.protobuf.EnumValueOptions.toObject(G.options,W)),A},Ze.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},Ze),l.ServiceDescriptorProto=(Fe.prototype.name="",Fe.prototype.method=s.emptyArray,Fe.prototype.options=null,Fe.create=function(G){return new Fe(G)},Fe.encode=function(G,W){if(W=W||i.create(),G.name!=null&&Object.hasOwnProperty.call(G,"name")&&W.uint32(10).string(G.name),G.method!=null&&G.method.length)for(var A=0;A>>3){case 1:x.name=G.string();break;case 2:x.method&&x.method.length||(x.method=[]),x.method.push(r.google.protobuf.MethodDescriptorProto.decode(G,G.uint32()));break;case 3:x.options=r.google.protobuf.ServiceOptions.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},Fe.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},Fe.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.name!=null&&G.hasOwnProperty("name")&&!s.isString(G.name))return"name: string expected";if(G.method!=null&&G.hasOwnProperty("method")){if(!Array.isArray(G.method))return"method: array expected";for(var W=0;W>>3){case 1:x.name=G.string();break;case 2:x.inputType=G.string();break;case 3:x.outputType=G.string();break;case 4:x.options=r.google.protobuf.MethodOptions.decode(G,G.uint32());break;case 5:x.clientStreaming=G.bool();break;case 6:x.serverStreaming=G.bool();break;default:G.skipType(7&ue)}}return x},ce.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},ce.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.name!=null&&G.hasOwnProperty("name")&&!s.isString(G.name))return"name: string expected";if(G.inputType!=null&&G.hasOwnProperty("inputType")&&!s.isString(G.inputType))return"inputType: string expected";if(G.outputType!=null&&G.hasOwnProperty("outputType")&&!s.isString(G.outputType))return"outputType: string expected";if(G.options!=null&&G.hasOwnProperty("options")){var W=r.google.protobuf.MethodOptions.verify(G.options);if(W)return"options."+W}return G.clientStreaming!=null&&G.hasOwnProperty("clientStreaming")&&typeof G.clientStreaming!="boolean"?"clientStreaming: boolean expected":G.serverStreaming!=null&&G.hasOwnProperty("serverStreaming")&&typeof G.serverStreaming!="boolean"?"serverStreaming: boolean expected":null},ce.fromObject=function(G){if(G instanceof r.google.protobuf.MethodDescriptorProto)return G;var W=new r.google.protobuf.MethodDescriptorProto;if(G.name!=null&&(W.name=String(G.name)),G.inputType!=null&&(W.inputType=String(G.inputType)),G.outputType!=null&&(W.outputType=String(G.outputType)),G.options!=null){if(typeof G.options!="object")throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");W.options=r.google.protobuf.MethodOptions.fromObject(G.options)}return G.clientStreaming!=null&&(W.clientStreaming=!!G.clientStreaming),G.serverStreaming!=null&&(W.serverStreaming=!!G.serverStreaming),W},ce.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.name="",A.inputType="",A.outputType="",A.options=null,A.clientStreaming=!1,A.serverStreaming=!1),G.name!=null&&G.hasOwnProperty("name")&&(A.name=G.name),G.inputType!=null&&G.hasOwnProperty("inputType")&&(A.inputType=G.inputType),G.outputType!=null&&G.hasOwnProperty("outputType")&&(A.outputType=G.outputType),G.options!=null&&G.hasOwnProperty("options")&&(A.options=r.google.protobuf.MethodOptions.toObject(G.options,W)),G.clientStreaming!=null&&G.hasOwnProperty("clientStreaming")&&(A.clientStreaming=G.clientStreaming),G.serverStreaming!=null&&G.hasOwnProperty("serverStreaming")&&(A.serverStreaming=G.serverStreaming),A},ce.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},ce),l.FileOptions=(fe.prototype.javaPackage="",fe.prototype.javaOuterClassname="",fe.prototype.javaMultipleFiles=!1,fe.prototype.javaGenerateEqualsAndHash=!1,fe.prototype.javaStringCheckUtf8=!1,fe.prototype.optimizeFor=1,fe.prototype.goPackage="",fe.prototype.ccGenericServices=!1,fe.prototype.javaGenericServices=!1,fe.prototype.pyGenericServices=!1,fe.prototype.phpGenericServices=!1,fe.prototype.deprecated=!1,fe.prototype.ccEnableArenas=!0,fe.prototype.objcClassPrefix="",fe.prototype.csharpNamespace="",fe.prototype.swiftPrefix="",fe.prototype.phpClassPrefix="",fe.prototype.phpNamespace="",fe.prototype.phpMetadataNamespace="",fe.prototype.rubyPackage="",fe.prototype.uninterpretedOption=s.emptyArray,fe.prototype[".google.api.resourceDefinition"]=s.emptyArray,fe.create=function(G){return new fe(G)},fe.encode=function(G,W){if(W=W||i.create(),G.javaPackage!=null&&Object.hasOwnProperty.call(G,"javaPackage")&&W.uint32(10).string(G.javaPackage),G.javaOuterClassname!=null&&Object.hasOwnProperty.call(G,"javaOuterClassname")&&W.uint32(66).string(G.javaOuterClassname),G.optimizeFor!=null&&Object.hasOwnProperty.call(G,"optimizeFor")&&W.uint32(72).int32(G.optimizeFor),G.javaMultipleFiles!=null&&Object.hasOwnProperty.call(G,"javaMultipleFiles")&&W.uint32(80).bool(G.javaMultipleFiles),G.goPackage!=null&&Object.hasOwnProperty.call(G,"goPackage")&&W.uint32(90).string(G.goPackage),G.ccGenericServices!=null&&Object.hasOwnProperty.call(G,"ccGenericServices")&&W.uint32(128).bool(G.ccGenericServices),G.javaGenericServices!=null&&Object.hasOwnProperty.call(G,"javaGenericServices")&&W.uint32(136).bool(G.javaGenericServices),G.pyGenericServices!=null&&Object.hasOwnProperty.call(G,"pyGenericServices")&&W.uint32(144).bool(G.pyGenericServices),G.javaGenerateEqualsAndHash!=null&&Object.hasOwnProperty.call(G,"javaGenerateEqualsAndHash")&&W.uint32(160).bool(G.javaGenerateEqualsAndHash),G.deprecated!=null&&Object.hasOwnProperty.call(G,"deprecated")&&W.uint32(184).bool(G.deprecated),G.javaStringCheckUtf8!=null&&Object.hasOwnProperty.call(G,"javaStringCheckUtf8")&&W.uint32(216).bool(G.javaStringCheckUtf8),G.ccEnableArenas!=null&&Object.hasOwnProperty.call(G,"ccEnableArenas")&&W.uint32(248).bool(G.ccEnableArenas),G.objcClassPrefix!=null&&Object.hasOwnProperty.call(G,"objcClassPrefix")&&W.uint32(290).string(G.objcClassPrefix),G.csharpNamespace!=null&&Object.hasOwnProperty.call(G,"csharpNamespace")&&W.uint32(298).string(G.csharpNamespace),G.swiftPrefix!=null&&Object.hasOwnProperty.call(G,"swiftPrefix")&&W.uint32(314).string(G.swiftPrefix),G.phpClassPrefix!=null&&Object.hasOwnProperty.call(G,"phpClassPrefix")&&W.uint32(322).string(G.phpClassPrefix),G.phpNamespace!=null&&Object.hasOwnProperty.call(G,"phpNamespace")&&W.uint32(330).string(G.phpNamespace),G.phpGenericServices!=null&&Object.hasOwnProperty.call(G,"phpGenericServices")&&W.uint32(336).bool(G.phpGenericServices),G.phpMetadataNamespace!=null&&Object.hasOwnProperty.call(G,"phpMetadataNamespace")&&W.uint32(354).string(G.phpMetadataNamespace),G.rubyPackage!=null&&Object.hasOwnProperty.call(G,"rubyPackage")&&W.uint32(362).string(G.rubyPackage),G.uninterpretedOption!=null&&G.uninterpretedOption.length)for(var A=0;A>>3){case 1:x.javaPackage=G.string();break;case 8:x.javaOuterClassname=G.string();break;case 10:x.javaMultipleFiles=G.bool();break;case 20:x.javaGenerateEqualsAndHash=G.bool();break;case 27:x.javaStringCheckUtf8=G.bool();break;case 9:x.optimizeFor=G.int32();break;case 11:x.goPackage=G.string();break;case 16:x.ccGenericServices=G.bool();break;case 17:x.javaGenericServices=G.bool();break;case 18:x.pyGenericServices=G.bool();break;case 42:x.phpGenericServices=G.bool();break;case 23:x.deprecated=G.bool();break;case 31:x.ccEnableArenas=G.bool();break;case 36:x.objcClassPrefix=G.string();break;case 37:x.csharpNamespace=G.string();break;case 39:x.swiftPrefix=G.string();break;case 40:x.phpClassPrefix=G.string();break;case 41:x.phpNamespace=G.string();break;case 44:x.phpMetadataNamespace=G.string();break;case 45:x.rubyPackage=G.string();break;case 999:x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()));break;case 1053:x[".google.api.resourceDefinition"]&&x[".google.api.resourceDefinition"].length||(x[".google.api.resourceDefinition"]=[]),x[".google.api.resourceDefinition"].push(r.google.api.ResourceDescriptor.decode(G,G.uint32()));break;default:G.skipType(7&ue)}}return x},fe.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},fe.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.javaPackage!=null&&G.hasOwnProperty("javaPackage")&&!s.isString(G.javaPackage))return"javaPackage: string expected";if(G.javaOuterClassname!=null&&G.hasOwnProperty("javaOuterClassname")&&!s.isString(G.javaOuterClassname))return"javaOuterClassname: string expected";if(G.javaMultipleFiles!=null&&G.hasOwnProperty("javaMultipleFiles")&&typeof G.javaMultipleFiles!="boolean")return"javaMultipleFiles: boolean expected";if(G.javaGenerateEqualsAndHash!=null&&G.hasOwnProperty("javaGenerateEqualsAndHash")&&typeof G.javaGenerateEqualsAndHash!="boolean")return"javaGenerateEqualsAndHash: boolean expected";if(G.javaStringCheckUtf8!=null&&G.hasOwnProperty("javaStringCheckUtf8")&&typeof G.javaStringCheckUtf8!="boolean")return"javaStringCheckUtf8: boolean expected";if(G.optimizeFor!=null&&G.hasOwnProperty("optimizeFor"))switch(G.optimizeFor){default:return"optimizeFor: enum value expected";case 1:case 2:case 3:}if(G.goPackage!=null&&G.hasOwnProperty("goPackage")&&!s.isString(G.goPackage))return"goPackage: string expected";if(G.ccGenericServices!=null&&G.hasOwnProperty("ccGenericServices")&&typeof G.ccGenericServices!="boolean")return"ccGenericServices: boolean expected";if(G.javaGenericServices!=null&&G.hasOwnProperty("javaGenericServices")&&typeof G.javaGenericServices!="boolean")return"javaGenericServices: boolean expected";if(G.pyGenericServices!=null&&G.hasOwnProperty("pyGenericServices")&&typeof G.pyGenericServices!="boolean")return"pyGenericServices: boolean expected";if(G.phpGenericServices!=null&&G.hasOwnProperty("phpGenericServices")&&typeof G.phpGenericServices!="boolean")return"phpGenericServices: boolean expected";if(G.deprecated!=null&&G.hasOwnProperty("deprecated")&&typeof G.deprecated!="boolean")return"deprecated: boolean expected";if(G.ccEnableArenas!=null&&G.hasOwnProperty("ccEnableArenas")&&typeof G.ccEnableArenas!="boolean")return"ccEnableArenas: boolean expected";if(G.objcClassPrefix!=null&&G.hasOwnProperty("objcClassPrefix")&&!s.isString(G.objcClassPrefix))return"objcClassPrefix: string expected";if(G.csharpNamespace!=null&&G.hasOwnProperty("csharpNamespace")&&!s.isString(G.csharpNamespace))return"csharpNamespace: string expected";if(G.swiftPrefix!=null&&G.hasOwnProperty("swiftPrefix")&&!s.isString(G.swiftPrefix))return"swiftPrefix: string expected";if(G.phpClassPrefix!=null&&G.hasOwnProperty("phpClassPrefix")&&!s.isString(G.phpClassPrefix))return"phpClassPrefix: string expected";if(G.phpNamespace!=null&&G.hasOwnProperty("phpNamespace")&&!s.isString(G.phpNamespace))return"phpNamespace: string expected";if(G.phpMetadataNamespace!=null&&G.hasOwnProperty("phpMetadataNamespace")&&!s.isString(G.phpMetadataNamespace))return"phpMetadataNamespace: string expected";if(G.rubyPackage!=null&&G.hasOwnProperty("rubyPackage")&&!s.isString(G.rubyPackage))return"rubyPackage: string expected";if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 1:x.messageSetWireFormat=G.bool();break;case 2:x.noStandardDescriptorAccessor=G.bool();break;case 3:x.deprecated=G.bool();break;case 7:x.mapEntry=G.bool();break;case 999:x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()));break;case 1053:x[".google.api.resource"]=r.google.api.ResourceDescriptor.decode(G,G.uint32());break;default:G.skipType(7&ue)}}return x},ke.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},ke.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.messageSetWireFormat!=null&&G.hasOwnProperty("messageSetWireFormat")&&typeof G.messageSetWireFormat!="boolean")return"messageSetWireFormat: boolean expected";if(G.noStandardDescriptorAccessor!=null&&G.hasOwnProperty("noStandardDescriptorAccessor")&&typeof G.noStandardDescriptorAccessor!="boolean")return"noStandardDescriptorAccessor: boolean expected";if(G.deprecated!=null&&G.hasOwnProperty("deprecated")&&typeof G.deprecated!="boolean")return"deprecated: boolean expected";if(G.mapEntry!=null&&G.hasOwnProperty("mapEntry")&&typeof G.mapEntry!="boolean")return"mapEntry: boolean expected";if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 1:x.ctype=G.int32();break;case 2:x.packed=G.bool();break;case 6:x.jstype=G.int32();break;case 5:x.lazy=G.bool();break;case 3:x.deprecated=G.bool();break;case 10:x.weak=G.bool();break;case 999:x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()));break;case 1052:if(x[".google.api.fieldBehavior"]&&x[".google.api.fieldBehavior"].length||(x[".google.api.fieldBehavior"]=[]),(7&ue)==2)for(var Ue=G.uint32()+G.pos;G.pos>>3==999?(x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()))):G.skipType(7&ue)}return x},E.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},E.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 2:x.allowAlias=G.bool();break;case 3:x.deprecated=G.bool();break;case 999:x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()));break;default:G.skipType(7&ue)}}return x},S.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},S.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.allowAlias!=null&&G.hasOwnProperty("allowAlias")&&typeof G.allowAlias!="boolean")return"allowAlias: boolean expected";if(G.deprecated!=null&&G.hasOwnProperty("deprecated")&&typeof G.deprecated!="boolean")return"deprecated: boolean expected";if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 1:x.deprecated=G.bool();break;case 999:x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()));break;default:G.skipType(7&ue)}}return x},m.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},m.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.deprecated!=null&&G.hasOwnProperty("deprecated")&&typeof G.deprecated!="boolean")return"deprecated: boolean expected";if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 33:x.deprecated=G.bool();break;case 999:x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()));break;case 1049:x[".google.api.defaultHost"]=G.string();break;case 1050:x[".google.api.oauthScopes"]=G.string();break;default:G.skipType(7&ue)}}return x},Y.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},Y.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.deprecated!=null&&G.hasOwnProperty("deprecated")&&typeof G.deprecated!="boolean")return"deprecated: boolean expected";if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 33:x.deprecated=G.bool();break;case 34:x.idempotencyLevel=G.int32();break;case 999:x.uninterpretedOption&&x.uninterpretedOption.length||(x.uninterpretedOption=[]),x.uninterpretedOption.push(r.google.protobuf.UninterpretedOption.decode(G,G.uint32()));break;case 72295728:x[".google.api.http"]=r.google.api.HttpRule.decode(G,G.uint32());break;case 1051:x[".google.api.methodSignature"]&&x[".google.api.methodSignature"].length||(x[".google.api.methodSignature"]=[]),x[".google.api.methodSignature"].push(G.string());break;default:G.skipType(7&ue)}}return x},R.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},R.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.deprecated!=null&&G.hasOwnProperty("deprecated")&&typeof G.deprecated!="boolean")return"deprecated: boolean expected";if(G.idempotencyLevel!=null&&G.hasOwnProperty("idempotencyLevel"))switch(G.idempotencyLevel){default:return"idempotencyLevel: enum value expected";case 0:case 1:case 2:}if(G.uninterpretedOption!=null&&G.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(G.uninterpretedOption))return"uninterpretedOption: array expected";for(var W=0;W>>3){case 2:x.name&&x.name.length||(x.name=[]),x.name.push(r.google.protobuf.UninterpretedOption.NamePart.decode(G,G.uint32()));break;case 3:x.identifierValue=G.string();break;case 4:x.positiveIntValue=G.uint64();break;case 5:x.negativeIntValue=G.int64();break;case 6:x.doubleValue=G.double();break;case 7:x.stringValue=G.bytes();break;case 8:x.aggregateValue=G.string();break;default:G.skipType(7&ue)}}return x},C.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},C.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.name!=null&&G.hasOwnProperty("name")){if(!Array.isArray(G.name))return"name: array expected";for(var W=0;W>>0,G.positiveIntValue.high>>>0).toNumber(!0))),G.negativeIntValue!=null&&(s.Long?(W.negativeIntValue=s.Long.fromValue(G.negativeIntValue)).unsigned=!1:typeof G.negativeIntValue=="string"?W.negativeIntValue=parseInt(G.negativeIntValue,10):typeof G.negativeIntValue=="number"?W.negativeIntValue=G.negativeIntValue:typeof G.negativeIntValue=="object"&&(W.negativeIntValue=new s.LongBits(G.negativeIntValue.low>>>0,G.negativeIntValue.high>>>0).toNumber())),G.doubleValue!=null&&(W.doubleValue=Number(G.doubleValue)),G.stringValue!=null&&(typeof G.stringValue=="string"?s.base64.decode(G.stringValue,W.stringValue=s.newBuffer(s.base64.length(G.stringValue)),0):G.stringValue.length&&(W.stringValue=G.stringValue)),G.aggregateValue!=null&&(W.aggregateValue=String(G.aggregateValue)),W},C.toObject=function(G,W){var A,x={};if(((W=W||{}).arrays||W.defaults)&&(x.name=[]),W.defaults&&(x.identifierValue="",s.Long?(A=new s.Long(0,0,!0),x.positiveIntValue=W.longs===String?A.toString():W.longs===Number?A.toNumber():A):x.positiveIntValue=W.longs===String?"0":0,s.Long?(A=new s.Long(0,0,!1),x.negativeIntValue=W.longs===String?A.toString():W.longs===Number?A.toNumber():A):x.negativeIntValue=W.longs===String?"0":0,x.doubleValue=0,W.bytes===String?x.stringValue="":(x.stringValue=[],W.bytes!==Array&&(x.stringValue=s.newBuffer(x.stringValue))),x.aggregateValue=""),G.name&&G.name.length){x.name=[];for(var ue=0;ue>>0,G.positiveIntValue.high>>>0).toNumber(!0):G.positiveIntValue),G.negativeIntValue!=null&&G.hasOwnProperty("negativeIntValue")&&(typeof G.negativeIntValue=="number"?x.negativeIntValue=W.longs===String?String(G.negativeIntValue):G.negativeIntValue:x.negativeIntValue=W.longs===String?s.Long.prototype.toString.call(G.negativeIntValue):W.longs===Number?new s.LongBits(G.negativeIntValue.low>>>0,G.negativeIntValue.high>>>0).toNumber():G.negativeIntValue),G.doubleValue!=null&&G.hasOwnProperty("doubleValue")&&(x.doubleValue=W.json&&!isFinite(G.doubleValue)?String(G.doubleValue):G.doubleValue),G.stringValue!=null&&G.hasOwnProperty("stringValue")&&(x.stringValue=W.bytes===String?s.base64.encode(G.stringValue,0,G.stringValue.length):W.bytes===Array?Array.prototype.slice.call(G.stringValue):G.stringValue),G.aggregateValue!=null&&G.hasOwnProperty("aggregateValue")&&(x.aggregateValue=G.aggregateValue),x},C.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},C.NamePart=(M.prototype.namePart="",M.prototype.isExtension=!1,M.create=function(G){return new M(G)},M.encode=function(G,W){return(W=W||i.create()).uint32(10).string(G.namePart),W.uint32(16).bool(G.isExtension),W},M.encodeDelimited=function(G,W){return this.encode(G,W).ldelim()},M.decode=function(G,W){G instanceof c||(G=c.create(G));for(var A=W===void 0?G.len:G.pos+W,x=new r.google.protobuf.UninterpretedOption.NamePart;G.pos>>3){case 1:x.namePart=G.string();break;case 2:x.isExtension=G.bool();break;default:G.skipType(7&ue)}}if(!x.hasOwnProperty("namePart"))throw s.ProtocolError("missing required 'namePart'",{instance:x});if(x.hasOwnProperty("isExtension"))return x;throw s.ProtocolError("missing required 'isExtension'",{instance:x})},M.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},M.verify=function(G){return typeof G!="object"||G===null?"object expected":s.isString(G.namePart)?typeof G.isExtension!="boolean"?"isExtension: boolean expected":null:"namePart: string expected"},M.fromObject=function(G){var W;return G instanceof r.google.protobuf.UninterpretedOption.NamePart?G:(W=new r.google.protobuf.UninterpretedOption.NamePart,G.namePart!=null&&(W.namePart=String(G.namePart)),G.isExtension!=null&&(W.isExtension=!!G.isExtension),W)},M.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.namePart="",A.isExtension=!1),G.namePart!=null&&G.hasOwnProperty("namePart")&&(A.namePart=G.namePart),G.isExtension!=null&&G.hasOwnProperty("isExtension")&&(A.isExtension=G.isExtension),A},M.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},M),C),l.SourceCodeInfo=(te.prototype.location=s.emptyArray,te.create=function(G){return new te(G)},te.encode=function(G,W){if(W=W||i.create(),G.location!=null&&G.location.length)for(var A=0;A>>3==1?(x.location&&x.location.length||(x.location=[]),x.location.push(r.google.protobuf.SourceCodeInfo.Location.decode(G,G.uint32()))):G.skipType(7&ue)}return x},te.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},te.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.location!=null&&G.hasOwnProperty("location")){if(!Array.isArray(G.location))return"location: array expected";for(var W=0;W>>3){case 1:if(x.path&&x.path.length||(x.path=[]),(7&ue)==2)for(var Ue=G.uint32()+G.pos;G.pos>>3==1?(x.annotation&&x.annotation.length||(x.annotation=[]),x.annotation.push(r.google.protobuf.GeneratedCodeInfo.Annotation.decode(G,G.uint32()))):G.skipType(7&ue)}return x},p.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},p.verify=function(G){if(typeof G!="object"||G===null)return"object expected";if(G.annotation!=null&&G.hasOwnProperty("annotation")){if(!Array.isArray(G.annotation))return"annotation: array expected";for(var W=0;W>>3){case 1:if(x.path&&x.path.length||(x.path=[]),(7&ue)==2)for(var Ue=G.uint32()+G.pos;G.pos>>3){case 1:x.expression=G.string();break;case 2:x.title=G.string();break;case 3:x.description=G.string();break;case 4:x.location=G.string();break;default:G.skipType(7&ue)}}return x},F.decodeDelimited=function(G){return G instanceof c||(G=new c(G)),this.decode(G,G.uint32())},F.verify=function(G){return typeof G!="object"||G===null?"object expected":G.expression!=null&&G.hasOwnProperty("expression")&&!s.isString(G.expression)?"expression: string expected":G.title!=null&&G.hasOwnProperty("title")&&!s.isString(G.title)?"title: string expected":G.description!=null&&G.hasOwnProperty("description")&&!s.isString(G.description)?"description: string expected":G.location!=null&&G.hasOwnProperty("location")&&!s.isString(G.location)?"location: string expected":null},F.fromObject=function(G){var W;return G instanceof r.google.type.Expr?G:(W=new r.google.type.Expr,G.expression!=null&&(W.expression=String(G.expression)),G.title!=null&&(W.title=String(G.title)),G.description!=null&&(W.description=String(G.description)),G.location!=null&&(W.location=String(G.location)),W)},F.toObject=function(G,W){var A={};return(W=W||{}).defaults&&(A.expression="",A.title="",A.description="",A.location=""),G.expression!=null&&G.hasOwnProperty("expression")&&(A.expression=G.expression),G.title!=null&&G.hasOwnProperty("title")&&(A.title=G.title),G.description!=null&&G.hasOwnProperty("description")&&(A.description=G.description),G.location!=null&&G.hasOwnProperty("location")&&(A.location=G.location),A},F.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},F),I),a),r})});var rbn=f((PVr,Vq)=>{(t=>{typeof define=="function"&&define.amd?define(["protobufjs/minimal"],t):typeof require=="function"&&typeof Vq=="object"&&Vq&&Vq.exports&&(Vq.exports=t(l9()))})(function(t){var e,n,l,I,a=t.Reader,c=t.Writer,i=t.util,s=t.roots.locations_protos||(t.roots.locations_protos={});function r(m,Y,R){t.rpc.Service.call(this,m,Y,R)}function u(m){if(m)for(var Y=Object.keys(m),R=0;R>>3){case 1:C.name=m.string();break;case 2:C.filter=m.string();break;case 3:C.pageSize=m.int32();break;case 4:C.pageToken=m.string();break;default:m.skipType(7&M)}}return C},u.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},u.verify=function(m){return typeof m!="object"||m===null?"object expected":m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name)?"name: string expected":m.filter!=null&&m.hasOwnProperty("filter")&&!i.isString(m.filter)?"filter: string expected":m.pageSize!=null&&m.hasOwnProperty("pageSize")&&!i.isInteger(m.pageSize)?"pageSize: integer expected":m.pageToken!=null&&m.hasOwnProperty("pageToken")&&!i.isString(m.pageToken)?"pageToken: string expected":null},u.fromObject=function(m){var Y;return m instanceof s.google.cloud.location.ListLocationsRequest?m:(Y=new s.google.cloud.location.ListLocationsRequest,m.name!=null&&(Y.name=String(m.name)),m.filter!=null&&(Y.filter=String(m.filter)),m.pageSize!=null&&(Y.pageSize=0|m.pageSize),m.pageToken!=null&&(Y.pageToken=String(m.pageToken)),Y)},u.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.name="",R.filter="",R.pageSize=0,R.pageToken=""),m.name!=null&&m.hasOwnProperty("name")&&(R.name=m.name),m.filter!=null&&m.hasOwnProperty("filter")&&(R.filter=m.filter),m.pageSize!=null&&m.hasOwnProperty("pageSize")&&(R.pageSize=m.pageSize),m.pageToken!=null&&m.hasOwnProperty("pageToken")&&(R.pageToken=m.pageToken),R},u.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},u),e.ListLocationsResponse=(o.prototype.locations=i.emptyArray,o.prototype.nextPageToken="",o.create=function(m){return new o(m)},o.encode=function(m,Y){if(Y=Y||c.create(),m.locations!=null&&m.locations.length)for(var R=0;R>>3){case 1:C.locations&&C.locations.length||(C.locations=[]),C.locations.push(s.google.cloud.location.Location.decode(m,m.uint32()));break;case 2:C.nextPageToken=m.string();break;default:m.skipType(7&M)}}return C},o.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},o.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.locations!=null&&m.hasOwnProperty("locations")){if(!Array.isArray(m.locations))return"locations: array expected";for(var Y=0;Y>>3==1?C.name=m.string():m.skipType(7&M)}return C},d.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},d.verify=function(m){return typeof m!="object"||m===null?"object expected":m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name)?"name: string expected":null},d.fromObject=function(m){var Y;return m instanceof s.google.cloud.location.GetLocationRequest?m:(Y=new s.google.cloud.location.GetLocationRequest,m.name!=null&&(Y.name=String(m.name)),Y)},d.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.name=""),m.name!=null&&m.hasOwnProperty("name")&&(R.name=m.name),R},d.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},d),e.Location=(b.prototype.name="",b.prototype.locationId="",b.prototype.displayName="",b.prototype.labels=i.emptyObject,b.prototype.metadata=null,b.create=function(m){return new b(m)},b.encode=function(m,Y){if(Y=Y||c.create(),m.name!=null&&Object.hasOwnProperty.call(m,"name")&&Y.uint32(10).string(m.name),m.labels!=null&&Object.hasOwnProperty.call(m,"labels"))for(var R=Object.keys(m.labels),C=0;C>>3){case 1:C.name=m.string();break;case 4:C.locationId=m.string();break;case 5:C.displayName=m.string();break;case 2:C.labels===i.emptyObject&&(C.labels={});for(var te=m.uint32()+m.pos,ae="",p="";m.pos>>3){case 1:ae=m.string();break;case 2:p=m.string();break;default:m.skipType(7&V)}}C.labels[ae]=p;break;case 3:C.metadata=s.google.protobuf.Any.decode(m,m.uint32());break;default:m.skipType(7&M)}}return C},b.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},b.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name))return"name: string expected";if(m.locationId!=null&&m.hasOwnProperty("locationId")&&!i.isString(m.locationId))return"locationId: string expected";if(m.displayName!=null&&m.hasOwnProperty("displayName")&&!i.isString(m.displayName))return"displayName: string expected";if(m.labels!=null&&m.hasOwnProperty("labels")){if(!i.isObject(m.labels))return"labels: object expected";for(var Y=Object.keys(m.labels),R=0;R>>3){case 1:C.rules&&C.rules.length||(C.rules=[]),C.rules.push(s.google.api.HttpRule.decode(m,m.uint32()));break;case 2:C.fullyDecodeReservedExpansion=m.bool();break;default:m.skipType(7&M)}}return C},h.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},h.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.rules!=null&&m.hasOwnProperty("rules")){if(!Array.isArray(m.rules))return"rules: array expected";for(var Y=0;Y>>3){case 1:C.selector=m.string();break;case 2:C.get=m.string();break;case 3:C.put=m.string();break;case 4:C.post=m.string();break;case 5:C.delete=m.string();break;case 6:C.patch=m.string();break;case 8:C.custom=s.google.api.CustomHttpPattern.decode(m,m.uint32());break;case 7:C.body=m.string();break;case 12:C.responseBody=m.string();break;case 11:C.additionalBindings&&C.additionalBindings.length||(C.additionalBindings=[]),C.additionalBindings.push(s.google.api.HttpRule.decode(m,m.uint32()));break;default:m.skipType(7&M)}}return C},Z.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},Z.verify=function(m){if(typeof m!="object"||m===null)return"object expected";var Y={};if(m.selector!=null&&m.hasOwnProperty("selector")&&!i.isString(m.selector))return"selector: string expected";if(m.get!=null&&m.hasOwnProperty("get")&&(Y.pattern=1,!i.isString(m.get)))return"get: string expected";if(m.put!=null&&m.hasOwnProperty("put")){if(Y.pattern===1)return"pattern: multiple values";if(Y.pattern=1,!i.isString(m.put))return"put: string expected"}if(m.post!=null&&m.hasOwnProperty("post")){if(Y.pattern===1)return"pattern: multiple values";if(Y.pattern=1,!i.isString(m.post))return"post: string expected"}if(m.delete!=null&&m.hasOwnProperty("delete")){if(Y.pattern===1)return"pattern: multiple values";if(Y.pattern=1,!i.isString(m.delete))return"delete: string expected"}if(m.patch!=null&&m.hasOwnProperty("patch")){if(Y.pattern===1)return"pattern: multiple values";if(Y.pattern=1,!i.isString(m.patch))return"patch: string expected"}if(m.custom!=null&&m.hasOwnProperty("custom")){if(Y.pattern===1)return"pattern: multiple values";if(Y.pattern=1,R=s.google.api.CustomHttpPattern.verify(m.custom))return"custom."+R}if(m.body!=null&&m.hasOwnProperty("body")&&!i.isString(m.body))return"body: string expected";if(m.responseBody!=null&&m.hasOwnProperty("responseBody")&&!i.isString(m.responseBody))return"responseBody: string expected";if(m.additionalBindings!=null&&m.hasOwnProperty("additionalBindings")){if(!Array.isArray(m.additionalBindings))return"additionalBindings: array expected";for(var R,C=0;C>>3){case 1:C.kind=m.string();break;case 2:C.path=m.string();break;default:m.skipType(7&M)}}return C},N.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},N.verify=function(m){return typeof m!="object"||m===null?"object expected":m.kind!=null&&m.hasOwnProperty("kind")&&!i.isString(m.kind)?"kind: string expected":m.path!=null&&m.hasOwnProperty("path")&&!i.isString(m.path)?"path: string expected":null},N.fromObject=function(m){var Y;return m instanceof s.google.api.CustomHttpPattern?m:(Y=new s.google.api.CustomHttpPattern,m.kind!=null&&(Y.kind=String(m.kind)),m.path!=null&&(Y.path=String(m.path)),Y)},N.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.kind="",R.path=""),m.kind!=null&&m.hasOwnProperty("kind")&&(R.kind=m.kind),m.path!=null&&m.hasOwnProperty("path")&&(R.path=m.path),R},N.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},N),e),I.protobuf=((l={}).FileDescriptorSet=(g.prototype.file=i.emptyArray,g.create=function(m){return new g(m)},g.encode=function(m,Y){if(Y=Y||c.create(),m.file!=null&&m.file.length)for(var R=0;R>>3==1?(C.file&&C.file.length||(C.file=[]),C.file.push(s.google.protobuf.FileDescriptorProto.decode(m,m.uint32()))):m.skipType(7&M)}return C},g.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},g.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.file!=null&&m.hasOwnProperty("file")){if(!Array.isArray(m.file))return"file: array expected";for(var Y=0;Y>>3){case 1:C.name=m.string();break;case 2:C.package=m.string();break;case 3:C.dependency&&C.dependency.length||(C.dependency=[]),C.dependency.push(m.string());break;case 10:if(C.publicDependency&&C.publicDependency.length||(C.publicDependency=[]),(7&M)==2)for(var te=m.uint32()+m.pos;m.pos>>3){case 1:C.name=m.string();break;case 2:C.field&&C.field.length||(C.field=[]),C.field.push(s.google.protobuf.FieldDescriptorProto.decode(m,m.uint32()));break;case 6:C.extension&&C.extension.length||(C.extension=[]),C.extension.push(s.google.protobuf.FieldDescriptorProto.decode(m,m.uint32()));break;case 3:C.nestedType&&C.nestedType.length||(C.nestedType=[]),C.nestedType.push(s.google.protobuf.DescriptorProto.decode(m,m.uint32()));break;case 4:C.enumType&&C.enumType.length||(C.enumType=[]),C.enumType.push(s.google.protobuf.EnumDescriptorProto.decode(m,m.uint32()));break;case 5:C.extensionRange&&C.extensionRange.length||(C.extensionRange=[]),C.extensionRange.push(s.google.protobuf.DescriptorProto.ExtensionRange.decode(m,m.uint32()));break;case 8:C.oneofDecl&&C.oneofDecl.length||(C.oneofDecl=[]),C.oneofDecl.push(s.google.protobuf.OneofDescriptorProto.decode(m,m.uint32()));break;case 7:C.options=s.google.protobuf.MessageOptions.decode(m,m.uint32());break;case 9:C.reservedRange&&C.reservedRange.length||(C.reservedRange=[]),C.reservedRange.push(s.google.protobuf.DescriptorProto.ReservedRange.decode(m,m.uint32()));break;case 10:C.reservedName&&C.reservedName.length||(C.reservedName=[]),C.reservedName.push(m.string());break;default:m.skipType(7&M)}}return C},X.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},X.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name))return"name: string expected";if(m.field!=null&&m.hasOwnProperty("field")){if(!Array.isArray(m.field))return"field: array expected";for(var Y=0;Y>>3){case 1:C.start=m.int32();break;case 2:C.end=m.int32();break;case 3:C.options=s.google.protobuf.ExtensionRangeOptions.decode(m,m.uint32());break;default:m.skipType(7&M)}}return C},v.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},v.verify=function(m){return typeof m!="object"||m===null?"object expected":m.start!=null&&m.hasOwnProperty("start")&&!i.isInteger(m.start)?"start: integer expected":m.end!=null&&m.hasOwnProperty("end")&&!i.isInteger(m.end)?"end: integer expected":m.options!=null&&m.hasOwnProperty("options")&&(m=s.google.protobuf.ExtensionRangeOptions.verify(m.options),m)?"options."+m:null},v.fromObject=function(m){if(m instanceof s.google.protobuf.DescriptorProto.ExtensionRange)return m;var Y=new s.google.protobuf.DescriptorProto.ExtensionRange;if(m.start!=null&&(Y.start=0|m.start),m.end!=null&&(Y.end=0|m.end),m.options!=null){if(typeof m.options!="object")throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");Y.options=s.google.protobuf.ExtensionRangeOptions.fromObject(m.options)}return Y},v.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.start=0,R.end=0,R.options=null),m.start!=null&&m.hasOwnProperty("start")&&(R.start=m.start),m.end!=null&&m.hasOwnProperty("end")&&(R.end=m.end),m.options!=null&&m.hasOwnProperty("options")&&(R.options=s.google.protobuf.ExtensionRangeOptions.toObject(m.options,Y)),R},v.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},v),X.ReservedRange=(H.prototype.start=0,H.prototype.end=0,H.create=function(m){return new H(m)},H.encode=function(m,Y){return Y=Y||c.create(),m.start!=null&&Object.hasOwnProperty.call(m,"start")&&Y.uint32(8).int32(m.start),m.end!=null&&Object.hasOwnProperty.call(m,"end")&&Y.uint32(16).int32(m.end),Y},H.encodeDelimited=function(m,Y){return this.encode(m,Y).ldelim()},H.decode=function(m,Y){m instanceof a||(m=a.create(m));for(var R=Y===void 0?m.len:m.pos+Y,C=new s.google.protobuf.DescriptorProto.ReservedRange;m.pos>>3){case 1:C.start=m.int32();break;case 2:C.end=m.int32();break;default:m.skipType(7&M)}}return C},H.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},H.verify=function(m){return typeof m!="object"||m===null?"object expected":m.start!=null&&m.hasOwnProperty("start")&&!i.isInteger(m.start)?"start: integer expected":m.end!=null&&m.hasOwnProperty("end")&&!i.isInteger(m.end)?"end: integer expected":null},H.fromObject=function(m){var Y;return m instanceof s.google.protobuf.DescriptorProto.ReservedRange?m:(Y=new s.google.protobuf.DescriptorProto.ReservedRange,m.start!=null&&(Y.start=0|m.start),m.end!=null&&(Y.end=0|m.end),Y)},H.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.start=0,R.end=0),m.start!=null&&m.hasOwnProperty("start")&&(R.start=m.start),m.end!=null&&m.hasOwnProperty("end")&&(R.end=m.end),R},H.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},H),X),l.ExtensionRangeOptions=(Q.prototype.uninterpretedOption=i.emptyArray,Q.create=function(m){return new Q(m)},Q.encode=function(m,Y){if(Y=Y||c.create(),m.uninterpretedOption!=null&&m.uninterpretedOption.length)for(var R=0;R>>3==999?(C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()))):m.skipType(7&M)}return C},Q.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},Q.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 1:C.name=m.string();break;case 3:C.number=m.int32();break;case 4:C.label=m.int32();break;case 5:C.type=m.int32();break;case 6:C.typeName=m.string();break;case 2:C.extendee=m.string();break;case 7:C.defaultValue=m.string();break;case 9:C.oneofIndex=m.int32();break;case 10:C.jsonName=m.string();break;case 8:C.options=s.google.protobuf.FieldOptions.decode(m,m.uint32());break;case 17:C.proto3Optional=m.bool();break;default:m.skipType(7&M)}}return C},L.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},L.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name))return"name: string expected";if(m.number!=null&&m.hasOwnProperty("number")&&!i.isInteger(m.number))return"number: integer expected";if(m.label!=null&&m.hasOwnProperty("label"))switch(m.label){default:return"label: enum value expected";case 1:case 2:case 3:}if(m.type!=null&&m.hasOwnProperty("type"))switch(m.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(m.typeName!=null&&m.hasOwnProperty("typeName")&&!i.isString(m.typeName))return"typeName: string expected";if(m.extendee!=null&&m.hasOwnProperty("extendee")&&!i.isString(m.extendee))return"extendee: string expected";if(m.defaultValue!=null&&m.hasOwnProperty("defaultValue")&&!i.isString(m.defaultValue))return"defaultValue: string expected";if(m.oneofIndex!=null&&m.hasOwnProperty("oneofIndex")&&!i.isInteger(m.oneofIndex))return"oneofIndex: integer expected";if(m.jsonName!=null&&m.hasOwnProperty("jsonName")&&!i.isString(m.jsonName))return"jsonName: string expected";if(m.options!=null&&m.hasOwnProperty("options")){var Y=s.google.protobuf.FieldOptions.verify(m.options);if(Y)return"options."+Y}return m.proto3Optional!=null&&m.hasOwnProperty("proto3Optional")&&typeof m.proto3Optional!="boolean"?"proto3Optional: boolean expected":null},L.fromObject=function(m){if(m instanceof s.google.protobuf.FieldDescriptorProto)return m;var Y=new s.google.protobuf.FieldDescriptorProto;switch(m.name!=null&&(Y.name=String(m.name)),m.number!=null&&(Y.number=0|m.number),m.label){case"LABEL_OPTIONAL":case 1:Y.label=1;break;case"LABEL_REQUIRED":case 2:Y.label=2;break;case"LABEL_REPEATED":case 3:Y.label=3}switch(m.type){case"TYPE_DOUBLE":case 1:Y.type=1;break;case"TYPE_FLOAT":case 2:Y.type=2;break;case"TYPE_INT64":case 3:Y.type=3;break;case"TYPE_UINT64":case 4:Y.type=4;break;case"TYPE_INT32":case 5:Y.type=5;break;case"TYPE_FIXED64":case 6:Y.type=6;break;case"TYPE_FIXED32":case 7:Y.type=7;break;case"TYPE_BOOL":case 8:Y.type=8;break;case"TYPE_STRING":case 9:Y.type=9;break;case"TYPE_GROUP":case 10:Y.type=10;break;case"TYPE_MESSAGE":case 11:Y.type=11;break;case"TYPE_BYTES":case 12:Y.type=12;break;case"TYPE_UINT32":case 13:Y.type=13;break;case"TYPE_ENUM":case 14:Y.type=14;break;case"TYPE_SFIXED32":case 15:Y.type=15;break;case"TYPE_SFIXED64":case 16:Y.type=16;break;case"TYPE_SINT32":case 17:Y.type=17;break;case"TYPE_SINT64":case 18:Y.type=18}if(m.typeName!=null&&(Y.typeName=String(m.typeName)),m.extendee!=null&&(Y.extendee=String(m.extendee)),m.defaultValue!=null&&(Y.defaultValue=String(m.defaultValue)),m.oneofIndex!=null&&(Y.oneofIndex=0|m.oneofIndex),m.jsonName!=null&&(Y.jsonName=String(m.jsonName)),m.options!=null){if(typeof m.options!="object")throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");Y.options=s.google.protobuf.FieldOptions.fromObject(m.options)}return m.proto3Optional!=null&&(Y.proto3Optional=!!m.proto3Optional),Y},L.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.name="",R.extendee="",R.number=0,R.label=Y.enums===String?"LABEL_OPTIONAL":1,R.type=Y.enums===String?"TYPE_DOUBLE":1,R.typeName="",R.defaultValue="",R.options=null,R.oneofIndex=0,R.jsonName="",R.proto3Optional=!1),m.name!=null&&m.hasOwnProperty("name")&&(R.name=m.name),m.extendee!=null&&m.hasOwnProperty("extendee")&&(R.extendee=m.extendee),m.number!=null&&m.hasOwnProperty("number")&&(R.number=m.number),m.label!=null&&m.hasOwnProperty("label")&&(R.label=Y.enums===String?s.google.protobuf.FieldDescriptorProto.Label[m.label]:m.label),m.type!=null&&m.hasOwnProperty("type")&&(R.type=Y.enums===String?s.google.protobuf.FieldDescriptorProto.Type[m.type]:m.type),m.typeName!=null&&m.hasOwnProperty("typeName")&&(R.typeName=m.typeName),m.defaultValue!=null&&m.hasOwnProperty("defaultValue")&&(R.defaultValue=m.defaultValue),m.options!=null&&m.hasOwnProperty("options")&&(R.options=s.google.protobuf.FieldOptions.toObject(m.options,Y)),m.oneofIndex!=null&&m.hasOwnProperty("oneofIndex")&&(R.oneofIndex=m.oneofIndex),m.jsonName!=null&&m.hasOwnProperty("jsonName")&&(R.jsonName=m.jsonName),m.proto3Optional!=null&&m.hasOwnProperty("proto3Optional")&&(R.proto3Optional=m.proto3Optional),R},L.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},L.Type=(e={},(n=Object.create(e))[e[1]="TYPE_DOUBLE"]=1,n[e[2]="TYPE_FLOAT"]=2,n[e[3]="TYPE_INT64"]=3,n[e[4]="TYPE_UINT64"]=4,n[e[5]="TYPE_INT32"]=5,n[e[6]="TYPE_FIXED64"]=6,n[e[7]="TYPE_FIXED32"]=7,n[e[8]="TYPE_BOOL"]=8,n[e[9]="TYPE_STRING"]=9,n[e[10]="TYPE_GROUP"]=10,n[e[11]="TYPE_MESSAGE"]=11,n[e[12]="TYPE_BYTES"]=12,n[e[13]="TYPE_UINT32"]=13,n[e[14]="TYPE_ENUM"]=14,n[e[15]="TYPE_SFIXED32"]=15,n[e[16]="TYPE_SFIXED64"]=16,n[e[17]="TYPE_SINT32"]=17,n[e[18]="TYPE_SINT64"]=18,n),L.Label=(e={},(n=Object.create(e))[e[1]="LABEL_OPTIONAL"]=1,n[e[2]="LABEL_REQUIRED"]=2,n[e[3]="LABEL_REPEATED"]=3,n),L),l.OneofDescriptorProto=(J.prototype.name="",J.prototype.options=null,J.create=function(m){return new J(m)},J.encode=function(m,Y){return Y=Y||c.create(),m.name!=null&&Object.hasOwnProperty.call(m,"name")&&Y.uint32(10).string(m.name),m.options!=null&&Object.hasOwnProperty.call(m,"options")&&s.google.protobuf.OneofOptions.encode(m.options,Y.uint32(18).fork()).ldelim(),Y},J.encodeDelimited=function(m,Y){return this.encode(m,Y).ldelim()},J.decode=function(m,Y){m instanceof a||(m=a.create(m));for(var R=Y===void 0?m.len:m.pos+Y,C=new s.google.protobuf.OneofDescriptorProto;m.pos>>3){case 1:C.name=m.string();break;case 2:C.options=s.google.protobuf.OneofOptions.decode(m,m.uint32());break;default:m.skipType(7&M)}}return C},J.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},J.verify=function(m){return typeof m!="object"||m===null?"object expected":m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name)?"name: string expected":m.options!=null&&m.hasOwnProperty("options")&&(m=s.google.protobuf.OneofOptions.verify(m.options),m)?"options."+m:null},J.fromObject=function(m){if(m instanceof s.google.protobuf.OneofDescriptorProto)return m;var Y=new s.google.protobuf.OneofDescriptorProto;if(m.name!=null&&(Y.name=String(m.name)),m.options!=null){if(typeof m.options!="object")throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");Y.options=s.google.protobuf.OneofOptions.fromObject(m.options)}return Y},J.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.name="",R.options=null),m.name!=null&&m.hasOwnProperty("name")&&(R.name=m.name),m.options!=null&&m.hasOwnProperty("options")&&(R.options=s.google.protobuf.OneofOptions.toObject(m.options,Y)),R},J.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},J),l.EnumDescriptorProto=(O.prototype.name="",O.prototype.value=i.emptyArray,O.prototype.options=null,O.prototype.reservedRange=i.emptyArray,O.prototype.reservedName=i.emptyArray,O.create=function(m){return new O(m)},O.encode=function(m,Y){if(Y=Y||c.create(),m.name!=null&&Object.hasOwnProperty.call(m,"name")&&Y.uint32(10).string(m.name),m.value!=null&&m.value.length)for(var R=0;R>>3){case 1:C.name=m.string();break;case 2:C.value&&C.value.length||(C.value=[]),C.value.push(s.google.protobuf.EnumValueDescriptorProto.decode(m,m.uint32()));break;case 3:C.options=s.google.protobuf.EnumOptions.decode(m,m.uint32());break;case 4:C.reservedRange&&C.reservedRange.length||(C.reservedRange=[]),C.reservedRange.push(s.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(m,m.uint32()));break;case 5:C.reservedName&&C.reservedName.length||(C.reservedName=[]),C.reservedName.push(m.string());break;default:m.skipType(7&M)}}return C},O.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},O.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name))return"name: string expected";if(m.value!=null&&m.hasOwnProperty("value")){if(!Array.isArray(m.value))return"value: array expected";for(var Y=0;Y>>3){case 1:C.start=m.int32();break;case 2:C.end=m.int32();break;default:m.skipType(7&M)}}return C},U.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},U.verify=function(m){return typeof m!="object"||m===null?"object expected":m.start!=null&&m.hasOwnProperty("start")&&!i.isInteger(m.start)?"start: integer expected":m.end!=null&&m.hasOwnProperty("end")&&!i.isInteger(m.end)?"end: integer expected":null},U.fromObject=function(m){var Y;return m instanceof s.google.protobuf.EnumDescriptorProto.EnumReservedRange?m:(Y=new s.google.protobuf.EnumDescriptorProto.EnumReservedRange,m.start!=null&&(Y.start=0|m.start),m.end!=null&&(Y.end=0|m.end),Y)},U.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.start=0,R.end=0),m.start!=null&&m.hasOwnProperty("start")&&(R.start=m.start),m.end!=null&&m.hasOwnProperty("end")&&(R.end=m.end),R},U.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},U),O),l.EnumValueDescriptorProto=(K.prototype.name="",K.prototype.number=0,K.prototype.options=null,K.create=function(m){return new K(m)},K.encode=function(m,Y){return Y=Y||c.create(),m.name!=null&&Object.hasOwnProperty.call(m,"name")&&Y.uint32(10).string(m.name),m.number!=null&&Object.hasOwnProperty.call(m,"number")&&Y.uint32(16).int32(m.number),m.options!=null&&Object.hasOwnProperty.call(m,"options")&&s.google.protobuf.EnumValueOptions.encode(m.options,Y.uint32(26).fork()).ldelim(),Y},K.encodeDelimited=function(m,Y){return this.encode(m,Y).ldelim()},K.decode=function(m,Y){m instanceof a||(m=a.create(m));for(var R=Y===void 0?m.len:m.pos+Y,C=new s.google.protobuf.EnumValueDescriptorProto;m.pos>>3){case 1:C.name=m.string();break;case 2:C.number=m.int32();break;case 3:C.options=s.google.protobuf.EnumValueOptions.decode(m,m.uint32());break;default:m.skipType(7&M)}}return C},K.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},K.verify=function(m){return typeof m!="object"||m===null?"object expected":m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name)?"name: string expected":m.number!=null&&m.hasOwnProperty("number")&&!i.isInteger(m.number)?"number: integer expected":m.options!=null&&m.hasOwnProperty("options")&&(m=s.google.protobuf.EnumValueOptions.verify(m.options),m)?"options."+m:null},K.fromObject=function(m){if(m instanceof s.google.protobuf.EnumValueDescriptorProto)return m;var Y=new s.google.protobuf.EnumValueDescriptorProto;if(m.name!=null&&(Y.name=String(m.name)),m.number!=null&&(Y.number=0|m.number),m.options!=null){if(typeof m.options!="object")throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");Y.options=s.google.protobuf.EnumValueOptions.fromObject(m.options)}return Y},K.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.name="",R.number=0,R.options=null),m.name!=null&&m.hasOwnProperty("name")&&(R.name=m.name),m.number!=null&&m.hasOwnProperty("number")&&(R.number=m.number),m.options!=null&&m.hasOwnProperty("options")&&(R.options=s.google.protobuf.EnumValueOptions.toObject(m.options,Y)),R},K.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},K),l.ServiceDescriptorProto=(D.prototype.name="",D.prototype.method=i.emptyArray,D.prototype.options=null,D.create=function(m){return new D(m)},D.encode=function(m,Y){if(Y=Y||c.create(),m.name!=null&&Object.hasOwnProperty.call(m,"name")&&Y.uint32(10).string(m.name),m.method!=null&&m.method.length)for(var R=0;R>>3){case 1:C.name=m.string();break;case 2:C.method&&C.method.length||(C.method=[]),C.method.push(s.google.protobuf.MethodDescriptorProto.decode(m,m.uint32()));break;case 3:C.options=s.google.protobuf.ServiceOptions.decode(m,m.uint32());break;default:m.skipType(7&M)}}return C},D.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},D.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name))return"name: string expected";if(m.method!=null&&m.hasOwnProperty("method")){if(!Array.isArray(m.method))return"method: array expected";for(var Y=0;Y>>3){case 1:C.name=m.string();break;case 2:C.inputType=m.string();break;case 3:C.outputType=m.string();break;case 4:C.options=s.google.protobuf.MethodOptions.decode(m,m.uint32());break;case 5:C.clientStreaming=m.bool();break;case 6:C.serverStreaming=m.bool();break;default:m.skipType(7&M)}}return C},_.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},_.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.name!=null&&m.hasOwnProperty("name")&&!i.isString(m.name))return"name: string expected";if(m.inputType!=null&&m.hasOwnProperty("inputType")&&!i.isString(m.inputType))return"inputType: string expected";if(m.outputType!=null&&m.hasOwnProperty("outputType")&&!i.isString(m.outputType))return"outputType: string expected";if(m.options!=null&&m.hasOwnProperty("options")){var Y=s.google.protobuf.MethodOptions.verify(m.options);if(Y)return"options."+Y}return m.clientStreaming!=null&&m.hasOwnProperty("clientStreaming")&&typeof m.clientStreaming!="boolean"?"clientStreaming: boolean expected":m.serverStreaming!=null&&m.hasOwnProperty("serverStreaming")&&typeof m.serverStreaming!="boolean"?"serverStreaming: boolean expected":null},_.fromObject=function(m){if(m instanceof s.google.protobuf.MethodDescriptorProto)return m;var Y=new s.google.protobuf.MethodDescriptorProto;if(m.name!=null&&(Y.name=String(m.name)),m.inputType!=null&&(Y.inputType=String(m.inputType)),m.outputType!=null&&(Y.outputType=String(m.outputType)),m.options!=null){if(typeof m.options!="object")throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");Y.options=s.google.protobuf.MethodOptions.fromObject(m.options)}return m.clientStreaming!=null&&(Y.clientStreaming=!!m.clientStreaming),m.serverStreaming!=null&&(Y.serverStreaming=!!m.serverStreaming),Y},_.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.name="",R.inputType="",R.outputType="",R.options=null,R.clientStreaming=!1,R.serverStreaming=!1),m.name!=null&&m.hasOwnProperty("name")&&(R.name=m.name),m.inputType!=null&&m.hasOwnProperty("inputType")&&(R.inputType=m.inputType),m.outputType!=null&&m.hasOwnProperty("outputType")&&(R.outputType=m.outputType),m.options!=null&&m.hasOwnProperty("options")&&(R.options=s.google.protobuf.MethodOptions.toObject(m.options,Y)),m.clientStreaming!=null&&m.hasOwnProperty("clientStreaming")&&(R.clientStreaming=m.clientStreaming),m.serverStreaming!=null&&m.hasOwnProperty("serverStreaming")&&(R.serverStreaming=m.serverStreaming),R},_.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},_),l.FileOptions=(P.prototype.javaPackage="",P.prototype.javaOuterClassname="",P.prototype.javaMultipleFiles=!1,P.prototype.javaGenerateEqualsAndHash=!1,P.prototype.javaStringCheckUtf8=!1,P.prototype.optimizeFor=1,P.prototype.goPackage="",P.prototype.ccGenericServices=!1,P.prototype.javaGenericServices=!1,P.prototype.pyGenericServices=!1,P.prototype.phpGenericServices=!1,P.prototype.deprecated=!1,P.prototype.ccEnableArenas=!0,P.prototype.objcClassPrefix="",P.prototype.csharpNamespace="",P.prototype.swiftPrefix="",P.prototype.phpClassPrefix="",P.prototype.phpNamespace="",P.prototype.phpMetadataNamespace="",P.prototype.rubyPackage="",P.prototype.uninterpretedOption=i.emptyArray,P.create=function(m){return new P(m)},P.encode=function(m,Y){if(Y=Y||c.create(),m.javaPackage!=null&&Object.hasOwnProperty.call(m,"javaPackage")&&Y.uint32(10).string(m.javaPackage),m.javaOuterClassname!=null&&Object.hasOwnProperty.call(m,"javaOuterClassname")&&Y.uint32(66).string(m.javaOuterClassname),m.optimizeFor!=null&&Object.hasOwnProperty.call(m,"optimizeFor")&&Y.uint32(72).int32(m.optimizeFor),m.javaMultipleFiles!=null&&Object.hasOwnProperty.call(m,"javaMultipleFiles")&&Y.uint32(80).bool(m.javaMultipleFiles),m.goPackage!=null&&Object.hasOwnProperty.call(m,"goPackage")&&Y.uint32(90).string(m.goPackage),m.ccGenericServices!=null&&Object.hasOwnProperty.call(m,"ccGenericServices")&&Y.uint32(128).bool(m.ccGenericServices),m.javaGenericServices!=null&&Object.hasOwnProperty.call(m,"javaGenericServices")&&Y.uint32(136).bool(m.javaGenericServices),m.pyGenericServices!=null&&Object.hasOwnProperty.call(m,"pyGenericServices")&&Y.uint32(144).bool(m.pyGenericServices),m.javaGenerateEqualsAndHash!=null&&Object.hasOwnProperty.call(m,"javaGenerateEqualsAndHash")&&Y.uint32(160).bool(m.javaGenerateEqualsAndHash),m.deprecated!=null&&Object.hasOwnProperty.call(m,"deprecated")&&Y.uint32(184).bool(m.deprecated),m.javaStringCheckUtf8!=null&&Object.hasOwnProperty.call(m,"javaStringCheckUtf8")&&Y.uint32(216).bool(m.javaStringCheckUtf8),m.ccEnableArenas!=null&&Object.hasOwnProperty.call(m,"ccEnableArenas")&&Y.uint32(248).bool(m.ccEnableArenas),m.objcClassPrefix!=null&&Object.hasOwnProperty.call(m,"objcClassPrefix")&&Y.uint32(290).string(m.objcClassPrefix),m.csharpNamespace!=null&&Object.hasOwnProperty.call(m,"csharpNamespace")&&Y.uint32(298).string(m.csharpNamespace),m.swiftPrefix!=null&&Object.hasOwnProperty.call(m,"swiftPrefix")&&Y.uint32(314).string(m.swiftPrefix),m.phpClassPrefix!=null&&Object.hasOwnProperty.call(m,"phpClassPrefix")&&Y.uint32(322).string(m.phpClassPrefix),m.phpNamespace!=null&&Object.hasOwnProperty.call(m,"phpNamespace")&&Y.uint32(330).string(m.phpNamespace),m.phpGenericServices!=null&&Object.hasOwnProperty.call(m,"phpGenericServices")&&Y.uint32(336).bool(m.phpGenericServices),m.phpMetadataNamespace!=null&&Object.hasOwnProperty.call(m,"phpMetadataNamespace")&&Y.uint32(354).string(m.phpMetadataNamespace),m.rubyPackage!=null&&Object.hasOwnProperty.call(m,"rubyPackage")&&Y.uint32(362).string(m.rubyPackage),m.uninterpretedOption!=null&&m.uninterpretedOption.length)for(var R=0;R>>3){case 1:C.javaPackage=m.string();break;case 8:C.javaOuterClassname=m.string();break;case 10:C.javaMultipleFiles=m.bool();break;case 20:C.javaGenerateEqualsAndHash=m.bool();break;case 27:C.javaStringCheckUtf8=m.bool();break;case 9:C.optimizeFor=m.int32();break;case 11:C.goPackage=m.string();break;case 16:C.ccGenericServices=m.bool();break;case 17:C.javaGenericServices=m.bool();break;case 18:C.pyGenericServices=m.bool();break;case 42:C.phpGenericServices=m.bool();break;case 23:C.deprecated=m.bool();break;case 31:C.ccEnableArenas=m.bool();break;case 36:C.objcClassPrefix=m.string();break;case 37:C.csharpNamespace=m.string();break;case 39:C.swiftPrefix=m.string();break;case 40:C.phpClassPrefix=m.string();break;case 41:C.phpNamespace=m.string();break;case 44:C.phpMetadataNamespace=m.string();break;case 45:C.rubyPackage=m.string();break;case 999:C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()));break;default:m.skipType(7&M)}}return C},P.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},P.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.javaPackage!=null&&m.hasOwnProperty("javaPackage")&&!i.isString(m.javaPackage))return"javaPackage: string expected";if(m.javaOuterClassname!=null&&m.hasOwnProperty("javaOuterClassname")&&!i.isString(m.javaOuterClassname))return"javaOuterClassname: string expected";if(m.javaMultipleFiles!=null&&m.hasOwnProperty("javaMultipleFiles")&&typeof m.javaMultipleFiles!="boolean")return"javaMultipleFiles: boolean expected";if(m.javaGenerateEqualsAndHash!=null&&m.hasOwnProperty("javaGenerateEqualsAndHash")&&typeof m.javaGenerateEqualsAndHash!="boolean")return"javaGenerateEqualsAndHash: boolean expected";if(m.javaStringCheckUtf8!=null&&m.hasOwnProperty("javaStringCheckUtf8")&&typeof m.javaStringCheckUtf8!="boolean")return"javaStringCheckUtf8: boolean expected";if(m.optimizeFor!=null&&m.hasOwnProperty("optimizeFor"))switch(m.optimizeFor){default:return"optimizeFor: enum value expected";case 1:case 2:case 3:}if(m.goPackage!=null&&m.hasOwnProperty("goPackage")&&!i.isString(m.goPackage))return"goPackage: string expected";if(m.ccGenericServices!=null&&m.hasOwnProperty("ccGenericServices")&&typeof m.ccGenericServices!="boolean")return"ccGenericServices: boolean expected";if(m.javaGenericServices!=null&&m.hasOwnProperty("javaGenericServices")&&typeof m.javaGenericServices!="boolean")return"javaGenericServices: boolean expected";if(m.pyGenericServices!=null&&m.hasOwnProperty("pyGenericServices")&&typeof m.pyGenericServices!="boolean")return"pyGenericServices: boolean expected";if(m.phpGenericServices!=null&&m.hasOwnProperty("phpGenericServices")&&typeof m.phpGenericServices!="boolean")return"phpGenericServices: boolean expected";if(m.deprecated!=null&&m.hasOwnProperty("deprecated")&&typeof m.deprecated!="boolean")return"deprecated: boolean expected";if(m.ccEnableArenas!=null&&m.hasOwnProperty("ccEnableArenas")&&typeof m.ccEnableArenas!="boolean")return"ccEnableArenas: boolean expected";if(m.objcClassPrefix!=null&&m.hasOwnProperty("objcClassPrefix")&&!i.isString(m.objcClassPrefix))return"objcClassPrefix: string expected";if(m.csharpNamespace!=null&&m.hasOwnProperty("csharpNamespace")&&!i.isString(m.csharpNamespace))return"csharpNamespace: string expected";if(m.swiftPrefix!=null&&m.hasOwnProperty("swiftPrefix")&&!i.isString(m.swiftPrefix))return"swiftPrefix: string expected";if(m.phpClassPrefix!=null&&m.hasOwnProperty("phpClassPrefix")&&!i.isString(m.phpClassPrefix))return"phpClassPrefix: string expected";if(m.phpNamespace!=null&&m.hasOwnProperty("phpNamespace")&&!i.isString(m.phpNamespace))return"phpNamespace: string expected";if(m.phpMetadataNamespace!=null&&m.hasOwnProperty("phpMetadataNamespace")&&!i.isString(m.phpMetadataNamespace))return"phpMetadataNamespace: string expected";if(m.rubyPackage!=null&&m.hasOwnProperty("rubyPackage")&&!i.isString(m.rubyPackage))return"rubyPackage: string expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 1:C.messageSetWireFormat=m.bool();break;case 2:C.noStandardDescriptorAccessor=m.bool();break;case 3:C.deprecated=m.bool();break;case 7:C.mapEntry=m.bool();break;case 999:C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()));break;default:m.skipType(7&M)}}return C},le.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},le.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.messageSetWireFormat!=null&&m.hasOwnProperty("messageSetWireFormat")&&typeof m.messageSetWireFormat!="boolean")return"messageSetWireFormat: boolean expected";if(m.noStandardDescriptorAccessor!=null&&m.hasOwnProperty("noStandardDescriptorAccessor")&&typeof m.noStandardDescriptorAccessor!="boolean")return"noStandardDescriptorAccessor: boolean expected";if(m.deprecated!=null&&m.hasOwnProperty("deprecated")&&typeof m.deprecated!="boolean")return"deprecated: boolean expected";if(m.mapEntry!=null&&m.hasOwnProperty("mapEntry")&&typeof m.mapEntry!="boolean")return"mapEntry: boolean expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 1:C.ctype=m.int32();break;case 2:C.packed=m.bool();break;case 6:C.jstype=m.int32();break;case 5:C.lazy=m.bool();break;case 3:C.deprecated=m.bool();break;case 10:C.weak=m.bool();break;case 999:C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()));break;default:m.skipType(7&M)}}return C},q.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},q.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.ctype!=null&&m.hasOwnProperty("ctype"))switch(m.ctype){default:return"ctype: enum value expected";case 0:case 1:case 2:}if(m.packed!=null&&m.hasOwnProperty("packed")&&typeof m.packed!="boolean")return"packed: boolean expected";if(m.jstype!=null&&m.hasOwnProperty("jstype"))switch(m.jstype){default:return"jstype: enum value expected";case 0:case 1:case 2:}if(m.lazy!=null&&m.hasOwnProperty("lazy")&&typeof m.lazy!="boolean")return"lazy: boolean expected";if(m.deprecated!=null&&m.hasOwnProperty("deprecated")&&typeof m.deprecated!="boolean")return"deprecated: boolean expected";if(m.weak!=null&&m.hasOwnProperty("weak")&&typeof m.weak!="boolean")return"weak: boolean expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3==999?(C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()))):m.skipType(7&M)}return C},ee.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},ee.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 2:C.allowAlias=m.bool();break;case 3:C.deprecated=m.bool();break;case 999:C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()));break;default:m.skipType(7&M)}}return C},ne.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},ne.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.allowAlias!=null&&m.hasOwnProperty("allowAlias")&&typeof m.allowAlias!="boolean")return"allowAlias: boolean expected";if(m.deprecated!=null&&m.hasOwnProperty("deprecated")&&typeof m.deprecated!="boolean")return"deprecated: boolean expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 1:C.deprecated=m.bool();break;case 999:C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()));break;default:m.skipType(7&M)}}return C},ie.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},ie.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.deprecated!=null&&m.hasOwnProperty("deprecated")&&typeof m.deprecated!="boolean")return"deprecated: boolean expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 33:C.deprecated=m.bool();break;case 999:C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()));break;case 1049:C[".google.api.defaultHost"]=m.string();break;case 1050:C[".google.api.oauthScopes"]=m.string();break;default:m.skipType(7&M)}}return C},me.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},me.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.deprecated!=null&&m.hasOwnProperty("deprecated")&&typeof m.deprecated!="boolean")return"deprecated: boolean expected";if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 33:C.deprecated=m.bool();break;case 34:C.idempotencyLevel=m.int32();break;case 999:C.uninterpretedOption&&C.uninterpretedOption.length||(C.uninterpretedOption=[]),C.uninterpretedOption.push(s.google.protobuf.UninterpretedOption.decode(m,m.uint32()));break;case 72295728:C[".google.api.http"]=s.google.api.HttpRule.decode(m,m.uint32());break;case 1051:C[".google.api.methodSignature"]&&C[".google.api.methodSignature"].length||(C[".google.api.methodSignature"]=[]),C[".google.api.methodSignature"].push(m.string());break;default:m.skipType(7&M)}}return C},Ze.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},Ze.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.deprecated!=null&&m.hasOwnProperty("deprecated")&&typeof m.deprecated!="boolean")return"deprecated: boolean expected";if(m.idempotencyLevel!=null&&m.hasOwnProperty("idempotencyLevel"))switch(m.idempotencyLevel){default:return"idempotencyLevel: enum value expected";case 0:case 1:case 2:}if(m.uninterpretedOption!=null&&m.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(m.uninterpretedOption))return"uninterpretedOption: array expected";for(var Y=0;Y>>3){case 2:C.name&&C.name.length||(C.name=[]),C.name.push(s.google.protobuf.UninterpretedOption.NamePart.decode(m,m.uint32()));break;case 3:C.identifierValue=m.string();break;case 4:C.positiveIntValue=m.uint64();break;case 5:C.negativeIntValue=m.int64();break;case 6:C.doubleValue=m.double();break;case 7:C.stringValue=m.bytes();break;case 8:C.aggregateValue=m.string();break;default:m.skipType(7&M)}}return C},Fe.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},Fe.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.name!=null&&m.hasOwnProperty("name")){if(!Array.isArray(m.name))return"name: array expected";for(var Y=0;Y>>0,m.positiveIntValue.high>>>0).toNumber(!0))),m.negativeIntValue!=null&&(i.Long?(Y.negativeIntValue=i.Long.fromValue(m.negativeIntValue)).unsigned=!1:typeof m.negativeIntValue=="string"?Y.negativeIntValue=parseInt(m.negativeIntValue,10):typeof m.negativeIntValue=="number"?Y.negativeIntValue=m.negativeIntValue:typeof m.negativeIntValue=="object"&&(Y.negativeIntValue=new i.LongBits(m.negativeIntValue.low>>>0,m.negativeIntValue.high>>>0).toNumber())),m.doubleValue!=null&&(Y.doubleValue=Number(m.doubleValue)),m.stringValue!=null&&(typeof m.stringValue=="string"?i.base64.decode(m.stringValue,Y.stringValue=i.newBuffer(i.base64.length(m.stringValue)),0):m.stringValue.length&&(Y.stringValue=m.stringValue)),m.aggregateValue!=null&&(Y.aggregateValue=String(m.aggregateValue)),Y},Fe.toObject=function(m,Y){var R,C={};if(((Y=Y||{}).arrays||Y.defaults)&&(C.name=[]),Y.defaults&&(C.identifierValue="",i.Long?(R=new i.Long(0,0,!0),C.positiveIntValue=Y.longs===String?R.toString():Y.longs===Number?R.toNumber():R):C.positiveIntValue=Y.longs===String?"0":0,i.Long?(R=new i.Long(0,0,!1),C.negativeIntValue=Y.longs===String?R.toString():Y.longs===Number?R.toNumber():R):C.negativeIntValue=Y.longs===String?"0":0,C.doubleValue=0,Y.bytes===String?C.stringValue="":(C.stringValue=[],Y.bytes!==Array&&(C.stringValue=i.newBuffer(C.stringValue))),C.aggregateValue=""),m.name&&m.name.length){C.name=[];for(var M=0;M>>0,m.positiveIntValue.high>>>0).toNumber(!0):m.positiveIntValue),m.negativeIntValue!=null&&m.hasOwnProperty("negativeIntValue")&&(typeof m.negativeIntValue=="number"?C.negativeIntValue=Y.longs===String?String(m.negativeIntValue):m.negativeIntValue:C.negativeIntValue=Y.longs===String?i.Long.prototype.toString.call(m.negativeIntValue):Y.longs===Number?new i.LongBits(m.negativeIntValue.low>>>0,m.negativeIntValue.high>>>0).toNumber():m.negativeIntValue),m.doubleValue!=null&&m.hasOwnProperty("doubleValue")&&(C.doubleValue=Y.json&&!isFinite(m.doubleValue)?String(m.doubleValue):m.doubleValue),m.stringValue!=null&&m.hasOwnProperty("stringValue")&&(C.stringValue=Y.bytes===String?i.base64.encode(m.stringValue,0,m.stringValue.length):Y.bytes===Array?Array.prototype.slice.call(m.stringValue):m.stringValue),m.aggregateValue!=null&&m.hasOwnProperty("aggregateValue")&&(C.aggregateValue=m.aggregateValue),C},Fe.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},Fe.NamePart=(ce.prototype.namePart="",ce.prototype.isExtension=!1,ce.create=function(m){return new ce(m)},ce.encode=function(m,Y){return(Y=Y||c.create()).uint32(10).string(m.namePart),Y.uint32(16).bool(m.isExtension),Y},ce.encodeDelimited=function(m,Y){return this.encode(m,Y).ldelim()},ce.decode=function(m,Y){m instanceof a||(m=a.create(m));for(var R=Y===void 0?m.len:m.pos+Y,C=new s.google.protobuf.UninterpretedOption.NamePart;m.pos>>3){case 1:C.namePart=m.string();break;case 2:C.isExtension=m.bool();break;default:m.skipType(7&M)}}if(!C.hasOwnProperty("namePart"))throw i.ProtocolError("missing required 'namePart'",{instance:C});if(C.hasOwnProperty("isExtension"))return C;throw i.ProtocolError("missing required 'isExtension'",{instance:C})},ce.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},ce.verify=function(m){return typeof m!="object"||m===null?"object expected":i.isString(m.namePart)?typeof m.isExtension!="boolean"?"isExtension: boolean expected":null:"namePart: string expected"},ce.fromObject=function(m){var Y;return m instanceof s.google.protobuf.UninterpretedOption.NamePart?m:(Y=new s.google.protobuf.UninterpretedOption.NamePart,m.namePart!=null&&(Y.namePart=String(m.namePart)),m.isExtension!=null&&(Y.isExtension=!!m.isExtension),Y)},ce.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.namePart="",R.isExtension=!1),m.namePart!=null&&m.hasOwnProperty("namePart")&&(R.namePart=m.namePart),m.isExtension!=null&&m.hasOwnProperty("isExtension")&&(R.isExtension=m.isExtension),R},ce.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},ce),Fe),l.SourceCodeInfo=(fe.prototype.location=i.emptyArray,fe.create=function(m){return new fe(m)},fe.encode=function(m,Y){if(Y=Y||c.create(),m.location!=null&&m.location.length)for(var R=0;R>>3==1?(C.location&&C.location.length||(C.location=[]),C.location.push(s.google.protobuf.SourceCodeInfo.Location.decode(m,m.uint32()))):m.skipType(7&M)}return C},fe.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},fe.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.location!=null&&m.hasOwnProperty("location")){if(!Array.isArray(m.location))return"location: array expected";for(var Y=0;Y>>3){case 1:if(C.path&&C.path.length||(C.path=[]),(7&M)==2)for(var te=m.uint32()+m.pos;m.pos>>3==1?(C.annotation&&C.annotation.length||(C.annotation=[]),C.annotation.push(s.google.protobuf.GeneratedCodeInfo.Annotation.decode(m,m.uint32()))):m.skipType(7&M)}return C},j.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},j.verify=function(m){if(typeof m!="object"||m===null)return"object expected";if(m.annotation!=null&&m.hasOwnProperty("annotation")){if(!Array.isArray(m.annotation))return"annotation: array expected";for(var Y=0;Y>>3){case 1:if(C.path&&C.path.length||(C.path=[]),(7&M)==2)for(var te=m.uint32()+m.pos;m.pos>>3){case 1:C.type_url=m.string();break;case 2:C.value=m.bytes();break;default:m.skipType(7&M)}}return C},S.decodeDelimited=function(m){return m instanceof a||(m=new a(m)),this.decode(m,m.uint32())},S.verify=function(m){return typeof m!="object"||m===null?"object expected":m.type_url!=null&&m.hasOwnProperty("type_url")&&!i.isString(m.type_url)?"type_url: string expected":m.value!=null&&m.hasOwnProperty("value")&&!(m.value&&typeof m.value.length=="number"||i.isString(m.value))?"value: buffer expected":null},S.fromObject=function(m){var Y;return m instanceof s.google.protobuf.Any?m:(Y=new s.google.protobuf.Any,m.type_url!=null&&(Y.type_url=String(m.type_url)),m.value!=null&&(typeof m.value=="string"?i.base64.decode(m.value,Y.value=i.newBuffer(i.base64.length(m.value)),0):m.value.length&&(Y.value=m.value)),Y)},S.toObject=function(m,Y){var R={};return(Y=Y||{}).defaults&&(R.type_url="",Y.bytes===String?R.value="":(R.value=[],Y.bytes!==Array&&(R.value=i.newBuffer(R.value)))),m.type_url!=null&&m.hasOwnProperty("type_url")&&(R.type_url=m.type_url),m.value!=null&&m.hasOwnProperty("value")&&(R.value=Y.bytes===String?i.base64.encode(m.value,0,m.value.length):Y.bytes===Array?Array.prototype.slice.call(m.value):m.value),R},S.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},S),l),I),s})});var cbn=f(EVe=>{"use strict";Object.defineProperty(EVe,"__esModule",{value:!0});EVe.PathTemplate=void 0;var pPe=class{constructor(e){this.bindings={},this.data=e,this.segments=this.parsePathTemplate(e),this.size=this.segments.length}match(e){let n=e.split("/"),l={};if(n.length!==this.segments.length)if(this.data.includes("**")){if(n.length!==this.segments.length+1)throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`)}else throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same.`);for(let I=0;I0;I++)if(this.segments[I]!==n[0])if(this.segments[I].includes("*")){let a=this.segments[I],c=a.match(/\{[$0-9a-zA-Z_]+=.*?\}/g);if(!c)throw new Error(`Error processing path template segment ${a}`);let i=c.map(s=>s.replace(/^\{/,"").replace(/=.*/,""));if(a.includes("**"))l[i[0]]=n[0]+"/"+n[1],n=n.slice(2);else{if(i.length===1)l[i[0]]=n[0];else{let s=n[0].split(/[-_.~]/);if(s.length!==i.length)throw new Error(`segment ${a} does not match ${n[0]}`);for(let r of i)l[r]=s[0],a=a.replace(`{${r}=*}`,`${s[0]}`),s.shift();if(a!==n[0])throw new TypeError(`non slash resource pattern ${this.segments[I]} and ${n[0]} should have same separator`)}n.shift()}}else throw new TypeError(`segment does not match, ${this.segments[I]} and ${n[I]}.`);else n.shift();return l}render(e){if(Object.keys(e).length!==Object.keys(this.bindings).length)throw new TypeError(`The number of variables ${Object.keys(e).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`);let n=this.inspect();for(let l of Object.keys(e)){let I=e[l].toString();if(!this.bindings[l])throw new TypeError(`render fails for not matching ${e[l]}`);let a=this.bindings[l];if(a==="*"){if(!I.match(/[^/{}]+/))throw new TypeError(`render fails for not matching ${I}`);n=n.replace(`{${l}=*}`,`${I}`)}else if(a==="**"){if(!I.match(/[^{}]+/))throw new TypeError(`render fails for not matching ${I}`);n=n.replace(`{${l}=**}`,`${I}`)}}return n}inspect(){return this.segments.join("/")}parsePathTemplate(e){let n=i2I(e),l=0,I=0,a=[],c;if(n.forEach(i=>{if(i==="*"||i==="**")this.bindings[`$${l}`]=i,a.push(`{$${l}=${i}}`),l=l+1,i==="**"&&++I;else if(c=i.match(/\{[0-9a-zA-Z-.~_]+(?:=.*?)?\}/g)){for(let s of c){let r=s.match(/^\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\}$/);if(!r)throw new Error(`Cannot process path template segment ${s}`);let u=r[1],o=r[2];o?o==="*"?this.bindings[u]=o:o==="**"&&(++I,this.bindings[u]=o):(o="*",i=i.replace(u,u+"=*"),this.bindings[u]=o)}a.push(i)}else i.match(/[0-9a-zA-Z-.~_]+/)&&a.push(i)}),I>1)throw new TypeError("Can not have more than one wildcard.");return a}};EVe.PathTemplate=pPe;function i2I(t){let e=0,n=0,l=0,I=[];for(;n>=e&&n{s2I.exports={interfaces:{"google.iam.v1.IAMPolicy":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:2e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:2e4,total_timeout_millis:6e5}},methods:{GetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},SetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},TestIamPermissions:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var ibn=f((eYr,u2I)=>{u2I.exports={nested:{google:{nested:{iam:{nested:{v1:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.Cloud.Iam.V1",go_package:"google.golang.org/genproto/googleapis/iam/v1;iam",java_multiple_files:!0,java_outer_classname:"PolicyProto",java_package:"com.google.iam.v1",php_namespace:"Google\\Cloud\\Iam\\V1"},nested:{IAMPolicy:{options:{"(google.api.default_host)":"iam-meta-api.googleapis.com"},methods:{SetIamPolicy:{requestType:"SetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:setIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:setIamPolicy",body:"*"}}]},GetIamPolicy:{requestType:"GetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:getIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:getIamPolicy",body:"*"}}]},TestIamPermissions:{requestType:"TestIamPermissionsRequest",responseType:"TestIamPermissionsResponse",options:{"(google.api.http).post":"/v1/{resource=**}:testIamPermissions","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:testIamPermissions",body:"*"}}]}}},SetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},policy:{type:"Policy",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},GetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},options:{type:"GetPolicyOptions",id:2}}},TestIamPermissionsRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},permissions:{rule:"repeated",type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TestIamPermissionsResponse:{fields:{permissions:{rule:"repeated",type:"string",id:1}}},GetPolicyOptions:{fields:{requestedPolicyVersion:{type:"int32",id:1}}},Policy:{fields:{version:{type:"int32",id:1},bindings:{rule:"repeated",type:"Binding",id:4},etag:{type:"bytes",id:3}}},Binding:{fields:{role:{type:"string",id:1},members:{rule:"repeated",type:"string",id:2},condition:{type:"google.type.Expr",id:3}}},PolicyDelta:{fields:{bindingDeltas:{rule:"repeated",type:"BindingDelta",id:1},auditConfigDeltas:{rule:"repeated",type:"AuditConfigDelta",id:2}}},BindingDelta:{fields:{action:{type:"Action",id:1},role:{type:"string",id:2},member:{type:"string",id:3},condition:{type:"google.type.Expr",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},AuditConfigDelta:{fields:{action:{type:"Action",id:1},service:{type:"string",id:2},exemptedMember:{type:"string",id:3},logType:{type:"string",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},logging:{options:{csharp_namespace:"Google.Cloud.Iam.V1.Logging",go_package:"google.golang.org/genproto/googleapis/iam/v1/logging;logging",java_multiple_files:!0,java_outer_classname:"AuditDataProto",java_package:"com.google.iam.v1.logging"},nested:{AuditData:{fields:{policyDelta:{type:"google.iam.v1.PolicyDelta",id:2}}}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ResourceProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"},fieldBehavior:{rule:"repeated",type:"google.api.FieldBehavior",id:1052,extend:"google.protobuf.FieldOptions"},FieldBehavior:{values:{FIELD_BEHAVIOR_UNSPECIFIED:0,OPTIONAL:1,REQUIRED:2,OUTPUT_ONLY:3,INPUT_ONLY:4,IMMUTABLE:5}},resourceReference:{type:"google.api.ResourceReference",id:1055,extend:"google.protobuf.FieldOptions"},resourceDefinition:{rule:"repeated",type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.FileOptions"},resource:{type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.MessageOptions"},ResourceDescriptor:{fields:{type:{type:"string",id:1},pattern:{rule:"repeated",type:"string",id:2},nameField:{type:"string",id:3},history:{type:"History",id:4},plural:{type:"string",id:5},singular:{type:"string",id:6}},nested:{History:{values:{HISTORY_UNSPECIFIED:0,ORIGINALLY_SINGLE_PATTERN:1,FUTURE_MULTI_PATTERN:2}}}},ResourceReference:{fields:{type:{type:"string",id:1},childType:{type:"string",id:2}}}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}},type:{options:{go_package:"google.golang.org/genproto/googleapis/type/expr;expr",java_multiple_files:!0,java_outer_classname:"ExprProto",java_package:"com.google.type",objc_class_prefix:"GTP"},nested:{Expr:{fields:{expression:{type:"string",id:1},title:{type:"string",id:2},description:{type:"string",id:3},location:{type:"string",id:4}}}}}}}}}});var sbn=f(JVe=>{"use strict";Object.defineProperty(JVe,"__esModule",{value:!0});JVe.IamClient=void 0;var d2I=mq(),hPe=QWe(),G2I=obn(),b2I=YY(),Yq=a9().version,m2I=ibn(),ZPe=class{constructor(e,n){this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{}},this.innerApiCalls={},this.gaxGrpc=e;let l=Object.assign({servicePath:n.servicePath,port:n.port,clientConfig:n.clientConfig,apiEndpoint:n.apiEndpoint,fallback:n.fallback},n);Yq=l.fallback?b2I.version:Yq,l.scopes=this.constructor.scopes,this._opts=l,this.auth=e.auth;let I=[`gax/${Yq}`,`gapic/${Yq}`];typeof process<"u"&&"versions"in process?I.push(`gl-node/${process.versions.node}`):I.push(`gl-web/${Yq}`),l.fallback||I.push(`grpc/${e.grpcVersion}`),l.libName&&l.libVersion&&I.push(`${l.libName}/${l.libVersion}`),this._protos=this.gaxGrpc.loadProtoJSON(m2I),this._defaults=e.constructSettings("google.iam.v1.IAMPolicy",G2I,l.clientConfig||{},{"x-goog-api-client":I.join(" ")}),this.innerApiCalls={}}initialize(){if(this.iamPolicyStub)return this.iamPolicyStub;this.iamPolicyStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.iam.v1.IAMPolicy"):this._protos.google.iam.v1.IAMPolicy,this._opts);let e=["getIamPolicy","setIamPolicy","testIamPermissions"];for(let n of e){let l=this.iamPolicyStub.then(I=>(...a)=>this._terminated?Promise.reject("The client has already been closed."):I[n].apply(I,a),I=>()=>{throw I});this.innerApiCalls[n]=(0,d2I.createApiCall)(l,this._defaults[n],this.descriptors.page[n])}return this.iamPolicyStub}static get servicePath(){return"cloudkms.googleapis.com"}static get apiEndpoint(){return"cloudkms.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudkms"]}getProjectId(e){if(this.auth&&"getProjectId"in this.auth)return this.auth.getProjectId(e);if(e)e(new Error("Cannot determine project ID."));else return Promise.reject("Cannot determine project ID.")}getIamPolicy(e,n,l){let I;return n instanceof Function&&l===void 0?(l=n,I={}):I=n,e=e||{},I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},I.otherArgs.headers["x-goog-request-params"]=hPe.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.getIamPolicy(e,I,l)}setIamPolicy(e,n,l){let I;return n instanceof Function&&l===void 0?(l=n,I={}):I=n,e=e||{},I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},I.otherArgs.headers["x-goog-request-params"]=hPe.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.setIamPolicy(e,I,l)}testIamPermissions(e,n,l){let I;return n instanceof Function&&l===void 0?(l=n,I={}):I=n,e=e||{},I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},I.otherArgs.headers["x-goog-request-params"]=hPe.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.testIamPermissions(e,I,l)}close(){return this.initialize(),this._terminated?Promise.resolve():this.iamPolicyStub.then(e=>{this._terminated=!0,e.close()})}};JVe.IamClient=ZPe});var ubn=f((nYr,p2I)=>{p2I.exports={nested:{google:{nested:{cloud:{nested:{location:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/cloud/location;location",java_multiple_files:!0,java_outer_classname:"LocationsProto",java_package:"com.google.cloud.location"},nested:{Locations:{options:{"(google.api.default_host)":"cloud.googleapis.com","(google.api.oauth_scopes)":"https://www.googleapis.com/auth/cloud-platform"},methods:{ListLocations:{requestType:"ListLocationsRequest",responseType:"ListLocationsResponse",options:{"(google.api.http).get":"/v1/{name=locations}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*}/locations"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations}",additional_bindings:{get:"/v1/{name=projects/*}/locations"}}}]},GetLocation:{requestType:"GetLocationRequest",responseType:"Location",options:{"(google.api.http).get":"/v1/{name=locations/*}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*/locations/*}"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations/*}",additional_bindings:{get:"/v1/{name=projects/*/locations/*}"}}}]}}},ListLocationsRequest:{fields:{name:{type:"string",id:1},filter:{type:"string",id:2},pageSize:{type:"int32",id:3},pageToken:{type:"string",id:4}}},ListLocationsResponse:{fields:{locations:{rule:"repeated",type:"Location",id:1},nextPageToken:{type:"string",id:2}}},GetLocationRequest:{fields:{name:{type:"string",id:1}}},Location:{fields:{name:{type:"string",id:1},locationId:{type:"string",id:4},displayName:{type:"string",id:5},labels:{keyType:"string",type:"string",id:2},metadata:{type:"google.protobuf.Any",id:3}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}}}}}}});var dbn=f((lYr,h2I)=>{h2I.exports={interfaces:{"google.cloud.location.Locations":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{ListLocations:{retry_codes_name:"non_idempotent",retry_params_name:"default"},GetLocation:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var Gbn=f(CVe=>{"use strict";Object.defineProperty(CVe,"__esModule",{value:!0});CVe.LocationsClient=void 0;var Z2I=kw(),W2I=PF(),N2I=mq(),WPe=QWe(),V2I=q_e(),Y2I=ubn(),g2I=dbn(),NPe=a9().version,VPe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}},this.gaxGrpc=e;let a=this.constructor,c=n?.servicePath||n?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(n?.servicePath||n?.apiEndpoint);let i=n?.port||a.port,s=(l=n?.clientConfig)!==null&&l!==void 0?l:{},r=(I=n?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";n=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},n),c!==a.servicePath&&!("scopes"in n)&&(n.scopes=a.scopes),this._opts=n,this.auth=e.auth,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${NPe}`,`gapic/${NPe}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${NPe}`),n.fallback?n.fallback==="rest"&&u.push(`rest/${e.grpcVersion}`):u.push(`grpc/${e.grpcVersion}`),n.libName&&n.libVersion&&u.push(`${n.libName}/${n.libVersion}`),this._protos=e.loadProtoJSON(Y2I),this.descriptors.page={listLocations:new V2I.PageDescriptor("pageToken","nextPageToken","locations")},this._defaults=e.constructSettings("google.cloud.location.Locations",g2I,n.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=W2I.warn}initialize(){if(this.locationsStub)return this.locationsStub;this.locationsStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.cloud.location.Locations"):this._protos.google.cloud.location.Locations,this._opts,this._providedCustomServicePath);let e=["listLocations","getLocation"];for(let n of e){let l=this.locationsStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),I=this.descriptors.page[n]||void 0,a=(0,N2I.createApiCall)(l,this._defaults[n],I);this.innerApiCalls[n]=a}return this.locationsStub}static get servicePath(){return"cloud.googleapis.com"}static get apiEndpoint(){return"cloud.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform"]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}getLocation(e,n,l){e=e||{};let I;return typeof n=="function"&&l===void 0?(l=n,I={}):I=n,I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},I.otherArgs.headers["x-goog-request-params"]=WPe.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.getLocation(e,I,l)}listLocations(e,n,l){e=e||{};let I;return typeof n=="function"&&l===void 0?(l=n,I={}):I=n,I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},I.otherArgs.headers["x-goog-request-params"]=WPe.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.listLocations(e,I,l)}listLocationsAsync(e,n){e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{},n.otherArgs.headers["x-goog-request-params"]=WPe.fromParams({name:e.name||""}),n=n||{};let l=new Z2I.CallSettings(n);return this.initialize(),this.descriptors.page.listLocations.asyncIterate(this.innerApiCalls.listLocations,e,l)}close(){return this.initialize(),this._terminated?Promise.resolve():this.locationsStub.then(e=>{this._terminated=!0,e.close()})}};CVe.LocationsClient=VPe});var YY=f((Kt,Zbn)=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.fallback=Kt.GoogleError=Kt.operation=Kt.Operation=Kt.warn=Kt.protobufMinimal=Kt.protobuf=Kt.LocationProtos=Kt.IamProtos=Kt.operationsProtos=Kt.GrpcClient=Kt.defaultToObjectOptions=Kt.makeUUID=Kt.LocationsClient=Kt.IamClient=Kt.OperationsClient=Kt.StreamType=Kt.StreamDescriptor=Kt.PageDescriptor=Kt.LongrunningDescriptor=Kt.BundleDescriptor=Kt.version=Kt.createDefaultBackoffSettings=Kt.RetryOptions=Kt.constructSettings=Kt.CallSettings=Kt.routingHeader=Kt.PathTemplate=void 0;Kt.lro=U2I;Kt.createApiCall=z2I;var R2I=Wrn(),YPe=ETe();Kt.protobuf=YPe;var bbn=kw(),y2I=QWe();Kt.routingHeader=y2I;var A2I=UR(),F2I=UKe(),v2I=uPe(),f2I=mq(),mbn=dPe(),pbn=C6(),X2I=Ibn(),w2I=bVe(),H2I=uU(),Q2I=abn();Kt.IamProtos=Q2I;var E2I=rbn();Kt.LocationProtos=E2I;var J2I=z_e();Kt.operationsProtos=J2I;var C2I=cbn();Object.defineProperty(Kt,"PathTemplate",{enumerable:!0,get:function(){return C2I.PathTemplate}});var LVe=kw();Object.defineProperty(Kt,"CallSettings",{enumerable:!0,get:function(){return LVe.CallSettings}});Object.defineProperty(Kt,"constructSettings",{enumerable:!0,get:function(){return LVe.constructSettings}});Object.defineProperty(Kt,"RetryOptions",{enumerable:!0,get:function(){return LVe.RetryOptions}});Object.defineProperty(Kt,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return LVe.createDefaultBackoffSettings}});Kt.version=a9().version+"-fallback";var kVe=rPe();Object.defineProperty(Kt,"BundleDescriptor",{enumerable:!0,get:function(){return kVe.BundleDescriptor}});Object.defineProperty(Kt,"LongrunningDescriptor",{enumerable:!0,get:function(){return kVe.LongrunningDescriptor}});Object.defineProperty(Kt,"PageDescriptor",{enumerable:!0,get:function(){return kVe.PageDescriptor}});Object.defineProperty(Kt,"StreamDescriptor",{enumerable:!0,get:function(){return kVe.StreamDescriptor}});var L2I=bVe();Object.defineProperty(Kt,"StreamType",{enumerable:!0,get:function(){return L2I.StreamType}});var k2I=uPe();Object.defineProperty(Kt,"OperationsClient",{enumerable:!0,get:function(){return k2I.OperationsClient}});var x2I=sbn();Object.defineProperty(Kt,"IamClient",{enumerable:!0,get:function(){return x2I.IamClient}});var j2I=Gbn();Object.defineProperty(Kt,"LocationsClient",{enumerable:!0,get:function(){return j2I.LocationsClient}});var O2I=uU();Object.defineProperty(Kt,"makeUUID",{enumerable:!0,get:function(){return O2I.makeUUID}});Kt.defaultToObjectOptions={keepCase:!1,longs:String,enums:String,defaults:!0,oneofs:!0};var gq="x-goog-api-client",Rq=class t{static clearProtoCache(){t.protoCache.clear()}constructor(e={}){var n;if((0,pbn.isNodeJS)())this.auth=e.auth||new F2I.GoogleAuth(e);else{if(!e.auth)throw new Error(JSON.stringify(e)+"You need to pass auth instance to use gRPC-fallback client in browser or other non-Node.js environments. Use OAuth2Client from google-auth-library.");this.auth=e.auth}this.fallback=!!e.fallback,this.grpcVersion=a9().version,this.httpRules=e.httpRules,this.numericEnums=(n=e.numericEnums)!==null&&n!==void 0?n:!1}loadProto(e){return YPe.Root.fromJSON(e)}loadProtoJSON(e,n=!1){let l=R2I(JSON.stringify(e)).toString(),I=t.protoCache.get(l);if(I&&!n)return I;let a=YPe.Root.fromJSON(e);return t.protoCache.set(l,a),a}static getServiceMethods(e){let n={};for(let[l,I]of Object.entries(e.methods)){let a=(0,H2I.toLowerCamelCase)(l);n[a]=I}return n}constructSettings(e,n,l,I){function a(c,i){let s={};I||(I={});for(let u in I)s[u]=Array.isArray(I[u])?I[u]:[I[u]];let r=[];if(s[gq]&&s[gq][0]&&r.push(...s[gq][0].split(" ")),r.push(`grpc-web/${Kt.version}`),s[gq]=[r.join(" ")],!i)return s;for(let u in i)if(u.toLowerCase()!==gq){let o=i[u];if(Array.isArray(o))if(s[u]===void 0)s[u]=o;else if(Array.isArray(s[u]))s[u].push(...o);else throw new Error(`Can not add value ${o} to the call metadata.`);else s[u]=[o]}return s}return bbn.constructSettings(e,n,l,A2I.Status,{metadataBuilder:a})}async createStub(e,n,l){if(this.authClient||(this.auth&&"getClient"in this.auth?this.authClient=await this.auth.getClient():this.auth&&"getRequestHeaders"in this.auth&&(this.authClient=this.auth)),!this.authClient)throw new Error("No authentication was provided");if(n.universeDomain||(n.universeDomain="googleapis.com"),n.universeDomain){let d=this.authClient.universeDomain;if(d&&n.universeDomain!==d)throw new Error(`The configured universe domain (${n.universeDomain}) does not match the universe domain found in the credentials (${d}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`)}e.resolveAll();let I=t.getServiceMethods(e),a=n.protocol||"https",c=n.servicePath;if(!c&&e.options&&e.options["(google.api.default_host)"]&&(c=e.options["(google.api.default_host)"]),!c)throw new Error(`Cannot determine service API path for service ${e.name}.`);let i,s=c.match(/^(.*):(\d+)$/);s&&(c=s[1],i=parseInt(s[2])),n.port?i=n.port:i||(i=443);let r=mbn.encodeRequest,u=mbn.decodeResponse;return(0,X2I.generateServiceStub)(I,a,c,i,this.authClient,r,u,this.numericEnums)}static createByteLengthFunction(e){return bbn.createByteLengthFunction(e)}};Kt.GrpcClient=Rq;Rq.protoCache=new Map;function U2I(t){t=Object.assign({scopes:[]},t),t.protoJson&&(t=Object.assign(t,{fallback:!0}));let e=new Rq(t);return new v2I.OperationsClientBuilder(e,t.protoJson)}function z2I(t,e,n,l){return n&&"streaming"in n&&n.type!==w2I.StreamType.SERVER_STREAMING?()=>{throw new Error("The REST transport currently does not support client-streaming or bidi-stream calls.")}:n&&"streaming"in n&&!(0,pbn.isNodeJS)()?()=>{throw new Error("Server streaming over the REST transport is only supported in Node.js.")}:(0,f2I.createApiCall)(t,e,n)}Kt.protobufMinimal=l9();var B2I=PF();Object.defineProperty(Kt,"warn",{enumerable:!0,get:function(){return B2I.warn}});var hbn=S_e();Object.defineProperty(Kt,"Operation",{enumerable:!0,get:function(){return hbn.Operation}});Object.defineProperty(Kt,"operation",{enumerable:!0,get:function(){return hbn.operation}});var S2I=VY();Object.defineProperty(Kt,"GoogleError",{enumerable:!0,get:function(){return S2I.GoogleError}});var M2I=Zbn.exports;Kt.fallback=M2I});var Wbn=f(xVe=>{"use strict";Object.defineProperty(xVe,"__esModule",{value:!0});xVe.DiscussServiceClient=void 0;var T2I=fw(),D2I=prn(),K2I=Xw().version,gPe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}};let a=this.constructor,c=e?.servicePath||e?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(e?.servicePath||e?.apiEndpoint);let i=e?.port||a.port,s=(l=e?.clientConfig)!==null&&l!==void 0?l:{},r=(I=e?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";e=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},e),e.numericEnums=!0,c!==a.servicePath&&!("scopes"in e)&&(e.scopes=a.scopes),n||(n=YY()),this._gaxModule=e.fallback?n.fallback:n,this._gaxGrpc=new this._gaxModule.GrpcClient(e),this._opts=e,this.auth=this._gaxGrpc.auth,this.auth.useJWTAccessWithScope=!0,this.auth.defaultServicePath=a.servicePath,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${this._gaxModule.version}`,`gapic/${K2I}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${this._gaxModule.version}`),e.fallback?u.push(`rest/${this._gaxGrpc.grpcVersion}`):u.push(`grpc/${this._gaxGrpc.grpcVersion}`),e.libName&&e.libVersion&&u.push(`${e.libName}/${e.libVersion}`),this._protos=this._gaxGrpc.loadProtoJSON(T2I),this.pathTemplates={modelPathTemplate:new this._gaxModule.PathTemplate("models/{model}")},this._defaults=this._gaxGrpc.constructSettings("google.ai.generativelanguage.v1beta2.DiscussService",D2I,e.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=this._gaxModule.warn}initialize(){if(this.discussServiceStub)return this.discussServiceStub;this.discussServiceStub=this._gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.ai.generativelanguage.v1beta2.DiscussService"):this._protos.google.ai.generativelanguage.v1beta2.DiscussService,this._opts,this._providedCustomServicePath);let e=["generateMessage","countMessageTokens"];for(let n of e){let l=this.discussServiceStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),a=this._gaxModule.createApiCall(l,this._defaults[n],void 0,this._opts.fallback);this.innerApiCalls[n]=a}return this.discussServiceStub}static get servicePath(){return"generativelanguage.googleapis.com"}static get apiEndpoint(){return"generativelanguage.googleapis.com"}static get port(){return 443}static get scopes(){return[]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}generateMessage(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.generateMessage(e,a,l)}countMessageTokens(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.countMessageTokens(e,a,l)}modelPath(e){return this.pathTemplates.modelPathTemplate.render({model:e})}matchModelFromModelName(e){return this.pathTemplates.modelPathTemplate.match(e).model}close(){return this.discussServiceStub&&!this._terminated?this.discussServiceStub.then(e=>{this._terminated=!0,e.close()}):Promise.resolve()}};xVe.DiscussServiceClient=gPe});var Nbn=f((rYr,_2I)=>{_2I.exports={interfaces:{"google.ai.generativelanguage.v1beta2.ModelService":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{GetModel:{retry_codes_name:"non_idempotent",retry_params_name:"default"},ListModels:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var Vbn=f(jVe=>{"use strict";Object.defineProperty(jVe,"__esModule",{value:!0});jVe.ModelServiceClient=void 0;var P2I=fw(),q2I=Nbn(),$2I=Xw().version,RPe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}};let a=this.constructor,c=e?.servicePath||e?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(e?.servicePath||e?.apiEndpoint);let i=e?.port||a.port,s=(l=e?.clientConfig)!==null&&l!==void 0?l:{},r=(I=e?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";e=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},e),e.numericEnums=!0,c!==a.servicePath&&!("scopes"in e)&&(e.scopes=a.scopes),n||(n=YY()),this._gaxModule=e.fallback?n.fallback:n,this._gaxGrpc=new this._gaxModule.GrpcClient(e),this._opts=e,this.auth=this._gaxGrpc.auth,this.auth.useJWTAccessWithScope=!0,this.auth.defaultServicePath=a.servicePath,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${this._gaxModule.version}`,`gapic/${$2I}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${this._gaxModule.version}`),e.fallback?u.push(`rest/${this._gaxGrpc.grpcVersion}`):u.push(`grpc/${this._gaxGrpc.grpcVersion}`),e.libName&&e.libVersion&&u.push(`${e.libName}/${e.libVersion}`),this._protos=this._gaxGrpc.loadProtoJSON(P2I),this.pathTemplates={modelPathTemplate:new this._gaxModule.PathTemplate("models/{model}")},this.descriptors.page={listModels:new this._gaxModule.PageDescriptor("pageToken","nextPageToken","models")},this._defaults=this._gaxGrpc.constructSettings("google.ai.generativelanguage.v1beta2.ModelService",q2I,e.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=this._gaxModule.warn}initialize(){if(this.modelServiceStub)return this.modelServiceStub;this.modelServiceStub=this._gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.ai.generativelanguage.v1beta2.ModelService"):this._protos.google.ai.generativelanguage.v1beta2.ModelService,this._opts,this._providedCustomServicePath);let e=["getModel","listModels"];for(let n of e){let l=this.modelServiceStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),I=this.descriptors.page[n]||void 0,a=this._gaxModule.createApiCall(l,this._defaults[n],I,this._opts.fallback);this.innerApiCalls[n]=a}return this.modelServiceStub}static get servicePath(){return"generativelanguage.googleapis.com"}static get apiEndpoint(){return"generativelanguage.googleapis.com"}static get port(){return 443}static get scopes(){return[]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}getModel(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({name:(I=e.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.getModel(e,a,l)}listModels(e,n,l){e=e||{};let I;return typeof n=="function"&&l===void 0?(l=n,I={}):I=n,I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},this.initialize(),this.innerApiCalls.listModels(e,I,l)}listModelsStream(e,n){e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{};let I=this._defaults.listModels.merge(n);return this.initialize(),this.descriptors.page.listModels.createStream(this.innerApiCalls.listModels,e,I)}listModelsAsync(e,n){e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{};let I=this._defaults.listModels.merge(n);return this.initialize(),this.descriptors.page.listModels.asyncIterate(this.innerApiCalls.listModels,e,I)}modelPath(e){return this.pathTemplates.modelPathTemplate.render({model:e})}matchModelFromModelName(e){return this.pathTemplates.modelPathTemplate.match(e).model}close(){return this.modelServiceStub&&!this._terminated?this.modelServiceStub.then(e=>{this._terminated=!0,e.close()}):Promise.resolve()}};jVe.ModelServiceClient=RPe});var Ybn=f((oYr,evI)=>{evI.exports={interfaces:{"google.ai.generativelanguage.v1beta2.TextService":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{GenerateText:{retry_codes_name:"non_idempotent",retry_params_name:"default"},EmbedText:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var gbn=f(OVe=>{"use strict";Object.defineProperty(OVe,"__esModule",{value:!0});OVe.TextServiceClient=void 0;var tvI=fw(),nvI=Ybn(),lvI=Xw().version,yPe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}};let a=this.constructor,c=e?.servicePath||e?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(e?.servicePath||e?.apiEndpoint);let i=e?.port||a.port,s=(l=e?.clientConfig)!==null&&l!==void 0?l:{},r=(I=e?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";e=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},e),e.numericEnums=!0,c!==a.servicePath&&!("scopes"in e)&&(e.scopes=a.scopes),n||(n=YY()),this._gaxModule=e.fallback?n.fallback:n,this._gaxGrpc=new this._gaxModule.GrpcClient(e),this._opts=e,this.auth=this._gaxGrpc.auth,this.auth.useJWTAccessWithScope=!0,this.auth.defaultServicePath=a.servicePath,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${this._gaxModule.version}`,`gapic/${lvI}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${this._gaxModule.version}`),e.fallback?u.push(`rest/${this._gaxGrpc.grpcVersion}`):u.push(`grpc/${this._gaxGrpc.grpcVersion}`),e.libName&&e.libVersion&&u.push(`${e.libName}/${e.libVersion}`),this._protos=this._gaxGrpc.loadProtoJSON(tvI),this.pathTemplates={modelPathTemplate:new this._gaxModule.PathTemplate("models/{model}")},this._defaults=this._gaxGrpc.constructSettings("google.ai.generativelanguage.v1beta2.TextService",nvI,e.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=this._gaxModule.warn}initialize(){if(this.textServiceStub)return this.textServiceStub;this.textServiceStub=this._gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.ai.generativelanguage.v1beta2.TextService"):this._protos.google.ai.generativelanguage.v1beta2.TextService,this._opts,this._providedCustomServicePath);let e=["generateText","embedText"];for(let n of e){let l=this.textServiceStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),a=this._gaxModule.createApiCall(l,this._defaults[n],void 0,this._opts.fallback);this.innerApiCalls[n]=a}return this.textServiceStub}static get servicePath(){return"generativelanguage.googleapis.com"}static get apiEndpoint(){return"generativelanguage.googleapis.com"}static get port(){return 443}static get scopes(){return[]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}generateText(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.generateText(e,a,l)}embedText(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.embedText(e,a,l)}modelPath(e){return this.pathTemplates.modelPathTemplate.render({model:e})}matchModelFromModelName(e){return this.pathTemplates.modelPathTemplate.match(e).model}close(){return this.textServiceStub&&!this._terminated?this.textServiceStub.then(e=>{this._terminated=!0,e.close()}):Promise.resolve()}};OVe.TextServiceClient=yPe});var Rbn=f(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});qw.TextServiceClient=qw.ModelServiceClient=qw.DiscussServiceClient=void 0;var IvI=Wbn();Object.defineProperty(qw,"DiscussServiceClient",{enumerable:!0,get:function(){return IvI.DiscussServiceClient}});var avI=Vbn();Object.defineProperty(qw,"ModelServiceClient",{enumerable:!0,get:function(){return avI.ModelServiceClient}});var rvI=gbn();Object.defineProperty(qw,"TextServiceClient",{enumerable:!0,get:function(){return rvI.TextServiceClient}})});var ybn=f((uYr,cvI)=>{cvI.exports={interfaces:{"google.ai.generativelanguage.v1beta3.DiscussService":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{GenerateMessage:{retry_codes_name:"non_idempotent",retry_params_name:"default"},CountMessageTokens:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var Abn=f(UVe=>{"use strict";Object.defineProperty(UVe,"__esModule",{value:!0});UVe.DiscussServiceClient=void 0;var ovI=fw(),ivI=ybn(),svI=Xw().version,APe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}};let a=this.constructor,c=e?.servicePath||e?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(e?.servicePath||e?.apiEndpoint);let i=e?.port||a.port,s=(l=e?.clientConfig)!==null&&l!==void 0?l:{},r=(I=e?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";e=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},e),e.numericEnums=!0,c!==a.servicePath&&!("scopes"in e)&&(e.scopes=a.scopes),n||(n=YY()),this._gaxModule=e.fallback?n.fallback:n,this._gaxGrpc=new this._gaxModule.GrpcClient(e),this._opts=e,this.auth=this._gaxGrpc.auth,this.auth.useJWTAccessWithScope=!0,this.auth.defaultServicePath=a.servicePath,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${this._gaxModule.version}`,`gapic/${svI}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${this._gaxModule.version}`),e.fallback?u.push(`rest/${this._gaxGrpc.grpcVersion}`):u.push(`grpc/${this._gaxGrpc.grpcVersion}`),e.libName&&e.libVersion&&u.push(`${e.libName}/${e.libVersion}`),this._protos=this._gaxGrpc.loadProtoJSON(ovI),this.pathTemplates={modelPathTemplate:new this._gaxModule.PathTemplate("models/{model}"),permissionPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}/permissions/{permission}"),tunedModelPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}")},this._defaults=this._gaxGrpc.constructSettings("google.ai.generativelanguage.v1beta3.DiscussService",ivI,e.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=this._gaxModule.warn}initialize(){if(this.discussServiceStub)return this.discussServiceStub;this.discussServiceStub=this._gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.ai.generativelanguage.v1beta3.DiscussService"):this._protos.google.ai.generativelanguage.v1beta3.DiscussService,this._opts,this._providedCustomServicePath);let e=["generateMessage","countMessageTokens"];for(let n of e){let l=this.discussServiceStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),a=this._gaxModule.createApiCall(l,this._defaults[n],void 0,this._opts.fallback);this.innerApiCalls[n]=a}return this.discussServiceStub}static get servicePath(){return"generativelanguage.googleapis.com"}static get apiEndpoint(){return"generativelanguage.googleapis.com"}static get port(){return 443}static get scopes(){return[]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}generateMessage(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.generateMessage(e,a,l)}countMessageTokens(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.countMessageTokens(e,a,l)}modelPath(e){return this.pathTemplates.modelPathTemplate.render({model:e})}matchModelFromModelName(e){return this.pathTemplates.modelPathTemplate.match(e).model}permissionPath(e,n){return this.pathTemplates.permissionPathTemplate.render({tuned_model:e,permission:n})}matchTunedModelFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).tuned_model}matchPermissionFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).permission}tunedModelPath(e){return this.pathTemplates.tunedModelPathTemplate.render({tuned_model:e})}matchTunedModelFromTunedModelName(e){return this.pathTemplates.tunedModelPathTemplate.match(e).tuned_model}close(){return this.discussServiceStub&&!this._terminated?this.discussServiceStub.then(e=>{this._terminated=!0,e.close()}):Promise.resolve()}};UVe.DiscussServiceClient=APe});var Fbn=f((GYr,uvI)=>{uvI.exports={interfaces:{"google.ai.generativelanguage.v1beta3.ModelService":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{GetModel:{retry_codes_name:"non_idempotent",retry_params_name:"default"},ListModels:{retry_codes_name:"non_idempotent",retry_params_name:"default"},GetTunedModel:{retry_codes_name:"non_idempotent",retry_params_name:"default"},ListTunedModels:{retry_codes_name:"non_idempotent",retry_params_name:"default"},CreateTunedModel:{retry_codes_name:"non_idempotent",retry_params_name:"default"},UpdateTunedModel:{retry_codes_name:"non_idempotent",retry_params_name:"default"},DeleteTunedModel:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var fbn=f(zVe=>{"use strict";Object.defineProperty(zVe,"__esModule",{value:!0});zVe.ModelServiceClient=void 0;var vbn=fw(),dvI=Fbn(),GvI=Xw().version,FPe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}};let a=this.constructor,c=e?.servicePath||e?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(e?.servicePath||e?.apiEndpoint);let i=e?.port||a.port,s=(l=e?.clientConfig)!==null&&l!==void 0?l:{},r=(I=e?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";e=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},e),e.numericEnums=!0,c!==a.servicePath&&!("scopes"in e)&&(e.scopes=a.scopes),n||(n=YY()),this._gaxModule=e.fallback?n.fallback:n,this._gaxGrpc=new this._gaxModule.GrpcClient(e),this._opts=e,this.auth=this._gaxGrpc.auth,this.auth.useJWTAccessWithScope=!0,this.auth.defaultServicePath=a.servicePath,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${this._gaxModule.version}`,`gapic/${GvI}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${this._gaxModule.version}`),e.fallback?u.push(`rest/${this._gaxGrpc.grpcVersion}`):u.push(`grpc/${this._gaxGrpc.grpcVersion}`),e.libName&&e.libVersion&&u.push(`${e.libName}/${e.libVersion}`),this._protos=this._gaxGrpc.loadProtoJSON(vbn),this.pathTemplates={modelPathTemplate:new this._gaxModule.PathTemplate("models/{model}"),permissionPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}/permissions/{permission}"),tunedModelPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}")},this.descriptors.page={listModels:new this._gaxModule.PageDescriptor("pageToken","nextPageToken","models"),listTunedModels:new this._gaxModule.PageDescriptor("pageToken","nextPageToken","tunedModels")};let o=this._gaxModule.protobuf.Root.fromJSON(vbn),d={auth:this.auth,grpc:"grpc"in this._gaxGrpc?this._gaxGrpc.grpc:void 0};e.fallback&&(d.protoJson=o,d.httpRules=[]),this.operationsClient=this._gaxModule.lro(d).operationsClient(e);let b=o.lookup(".google.ai.generativelanguage.v1beta3.TunedModel"),h=o.lookup(".google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata");this.descriptors.longrunning={createTunedModel:new this._gaxModule.LongrunningDescriptor(this.operationsClient,b.decode.bind(b),h.decode.bind(h))},this._defaults=this._gaxGrpc.constructSettings("google.ai.generativelanguage.v1beta3.ModelService",dvI,e.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=this._gaxModule.warn}initialize(){if(this.modelServiceStub)return this.modelServiceStub;this.modelServiceStub=this._gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.ai.generativelanguage.v1beta3.ModelService"):this._protos.google.ai.generativelanguage.v1beta3.ModelService,this._opts,this._providedCustomServicePath);let e=["getModel","listModels","getTunedModel","listTunedModels","createTunedModel","updateTunedModel","deleteTunedModel"];for(let n of e){let l=this.modelServiceStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),I=this.descriptors.page[n]||this.descriptors.longrunning[n]||void 0,a=this._gaxModule.createApiCall(l,this._defaults[n],I,this._opts.fallback);this.innerApiCalls[n]=a}return this.modelServiceStub}static get servicePath(){return"generativelanguage.googleapis.com"}static get apiEndpoint(){return"generativelanguage.googleapis.com"}static get port(){return 443}static get scopes(){return[]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}getModel(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({name:(I=e.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.getModel(e,a,l)}getTunedModel(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({name:(I=e.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.getTunedModel(e,a,l)}updateTunedModel(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({"tuned_model.name":(I=e.tunedModel.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.updateTunedModel(e,a,l)}deleteTunedModel(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({name:(I=e.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.deleteTunedModel(e,a,l)}createTunedModel(e,n,l){e=e||{};let I;return typeof n=="function"&&l===void 0?(l=n,I={}):I=n,I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},this.initialize(),this.innerApiCalls.createTunedModel(e,I,l)}async checkCreateTunedModelProgress(e){let n=new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name:e}),[l]=await this.operationsClient.getOperation(n);return new this._gaxModule.Operation(l,this.descriptors.longrunning.createTunedModel,this._gaxModule.createDefaultBackoffSettings())}listModels(e,n,l){e=e||{};let I;return typeof n=="function"&&l===void 0?(l=n,I={}):I=n,I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},this.initialize(),this.innerApiCalls.listModels(e,I,l)}listModelsStream(e,n){e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{};let I=this._defaults.listModels.merge(n);return this.initialize(),this.descriptors.page.listModels.createStream(this.innerApiCalls.listModels,e,I)}listModelsAsync(e,n){e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{};let I=this._defaults.listModels.merge(n);return this.initialize(),this.descriptors.page.listModels.asyncIterate(this.innerApiCalls.listModels,e,I)}listTunedModels(e,n,l){e=e||{};let I;return typeof n=="function"&&l===void 0?(l=n,I={}):I=n,I=I||{},I.otherArgs=I.otherArgs||{},I.otherArgs.headers=I.otherArgs.headers||{},this.initialize(),this.innerApiCalls.listTunedModels(e,I,l)}listTunedModelsStream(e,n){e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{};let I=this._defaults.listTunedModels.merge(n);return this.initialize(),this.descriptors.page.listTunedModels.createStream(this.innerApiCalls.listTunedModels,e,I)}listTunedModelsAsync(e,n){e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{};let I=this._defaults.listTunedModels.merge(n);return this.initialize(),this.descriptors.page.listTunedModels.asyncIterate(this.innerApiCalls.listTunedModels,e,I)}getOperation(e,n,l){return this.operationsClient.getOperation(e,n,l)}listOperationsAsync(e,n){return this.operationsClient.listOperationsAsync(e,n)}cancelOperation(e,n,l){return this.operationsClient.cancelOperation(e,n,l)}deleteOperation(e,n,l){return this.operationsClient.deleteOperation(e,n,l)}modelPath(e){return this.pathTemplates.modelPathTemplate.render({model:e})}matchModelFromModelName(e){return this.pathTemplates.modelPathTemplate.match(e).model}permissionPath(e,n){return this.pathTemplates.permissionPathTemplate.render({tuned_model:e,permission:n})}matchTunedModelFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).tuned_model}matchPermissionFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).permission}tunedModelPath(e){return this.pathTemplates.tunedModelPathTemplate.render({tuned_model:e})}matchTunedModelFromTunedModelName(e){return this.pathTemplates.tunedModelPathTemplate.match(e).tuned_model}close(){return this.modelServiceStub&&!this._terminated?this.modelServiceStub.then(e=>{this._terminated=!0,e.close(),this.operationsClient.close()}):Promise.resolve()}};zVe.ModelServiceClient=FPe});var Xbn=f((mYr,bvI)=>{bvI.exports={interfaces:{"google.ai.generativelanguage.v1beta3.PermissionService":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{CreatePermission:{retry_codes_name:"non_idempotent",retry_params_name:"default"},GetPermission:{retry_codes_name:"non_idempotent",retry_params_name:"default"},ListPermissions:{retry_codes_name:"non_idempotent",retry_params_name:"default"},UpdatePermission:{retry_codes_name:"non_idempotent",retry_params_name:"default"},DeletePermission:{retry_codes_name:"non_idempotent",retry_params_name:"default"},TransferOwnership:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var wbn=f(BVe=>{"use strict";Object.defineProperty(BVe,"__esModule",{value:!0});BVe.PermissionServiceClient=void 0;var mvI=fw(),pvI=Xbn(),hvI=Xw().version,vPe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}};let a=this.constructor,c=e?.servicePath||e?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(e?.servicePath||e?.apiEndpoint);let i=e?.port||a.port,s=(l=e?.clientConfig)!==null&&l!==void 0?l:{},r=(I=e?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";e=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},e),e.numericEnums=!0,c!==a.servicePath&&!("scopes"in e)&&(e.scopes=a.scopes),n||(n=YY()),this._gaxModule=e.fallback?n.fallback:n,this._gaxGrpc=new this._gaxModule.GrpcClient(e),this._opts=e,this.auth=this._gaxGrpc.auth,this.auth.useJWTAccessWithScope=!0,this.auth.defaultServicePath=a.servicePath,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${this._gaxModule.version}`,`gapic/${hvI}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${this._gaxModule.version}`),e.fallback?u.push(`rest/${this._gaxGrpc.grpcVersion}`):u.push(`grpc/${this._gaxGrpc.grpcVersion}`),e.libName&&e.libVersion&&u.push(`${e.libName}/${e.libVersion}`),this._protos=this._gaxGrpc.loadProtoJSON(mvI),this.pathTemplates={modelPathTemplate:new this._gaxModule.PathTemplate("models/{model}"),permissionPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}/permissions/{permission}"),tunedModelPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}")},this.descriptors.page={listPermissions:new this._gaxModule.PageDescriptor("pageToken","nextPageToken","permissions")},this._defaults=this._gaxGrpc.constructSettings("google.ai.generativelanguage.v1beta3.PermissionService",pvI,e.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=this._gaxModule.warn}initialize(){if(this.permissionServiceStub)return this.permissionServiceStub;this.permissionServiceStub=this._gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.ai.generativelanguage.v1beta3.PermissionService"):this._protos.google.ai.generativelanguage.v1beta3.PermissionService,this._opts,this._providedCustomServicePath);let e=["createPermission","getPermission","listPermissions","updatePermission","deletePermission","transferOwnership"];for(let n of e){let l=this.permissionServiceStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),I=this.descriptors.page[n]||void 0,a=this._gaxModule.createApiCall(l,this._defaults[n],I,this._opts.fallback);this.innerApiCalls[n]=a}return this.permissionServiceStub}static get servicePath(){return"generativelanguage.googleapis.com"}static get apiEndpoint(){return"generativelanguage.googleapis.com"}static get port(){return 443}static get scopes(){return[]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}createPermission(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({parent:(I=e.parent)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.createPermission(e,a,l)}getPermission(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({name:(I=e.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.getPermission(e,a,l)}updatePermission(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({"permission.name":(I=e.permission.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.updatePermission(e,a,l)}deletePermission(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({name:(I=e.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.deletePermission(e,a,l)}transferOwnership(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({name:(I=e.name)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.transferOwnership(e,a,l)}listPermissions(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({parent:(I=e.parent)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.listPermissions(e,a,l)}listPermissionsStream(e,n){var l;e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{},n.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({parent:(l=e.parent)!==null&&l!==void 0?l:""});let a=this._defaults.listPermissions.merge(n);return this.initialize(),this.descriptors.page.listPermissions.createStream(this.innerApiCalls.listPermissions,e,a)}listPermissionsAsync(e,n){var l;e=e||{},n=n||{},n.otherArgs=n.otherArgs||{},n.otherArgs.headers=n.otherArgs.headers||{},n.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({parent:(l=e.parent)!==null&&l!==void 0?l:""});let a=this._defaults.listPermissions.merge(n);return this.initialize(),this.descriptors.page.listPermissions.asyncIterate(this.innerApiCalls.listPermissions,e,a)}modelPath(e){return this.pathTemplates.modelPathTemplate.render({model:e})}matchModelFromModelName(e){return this.pathTemplates.modelPathTemplate.match(e).model}permissionPath(e,n){return this.pathTemplates.permissionPathTemplate.render({tuned_model:e,permission:n})}matchTunedModelFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).tuned_model}matchPermissionFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).permission}tunedModelPath(e){return this.pathTemplates.tunedModelPathTemplate.render({tuned_model:e})}matchTunedModelFromTunedModelName(e){return this.pathTemplates.tunedModelPathTemplate.match(e).tuned_model}close(){return this.permissionServiceStub&&!this._terminated?this.permissionServiceStub.then(e=>{this._terminated=!0,e.close()}):Promise.resolve()}};BVe.PermissionServiceClient=vPe});var Hbn=f((hYr,ZvI)=>{ZvI.exports={interfaces:{"google.ai.generativelanguage.v1beta3.TextService":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{GenerateText:{retry_codes_name:"non_idempotent",retry_params_name:"default"},EmbedText:{retry_codes_name:"non_idempotent",retry_params_name:"default"},BatchEmbedText:{retry_codes_name:"non_idempotent",retry_params_name:"default"},CountTextTokens:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}}}});var Qbn=f(SVe=>{"use strict";Object.defineProperty(SVe,"__esModule",{value:!0});SVe.TextServiceClient=void 0;var WvI=fw(),NvI=Hbn(),VvI=Xw().version,fPe=class{constructor(e,n){var l,I;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}};let a=this.constructor,c=e?.servicePath||e?.apiEndpoint||a.servicePath;this._providedCustomServicePath=!!(e?.servicePath||e?.apiEndpoint);let i=e?.port||a.port,s=(l=e?.clientConfig)!==null&&l!==void 0?l:{},r=(I=e?.fallback)!==null&&I!==void 0?I:typeof window<"u"&&typeof window?.fetch=="function";e=Object.assign({servicePath:c,port:i,clientConfig:s,fallback:r},e),e.numericEnums=!0,c!==a.servicePath&&!("scopes"in e)&&(e.scopes=a.scopes),n||(n=YY()),this._gaxModule=e.fallback?n.fallback:n,this._gaxGrpc=new this._gaxModule.GrpcClient(e),this._opts=e,this.auth=this._gaxGrpc.auth,this.auth.useJWTAccessWithScope=!0,this.auth.defaultServicePath=a.servicePath,c===a.servicePath&&(this.auth.defaultScopes=a.scopes);let u=[`gax/${this._gaxModule.version}`,`gapic/${VvI}`];typeof process<"u"&&"versions"in process?u.push(`gl-node/${process.versions.node}`):u.push(`gl-web/${this._gaxModule.version}`),e.fallback?u.push(`rest/${this._gaxGrpc.grpcVersion}`):u.push(`grpc/${this._gaxGrpc.grpcVersion}`),e.libName&&e.libVersion&&u.push(`${e.libName}/${e.libVersion}`),this._protos=this._gaxGrpc.loadProtoJSON(WvI),this.pathTemplates={modelPathTemplate:new this._gaxModule.PathTemplate("models/{model}"),permissionPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}/permissions/{permission}"),tunedModelPathTemplate:new this._gaxModule.PathTemplate("tunedModels/{tuned_model}")},this._defaults=this._gaxGrpc.constructSettings("google.ai.generativelanguage.v1beta3.TextService",NvI,e.clientConfig||{},{"x-goog-api-client":u.join(" ")}),this.innerApiCalls={},this.warn=this._gaxModule.warn}initialize(){if(this.textServiceStub)return this.textServiceStub;this.textServiceStub=this._gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.ai.generativelanguage.v1beta3.TextService"):this._protos.google.ai.generativelanguage.v1beta3.TextService,this._opts,this._providedCustomServicePath);let e=["generateText","embedText","batchEmbedText","countTextTokens"];for(let n of e){let l=this.textServiceStub.then(c=>(...i)=>this._terminated?Promise.reject("The client has already been closed."):c[n].apply(c,i),c=>()=>{throw c}),a=this._gaxModule.createApiCall(l,this._defaults[n],void 0,this._opts.fallback);this.innerApiCalls[n]=a}return this.textServiceStub}static get servicePath(){return"generativelanguage.googleapis.com"}static get apiEndpoint(){return"generativelanguage.googleapis.com"}static get port(){return 443}static get scopes(){return[]}getProjectId(e){if(e){this.auth.getProjectId(e);return}return this.auth.getProjectId()}generateText(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.generateText(e,a,l)}embedText(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.embedText(e,a,l)}batchEmbedText(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.batchEmbedText(e,a,l)}countTextTokens(e,n,l){var I;e=e||{};let a;return typeof n=="function"&&l===void 0?(l=n,a={}):a=n,a=a||{},a.otherArgs=a.otherArgs||{},a.otherArgs.headers=a.otherArgs.headers||{},a.otherArgs.headers["x-goog-request-params"]=this._gaxModule.routingHeader.fromParams({model:(I=e.model)!==null&&I!==void 0?I:""}),this.initialize(),this.innerApiCalls.countTextTokens(e,a,l)}modelPath(e){return this.pathTemplates.modelPathTemplate.render({model:e})}matchModelFromModelName(e){return this.pathTemplates.modelPathTemplate.match(e).model}permissionPath(e,n){return this.pathTemplates.permissionPathTemplate.render({tuned_model:e,permission:n})}matchTunedModelFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).tuned_model}matchPermissionFromPermissionName(e){return this.pathTemplates.permissionPathTemplate.match(e).permission}tunedModelPath(e){return this.pathTemplates.tunedModelPathTemplate.render({tuned_model:e})}matchTunedModelFromTunedModelName(e){return this.pathTemplates.tunedModelPathTemplate.match(e).tuned_model}close(){return this.textServiceStub&&!this._terminated?this.textServiceStub.then(e=>{this._terminated=!0,e.close()}):Promise.resolve()}};SVe.TextServiceClient=fPe});var Ebn=f(qR=>{"use strict";Object.defineProperty(qR,"__esModule",{value:!0});qR.TextServiceClient=qR.PermissionServiceClient=qR.ModelServiceClient=qR.DiscussServiceClient=void 0;var YvI=Abn();Object.defineProperty(qR,"DiscussServiceClient",{enumerable:!0,get:function(){return YvI.DiscussServiceClient}});var gvI=fbn();Object.defineProperty(qR,"ModelServiceClient",{enumerable:!0,get:function(){return gvI.ModelServiceClient}});var RvI=wbn();Object.defineProperty(qR,"PermissionServiceClient",{enumerable:!0,get:function(){return RvI.PermissionServiceClient}});var yvI=Qbn();Object.defineProperty(qR,"TextServiceClient",{enumerable:!0,get:function(){return yvI.TextServiceClient}})});var Jbn=f(MVe=>{"use strict";Object.defineProperty(MVe,"__esModule",{value:!0});MVe.protobufMinimal=void 0;MVe.protobufMinimal=l9()});var Lbn=f((Cbn,yq)=>{(function(t,e){typeof define=="function"&&define.amd?define(["protobufjs/minimal"],e):typeof require=="function"&&typeof yq=="object"&&yq&&yq.exports&&(yq.exports=e(Jbn().protobufMinimal))})(Cbn,function(t){"use strict";var e=t.Reader,n=t.Writer,l=t.util,I=t.roots._google_ai_generativelanguage_protos||(t.roots._google_ai_generativelanguage_protos={});return I.google=function(){var a={};return a.ai=function(){var c={};return c.generativelanguage=function(){var i={};return i.v1beta2=function(){var s={};return s.CitationMetadata=function(){function r(u){if(this.citationSources=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.citationSources&&h.citationSources.length||(h.citationSources=[]),h.citationSources.push(I.google.ai.generativelanguage.v1beta2.CitationSource.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.citationSources!=null&&o.hasOwnProperty("citationSources")){if(!Array.isArray(o.citationSources))return"citationSources: array expected";for(var d=0;d>>3){case 1:{Z.startIndex=d.int32();break}case 2:{Z.endIndex=d.int32();break}case 3:{Z.uri=d.string();break}case 4:{Z.license=d.string();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};return d.startIndex!=null&&d.hasOwnProperty("startIndex")&&(b._startIndex=1,!l.isInteger(d.startIndex))?"startIndex: integer expected":d.endIndex!=null&&d.hasOwnProperty("endIndex")&&(b._endIndex=1,!l.isInteger(d.endIndex))?"endIndex: integer expected":d.uri!=null&&d.hasOwnProperty("uri")&&(b._uri=1,!l.isString(d.uri))?"uri: string expected":d.license!=null&&d.hasOwnProperty("license")&&(b._license=1,!l.isString(d.license))?"license: string expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta2.CitationSource)return d;var b=new I.google.ai.generativelanguage.v1beta2.CitationSource;return d.startIndex!=null&&(b.startIndex=d.startIndex|0),d.endIndex!=null&&(b.endIndex=d.endIndex|0),d.uri!=null&&(b.uri=String(d.uri)),d.license!=null&&(b.license=String(d.license)),b},r.toObject=function(d,b){b||(b={});var h={};return d.startIndex!=null&&d.hasOwnProperty("startIndex")&&(h.startIndex=d.startIndex,b.oneofs&&(h._startIndex="startIndex")),d.endIndex!=null&&d.hasOwnProperty("endIndex")&&(h.endIndex=d.endIndex,b.oneofs&&(h._endIndex="endIndex")),d.uri!=null&&d.hasOwnProperty("uri")&&(h.uri=d.uri,b.oneofs&&(h._uri="uri")),d.license!=null&&d.hasOwnProperty("license")&&(h.license=d.license,b.oneofs&&(h._license="license")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta2.CitationSource"},r}(),s.DiscussService=function(){function r(u,o,d){t.rpc.Service.call(this,u,o,d)}return(r.prototype=Object.create(t.rpc.Service.prototype)).constructor=r,r.create=function(o,d,b){return new this(o,d,b)},Object.defineProperty(r.prototype.generateMessage=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta2.GenerateMessageRequest,I.google.ai.generativelanguage.v1beta2.GenerateMessageResponse,o,d)},"name",{value:"GenerateMessage"}),Object.defineProperty(r.prototype.countMessageTokens=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta2.CountMessageTokensRequest,I.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse,o,d)},"name",{value:"CountMessageTokens"}),r}(),s.GenerateMessageRequest=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.model=d.string();break}case 2:{Z.prompt=I.google.ai.generativelanguage.v1beta2.MessagePrompt.decode(d,d.uint32());break}case 3:{Z.temperature=d.float();break}case 4:{Z.candidateCount=d.int32();break}case 5:{Z.topP=d.float();break}case 6:{Z.topK=d.int32();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.model!=null&&d.hasOwnProperty("model")&&!l.isString(d.model))return"model: string expected";if(d.prompt!=null&&d.hasOwnProperty("prompt")){var h=I.google.ai.generativelanguage.v1beta2.MessagePrompt.verify(d.prompt);if(h)return"prompt."+h}return d.temperature!=null&&d.hasOwnProperty("temperature")&&(b._temperature=1,typeof d.temperature!="number")?"temperature: number expected":d.candidateCount!=null&&d.hasOwnProperty("candidateCount")&&(b._candidateCount=1,!l.isInteger(d.candidateCount))?"candidateCount: integer expected":d.topP!=null&&d.hasOwnProperty("topP")&&(b._topP=1,typeof d.topP!="number")?"topP: number expected":d.topK!=null&&d.hasOwnProperty("topK")&&(b._topK=1,!l.isInteger(d.topK))?"topK: integer expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta2.GenerateMessageRequest)return d;var b=new I.google.ai.generativelanguage.v1beta2.GenerateMessageRequest;if(d.model!=null&&(b.model=String(d.model)),d.prompt!=null){if(typeof d.prompt!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.GenerateMessageRequest.prompt: object expected");b.prompt=I.google.ai.generativelanguage.v1beta2.MessagePrompt.fromObject(d.prompt)}return d.temperature!=null&&(b.temperature=Number(d.temperature)),d.candidateCount!=null&&(b.candidateCount=d.candidateCount|0),d.topP!=null&&(b.topP=Number(d.topP)),d.topK!=null&&(b.topK=d.topK|0),b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.model="",h.prompt=null),d.model!=null&&d.hasOwnProperty("model")&&(h.model=d.model),d.prompt!=null&&d.hasOwnProperty("prompt")&&(h.prompt=I.google.ai.generativelanguage.v1beta2.MessagePrompt.toObject(d.prompt,b)),d.temperature!=null&&d.hasOwnProperty("temperature")&&(h.temperature=b.json&&!isFinite(d.temperature)?String(d.temperature):d.temperature,b.oneofs&&(h._temperature="temperature")),d.candidateCount!=null&&d.hasOwnProperty("candidateCount")&&(h.candidateCount=d.candidateCount,b.oneofs&&(h._candidateCount="candidateCount")),d.topP!=null&&d.hasOwnProperty("topP")&&(h.topP=b.json&&!isFinite(d.topP)?String(d.topP):d.topP,b.oneofs&&(h._topP="topP")),d.topK!=null&&d.hasOwnProperty("topK")&&(h.topK=d.topK,b.oneofs&&(h._topK="topK")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta2.GenerateMessageRequest"},r}(),s.GenerateMessageResponse=function(){function r(u){if(this.candidates=[],this.messages=[],this.filters=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.candidates&&h.candidates.length||(h.candidates=[]),h.candidates.push(I.google.ai.generativelanguage.v1beta2.Message.decode(o,o.uint32()));break}case 2:{h.messages&&h.messages.length||(h.messages=[]),h.messages.push(I.google.ai.generativelanguage.v1beta2.Message.decode(o,o.uint32()));break}case 3:{h.filters&&h.filters.length||(h.filters=[]),h.filters.push(I.google.ai.generativelanguage.v1beta2.ContentFilter.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.candidates!=null&&o.hasOwnProperty("candidates")){if(!Array.isArray(o.candidates))return"candidates: array expected";for(var d=0;d>>3){case 1:{Z.author=d.string();break}case 2:{Z.content=d.string();break}case 3:{Z.citationMetadata=I.google.ai.generativelanguage.v1beta2.CitationMetadata.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.author!=null&&d.hasOwnProperty("author")&&!l.isString(d.author))return"author: string expected";if(d.content!=null&&d.hasOwnProperty("content")&&!l.isString(d.content))return"content: string expected";if(d.citationMetadata!=null&&d.hasOwnProperty("citationMetadata")){b._citationMetadata=1;{var h=I.google.ai.generativelanguage.v1beta2.CitationMetadata.verify(d.citationMetadata);if(h)return"citationMetadata."+h}}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta2.Message)return d;var b=new I.google.ai.generativelanguage.v1beta2.Message;if(d.author!=null&&(b.author=String(d.author)),d.content!=null&&(b.content=String(d.content)),d.citationMetadata!=null){if(typeof d.citationMetadata!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.Message.citationMetadata: object expected");b.citationMetadata=I.google.ai.generativelanguage.v1beta2.CitationMetadata.fromObject(d.citationMetadata)}return b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.author="",h.content=""),d.author!=null&&d.hasOwnProperty("author")&&(h.author=d.author),d.content!=null&&d.hasOwnProperty("content")&&(h.content=d.content),d.citationMetadata!=null&&d.hasOwnProperty("citationMetadata")&&(h.citationMetadata=I.google.ai.generativelanguage.v1beta2.CitationMetadata.toObject(d.citationMetadata,b),b.oneofs&&(h._citationMetadata="citationMetadata")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta2.Message"},r}(),s.MessagePrompt=function(){function r(u){if(this.examples=[],this.messages=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.context=o.string();break}case 2:{h.examples&&h.examples.length||(h.examples=[]),h.examples.push(I.google.ai.generativelanguage.v1beta2.Example.decode(o,o.uint32()));break}case 3:{h.messages&&h.messages.length||(h.messages=[]),h.messages.push(I.google.ai.generativelanguage.v1beta2.Message.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.context!=null&&o.hasOwnProperty("context")&&!l.isString(o.context))return"context: string expected";if(o.examples!=null&&o.hasOwnProperty("examples")){if(!Array.isArray(o.examples))return"examples: array expected";for(var d=0;d>>3){case 1:{h.input=I.google.ai.generativelanguage.v1beta2.Message.decode(o,o.uint32());break}case 2:{h.output=I.google.ai.generativelanguage.v1beta2.Message.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.input!=null&&o.hasOwnProperty("input")){var d=I.google.ai.generativelanguage.v1beta2.Message.verify(o.input);if(d)return"input."+d}if(o.output!=null&&o.hasOwnProperty("output")){var d=I.google.ai.generativelanguage.v1beta2.Message.verify(o.output);if(d)return"output."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.Example)return o;var d=new I.google.ai.generativelanguage.v1beta2.Example;if(o.input!=null){if(typeof o.input!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.Example.input: object expected");d.input=I.google.ai.generativelanguage.v1beta2.Message.fromObject(o.input)}if(o.output!=null){if(typeof o.output!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.Example.output: object expected");d.output=I.google.ai.generativelanguage.v1beta2.Message.fromObject(o.output)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.input=null,b.output=null),o.input!=null&&o.hasOwnProperty("input")&&(b.input=I.google.ai.generativelanguage.v1beta2.Message.toObject(o.input,d)),o.output!=null&&o.hasOwnProperty("output")&&(b.output=I.google.ai.generativelanguage.v1beta2.Message.toObject(o.output,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.Example"},r}(),s.CountMessageTokensRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.model=o.string();break}case 2:{h.prompt=I.google.ai.generativelanguage.v1beta2.MessagePrompt.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.model!=null&&o.hasOwnProperty("model")&&!l.isString(o.model))return"model: string expected";if(o.prompt!=null&&o.hasOwnProperty("prompt")){var d=I.google.ai.generativelanguage.v1beta2.MessagePrompt.verify(o.prompt);if(d)return"prompt."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.CountMessageTokensRequest)return o;var d=new I.google.ai.generativelanguage.v1beta2.CountMessageTokensRequest;if(o.model!=null&&(d.model=String(o.model)),o.prompt!=null){if(typeof o.prompt!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.CountMessageTokensRequest.prompt: object expected");d.prompt=I.google.ai.generativelanguage.v1beta2.MessagePrompt.fromObject(o.prompt)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.model="",b.prompt=null),o.model!=null&&o.hasOwnProperty("model")&&(b.model=o.model),o.prompt!=null&&o.hasOwnProperty("prompt")&&(b.prompt=I.google.ai.generativelanguage.v1beta2.MessagePrompt.toObject(o.prompt,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.CountMessageTokensRequest"},r}(),s.CountMessageTokensResponse=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.tokenCount=o.int32();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.tokenCount!=null&&o.hasOwnProperty("tokenCount")&&!l.isInteger(o.tokenCount)?"tokenCount: integer expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse)return o;var d=new I.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse;return o.tokenCount!=null&&(d.tokenCount=o.tokenCount|0),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.tokenCount=0),o.tokenCount!=null&&o.hasOwnProperty("tokenCount")&&(b.tokenCount=o.tokenCount),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.CountMessageTokensResponse"},r}(),s.HarmCategory=function(){var r={},u=Object.create(r);return u[r[0]="HARM_CATEGORY_UNSPECIFIED"]=0,u[r[1]="HARM_CATEGORY_DEROGATORY"]=1,u[r[2]="HARM_CATEGORY_TOXICITY"]=2,u[r[3]="HARM_CATEGORY_VIOLENCE"]=3,u[r[4]="HARM_CATEGORY_SEXUAL"]=4,u[r[5]="HARM_CATEGORY_MEDICAL"]=5,u[r[6]="HARM_CATEGORY_DANGEROUS"]=6,u}(),s.ContentFilter=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.reason=d.int32();break}case 2:{Z.message=d.string();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.reason!=null&&d.hasOwnProperty("reason"))switch(d.reason){default:return"reason: enum value expected";case 0:case 1:case 2:break}return d.message!=null&&d.hasOwnProperty("message")&&(b._message=1,!l.isString(d.message))?"message: string expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta2.ContentFilter)return d;var b=new I.google.ai.generativelanguage.v1beta2.ContentFilter;switch(d.reason){default:if(typeof d.reason=="number"){b.reason=d.reason;break}break;case"BLOCKED_REASON_UNSPECIFIED":case 0:b.reason=0;break;case"SAFETY":case 1:b.reason=1;break;case"OTHER":case 2:b.reason=2;break}return d.message!=null&&(b.message=String(d.message)),b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.reason=b.enums===String?"BLOCKED_REASON_UNSPECIFIED":0),d.reason!=null&&d.hasOwnProperty("reason")&&(h.reason=b.enums===String?I.google.ai.generativelanguage.v1beta2.ContentFilter.BlockedReason[d.reason]===void 0?d.reason:I.google.ai.generativelanguage.v1beta2.ContentFilter.BlockedReason[d.reason]:d.reason),d.message!=null&&d.hasOwnProperty("message")&&(h.message=d.message,b.oneofs&&(h._message="message")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta2.ContentFilter"},r.BlockedReason=function(){var o={},d=Object.create(o);return d[o[0]="BLOCKED_REASON_UNSPECIFIED"]=0,d[o[1]="SAFETY"]=1,d[o[2]="OTHER"]=2,d}(),r}(),s.SafetyFeedback=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.rating=I.google.ai.generativelanguage.v1beta2.SafetyRating.decode(o,o.uint32());break}case 2:{h.setting=I.google.ai.generativelanguage.v1beta2.SafetySetting.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.rating!=null&&o.hasOwnProperty("rating")){var d=I.google.ai.generativelanguage.v1beta2.SafetyRating.verify(o.rating);if(d)return"rating."+d}if(o.setting!=null&&o.hasOwnProperty("setting")){var d=I.google.ai.generativelanguage.v1beta2.SafetySetting.verify(o.setting);if(d)return"setting."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.SafetyFeedback)return o;var d=new I.google.ai.generativelanguage.v1beta2.SafetyFeedback;if(o.rating!=null){if(typeof o.rating!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.SafetyFeedback.rating: object expected");d.rating=I.google.ai.generativelanguage.v1beta2.SafetyRating.fromObject(o.rating)}if(o.setting!=null){if(typeof o.setting!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.SafetyFeedback.setting: object expected");d.setting=I.google.ai.generativelanguage.v1beta2.SafetySetting.fromObject(o.setting)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.rating=null,b.setting=null),o.rating!=null&&o.hasOwnProperty("rating")&&(b.rating=I.google.ai.generativelanguage.v1beta2.SafetyRating.toObject(o.rating,d)),o.setting!=null&&o.hasOwnProperty("setting")&&(b.setting=I.google.ai.generativelanguage.v1beta2.SafetySetting.toObject(o.setting,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.SafetyFeedback"},r}(),s.SafetyRating=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 3:{h.category=o.int32();break}case 4:{h.probability=o.int32();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.category!=null&&o.hasOwnProperty("category"))switch(o.category){default:return"category: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(o.probability!=null&&o.hasOwnProperty("probability"))switch(o.probability){default:return"probability: enum value expected";case 0:case 1:case 2:case 3:case 4:break}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.SafetyRating)return o;var d=new I.google.ai.generativelanguage.v1beta2.SafetyRating;switch(o.category){default:if(typeof o.category=="number"){d.category=o.category;break}break;case"HARM_CATEGORY_UNSPECIFIED":case 0:d.category=0;break;case"HARM_CATEGORY_DEROGATORY":case 1:d.category=1;break;case"HARM_CATEGORY_TOXICITY":case 2:d.category=2;break;case"HARM_CATEGORY_VIOLENCE":case 3:d.category=3;break;case"HARM_CATEGORY_SEXUAL":case 4:d.category=4;break;case"HARM_CATEGORY_MEDICAL":case 5:d.category=5;break;case"HARM_CATEGORY_DANGEROUS":case 6:d.category=6;break}switch(o.probability){default:if(typeof o.probability=="number"){d.probability=o.probability;break}break;case"HARM_PROBABILITY_UNSPECIFIED":case 0:d.probability=0;break;case"NEGLIGIBLE":case 1:d.probability=1;break;case"LOW":case 2:d.probability=2;break;case"MEDIUM":case 3:d.probability=3;break;case"HIGH":case 4:d.probability=4;break}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.category=d.enums===String?"HARM_CATEGORY_UNSPECIFIED":0,b.probability=d.enums===String?"HARM_PROBABILITY_UNSPECIFIED":0),o.category!=null&&o.hasOwnProperty("category")&&(b.category=d.enums===String?I.google.ai.generativelanguage.v1beta2.HarmCategory[o.category]===void 0?o.category:I.google.ai.generativelanguage.v1beta2.HarmCategory[o.category]:o.category),o.probability!=null&&o.hasOwnProperty("probability")&&(b.probability=d.enums===String?I.google.ai.generativelanguage.v1beta2.SafetyRating.HarmProbability[o.probability]===void 0?o.probability:I.google.ai.generativelanguage.v1beta2.SafetyRating.HarmProbability[o.probability]:o.probability),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.SafetyRating"},r.HarmProbability=function(){var u={},o=Object.create(u);return o[u[0]="HARM_PROBABILITY_UNSPECIFIED"]=0,o[u[1]="NEGLIGIBLE"]=1,o[u[2]="LOW"]=2,o[u[3]="MEDIUM"]=3,o[u[4]="HIGH"]=4,o}(),r}(),s.SafetySetting=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 3:{h.category=o.int32();break}case 4:{h.threshold=o.int32();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.category!=null&&o.hasOwnProperty("category"))switch(o.category){default:return"category: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(o.threshold!=null&&o.hasOwnProperty("threshold"))switch(o.threshold){default:return"threshold: enum value expected";case 0:case 1:case 2:case 3:break}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.SafetySetting)return o;var d=new I.google.ai.generativelanguage.v1beta2.SafetySetting;switch(o.category){default:if(typeof o.category=="number"){d.category=o.category;break}break;case"HARM_CATEGORY_UNSPECIFIED":case 0:d.category=0;break;case"HARM_CATEGORY_DEROGATORY":case 1:d.category=1;break;case"HARM_CATEGORY_TOXICITY":case 2:d.category=2;break;case"HARM_CATEGORY_VIOLENCE":case 3:d.category=3;break;case"HARM_CATEGORY_SEXUAL":case 4:d.category=4;break;case"HARM_CATEGORY_MEDICAL":case 5:d.category=5;break;case"HARM_CATEGORY_DANGEROUS":case 6:d.category=6;break}switch(o.threshold){default:if(typeof o.threshold=="number"){d.threshold=o.threshold;break}break;case"HARM_BLOCK_THRESHOLD_UNSPECIFIED":case 0:d.threshold=0;break;case"BLOCK_LOW_AND_ABOVE":case 1:d.threshold=1;break;case"BLOCK_MEDIUM_AND_ABOVE":case 2:d.threshold=2;break;case"BLOCK_ONLY_HIGH":case 3:d.threshold=3;break}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.category=d.enums===String?"HARM_CATEGORY_UNSPECIFIED":0,b.threshold=d.enums===String?"HARM_BLOCK_THRESHOLD_UNSPECIFIED":0),o.category!=null&&o.hasOwnProperty("category")&&(b.category=d.enums===String?I.google.ai.generativelanguage.v1beta2.HarmCategory[o.category]===void 0?o.category:I.google.ai.generativelanguage.v1beta2.HarmCategory[o.category]:o.category),o.threshold!=null&&o.hasOwnProperty("threshold")&&(b.threshold=d.enums===String?I.google.ai.generativelanguage.v1beta2.SafetySetting.HarmBlockThreshold[o.threshold]===void 0?o.threshold:I.google.ai.generativelanguage.v1beta2.SafetySetting.HarmBlockThreshold[o.threshold]:o.threshold),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.SafetySetting"},r.HarmBlockThreshold=function(){var u={},o=Object.create(u);return o[u[0]="HARM_BLOCK_THRESHOLD_UNSPECIFIED"]=0,o[u[1]="BLOCK_LOW_AND_ABOVE"]=1,o[u[2]="BLOCK_MEDIUM_AND_ABOVE"]=2,o[u[3]="BLOCK_ONLY_HIGH"]=3,o}(),r}(),s.Model=function(){function r(o){if(this.supportedGenerationMethods=[],o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.name=d.string();break}case 2:{Z.baseModelId=d.string();break}case 3:{Z.version=d.string();break}case 4:{Z.displayName=d.string();break}case 5:{Z.description=d.string();break}case 6:{Z.inputTokenLimit=d.int32();break}case 7:{Z.outputTokenLimit=d.int32();break}case 8:{Z.supportedGenerationMethods&&Z.supportedGenerationMethods.length||(Z.supportedGenerationMethods=[]),Z.supportedGenerationMethods.push(d.string());break}case 9:{Z.temperature=d.float();break}case 10:{Z.topP=d.float();break}case 11:{Z.topK=d.int32();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.name!=null&&d.hasOwnProperty("name")&&!l.isString(d.name))return"name: string expected";if(d.baseModelId!=null&&d.hasOwnProperty("baseModelId")&&!l.isString(d.baseModelId))return"baseModelId: string expected";if(d.version!=null&&d.hasOwnProperty("version")&&!l.isString(d.version))return"version: string expected";if(d.displayName!=null&&d.hasOwnProperty("displayName")&&!l.isString(d.displayName))return"displayName: string expected";if(d.description!=null&&d.hasOwnProperty("description")&&!l.isString(d.description))return"description: string expected";if(d.inputTokenLimit!=null&&d.hasOwnProperty("inputTokenLimit")&&!l.isInteger(d.inputTokenLimit))return"inputTokenLimit: integer expected";if(d.outputTokenLimit!=null&&d.hasOwnProperty("outputTokenLimit")&&!l.isInteger(d.outputTokenLimit))return"outputTokenLimit: integer expected";if(d.supportedGenerationMethods!=null&&d.hasOwnProperty("supportedGenerationMethods")){if(!Array.isArray(d.supportedGenerationMethods))return"supportedGenerationMethods: array expected";for(var h=0;h>>3){case 1:{h.name=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.name!=null&&o.hasOwnProperty("name")&&!l.isString(o.name)?"name: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.GetModelRequest)return o;var d=new I.google.ai.generativelanguage.v1beta2.GetModelRequest;return o.name!=null&&(d.name=String(o.name)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.name=""),o.name!=null&&o.hasOwnProperty("name")&&(b.name=o.name),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.GetModelRequest"},r}(),s.ListModelsRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 2:{h.pageSize=o.int32();break}case 3:{h.pageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.pageSize!=null&&o.hasOwnProperty("pageSize")&&!l.isInteger(o.pageSize)?"pageSize: integer expected":o.pageToken!=null&&o.hasOwnProperty("pageToken")&&!l.isString(o.pageToken)?"pageToken: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.ListModelsRequest)return o;var d=new I.google.ai.generativelanguage.v1beta2.ListModelsRequest;return o.pageSize!=null&&(d.pageSize=o.pageSize|0),o.pageToken!=null&&(d.pageToken=String(o.pageToken)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.pageSize=0,b.pageToken=""),o.pageSize!=null&&o.hasOwnProperty("pageSize")&&(b.pageSize=o.pageSize),o.pageToken!=null&&o.hasOwnProperty("pageToken")&&(b.pageToken=o.pageToken),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.ListModelsRequest"},r}(),s.ListModelsResponse=function(){function r(u){if(this.models=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.models&&h.models.length||(h.models=[]),h.models.push(I.google.ai.generativelanguage.v1beta2.Model.decode(o,o.uint32()));break}case 2:{h.nextPageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.models!=null&&o.hasOwnProperty("models")){if(!Array.isArray(o.models))return"models: array expected";for(var d=0;d>>3){case 1:{Z.model=d.string();break}case 2:{Z.prompt=I.google.ai.generativelanguage.v1beta2.TextPrompt.decode(d,d.uint32());break}case 3:{Z.temperature=d.float();break}case 4:{Z.candidateCount=d.int32();break}case 5:{Z.maxOutputTokens=d.int32();break}case 6:{Z.topP=d.float();break}case 7:{Z.topK=d.int32();break}case 8:{Z.safetySettings&&Z.safetySettings.length||(Z.safetySettings=[]),Z.safetySettings.push(I.google.ai.generativelanguage.v1beta2.SafetySetting.decode(d,d.uint32()));break}case 9:{Z.stopSequences&&Z.stopSequences.length||(Z.stopSequences=[]),Z.stopSequences.push(d.string());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.model!=null&&d.hasOwnProperty("model")&&!l.isString(d.model))return"model: string expected";if(d.prompt!=null&&d.hasOwnProperty("prompt")){var h=I.google.ai.generativelanguage.v1beta2.TextPrompt.verify(d.prompt);if(h)return"prompt."+h}if(d.temperature!=null&&d.hasOwnProperty("temperature")&&(b._temperature=1,typeof d.temperature!="number"))return"temperature: number expected";if(d.candidateCount!=null&&d.hasOwnProperty("candidateCount")&&(b._candidateCount=1,!l.isInteger(d.candidateCount)))return"candidateCount: integer expected";if(d.maxOutputTokens!=null&&d.hasOwnProperty("maxOutputTokens")&&(b._maxOutputTokens=1,!l.isInteger(d.maxOutputTokens)))return"maxOutputTokens: integer expected";if(d.topP!=null&&d.hasOwnProperty("topP")&&(b._topP=1,typeof d.topP!="number"))return"topP: number expected";if(d.topK!=null&&d.hasOwnProperty("topK")&&(b._topK=1,!l.isInteger(d.topK)))return"topK: integer expected";if(d.safetySettings!=null&&d.hasOwnProperty("safetySettings")){if(!Array.isArray(d.safetySettings))return"safetySettings: array expected";for(var Z=0;Z>>3){case 1:{h.candidates&&h.candidates.length||(h.candidates=[]),h.candidates.push(I.google.ai.generativelanguage.v1beta2.TextCompletion.decode(o,o.uint32()));break}case 3:{h.filters&&h.filters.length||(h.filters=[]),h.filters.push(I.google.ai.generativelanguage.v1beta2.ContentFilter.decode(o,o.uint32()));break}case 4:{h.safetyFeedback&&h.safetyFeedback.length||(h.safetyFeedback=[]),h.safetyFeedback.push(I.google.ai.generativelanguage.v1beta2.SafetyFeedback.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.candidates!=null&&o.hasOwnProperty("candidates")){if(!Array.isArray(o.candidates))return"candidates: array expected";for(var d=0;d>>3){case 1:{h.text=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.text!=null&&o.hasOwnProperty("text")&&!l.isString(o.text)?"text: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.TextPrompt)return o;var d=new I.google.ai.generativelanguage.v1beta2.TextPrompt;return o.text!=null&&(d.text=String(o.text)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.text=""),o.text!=null&&o.hasOwnProperty("text")&&(b.text=o.text),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.TextPrompt"},r}(),s.TextCompletion=function(){function r(o){if(this.safetyRatings=[],o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.output=d.string();break}case 2:{Z.safetyRatings&&Z.safetyRatings.length||(Z.safetyRatings=[]),Z.safetyRatings.push(I.google.ai.generativelanguage.v1beta2.SafetyRating.decode(d,d.uint32()));break}case 3:{Z.citationMetadata=I.google.ai.generativelanguage.v1beta2.CitationMetadata.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.output!=null&&d.hasOwnProperty("output")&&!l.isString(d.output))return"output: string expected";if(d.safetyRatings!=null&&d.hasOwnProperty("safetyRatings")){if(!Array.isArray(d.safetyRatings))return"safetyRatings: array expected";for(var h=0;h>>3){case 1:{h.model=o.string();break}case 2:{h.text=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.model!=null&&o.hasOwnProperty("model")&&!l.isString(o.model)?"model: string expected":o.text!=null&&o.hasOwnProperty("text")&&!l.isString(o.text)?"text: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta2.EmbedTextRequest)return o;var d=new I.google.ai.generativelanguage.v1beta2.EmbedTextRequest;return o.model!=null&&(d.model=String(o.model)),o.text!=null&&(d.text=String(o.text)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.model="",b.text=""),o.model!=null&&o.hasOwnProperty("model")&&(b.model=o.model),o.text!=null&&o.hasOwnProperty("text")&&(b.text=o.text),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta2.EmbedTextRequest"},r}(),s.EmbedTextResponse=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.embedding=I.google.ai.generativelanguage.v1beta2.Embedding.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.embedding!=null&&d.hasOwnProperty("embedding")){b._embedding=1;{var h=I.google.ai.generativelanguage.v1beta2.Embedding.verify(d.embedding);if(h)return"embedding."+h}}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta2.EmbedTextResponse)return d;var b=new I.google.ai.generativelanguage.v1beta2.EmbedTextResponse;if(d.embedding!=null){if(typeof d.embedding!="object")throw TypeError(".google.ai.generativelanguage.v1beta2.EmbedTextResponse.embedding: object expected");b.embedding=I.google.ai.generativelanguage.v1beta2.Embedding.fromObject(d.embedding)}return b},r.toObject=function(d,b){b||(b={});var h={};return d.embedding!=null&&d.hasOwnProperty("embedding")&&(h.embedding=I.google.ai.generativelanguage.v1beta2.Embedding.toObject(d.embedding,b),b.oneofs&&(h._embedding="embedding")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta2.EmbedTextResponse"},r}(),s.Embedding=function(){function r(u){if(this.value=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{if(h.value&&h.value.length||(h.value=[]),(Z&7)===2)for(var N=o.uint32()+o.pos;o.pos>>3){case 1:{h.citationSources&&h.citationSources.length||(h.citationSources=[]),h.citationSources.push(I.google.ai.generativelanguage.v1beta3.CitationSource.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.citationSources!=null&&o.hasOwnProperty("citationSources")){if(!Array.isArray(o.citationSources))return"citationSources: array expected";for(var d=0;d>>3){case 1:{Z.startIndex=d.int32();break}case 2:{Z.endIndex=d.int32();break}case 3:{Z.uri=d.string();break}case 4:{Z.license=d.string();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};return d.startIndex!=null&&d.hasOwnProperty("startIndex")&&(b._startIndex=1,!l.isInteger(d.startIndex))?"startIndex: integer expected":d.endIndex!=null&&d.hasOwnProperty("endIndex")&&(b._endIndex=1,!l.isInteger(d.endIndex))?"endIndex: integer expected":d.uri!=null&&d.hasOwnProperty("uri")&&(b._uri=1,!l.isString(d.uri))?"uri: string expected":d.license!=null&&d.hasOwnProperty("license")&&(b._license=1,!l.isString(d.license))?"license: string expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.CitationSource)return d;var b=new I.google.ai.generativelanguage.v1beta3.CitationSource;return d.startIndex!=null&&(b.startIndex=d.startIndex|0),d.endIndex!=null&&(b.endIndex=d.endIndex|0),d.uri!=null&&(b.uri=String(d.uri)),d.license!=null&&(b.license=String(d.license)),b},r.toObject=function(d,b){b||(b={});var h={};return d.startIndex!=null&&d.hasOwnProperty("startIndex")&&(h.startIndex=d.startIndex,b.oneofs&&(h._startIndex="startIndex")),d.endIndex!=null&&d.hasOwnProperty("endIndex")&&(h.endIndex=d.endIndex,b.oneofs&&(h._endIndex="endIndex")),d.uri!=null&&d.hasOwnProperty("uri")&&(h.uri=d.uri,b.oneofs&&(h._uri="uri")),d.license!=null&&d.hasOwnProperty("license")&&(h.license=d.license,b.oneofs&&(h._license="license")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.CitationSource"},r}(),s.DiscussService=function(){function r(u,o,d){t.rpc.Service.call(this,u,o,d)}return(r.prototype=Object.create(t.rpc.Service.prototype)).constructor=r,r.create=function(o,d,b){return new this(o,d,b)},Object.defineProperty(r.prototype.generateMessage=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.GenerateMessageRequest,I.google.ai.generativelanguage.v1beta3.GenerateMessageResponse,o,d)},"name",{value:"GenerateMessage"}),Object.defineProperty(r.prototype.countMessageTokens=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest,I.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse,o,d)},"name",{value:"CountMessageTokens"}),r}(),s.GenerateMessageRequest=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.model=d.string();break}case 2:{Z.prompt=I.google.ai.generativelanguage.v1beta3.MessagePrompt.decode(d,d.uint32());break}case 3:{Z.temperature=d.float();break}case 4:{Z.candidateCount=d.int32();break}case 5:{Z.topP=d.float();break}case 6:{Z.topK=d.int32();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.model!=null&&d.hasOwnProperty("model")&&!l.isString(d.model))return"model: string expected";if(d.prompt!=null&&d.hasOwnProperty("prompt")){var h=I.google.ai.generativelanguage.v1beta3.MessagePrompt.verify(d.prompt);if(h)return"prompt."+h}return d.temperature!=null&&d.hasOwnProperty("temperature")&&(b._temperature=1,typeof d.temperature!="number")?"temperature: number expected":d.candidateCount!=null&&d.hasOwnProperty("candidateCount")&&(b._candidateCount=1,!l.isInteger(d.candidateCount))?"candidateCount: integer expected":d.topP!=null&&d.hasOwnProperty("topP")&&(b._topP=1,typeof d.topP!="number")?"topP: number expected":d.topK!=null&&d.hasOwnProperty("topK")&&(b._topK=1,!l.isInteger(d.topK))?"topK: integer expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.GenerateMessageRequest)return d;var b=new I.google.ai.generativelanguage.v1beta3.GenerateMessageRequest;if(d.model!=null&&(b.model=String(d.model)),d.prompt!=null){if(typeof d.prompt!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageRequest.prompt: object expected");b.prompt=I.google.ai.generativelanguage.v1beta3.MessagePrompt.fromObject(d.prompt)}return d.temperature!=null&&(b.temperature=Number(d.temperature)),d.candidateCount!=null&&(b.candidateCount=d.candidateCount|0),d.topP!=null&&(b.topP=Number(d.topP)),d.topK!=null&&(b.topK=d.topK|0),b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.model="",h.prompt=null),d.model!=null&&d.hasOwnProperty("model")&&(h.model=d.model),d.prompt!=null&&d.hasOwnProperty("prompt")&&(h.prompt=I.google.ai.generativelanguage.v1beta3.MessagePrompt.toObject(d.prompt,b)),d.temperature!=null&&d.hasOwnProperty("temperature")&&(h.temperature=b.json&&!isFinite(d.temperature)?String(d.temperature):d.temperature,b.oneofs&&(h._temperature="temperature")),d.candidateCount!=null&&d.hasOwnProperty("candidateCount")&&(h.candidateCount=d.candidateCount,b.oneofs&&(h._candidateCount="candidateCount")),d.topP!=null&&d.hasOwnProperty("topP")&&(h.topP=b.json&&!isFinite(d.topP)?String(d.topP):d.topP,b.oneofs&&(h._topP="topP")),d.topK!=null&&d.hasOwnProperty("topK")&&(h.topK=d.topK,b.oneofs&&(h._topK="topK")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.GenerateMessageRequest"},r}(),s.GenerateMessageResponse=function(){function r(u){if(this.candidates=[],this.messages=[],this.filters=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.candidates&&h.candidates.length||(h.candidates=[]),h.candidates.push(I.google.ai.generativelanguage.v1beta3.Message.decode(o,o.uint32()));break}case 2:{h.messages&&h.messages.length||(h.messages=[]),h.messages.push(I.google.ai.generativelanguage.v1beta3.Message.decode(o,o.uint32()));break}case 3:{h.filters&&h.filters.length||(h.filters=[]),h.filters.push(I.google.ai.generativelanguage.v1beta3.ContentFilter.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.candidates!=null&&o.hasOwnProperty("candidates")){if(!Array.isArray(o.candidates))return"candidates: array expected";for(var d=0;d>>3){case 1:{Z.author=d.string();break}case 2:{Z.content=d.string();break}case 3:{Z.citationMetadata=I.google.ai.generativelanguage.v1beta3.CitationMetadata.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.author!=null&&d.hasOwnProperty("author")&&!l.isString(d.author))return"author: string expected";if(d.content!=null&&d.hasOwnProperty("content")&&!l.isString(d.content))return"content: string expected";if(d.citationMetadata!=null&&d.hasOwnProperty("citationMetadata")){b._citationMetadata=1;{var h=I.google.ai.generativelanguage.v1beta3.CitationMetadata.verify(d.citationMetadata);if(h)return"citationMetadata."+h}}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.Message)return d;var b=new I.google.ai.generativelanguage.v1beta3.Message;if(d.author!=null&&(b.author=String(d.author)),d.content!=null&&(b.content=String(d.content)),d.citationMetadata!=null){if(typeof d.citationMetadata!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.Message.citationMetadata: object expected");b.citationMetadata=I.google.ai.generativelanguage.v1beta3.CitationMetadata.fromObject(d.citationMetadata)}return b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.author="",h.content=""),d.author!=null&&d.hasOwnProperty("author")&&(h.author=d.author),d.content!=null&&d.hasOwnProperty("content")&&(h.content=d.content),d.citationMetadata!=null&&d.hasOwnProperty("citationMetadata")&&(h.citationMetadata=I.google.ai.generativelanguage.v1beta3.CitationMetadata.toObject(d.citationMetadata,b),b.oneofs&&(h._citationMetadata="citationMetadata")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.Message"},r}(),s.MessagePrompt=function(){function r(u){if(this.examples=[],this.messages=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.context=o.string();break}case 2:{h.examples&&h.examples.length||(h.examples=[]),h.examples.push(I.google.ai.generativelanguage.v1beta3.Example.decode(o,o.uint32()));break}case 3:{h.messages&&h.messages.length||(h.messages=[]),h.messages.push(I.google.ai.generativelanguage.v1beta3.Message.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.context!=null&&o.hasOwnProperty("context")&&!l.isString(o.context))return"context: string expected";if(o.examples!=null&&o.hasOwnProperty("examples")){if(!Array.isArray(o.examples))return"examples: array expected";for(var d=0;d>>3){case 1:{h.input=I.google.ai.generativelanguage.v1beta3.Message.decode(o,o.uint32());break}case 2:{h.output=I.google.ai.generativelanguage.v1beta3.Message.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.input!=null&&o.hasOwnProperty("input")){var d=I.google.ai.generativelanguage.v1beta3.Message.verify(o.input);if(d)return"input."+d}if(o.output!=null&&o.hasOwnProperty("output")){var d=I.google.ai.generativelanguage.v1beta3.Message.verify(o.output);if(d)return"output."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.Example)return o;var d=new I.google.ai.generativelanguage.v1beta3.Example;if(o.input!=null){if(typeof o.input!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.Example.input: object expected");d.input=I.google.ai.generativelanguage.v1beta3.Message.fromObject(o.input)}if(o.output!=null){if(typeof o.output!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.Example.output: object expected");d.output=I.google.ai.generativelanguage.v1beta3.Message.fromObject(o.output)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.input=null,b.output=null),o.input!=null&&o.hasOwnProperty("input")&&(b.input=I.google.ai.generativelanguage.v1beta3.Message.toObject(o.input,d)),o.output!=null&&o.hasOwnProperty("output")&&(b.output=I.google.ai.generativelanguage.v1beta3.Message.toObject(o.output,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.Example"},r}(),s.CountMessageTokensRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.model=o.string();break}case 2:{h.prompt=I.google.ai.generativelanguage.v1beta3.MessagePrompt.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.model!=null&&o.hasOwnProperty("model")&&!l.isString(o.model))return"model: string expected";if(o.prompt!=null&&o.hasOwnProperty("prompt")){var d=I.google.ai.generativelanguage.v1beta3.MessagePrompt.verify(o.prompt);if(d)return"prompt."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest;if(o.model!=null&&(d.model=String(o.model)),o.prompt!=null){if(typeof o.prompt!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.prompt: object expected");d.prompt=I.google.ai.generativelanguage.v1beta3.MessagePrompt.fromObject(o.prompt)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.model="",b.prompt=null),o.model!=null&&o.hasOwnProperty("model")&&(b.model=o.model),o.prompt!=null&&o.hasOwnProperty("prompt")&&(b.prompt=I.google.ai.generativelanguage.v1beta3.MessagePrompt.toObject(o.prompt,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.CountMessageTokensRequest"},r}(),s.CountMessageTokensResponse=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.tokenCount=o.int32();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.tokenCount!=null&&o.hasOwnProperty("tokenCount")&&!l.isInteger(o.tokenCount)?"tokenCount: integer expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse)return o;var d=new I.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse;return o.tokenCount!=null&&(d.tokenCount=o.tokenCount|0),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.tokenCount=0),o.tokenCount!=null&&o.hasOwnProperty("tokenCount")&&(b.tokenCount=o.tokenCount),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.CountMessageTokensResponse"},r}(),s.HarmCategory=function(){var r={},u=Object.create(r);return u[r[0]="HARM_CATEGORY_UNSPECIFIED"]=0,u[r[1]="HARM_CATEGORY_DEROGATORY"]=1,u[r[2]="HARM_CATEGORY_TOXICITY"]=2,u[r[3]="HARM_CATEGORY_VIOLENCE"]=3,u[r[4]="HARM_CATEGORY_SEXUAL"]=4,u[r[5]="HARM_CATEGORY_MEDICAL"]=5,u[r[6]="HARM_CATEGORY_DANGEROUS"]=6,u}(),s.ContentFilter=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.reason=d.int32();break}case 2:{Z.message=d.string();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.reason!=null&&d.hasOwnProperty("reason"))switch(d.reason){default:return"reason: enum value expected";case 0:case 1:case 2:break}return d.message!=null&&d.hasOwnProperty("message")&&(b._message=1,!l.isString(d.message))?"message: string expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.ContentFilter)return d;var b=new I.google.ai.generativelanguage.v1beta3.ContentFilter;switch(d.reason){default:if(typeof d.reason=="number"){b.reason=d.reason;break}break;case"BLOCKED_REASON_UNSPECIFIED":case 0:b.reason=0;break;case"SAFETY":case 1:b.reason=1;break;case"OTHER":case 2:b.reason=2;break}return d.message!=null&&(b.message=String(d.message)),b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.reason=b.enums===String?"BLOCKED_REASON_UNSPECIFIED":0),d.reason!=null&&d.hasOwnProperty("reason")&&(h.reason=b.enums===String?I.google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason[d.reason]===void 0?d.reason:I.google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason[d.reason]:d.reason),d.message!=null&&d.hasOwnProperty("message")&&(h.message=d.message,b.oneofs&&(h._message="message")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.ContentFilter"},r.BlockedReason=function(){var o={},d=Object.create(o);return d[o[0]="BLOCKED_REASON_UNSPECIFIED"]=0,d[o[1]="SAFETY"]=1,d[o[2]="OTHER"]=2,d}(),r}(),s.SafetyFeedback=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.rating=I.google.ai.generativelanguage.v1beta3.SafetyRating.decode(o,o.uint32());break}case 2:{h.setting=I.google.ai.generativelanguage.v1beta3.SafetySetting.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.rating!=null&&o.hasOwnProperty("rating")){var d=I.google.ai.generativelanguage.v1beta3.SafetyRating.verify(o.rating);if(d)return"rating."+d}if(o.setting!=null&&o.hasOwnProperty("setting")){var d=I.google.ai.generativelanguage.v1beta3.SafetySetting.verify(o.setting);if(d)return"setting."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.SafetyFeedback)return o;var d=new I.google.ai.generativelanguage.v1beta3.SafetyFeedback;if(o.rating!=null){if(typeof o.rating!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.SafetyFeedback.rating: object expected");d.rating=I.google.ai.generativelanguage.v1beta3.SafetyRating.fromObject(o.rating)}if(o.setting!=null){if(typeof o.setting!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.SafetyFeedback.setting: object expected");d.setting=I.google.ai.generativelanguage.v1beta3.SafetySetting.fromObject(o.setting)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.rating=null,b.setting=null),o.rating!=null&&o.hasOwnProperty("rating")&&(b.rating=I.google.ai.generativelanguage.v1beta3.SafetyRating.toObject(o.rating,d)),o.setting!=null&&o.hasOwnProperty("setting")&&(b.setting=I.google.ai.generativelanguage.v1beta3.SafetySetting.toObject(o.setting,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.SafetyFeedback"},r}(),s.SafetyRating=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 3:{h.category=o.int32();break}case 4:{h.probability=o.int32();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.category!=null&&o.hasOwnProperty("category"))switch(o.category){default:return"category: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(o.probability!=null&&o.hasOwnProperty("probability"))switch(o.probability){default:return"probability: enum value expected";case 0:case 1:case 2:case 3:case 4:break}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.SafetyRating)return o;var d=new I.google.ai.generativelanguage.v1beta3.SafetyRating;switch(o.category){default:if(typeof o.category=="number"){d.category=o.category;break}break;case"HARM_CATEGORY_UNSPECIFIED":case 0:d.category=0;break;case"HARM_CATEGORY_DEROGATORY":case 1:d.category=1;break;case"HARM_CATEGORY_TOXICITY":case 2:d.category=2;break;case"HARM_CATEGORY_VIOLENCE":case 3:d.category=3;break;case"HARM_CATEGORY_SEXUAL":case 4:d.category=4;break;case"HARM_CATEGORY_MEDICAL":case 5:d.category=5;break;case"HARM_CATEGORY_DANGEROUS":case 6:d.category=6;break}switch(o.probability){default:if(typeof o.probability=="number"){d.probability=o.probability;break}break;case"HARM_PROBABILITY_UNSPECIFIED":case 0:d.probability=0;break;case"NEGLIGIBLE":case 1:d.probability=1;break;case"LOW":case 2:d.probability=2;break;case"MEDIUM":case 3:d.probability=3;break;case"HIGH":case 4:d.probability=4;break}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.category=d.enums===String?"HARM_CATEGORY_UNSPECIFIED":0,b.probability=d.enums===String?"HARM_PROBABILITY_UNSPECIFIED":0),o.category!=null&&o.hasOwnProperty("category")&&(b.category=d.enums===String?I.google.ai.generativelanguage.v1beta3.HarmCategory[o.category]===void 0?o.category:I.google.ai.generativelanguage.v1beta3.HarmCategory[o.category]:o.category),o.probability!=null&&o.hasOwnProperty("probability")&&(b.probability=d.enums===String?I.google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability[o.probability]===void 0?o.probability:I.google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability[o.probability]:o.probability),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.SafetyRating"},r.HarmProbability=function(){var u={},o=Object.create(u);return o[u[0]="HARM_PROBABILITY_UNSPECIFIED"]=0,o[u[1]="NEGLIGIBLE"]=1,o[u[2]="LOW"]=2,o[u[3]="MEDIUM"]=3,o[u[4]="HIGH"]=4,o}(),r}(),s.SafetySetting=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 3:{h.category=o.int32();break}case 4:{h.threshold=o.int32();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.category!=null&&o.hasOwnProperty("category"))switch(o.category){default:return"category: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(o.threshold!=null&&o.hasOwnProperty("threshold"))switch(o.threshold){default:return"threshold: enum value expected";case 0:case 1:case 2:case 3:case 4:break}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.SafetySetting)return o;var d=new I.google.ai.generativelanguage.v1beta3.SafetySetting;switch(o.category){default:if(typeof o.category=="number"){d.category=o.category;break}break;case"HARM_CATEGORY_UNSPECIFIED":case 0:d.category=0;break;case"HARM_CATEGORY_DEROGATORY":case 1:d.category=1;break;case"HARM_CATEGORY_TOXICITY":case 2:d.category=2;break;case"HARM_CATEGORY_VIOLENCE":case 3:d.category=3;break;case"HARM_CATEGORY_SEXUAL":case 4:d.category=4;break;case"HARM_CATEGORY_MEDICAL":case 5:d.category=5;break;case"HARM_CATEGORY_DANGEROUS":case 6:d.category=6;break}switch(o.threshold){default:if(typeof o.threshold=="number"){d.threshold=o.threshold;break}break;case"HARM_BLOCK_THRESHOLD_UNSPECIFIED":case 0:d.threshold=0;break;case"BLOCK_LOW_AND_ABOVE":case 1:d.threshold=1;break;case"BLOCK_MEDIUM_AND_ABOVE":case 2:d.threshold=2;break;case"BLOCK_ONLY_HIGH":case 3:d.threshold=3;break;case"BLOCK_NONE":case 4:d.threshold=4;break}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.category=d.enums===String?"HARM_CATEGORY_UNSPECIFIED":0,b.threshold=d.enums===String?"HARM_BLOCK_THRESHOLD_UNSPECIFIED":0),o.category!=null&&o.hasOwnProperty("category")&&(b.category=d.enums===String?I.google.ai.generativelanguage.v1beta3.HarmCategory[o.category]===void 0?o.category:I.google.ai.generativelanguage.v1beta3.HarmCategory[o.category]:o.category),o.threshold!=null&&o.hasOwnProperty("threshold")&&(b.threshold=d.enums===String?I.google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold[o.threshold]===void 0?o.threshold:I.google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold[o.threshold]:o.threshold),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.SafetySetting"},r.HarmBlockThreshold=function(){var u={},o=Object.create(u);return o[u[0]="HARM_BLOCK_THRESHOLD_UNSPECIFIED"]=0,o[u[1]="BLOCK_LOW_AND_ABOVE"]=1,o[u[2]="BLOCK_MEDIUM_AND_ABOVE"]=2,o[u[3]="BLOCK_ONLY_HIGH"]=3,o[u[4]="BLOCK_NONE"]=4,o}(),r}(),s.Model=function(){function r(o){if(this.supportedGenerationMethods=[],o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.name=d.string();break}case 2:{Z.baseModelId=d.string();break}case 3:{Z.version=d.string();break}case 4:{Z.displayName=d.string();break}case 5:{Z.description=d.string();break}case 6:{Z.inputTokenLimit=d.int32();break}case 7:{Z.outputTokenLimit=d.int32();break}case 8:{Z.supportedGenerationMethods&&Z.supportedGenerationMethods.length||(Z.supportedGenerationMethods=[]),Z.supportedGenerationMethods.push(d.string());break}case 9:{Z.temperature=d.float();break}case 10:{Z.topP=d.float();break}case 11:{Z.topK=d.int32();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.name!=null&&d.hasOwnProperty("name")&&!l.isString(d.name))return"name: string expected";if(d.baseModelId!=null&&d.hasOwnProperty("baseModelId")&&!l.isString(d.baseModelId))return"baseModelId: string expected";if(d.version!=null&&d.hasOwnProperty("version")&&!l.isString(d.version))return"version: string expected";if(d.displayName!=null&&d.hasOwnProperty("displayName")&&!l.isString(d.displayName))return"displayName: string expected";if(d.description!=null&&d.hasOwnProperty("description")&&!l.isString(d.description))return"description: string expected";if(d.inputTokenLimit!=null&&d.hasOwnProperty("inputTokenLimit")&&!l.isInteger(d.inputTokenLimit))return"inputTokenLimit: integer expected";if(d.outputTokenLimit!=null&&d.hasOwnProperty("outputTokenLimit")&&!l.isInteger(d.outputTokenLimit))return"outputTokenLimit: integer expected";if(d.supportedGenerationMethods!=null&&d.hasOwnProperty("supportedGenerationMethods")){if(!Array.isArray(d.supportedGenerationMethods))return"supportedGenerationMethods: array expected";for(var h=0;h>>3){case 1:{h.name=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.name!=null&&o.hasOwnProperty("name")&&!l.isString(o.name)?"name: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.GetModelRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.GetModelRequest;return o.name!=null&&(d.name=String(o.name)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.name=""),o.name!=null&&o.hasOwnProperty("name")&&(b.name=o.name),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.GetModelRequest"},r}(),s.ListModelsRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 2:{h.pageSize=o.int32();break}case 3:{h.pageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.pageSize!=null&&o.hasOwnProperty("pageSize")&&!l.isInteger(o.pageSize)?"pageSize: integer expected":o.pageToken!=null&&o.hasOwnProperty("pageToken")&&!l.isString(o.pageToken)?"pageToken: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.ListModelsRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.ListModelsRequest;return o.pageSize!=null&&(d.pageSize=o.pageSize|0),o.pageToken!=null&&(d.pageToken=String(o.pageToken)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.pageSize=0,b.pageToken=""),o.pageSize!=null&&o.hasOwnProperty("pageSize")&&(b.pageSize=o.pageSize),o.pageToken!=null&&o.hasOwnProperty("pageToken")&&(b.pageToken=o.pageToken),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.ListModelsRequest"},r}(),s.ListModelsResponse=function(){function r(u){if(this.models=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.models&&h.models.length||(h.models=[]),h.models.push(I.google.ai.generativelanguage.v1beta3.Model.decode(o,o.uint32()));break}case 2:{h.nextPageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.models!=null&&o.hasOwnProperty("models")){if(!Array.isArray(o.models))return"models: array expected";for(var d=0;d>>3){case 1:{h.name=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.name!=null&&o.hasOwnProperty("name")&&!l.isString(o.name)?"name: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.GetTunedModelRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.GetTunedModelRequest;return o.name!=null&&(d.name=String(o.name)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.name=""),o.name!=null&&o.hasOwnProperty("name")&&(b.name=o.name),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.GetTunedModelRequest"},r}(),s.ListTunedModelsRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.pageSize=o.int32();break}case 2:{h.pageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.pageSize!=null&&o.hasOwnProperty("pageSize")&&!l.isInteger(o.pageSize)?"pageSize: integer expected":o.pageToken!=null&&o.hasOwnProperty("pageToken")&&!l.isString(o.pageToken)?"pageToken: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest;return o.pageSize!=null&&(d.pageSize=o.pageSize|0),o.pageToken!=null&&(d.pageToken=String(o.pageToken)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.pageSize=0,b.pageToken=""),o.pageSize!=null&&o.hasOwnProperty("pageSize")&&(b.pageSize=o.pageSize),o.pageToken!=null&&o.hasOwnProperty("pageToken")&&(b.pageToken=o.pageToken),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.ListTunedModelsRequest"},r}(),s.ListTunedModelsResponse=function(){function r(u){if(this.tunedModels=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.tunedModels&&h.tunedModels.length||(h.tunedModels=[]),h.tunedModels.push(I.google.ai.generativelanguage.v1beta3.TunedModel.decode(o,o.uint32()));break}case 2:{h.nextPageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.tunedModels!=null&&o.hasOwnProperty("tunedModels")){if(!Array.isArray(o.tunedModels))return"tunedModels: array expected";for(var d=0;d>>3){case 1:{Z.tunedModelId=d.string();break}case 2:{Z.tunedModel=I.google.ai.generativelanguage.v1beta3.TunedModel.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.tunedModelId!=null&&d.hasOwnProperty("tunedModelId")&&(b._tunedModelId=1,!l.isString(d.tunedModelId)))return"tunedModelId: string expected";if(d.tunedModel!=null&&d.hasOwnProperty("tunedModel")){var h=I.google.ai.generativelanguage.v1beta3.TunedModel.verify(d.tunedModel);if(h)return"tunedModel."+h}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest)return d;var b=new I.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest;if(d.tunedModelId!=null&&(b.tunedModelId=String(d.tunedModelId)),d.tunedModel!=null){if(typeof d.tunedModel!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.tunedModel: object expected");b.tunedModel=I.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(d.tunedModel)}return b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.tunedModel=null),d.tunedModelId!=null&&d.hasOwnProperty("tunedModelId")&&(h.tunedModelId=d.tunedModelId,b.oneofs&&(h._tunedModelId="tunedModelId")),d.tunedModel!=null&&d.hasOwnProperty("tunedModel")&&(h.tunedModel=I.google.ai.generativelanguage.v1beta3.TunedModel.toObject(d.tunedModel,b)),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.CreateTunedModelRequest"},r}(),s.CreateTunedModelMetadata=function(){function r(u){if(this.snapshots=[],u)for(var o=Object.keys(u),d=0;d>>3){case 5:{h.tunedModel=o.string();break}case 1:{h.totalSteps=o.int32();break}case 2:{h.completedSteps=o.int32();break}case 3:{h.completedPercent=o.float();break}case 4:{h.snapshots&&h.snapshots.length||(h.snapshots=[]),h.snapshots.push(I.google.ai.generativelanguage.v1beta3.TuningSnapshot.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.tunedModel!=null&&o.hasOwnProperty("tunedModel")&&!l.isString(o.tunedModel))return"tunedModel: string expected";if(o.totalSteps!=null&&o.hasOwnProperty("totalSteps")&&!l.isInteger(o.totalSteps))return"totalSteps: integer expected";if(o.completedSteps!=null&&o.hasOwnProperty("completedSteps")&&!l.isInteger(o.completedSteps))return"completedSteps: integer expected";if(o.completedPercent!=null&&o.hasOwnProperty("completedPercent")&&typeof o.completedPercent!="number")return"completedPercent: number expected";if(o.snapshots!=null&&o.hasOwnProperty("snapshots")){if(!Array.isArray(o.snapshots))return"snapshots: array expected";for(var d=0;d>>3){case 1:{h.tunedModel=I.google.ai.generativelanguage.v1beta3.TunedModel.decode(o,o.uint32());break}case 2:{h.updateMask=I.google.protobuf.FieldMask.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.tunedModel!=null&&o.hasOwnProperty("tunedModel")){var d=I.google.ai.generativelanguage.v1beta3.TunedModel.verify(o.tunedModel);if(d)return"tunedModel."+d}if(o.updateMask!=null&&o.hasOwnProperty("updateMask")){var d=I.google.protobuf.FieldMask.verify(o.updateMask);if(d)return"updateMask."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest;if(o.tunedModel!=null){if(typeof o.tunedModel!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.tunedModel: object expected");d.tunedModel=I.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(o.tunedModel)}if(o.updateMask!=null){if(typeof o.updateMask!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.updateMask: object expected");d.updateMask=I.google.protobuf.FieldMask.fromObject(o.updateMask)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.tunedModel=null,b.updateMask=null),o.tunedModel!=null&&o.hasOwnProperty("tunedModel")&&(b.tunedModel=I.google.ai.generativelanguage.v1beta3.TunedModel.toObject(o.tunedModel,d)),o.updateMask!=null&&o.hasOwnProperty("updateMask")&&(b.updateMask=I.google.protobuf.FieldMask.toObject(o.updateMask,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest"},r}(),s.DeleteTunedModelRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.name=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.name!=null&&o.hasOwnProperty("name")&&!l.isString(o.name)?"name: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest;return o.name!=null&&(d.name=String(o.name)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.name=""),o.name!=null&&o.hasOwnProperty("name")&&(b.name=o.name),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest"},r}(),s.TunedModel=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 3:{Z.tunedModelSource=I.google.ai.generativelanguage.v1beta3.TunedModelSource.decode(d,d.uint32());break}case 4:{Z.baseModel=d.string();break}case 1:{Z.name=d.string();break}case 5:{Z.displayName=d.string();break}case 6:{Z.description=d.string();break}case 11:{Z.temperature=d.float();break}case 12:{Z.topP=d.float();break}case 13:{Z.topK=d.int32();break}case 7:{Z.state=d.int32();break}case 8:{Z.createTime=I.google.protobuf.Timestamp.decode(d,d.uint32());break}case 9:{Z.updateTime=I.google.protobuf.Timestamp.decode(d,d.uint32());break}case 10:{Z.tuningTask=I.google.ai.generativelanguage.v1beta3.TuningTask.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.tunedModelSource!=null&&d.hasOwnProperty("tunedModelSource")){b.sourceModel=1;{var h=I.google.ai.generativelanguage.v1beta3.TunedModelSource.verify(d.tunedModelSource);if(h)return"tunedModelSource."+h}}if(d.baseModel!=null&&d.hasOwnProperty("baseModel")){if(b.sourceModel===1)return"sourceModel: multiple values";if(b.sourceModel=1,!l.isString(d.baseModel))return"baseModel: string expected"}if(d.name!=null&&d.hasOwnProperty("name")&&!l.isString(d.name))return"name: string expected";if(d.displayName!=null&&d.hasOwnProperty("displayName")&&!l.isString(d.displayName))return"displayName: string expected";if(d.description!=null&&d.hasOwnProperty("description")&&!l.isString(d.description))return"description: string expected";if(d.temperature!=null&&d.hasOwnProperty("temperature")&&(b._temperature=1,typeof d.temperature!="number"))return"temperature: number expected";if(d.topP!=null&&d.hasOwnProperty("topP")&&(b._topP=1,typeof d.topP!="number"))return"topP: number expected";if(d.topK!=null&&d.hasOwnProperty("topK")&&(b._topK=1,!l.isInteger(d.topK)))return"topK: integer expected";if(d.state!=null&&d.hasOwnProperty("state"))switch(d.state){default:return"state: enum value expected";case 0:case 1:case 2:case 3:break}if(d.createTime!=null&&d.hasOwnProperty("createTime")){var h=I.google.protobuf.Timestamp.verify(d.createTime);if(h)return"createTime."+h}if(d.updateTime!=null&&d.hasOwnProperty("updateTime")){var h=I.google.protobuf.Timestamp.verify(d.updateTime);if(h)return"updateTime."+h}if(d.tuningTask!=null&&d.hasOwnProperty("tuningTask")){var h=I.google.ai.generativelanguage.v1beta3.TuningTask.verify(d.tuningTask);if(h)return"tuningTask."+h}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.TunedModel)return d;var b=new I.google.ai.generativelanguage.v1beta3.TunedModel;if(d.tunedModelSource!=null){if(typeof d.tunedModelSource!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.tunedModelSource: object expected");b.tunedModelSource=I.google.ai.generativelanguage.v1beta3.TunedModelSource.fromObject(d.tunedModelSource)}switch(d.baseModel!=null&&(b.baseModel=String(d.baseModel)),d.name!=null&&(b.name=String(d.name)),d.displayName!=null&&(b.displayName=String(d.displayName)),d.description!=null&&(b.description=String(d.description)),d.temperature!=null&&(b.temperature=Number(d.temperature)),d.topP!=null&&(b.topP=Number(d.topP)),d.topK!=null&&(b.topK=d.topK|0),d.state){default:if(typeof d.state=="number"){b.state=d.state;break}break;case"STATE_UNSPECIFIED":case 0:b.state=0;break;case"CREATING":case 1:b.state=1;break;case"ACTIVE":case 2:b.state=2;break;case"FAILED":case 3:b.state=3;break}if(d.createTime!=null){if(typeof d.createTime!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.createTime: object expected");b.createTime=I.google.protobuf.Timestamp.fromObject(d.createTime)}if(d.updateTime!=null){if(typeof d.updateTime!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.updateTime: object expected");b.updateTime=I.google.protobuf.Timestamp.fromObject(d.updateTime)}if(d.tuningTask!=null){if(typeof d.tuningTask!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.tuningTask: object expected");b.tuningTask=I.google.ai.generativelanguage.v1beta3.TuningTask.fromObject(d.tuningTask)}return b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.name="",h.displayName="",h.description="",h.state=b.enums===String?"STATE_UNSPECIFIED":0,h.createTime=null,h.updateTime=null,h.tuningTask=null),d.name!=null&&d.hasOwnProperty("name")&&(h.name=d.name),d.tunedModelSource!=null&&d.hasOwnProperty("tunedModelSource")&&(h.tunedModelSource=I.google.ai.generativelanguage.v1beta3.TunedModelSource.toObject(d.tunedModelSource,b),b.oneofs&&(h.sourceModel="tunedModelSource")),d.baseModel!=null&&d.hasOwnProperty("baseModel")&&(h.baseModel=d.baseModel,b.oneofs&&(h.sourceModel="baseModel")),d.displayName!=null&&d.hasOwnProperty("displayName")&&(h.displayName=d.displayName),d.description!=null&&d.hasOwnProperty("description")&&(h.description=d.description),d.state!=null&&d.hasOwnProperty("state")&&(h.state=b.enums===String?I.google.ai.generativelanguage.v1beta3.TunedModel.State[d.state]===void 0?d.state:I.google.ai.generativelanguage.v1beta3.TunedModel.State[d.state]:d.state),d.createTime!=null&&d.hasOwnProperty("createTime")&&(h.createTime=I.google.protobuf.Timestamp.toObject(d.createTime,b)),d.updateTime!=null&&d.hasOwnProperty("updateTime")&&(h.updateTime=I.google.protobuf.Timestamp.toObject(d.updateTime,b)),d.tuningTask!=null&&d.hasOwnProperty("tuningTask")&&(h.tuningTask=I.google.ai.generativelanguage.v1beta3.TuningTask.toObject(d.tuningTask,b)),d.temperature!=null&&d.hasOwnProperty("temperature")&&(h.temperature=b.json&&!isFinite(d.temperature)?String(d.temperature):d.temperature,b.oneofs&&(h._temperature="temperature")),d.topP!=null&&d.hasOwnProperty("topP")&&(h.topP=b.json&&!isFinite(d.topP)?String(d.topP):d.topP,b.oneofs&&(h._topP="topP")),d.topK!=null&&d.hasOwnProperty("topK")&&(h.topK=d.topK,b.oneofs&&(h._topK="topK")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.TunedModel"},r.State=function(){var o={},d=Object.create(o);return d[o[0]="STATE_UNSPECIFIED"]=0,d[o[1]="CREATING"]=1,d[o[2]="ACTIVE"]=2,d[o[3]="FAILED"]=3,d}(),r}(),s.TunedModelSource=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.tunedModel=o.string();break}case 2:{h.baseModel=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.tunedModel!=null&&o.hasOwnProperty("tunedModel")&&!l.isString(o.tunedModel)?"tunedModel: string expected":o.baseModel!=null&&o.hasOwnProperty("baseModel")&&!l.isString(o.baseModel)?"baseModel: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.TunedModelSource)return o;var d=new I.google.ai.generativelanguage.v1beta3.TunedModelSource;return o.tunedModel!=null&&(d.tunedModel=String(o.tunedModel)),o.baseModel!=null&&(d.baseModel=String(o.baseModel)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.tunedModel="",b.baseModel=""),o.tunedModel!=null&&o.hasOwnProperty("tunedModel")&&(b.tunedModel=o.tunedModel),o.baseModel!=null&&o.hasOwnProperty("baseModel")&&(b.baseModel=o.baseModel),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.TunedModelSource"},r}(),s.TuningTask=function(){function r(u){if(this.snapshots=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.startTime=I.google.protobuf.Timestamp.decode(o,o.uint32());break}case 2:{h.completeTime=I.google.protobuf.Timestamp.decode(o,o.uint32());break}case 3:{h.snapshots&&h.snapshots.length||(h.snapshots=[]),h.snapshots.push(I.google.ai.generativelanguage.v1beta3.TuningSnapshot.decode(o,o.uint32()));break}case 4:{h.trainingData=I.google.ai.generativelanguage.v1beta3.Dataset.decode(o,o.uint32());break}case 5:{h.hyperparameters=I.google.ai.generativelanguage.v1beta3.Hyperparameters.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.startTime!=null&&o.hasOwnProperty("startTime")){var d=I.google.protobuf.Timestamp.verify(o.startTime);if(d)return"startTime."+d}if(o.completeTime!=null&&o.hasOwnProperty("completeTime")){var d=I.google.protobuf.Timestamp.verify(o.completeTime);if(d)return"completeTime."+d}if(o.snapshots!=null&&o.hasOwnProperty("snapshots")){if(!Array.isArray(o.snapshots))return"snapshots: array expected";for(var b=0;b>>3){case 14:{Z.epochCount=d.int32();break}case 15:{Z.batchSize=d.int32();break}case 16:{Z.learningRate=d.float();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};return d.epochCount!=null&&d.hasOwnProperty("epochCount")&&(b._epochCount=1,!l.isInteger(d.epochCount))?"epochCount: integer expected":d.batchSize!=null&&d.hasOwnProperty("batchSize")&&(b._batchSize=1,!l.isInteger(d.batchSize))?"batchSize: integer expected":d.learningRate!=null&&d.hasOwnProperty("learningRate")&&(b._learningRate=1,typeof d.learningRate!="number")?"learningRate: number expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.Hyperparameters)return d;var b=new I.google.ai.generativelanguage.v1beta3.Hyperparameters;return d.epochCount!=null&&(b.epochCount=d.epochCount|0),d.batchSize!=null&&(b.batchSize=d.batchSize|0),d.learningRate!=null&&(b.learningRate=Number(d.learningRate)),b},r.toObject=function(d,b){b||(b={});var h={};return d.epochCount!=null&&d.hasOwnProperty("epochCount")&&(h.epochCount=d.epochCount,b.oneofs&&(h._epochCount="epochCount")),d.batchSize!=null&&d.hasOwnProperty("batchSize")&&(h.batchSize=d.batchSize,b.oneofs&&(h._batchSize="batchSize")),d.learningRate!=null&&d.hasOwnProperty("learningRate")&&(h.learningRate=b.json&&!isFinite(d.learningRate)?String(d.learningRate):d.learningRate,b.oneofs&&(h._learningRate="learningRate")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.Hyperparameters"},r}(),s.Dataset=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.examples=I.google.ai.generativelanguage.v1beta3.TuningExamples.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.examples!=null&&d.hasOwnProperty("examples")){b.dataset=1;{var h=I.google.ai.generativelanguage.v1beta3.TuningExamples.verify(d.examples);if(h)return"examples."+h}}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.Dataset)return d;var b=new I.google.ai.generativelanguage.v1beta3.Dataset;if(d.examples!=null){if(typeof d.examples!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.Dataset.examples: object expected");b.examples=I.google.ai.generativelanguage.v1beta3.TuningExamples.fromObject(d.examples)}return b},r.toObject=function(d,b){b||(b={});var h={};return d.examples!=null&&d.hasOwnProperty("examples")&&(h.examples=I.google.ai.generativelanguage.v1beta3.TuningExamples.toObject(d.examples,b),b.oneofs&&(h.dataset="examples")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.Dataset"},r}(),s.TuningExamples=function(){function r(u){if(this.examples=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.examples&&h.examples.length||(h.examples=[]),h.examples.push(I.google.ai.generativelanguage.v1beta3.TuningExample.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.examples!=null&&o.hasOwnProperty("examples")){if(!Array.isArray(o.examples))return"examples: array expected";for(var d=0;d>>3){case 1:{Z.textInput=d.string();break}case 3:{Z.output=d.string();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};return d.textInput!=null&&d.hasOwnProperty("textInput")&&(b.modelInput=1,!l.isString(d.textInput))?"textInput: string expected":d.output!=null&&d.hasOwnProperty("output")&&!l.isString(d.output)?"output: string expected":null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.TuningExample)return d;var b=new I.google.ai.generativelanguage.v1beta3.TuningExample;return d.textInput!=null&&(b.textInput=String(d.textInput)),d.output!=null&&(b.output=String(d.output)),b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.output=""),d.textInput!=null&&d.hasOwnProperty("textInput")&&(h.textInput=d.textInput,b.oneofs&&(h.modelInput="textInput")),d.output!=null&&d.hasOwnProperty("output")&&(h.output=d.output),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.TuningExample"},r}(),s.TuningSnapshot=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.step=o.int32();break}case 2:{h.epoch=o.int32();break}case 3:{h.meanLoss=o.float();break}case 4:{h.computeTime=I.google.protobuf.Timestamp.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.step!=null&&o.hasOwnProperty("step")&&!l.isInteger(o.step))return"step: integer expected";if(o.epoch!=null&&o.hasOwnProperty("epoch")&&!l.isInteger(o.epoch))return"epoch: integer expected";if(o.meanLoss!=null&&o.hasOwnProperty("meanLoss")&&typeof o.meanLoss!="number")return"meanLoss: number expected";if(o.computeTime!=null&&o.hasOwnProperty("computeTime")){var d=I.google.protobuf.Timestamp.verify(o.computeTime);if(d)return"computeTime."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.TuningSnapshot)return o;var d=new I.google.ai.generativelanguage.v1beta3.TuningSnapshot;if(o.step!=null&&(d.step=o.step|0),o.epoch!=null&&(d.epoch=o.epoch|0),o.meanLoss!=null&&(d.meanLoss=Number(o.meanLoss)),o.computeTime!=null){if(typeof o.computeTime!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.TuningSnapshot.computeTime: object expected");d.computeTime=I.google.protobuf.Timestamp.fromObject(o.computeTime)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.step=0,b.epoch=0,b.meanLoss=0,b.computeTime=null),o.step!=null&&o.hasOwnProperty("step")&&(b.step=o.step),o.epoch!=null&&o.hasOwnProperty("epoch")&&(b.epoch=o.epoch),o.meanLoss!=null&&o.hasOwnProperty("meanLoss")&&(b.meanLoss=d.json&&!isFinite(o.meanLoss)?String(o.meanLoss):o.meanLoss),o.computeTime!=null&&o.hasOwnProperty("computeTime")&&(b.computeTime=I.google.protobuf.Timestamp.toObject(o.computeTime,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.TuningSnapshot"},r}(),s.Permission=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.name=d.string();break}case 2:{Z.granteeType=d.int32();break}case 3:{Z.emailAddress=d.string();break}case 4:{Z.role=d.int32();break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.name!=null&&d.hasOwnProperty("name")&&!l.isString(d.name))return"name: string expected";if(d.granteeType!=null&&d.hasOwnProperty("granteeType"))switch(b._granteeType=1,d.granteeType){default:return"granteeType: enum value expected";case 0:case 1:case 2:case 3:break}if(d.emailAddress!=null&&d.hasOwnProperty("emailAddress")&&(b._emailAddress=1,!l.isString(d.emailAddress)))return"emailAddress: string expected";if(d.role!=null&&d.hasOwnProperty("role"))switch(b._role=1,d.role){default:return"role: enum value expected";case 0:case 1:case 2:case 3:break}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.Permission)return d;var b=new I.google.ai.generativelanguage.v1beta3.Permission;switch(d.name!=null&&(b.name=String(d.name)),d.granteeType){default:if(typeof d.granteeType=="number"){b.granteeType=d.granteeType;break}break;case"GRANTEE_TYPE_UNSPECIFIED":case 0:b.granteeType=0;break;case"USER":case 1:b.granteeType=1;break;case"GROUP":case 2:b.granteeType=2;break;case"EVERYONE":case 3:b.granteeType=3;break}switch(d.emailAddress!=null&&(b.emailAddress=String(d.emailAddress)),d.role){default:if(typeof d.role=="number"){b.role=d.role;break}break;case"ROLE_UNSPECIFIED":case 0:b.role=0;break;case"OWNER":case 1:b.role=1;break;case"WRITER":case 2:b.role=2;break;case"READER":case 3:b.role=3;break}return b},r.toObject=function(d,b){b||(b={});var h={};return b.defaults&&(h.name=""),d.name!=null&&d.hasOwnProperty("name")&&(h.name=d.name),d.granteeType!=null&&d.hasOwnProperty("granteeType")&&(h.granteeType=b.enums===String?I.google.ai.generativelanguage.v1beta3.Permission.GranteeType[d.granteeType]===void 0?d.granteeType:I.google.ai.generativelanguage.v1beta3.Permission.GranteeType[d.granteeType]:d.granteeType,b.oneofs&&(h._granteeType="granteeType")),d.emailAddress!=null&&d.hasOwnProperty("emailAddress")&&(h.emailAddress=d.emailAddress,b.oneofs&&(h._emailAddress="emailAddress")),d.role!=null&&d.hasOwnProperty("role")&&(h.role=b.enums===String?I.google.ai.generativelanguage.v1beta3.Permission.Role[d.role]===void 0?d.role:I.google.ai.generativelanguage.v1beta3.Permission.Role[d.role]:d.role,b.oneofs&&(h._role="role")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.Permission"},r.GranteeType=function(){var o={},d=Object.create(o);return d[o[0]="GRANTEE_TYPE_UNSPECIFIED"]=0,d[o[1]="USER"]=1,d[o[2]="GROUP"]=2,d[o[3]="EVERYONE"]=3,d}(),r.Role=function(){var o={},d=Object.create(o);return d[o[0]="ROLE_UNSPECIFIED"]=0,d[o[1]="OWNER"]=1,d[o[2]="WRITER"]=2,d[o[3]="READER"]=3,d}(),r}(),s.PermissionService=function(){function r(u,o,d){t.rpc.Service.call(this,u,o,d)}return(r.prototype=Object.create(t.rpc.Service.prototype)).constructor=r,r.create=function(o,d,b){return new this(o,d,b)},Object.defineProperty(r.prototype.createPermission=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.CreatePermissionRequest,I.google.ai.generativelanguage.v1beta3.Permission,o,d)},"name",{value:"CreatePermission"}),Object.defineProperty(r.prototype.getPermission=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.GetPermissionRequest,I.google.ai.generativelanguage.v1beta3.Permission,o,d)},"name",{value:"GetPermission"}),Object.defineProperty(r.prototype.listPermissions=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.ListPermissionsRequest,I.google.ai.generativelanguage.v1beta3.ListPermissionsResponse,o,d)},"name",{value:"ListPermissions"}),Object.defineProperty(r.prototype.updatePermission=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest,I.google.ai.generativelanguage.v1beta3.Permission,o,d)},"name",{value:"UpdatePermission"}),Object.defineProperty(r.prototype.deletePermission=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.DeletePermissionRequest,I.google.protobuf.Empty,o,d)},"name",{value:"DeletePermission"}),Object.defineProperty(r.prototype.transferOwnership=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest,I.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse,o,d)},"name",{value:"TransferOwnership"}),r}(),s.CreatePermissionRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.parent=o.string();break}case 2:{h.permission=I.google.ai.generativelanguage.v1beta3.Permission.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.parent!=null&&o.hasOwnProperty("parent")&&!l.isString(o.parent))return"parent: string expected";if(o.permission!=null&&o.hasOwnProperty("permission")){var d=I.google.ai.generativelanguage.v1beta3.Permission.verify(o.permission);if(d)return"permission."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.CreatePermissionRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.CreatePermissionRequest;if(o.parent!=null&&(d.parent=String(o.parent)),o.permission!=null){if(typeof o.permission!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.CreatePermissionRequest.permission: object expected");d.permission=I.google.ai.generativelanguage.v1beta3.Permission.fromObject(o.permission)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.parent="",b.permission=null),o.parent!=null&&o.hasOwnProperty("parent")&&(b.parent=o.parent),o.permission!=null&&o.hasOwnProperty("permission")&&(b.permission=I.google.ai.generativelanguage.v1beta3.Permission.toObject(o.permission,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.CreatePermissionRequest"},r}(),s.GetPermissionRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.name=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.name!=null&&o.hasOwnProperty("name")&&!l.isString(o.name)?"name: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.GetPermissionRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.GetPermissionRequest;return o.name!=null&&(d.name=String(o.name)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.name=""),o.name!=null&&o.hasOwnProperty("name")&&(b.name=o.name),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.GetPermissionRequest"},r}(),s.ListPermissionsRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.parent=o.string();break}case 2:{h.pageSize=o.int32();break}case 3:{h.pageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.parent!=null&&o.hasOwnProperty("parent")&&!l.isString(o.parent)?"parent: string expected":o.pageSize!=null&&o.hasOwnProperty("pageSize")&&!l.isInteger(o.pageSize)?"pageSize: integer expected":o.pageToken!=null&&o.hasOwnProperty("pageToken")&&!l.isString(o.pageToken)?"pageToken: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.ListPermissionsRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.ListPermissionsRequest;return o.parent!=null&&(d.parent=String(o.parent)),o.pageSize!=null&&(d.pageSize=o.pageSize|0),o.pageToken!=null&&(d.pageToken=String(o.pageToken)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.parent="",b.pageSize=0,b.pageToken=""),o.parent!=null&&o.hasOwnProperty("parent")&&(b.parent=o.parent),o.pageSize!=null&&o.hasOwnProperty("pageSize")&&(b.pageSize=o.pageSize),o.pageToken!=null&&o.hasOwnProperty("pageToken")&&(b.pageToken=o.pageToken),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.ListPermissionsRequest"},r}(),s.ListPermissionsResponse=function(){function r(u){if(this.permissions=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.permissions&&h.permissions.length||(h.permissions=[]),h.permissions.push(I.google.ai.generativelanguage.v1beta3.Permission.decode(o,o.uint32()));break}case 2:{h.nextPageToken=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.permissions!=null&&o.hasOwnProperty("permissions")){if(!Array.isArray(o.permissions))return"permissions: array expected";for(var d=0;d>>3){case 1:{h.permission=I.google.ai.generativelanguage.v1beta3.Permission.decode(o,o.uint32());break}case 2:{h.updateMask=I.google.protobuf.FieldMask.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.permission!=null&&o.hasOwnProperty("permission")){var d=I.google.ai.generativelanguage.v1beta3.Permission.verify(o.permission);if(d)return"permission."+d}if(o.updateMask!=null&&o.hasOwnProperty("updateMask")){var d=I.google.protobuf.FieldMask.verify(o.updateMask);if(d)return"updateMask."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest;if(o.permission!=null){if(typeof o.permission!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.permission: object expected");d.permission=I.google.ai.generativelanguage.v1beta3.Permission.fromObject(o.permission)}if(o.updateMask!=null){if(typeof o.updateMask!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.updateMask: object expected");d.updateMask=I.google.protobuf.FieldMask.fromObject(o.updateMask)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.permission=null,b.updateMask=null),o.permission!=null&&o.hasOwnProperty("permission")&&(b.permission=I.google.ai.generativelanguage.v1beta3.Permission.toObject(o.permission,d)),o.updateMask!=null&&o.hasOwnProperty("updateMask")&&(b.updateMask=I.google.protobuf.FieldMask.toObject(o.updateMask,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.UpdatePermissionRequest"},r}(),s.DeletePermissionRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.name=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.name!=null&&o.hasOwnProperty("name")&&!l.isString(o.name)?"name: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.DeletePermissionRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.DeletePermissionRequest;return o.name!=null&&(d.name=String(o.name)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.name=""),o.name!=null&&o.hasOwnProperty("name")&&(b.name=o.name),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.DeletePermissionRequest"},r}(),s.TransferOwnershipRequest=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.name=o.string();break}case 2:{h.emailAddress=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.name!=null&&o.hasOwnProperty("name")&&!l.isString(o.name)?"name: string expected":o.emailAddress!=null&&o.hasOwnProperty("emailAddress")&&!l.isString(o.emailAddress)?"emailAddress: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest;return o.name!=null&&(d.name=String(o.name)),o.emailAddress!=null&&(d.emailAddress=String(o.emailAddress)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.name="",b.emailAddress=""),o.name!=null&&o.hasOwnProperty("name")&&(b.name=o.name),o.emailAddress!=null&&o.hasOwnProperty("emailAddress")&&(b.emailAddress=o.emailAddress),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.TransferOwnershipRequest"},r}(),s.TransferOwnershipResponse=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":null},r.fromObject=function(o){return o instanceof I.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse?o:new I.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse},r.toObject=function(){return{}},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.TransferOwnershipResponse"},r}(),s.TextService=function(){function r(u,o,d){t.rpc.Service.call(this,u,o,d)}return(r.prototype=Object.create(t.rpc.Service.prototype)).constructor=r,r.create=function(o,d,b){return new this(o,d,b)},Object.defineProperty(r.prototype.generateText=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.GenerateTextRequest,I.google.ai.generativelanguage.v1beta3.GenerateTextResponse,o,d)},"name",{value:"GenerateText"}),Object.defineProperty(r.prototype.embedText=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.EmbedTextRequest,I.google.ai.generativelanguage.v1beta3.EmbedTextResponse,o,d)},"name",{value:"EmbedText"}),Object.defineProperty(r.prototype.batchEmbedText=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest,I.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse,o,d)},"name",{value:"BatchEmbedText"}),Object.defineProperty(r.prototype.countTextTokens=function u(o,d){return this.rpcCall(u,I.google.ai.generativelanguage.v1beta3.CountTextTokensRequest,I.google.ai.generativelanguage.v1beta3.CountTextTokensResponse,o,d)},"name",{value:"CountTextTokens"}),r}(),s.GenerateTextRequest=function(){function r(o){if(this.safetySettings=[],this.stopSequences=[],o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.model=d.string();break}case 2:{Z.prompt=I.google.ai.generativelanguage.v1beta3.TextPrompt.decode(d,d.uint32());break}case 3:{Z.temperature=d.float();break}case 4:{Z.candidateCount=d.int32();break}case 5:{Z.maxOutputTokens=d.int32();break}case 6:{Z.topP=d.float();break}case 7:{Z.topK=d.int32();break}case 8:{Z.safetySettings&&Z.safetySettings.length||(Z.safetySettings=[]),Z.safetySettings.push(I.google.ai.generativelanguage.v1beta3.SafetySetting.decode(d,d.uint32()));break}case 9:{Z.stopSequences&&Z.stopSequences.length||(Z.stopSequences=[]),Z.stopSequences.push(d.string());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.model!=null&&d.hasOwnProperty("model")&&!l.isString(d.model))return"model: string expected";if(d.prompt!=null&&d.hasOwnProperty("prompt")){var h=I.google.ai.generativelanguage.v1beta3.TextPrompt.verify(d.prompt);if(h)return"prompt."+h}if(d.temperature!=null&&d.hasOwnProperty("temperature")&&(b._temperature=1,typeof d.temperature!="number"))return"temperature: number expected";if(d.candidateCount!=null&&d.hasOwnProperty("candidateCount")&&(b._candidateCount=1,!l.isInteger(d.candidateCount)))return"candidateCount: integer expected";if(d.maxOutputTokens!=null&&d.hasOwnProperty("maxOutputTokens")&&(b._maxOutputTokens=1,!l.isInteger(d.maxOutputTokens)))return"maxOutputTokens: integer expected";if(d.topP!=null&&d.hasOwnProperty("topP")&&(b._topP=1,typeof d.topP!="number"))return"topP: number expected";if(d.topK!=null&&d.hasOwnProperty("topK")&&(b._topK=1,!l.isInteger(d.topK)))return"topK: integer expected";if(d.safetySettings!=null&&d.hasOwnProperty("safetySettings")){if(!Array.isArray(d.safetySettings))return"safetySettings: array expected";for(var Z=0;Z>>3){case 1:{h.candidates&&h.candidates.length||(h.candidates=[]),h.candidates.push(I.google.ai.generativelanguage.v1beta3.TextCompletion.decode(o,o.uint32()));break}case 3:{h.filters&&h.filters.length||(h.filters=[]),h.filters.push(I.google.ai.generativelanguage.v1beta3.ContentFilter.decode(o,o.uint32()));break}case 4:{h.safetyFeedback&&h.safetyFeedback.length||(h.safetyFeedback=[]),h.safetyFeedback.push(I.google.ai.generativelanguage.v1beta3.SafetyFeedback.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.candidates!=null&&o.hasOwnProperty("candidates")){if(!Array.isArray(o.candidates))return"candidates: array expected";for(var d=0;d>>3){case 1:{h.text=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.text!=null&&o.hasOwnProperty("text")&&!l.isString(o.text)?"text: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.TextPrompt)return o;var d=new I.google.ai.generativelanguage.v1beta3.TextPrompt;return o.text!=null&&(d.text=String(o.text)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.text=""),o.text!=null&&o.hasOwnProperty("text")&&(b.text=o.text),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.TextPrompt"},r}(),s.TextCompletion=function(){function r(o){if(this.safetyRatings=[],o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.output=d.string();break}case 2:{Z.safetyRatings&&Z.safetyRatings.length||(Z.safetyRatings=[]),Z.safetyRatings.push(I.google.ai.generativelanguage.v1beta3.SafetyRating.decode(d,d.uint32()));break}case 3:{Z.citationMetadata=I.google.ai.generativelanguage.v1beta3.CitationMetadata.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.output!=null&&d.hasOwnProperty("output")&&!l.isString(d.output))return"output: string expected";if(d.safetyRatings!=null&&d.hasOwnProperty("safetyRatings")){if(!Array.isArray(d.safetyRatings))return"safetyRatings: array expected";for(var h=0;h>>3){case 1:{h.model=o.string();break}case 2:{h.text=o.string();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.model!=null&&o.hasOwnProperty("model")&&!l.isString(o.model)?"model: string expected":o.text!=null&&o.hasOwnProperty("text")&&!l.isString(o.text)?"text: string expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.EmbedTextRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.EmbedTextRequest;return o.model!=null&&(d.model=String(o.model)),o.text!=null&&(d.text=String(o.text)),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.model="",b.text=""),o.model!=null&&o.hasOwnProperty("model")&&(b.model=o.model),o.text!=null&&o.hasOwnProperty("text")&&(b.text=o.text),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.EmbedTextRequest"},r}(),s.EmbedTextResponse=function(){function r(o){if(o)for(var d=Object.keys(o),b=0;b>>3){case 1:{Z.embedding=I.google.ai.generativelanguage.v1beta3.Embedding.decode(d,d.uint32());break}default:d.skipType(N&7);break}}return Z},r.decodeDelimited=function(d){return d instanceof e||(d=new e(d)),this.decode(d,d.uint32())},r.verify=function(d){if(typeof d!="object"||d===null)return"object expected";var b={};if(d.embedding!=null&&d.hasOwnProperty("embedding")){b._embedding=1;{var h=I.google.ai.generativelanguage.v1beta3.Embedding.verify(d.embedding);if(h)return"embedding."+h}}return null},r.fromObject=function(d){if(d instanceof I.google.ai.generativelanguage.v1beta3.EmbedTextResponse)return d;var b=new I.google.ai.generativelanguage.v1beta3.EmbedTextResponse;if(d.embedding!=null){if(typeof d.embedding!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.EmbedTextResponse.embedding: object expected");b.embedding=I.google.ai.generativelanguage.v1beta3.Embedding.fromObject(d.embedding)}return b},r.toObject=function(d,b){b||(b={});var h={};return d.embedding!=null&&d.hasOwnProperty("embedding")&&(h.embedding=I.google.ai.generativelanguage.v1beta3.Embedding.toObject(d.embedding,b),b.oneofs&&(h._embedding="embedding")),h},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/google.ai.generativelanguage.v1beta3.EmbedTextResponse"},r}(),s.BatchEmbedTextRequest=function(){function r(u){if(this.texts=[],u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.model=o.string();break}case 2:{h.texts&&h.texts.length||(h.texts=[]),h.texts.push(o.string());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.model!=null&&o.hasOwnProperty("model")&&!l.isString(o.model))return"model: string expected";if(o.texts!=null&&o.hasOwnProperty("texts")){if(!Array.isArray(o.texts))return"texts: array expected";for(var d=0;d>>3){case 1:{h.embeddings&&h.embeddings.length||(h.embeddings=[]),h.embeddings.push(I.google.ai.generativelanguage.v1beta3.Embedding.decode(o,o.uint32()));break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.embeddings!=null&&o.hasOwnProperty("embeddings")){if(!Array.isArray(o.embeddings))return"embeddings: array expected";for(var d=0;d>>3){case 1:{if(h.value&&h.value.length||(h.value=[]),(Z&7)===2)for(var N=o.uint32()+o.pos;o.pos>>3){case 1:{h.model=o.string();break}case 2:{h.prompt=I.google.ai.generativelanguage.v1beta3.TextPrompt.decode(o,o.uint32());break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.model!=null&&o.hasOwnProperty("model")&&!l.isString(o.model))return"model: string expected";if(o.prompt!=null&&o.hasOwnProperty("prompt")){var d=I.google.ai.generativelanguage.v1beta3.TextPrompt.verify(o.prompt);if(d)return"prompt."+d}return null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.CountTextTokensRequest)return o;var d=new I.google.ai.generativelanguage.v1beta3.CountTextTokensRequest;if(o.model!=null&&(d.model=String(o.model)),o.prompt!=null){if(typeof o.prompt!="object")throw TypeError(".google.ai.generativelanguage.v1beta3.CountTextTokensRequest.prompt: object expected");d.prompt=I.google.ai.generativelanguage.v1beta3.TextPrompt.fromObject(o.prompt)}return d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.model="",b.prompt=null),o.model!=null&&o.hasOwnProperty("model")&&(b.model=o.model),o.prompt!=null&&o.hasOwnProperty("prompt")&&(b.prompt=I.google.ai.generativelanguage.v1beta3.TextPrompt.toObject(o.prompt,d)),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.CountTextTokensRequest"},r}(),s.CountTextTokensResponse=function(){function r(u){if(u)for(var o=Object.keys(u),d=0;d>>3){case 1:{h.tokenCount=o.int32();break}default:o.skipType(Z&7);break}}return h},r.decodeDelimited=function(o){return o instanceof e||(o=new e(o)),this.decode(o,o.uint32())},r.verify=function(o){return typeof o!="object"||o===null?"object expected":o.tokenCount!=null&&o.hasOwnProperty("tokenCount")&&!l.isInteger(o.tokenCount)?"tokenCount: integer expected":null},r.fromObject=function(o){if(o instanceof I.google.ai.generativelanguage.v1beta3.CountTextTokensResponse)return o;var d=new I.google.ai.generativelanguage.v1beta3.CountTextTokensResponse;return o.tokenCount!=null&&(d.tokenCount=o.tokenCount|0),d},r.toObject=function(o,d){d||(d={});var b={};return d.defaults&&(b.tokenCount=0),o.tokenCount!=null&&o.hasOwnProperty("tokenCount")&&(b.tokenCount=o.tokenCount),b},r.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},r.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/google.ai.generativelanguage.v1beta3.CountTextTokensResponse"},r}(),s}(),i}(),c}(),a.api=function(){var c={};return c.FieldBehavior=function(){var i={},s=Object.create(i);return s[i[0]="FIELD_BEHAVIOR_UNSPECIFIED"]=0,s[i[1]="OPTIONAL"]=1,s[i[2]="REQUIRED"]=2,s[i[3]="OUTPUT_ONLY"]=3,s[i[4]="INPUT_ONLY"]=4,s[i[5]="IMMUTABLE"]=5,s[i[6]="UNORDERED_LIST"]=6,s[i[7]="NON_EMPTY_DEFAULT"]=7,s}(),c.Http=function(){function i(s){if(this.rules=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.rules&&d.rules.length||(d.rules=[]),d.rules.push(I.google.api.HttpRule.decode(r,r.uint32()));break}case 2:{d.fullyDecodeReservedExpansion=r.bool();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.rules!=null&&r.hasOwnProperty("rules")){if(!Array.isArray(r.rules))return"rules: array expected";for(var u=0;u>>3){case 1:{b.selector=u.string();break}case 2:{b.get=u.string();break}case 3:{b.put=u.string();break}case 4:{b.post=u.string();break}case 5:{b.delete=u.string();break}case 6:{b.patch=u.string();break}case 8:{b.custom=I.google.api.CustomHttpPattern.decode(u,u.uint32());break}case 7:{b.body=u.string();break}case 12:{b.responseBody=u.string();break}case 11:{b.additionalBindings&&b.additionalBindings.length||(b.additionalBindings=[]),b.additionalBindings.push(I.google.api.HttpRule.decode(u,u.uint32()));break}default:u.skipType(h&7);break}}return b},i.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},i.verify=function(u){if(typeof u!="object"||u===null)return"object expected";var o={};if(u.selector!=null&&u.hasOwnProperty("selector")&&!l.isString(u.selector))return"selector: string expected";if(u.get!=null&&u.hasOwnProperty("get")&&(o.pattern=1,!l.isString(u.get)))return"get: string expected";if(u.put!=null&&u.hasOwnProperty("put")){if(o.pattern===1)return"pattern: multiple values";if(o.pattern=1,!l.isString(u.put))return"put: string expected"}if(u.post!=null&&u.hasOwnProperty("post")){if(o.pattern===1)return"pattern: multiple values";if(o.pattern=1,!l.isString(u.post))return"post: string expected"}if(u.delete!=null&&u.hasOwnProperty("delete")){if(o.pattern===1)return"pattern: multiple values";if(o.pattern=1,!l.isString(u.delete))return"delete: string expected"}if(u.patch!=null&&u.hasOwnProperty("patch")){if(o.pattern===1)return"pattern: multiple values";if(o.pattern=1,!l.isString(u.patch))return"patch: string expected"}if(u.custom!=null&&u.hasOwnProperty("custom")){if(o.pattern===1)return"pattern: multiple values";o.pattern=1;{var d=I.google.api.CustomHttpPattern.verify(u.custom);if(d)return"custom."+d}}if(u.body!=null&&u.hasOwnProperty("body")&&!l.isString(u.body))return"body: string expected";if(u.responseBody!=null&&u.hasOwnProperty("responseBody")&&!l.isString(u.responseBody))return"responseBody: string expected";if(u.additionalBindings!=null&&u.hasOwnProperty("additionalBindings")){if(!Array.isArray(u.additionalBindings))return"additionalBindings: array expected";for(var b=0;b>>3){case 1:{d.kind=r.string();break}case 2:{d.path=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.kind!=null&&r.hasOwnProperty("kind")&&!l.isString(r.kind)?"kind: string expected":r.path!=null&&r.hasOwnProperty("path")&&!l.isString(r.path)?"path: string expected":null},i.fromObject=function(r){if(r instanceof I.google.api.CustomHttpPattern)return r;var u=new I.google.api.CustomHttpPattern;return r.kind!=null&&(u.kind=String(r.kind)),r.path!=null&&(u.path=String(r.path)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.kind="",o.path=""),r.kind!=null&&r.hasOwnProperty("kind")&&(o.kind=r.kind),r.path!=null&&r.hasOwnProperty("path")&&(o.path=r.path),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.CustomHttpPattern"},i}(),c.CommonLanguageSettings=function(){function i(s){if(this.destinations=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.referenceDocsUri=r.string();break}case 2:{if(d.destinations&&d.destinations.length||(d.destinations=[]),(b&7)===2)for(var h=r.uint32()+r.pos;r.pos>>3){case 1:{d.version=r.string();break}case 2:{d.launchStage=r.int32();break}case 3:{d.restNumericEnums=r.bool();break}case 21:{d.javaSettings=I.google.api.JavaSettings.decode(r,r.uint32());break}case 22:{d.cppSettings=I.google.api.CppSettings.decode(r,r.uint32());break}case 23:{d.phpSettings=I.google.api.PhpSettings.decode(r,r.uint32());break}case 24:{d.pythonSettings=I.google.api.PythonSettings.decode(r,r.uint32());break}case 25:{d.nodeSettings=I.google.api.NodeSettings.decode(r,r.uint32());break}case 26:{d.dotnetSettings=I.google.api.DotnetSettings.decode(r,r.uint32());break}case 27:{d.rubySettings=I.google.api.RubySettings.decode(r,r.uint32());break}case 28:{d.goSettings=I.google.api.GoSettings.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.version!=null&&r.hasOwnProperty("version")&&!l.isString(r.version))return"version: string expected";if(r.launchStage!=null&&r.hasOwnProperty("launchStage"))switch(r.launchStage){default:return"launchStage: enum value expected";case 0:case 6:case 7:case 1:case 2:case 3:case 4:case 5:break}if(r.restNumericEnums!=null&&r.hasOwnProperty("restNumericEnums")&&typeof r.restNumericEnums!="boolean")return"restNumericEnums: boolean expected";if(r.javaSettings!=null&&r.hasOwnProperty("javaSettings")){var u=I.google.api.JavaSettings.verify(r.javaSettings);if(u)return"javaSettings."+u}if(r.cppSettings!=null&&r.hasOwnProperty("cppSettings")){var u=I.google.api.CppSettings.verify(r.cppSettings);if(u)return"cppSettings."+u}if(r.phpSettings!=null&&r.hasOwnProperty("phpSettings")){var u=I.google.api.PhpSettings.verify(r.phpSettings);if(u)return"phpSettings."+u}if(r.pythonSettings!=null&&r.hasOwnProperty("pythonSettings")){var u=I.google.api.PythonSettings.verify(r.pythonSettings);if(u)return"pythonSettings."+u}if(r.nodeSettings!=null&&r.hasOwnProperty("nodeSettings")){var u=I.google.api.NodeSettings.verify(r.nodeSettings);if(u)return"nodeSettings."+u}if(r.dotnetSettings!=null&&r.hasOwnProperty("dotnetSettings")){var u=I.google.api.DotnetSettings.verify(r.dotnetSettings);if(u)return"dotnetSettings."+u}if(r.rubySettings!=null&&r.hasOwnProperty("rubySettings")){var u=I.google.api.RubySettings.verify(r.rubySettings);if(u)return"rubySettings."+u}if(r.goSettings!=null&&r.hasOwnProperty("goSettings")){var u=I.google.api.GoSettings.verify(r.goSettings);if(u)return"goSettings."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.ClientLibrarySettings)return r;var u=new I.google.api.ClientLibrarySettings;switch(r.version!=null&&(u.version=String(r.version)),r.launchStage){default:if(typeof r.launchStage=="number"){u.launchStage=r.launchStage;break}break;case"LAUNCH_STAGE_UNSPECIFIED":case 0:u.launchStage=0;break;case"UNIMPLEMENTED":case 6:u.launchStage=6;break;case"PRELAUNCH":case 7:u.launchStage=7;break;case"EARLY_ACCESS":case 1:u.launchStage=1;break;case"ALPHA":case 2:u.launchStage=2;break;case"BETA":case 3:u.launchStage=3;break;case"GA":case 4:u.launchStage=4;break;case"DEPRECATED":case 5:u.launchStage=5;break}if(r.restNumericEnums!=null&&(u.restNumericEnums=!!r.restNumericEnums),r.javaSettings!=null){if(typeof r.javaSettings!="object")throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected");u.javaSettings=I.google.api.JavaSettings.fromObject(r.javaSettings)}if(r.cppSettings!=null){if(typeof r.cppSettings!="object")throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected");u.cppSettings=I.google.api.CppSettings.fromObject(r.cppSettings)}if(r.phpSettings!=null){if(typeof r.phpSettings!="object")throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected");u.phpSettings=I.google.api.PhpSettings.fromObject(r.phpSettings)}if(r.pythonSettings!=null){if(typeof r.pythonSettings!="object")throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected");u.pythonSettings=I.google.api.PythonSettings.fromObject(r.pythonSettings)}if(r.nodeSettings!=null){if(typeof r.nodeSettings!="object")throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected");u.nodeSettings=I.google.api.NodeSettings.fromObject(r.nodeSettings)}if(r.dotnetSettings!=null){if(typeof r.dotnetSettings!="object")throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected");u.dotnetSettings=I.google.api.DotnetSettings.fromObject(r.dotnetSettings)}if(r.rubySettings!=null){if(typeof r.rubySettings!="object")throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected");u.rubySettings=I.google.api.RubySettings.fromObject(r.rubySettings)}if(r.goSettings!=null){if(typeof r.goSettings!="object")throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected");u.goSettings=I.google.api.GoSettings.fromObject(r.goSettings)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.version="",o.launchStage=u.enums===String?"LAUNCH_STAGE_UNSPECIFIED":0,o.restNumericEnums=!1,o.javaSettings=null,o.cppSettings=null,o.phpSettings=null,o.pythonSettings=null,o.nodeSettings=null,o.dotnetSettings=null,o.rubySettings=null,o.goSettings=null),r.version!=null&&r.hasOwnProperty("version")&&(o.version=r.version),r.launchStage!=null&&r.hasOwnProperty("launchStage")&&(o.launchStage=u.enums===String?I.google.api.LaunchStage[r.launchStage]===void 0?r.launchStage:I.google.api.LaunchStage[r.launchStage]:r.launchStage),r.restNumericEnums!=null&&r.hasOwnProperty("restNumericEnums")&&(o.restNumericEnums=r.restNumericEnums),r.javaSettings!=null&&r.hasOwnProperty("javaSettings")&&(o.javaSettings=I.google.api.JavaSettings.toObject(r.javaSettings,u)),r.cppSettings!=null&&r.hasOwnProperty("cppSettings")&&(o.cppSettings=I.google.api.CppSettings.toObject(r.cppSettings,u)),r.phpSettings!=null&&r.hasOwnProperty("phpSettings")&&(o.phpSettings=I.google.api.PhpSettings.toObject(r.phpSettings,u)),r.pythonSettings!=null&&r.hasOwnProperty("pythonSettings")&&(o.pythonSettings=I.google.api.PythonSettings.toObject(r.pythonSettings,u)),r.nodeSettings!=null&&r.hasOwnProperty("nodeSettings")&&(o.nodeSettings=I.google.api.NodeSettings.toObject(r.nodeSettings,u)),r.dotnetSettings!=null&&r.hasOwnProperty("dotnetSettings")&&(o.dotnetSettings=I.google.api.DotnetSettings.toObject(r.dotnetSettings,u)),r.rubySettings!=null&&r.hasOwnProperty("rubySettings")&&(o.rubySettings=I.google.api.RubySettings.toObject(r.rubySettings,u)),r.goSettings!=null&&r.hasOwnProperty("goSettings")&&(o.goSettings=I.google.api.GoSettings.toObject(r.goSettings,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.ClientLibrarySettings"},i}(),c.Publishing=function(){function i(s){if(this.methodSettings=[],this.codeownerGithubTeams=[],this.librarySettings=[],s)for(var r=Object.keys(s),u=0;u>>3){case 2:{d.methodSettings&&d.methodSettings.length||(d.methodSettings=[]),d.methodSettings.push(I.google.api.MethodSettings.decode(r,r.uint32()));break}case 101:{d.newIssueUri=r.string();break}case 102:{d.documentationUri=r.string();break}case 103:{d.apiShortName=r.string();break}case 104:{d.githubLabel=r.string();break}case 105:{d.codeownerGithubTeams&&d.codeownerGithubTeams.length||(d.codeownerGithubTeams=[]),d.codeownerGithubTeams.push(r.string());break}case 106:{d.docTagPrefix=r.string();break}case 107:{d.organization=r.int32();break}case 109:{d.librarySettings&&d.librarySettings.length||(d.librarySettings=[]),d.librarySettings.push(I.google.api.ClientLibrarySettings.decode(r,r.uint32()));break}case 110:{d.protoReferenceDocumentationUri=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.methodSettings!=null&&r.hasOwnProperty("methodSettings")){if(!Array.isArray(r.methodSettings))return"methodSettings: array expected";for(var u=0;u>>3){case 1:{d.libraryPackage=r.string();break}case 2:{d.serviceClassNames===l.emptyObject&&(d.serviceClassNames={});var N=r.uint32()+r.pos;for(b="",h="";r.pos>>3){case 1:b=r.string();break;case 2:h=r.string();break;default:r.skipType(g&7);break}}d.serviceClassNames[b]=h;break}case 3:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}default:r.skipType(Z&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.libraryPackage!=null&&r.hasOwnProperty("libraryPackage")&&!l.isString(r.libraryPackage))return"libraryPackage: string expected";if(r.serviceClassNames!=null&&r.hasOwnProperty("serviceClassNames")){if(!l.isObject(r.serviceClassNames))return"serviceClassNames: object expected";for(var u=Object.keys(r.serviceClassNames),o=0;o>>3){case 1:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.common!=null&&r.hasOwnProperty("common")){var u=I.google.api.CommonLanguageSettings.verify(r.common);if(u)return"common."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.CppSettings)return r;var u=new I.google.api.CppSettings;if(r.common!=null){if(typeof r.common!="object")throw TypeError(".google.api.CppSettings.common: object expected");u.common=I.google.api.CommonLanguageSettings.fromObject(r.common)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.common=null),r.common!=null&&r.hasOwnProperty("common")&&(o.common=I.google.api.CommonLanguageSettings.toObject(r.common,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.CppSettings"},i}(),c.PhpSettings=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.common!=null&&r.hasOwnProperty("common")){var u=I.google.api.CommonLanguageSettings.verify(r.common);if(u)return"common."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.PhpSettings)return r;var u=new I.google.api.PhpSettings;if(r.common!=null){if(typeof r.common!="object")throw TypeError(".google.api.PhpSettings.common: object expected");u.common=I.google.api.CommonLanguageSettings.fromObject(r.common)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.common=null),r.common!=null&&r.hasOwnProperty("common")&&(o.common=I.google.api.CommonLanguageSettings.toObject(r.common,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.PhpSettings"},i}(),c.PythonSettings=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.common!=null&&r.hasOwnProperty("common")){var u=I.google.api.CommonLanguageSettings.verify(r.common);if(u)return"common."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.PythonSettings)return r;var u=new I.google.api.PythonSettings;if(r.common!=null){if(typeof r.common!="object")throw TypeError(".google.api.PythonSettings.common: object expected");u.common=I.google.api.CommonLanguageSettings.fromObject(r.common)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.common=null),r.common!=null&&r.hasOwnProperty("common")&&(o.common=I.google.api.CommonLanguageSettings.toObject(r.common,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.PythonSettings"},i}(),c.NodeSettings=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.common!=null&&r.hasOwnProperty("common")){var u=I.google.api.CommonLanguageSettings.verify(r.common);if(u)return"common."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.NodeSettings)return r;var u=new I.google.api.NodeSettings;if(r.common!=null){if(typeof r.common!="object")throw TypeError(".google.api.NodeSettings.common: object expected");u.common=I.google.api.CommonLanguageSettings.fromObject(r.common)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.common=null),r.common!=null&&r.hasOwnProperty("common")&&(o.common=I.google.api.CommonLanguageSettings.toObject(r.common,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.NodeSettings"},i}(),c.DotnetSettings=function(){function i(s){if(this.renamedServices={},this.renamedResources={},this.ignoredResources=[],this.forcedNamespaceAliases=[],this.handwrittenSignatures=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}case 2:{d.renamedServices===l.emptyObject&&(d.renamedServices={});var N=r.uint32()+r.pos;for(b="",h="";r.pos>>3){case 1:b=r.string();break;case 2:h=r.string();break;default:r.skipType(g&7);break}}d.renamedServices[b]=h;break}case 3:{d.renamedResources===l.emptyObject&&(d.renamedResources={});var N=r.uint32()+r.pos;for(b="",h="";r.pos>>3){case 1:b=r.string();break;case 2:h=r.string();break;default:r.skipType(g&7);break}}d.renamedResources[b]=h;break}case 4:{d.ignoredResources&&d.ignoredResources.length||(d.ignoredResources=[]),d.ignoredResources.push(r.string());break}case 5:{d.forcedNamespaceAliases&&d.forcedNamespaceAliases.length||(d.forcedNamespaceAliases=[]),d.forcedNamespaceAliases.push(r.string());break}case 6:{d.handwrittenSignatures&&d.handwrittenSignatures.length||(d.handwrittenSignatures=[]),d.handwrittenSignatures.push(r.string());break}default:r.skipType(Z&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.common!=null&&r.hasOwnProperty("common")){var u=I.google.api.CommonLanguageSettings.verify(r.common);if(u)return"common."+u}if(r.renamedServices!=null&&r.hasOwnProperty("renamedServices")){if(!l.isObject(r.renamedServices))return"renamedServices: object expected";for(var o=Object.keys(r.renamedServices),d=0;d>>3){case 1:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.common!=null&&r.hasOwnProperty("common")){var u=I.google.api.CommonLanguageSettings.verify(r.common);if(u)return"common."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.RubySettings)return r;var u=new I.google.api.RubySettings;if(r.common!=null){if(typeof r.common!="object")throw TypeError(".google.api.RubySettings.common: object expected");u.common=I.google.api.CommonLanguageSettings.fromObject(r.common)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.common=null),r.common!=null&&r.hasOwnProperty("common")&&(o.common=I.google.api.CommonLanguageSettings.toObject(r.common,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.RubySettings"},i}(),c.GoSettings=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.common=I.google.api.CommonLanguageSettings.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.common!=null&&r.hasOwnProperty("common")){var u=I.google.api.CommonLanguageSettings.verify(r.common);if(u)return"common."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.GoSettings)return r;var u=new I.google.api.GoSettings;if(r.common!=null){if(typeof r.common!="object")throw TypeError(".google.api.GoSettings.common: object expected");u.common=I.google.api.CommonLanguageSettings.fromObject(r.common)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.common=null),r.common!=null&&r.hasOwnProperty("common")&&(o.common=I.google.api.CommonLanguageSettings.toObject(r.common,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.GoSettings"},i}(),c.MethodSettings=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.selector=r.string();break}case 2:{d.longRunning=I.google.api.MethodSettings.LongRunning.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.selector!=null&&r.hasOwnProperty("selector")&&!l.isString(r.selector))return"selector: string expected";if(r.longRunning!=null&&r.hasOwnProperty("longRunning")){var u=I.google.api.MethodSettings.LongRunning.verify(r.longRunning);if(u)return"longRunning."+u}return null},i.fromObject=function(r){if(r instanceof I.google.api.MethodSettings)return r;var u=new I.google.api.MethodSettings;if(r.selector!=null&&(u.selector=String(r.selector)),r.longRunning!=null){if(typeof r.longRunning!="object")throw TypeError(".google.api.MethodSettings.longRunning: object expected");u.longRunning=I.google.api.MethodSettings.LongRunning.fromObject(r.longRunning)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.selector="",o.longRunning=null),r.selector!=null&&r.hasOwnProperty("selector")&&(o.selector=r.selector),r.longRunning!=null&&r.hasOwnProperty("longRunning")&&(o.longRunning=I.google.api.MethodSettings.LongRunning.toObject(r.longRunning,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.MethodSettings"},i.LongRunning=function(){function s(r){if(r)for(var u=Object.keys(r),o=0;o>>3){case 1:{b.initialPollDelay=I.google.protobuf.Duration.decode(u,u.uint32());break}case 2:{b.pollDelayMultiplier=u.float();break}case 3:{b.maxPollDelay=I.google.protobuf.Duration.decode(u,u.uint32());break}case 4:{b.totalPollTimeout=I.google.protobuf.Duration.decode(u,u.uint32());break}default:u.skipType(h&7);break}}return b},s.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},s.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.initialPollDelay!=null&&u.hasOwnProperty("initialPollDelay")){var o=I.google.protobuf.Duration.verify(u.initialPollDelay);if(o)return"initialPollDelay."+o}if(u.pollDelayMultiplier!=null&&u.hasOwnProperty("pollDelayMultiplier")&&typeof u.pollDelayMultiplier!="number")return"pollDelayMultiplier: number expected";if(u.maxPollDelay!=null&&u.hasOwnProperty("maxPollDelay")){var o=I.google.protobuf.Duration.verify(u.maxPollDelay);if(o)return"maxPollDelay."+o}if(u.totalPollTimeout!=null&&u.hasOwnProperty("totalPollTimeout")){var o=I.google.protobuf.Duration.verify(u.totalPollTimeout);if(o)return"totalPollTimeout."+o}return null},s.fromObject=function(u){if(u instanceof I.google.api.MethodSettings.LongRunning)return u;var o=new I.google.api.MethodSettings.LongRunning;if(u.initialPollDelay!=null){if(typeof u.initialPollDelay!="object")throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected");o.initialPollDelay=I.google.protobuf.Duration.fromObject(u.initialPollDelay)}if(u.pollDelayMultiplier!=null&&(o.pollDelayMultiplier=Number(u.pollDelayMultiplier)),u.maxPollDelay!=null){if(typeof u.maxPollDelay!="object")throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected");o.maxPollDelay=I.google.protobuf.Duration.fromObject(u.maxPollDelay)}if(u.totalPollTimeout!=null){if(typeof u.totalPollTimeout!="object")throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected");o.totalPollTimeout=I.google.protobuf.Duration.fromObject(u.totalPollTimeout)}return o},s.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.initialPollDelay=null,d.pollDelayMultiplier=0,d.maxPollDelay=null,d.totalPollTimeout=null),u.initialPollDelay!=null&&u.hasOwnProperty("initialPollDelay")&&(d.initialPollDelay=I.google.protobuf.Duration.toObject(u.initialPollDelay,o)),u.pollDelayMultiplier!=null&&u.hasOwnProperty("pollDelayMultiplier")&&(d.pollDelayMultiplier=o.json&&!isFinite(u.pollDelayMultiplier)?String(u.pollDelayMultiplier):u.pollDelayMultiplier),u.maxPollDelay!=null&&u.hasOwnProperty("maxPollDelay")&&(d.maxPollDelay=I.google.protobuf.Duration.toObject(u.maxPollDelay,o)),u.totalPollTimeout!=null&&u.hasOwnProperty("totalPollTimeout")&&(d.totalPollTimeout=I.google.protobuf.Duration.toObject(u.totalPollTimeout,o)),d},s.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},s.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.api.MethodSettings.LongRunning"},s}(),i}(),c.ClientLibraryOrganization=function(){var i={},s=Object.create(i);return s[i[0]="CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"]=0,s[i[1]="CLOUD"]=1,s[i[2]="ADS"]=2,s[i[3]="PHOTOS"]=3,s[i[4]="STREET_VIEW"]=4,s[i[5]="SHOPPING"]=5,s[i[6]="GEO"]=6,s[i[7]="GENERATIVE_AI"]=7,s}(),c.ClientLibraryDestination=function(){var i={},s=Object.create(i);return s[i[0]="CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"]=0,s[i[10]="GITHUB"]=10,s[i[20]="PACKAGE_MANAGER"]=20,s}(),c.LaunchStage=function(){var i={},s=Object.create(i);return s[i[0]="LAUNCH_STAGE_UNSPECIFIED"]=0,s[i[6]="UNIMPLEMENTED"]=6,s[i[7]="PRELAUNCH"]=7,s[i[1]="EARLY_ACCESS"]=1,s[i[2]="ALPHA"]=2,s[i[3]="BETA"]=3,s[i[4]="GA"]=4,s[i[5]="DEPRECATED"]=5,s}(),c.ResourceDescriptor=function(){function i(s){if(this.pattern=[],this.style=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.type=r.string();break}case 2:{d.pattern&&d.pattern.length||(d.pattern=[]),d.pattern.push(r.string());break}case 3:{d.nameField=r.string();break}case 4:{d.history=r.int32();break}case 5:{d.plural=r.string();break}case 6:{d.singular=r.string();break}case 10:{if(d.style&&d.style.length||(d.style=[]),(b&7)===2)for(var h=r.uint32()+r.pos;r.pos>>3){case 1:{d.type=r.string();break}case 2:{d.childType=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.type!=null&&r.hasOwnProperty("type")&&!l.isString(r.type)?"type: string expected":r.childType!=null&&r.hasOwnProperty("childType")&&!l.isString(r.childType)?"childType: string expected":null},i.fromObject=function(r){if(r instanceof I.google.api.ResourceReference)return r;var u=new I.google.api.ResourceReference;return r.type!=null&&(u.type=String(r.type)),r.childType!=null&&(u.childType=String(r.childType)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.type="",o.childType=""),r.type!=null&&r.hasOwnProperty("type")&&(o.type=r.type),r.childType!=null&&r.hasOwnProperty("childType")&&(o.childType=r.childType),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.api.ResourceReference"},i}(),c}(),a.protobuf=function(){var c={};return c.FileDescriptorSet=function(){function i(s){if(this.file=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.file&&d.file.length||(d.file=[]),d.file.push(I.google.protobuf.FileDescriptorProto.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.file!=null&&r.hasOwnProperty("file")){if(!Array.isArray(r.file))return"file: array expected";for(var u=0;u>>3){case 1:{d.name=r.string();break}case 2:{d.package=r.string();break}case 3:{d.dependency&&d.dependency.length||(d.dependency=[]),d.dependency.push(r.string());break}case 10:{if(d.publicDependency&&d.publicDependency.length||(d.publicDependency=[]),(b&7)===2)for(var h=r.uint32()+r.pos;r.pos>>3){case 1:{d.name=r.string();break}case 2:{d.field&&d.field.length||(d.field=[]),d.field.push(I.google.protobuf.FieldDescriptorProto.decode(r,r.uint32()));break}case 6:{d.extension&&d.extension.length||(d.extension=[]),d.extension.push(I.google.protobuf.FieldDescriptorProto.decode(r,r.uint32()));break}case 3:{d.nestedType&&d.nestedType.length||(d.nestedType=[]),d.nestedType.push(I.google.protobuf.DescriptorProto.decode(r,r.uint32()));break}case 4:{d.enumType&&d.enumType.length||(d.enumType=[]),d.enumType.push(I.google.protobuf.EnumDescriptorProto.decode(r,r.uint32()));break}case 5:{d.extensionRange&&d.extensionRange.length||(d.extensionRange=[]),d.extensionRange.push(I.google.protobuf.DescriptorProto.ExtensionRange.decode(r,r.uint32()));break}case 8:{d.oneofDecl&&d.oneofDecl.length||(d.oneofDecl=[]),d.oneofDecl.push(I.google.protobuf.OneofDescriptorProto.decode(r,r.uint32()));break}case 7:{d.options=I.google.protobuf.MessageOptions.decode(r,r.uint32());break}case 9:{d.reservedRange&&d.reservedRange.length||(d.reservedRange=[]),d.reservedRange.push(I.google.protobuf.DescriptorProto.ReservedRange.decode(r,r.uint32()));break}case 10:{d.reservedName&&d.reservedName.length||(d.reservedName=[]),d.reservedName.push(r.string());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.field!=null&&r.hasOwnProperty("field")){if(!Array.isArray(r.field))return"field: array expected";for(var u=0;u>>3){case 1:{b.start=u.int32();break}case 2:{b.end=u.int32();break}case 3:{b.options=I.google.protobuf.ExtensionRangeOptions.decode(u,u.uint32());break}default:u.skipType(h&7);break}}return b},s.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},s.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.start!=null&&u.hasOwnProperty("start")&&!l.isInteger(u.start))return"start: integer expected";if(u.end!=null&&u.hasOwnProperty("end")&&!l.isInteger(u.end))return"end: integer expected";if(u.options!=null&&u.hasOwnProperty("options")){var o=I.google.protobuf.ExtensionRangeOptions.verify(u.options);if(o)return"options."+o}return null},s.fromObject=function(u){if(u instanceof I.google.protobuf.DescriptorProto.ExtensionRange)return u;var o=new I.google.protobuf.DescriptorProto.ExtensionRange;if(u.start!=null&&(o.start=u.start|0),u.end!=null&&(o.end=u.end|0),u.options!=null){if(typeof u.options!="object")throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");o.options=I.google.protobuf.ExtensionRangeOptions.fromObject(u.options)}return o},s.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.start=0,d.end=0,d.options=null),u.start!=null&&u.hasOwnProperty("start")&&(d.start=u.start),u.end!=null&&u.hasOwnProperty("end")&&(d.end=u.end),u.options!=null&&u.hasOwnProperty("options")&&(d.options=I.google.protobuf.ExtensionRangeOptions.toObject(u.options,o)),d},s.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},s.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.protobuf.DescriptorProto.ExtensionRange"},s}(),i.ReservedRange=function(){function s(r){if(r)for(var u=Object.keys(r),o=0;o>>3){case 1:{b.start=u.int32();break}case 2:{b.end=u.int32();break}default:u.skipType(h&7);break}}return b},s.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},s.verify=function(u){return typeof u!="object"||u===null?"object expected":u.start!=null&&u.hasOwnProperty("start")&&!l.isInteger(u.start)?"start: integer expected":u.end!=null&&u.hasOwnProperty("end")&&!l.isInteger(u.end)?"end: integer expected":null},s.fromObject=function(u){if(u instanceof I.google.protobuf.DescriptorProto.ReservedRange)return u;var o=new I.google.protobuf.DescriptorProto.ReservedRange;return u.start!=null&&(o.start=u.start|0),u.end!=null&&(o.end=u.end|0),o},s.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.start=0,d.end=0),u.start!=null&&u.hasOwnProperty("start")&&(d.start=u.start),u.end!=null&&u.hasOwnProperty("end")&&(d.end=u.end),d},s.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},s.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.protobuf.DescriptorProto.ReservedRange"},s}(),i}(),c.ExtensionRangeOptions=function(){function i(s){if(this.uninterpretedOption=[],this.declaration=[],s)for(var r=Object.keys(s),u=0;u>>3){case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}case 2:{d.declaration&&d.declaration.length||(d.declaration=[]),d.declaration.push(I.google.protobuf.ExtensionRangeOptions.Declaration.decode(r,r.uint32()));break}case 50:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 3:{d.verification=r.int32();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var u=0;u>>3){case 1:{b.number=u.int32();break}case 2:{b.fullName=u.string();break}case 3:{b.type=u.string();break}case 5:{b.reserved=u.bool();break}case 6:{b.repeated=u.bool();break}default:u.skipType(h&7);break}}return b},s.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},s.verify=function(u){return typeof u!="object"||u===null?"object expected":u.number!=null&&u.hasOwnProperty("number")&&!l.isInteger(u.number)?"number: integer expected":u.fullName!=null&&u.hasOwnProperty("fullName")&&!l.isString(u.fullName)?"fullName: string expected":u.type!=null&&u.hasOwnProperty("type")&&!l.isString(u.type)?"type: string expected":u.reserved!=null&&u.hasOwnProperty("reserved")&&typeof u.reserved!="boolean"?"reserved: boolean expected":u.repeated!=null&&u.hasOwnProperty("repeated")&&typeof u.repeated!="boolean"?"repeated: boolean expected":null},s.fromObject=function(u){if(u instanceof I.google.protobuf.ExtensionRangeOptions.Declaration)return u;var o=new I.google.protobuf.ExtensionRangeOptions.Declaration;return u.number!=null&&(o.number=u.number|0),u.fullName!=null&&(o.fullName=String(u.fullName)),u.type!=null&&(o.type=String(u.type)),u.reserved!=null&&(o.reserved=!!u.reserved),u.repeated!=null&&(o.repeated=!!u.repeated),o},s.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.number=0,d.fullName="",d.type="",d.reserved=!1,d.repeated=!1),u.number!=null&&u.hasOwnProperty("number")&&(d.number=u.number),u.fullName!=null&&u.hasOwnProperty("fullName")&&(d.fullName=u.fullName),u.type!=null&&u.hasOwnProperty("type")&&(d.type=u.type),u.reserved!=null&&u.hasOwnProperty("reserved")&&(d.reserved=u.reserved),u.repeated!=null&&u.hasOwnProperty("repeated")&&(d.repeated=u.repeated),d},s.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},s.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.protobuf.ExtensionRangeOptions.Declaration"},s}(),i.VerificationState=function(){var s={},r=Object.create(s);return r[s[0]="DECLARATION"]=0,r[s[1]="UNVERIFIED"]=1,r}(),i}(),c.FieldDescriptorProto=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}case 3:{d.number=r.int32();break}case 4:{d.label=r.int32();break}case 5:{d.type=r.int32();break}case 6:{d.typeName=r.string();break}case 2:{d.extendee=r.string();break}case 7:{d.defaultValue=r.string();break}case 9:{d.oneofIndex=r.int32();break}case 10:{d.jsonName=r.string();break}case 8:{d.options=I.google.protobuf.FieldOptions.decode(r,r.uint32());break}case 17:{d.proto3Optional=r.bool();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.number!=null&&r.hasOwnProperty("number")&&!l.isInteger(r.number))return"number: integer expected";if(r.label!=null&&r.hasOwnProperty("label"))switch(r.label){default:return"label: enum value expected";case 1:case 2:case 3:break}if(r.type!=null&&r.hasOwnProperty("type"))switch(r.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:break}if(r.typeName!=null&&r.hasOwnProperty("typeName")&&!l.isString(r.typeName))return"typeName: string expected";if(r.extendee!=null&&r.hasOwnProperty("extendee")&&!l.isString(r.extendee))return"extendee: string expected";if(r.defaultValue!=null&&r.hasOwnProperty("defaultValue")&&!l.isString(r.defaultValue))return"defaultValue: string expected";if(r.oneofIndex!=null&&r.hasOwnProperty("oneofIndex")&&!l.isInteger(r.oneofIndex))return"oneofIndex: integer expected";if(r.jsonName!=null&&r.hasOwnProperty("jsonName")&&!l.isString(r.jsonName))return"jsonName: string expected";if(r.options!=null&&r.hasOwnProperty("options")){var u=I.google.protobuf.FieldOptions.verify(r.options);if(u)return"options."+u}return r.proto3Optional!=null&&r.hasOwnProperty("proto3Optional")&&typeof r.proto3Optional!="boolean"?"proto3Optional: boolean expected":null},i.fromObject=function(r){if(r instanceof I.google.protobuf.FieldDescriptorProto)return r;var u=new I.google.protobuf.FieldDescriptorProto;switch(r.name!=null&&(u.name=String(r.name)),r.number!=null&&(u.number=r.number|0),r.label){default:if(typeof r.label=="number"){u.label=r.label;break}break;case"LABEL_OPTIONAL":case 1:u.label=1;break;case"LABEL_REQUIRED":case 2:u.label=2;break;case"LABEL_REPEATED":case 3:u.label=3;break}switch(r.type){default:if(typeof r.type=="number"){u.type=r.type;break}break;case"TYPE_DOUBLE":case 1:u.type=1;break;case"TYPE_FLOAT":case 2:u.type=2;break;case"TYPE_INT64":case 3:u.type=3;break;case"TYPE_UINT64":case 4:u.type=4;break;case"TYPE_INT32":case 5:u.type=5;break;case"TYPE_FIXED64":case 6:u.type=6;break;case"TYPE_FIXED32":case 7:u.type=7;break;case"TYPE_BOOL":case 8:u.type=8;break;case"TYPE_STRING":case 9:u.type=9;break;case"TYPE_GROUP":case 10:u.type=10;break;case"TYPE_MESSAGE":case 11:u.type=11;break;case"TYPE_BYTES":case 12:u.type=12;break;case"TYPE_UINT32":case 13:u.type=13;break;case"TYPE_ENUM":case 14:u.type=14;break;case"TYPE_SFIXED32":case 15:u.type=15;break;case"TYPE_SFIXED64":case 16:u.type=16;break;case"TYPE_SINT32":case 17:u.type=17;break;case"TYPE_SINT64":case 18:u.type=18;break}if(r.typeName!=null&&(u.typeName=String(r.typeName)),r.extendee!=null&&(u.extendee=String(r.extendee)),r.defaultValue!=null&&(u.defaultValue=String(r.defaultValue)),r.oneofIndex!=null&&(u.oneofIndex=r.oneofIndex|0),r.jsonName!=null&&(u.jsonName=String(r.jsonName)),r.options!=null){if(typeof r.options!="object")throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");u.options=I.google.protobuf.FieldOptions.fromObject(r.options)}return r.proto3Optional!=null&&(u.proto3Optional=!!r.proto3Optional),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name="",o.extendee="",o.number=0,o.label=u.enums===String?"LABEL_OPTIONAL":1,o.type=u.enums===String?"TYPE_DOUBLE":1,o.typeName="",o.defaultValue="",o.options=null,o.oneofIndex=0,o.jsonName="",o.proto3Optional=!1),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),r.extendee!=null&&r.hasOwnProperty("extendee")&&(o.extendee=r.extendee),r.number!=null&&r.hasOwnProperty("number")&&(o.number=r.number),r.label!=null&&r.hasOwnProperty("label")&&(o.label=u.enums===String?I.google.protobuf.FieldDescriptorProto.Label[r.label]===void 0?r.label:I.google.protobuf.FieldDescriptorProto.Label[r.label]:r.label),r.type!=null&&r.hasOwnProperty("type")&&(o.type=u.enums===String?I.google.protobuf.FieldDescriptorProto.Type[r.type]===void 0?r.type:I.google.protobuf.FieldDescriptorProto.Type[r.type]:r.type),r.typeName!=null&&r.hasOwnProperty("typeName")&&(o.typeName=r.typeName),r.defaultValue!=null&&r.hasOwnProperty("defaultValue")&&(o.defaultValue=r.defaultValue),r.options!=null&&r.hasOwnProperty("options")&&(o.options=I.google.protobuf.FieldOptions.toObject(r.options,u)),r.oneofIndex!=null&&r.hasOwnProperty("oneofIndex")&&(o.oneofIndex=r.oneofIndex),r.jsonName!=null&&r.hasOwnProperty("jsonName")&&(o.jsonName=r.jsonName),r.proto3Optional!=null&&r.hasOwnProperty("proto3Optional")&&(o.proto3Optional=r.proto3Optional),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.FieldDescriptorProto"},i.Type=function(){var s={},r=Object.create(s);return r[s[1]="TYPE_DOUBLE"]=1,r[s[2]="TYPE_FLOAT"]=2,r[s[3]="TYPE_INT64"]=3,r[s[4]="TYPE_UINT64"]=4,r[s[5]="TYPE_INT32"]=5,r[s[6]="TYPE_FIXED64"]=6,r[s[7]="TYPE_FIXED32"]=7,r[s[8]="TYPE_BOOL"]=8,r[s[9]="TYPE_STRING"]=9,r[s[10]="TYPE_GROUP"]=10,r[s[11]="TYPE_MESSAGE"]=11,r[s[12]="TYPE_BYTES"]=12,r[s[13]="TYPE_UINT32"]=13,r[s[14]="TYPE_ENUM"]=14,r[s[15]="TYPE_SFIXED32"]=15,r[s[16]="TYPE_SFIXED64"]=16,r[s[17]="TYPE_SINT32"]=17,r[s[18]="TYPE_SINT64"]=18,r}(),i.Label=function(){var s={},r=Object.create(s);return r[s[1]="LABEL_OPTIONAL"]=1,r[s[2]="LABEL_REQUIRED"]=2,r[s[3]="LABEL_REPEATED"]=3,r}(),i}(),c.OneofDescriptorProto=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}case 2:{d.options=I.google.protobuf.OneofOptions.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.options!=null&&r.hasOwnProperty("options")){var u=I.google.protobuf.OneofOptions.verify(r.options);if(u)return"options."+u}return null},i.fromObject=function(r){if(r instanceof I.google.protobuf.OneofDescriptorProto)return r;var u=new I.google.protobuf.OneofDescriptorProto;if(r.name!=null&&(u.name=String(r.name)),r.options!=null){if(typeof r.options!="object")throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");u.options=I.google.protobuf.OneofOptions.fromObject(r.options)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name="",o.options=null),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),r.options!=null&&r.hasOwnProperty("options")&&(o.options=I.google.protobuf.OneofOptions.toObject(r.options,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.OneofDescriptorProto"},i}(),c.EnumDescriptorProto=function(){function i(s){if(this.value=[],this.reservedRange=[],this.reservedName=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}case 2:{d.value&&d.value.length||(d.value=[]),d.value.push(I.google.protobuf.EnumValueDescriptorProto.decode(r,r.uint32()));break}case 3:{d.options=I.google.protobuf.EnumOptions.decode(r,r.uint32());break}case 4:{d.reservedRange&&d.reservedRange.length||(d.reservedRange=[]),d.reservedRange.push(I.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(r,r.uint32()));break}case 5:{d.reservedName&&d.reservedName.length||(d.reservedName=[]),d.reservedName.push(r.string());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.value!=null&&r.hasOwnProperty("value")){if(!Array.isArray(r.value))return"value: array expected";for(var u=0;u>>3){case 1:{b.start=u.int32();break}case 2:{b.end=u.int32();break}default:u.skipType(h&7);break}}return b},s.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},s.verify=function(u){return typeof u!="object"||u===null?"object expected":u.start!=null&&u.hasOwnProperty("start")&&!l.isInteger(u.start)?"start: integer expected":u.end!=null&&u.hasOwnProperty("end")&&!l.isInteger(u.end)?"end: integer expected":null},s.fromObject=function(u){if(u instanceof I.google.protobuf.EnumDescriptorProto.EnumReservedRange)return u;var o=new I.google.protobuf.EnumDescriptorProto.EnumReservedRange;return u.start!=null&&(o.start=u.start|0),u.end!=null&&(o.end=u.end|0),o},s.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.start=0,d.end=0),u.start!=null&&u.hasOwnProperty("start")&&(d.start=u.start),u.end!=null&&u.hasOwnProperty("end")&&(d.end=u.end),d},s.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},s.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.protobuf.EnumDescriptorProto.EnumReservedRange"},s}(),i}(),c.EnumValueDescriptorProto=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}case 2:{d.number=r.int32();break}case 3:{d.options=I.google.protobuf.EnumValueOptions.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.number!=null&&r.hasOwnProperty("number")&&!l.isInteger(r.number))return"number: integer expected";if(r.options!=null&&r.hasOwnProperty("options")){var u=I.google.protobuf.EnumValueOptions.verify(r.options);if(u)return"options."+u}return null},i.fromObject=function(r){if(r instanceof I.google.protobuf.EnumValueDescriptorProto)return r;var u=new I.google.protobuf.EnumValueDescriptorProto;if(r.name!=null&&(u.name=String(r.name)),r.number!=null&&(u.number=r.number|0),r.options!=null){if(typeof r.options!="object")throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");u.options=I.google.protobuf.EnumValueOptions.fromObject(r.options)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name="",o.number=0,o.options=null),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),r.number!=null&&r.hasOwnProperty("number")&&(o.number=r.number),r.options!=null&&r.hasOwnProperty("options")&&(o.options=I.google.protobuf.EnumValueOptions.toObject(r.options,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.EnumValueDescriptorProto"},i}(),c.ServiceDescriptorProto=function(){function i(s){if(this.method=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}case 2:{d.method&&d.method.length||(d.method=[]),d.method.push(I.google.protobuf.MethodDescriptorProto.decode(r,r.uint32()));break}case 3:{d.options=I.google.protobuf.ServiceOptions.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.method!=null&&r.hasOwnProperty("method")){if(!Array.isArray(r.method))return"method: array expected";for(var u=0;u>>3){case 1:{d.name=r.string();break}case 2:{d.inputType=r.string();break}case 3:{d.outputType=r.string();break}case 4:{d.options=I.google.protobuf.MethodOptions.decode(r,r.uint32());break}case 5:{d.clientStreaming=r.bool();break}case 6:{d.serverStreaming=r.bool();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.inputType!=null&&r.hasOwnProperty("inputType")&&!l.isString(r.inputType))return"inputType: string expected";if(r.outputType!=null&&r.hasOwnProperty("outputType")&&!l.isString(r.outputType))return"outputType: string expected";if(r.options!=null&&r.hasOwnProperty("options")){var u=I.google.protobuf.MethodOptions.verify(r.options);if(u)return"options."+u}return r.clientStreaming!=null&&r.hasOwnProperty("clientStreaming")&&typeof r.clientStreaming!="boolean"?"clientStreaming: boolean expected":r.serverStreaming!=null&&r.hasOwnProperty("serverStreaming")&&typeof r.serverStreaming!="boolean"?"serverStreaming: boolean expected":null},i.fromObject=function(r){if(r instanceof I.google.protobuf.MethodDescriptorProto)return r;var u=new I.google.protobuf.MethodDescriptorProto;if(r.name!=null&&(u.name=String(r.name)),r.inputType!=null&&(u.inputType=String(r.inputType)),r.outputType!=null&&(u.outputType=String(r.outputType)),r.options!=null){if(typeof r.options!="object")throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");u.options=I.google.protobuf.MethodOptions.fromObject(r.options)}return r.clientStreaming!=null&&(u.clientStreaming=!!r.clientStreaming),r.serverStreaming!=null&&(u.serverStreaming=!!r.serverStreaming),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name="",o.inputType="",o.outputType="",o.options=null,o.clientStreaming=!1,o.serverStreaming=!1),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),r.inputType!=null&&r.hasOwnProperty("inputType")&&(o.inputType=r.inputType),r.outputType!=null&&r.hasOwnProperty("outputType")&&(o.outputType=r.outputType),r.options!=null&&r.hasOwnProperty("options")&&(o.options=I.google.protobuf.MethodOptions.toObject(r.options,u)),r.clientStreaming!=null&&r.hasOwnProperty("clientStreaming")&&(o.clientStreaming=r.clientStreaming),r.serverStreaming!=null&&r.hasOwnProperty("serverStreaming")&&(o.serverStreaming=r.serverStreaming),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.MethodDescriptorProto"},i}(),c.FileOptions=function(){function i(s){if(this.uninterpretedOption=[],this[".google.api.resourceDefinition"]=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.javaPackage=r.string();break}case 8:{d.javaOuterClassname=r.string();break}case 10:{d.javaMultipleFiles=r.bool();break}case 20:{d.javaGenerateEqualsAndHash=r.bool();break}case 27:{d.javaStringCheckUtf8=r.bool();break}case 9:{d.optimizeFor=r.int32();break}case 11:{d.goPackage=r.string();break}case 16:{d.ccGenericServices=r.bool();break}case 17:{d.javaGenericServices=r.bool();break}case 18:{d.pyGenericServices=r.bool();break}case 42:{d.phpGenericServices=r.bool();break}case 23:{d.deprecated=r.bool();break}case 31:{d.ccEnableArenas=r.bool();break}case 36:{d.objcClassPrefix=r.string();break}case 37:{d.csharpNamespace=r.string();break}case 39:{d.swiftPrefix=r.string();break}case 40:{d.phpClassPrefix=r.string();break}case 41:{d.phpNamespace=r.string();break}case 44:{d.phpMetadataNamespace=r.string();break}case 45:{d.rubyPackage=r.string();break}case 50:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}case 1053:{d[".google.api.resourceDefinition"]&&d[".google.api.resourceDefinition"].length||(d[".google.api.resourceDefinition"]=[]),d[".google.api.resourceDefinition"].push(I.google.api.ResourceDescriptor.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.javaPackage!=null&&r.hasOwnProperty("javaPackage")&&!l.isString(r.javaPackage))return"javaPackage: string expected";if(r.javaOuterClassname!=null&&r.hasOwnProperty("javaOuterClassname")&&!l.isString(r.javaOuterClassname))return"javaOuterClassname: string expected";if(r.javaMultipleFiles!=null&&r.hasOwnProperty("javaMultipleFiles")&&typeof r.javaMultipleFiles!="boolean")return"javaMultipleFiles: boolean expected";if(r.javaGenerateEqualsAndHash!=null&&r.hasOwnProperty("javaGenerateEqualsAndHash")&&typeof r.javaGenerateEqualsAndHash!="boolean")return"javaGenerateEqualsAndHash: boolean expected";if(r.javaStringCheckUtf8!=null&&r.hasOwnProperty("javaStringCheckUtf8")&&typeof r.javaStringCheckUtf8!="boolean")return"javaStringCheckUtf8: boolean expected";if(r.optimizeFor!=null&&r.hasOwnProperty("optimizeFor"))switch(r.optimizeFor){default:return"optimizeFor: enum value expected";case 1:case 2:case 3:break}if(r.goPackage!=null&&r.hasOwnProperty("goPackage")&&!l.isString(r.goPackage))return"goPackage: string expected";if(r.ccGenericServices!=null&&r.hasOwnProperty("ccGenericServices")&&typeof r.ccGenericServices!="boolean")return"ccGenericServices: boolean expected";if(r.javaGenericServices!=null&&r.hasOwnProperty("javaGenericServices")&&typeof r.javaGenericServices!="boolean")return"javaGenericServices: boolean expected";if(r.pyGenericServices!=null&&r.hasOwnProperty("pyGenericServices")&&typeof r.pyGenericServices!="boolean")return"pyGenericServices: boolean expected";if(r.phpGenericServices!=null&&r.hasOwnProperty("phpGenericServices")&&typeof r.phpGenericServices!="boolean")return"phpGenericServices: boolean expected";if(r.deprecated!=null&&r.hasOwnProperty("deprecated")&&typeof r.deprecated!="boolean")return"deprecated: boolean expected";if(r.ccEnableArenas!=null&&r.hasOwnProperty("ccEnableArenas")&&typeof r.ccEnableArenas!="boolean")return"ccEnableArenas: boolean expected";if(r.objcClassPrefix!=null&&r.hasOwnProperty("objcClassPrefix")&&!l.isString(r.objcClassPrefix))return"objcClassPrefix: string expected";if(r.csharpNamespace!=null&&r.hasOwnProperty("csharpNamespace")&&!l.isString(r.csharpNamespace))return"csharpNamespace: string expected";if(r.swiftPrefix!=null&&r.hasOwnProperty("swiftPrefix")&&!l.isString(r.swiftPrefix))return"swiftPrefix: string expected";if(r.phpClassPrefix!=null&&r.hasOwnProperty("phpClassPrefix")&&!l.isString(r.phpClassPrefix))return"phpClassPrefix: string expected";if(r.phpNamespace!=null&&r.hasOwnProperty("phpNamespace")&&!l.isString(r.phpNamespace))return"phpNamespace: string expected";if(r.phpMetadataNamespace!=null&&r.hasOwnProperty("phpMetadataNamespace")&&!l.isString(r.phpMetadataNamespace))return"phpMetadataNamespace: string expected";if(r.rubyPackage!=null&&r.hasOwnProperty("rubyPackage")&&!l.isString(r.rubyPackage))return"rubyPackage: string expected";if(r.features!=null&&r.hasOwnProperty("features")){var u=I.google.protobuf.FeatureSet.verify(r.features);if(u)return"features."+u}if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var o=0;o>>3){case 1:{d.messageSetWireFormat=r.bool();break}case 2:{d.noStandardDescriptorAccessor=r.bool();break}case 3:{d.deprecated=r.bool();break}case 7:{d.mapEntry=r.bool();break}case 11:{d.deprecatedLegacyJsonFieldConflicts=r.bool();break}case 12:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}case 1053:{d[".google.api.resource"]=I.google.api.ResourceDescriptor.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.messageSetWireFormat!=null&&r.hasOwnProperty("messageSetWireFormat")&&typeof r.messageSetWireFormat!="boolean")return"messageSetWireFormat: boolean expected";if(r.noStandardDescriptorAccessor!=null&&r.hasOwnProperty("noStandardDescriptorAccessor")&&typeof r.noStandardDescriptorAccessor!="boolean")return"noStandardDescriptorAccessor: boolean expected";if(r.deprecated!=null&&r.hasOwnProperty("deprecated")&&typeof r.deprecated!="boolean")return"deprecated: boolean expected";if(r.mapEntry!=null&&r.hasOwnProperty("mapEntry")&&typeof r.mapEntry!="boolean")return"mapEntry: boolean expected";if(r.deprecatedLegacyJsonFieldConflicts!=null&&r.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")&&typeof r.deprecatedLegacyJsonFieldConflicts!="boolean")return"deprecatedLegacyJsonFieldConflicts: boolean expected";if(r.features!=null&&r.hasOwnProperty("features")){var u=I.google.protobuf.FeatureSet.verify(r.features);if(u)return"features."+u}if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var o=0;o>>3){case 1:{d.ctype=r.int32();break}case 2:{d.packed=r.bool();break}case 6:{d.jstype=r.int32();break}case 5:{d.lazy=r.bool();break}case 15:{d.unverifiedLazy=r.bool();break}case 3:{d.deprecated=r.bool();break}case 10:{d.weak=r.bool();break}case 16:{d.debugRedact=r.bool();break}case 17:{d.retention=r.int32();break}case 19:{if(d.targets&&d.targets.length||(d.targets=[]),(b&7)===2)for(var h=r.uint32()+r.pos;r.pos>>3){case 1:{b.edition=u.string();break}case 2:{b.value=u.string();break}default:u.skipType(h&7);break}}return b},s.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},s.verify=function(u){return typeof u!="object"||u===null?"object expected":u.edition!=null&&u.hasOwnProperty("edition")&&!l.isString(u.edition)?"edition: string expected":u.value!=null&&u.hasOwnProperty("value")&&!l.isString(u.value)?"value: string expected":null},s.fromObject=function(u){if(u instanceof I.google.protobuf.FieldOptions.EditionDefault)return u;var o=new I.google.protobuf.FieldOptions.EditionDefault;return u.edition!=null&&(o.edition=String(u.edition)),u.value!=null&&(o.value=String(u.value)),o},s.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.edition="",d.value=""),u.edition!=null&&u.hasOwnProperty("edition")&&(d.edition=u.edition),u.value!=null&&u.hasOwnProperty("value")&&(d.value=u.value),d},s.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},s.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.protobuf.FieldOptions.EditionDefault"},s}(),i}(),c.OneofOptions=function(){function i(s){if(this.uninterpretedOption=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.features!=null&&r.hasOwnProperty("features")){var u=I.google.protobuf.FeatureSet.verify(r.features);if(u)return"features."+u}if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var o=0;o>>3){case 2:{d.allowAlias=r.bool();break}case 3:{d.deprecated=r.bool();break}case 6:{d.deprecatedLegacyJsonFieldConflicts=r.bool();break}case 7:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.allowAlias!=null&&r.hasOwnProperty("allowAlias")&&typeof r.allowAlias!="boolean")return"allowAlias: boolean expected";if(r.deprecated!=null&&r.hasOwnProperty("deprecated")&&typeof r.deprecated!="boolean")return"deprecated: boolean expected";if(r.deprecatedLegacyJsonFieldConflicts!=null&&r.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")&&typeof r.deprecatedLegacyJsonFieldConflicts!="boolean")return"deprecatedLegacyJsonFieldConflicts: boolean expected";if(r.features!=null&&r.hasOwnProperty("features")){var u=I.google.protobuf.FeatureSet.verify(r.features);if(u)return"features."+u}if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var o=0;o>>3){case 1:{d.deprecated=r.bool();break}case 2:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 3:{d.debugRedact=r.bool();break}case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.deprecated!=null&&r.hasOwnProperty("deprecated")&&typeof r.deprecated!="boolean")return"deprecated: boolean expected";if(r.features!=null&&r.hasOwnProperty("features")){var u=I.google.protobuf.FeatureSet.verify(r.features);if(u)return"features."+u}if(r.debugRedact!=null&&r.hasOwnProperty("debugRedact")&&typeof r.debugRedact!="boolean")return"debugRedact: boolean expected";if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var o=0;o>>3){case 34:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 33:{d.deprecated=r.bool();break}case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}case 1049:{d[".google.api.defaultHost"]=r.string();break}case 1050:{d[".google.api.oauthScopes"]=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.features!=null&&r.hasOwnProperty("features")){var u=I.google.protobuf.FeatureSet.verify(r.features);if(u)return"features."+u}if(r.deprecated!=null&&r.hasOwnProperty("deprecated")&&typeof r.deprecated!="boolean")return"deprecated: boolean expected";if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var o=0;o>>3){case 33:{d.deprecated=r.bool();break}case 34:{d.idempotencyLevel=r.int32();break}case 35:{d.features=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}case 999:{d.uninterpretedOption&&d.uninterpretedOption.length||(d.uninterpretedOption=[]),d.uninterpretedOption.push(I.google.protobuf.UninterpretedOption.decode(r,r.uint32()));break}case 72295728:{d[".google.api.http"]=I.google.api.HttpRule.decode(r,r.uint32());break}case 1051:{d[".google.api.methodSignature"]&&d[".google.api.methodSignature"].length||(d[".google.api.methodSignature"]=[]),d[".google.api.methodSignature"].push(r.string());break}case 1049:{d[".google.longrunning.operationInfo"]=I.google.longrunning.OperationInfo.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.deprecated!=null&&r.hasOwnProperty("deprecated")&&typeof r.deprecated!="boolean")return"deprecated: boolean expected";if(r.idempotencyLevel!=null&&r.hasOwnProperty("idempotencyLevel"))switch(r.idempotencyLevel){default:return"idempotencyLevel: enum value expected";case 0:case 1:case 2:break}if(r.features!=null&&r.hasOwnProperty("features")){var u=I.google.protobuf.FeatureSet.verify(r.features);if(u)return"features."+u}if(r.uninterpretedOption!=null&&r.hasOwnProperty("uninterpretedOption")){if(!Array.isArray(r.uninterpretedOption))return"uninterpretedOption: array expected";for(var o=0;o>>3){case 2:{d.name&&d.name.length||(d.name=[]),d.name.push(I.google.protobuf.UninterpretedOption.NamePart.decode(r,r.uint32()));break}case 3:{d.identifierValue=r.string();break}case 4:{d.positiveIntValue=r.uint64();break}case 5:{d.negativeIntValue=r.int64();break}case 6:{d.doubleValue=r.double();break}case 7:{d.stringValue=r.bytes();break}case 8:{d.aggregateValue=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")){if(!Array.isArray(r.name))return"name: array expected";for(var u=0;u>>0,r.positiveIntValue.high>>>0).toNumber(!0))),r.negativeIntValue!=null&&(l.Long?(u.negativeIntValue=l.Long.fromValue(r.negativeIntValue)).unsigned=!1:typeof r.negativeIntValue=="string"?u.negativeIntValue=parseInt(r.negativeIntValue,10):typeof r.negativeIntValue=="number"?u.negativeIntValue=r.negativeIntValue:typeof r.negativeIntValue=="object"&&(u.negativeIntValue=new l.LongBits(r.negativeIntValue.low>>>0,r.negativeIntValue.high>>>0).toNumber())),r.doubleValue!=null&&(u.doubleValue=Number(r.doubleValue)),r.stringValue!=null&&(typeof r.stringValue=="string"?l.base64.decode(r.stringValue,u.stringValue=l.newBuffer(l.base64.length(r.stringValue)),0):r.stringValue.length>=0&&(u.stringValue=r.stringValue)),r.aggregateValue!=null&&(u.aggregateValue=String(r.aggregateValue)),u},i.toObject=function(r,u){u||(u={});var o={};if((u.arrays||u.defaults)&&(o.name=[]),u.defaults){if(o.identifierValue="",l.Long){var d=new l.Long(0,0,!0);o.positiveIntValue=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else o.positiveIntValue=u.longs===String?"0":0;if(l.Long){var d=new l.Long(0,0,!1);o.negativeIntValue=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else o.negativeIntValue=u.longs===String?"0":0;o.doubleValue=0,u.bytes===String?o.stringValue="":(o.stringValue=[],u.bytes!==Array&&(o.stringValue=l.newBuffer(o.stringValue))),o.aggregateValue=""}if(r.name&&r.name.length){o.name=[];for(var b=0;b>>0,r.positiveIntValue.high>>>0).toNumber(!0):r.positiveIntValue),r.negativeIntValue!=null&&r.hasOwnProperty("negativeIntValue")&&(typeof r.negativeIntValue=="number"?o.negativeIntValue=u.longs===String?String(r.negativeIntValue):r.negativeIntValue:o.negativeIntValue=u.longs===String?l.Long.prototype.toString.call(r.negativeIntValue):u.longs===Number?new l.LongBits(r.negativeIntValue.low>>>0,r.negativeIntValue.high>>>0).toNumber():r.negativeIntValue),r.doubleValue!=null&&r.hasOwnProperty("doubleValue")&&(o.doubleValue=u.json&&!isFinite(r.doubleValue)?String(r.doubleValue):r.doubleValue),r.stringValue!=null&&r.hasOwnProperty("stringValue")&&(o.stringValue=u.bytes===String?l.base64.encode(r.stringValue,0,r.stringValue.length):u.bytes===Array?Array.prototype.slice.call(r.stringValue):r.stringValue),r.aggregateValue!=null&&r.hasOwnProperty("aggregateValue")&&(o.aggregateValue=r.aggregateValue),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.UninterpretedOption"},i.NamePart=function(){function s(r){if(r)for(var u=Object.keys(r),o=0;o>>3){case 1:{b.namePart=u.string();break}case 2:{b.isExtension=u.bool();break}default:u.skipType(h&7);break}}if(!b.hasOwnProperty("namePart"))throw l.ProtocolError("missing required 'namePart'",{instance:b});if(!b.hasOwnProperty("isExtension"))throw l.ProtocolError("missing required 'isExtension'",{instance:b});return b},s.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},s.verify=function(u){return typeof u!="object"||u===null?"object expected":l.isString(u.namePart)?typeof u.isExtension!="boolean"?"isExtension: boolean expected":null:"namePart: string expected"},s.fromObject=function(u){if(u instanceof I.google.protobuf.UninterpretedOption.NamePart)return u;var o=new I.google.protobuf.UninterpretedOption.NamePart;return u.namePart!=null&&(o.namePart=String(u.namePart)),u.isExtension!=null&&(o.isExtension=!!u.isExtension),o},s.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.namePart="",d.isExtension=!1),u.namePart!=null&&u.hasOwnProperty("namePart")&&(d.namePart=u.namePart),u.isExtension!=null&&u.hasOwnProperty("isExtension")&&(d.isExtension=u.isExtension),d},s.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},s.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.protobuf.UninterpretedOption.NamePart"},s}(),i}(),c.FeatureSet=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.fieldPresence=r.int32();break}case 2:{d.enumType=r.int32();break}case 3:{d.repeatedFieldEncoding=r.int32();break}case 4:{d.stringFieldValidation=r.int32();break}case 5:{d.messageEncoding=r.int32();break}case 6:{d.jsonFormat=r.int32();break}case 999:{d.rawFeatures=I.google.protobuf.FeatureSet.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.fieldPresence!=null&&r.hasOwnProperty("fieldPresence"))switch(r.fieldPresence){default:return"fieldPresence: enum value expected";case 0:case 1:case 2:case 3:break}if(r.enumType!=null&&r.hasOwnProperty("enumType"))switch(r.enumType){default:return"enumType: enum value expected";case 0:case 1:case 2:break}if(r.repeatedFieldEncoding!=null&&r.hasOwnProperty("repeatedFieldEncoding"))switch(r.repeatedFieldEncoding){default:return"repeatedFieldEncoding: enum value expected";case 0:case 1:case 2:break}if(r.stringFieldValidation!=null&&r.hasOwnProperty("stringFieldValidation"))switch(r.stringFieldValidation){default:return"stringFieldValidation: enum value expected";case 0:case 1:case 2:case 3:break}if(r.messageEncoding!=null&&r.hasOwnProperty("messageEncoding"))switch(r.messageEncoding){default:return"messageEncoding: enum value expected";case 0:case 1:case 2:break}if(r.jsonFormat!=null&&r.hasOwnProperty("jsonFormat"))switch(r.jsonFormat){default:return"jsonFormat: enum value expected";case 0:case 1:case 2:break}if(r.rawFeatures!=null&&r.hasOwnProperty("rawFeatures")){var u=I.google.protobuf.FeatureSet.verify(r.rawFeatures);if(u)return"rawFeatures."+u}return null},i.fromObject=function(r){if(r instanceof I.google.protobuf.FeatureSet)return r;var u=new I.google.protobuf.FeatureSet;switch(r.fieldPresence){default:if(typeof r.fieldPresence=="number"){u.fieldPresence=r.fieldPresence;break}break;case"FIELD_PRESENCE_UNKNOWN":case 0:u.fieldPresence=0;break;case"EXPLICIT":case 1:u.fieldPresence=1;break;case"IMPLICIT":case 2:u.fieldPresence=2;break;case"LEGACY_REQUIRED":case 3:u.fieldPresence=3;break}switch(r.enumType){default:if(typeof r.enumType=="number"){u.enumType=r.enumType;break}break;case"ENUM_TYPE_UNKNOWN":case 0:u.enumType=0;break;case"OPEN":case 1:u.enumType=1;break;case"CLOSED":case 2:u.enumType=2;break}switch(r.repeatedFieldEncoding){default:if(typeof r.repeatedFieldEncoding=="number"){u.repeatedFieldEncoding=r.repeatedFieldEncoding;break}break;case"REPEATED_FIELD_ENCODING_UNKNOWN":case 0:u.repeatedFieldEncoding=0;break;case"PACKED":case 1:u.repeatedFieldEncoding=1;break;case"EXPANDED":case 2:u.repeatedFieldEncoding=2;break}switch(r.stringFieldValidation){default:if(typeof r.stringFieldValidation=="number"){u.stringFieldValidation=r.stringFieldValidation;break}break;case"STRING_FIELD_VALIDATION_UNKNOWN":case 0:u.stringFieldValidation=0;break;case"MANDATORY":case 1:u.stringFieldValidation=1;break;case"HINT":case 2:u.stringFieldValidation=2;break;case"NONE":case 3:u.stringFieldValidation=3;break}switch(r.messageEncoding){default:if(typeof r.messageEncoding=="number"){u.messageEncoding=r.messageEncoding;break}break;case"MESSAGE_ENCODING_UNKNOWN":case 0:u.messageEncoding=0;break;case"LENGTH_PREFIXED":case 1:u.messageEncoding=1;break;case"DELIMITED":case 2:u.messageEncoding=2;break}switch(r.jsonFormat){default:if(typeof r.jsonFormat=="number"){u.jsonFormat=r.jsonFormat;break}break;case"JSON_FORMAT_UNKNOWN":case 0:u.jsonFormat=0;break;case"ALLOW":case 1:u.jsonFormat=1;break;case"LEGACY_BEST_EFFORT":case 2:u.jsonFormat=2;break}if(r.rawFeatures!=null){if(typeof r.rawFeatures!="object")throw TypeError(".google.protobuf.FeatureSet.rawFeatures: object expected");u.rawFeatures=I.google.protobuf.FeatureSet.fromObject(r.rawFeatures)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.fieldPresence=u.enums===String?"FIELD_PRESENCE_UNKNOWN":0,o.enumType=u.enums===String?"ENUM_TYPE_UNKNOWN":0,o.repeatedFieldEncoding=u.enums===String?"REPEATED_FIELD_ENCODING_UNKNOWN":0,o.stringFieldValidation=u.enums===String?"STRING_FIELD_VALIDATION_UNKNOWN":0,o.messageEncoding=u.enums===String?"MESSAGE_ENCODING_UNKNOWN":0,o.jsonFormat=u.enums===String?"JSON_FORMAT_UNKNOWN":0,o.rawFeatures=null),r.fieldPresence!=null&&r.hasOwnProperty("fieldPresence")&&(o.fieldPresence=u.enums===String?I.google.protobuf.FeatureSet.FieldPresence[r.fieldPresence]===void 0?r.fieldPresence:I.google.protobuf.FeatureSet.FieldPresence[r.fieldPresence]:r.fieldPresence),r.enumType!=null&&r.hasOwnProperty("enumType")&&(o.enumType=u.enums===String?I.google.protobuf.FeatureSet.EnumType[r.enumType]===void 0?r.enumType:I.google.protobuf.FeatureSet.EnumType[r.enumType]:r.enumType),r.repeatedFieldEncoding!=null&&r.hasOwnProperty("repeatedFieldEncoding")&&(o.repeatedFieldEncoding=u.enums===String?I.google.protobuf.FeatureSet.RepeatedFieldEncoding[r.repeatedFieldEncoding]===void 0?r.repeatedFieldEncoding:I.google.protobuf.FeatureSet.RepeatedFieldEncoding[r.repeatedFieldEncoding]:r.repeatedFieldEncoding),r.stringFieldValidation!=null&&r.hasOwnProperty("stringFieldValidation")&&(o.stringFieldValidation=u.enums===String?I.google.protobuf.FeatureSet.StringFieldValidation[r.stringFieldValidation]===void 0?r.stringFieldValidation:I.google.protobuf.FeatureSet.StringFieldValidation[r.stringFieldValidation]:r.stringFieldValidation),r.messageEncoding!=null&&r.hasOwnProperty("messageEncoding")&&(o.messageEncoding=u.enums===String?I.google.protobuf.FeatureSet.MessageEncoding[r.messageEncoding]===void 0?r.messageEncoding:I.google.protobuf.FeatureSet.MessageEncoding[r.messageEncoding]:r.messageEncoding),r.jsonFormat!=null&&r.hasOwnProperty("jsonFormat")&&(o.jsonFormat=u.enums===String?I.google.protobuf.FeatureSet.JsonFormat[r.jsonFormat]===void 0?r.jsonFormat:I.google.protobuf.FeatureSet.JsonFormat[r.jsonFormat]:r.jsonFormat),r.rawFeatures!=null&&r.hasOwnProperty("rawFeatures")&&(o.rawFeatures=I.google.protobuf.FeatureSet.toObject(r.rawFeatures,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.FeatureSet"},i.FieldPresence=function(){var s={},r=Object.create(s);return r[s[0]="FIELD_PRESENCE_UNKNOWN"]=0,r[s[1]="EXPLICIT"]=1,r[s[2]="IMPLICIT"]=2,r[s[3]="LEGACY_REQUIRED"]=3,r}(),i.EnumType=function(){var s={},r=Object.create(s);return r[s[0]="ENUM_TYPE_UNKNOWN"]=0,r[s[1]="OPEN"]=1,r[s[2]="CLOSED"]=2,r}(),i.RepeatedFieldEncoding=function(){var s={},r=Object.create(s);return r[s[0]="REPEATED_FIELD_ENCODING_UNKNOWN"]=0,r[s[1]="PACKED"]=1,r[s[2]="EXPANDED"]=2,r}(),i.StringFieldValidation=function(){var s={},r=Object.create(s);return r[s[0]="STRING_FIELD_VALIDATION_UNKNOWN"]=0,r[s[1]="MANDATORY"]=1,r[s[2]="HINT"]=2,r[s[3]="NONE"]=3,r}(),i.MessageEncoding=function(){var s={},r=Object.create(s);return r[s[0]="MESSAGE_ENCODING_UNKNOWN"]=0,r[s[1]="LENGTH_PREFIXED"]=1,r[s[2]="DELIMITED"]=2,r}(),i.JsonFormat=function(){var s={},r=Object.create(s);return r[s[0]="JSON_FORMAT_UNKNOWN"]=0,r[s[1]="ALLOW"]=1,r[s[2]="LEGACY_BEST_EFFORT"]=2,r}(),i}(),c.SourceCodeInfo=function(){function i(s){if(this.location=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.location&&d.location.length||(d.location=[]),d.location.push(I.google.protobuf.SourceCodeInfo.Location.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.location!=null&&r.hasOwnProperty("location")){if(!Array.isArray(r.location))return"location: array expected";for(var u=0;u>>3){case 1:{if(b.path&&b.path.length||(b.path=[]),(h&7)===2)for(var Z=u.uint32()+u.pos;u.pos>>3){case 1:{d.annotation&&d.annotation.length||(d.annotation=[]),d.annotation.push(I.google.protobuf.GeneratedCodeInfo.Annotation.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.annotation!=null&&r.hasOwnProperty("annotation")){if(!Array.isArray(r.annotation))return"annotation: array expected";for(var u=0;u>>3){case 1:{if(b.path&&b.path.length||(b.path=[]),(h&7)===2)for(var Z=u.uint32()+u.pos;u.pos>>3){case 1:{d.seconds=r.int64();break}case 2:{d.nanos=r.int32();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.seconds!=null&&r.hasOwnProperty("seconds")&&!l.isInteger(r.seconds)&&!(r.seconds&&l.isInteger(r.seconds.low)&&l.isInteger(r.seconds.high))?"seconds: integer|Long expected":r.nanos!=null&&r.hasOwnProperty("nanos")&&!l.isInteger(r.nanos)?"nanos: integer expected":null},i.fromObject=function(r){if(r instanceof I.google.protobuf.Duration)return r;var u=new I.google.protobuf.Duration;return r.seconds!=null&&(l.Long?(u.seconds=l.Long.fromValue(r.seconds)).unsigned=!1:typeof r.seconds=="string"?u.seconds=parseInt(r.seconds,10):typeof r.seconds=="number"?u.seconds=r.seconds:typeof r.seconds=="object"&&(u.seconds=new l.LongBits(r.seconds.low>>>0,r.seconds.high>>>0).toNumber())),r.nanos!=null&&(u.nanos=r.nanos|0),u},i.toObject=function(r,u){u||(u={});var o={};if(u.defaults){if(l.Long){var d=new l.Long(0,0,!1);o.seconds=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else o.seconds=u.longs===String?"0":0;o.nanos=0}return r.seconds!=null&&r.hasOwnProperty("seconds")&&(typeof r.seconds=="number"?o.seconds=u.longs===String?String(r.seconds):r.seconds:o.seconds=u.longs===String?l.Long.prototype.toString.call(r.seconds):u.longs===Number?new l.LongBits(r.seconds.low>>>0,r.seconds.high>>>0).toNumber():r.seconds),r.nanos!=null&&r.hasOwnProperty("nanos")&&(o.nanos=r.nanos),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.Duration"},i}(),c.Timestamp=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.seconds=r.int64();break}case 2:{d.nanos=r.int32();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.seconds!=null&&r.hasOwnProperty("seconds")&&!l.isInteger(r.seconds)&&!(r.seconds&&l.isInteger(r.seconds.low)&&l.isInteger(r.seconds.high))?"seconds: integer|Long expected":r.nanos!=null&&r.hasOwnProperty("nanos")&&!l.isInteger(r.nanos)?"nanos: integer expected":null},i.fromObject=function(r){if(r instanceof I.google.protobuf.Timestamp)return r;var u=new I.google.protobuf.Timestamp;return r.seconds!=null&&(l.Long?(u.seconds=l.Long.fromValue(r.seconds)).unsigned=!1:typeof r.seconds=="string"?u.seconds=parseInt(r.seconds,10):typeof r.seconds=="number"?u.seconds=r.seconds:typeof r.seconds=="object"&&(u.seconds=new l.LongBits(r.seconds.low>>>0,r.seconds.high>>>0).toNumber())),r.nanos!=null&&(u.nanos=r.nanos|0),u},i.toObject=function(r,u){u||(u={});var o={};if(u.defaults){if(l.Long){var d=new l.Long(0,0,!1);o.seconds=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else o.seconds=u.longs===String?"0":0;o.nanos=0}return r.seconds!=null&&r.hasOwnProperty("seconds")&&(typeof r.seconds=="number"?o.seconds=u.longs===String?String(r.seconds):r.seconds:o.seconds=u.longs===String?l.Long.prototype.toString.call(r.seconds):u.longs===Number?new l.LongBits(r.seconds.low>>>0,r.seconds.high>>>0).toNumber():r.seconds),r.nanos!=null&&r.hasOwnProperty("nanos")&&(o.nanos=r.nanos),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.Timestamp"},i}(),c.Any=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.type_url=r.string();break}case 2:{d.value=r.bytes();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.type_url!=null&&r.hasOwnProperty("type_url")&&!l.isString(r.type_url)?"type_url: string expected":r.value!=null&&r.hasOwnProperty("value")&&!(r.value&&typeof r.value.length=="number"||l.isString(r.value))?"value: buffer expected":null},i.fromObject=function(r){if(r instanceof I.google.protobuf.Any)return r;var u=new I.google.protobuf.Any;return r.type_url!=null&&(u.type_url=String(r.type_url)),r.value!=null&&(typeof r.value=="string"?l.base64.decode(r.value,u.value=l.newBuffer(l.base64.length(r.value)),0):r.value.length>=0&&(u.value=r.value)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.type_url="",u.bytes===String?o.value="":(o.value=[],u.bytes!==Array&&(o.value=l.newBuffer(o.value)))),r.type_url!=null&&r.hasOwnProperty("type_url")&&(o.type_url=r.type_url),r.value!=null&&r.hasOwnProperty("value")&&(o.value=u.bytes===String?l.base64.encode(r.value,0,r.value.length):u.bytes===Array?Array.prototype.slice.call(r.value):r.value),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.Any"},i}(),c.Empty=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":null},i.fromObject=function(r){return r instanceof I.google.protobuf.Empty?r:new I.google.protobuf.Empty},i.toObject=function(){return{}},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.protobuf.Empty"},i}(),c.FieldMask=function(){function i(s){if(this.paths=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.paths&&d.paths.length||(d.paths=[]),d.paths.push(r.string());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.paths!=null&&r.hasOwnProperty("paths")){if(!Array.isArray(r.paths))return"paths: array expected";for(var u=0;u>>3){case 1:{b.name=u.string();break}case 2:{b.metadata=I.google.protobuf.Any.decode(u,u.uint32());break}case 3:{b.done=u.bool();break}case 4:{b.error=I.google.rpc.Status.decode(u,u.uint32());break}case 5:{b.response=I.google.protobuf.Any.decode(u,u.uint32());break}default:u.skipType(h&7);break}}return b},i.decodeDelimited=function(u){return u instanceof e||(u=new e(u)),this.decode(u,u.uint32())},i.verify=function(u){if(typeof u!="object"||u===null)return"object expected";var o={};if(u.name!=null&&u.hasOwnProperty("name")&&!l.isString(u.name))return"name: string expected";if(u.metadata!=null&&u.hasOwnProperty("metadata")){var d=I.google.protobuf.Any.verify(u.metadata);if(d)return"metadata."+d}if(u.done!=null&&u.hasOwnProperty("done")&&typeof u.done!="boolean")return"done: boolean expected";if(u.error!=null&&u.hasOwnProperty("error")){o.result=1;{var d=I.google.rpc.Status.verify(u.error);if(d)return"error."+d}}if(u.response!=null&&u.hasOwnProperty("response")){if(o.result===1)return"result: multiple values";o.result=1;{var d=I.google.protobuf.Any.verify(u.response);if(d)return"response."+d}}return null},i.fromObject=function(u){if(u instanceof I.google.longrunning.Operation)return u;var o=new I.google.longrunning.Operation;if(u.name!=null&&(o.name=String(u.name)),u.metadata!=null){if(typeof u.metadata!="object")throw TypeError(".google.longrunning.Operation.metadata: object expected");o.metadata=I.google.protobuf.Any.fromObject(u.metadata)}if(u.done!=null&&(o.done=!!u.done),u.error!=null){if(typeof u.error!="object")throw TypeError(".google.longrunning.Operation.error: object expected");o.error=I.google.rpc.Status.fromObject(u.error)}if(u.response!=null){if(typeof u.response!="object")throw TypeError(".google.longrunning.Operation.response: object expected");o.response=I.google.protobuf.Any.fromObject(u.response)}return o},i.toObject=function(u,o){o||(o={});var d={};return o.defaults&&(d.name="",d.metadata=null,d.done=!1),u.name!=null&&u.hasOwnProperty("name")&&(d.name=u.name),u.metadata!=null&&u.hasOwnProperty("metadata")&&(d.metadata=I.google.protobuf.Any.toObject(u.metadata,o)),u.done!=null&&u.hasOwnProperty("done")&&(d.done=u.done),u.error!=null&&u.hasOwnProperty("error")&&(d.error=I.google.rpc.Status.toObject(u.error,o),o.oneofs&&(d.result="error")),u.response!=null&&u.hasOwnProperty("response")&&(d.response=I.google.protobuf.Any.toObject(u.response,o),o.oneofs&&(d.result="response")),d},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/google.longrunning.Operation"},i}(),c.GetOperationRequest=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name)?"name: string expected":null},i.fromObject=function(r){if(r instanceof I.google.longrunning.GetOperationRequest)return r;var u=new I.google.longrunning.GetOperationRequest;return r.name!=null&&(u.name=String(r.name)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name=""),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.longrunning.GetOperationRequest"},i}(),c.ListOperationsRequest=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 4:{d.name=r.string();break}case 1:{d.filter=r.string();break}case 2:{d.pageSize=r.int32();break}case 3:{d.pageToken=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name)?"name: string expected":r.filter!=null&&r.hasOwnProperty("filter")&&!l.isString(r.filter)?"filter: string expected":r.pageSize!=null&&r.hasOwnProperty("pageSize")&&!l.isInteger(r.pageSize)?"pageSize: integer expected":r.pageToken!=null&&r.hasOwnProperty("pageToken")&&!l.isString(r.pageToken)?"pageToken: string expected":null},i.fromObject=function(r){if(r instanceof I.google.longrunning.ListOperationsRequest)return r;var u=new I.google.longrunning.ListOperationsRequest;return r.name!=null&&(u.name=String(r.name)),r.filter!=null&&(u.filter=String(r.filter)),r.pageSize!=null&&(u.pageSize=r.pageSize|0),r.pageToken!=null&&(u.pageToken=String(r.pageToken)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.filter="",o.pageSize=0,o.pageToken="",o.name=""),r.filter!=null&&r.hasOwnProperty("filter")&&(o.filter=r.filter),r.pageSize!=null&&r.hasOwnProperty("pageSize")&&(o.pageSize=r.pageSize),r.pageToken!=null&&r.hasOwnProperty("pageToken")&&(o.pageToken=r.pageToken),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.longrunning.ListOperationsRequest"},i}(),c.ListOperationsResponse=function(){function i(s){if(this.operations=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.operations&&d.operations.length||(d.operations=[]),d.operations.push(I.google.longrunning.Operation.decode(r,r.uint32()));break}case 2:{d.nextPageToken=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.operations!=null&&r.hasOwnProperty("operations")){if(!Array.isArray(r.operations))return"operations: array expected";for(var u=0;u>>3){case 1:{d.name=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name)?"name: string expected":null},i.fromObject=function(r){if(r instanceof I.google.longrunning.CancelOperationRequest)return r;var u=new I.google.longrunning.CancelOperationRequest;return r.name!=null&&(u.name=String(r.name)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name=""),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.longrunning.CancelOperationRequest"},i}(),c.DeleteOperationRequest=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name)?"name: string expected":null},i.fromObject=function(r){if(r instanceof I.google.longrunning.DeleteOperationRequest)return r;var u=new I.google.longrunning.DeleteOperationRequest;return r.name!=null&&(u.name=String(r.name)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name=""),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.longrunning.DeleteOperationRequest"},i}(),c.WaitOperationRequest=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.name=r.string();break}case 2:{d.timeout=I.google.protobuf.Duration.decode(r,r.uint32());break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")&&!l.isString(r.name))return"name: string expected";if(r.timeout!=null&&r.hasOwnProperty("timeout")){var u=I.google.protobuf.Duration.verify(r.timeout);if(u)return"timeout."+u}return null},i.fromObject=function(r){if(r instanceof I.google.longrunning.WaitOperationRequest)return r;var u=new I.google.longrunning.WaitOperationRequest;if(r.name!=null&&(u.name=String(r.name)),r.timeout!=null){if(typeof r.timeout!="object")throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected");u.timeout=I.google.protobuf.Duration.fromObject(r.timeout)}return u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.name="",o.timeout=null),r.name!=null&&r.hasOwnProperty("name")&&(o.name=r.name),r.timeout!=null&&r.hasOwnProperty("timeout")&&(o.timeout=I.google.protobuf.Duration.toObject(r.timeout,u)),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.longrunning.WaitOperationRequest"},i}(),c.OperationInfo=function(){function i(s){if(s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.responseType=r.string();break}case 2:{d.metadataType=r.string();break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.responseType!=null&&r.hasOwnProperty("responseType")&&!l.isString(r.responseType)?"responseType: string expected":r.metadataType!=null&&r.hasOwnProperty("metadataType")&&!l.isString(r.metadataType)?"metadataType: string expected":null},i.fromObject=function(r){if(r instanceof I.google.longrunning.OperationInfo)return r;var u=new I.google.longrunning.OperationInfo;return r.responseType!=null&&(u.responseType=String(r.responseType)),r.metadataType!=null&&(u.metadataType=String(r.metadataType)),u},i.toObject=function(r,u){u||(u={});var o={};return u.defaults&&(o.responseType="",o.metadataType=""),r.responseType!=null&&r.hasOwnProperty("responseType")&&(o.responseType=r.responseType),r.metadataType!=null&&r.hasOwnProperty("metadataType")&&(o.metadataType=r.metadataType),o},i.prototype.toJSON=function(){return this.constructor.toObject(this,t.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/google.longrunning.OperationInfo"},i}(),c}(),a.rpc=function(){var c={};return c.Status=function(){function i(s){if(this.details=[],s)for(var r=Object.keys(s),u=0;u>>3){case 1:{d.code=r.int32();break}case 2:{d.message=r.string();break}case 3:{d.details&&d.details.length||(d.details=[]),d.details.push(I.google.protobuf.Any.decode(r,r.uint32()));break}default:r.skipType(b&7);break}}return d},i.decodeDelimited=function(r){return r instanceof e||(r=new e(r)),this.decode(r,r.uint32())},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.code!=null&&r.hasOwnProperty("code")&&!l.isInteger(r.code))return"code: integer expected";if(r.message!=null&&r.hasOwnProperty("message")&&!l.isString(r.message))return"message: string expected";if(r.details!=null&&r.hasOwnProperty("details")){if(!Array.isArray(r.details))return"details: array expected";for(var u=0;u{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.protos=Jm.TextServiceClient=Jm.ModelServiceClient=Jm.DiscussServiceClient=Jm.v1beta3=Jm.v1beta2=void 0;var Aq=Rbn();Jm.v1beta2=Aq;var kbn=Ebn();Jm.v1beta3=kbn;var xbn=Aq.DiscussServiceClient;Jm.DiscussServiceClient=xbn;var jbn=Aq.ModelServiceClient;Jm.ModelServiceClient=jbn;var Obn=Aq.TextServiceClient;Jm.TextServiceClient=Obn;Jm.default={v1beta2:Aq,v1beta3:kbn,DiscussServiceClient:xbn,ModelServiceClient:jbn,TextServiceClient:Obn};var AvI=Lbn();Jm.protos=AvI});var zbn=B(()=>{iZe()});var Fq,Bbn=B(()=>{jF();TP();mSe();Fq=class extends Uu{static lc_name(){return"RunnablePassthrough"}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,"func",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e&&(this.func=e.func)}async invoke(e,n){let l=dr(n);return this.func&&await this.func(e,l),this._callWithConfig(I=>Promise.resolve(I),e,l)}async*transform(e,n){let l=dr(n),I,a=!0;for await(let c of this._transformStreamWithConfig(e,i=>i,l))if(yield c,a)if(I===void 0)I=c;else try{I=jb(I,c)}catch{I=void 0,a=!1}this.func&&I!==void 0&&await this.func(I,l)}static assign(e){return new MP(new JJ({steps:e}))}}});function Sbn(t){return typeof t?.parse=="function"}var Mbn=B(()=>{});var TVe,Tbn=B(()=>{v5();iZe();UP();HSe();kP();TP();nZe();$he();jF();Bbn();Mbn();TVe=class t extends LO{constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","chat_models",this._llmType()]})}_separateRunnableConfigFromCallOptionsCompat(e){let[n,l]=super._separateRunnableConfigFromCallOptions(e);return l.signal=n.signal,[n,l]}async invoke(e,n){let l=t._convertInputToPromptValue(e);return(await this.generatePrompt([l],n,n?.callbacks)).generations[0][0].message}async*_streamResponseChunks(e,n,l){throw new Error("Not implemented.")}async*_streamIterator(e,n){if(this._streamResponseChunks===t.prototype._streamResponseChunks)yield this.invoke(e,n);else{let I=t._convertInputToPromptValue(e).toChatMessages(),[a,c]=this._separateRunnableConfigFromCallOptionsCompat(n),i={...a.metadata,...this.getLsParams(c)},s=await xd.configure(a.callbacks,this.callbacks,a.tags,this.tags,i,this.metadata,{verbose:this.verbose}),r={options:c,invocation_params:this?.invocationParams(c),batch_size:1},u=await s?.handleChatModelStart(this.toJSON(),[I],a.runId,void 0,r,void 0,void 0,a.runName),o;try{for await(let d of this._streamResponseChunks(I,c,u?.[0])){if(d.message.id==null){let b=u?.at(0)?.runId;b!=null&&d.message._updateId(`run-${b}`)}d.message.response_metadata={...d.generationInfo,...d.message.response_metadata},yield d.message,o?o=o.concat(d):o=d}}catch(d){throw await Promise.all((u??[]).map(b=>b?.handleLLMError(d))),d}await Promise.all((u??[]).map(d=>d?.handleLLMEnd({generations:[[o]]})))}}getLsParams(e){return{ls_model_type:"chat",ls_stop:e.stop}}async _generateUncached(e,n,l){let I=e.map(b=>b.map(RJ)),a={...l.metadata,...this.getLsParams(n)},c=await xd.configure(l.callbacks,this.callbacks,l.tags,this.tags,a,this.metadata,{verbose:this.verbose}),i={options:n,invocation_params:this?.invocationParams(n),batch_size:1},s=await c?.handleChatModelStart(this.toJSON(),I,l.runId,void 0,i,void 0,void 0,l.runName),r=[],u=[];if(!!s?.[0].handlers.find(b=>JO(b)||QO(b))&&I.length===1&&this._streamResponseChunks!==t.prototype._streamResponseChunks)try{let b=await this._streamResponseChunks(I[0],n,s?.[0]),h;for await(let Z of b){if(Z.message.id==null){let N=s?.at(0)?.runId;N!=null&&Z.message._updateId(`run-${N}`)}h===void 0?h=Z:h=jb(h,Z)}if(h===void 0)throw new Error("Received empty response from chat model call.");r.push([h]),await s?.[0].handleLLMEnd({generations:r,llmOutput:{}})}catch(b){throw await s?.[0].handleLLMError(b),b}else{let b=await Promise.allSettled(I.map((h,Z)=>this._generate(h,{...n,promptIndex:Z},s?.[Z])));await Promise.all(b.map(async(h,Z)=>{if(h.status==="fulfilled"){let N=h.value;for(let g of N.generations){if(g.message.id==null){let y=s?.at(0)?.runId;y!=null&&g.message._updateId(`run-${y}`)}g.message.response_metadata={...g.generationInfo,...g.message.response_metadata}}return N.generations.length===1&&(N.generations[0].message.response_metadata={...N.llmOutput,...N.generations[0].message.response_metadata}),r[Z]=N.generations,u[Z]=N.llmOutput,s?.[Z]?.handleLLMEnd({generations:[N.generations],llmOutput:N.llmOutput})}else return await s?.[Z]?.handleLLMError(h.reason),Promise.reject(h.reason)}))}let d={generations:r,llmOutput:u.length?this._combineLLMOutput?.(...u):void 0};return Object.defineProperty(d,EO,{value:s?{runIds:s?.map(b=>b.runId)}:void 0,configurable:!0}),d}async _generateCached({messages:e,cache:n,llmStringKey:l,parsedOptions:I,handledOptions:a}){let c=e.map(N=>N.map(RJ)),i={...a.metadata,...this.getLsParams(I)},s=await xd.configure(a.callbacks,this.callbacks,a.tags,this.tags,i,this.metadata,{verbose:this.verbose}),r={options:I,invocation_params:this?.invocationParams(I),batch_size:1,cached:!0},u=await s?.handleChatModelStart(this.toJSON(),c,a.runId,void 0,r,void 0,void 0,a.runName),o=[],b=(await Promise.allSettled(c.map(async(N,g)=>{let y=t._convertInputToPromptValue(N).toString(),X=await n.lookup(y,l);return X==null&&o.push(g),X}))).map((N,g)=>({result:N,runManager:u?.[g]})).filter(({result:N})=>N.status==="fulfilled"&&N.value!=null||N.status==="rejected"),h=[];await Promise.all(b.map(async({result:N,runManager:g},y)=>{if(N.status==="fulfilled"){let X=N.value;return h[y]=X,X.length&&await g?.handleLLMNewToken(X[0].text),g?.handleLLMEnd({generations:[X]})}else return await g?.handleLLMError(N.reason),Promise.reject(N.reason)}));let Z={generations:h,missingPromptIndices:o};return Object.defineProperty(Z,EO,{value:u?{runIds:u?.map(N=>N.runId)}:void 0,configurable:!0}),Z}async generate(e,n,l){let I;Array.isArray(n)?I={stop:n}:I=n;let a=e.map(b=>b.map(RJ)),[c,i]=this._separateRunnableConfigFromCallOptionsCompat(I);if(c.callbacks=c.callbacks??l,!this.cache)return this._generateUncached(a,i,c);let{cache:s}=this,r=this._getSerializedCacheKeyParametersForCall(i),{generations:u,missingPromptIndices:o}=await this._generateCached({messages:a,cache:s,llmStringKey:r,parsedOptions:i,handledOptions:c}),d={};if(o.length>0){let b=await this._generateUncached(o.map(h=>a[h]),i,c);await Promise.all(b.generations.map(async(h,Z)=>{let N=o[Z];u[N]=h;let g=t._convertInputToPromptValue(a[N]).toString();return s.update(g,r,h)})),d=b.llmOutput??{}}return{generations:u,llmOutput:d}}invocationParams(e){return{}}_modelType(){return"base_chat_model"}serialize(){return{...this.invocationParams(),_type:this._llmType(),_model:this._modelType()}}async generatePrompt(e,n,l){let I=e.map(a=>a.toChatMessages());return this.generate(I,n,l)}async call(e,n,l){return(await this.generate([e.map(RJ)],n,l)).generations[0][0].message}async callPrompt(e,n,l){let I=e.toChatMessages();return this.call(I,n,l)}async predictMessages(e,n,l){return this.call(e,n,l)}async predict(e,n,l){let I=new XR(e),a=await this.call([I],n,l);if(typeof a.content!="string")throw new Error("Cannot use predict when output is not a string.");return a.content}withStructuredOutput(e,n){if(typeof this.bindTools!="function")throw new Error('Chat model must implement ".bindTools()" to use withStructuredOutput.');let l=e,I=n?.name,a=l.description??"A function available to call.",c=n?.method,i=n?.includeRaw;if(c==="jsonMode")throw new Error('Base withStructuredOutput implementation only supports "functionCalling" as a method.');let s=I??"extract",r;Sbn(l)?r=[{type:"function",function:{name:s,description:a,parameters:JN(l)}}]:("name"in l&&(s=l.name),r=[{type:"function",function:{name:s,description:a,parameters:l}}]);let u=this.bindTools(r),o=CJ.from(Z=>{if(!Z.tool_calls||Z.tool_calls.length===0)throw new Error("No tool calls found in the response.");let N=Z.tool_calls.find(g=>g.name===s);if(!N)throw new Error(`No tool call found with name ${s}.`);return N.args});if(!i)return u.pipe(o).withConfig({runName:"StructuredOutput"});let d=Fq.assign({parsed:(Z,N)=>o.invoke(Z.raw,N)}),b=Fq.assign({parsed:()=>null}),h=d.withFallbacks({fallbacks:[b]});return CO.from([{raw:u},h]).withConfig({runName:"StructuredOutputRunnable"})}}});var Dbn=B(()=>{Tbn()});function vq(t){let e=t._getType();return yO.isInstance(t)?t.role:t.name??e}var Kbn,_bn,XPe,Pbn=B(()=>{Kbn=$(Ubn(),1),_bn=$(UKe(),1);zbn();CSe();Dbn();XPe=class extends TVe{static lc_name(){return"ChatGooglePaLM"}get lc_secrets(){return{apiKey:"GOOGLE_PALM_API_KEY"}}constructor(e){if(super(e??{}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"models/chat-bison-001"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"models/chat-bison-001"}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topK",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.modelName=e?.model??e?.modelName??this.model,this.model=this.modelName,this.temperature=e?.temperature??this.temperature,this.temperature&&(this.temperature<0||this.temperature>1))throw new Error("`temperature` must be in the range of [0.0,1.0]");if(this.topP=e?.topP??this.topP,this.topP&&this.topP<0)throw new Error("`topP` must be a positive integer");if(this.topK=e?.topK??this.topK,this.topK&&this.topK<0)throw new Error("`topK` must be a positive integer");if(this.examples=e?.examples?.map(n=>{if(vP(n.input)&&typeof n.input.content!="string"||vP(n.output)&&typeof n.output.content!="string")throw new Error("GooglePaLM example messages may only have string content.");return{input:{...n.input,content:n.input?.content},output:{...n.output,content:n.output?.content}}})??this.examples,this.apiKey=e?.apiKey??Hm("GOOGLE_PALM_API_KEY"),!this.apiKey)throw new Error("Please set an API key for Google Palm 2 in the environment variable GOOGLE_PALM_API_KEY or in the `apiKey` field of the GooglePalm constructor");this.client=new Kbn.DiscussServiceClient({authClient:new _bn.GoogleAuth().fromAPIKey(this.apiKey)})}_combineLLMOutput(){return[]}_llmType(){return"googlepalm"}async _generate(e,n,l){let I=await this.caller.callWithOptions({signal:n.signal},this._generateMessage.bind(this),this._mapBaseMessagesToPalmMessages(e),this._getPalmContextInstruction(e),this.examples),a=this._mapPalmMessagesToChatResult(I);return l?.handleLLMNewToken(a.generations.length>0?a.generations[0].text:""),a}async _generateMessage(e,n,l){let[I]=await this.client.generateMessage({candidateCount:1,model:this.model,temperature:this.temperature,topK:this.topK,topP:this.topP,prompt:{context:n,examples:l,messages:e}});return I}_getPalmContextInstruction(e){let n=e.length>0&&vq(e[0])==="system"?e[0]:void 0;if(n?.content!==void 0&&typeof n.content!="string")throw new Error("Non-string system message content is not supported.");return n?.content}_mapBaseMessagesToPalmMessages(e){let n=e.filter(l=>vq(l)!=="system");return n.forEach((l,I)=>{if(!(I<1)&&vq(l)===vq(n[I-1]))throw new Error("Google PaLM requires alternate messages between authors")}),n.map(l=>{if(typeof l.content!="string")throw new Error("ChatGooglePaLM does not support non-string message content.");return{author:vq(l),content:l.content,citationMetadata:{citationSources:l.additional_kwargs.citationSources}}})}_mapPalmMessagesToChatResult(e){if(e.candidates&&e.candidates.length>0&&e.candidates[0]){let n=e.candidates[0];return{generations:[{text:n.content??"",message:new $V({content:n.content??"",name:n.author===null?void 0:n.author,additional_kwargs:{citationSources:n.citationMetadata?.citationSources,filters:e.filters}})}]}}return{generations:[],llmOutput:{filters:e.filters}}}}});var qbn={};Xe(qbn,{ChatGooglePaLM:()=>XPe});var $bn=B(()=>{Pbn()});function HvI(t){let e=[];return t?.apiClient&&e.push(t.apiClient),e.push(`${wvI}/${XvI}`),e.join(" ")}async function QvI(t){var e;let n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",HvI(t.requestOptions)),n.append("x-goog-api-key",t.apiKey);let l=(e=t.requestOptions)===null||e===void 0?void 0:e.customHeaders;if(l){if(!(l instanceof Headers))try{l=new Headers(l)}catch(I){throw new $R(`unable to convert customHeaders value ${JSON.stringify(l)} to Headers: ${I.message}`)}for(let[I,a]of l.entries()){if(I==="x-goog-api-key")throw new $R(`Cannot set reserved header name ${I}`);if(I==="x-goog-api-client")throw new $R(`Header name ${I} can only be set using the apiClient field`);n.append(I,a)}}return n}async function EvI(t,e,n,l,I,a){let c=new wPe(t,e,n,l,a);return{url:c.toString(),fetchOptions:Object.assign(Object.assign({},kvI(a)),{method:"POST",headers:await QvI(c),body:I})}}async function Qq(t,e,n,l,I,a={},c=fetch){let{url:i,fetchOptions:s}=await EvI(t,e,n,l,I,a);return JvI(i,s,c)}async function JvI(t,e,n=fetch){let l;try{l=await n(t,e)}catch(I){CvI(I,t)}return l.ok||await LvI(l,t),l}function CvI(t,e){let n=t;throw n.name==="AbortError"?(n=new _Ve(`Request aborted when fetching ${e.toString()}: ${t.message}`),n.stack=t.stack):t instanceof KVe||t instanceof $R||(n=new _d(`Error fetching from ${e.toString()}: ${t.message}`),n.stack=t.stack),n}async function LvI(t,e){let n="",l;try{let I=await t.json();n=I.error.message,I.error.details&&(n+=` ${JSON.stringify(I.error.details)}`,l=I.error.details)}catch{}throw new KVe(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${n}`,t.status,t.statusText,l)}function kvI(t){let e={};if(t?.signal!==void 0||t?.timeout>=0){let n=new AbortController;t?.timeout>=0&&setTimeout(()=>n.abort(),t.timeout),t?.signal&&t.signal.addEventListener("abort",()=>{n.abort()}),e.signal=n.signal}return e}function QPe(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),DVe(t.candidates[0]))throw new $w(`${eH(t)}`,t);return xvI(t)}else if(t.promptFeedback)throw new $w(`Text not available. ${eH(t)}`,t);return""},t.functionCall=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),DVe(t.candidates[0]))throw new $w(`${eH(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),umn(t)[0]}else if(t.promptFeedback)throw new $w(`Function call not available. ${eH(t)}`,t)},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),DVe(t.candidates[0]))throw new $w(`${eH(t)}`,t);return umn(t)}else if(t.promptFeedback)throw new $w(`Function call not available. ${eH(t)}`,t)},t}function xvI(t){var e,n,l,I;let a=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(let c of(I=(l=t.candidates)===null||l===void 0?void 0:l[0].content)===null||I===void 0?void 0:I.parts)c.text&&a.push(c.text),c.executableCode&&a.push("\n```"+c.executableCode.language+` +`+c.executableCode.code+"\n```\n"),c.codeExecutionResult&&a.push("\n```\n"+c.codeExecutionResult.output+"\n```\n");return a.length>0?a.join(""):""}function umn(t){var e,n,l,I;let a=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(let c of(I=(l=t.candidates)===null||l===void 0?void 0:l[0].content)===null||I===void 0?void 0:I.parts)c.functionCall&&a.push(c.functionCall);if(a.length>0)return a}function DVe(t){return!!t.finishReason&&jvI.includes(t.finishReason)}function eH(t){var e,n,l;let I="";if((!t.candidates||t.candidates.length===0)&&t.promptFeedback)I+="Response was blocked",!((e=t.promptFeedback)===null||e===void 0)&&e.blockReason&&(I+=` due to ${t.promptFeedback.blockReason}`),!((n=t.promptFeedback)===null||n===void 0)&&n.blockReasonMessage&&(I+=`: ${t.promptFeedback.blockReasonMessage}`);else if(!((l=t.candidates)===null||l===void 0)&&l[0]){let a=t.candidates[0];DVe(a)&&(I+=`Candidate was blocked due to ${a.finishReason}`,a.finishMessage&&(I+=`: ${a.finishMessage}`))}return I}function wq(t){return this instanceof wq?(this.v=t,this):new wq(t)}function OvI(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=n.apply(t,e||[]),I,a=[];return I={},c("next"),c("throw"),c("return"),I[Symbol.asyncIterator]=function(){return this},I;function c(d){l[d]&&(I[d]=function(b){return new Promise(function(h,Z){a.push([d,b,h,Z])>1||i(d,b)})})}function i(d,b){try{s(l[d](b))}catch(h){o(a[0][3],h)}}function s(d){d.value instanceof wq?Promise.resolve(d.value.v).then(r,u):o(a[0][2],d)}function r(d){i("next",d)}function u(d){i("throw",d)}function o(d,b){d(b),a.shift(),a.length&&i(a[0][0],a[0][1])}}function UvI(t){let e=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),n=SvI(e),[l,I]=n.tee();return{stream:BvI(l),response:zvI(I)}}async function zvI(t){let e=[],n=t.getReader();for(;;){let{done:l,value:I}=await n.read();if(l)return QPe(MvI(e));e.push(I)}}function BvI(t){return OvI(this,arguments,function*(){let n=t.getReader();for(;;){let{value:l,done:I}=yield wq(n.read());if(I)break;yield yield wq(QPe(l))}})}function SvI(t){let e=t.getReader();return new ReadableStream({start(l){let I="";return a();function a(){return e.read().then(({value:c,done:i})=>{if(i){if(I.trim()){l.error(new _d("Failed to parse stream"));return}l.close();return}I+=c;let s=I.match(dmn),r;for(;s;){try{r=JSON.parse(s[1])}catch{l.error(new _d(`Error parsing JSON response: "${s[1]}"`));return}l.enqueue(r),I=I.substring(s[0].length),s=I.match(dmn)}return a()}).catch(c=>{let i=c;throw i.stack=c.stack,i.name==="AbortError"?i=new _Ve("Request aborted when reading from the stream"):i=new _d("Error reading from the stream"),i})}}})}function MvI(t){let e=t[t.length-1],n={promptFeedback:e?.promptFeedback};for(let l of t){if(l.candidates){let I=0;for(let a of l.candidates)if(n.candidates||(n.candidates=[]),n.candidates[I]||(n.candidates[I]={index:I}),n.candidates[I].citationMetadata=a.citationMetadata,n.candidates[I].groundingMetadata=a.groundingMetadata,n.candidates[I].finishReason=a.finishReason,n.candidates[I].finishMessage=a.finishMessage,n.candidates[I].safetyRatings=a.safetyRatings,a.content&&a.content.parts){n.candidates[I].content||(n.candidates[I].content={role:a.content.role||"user",parts:[]});let c={};for(let i of a.content.parts)i.text&&(c.text=i.text),i.functionCall&&(c.functionCall=i.functionCall),i.executableCode&&(c.executableCode=i.executableCode),i.codeExecutionResult&&(c.codeExecutionResult=i.codeExecutionResult),Object.keys(c).length===0&&(c.text=""),n.candidates[I].content.parts.push(c)}I++}l.usageMetadata&&(n.usageMetadata=l.usageMetadata)}return n}async function hmn(t,e,n,l){let I=await Qq(e,bC.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(n),l);return UvI(I)}async function Zmn(t,e,n,l){let a=await(await Qq(e,bC.GENERATE_CONTENT,t,!1,JSON.stringify(n),l)).json();return{response:QPe(a)}}function Wmn(t){if(t!=null){if(typeof t=="string")return{role:"system",parts:[{text:t}]};if(t.text)return{role:"system",parts:[t]};if(t.parts)return t.role?t:{role:"system",parts:t.parts}}}function Hq(t){let e=[];if(typeof t=="string")e=[{text:t}];else for(let n of t)typeof n=="string"?e.push({text:n}):e.push(n);return TvI(e)}function TvI(t){let e={role:"user",parts:[]},n={role:"function",parts:[]},l=!1,I=!1;for(let a of t)"functionResponse"in a?(n.parts.push(a),I=!0):(e.parts.push(a),l=!0);if(l&&I)throw new _d("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");if(!l&&!I)throw new _d("No content is provided for sending chat message.");return l?e:n}function DvI(t,e){var n;let l={model:e?.model,generationConfig:e?.generationConfig,safetySettings:e?.safetySettings,tools:e?.tools,toolConfig:e?.toolConfig,systemInstruction:e?.systemInstruction,cachedContent:(n=e?.cachedContent)===null||n===void 0?void 0:n.name,contents:[]},I=t.generateContentRequest!=null;if(t.contents){if(I)throw new $R("CountTokensRequest must have one of contents or generateContentRequest, not both.");l.contents=t.contents}else if(I)l=Object.assign(Object.assign({},l),t.generateContentRequest);else{let a=Hq(t);l.contents=[a]}return{generateContentRequest:l}}function Gmn(t){let e;return t.contents?e=t:e={contents:[Hq(t)]},t.systemInstruction&&(e.systemInstruction=Wmn(t.systemInstruction)),e}function KvI(t){return typeof t=="string"||Array.isArray(t)?{content:Hq(t)}:t}function PvI(t){let e=!1;for(let n of t){let{role:l,parts:I}=n;if(!e&&l!=="user")throw new _d(`First content should be with role 'user', got ${l}`);if(!Imn.includes(l))throw new _d(`Each item should include role field. Got ${l} but valid roles are: ${JSON.stringify(Imn)}`);if(!Array.isArray(I))throw new _d("Content should have 'parts' property with an array of Parts");if(I.length===0)throw new _d("Each Content should have at least one part");let a={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(let i of I)for(let s of bmn)s in i&&(a[s]+=1);let c=_vI[l];for(let i of bmn)if(!c.includes(i)&&a[i]>0)throw new _d(`Content with role '${l}' can't contain '${i}' part`);e=!0}}function mmn(t){var e;if(t.candidates===void 0||t.candidates.length===0)return!1;let n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;if(n===void 0||n.parts===void 0||n.parts.length===0)return!1;for(let l of n.parts)if(l===void 0||Object.keys(l).length===0||l.text!==void 0&&l.text==="")return!1;return!0}async function qvI(t,e,n,l){return(await Qq(e,bC.COUNT_TOKENS,t,!1,JSON.stringify(n),l)).json()}async function $vI(t,e,n,l){return(await Qq(e,bC.EMBED_CONTENT,t,!1,JSON.stringify(n),l)).json()}async function efI(t,e,n,l){let I=n.requests.map(c=>Object.assign(Object.assign({},c),{model:e}));return(await Qq(e,bC.BATCH_EMBED_CONTENTS,t,!1,JSON.stringify({requests:I}),l)).json()}var tmn,nmn,lmn,Imn,amn,rmn,cmn,omn,Xq,imn,GC,smn,_d,$w,KVe,$R,_Ve,vvI,fvI,XvI,wvI,bC,wPe,jvI,dmn,bmn,_vI,pmn,HPe,PVe,mC,qVe=B(()=>{(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(tmn||(tmn={}));(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})(nmn||(nmn={}));(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(lmn||(lmn={}));Imn=["user","model","function","system"];(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(amn||(amn={}));(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(rmn||(rmn={}));(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(cmn||(cmn={}));(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(omn||(omn={}));(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.OTHER="OTHER"})(Xq||(Xq={}));(function(t){t.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",t.RETRIEVAL_QUERY="RETRIEVAL_QUERY",t.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",t.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",t.CLASSIFICATION="CLASSIFICATION",t.CLUSTERING="CLUSTERING"})(imn||(imn={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(GC||(GC={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(smn||(smn={}));_d=class extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}},$w=class extends _d{constructor(e,n){super(e),this.response=n}},KVe=class extends _d{constructor(e,n,l,I){super(e),this.status=n,this.statusText=l,this.errorDetails=I}},$R=class extends _d{},_Ve=class extends _d{};vvI="https://generativelanguage.googleapis.com",fvI="v1beta",XvI="0.24.1",wvI="genai-js";(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(bC||(bC={}));wPe=class{constructor(e,n,l,I,a){this.model=e,this.task=n,this.apiKey=l,this.stream=I,this.requestOptions=a}toString(){var e,n;let l=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||fvI,a=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||vvI}/${l}/${this.model}:${this.task}`;return this.stream&&(a+="?alt=sse"),a}};jvI=[Xq.RECITATION,Xq.SAFETY,Xq.LANGUAGE];dmn=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;bmn=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],_vI={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};pmn="SILENT_ERROR",HPe=class{constructor(e,n,l,I={}){this.model=n,this.params=l,this._requestOptions=I,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,l?.history&&(PvI(l.history),this._history=l.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,n={}){var l,I,a,c,i,s;await this._sendPromise;let r=Hq(e),u={safetySettings:(l=this.params)===null||l===void 0?void 0:l.safetySettings,generationConfig:(I=this.params)===null||I===void 0?void 0:I.generationConfig,tools:(a=this.params)===null||a===void 0?void 0:a.tools,toolConfig:(c=this.params)===null||c===void 0?void 0:c.toolConfig,systemInstruction:(i=this.params)===null||i===void 0?void 0:i.systemInstruction,cachedContent:(s=this.params)===null||s===void 0?void 0:s.cachedContent,contents:[...this._history,r]},o=Object.assign(Object.assign({},this._requestOptions),n),d;return this._sendPromise=this._sendPromise.then(()=>Zmn(this._apiKey,this.model,u,o)).then(b=>{var h;if(mmn(b.response)){this._history.push(r);let Z=Object.assign({parts:[],role:"model"},(h=b.response.candidates)===null||h===void 0?void 0:h[0].content);this._history.push(Z)}else{let Z=eH(b.response);Z&&console.warn(`sendMessage() was unsuccessful. ${Z}. Inspect response object for details.`)}d=b}).catch(b=>{throw this._sendPromise=Promise.resolve(),b}),await this._sendPromise,d}async sendMessageStream(e,n={}){var l,I,a,c,i,s;await this._sendPromise;let r=Hq(e),u={safetySettings:(l=this.params)===null||l===void 0?void 0:l.safetySettings,generationConfig:(I=this.params)===null||I===void 0?void 0:I.generationConfig,tools:(a=this.params)===null||a===void 0?void 0:a.tools,toolConfig:(c=this.params)===null||c===void 0?void 0:c.toolConfig,systemInstruction:(i=this.params)===null||i===void 0?void 0:i.systemInstruction,cachedContent:(s=this.params)===null||s===void 0?void 0:s.cachedContent,contents:[...this._history,r]},o=Object.assign(Object.assign({},this._requestOptions),n),d=hmn(this._apiKey,this.model,u,o);return this._sendPromise=this._sendPromise.then(()=>d).catch(b=>{throw new Error(pmn)}).then(b=>b.response).then(b=>{if(mmn(b)){this._history.push(r);let h=Object.assign({},b.candidates[0].content);h.role||(h.role="model"),this._history.push(h)}else{let h=eH(b);h&&console.warn(`sendMessageStream() was unsuccessful. ${h}. Inspect response object for details.`)}}).catch(b=>{b.message!==pmn&&console.error(b)}),d}};PVe=class{constructor(e,n,l={}){this.apiKey=e,this._requestOptions=l,n.model.includes("/")?this.model=n.model:this.model=`models/${n.model}`,this.generationConfig=n.generationConfig||{},this.safetySettings=n.safetySettings||[],this.tools=n.tools,this.toolConfig=n.toolConfig,this.systemInstruction=Wmn(n.systemInstruction),this.cachedContent=n.cachedContent}async generateContent(e,n={}){var l;let I=Gmn(e),a=Object.assign(Object.assign({},this._requestOptions),n);return Zmn(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(l=this.cachedContent)===null||l===void 0?void 0:l.name},I),a)}async generateContentStream(e,n={}){var l;let I=Gmn(e),a=Object.assign(Object.assign({},this._requestOptions),n);return hmn(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(l=this.cachedContent)===null||l===void 0?void 0:l.name},I),a)}startChat(e){var n;return new HPe(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},e),this._requestOptions)}async countTokens(e,n={}){let l=DvI(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),I=Object.assign(Object.assign({},this._requestOptions),n);return qvI(this.apiKey,this.model,l,I)}async embedContent(e,n={}){let l=KvI(e),I=Object.assign(Object.assign({},this._requestOptions),n);return $vI(this.apiKey,this.model,l,I)}async batchEmbedContents(e,n={}){let l=Object.assign(Object.assign({},this._requestOptions),n);return efI(this.apiKey,this.model,e,l)}};mC=class{constructor(e){this.apiKey=e}getGenerativeModel(e,n){if(!e.model)throw new _d("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new PVe(this.apiKey,e,n)}getGenerativeModelFromCachedContent(e,n,l){if(!e.name)throw new $R("Cached content must contain a `name` field.");if(!e.model)throw new $R("Cached content must contain a `model` field.");let I=["model","systemInstruction"];for(let c of I)if(n?.[c]&&e[c]&&n?.[c]!==e[c]){if(c==="model"){let i=n.model.startsWith("models/")?n.model.replace("models/",""):n.model,s=e.model.startsWith("models/")?e.model.replace("models/",""):e.model;if(i===s)continue}throw new $R(`Different value for "${c}" specified in modelParams (${n[c]}) and cachedContent (${e[c]})`)}let a=Object.assign(Object.assign({},n),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new PVe(this.apiKey,a,l)}}});function r2(t){if(typeof t=="object"&&t!==null){let e={...t};"additionalProperties"in e&&delete e.additionalProperties,"$schema"in e&&delete e.$schema,"strict"in e&&delete e.strict;for(let n in e)n in e&&(Array.isArray(e[n])?e[n]=e[n].map(r2):typeof e[n]=="object"&&e[n]!==null&&(e[n]=r2(e[n])));return e}return t}function Eq(t){let e=r2(wr(t)?Wl(t):t),{$schema:n,...l}=e;return l}function Nmn(t){let e=r2(t),{$schema:n,...l}=e;return l}var $Ve=B(()=>{ep();tp()});function Vmn(t,e=0){return(SG[t[e+0]]+SG[t[e+1]]+SG[t[e+2]]+SG[t[e+3]]+"-"+SG[t[e+4]]+SG[t[e+5]]+"-"+SG[t[e+6]]+SG[t[e+7]]+"-"+SG[t[e+8]]+SG[t[e+9]]+"-"+SG[t[e+10]]+SG[t[e+11]]+SG[t[e+12]]+SG[t[e+13]]+SG[t[e+14]]+SG[t[e+15]]).toLowerCase()}var SG,Ymn=B(()=>{SG=[];for(let t=0;t<256;++t)SG.push((t+256).toString(16).slice(1))});function JPe(){if(!EPe){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");EPe=crypto.getRandomValues.bind(crypto)}return EPe(tfI)}var EPe,tfI,gmn=B(()=>{tfI=new Uint8Array(16)});var nfI,CPe,Rmn=B(()=>{nfI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),CPe={randomUUID:nfI}});function lfI(t,e,n){if(CPe.randomUUID&&!e&&!t)return CPe.randomUUID();t=t||{};let l=t.random??t.rng?.()??JPe();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let I=0;I<16;++I)e[n+I]=l[I];return e}return Vmn(l)}var eYe,ymn=B(()=>{Rmn();gmn();Ymn();eYe=lfI});var Amn=B(()=>{ymn()});function IfI(t){let e=t._getType();return lo.isInstance(t)?t.role:e==="tool"?e:t.name??e}function afI(t){switch(t){case"supervisor":case"ai":case"model":return"model";case"system":return"system";case"human":return"user";case"tool":case"function":return"function";default:throw new Error(`Unknown / unsupported author: ${t}`)}}function rfI(t){if("mimeType"in t&&"data"in t)return{inlineData:{mimeType:t.mimeType,data:t.data}};if("mimeType"in t&&"fileUri"in t)return{fileData:{mimeType:t.mimeType,fileUri:t.fileUri}};throw new Error("Invalid media content")}function cfI(t,e){return e.map(n=>qG(n)?n.tool_calls??[]:[]).flat().find(n=>n.id===t.tool_call_id)?.name}function ofI(t){return{providerName:"Google Gemini",fromStandardTextBlock(n){return{text:n.text}},fromStandardImageBlock(n){if(!t)throw new Error("This model does not support images");if(n.source_type==="url"){let l=y2({dataUrl:n.url});return l?{inlineData:{mimeType:l.mime_type,data:l.data}}:{fileData:{mimeType:n.mime_type??"",fileUri:n.url}}}if(n.source_type==="base64")return{inlineData:{mimeType:n.mime_type??"",data:n.data}};throw new Error(`Unsupported source type: ${n.source_type}`)},fromStandardAudioBlock(n){if(!t)throw new Error("This model does not support audio");if(n.source_type==="url"){let l=y2({dataUrl:n.url});return l?{inlineData:{mimeType:l.mime_type,data:l.data}}:{fileData:{mimeType:n.mime_type??"",fileUri:n.url}}}if(n.source_type==="base64")return{inlineData:{mimeType:n.mime_type??"",data:n.data}};throw new Error(`Unsupported source type: ${n.source_type}`)},fromStandardFileBlock(n){if(!t)throw new Error("This model does not support files");if(n.source_type==="text")return{text:n.text};if(n.source_type==="url"){let l=y2({dataUrl:n.url});return l?{inlineData:{mimeType:l.mime_type,data:l.data}}:{fileData:{mimeType:n.mime_type??"",fileUri:n.url}}}if(n.source_type==="base64")return{inlineData:{mimeType:n.mime_type??"",data:n.data}};throw new Error(`Unsupported source type: ${n.source_type}`)}}}function Fmn(t,e){if(uh(t))return az(t,ofI(e));if(t.type==="text")return{text:t.text};if(t.type==="executableCode")return{executableCode:t.executableCode};if(t.type==="codeExecutionResult")return{codeExecutionResult:t.codeExecutionResult};if(t.type==="image_url"){if(!e)throw new Error("This model does not support images");let n;if(typeof t.image_url=="string")n=t.image_url;else if(typeof t.image_url=="object"&&"url"in t.image_url)n=t.image_url.url;else throw new Error("Please provide image as base64 encoded data URL");let[l,I]=n.split(",");if(!l.startsWith("data:"))throw new Error("Please provide image as base64 encoded data URL");let[a,c]=l.replace(/^data:/,"").split(";");if(c!=="base64")throw new Error("Please provide image as base64 encoded data URL");return{inlineData:{data:I,mimeType:a}}}else{if(t.type==="media")return rfI(t);if(t.type==="tool_use")return{functionCall:{name:t.name,args:t.input}};if(t.type?.includes("/")&&t.type.split("/").length===2&&"data"in t&&typeof t.data=="string")return{inlineData:{mimeType:t.type,data:t.data}};if("functionCall"in t)return;throw"type"in t?new Error(`Unknown content type ${t.type}`):new Error(`Unknown content ${JSON.stringify(t)}`)}}function ifI(t,e,n){if(p8(t)){let a=t.name??cfI(t,n);if(a===void 0)throw new Error(`Google requires a tool name for each tool call response, and we could not infer a called tool name for ToolMessage "${t.id}" from your passed messages. Please populate a "name" field on that ToolMessage explicitly.`);let c=Array.isArray(t.content)?t.content.map(i=>Fmn(i,e)).filter(i=>i!==void 0):t.content;return t.status==="error"?[{functionResponse:{name:a,response:{error:{details:c}}}}]:[{functionResponse:{name:a,response:{result:c}}}]}let l=[],I=[];return typeof t.content=="string"&&t.content&&I.push({text:t.content}),Array.isArray(t.content)&&I.push(...t.content.map(a=>Fmn(a,e)).filter(a=>a!==void 0)),qG(t)&&t.tool_calls?.length&&(l=t.tool_calls.map(a=>({functionCall:{name:a.name,args:a.args}}))),[...I,...l]}function LPe(t,e,n=!1){return t.reduce((l,I,a)=>{if(!$r(I))throw new Error("Unsupported message input");let c=IfI(I);if(c==="system"&&a!==0)throw new Error("System message should be the first one");let i=afI(c),s=l.content[l.content.length];if(!l.mergeWithPreviousContent&&s&&s.role===i)throw new Error("Google Generative AI requires alternate messages between authors");let r=ifI(I,e,t.slice(0,a));if(l.mergeWithPreviousContent){let d=l.content[l.content.length-1];if(!d)throw new Error("There was a problem parsing your system message. Please try a prompt without one.");return d.parts.push(...r),{mergeWithPreviousContent:!1,content:l.content}}let u=i;(u==="function"||u==="system"&&!n)&&(u="user");let o={role:u,parts:r};return{mergeWithPreviousContent:c==="system"&&!n,content:[...l.content,o]}},{content:[],mergeWithPreviousContent:!1}).content}function vmn(t,e){if(!t.candidates||t.candidates.length===0||!t.candidates[0])return{generations:[],llmOutput:{filters:t.promptFeedback}};let n=t.functionCalls(),[l]=t.candidates,{content:I,...a}=l,c;Array.isArray(I?.parts)&&I.parts.length===1&&I.parts[0].text?c=I.parts[0].text:Array.isArray(I?.parts)&&I.parts.length>0?c=I.parts.map(r=>"text"in r?{type:"text",text:r.text}:"executableCode"in r?{type:"executableCode",executableCode:r.executableCode}:"codeExecutionResult"in r?{type:"codeExecutionResult",codeExecutionResult:r.codeExecutionResult}:r):c=[];let i="";return typeof c=="string"?i=c:Array.isArray(c)&&c.length>0&&(i=c.find(u=>"text"in u)?.text??i),{generations:[{text:i,message:new _t({content:c??"",tool_calls:n?.map(r=>({...r,type:"tool_call",id:"id"in r&&typeof r.id=="string"?r.id:eYe()})),additional_kwargs:{...a},usage_metadata:e?.usageMetadata}),generationInfo:a}],llmOutput:{tokenUsage:{promptTokens:e?.usageMetadata?.input_tokens,completionTokens:e?.usageMetadata?.output_tokens,totalTokens:e?.usageMetadata?.total_tokens}}}}function fmn(t,e){if(!t.candidates||t.candidates.length===0)return null;let n=t.functionCalls(),[l]=t.candidates,{content:I,...a}=l,c;Array.isArray(I?.parts)&&I.parts.every(r=>"text"in r)?c=I.parts.map(r=>r.text).join(""):Array.isArray(I?.parts)?c=I.parts.map(r=>"text"in r?{type:"text",text:r.text}:"executableCode"in r?{type:"executableCode",executableCode:r.executableCode}:"codeExecutionResult"in r?{type:"codeExecutionResult",codeExecutionResult:r.codeExecutionResult}:r):c=[];let i="";c&&typeof c=="string"?i=c:Array.isArray(c)&&(i=c.find(u=>"text"in u)?.text??"");let s=[];return n&&s.push(...n.map(r=>({...r,args:JSON.stringify(r.args),index:e.index,type:"tool_call_chunk",id:"id"in r&&typeof r.id=="string"?r.id:eYe()}))),new Io({text:i,message:new Jl({content:c||"",name:I?I.role:void 0,tool_call_chunks:s,additional_kwargs:{},usage_metadata:e.usageMetadata}),generationInfo:a})}function Xmn(t){return t.every(e=>"functionDeclarations"in e&&Array.isArray(e.functionDeclarations))?t:[{functionDeclarations:t.map(e=>{if(cb(e)){let n=Eq(e.schema);return n.type==="object"&&"properties"in n&&Object.keys(n.properties).length===0?{name:e.name,description:e.description}:{name:e.name,description:e.description,parameters:n}}return qm(e)?{name:e.function.name,description:e.function.description??"A function available to call.",parameters:Nmn(e.function.parameters)}:e})}]}var kPe=B(()=>{Vr();gh();_N();DN();Amn();$Ve()});var Jq,wmn=B(()=>{Ul();ep();Jq=class extends vo{static lc_name(){return"GoogleGenerativeAIToolsOutputParser"}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","google_genai","output_parsers"]}),Object.defineProperty(this,"returnId",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"keyName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnSingle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"zodSchema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.keyName=e.keyName,this.returnSingle=e.returnSingle??this.returnSingle,this.zodSchema=e.zodSchema}async _validateResult(e){if(this.zodSchema===void 0)return e;let n=await Cy(this.zodSchema,e);if(n.success)return n.data;throw new $t(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(n.error.issues)}`,JSON.stringify(e,null,2))}async parseResult(e){let n=e.flatMap(a=>{let{message:c}=a;return!("tool_calls"in c)||!Array.isArray(c.tool_calls)?[]:c.tool_calls});if(n[0]===void 0)throw new Error("No parseable tool calls provided to GoogleGenerativeAIToolsOutputParser.");let[l]=n;return await this._validateResult(l.args)}}});function xPe(t,e){let n=sfI(t),l=dfI(n,e);return{tools:n,toolConfig:l}}function sfI(t){let e=[],n=[];return t.forEach(I=>{if(cb(I)){let[a]=Xmn([I]);a.functionDeclarations&&e.push(...a.functionDeclarations)}else if(qm(I)){let{functionDeclarations:a}=ufI(I);if(a)e.push(...a);else throw new Error("Failed to convert OpenAI structured tool to GenerativeAI tool")}else n.push(I)}),n.find(I=>"functionDeclarations"in I)?n.map(I=>{if(e?.length>0&&"functionDeclarations"in I){let a={functionDeclarations:[...I.functionDeclarations||[],...e]};return e=[],a}return I}):[...n,...e.length>0?[{functionDeclarations:e}]:[]]}function ufI(t){return{functionDeclarations:[{name:t.function.name,description:t.function.description,parameters:r2(t.function.parameters)}]}}function dfI(t,e){if(!t.length||!e)return;let{toolChoice:n,allowedFunctionNames:l}=e,I={any:GC.ANY,auto:GC.AUTO,none:GC.NONE};if(n&&["any","auto","none"].includes(n))return{functionCallingConfig:{mode:I[n]??"MODE_UNSPECIFIED",allowedFunctionNames:l}};if(typeof n=="string"||l)return{functionCallingConfig:{mode:GC.ANY,allowedFunctionNames:[...l??[],...n&&typeof n=="string"?[n]:[]]}}}var Hmn=B(()=>{qVe();_N();DN();kPe();$Ve()});var jPe,Qmn=B(()=>{qVe();Xh();Xk();Bo();ep();Ul();$Ve();kPe();wmn();Hmn();jPe=class extends Vd{static lc_name(){return"ChatGoogleGenerativeAI"}get lc_secrets(){return{apiKey:"GOOGLE_API_KEY"}}get lc_aliases(){return{apiKey:"google_api_key"}}get _isMultimodalModel(){return this.model.includes("vision")||this.model.startsWith("gemini-1.5")||this.model.startsWith("gemini-2")}constructor(e){if(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","chat_models","google_genai"]}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"temperature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxOutputTokens",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topP",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"topK",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stopSequences",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"safetySettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streaming",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"json",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"streamUsage",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"convertSystemMessageToHumanContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.model=e.model.replace(/^models\//,""),this.maxOutputTokens=e.maxOutputTokens??this.maxOutputTokens,this.maxOutputTokens&&this.maxOutputTokens<0)throw new Error("`maxOutputTokens` must be a positive integer");if(this.temperature=e.temperature??this.temperature,this.temperature&&(this.temperature<0||this.temperature>2))throw new Error("`temperature` must be in the range of [0.0,2.0]");if(this.topP=e.topP??this.topP,this.topP&&this.topP<0)throw new Error("`topP` must be a positive integer");if(this.topP&&this.topP>1)throw new Error("`topP` must be below 1.");if(this.topK=e.topK??this.topK,this.topK&&this.topK<0)throw new Error("`topK` must be a positive integer");if(this.stopSequences=e.stopSequences??this.stopSequences,this.apiKey=e.apiKey??yt("GOOGLE_API_KEY"),!this.apiKey)throw new Error("Please set an API key for Google GenerativeAI in the environment variable GOOGLE_API_KEY or in the `apiKey` field of the ChatGoogleGenerativeAI constructor");if(this.safetySettings=e.safetySettings??this.safetySettings,this.safetySettings&&this.safetySettings.length>0&&new Set(this.safetySettings.map(l=>l.category)).size!==this.safetySettings.length)throw new Error("The categories in `safetySettings` array must be unique");this.streaming=e.streaming??this.streaming,this.json=e.json,this.client=new mC(this.apiKey).getGenerativeModel({model:this.model,safetySettings:this.safetySettings,generationConfig:{stopSequences:this.stopSequences,maxOutputTokens:this.maxOutputTokens,temperature:this.temperature,topP:this.topP,topK:this.topK,...this.json?{responseMimeType:"application/json"}:{}}},{apiVersion:e.apiVersion,baseUrl:e.baseUrl}),this.streamUsage=e.streamUsage??this.streamUsage}useCachedContent(e,n,l){this.apiKey&&(this.client=new mC(this.apiKey).getGenerativeModelFromCachedContent(e,n,l))}get useSystemInstruction(){return typeof this.convertSystemMessageToHumanContent=="boolean"?!this.convertSystemMessageToHumanContent:this.computeUseSystemInstruction}get computeUseSystemInstruction(){return this.model==="gemini-1.0-pro-001"||this.model.startsWith("gemini-pro-vision")||this.model.startsWith("gemini-1.0-pro-vision")?!1:this.model!=="gemini-pro"}getLsParams(e){return{ls_provider:"google_genai",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:this.client.generationConfig.temperature,ls_max_tokens:this.client.generationConfig.maxOutputTokens,ls_stop:e.stop}}_combineLLMOutput(){return[]}_llmType(){return"googlegenerativeai"}bindTools(e,n){return this.withConfig({tools:xPe(e)?.tools,...n})}invocationParams(e){let n=e?.tools?.length?xPe(e.tools,{toolChoice:e.tool_choice,allowedFunctionNames:e.allowedFunctionNames}):void 0;return e?.responseSchema?(this.client.generationConfig.responseSchema=e.responseSchema,this.client.generationConfig.responseMimeType="application/json"):(this.client.generationConfig.responseSchema=void 0,this.client.generationConfig.responseMimeType=this.json?"application/json":void 0),{...n?.tools?{tools:n.tools}:{},...n?.toolConfig?{toolConfig:n.toolConfig}:{}}}async _generate(e,n,l){let I=LPe(e,this._isMultimodalModel,this.useSystemInstruction),a=I;if(I[0].role==="system"){let[u]=I;this.client.systemInstruction=u,a=I.slice(1)}let c=this.invocationParams(n);if(this.streaming){let u={},o=this._streamResponseChunks(e,n,l),d={};for await(let h of o){let Z=h.generationInfo?.completion??0;d[Z]===void 0?d[Z]=h:d[Z]=d[Z].concat(h)}return{generations:Object.entries(d).sort(([h],[Z])=>parseInt(h,10)-parseInt(Z,10)).map(([h,Z])=>Z),llmOutput:{estimatedTokenUsage:u}}}let i=await this.completionWithRetry({...c,contents:a}),s;if("usageMetadata"in i.response){let u=i.response.usageMetadata;s={input_tokens:u.promptTokenCount??0,output_tokens:u.candidatesTokenCount??0,total_tokens:u.totalTokenCount??0}}let r=vmn(i.response,{usageMetadata:s});return r.generations?.length>0&&await l?.handleLLMNewToken(r.generations[0]?.text??""),r}async*_streamResponseChunks(e,n,l){let I=LPe(e,this._isMultimodalModel,this.useSystemInstruction),a=I;if(I[0].role==="system"){let[o]=I;this.client.systemInstruction=o,a=I.slice(1)}let i={...this.invocationParams(n),contents:a},s=await this.caller.callWithOptions({signal:n?.signal},async()=>{let{stream:o}=await this.client.generateContentStream(i);return o}),r,u=0;for await(let o of s){if("usageMetadata"in o&&this.streamUsage!==!1&&n.streamUsage!==!1){let b=o.usageMetadata;if(!r)r={input_tokens:b.promptTokenCount??0,output_tokens:b.candidatesTokenCount??0,total_tokens:b.totalTokenCount??0};else{let h=(b.candidatesTokenCount??0)-r.output_tokens;r={input_tokens:0,output_tokens:h,total_tokens:h}}}let d=fmn(o,{usageMetadata:r,index:u});u+=1,d&&(yield d,await l?.handleLLMNewToken(d.text??""))}}async completionWithRetry(e,n){return this.caller.callWithOptions({signal:n?.signal},async()=>{try{return await this.client.generateContent(e)}catch(l){throw l.message?.includes("400 Bad Request")&&(l.status=400),l}})}withStructuredOutput(e,n){let l=e,I=n?.name,a=n?.method,c=n?.includeRaw;if(a==="jsonMode")throw new Error('ChatGoogleGenerativeAI only supports "jsonSchema" or "functionCalling" as a method.');let i,s;if(a==="functionCalling"){let d=I??"extract",b;if(wr(l)){let h=Eq(l);b=[{functionDeclarations:[{name:d,description:h.description??"A function available to call.",parameters:h}]}],s=new Jq({returnSingle:!0,keyName:d,zodSchema:l})}else{let h;typeof l.name=="string"&&typeof l.parameters=="object"&&l.parameters!=null?(h=l,h.parameters=r2(l.parameters),d=l.name):h={name:d,description:l.description??"",parameters:r2(l)},b=[{functionDeclarations:[h]}],s=new Jq({returnSingle:!0,keyName:d})}i=this.bindTools(b).withConfig({allowedFunctionNames:[d]})}else{let d=Eq(l);i=this.withConfig({responseSchema:d}),s=new ng}if(!c)return i.pipe(s).withConfig({runName:"ChatGoogleGenerativeAIStructuredOutput"});let r=Tl.assign({parsed:(d,b)=>s.invoke(d.raw,b)}),u=Tl.assign({parsed:()=>null}),o=r.withFallbacks({fallbacks:[u]});return Hr.from([{raw:i},o]).withConfig({runName:"StructuredOutputRunnable"})}}});var OPe,Emn=B(()=>{qVe();Xh();WS();wk();OPe=class extends Pm{constructor(e){if(super(e??{}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelName",{enumerable:!0,configurable:!0,writable:!0,value:"embedding-001"}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:"embedding-001"}),Object.defineProperty(this,"taskType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"title",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stripNewLines",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"maxBatchSize",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.modelName=e?.model?.replace(/^models\//,"")??e?.modelName?.replace(/^models\//,"")??this.modelName,this.model=this.modelName,this.taskType=e?.taskType??this.taskType,this.title=e?.title??this.title,this.title&&this.taskType!=="RETRIEVAL_DOCUMENT")throw new Error("title can only be sepcified with TaskType.RETRIEVAL_DOCUMENT");if(this.apiKey=e?.apiKey??yt("GOOGLE_API_KEY"),!this.apiKey)throw new Error("Please set an API key for Google GenerativeAI in the environmentb variable GOOGLE_API_KEY or in the `apiKey` field of the GoogleGenerativeAIEmbeddings constructor");this.client=new mC(this.apiKey).getGenerativeModel({model:this.model},{baseUrl:e?.baseUrl})}_convertToContent(e){return{content:{role:"user",parts:[{text:this.stripNewLines?e.replace(/\n/g," "):e}]},taskType:this.taskType,title:this.title}}async _embedQueryContent(e){let n=this._convertToContent(e);return(await this.client.embedContent(n)).embedding.values??[]}async _embedDocumentsContent(e){let n=BZ(e,this.maxBatchSize),l=n.map(c=>({requests:c.map(i=>this._convertToContent(i))}));return(await Promise.allSettled(l.map(c=>this.client.batchEmbedContents(c)))).flatMap((c,i)=>c.status==="fulfilled"?c.value.embeddings.map(s=>s.values||[]):Array(n[i].length).fill([]))}embedQuery(e){return this.caller.call(this._embedQueryContent.bind(this),e)}embedDocuments(e){return this.caller.call(this._embedDocumentsContent.bind(this),e)}}});var Jmn=B(()=>{Qmn();Emn()});var Cmn={};Xe(Cmn,{ChatGoogleGenerativeAI:()=>jPe,GoogleGenerativeAIEmbeddings:()=>OPe});var Lmn=B(()=>{Jmn()});var zPe=f((RRr,zmn)=>{"use strict";zmn.exports=Object});var Smn=f((yRr,Bmn)=>{"use strict";Bmn.exports=Error});var Tmn=f((ARr,Mmn)=>{"use strict";Mmn.exports=EvalError});var Kmn=f((FRr,Dmn)=>{"use strict";Dmn.exports=RangeError});var Pmn=f((vRr,_mn)=>{"use strict";_mn.exports=ReferenceError});var $mn=f((fRr,qmn)=>{"use strict";qmn.exports=SyntaxError});var nYe=f((XRr,epn)=>{"use strict";epn.exports=TypeError});var npn=f((wRr,tpn)=>{"use strict";tpn.exports=URIError});var Ipn=f((HRr,lpn)=>{"use strict";lpn.exports=Math.abs});var rpn=f((QRr,apn)=>{"use strict";apn.exports=Math.floor});var opn=f((ERr,cpn)=>{"use strict";cpn.exports=Math.max});var spn=f((JRr,ipn)=>{"use strict";ipn.exports=Math.min});var dpn=f((CRr,upn)=>{"use strict";upn.exports=Math.pow});var bpn=f((LRr,Gpn)=>{"use strict";Gpn.exports=Math.round});var ppn=f((kRr,mpn)=>{"use strict";mpn.exports=Number.isNaN||function(e){return e!==e}});var Zpn=f((xRr,hpn)=>{"use strict";var mfI=ppn();hpn.exports=function(e){return mfI(e)||e===0?e:e<0?-1:1}});var Npn=f((jRr,Wpn)=>{"use strict";Wpn.exports=Object.getOwnPropertyDescriptor});var IYe=f((ORr,Vpn)=>{"use strict";var lYe=Npn();if(lYe)try{lYe([],"length")}catch{lYe=null}Vpn.exports=lYe});var gpn=f((URr,Ypn)=>{"use strict";var aYe=Object.defineProperty||!1;if(aYe)try{aYe({},"a",{value:1})}catch{aYe=!1}Ypn.exports=aYe});var BPe=f((zRr,Rpn)=>{"use strict";Rpn.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),l=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(l)!=="[object Symbol]")return!1;var I=42;e[n]=I;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(e,n);if(i.value!==I||i.enumerable!==!0)return!1}return!0}});var Fpn=f((BRr,Apn)=>{"use strict";var ypn=typeof Symbol<"u"&&Symbol,pfI=BPe();Apn.exports=function(){return typeof ypn!="function"||typeof Symbol!="function"||typeof ypn("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:pfI()}});var SPe=f((SRr,vpn)=>{"use strict";vpn.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var MPe=f((MRr,fpn)=>{"use strict";var hfI=zPe();fpn.exports=hfI.getPrototypeOf||null});var Hpn=f((TRr,wpn)=>{"use strict";var ZfI="Function.prototype.bind called on incompatible ",WfI=Object.prototype.toString,NfI=Math.max,VfI="[object Function]",Xpn=function(e,n){for(var l=[],I=0;I{"use strict";var RfI=Hpn();Qpn.exports=Function.prototype.bind||RfI});var rYe=f((KRr,Epn)=>{"use strict";Epn.exports=Function.prototype.call});var TPe=f((_Rr,Jpn)=>{"use strict";Jpn.exports=Function.prototype.apply});var Lpn=f((PRr,Cpn)=>{"use strict";Cpn.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var xpn=f((qRr,kpn)=>{"use strict";var yfI=jq(),AfI=TPe(),FfI=rYe(),vfI=Lpn();kpn.exports=vfI||yfI.call(FfI,AfI)});var DPe=f(($Rr,jpn)=>{"use strict";var ffI=jq(),XfI=nYe(),wfI=rYe(),HfI=xpn();jpn.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new XfI("a function is required");return HfI(ffI,wfI,e)}});var Mpn=f((eyr,Spn)=>{"use strict";var QfI=DPe(),Opn=IYe(),zpn;try{zpn=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var KPe=!!zpn&&Opn&&Opn(Object.prototype,"__proto__"),Bpn=Object,Upn=Bpn.getPrototypeOf;Spn.exports=KPe&&typeof KPe.get=="function"?QfI([KPe.get]):typeof Upn=="function"?function(e){return Upn(e==null?e:Bpn(e))}:!1});var _Pe=f((tyr,_pn)=>{"use strict";var Tpn=SPe(),Dpn=MPe(),Kpn=Mpn();_pn.exports=Tpn?function(e){return Tpn(e)}:Dpn?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return Dpn(e)}:Kpn?function(e){return Kpn(e)}:null});var PPe=f((nyr,Ppn)=>{"use strict";var EfI=Function.prototype.call,JfI=Object.prototype.hasOwnProperty,CfI=jq();Ppn.exports=CfI.call(EfI,JfI)});var Ihn=f((lyr,lhn)=>{"use strict";var pI,LfI=zPe(),kfI=Smn(),xfI=Tmn(),jfI=Kmn(),OfI=Pmn(),i9=$mn(),o9=nYe(),UfI=npn(),zfI=Ipn(),BfI=rpn(),SfI=opn(),MfI=spn(),TfI=dpn(),DfI=bpn(),KfI=Zpn(),thn=Function,qPe=function(t){try{return thn('"use strict"; return ('+t+").constructor;")()}catch{}},Oq=IYe(),_fI=gpn(),$Pe=function(){throw new o9},PfI=Oq?function(){try{return arguments.callee,$Pe}catch{try{return Oq(arguments,"callee").get}catch{return $Pe}}}():$Pe,r9=Fpn()(),Pd=_Pe(),qfI=MPe(),$fI=SPe(),nhn=TPe(),Uq=rYe(),c9={},eXI=typeof Uint8Array>"u"||!Pd?pI:Pd(Uint8Array),pC={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?pI:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?pI:ArrayBuffer,"%ArrayIteratorPrototype%":r9&&Pd?Pd([][Symbol.iterator]()):pI,"%AsyncFromSyncIteratorPrototype%":pI,"%AsyncFunction%":c9,"%AsyncGenerator%":c9,"%AsyncGeneratorFunction%":c9,"%AsyncIteratorPrototype%":c9,"%Atomics%":typeof Atomics>"u"?pI:Atomics,"%BigInt%":typeof BigInt>"u"?pI:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?pI:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?pI:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?pI:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":kfI,"%eval%":eval,"%EvalError%":xfI,"%Float16Array%":typeof Float16Array>"u"?pI:Float16Array,"%Float32Array%":typeof Float32Array>"u"?pI:Float32Array,"%Float64Array%":typeof Float64Array>"u"?pI:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?pI:FinalizationRegistry,"%Function%":thn,"%GeneratorFunction%":c9,"%Int8Array%":typeof Int8Array>"u"?pI:Int8Array,"%Int16Array%":typeof Int16Array>"u"?pI:Int16Array,"%Int32Array%":typeof Int32Array>"u"?pI:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":r9&&Pd?Pd(Pd([][Symbol.iterator]())):pI,"%JSON%":typeof JSON=="object"?JSON:pI,"%Map%":typeof Map>"u"?pI:Map,"%MapIteratorPrototype%":typeof Map>"u"||!r9||!Pd?pI:Pd(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":LfI,"%Object.getOwnPropertyDescriptor%":Oq,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?pI:Promise,"%Proxy%":typeof Proxy>"u"?pI:Proxy,"%RangeError%":jfI,"%ReferenceError%":OfI,"%Reflect%":typeof Reflect>"u"?pI:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?pI:Set,"%SetIteratorPrototype%":typeof Set>"u"||!r9||!Pd?pI:Pd(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?pI:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":r9&&Pd?Pd(""[Symbol.iterator]()):pI,"%Symbol%":r9?Symbol:pI,"%SyntaxError%":i9,"%ThrowTypeError%":PfI,"%TypedArray%":eXI,"%TypeError%":o9,"%Uint8Array%":typeof Uint8Array>"u"?pI:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?pI:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?pI:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?pI:Uint32Array,"%URIError%":UfI,"%WeakMap%":typeof WeakMap>"u"?pI:WeakMap,"%WeakRef%":typeof WeakRef>"u"?pI:WeakRef,"%WeakSet%":typeof WeakSet>"u"?pI:WeakSet,"%Function.prototype.call%":Uq,"%Function.prototype.apply%":nhn,"%Object.defineProperty%":_fI,"%Object.getPrototypeOf%":qfI,"%Math.abs%":zfI,"%Math.floor%":BfI,"%Math.max%":SfI,"%Math.min%":MfI,"%Math.pow%":TfI,"%Math.round%":DfI,"%Math.sign%":KfI,"%Reflect.getPrototypeOf%":$fI};if(Pd)try{null.error}catch(t){qpn=Pd(Pd(t)),pC["%Error.prototype%"]=qpn}var qpn,tXI=function t(e){var n;if(e==="%AsyncFunction%")n=qPe("async function () {}");else if(e==="%GeneratorFunction%")n=qPe("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=qPe("async function* () {}");else if(e==="%AsyncGenerator%"){var l=t("%AsyncGeneratorFunction%");l&&(n=l.prototype)}else if(e==="%AsyncIteratorPrototype%"){var I=t("%AsyncGenerator%");I&&Pd&&(n=Pd(I.prototype))}return pC[e]=n,n},$pn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},zq=jq(),cYe=PPe(),nXI=zq.call(Uq,Array.prototype.concat),lXI=zq.call(nhn,Array.prototype.splice),ehn=zq.call(Uq,String.prototype.replace),oYe=zq.call(Uq,String.prototype.slice),IXI=zq.call(Uq,RegExp.prototype.exec),aXI=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rXI=/\\(\\)?/g,cXI=function(e){var n=oYe(e,0,1),l=oYe(e,-1);if(n==="%"&&l!=="%")throw new i9("invalid intrinsic syntax, expected closing `%`");if(l==="%"&&n!=="%")throw new i9("invalid intrinsic syntax, expected opening `%`");var I=[];return ehn(e,aXI,function(a,c,i,s){I[I.length]=i?ehn(s,rXI,"$1"):c||a}),I},oXI=function(e,n){var l=e,I;if(cYe($pn,l)&&(I=$pn[l],l="%"+I[0]+"%"),cYe(pC,l)){var a=pC[l];if(a===c9&&(a=tXI(l)),typeof a>"u"&&!n)throw new o9("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:I,name:l,value:a}}throw new i9("intrinsic "+e+" does not exist!")};lhn.exports=function(e,n){if(typeof e!="string"||e.length===0)throw new o9("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new o9('"allowMissing" argument must be a boolean');if(IXI(/^%?[^%]*%?$/,e)===null)throw new i9("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var l=cXI(e),I=l.length>0?l[0]:"",a=oXI("%"+I+"%",n),c=a.name,i=a.value,s=!1,r=a.alias;r&&(I=r[0],lXI(l,nXI([0,1],r)));for(var u=1,o=!0;u=l.length){var Z=Oq(i,d);o=!!Z,o&&"get"in Z&&!("originalValue"in Z.get)?i=Z.get:i=i[d]}else o=cYe(i,d),i=i[d];o&&!s&&(pC[c]=i)}}return i}});var iYe=f((Iyr,chn)=>{"use strict";var ahn=Ihn(),rhn=DPe(),iXI=rhn([ahn("%String.prototype.indexOf%")]);chn.exports=function(e,n){var l=ahn(e,!!n);return typeof l=="function"&&iXI(e,".prototype.")>-1?rhn([l]):l}});var e6e=f((ayr,ohn)=>{"use strict";var sXI=BPe();ohn.exports=function(){return sXI()&&!!Symbol.toStringTag}});var bhn=f((ryr,Ghn)=>{"use strict";var ihn=iYe(),uXI=e6e()(),dXI=PPe(),GXI=IYe(),l6e;uXI?(shn=ihn("RegExp.prototype.exec"),t6e={},sYe=function(){throw t6e},n6e={toString:sYe,valueOf:sYe},typeof Symbol.toPrimitive=="symbol"&&(n6e[Symbol.toPrimitive]=sYe),l6e=function(e){if(!e||typeof e!="object")return!1;var n=GXI(e,"lastIndex"),l=n&&dXI(n,"value");if(!l)return!1;try{shn(e,n6e)}catch(I){return I===t6e}}):(uhn=ihn("Object.prototype.toString"),dhn="[object RegExp]",l6e=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:uhn(e)===dhn});var shn,t6e,sYe,n6e,uhn,dhn;Ghn.exports=l6e});var phn=f((cyr,mhn)=>{"use strict";var bXI=iYe(),mXI=bhn(),pXI=bXI("RegExp.prototype.exec"),hXI=nYe();mhn.exports=function(e){if(!mXI(e))throw new hXI("`regex` must be a RegExp");return function(l){return pXI(e,l)!==null}}});var Nhn=f((oyr,Whn)=>{"use strict";var hhn=iYe(),ZXI=phn(),WXI=ZXI(/^\s*(?:function)?\*/),Zhn=e6e()(),I6e=_Pe(),NXI=hhn("Object.prototype.toString"),VXI=hhn("Function.prototype.toString"),YXI=function(){if(!Zhn)return!1;try{return Function("return function*() {}")()}catch{}},a6e;Whn.exports=function(e){if(typeof e!="function")return!1;if(WXI(VXI(e)))return!0;if(!Zhn){var n=NXI(e);return n==="[object GeneratorFunction]"}if(!I6e)return!1;if(typeof a6e>"u"){var l=YXI();a6e=l?I6e(l):!1}return I6e(e)===a6e}});var Yhn=f((iyr,Vhn)=>{"use strict";Vhn.exports=gXI;function gXI(t,e){if(!Array.isArray(t))throw new TypeError("arg must be an array of [ee, events...] arrays");for(var n=[],l=0;l{"use strict";r6e.exports=AXI;r6e.exports.isFinished=yhn;var ghn=wXI(),Rhn=Yhn(),yXI=typeof setImmediate=="function"?setImmediate:function(t){process.nextTick(t.bind.apply(t,arguments))};function AXI(t,e){return yhn(t)!==!1?(yXI(e,null,t),t):(vXI(t,HXI(e)),t)}function yhn(t){var e=t.socket;if(typeof t.finished=="boolean")return!!(t.finished||e&&!e.writable);if(typeof t.complete=="boolean")return!!(t.upgrade||!e||!e.readable||t.complete&&!t.readable)}function FXI(t,e){var n,l,I=!1;function a(i){n.cancel(),l.cancel(),I=!0,e(i)}n=l=Rhn([[t,"end","finish"]],a);function c(i){t.removeListener("socket",c),!I&&n===l&&(l=Rhn([[i,"error","close"]],a))}if(t.socket){c(t.socket);return}t.on("socket",c),t.socket===void 0&&XXI(t,c)}function vXI(t,e){var n=t.__onFinished;(!n||!n.queue)&&(n=t.__onFinished=fXI(t),FXI(t,n)),n.queue.push(e)}function fXI(t){function e(n){if(t.__onFinished===e&&(t.__onFinished=null),!!e.queue){var l=e.queue;e.queue=null;for(var I=0;I{"use strict";o6e.exports=zXI;o6e.exports.parse=TXI;var Ahn=Ca().basename,QXI=nC().Buffer,EXI=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,JXI=/%[0-9A-Fa-f]{2}/,CXI=/%([0-9A-Fa-f]{2})/g,vhn=/[^\x20-\x7e\xa0-\xff]/g,LXI=/\\([\u0000-\u007f])/g,kXI=/([\\"])/g,Fhn=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,xXI=/^[\x20-\x7e\x80-\xff]+$/,jXI=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,OXI=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,UXI=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function zXI(t,e){var n=e||{},l=n.type||"attachment",I=BXI(t,n.fallback);return SXI(new Xhn(l,I))}function BXI(t,e){if(t!==void 0){var n={};if(typeof t!="string")throw new TypeError("filename must be a string");if(e===void 0&&(e=!0),typeof e!="string"&&typeof e!="boolean")throw new TypeError("fallback must be a string or boolean");if(typeof e=="string"&&vhn.test(e))throw new TypeError("fallback must be ISO-8859-1 string");var l=Ahn(t),I=xXI.test(l),a=typeof e!="string"?e&&fhn(l):Ahn(e),c=typeof a=="string"&&a!==l;return(c||!I||JXI.test(l))&&(n["filename*"]=l),(I||c)&&(n.filename=c?a:l),n}}function SXI(t){var e=t.parameters,n=t.type;if(!n||typeof n!="string"||!jXI.test(n))throw new TypeError("invalid type");var l=String(n).toLowerCase();if(e&&typeof e=="object")for(var I,a=Object.keys(e).sort(),c=0;c{"use strict";var i6e=class{constructor(e){this.max=e,this.size=0,this.cache=new Map,this._cache=new Map}get(e,n){let l=this.cache.get(e),I=n&&n.maxAge,a;function c(){return a=a||Date.now(),a}if(l){if(l.expired&&c()>l.expired)l.expired=0,l.value=void 0;else if(I!==void 0){let i=I?c()+I:0;l.expired=i}return l.value}if(l=this._cache.get(e),l){if(l.expired&&c()>l.expired)l.expired=0,l.value=void 0;else if(this._update(e,l),I!==void 0){let i=I?c()+I:0;l.expired=i}return l.value}}set(e,n,l){let I=l&&l.maxAge,a=I?Date.now()+I:0,c=this.cache.get(e);c?(c.expired=a,c.value=n):(c={value:n,expired:a},this._update(e,c))}keys(){let e=new Set,n=Date.now();for(let I of this.cache.entries())l(I);for(let I of this._cache.entries())l(I);function l(I){let a=I[0],c=I[1];(I[1].value&&!I[1].expired||c.expired>=n)&&e.add(a)}return Array.from(e.keys())}reset(){this.size=0,this.cache.clear(),this._cache.clear()}_update(e,n){this.cache.set(e,n),this.size++,this.size>=this.max&&(this.size=0,this._cache=this.cache,this.cache=new Map)}};Hhn.exports=i6e});var Chn=f((Gyr,Jhn)=>{"use strict";var qXI=pD(),$XI=Qhn(),Ehn=new $XI(100);Jhn.exports=t=>{let e=Ehn.get(t);return e||(e=qXI.contentType(t),Ehn.set(t,e)),e}});var khn=f((byr,Lhn)=>{"use strict";var ewI=/["'&<>]/;Lhn.exports=twI;function twI(t){var e=""+t,n=ewI.exec(e);if(!n)return e;var l,I="",a=0,c=0;for(a=n.index;a{var xhn=/; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g,nwI=/^[\u0020-\u007e\u0080-\u00ff]+$/,Ohn=/^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/,lwI=/\\([\u0000-\u007f])/g,IwI=/([\\"])/g,awI=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/,jhn=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/,rwI=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;s6e.format=cwI;s6e.parse=owI;function cwI(t){if(!t||typeof t!="object")throw new TypeError("argument obj is required");var e=t.parameters,n=t.subtype,l=t.suffix,I=t.type;if(!I||!jhn.test(I))throw new TypeError("invalid type");if(!n||!awI.test(n))throw new TypeError("invalid subtype");var a=I+"/"+n;if(l){if(!jhn.test(l))throw new TypeError("invalid suffix");a+="+"+l}if(e&&typeof e=="object")for(var c,i=Object.keys(e).sort(),s=0;s0&&!nwI.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(IwI,"\\$1")+'"'}function uwI(t){var e=rwI.exec(t.toLowerCase());if(!e)throw new TypeError("invalid media type");var n=e[1],l=e[2],I,a=l.lastIndexOf("+");a!==-1&&(I=l.substr(a+1),l=l.substr(0,a));var c={type:n,subtype:l,suffix:I};return c}});var u6e=f((pyr,s9)=>{"use strict";var zhn=Uhn(),dwI=pD();s9.exports=GwI;s9.exports.is=Bhn;s9.exports.hasBody=Shn;s9.exports.normalize=Mhn;s9.exports.match=Thn;function Bhn(t,e){var n,l=e,I=mwI(t);if(!I)return!1;if(l&&!Array.isArray(l))for(l=new Array(arguments.length-1),n=0;n2){n=new Array(arguments.length-1);for(var l=0;l{pwI.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}});var u9=f((Zyr,_hn)=>{"use strict";var Khn=Dhn();_hn.exports=ey;ey.STATUS_CODES=Khn;ey.codes=hwI(ey,Khn);ey.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};ey.empty={204:!0,205:!0,304:!0};ey.retry={502:!0,503:!0,504:!0};function hwI(t,e){var n=[];return Object.keys(e).forEach(function(I){var a=e[I],c=Number(I);t[c]=a,t[a]=c,t[a.toLowerCase()]=c,n.push(c)}),n}function ey(t){if(typeof t=="number"){if(!ey[t])throw new Error("invalid status code: "+t);return t}if(typeof t!="string")throw new TypeError("code must be a number or string");var e=parseInt(t,10);if(!isNaN(e)){if(!ey[e])throw new Error("invalid status code: "+e);return e}if(e=ey[t.toLowerCase()],!e)throw new Error('invalid status message: "'+t+'"');return e}});var $hn=f((Wyr,qhn)=>{"use strict";var ZwI=require("events").EventEmitter,WwI=co().ReadStream,Phn=require("stream"),hC=require("zlib");qhn.exports=NwI;function NwI(t,e){return AwI(t)?VwI(t):FwI(t)?gwI(t):RwI(t)&&t.destroy(),ywI(t)&&e&&(t.removeAllListeners("error"),t.addListener("error",vwI)),t}function VwI(t){t.destroy(),typeof t.close=="function"&&t.on("open",XwI)}function YwI(t){if(t._hadError===!0){var e=t._binding===null?"_binding":"_handle";t[e]={close:function(){this[e]=null}}}t.close()}function gwI(t){typeof t.destroy=="function"?t._binding?(t.destroy(),t._processing?(t._needDrain=!0,t.once("drain",fwI)):t._binding.clear()):t._destroy&&t._destroy!==Phn.Transform.prototype._destroy?t.destroy():t._destroy&&typeof t.close=="function"?(t.destroyed=!0,t.close()):t.destroy():typeof t.close=="function"&&YwI(t)}function RwI(t){return t instanceof Phn&&typeof t.destroy=="function"}function ywI(t){return t instanceof ZwI}function AwI(t){return t instanceof WwI}function FwI(t){return t instanceof hC.Gzip||t instanceof hC.Gunzip||t instanceof hC.Deflate||t instanceof hC.DeflateRaw||t instanceof hC.Inflate||t instanceof hC.InflateRaw||t instanceof hC.Unzip}function vwI(){}function fwI(){this._binding.clear()}function XwI(){typeof this.fd=="number"&&this.close()}});var G6e=f((Nyr,d6e)=>{"use strict";d6e.exports=HwI;d6e.exports.append=tZn;var wwI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function tZn(t,e){if(typeof t!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var n=Array.isArray(e)?e:eZn(String(e)),l=0;l{nZn.exports=function(t,e){return t=t||{},typeof e=="string"&&(e=e.split(/ +/)),e.reduce(function(n,l){return t[l]==null||(n[l]=t[l]),n},{})}});var IZn=f((Yyr,lZn)=>{"use strict";lZn.exports=CwI;var QwI=/(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g,EwI=/(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g,JwI="$1\uFFFD$2";function CwI(t){return String(t).replace(EwI,JwI).replace(QwI,encodeURI)}});var oZn=f((gyr,dYe)=>{"use strict";var LwI=whn(),kwI=Chn(),xwI=c6e(),jwI=khn(),OwI=u6e().is,Bq=u9(),UwI=$hn(),aZn=require("assert"),zwI=Ca().extname,BwI=G6e(),SwI=uYe(),rZn=require("util"),MwI=IZn(),cZn=require("stream"),TwI=require("url").URL;dYe.exports={get socket(){return this.res.socket},get header(){let{res:t}=this;return typeof t.getHeaders=="function"?t.getHeaders():t._headers||{}},get headers(){return this.header},get status(){return this.res.statusCode},set status(t){this.headerSent||(aZn(Number.isInteger(t),"status code must be a number"),aZn(t>=100&&t<=999,`invalid status code: ${t}`),this._explicitStatus=!0,this.res.statusCode=t,this.req.httpVersionMajor<2&&(this.res.statusMessage=Bq[t]),this.body&&Bq.empty[t]&&(this.body=null))},get message(){return this.res.statusMessage||Bq[this.status]},set message(t){this.res.statusMessage=t},get body(){return this._body},set body(t){let e=this._body;if(this._body=t,t==null){Bq.empty[this.status]||(this.status=204),t===null&&(this._explicitNullBody=!0),this.remove("Content-Type"),this.remove("Content-Length"),this.remove("Transfer-Encoding");return}this._explicitStatus||(this.status=200);let n=!this.has("Content-Type");if(typeof t=="string"){n&&(this.type=/^\s*this.ctx.onerror(l)),e!=null&&this.remove("Content-Length")),n&&(this.type="bin");return}this.remove("Content-Length"),this.type="json"},set length(t){this.has("Transfer-Encoding")||this.set("Content-Length",t)},get length(){if(this.has("Content-Length"))return parseInt(this.get("Content-Length"),10)||0;let{body:t}=this;if(!(!t||t instanceof cZn))return typeof t=="string"?Buffer.byteLength(t):Buffer.isBuffer(t)?t.length:Buffer.byteLength(JSON.stringify(t))},get headerSent(){return this.res.headersSent},vary(t){this.headerSent||BwI(this.res,t)},redirect(t,e){if(t==="back"&&(t=this.ctx.get("Referrer")||e||"/"),/^https?:\/\//i.test(t)&&(t=new TwI(t).toString()),this.set("Location",MwI(t)),Bq.redirect[this.status]||(this.status=302),this.ctx.accepts("html")){t=jwI(t),this.type="text/html; charset=utf-8",this.body=`Redirecting to ${t}.`;return}this.type="text/plain; charset=utf-8",this.body=`Redirecting to ${t}.`},attachment(t,e){t&&(this.type=zwI(t)),this.set("Content-Disposition",LwI(t,e))},set type(t){t=kwI(t),t?this.set("Content-Type",t):this.remove("Content-Type")},set lastModified(t){typeof t=="string"&&(t=new Date(t)),this.set("Last-Modified",t.toUTCString())},get lastModified(){let t=this.get("last-modified");if(t)return new Date(t)},set etag(t){/^(W\/)?"/.test(t)||(t=`"${t}"`),this.set("ETag",t)},get etag(){return this.get("ETag")},get type(){let t=this.get("Content-Type");return t?t.split(";",1)[0]:""},is(t,...e){return OwI(this.type,t,...e)},get(t){return this.header[t.toLowerCase()]||""},has(t){return typeof this.res.hasHeader=="function"?this.res.hasHeader(t):t.toLowerCase()in this.headers},set(t,e){if(!this.headerSent)if(arguments.length===2)Array.isArray(e)?e=e.map(n=>typeof n=="string"?n:String(n)):typeof e!="string"&&(e=String(e)),this.res.setHeader(t,e);else for(let n in t)this.set(n,t[n])},append(t,e){let n=this.get(t);return n&&(e=Array.isArray(n)?n.concat(e):[n].concat(e)),this.set(t,e)},remove(t){this.headerSent||this.res.removeHeader(t)},get writable(){if(this.res.writableEnded||this.res.finished)return!1;let t=this.res.socket;return t?t.writable:!0},inspect(){if(!this.res)return;let t=this.toJSON();return t.body=this.body,t},toJSON(){return SwI(this,["status","message","header"])},flushHeaders(){this.res.flushHeaders()}};rZn.inspect.custom&&(dYe.exports[rZn.inspect.custom]=dYe.exports.inspect)});var b6e=f((Ryr,iZn)=>{"use strict";iZn.exports=DwI;function DwI(t){if(!Array.isArray(t))throw new TypeError("Middleware stack must be an array!");for(let e of t)if(typeof e!="function")throw new TypeError("Middleware must be composed of functions!");return function(e,n){let l=-1;return I(0);function I(a){if(a<=l)return Promise.reject(new Error("next() called multiple times"));l=a;let c=t[a];if(a===t.length&&(c=n),!c)return Promise.resolve();try{return Promise.resolve(c(e,I.bind(null,a+1)))}catch(i){return Promise.reject(i)}}}}});var uZn=f((yyr,sZn)=>{"use strict";sZn.exports=KwI;function KwI(t){if(!t)throw new TypeError("argument namespace is required");function e(n){}return e._file=void 0,e._ignored=!0,e._namespace=t,e._traced=!1,e._warned=Object.create(null),e.function=_wI,e.property=PwI,e}function _wI(t,e){if(typeof t!="function")throw new TypeError("argument fn must be a function");return t}function PwI(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("argument obj must be object");var l=Object.getOwnPropertyDescriptor(t,e);if(!l)throw new TypeError("must call property on owner object");if(!l.configurable)throw new TypeError("property must be configurable")}});var GZn=f((Ayr,dZn)=>{"use strict";dZn.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?qwI:$wI);function qwI(t,e){return t.__proto__=e,t}function $wI(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n]);return t}});var mZn=f((Fyr,bZn)=>{"use strict";bZn.exports=eHI;function eHI(t){return t.split(" ").map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}});var bYe=f((vyr,ZC)=>{"use strict";var m6e=uZn()("http-errors"),pZn=GZn(),d9=u9(),p6e=Tw(),tHI=mZn();ZC.exports=GYe;ZC.exports.HttpError=nHI();ZC.exports.isHttpError=IHI(ZC.exports.HttpError);rHI(ZC.exports,d9.codes,ZC.exports.HttpError);function hZn(t){return+(String(t).charAt(0)+"00")}function GYe(){for(var t,e,n=500,l={},I=0;I=600)&&m6e("non-error status code; use only 4xx or 5xx status codes"),(typeof n!="number"||!d9[n]&&(n<400||n>=600))&&(n=500);var c=GYe[n]||GYe[hZn(n)];t||(t=c?new c(e):new Error(e||d9[n]),Error.captureStackTrace(t,GYe)),(!c||!(t instanceof c)||t.status!==n)&&(t.expose=n<500,t.status=t.statusCode=n);for(var i in l)i!=="status"&&i!=="statusCode"&&(t[i]=l[i]);return t}function nHI(){function t(){throw new TypeError("cannot construct abstract class")}return p6e(t,Error),t}function lHI(t,e,n){var l=WZn(e);function I(a){var c=a??d9[n],i=new Error(c);return Error.captureStackTrace(i,I),pZn(i,I.prototype),Object.defineProperty(i,"message",{enumerable:!0,configurable:!0,value:c,writable:!0}),Object.defineProperty(i,"name",{enumerable:!1,configurable:!0,value:l,writable:!0}),i}return p6e(I,t),ZZn(I,l),I.prototype.status=n,I.prototype.statusCode=n,I.prototype.expose=!0,I}function IHI(t){return function(n){return!n||typeof n!="object"?!1:n instanceof t?!0:n instanceof Error&&typeof n.expose=="boolean"&&typeof n.statusCode=="number"&&n.status===n.statusCode}}function aHI(t,e,n){var l=WZn(e);function I(a){var c=a??d9[n],i=new Error(c);return Error.captureStackTrace(i,I),pZn(i,I.prototype),Object.defineProperty(i,"message",{enumerable:!0,configurable:!0,value:c,writable:!0}),Object.defineProperty(i,"name",{enumerable:!1,configurable:!0,value:l,writable:!0}),i}return p6e(I,t),ZZn(I,l),I.prototype.status=n,I.prototype.statusCode=n,I.prototype.expose=!1,I}function ZZn(t,e){var n=Object.getOwnPropertyDescriptor(t,"name");n&&n.configurable&&(n.value=e,Object.defineProperty(t,"name",n))}function rHI(t,e,n){e.forEach(function(I){var a,c=tHI(d9[I]);switch(hZn(I)){case 400:a=lHI(n,c,I);break;case 500:a=aHI(n,c,I);break}a&&(t[I]=a,t[c]=a)}),t["I'mateapot"]=m6e.function(t.ImATeapot,`"I'mateapot"; use "ImATeapot" instead`)}function WZn(t){return t.substr(-5)!=="Error"?t+"Error":t}});var YZn=f((h6e,VZn)=>{h6e=VZn.exports=typeof Object.keys=="function"?Object.keys:NZn;h6e.shim=NZn;function NZn(t){var e=[];for(var n in t)e.push(n);return e}});var AZn=f((mYe,yZn)=>{var cHI=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";mYe=yZn.exports=cHI?gZn:RZn;mYe.supported=gZn;function gZn(t){return Object.prototype.toString.call(t)=="[object Arguments]"}mYe.unsupported=RZn;function RZn(t){return t&&typeof t=="object"&&typeof t.length=="number"&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}});var EZn=f((fyr,QZn)=>{var FZn=Array.prototype.slice,vZn=YZn(),fZn=AZn(),XZn=QZn.exports=function(t,e,n){return n||(n={}),t===e?!0:t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||typeof t!="object"&&typeof e!="object"?n.strict?t===e:t==e:oHI(t,e,n)};function wZn(t){return t==null}function HZn(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function oHI(t,e,n){var l,I;if(wZn(t)||wZn(e)||t.prototype!==e.prototype)return!1;if(fZn(t))return fZn(e)?(t=FZn.call(t),e=FZn.call(e),XZn(t,e,n)):!1;if(HZn(t)){if(!HZn(e)||t.length!==e.length)return!1;for(l=0;l=0;l--)if(a[l]!=c[l])return!1;for(l=a.length-1;l>=0;l--)if(I=a[l],!XZn(t[I],e[I],n))return!1;return typeof t==typeof e}});var LZn=f((Xyr,CZn)=>{var iHI=bYe(),JZn=EZn();CZn.exports=MG;function MG(t,e,n,l){if(!t)throw iHI(e,n,l)}MG.fail=function(t,e,n){MG(!1,t,e,n)};MG.equal=function(t,e,n,l,I){MG(t==e,n,l,I)};MG.notEqual=function(t,e,n,l,I){MG(t!=e,n,l,I)};MG.ok=function(t,e,n,l){MG(t,e,n,l)};MG.strictEqual=function(t,e,n,l,I){MG(t===e,n,l,I)};MG.notStrictEqual=function(t,e,n,l,I){MG(t!==e,n,l,I)};MG.deepEqual=function(t,e,n,l,I){MG(JZn(t,e),n,l,I)};MG.notDeepEqual=function(t,e,n,l,I){MG(!JZn(t,e),n,l,I)}});var xZn=f((wyr,kZn)=>{kZn.exports=tH;function tH(t,e){if(!(this instanceof tH))return new tH(t,e);this.proto=t,this.target=e,this.methods=[],this.getters=[],this.setters=[],this.fluents=[]}tH.prototype.method=function(t){var e=this.proto,n=this.target;return this.methods.push(t),e[t]=function(){return this[n][t].apply(this[n],arguments)},this};tH.prototype.access=function(t){return this.getter(t).setter(t)};tH.prototype.getter=function(t){var e=this.proto,n=this.target;return this.getters.push(t),e.__defineGetter__(t,function(){return this[n][t]}),this};tH.prototype.setter=function(t){var e=this.proto,n=this.target;return this.setters.push(t),e.__defineSetter__(t,function(l){return this[n][t]=l}),this};tH.prototype.fluent=function(t){var e=this.proto,n=this.target;return this.fluents.push(t),e[t]=function(l){return typeof l<"u"?(this[n][t]=l,this):this[n][t]},this}});var Z6e=f((Hyr,jZn)=>{"use strict";jZn.exports=sHI;function sHI(t){if(!t)throw new TypeError("argument namespace is required");function e(n){}return e._file=void 0,e._ignored=!0,e._namespace=t,e._traced=!1,e._warned=Object.create(null),e.function=uHI,e.property=dHI,e}function uHI(t,e){if(typeof t!="function")throw new TypeError("argument fn must be a function");return t}function dHI(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("argument obj must be object");var l=Object.getOwnPropertyDescriptor(t,e);if(!l)throw new TypeError("must call property on owner object");if(!l.configurable)throw new TypeError("property must be configurable")}});var UZn=f((Qyr,OZn)=>{"use strict";var Sq=require("crypto");function GHI(t,e){if(t.length!==e.length)return!1;if(Sq.timingSafeEqual)return Sq.timingSafeEqual(t,e);for(var n=0;n{"use strict";var mHI=UZn(),pHI=require("crypto");function G9(t,e,n){if(e||(e="sha1"),n||(n="base64"),!(this instanceof G9))return new G9(t,e,n);if(!t||!(0 in t))throw new Error("Keys must be provided.");function l(I,a){return pHI.createHmac(e,a).update(I).digest(n).replace(/\/|\+|=/g,function(c){return{"/":"_","+":"-","=":""}[c]})}this.sign=function(I){return l(I,t[0])},this.verify=function(I,a){return this.index(I,a)>-1},this.index=function(I,a){for(var c=0,i=t.length;c)")};zZn.exports=G9});var DZn=f((Jyr,TZn)=>{"use strict";var hYe=Z6e()("cookies"),SZn=BZn(),hHI=require("http"),pYe=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ZHI=/^(?:low|medium|high)$/i,W6e=Object.create(null),WHI=/[\^$\\.*+?()[\]{}|]/g,NHI=/[;=]/,VHI=/[;]/,YHI=/^(?:lax|none|strict)$/i;function c2(t,e,n){if(!(this instanceof c2))return new c2(t,e,n);this.secure=void 0,this.request=t,this.response=e,n&&(Array.isArray(n)?(hYe('"keys" argument; provide using options {"keys": [...]}'),this.keys=new SZn(n)):n.constructor&&n.constructor.name==="Keygrip"?(hYe('"keys" argument; provide using options {"keys": keygrip}'),this.keys=n):(this.keys=Array.isArray(n.keys)?new SZn(n.keys):n.keys,this.secure=n.secure))}c2.prototype.get=function(t,e){var n=t+".sig",l,I,a,c,i,s,r=e&&e.signed!==void 0?e.signed:!!this.keys;if(l=this.request.headers.cookie,!!l&&(I=l.match(gHI(t)),!!I)){if(a=I[1],a[0]==='"'&&(a=a.slice(1,-1)),!e||!r)return a;if(c=this.get(n),!!c){if(i=t+"="+a,!this.keys)throw new Error(".keys required for signed cookies");if(s=this.keys.index(i,c),s<0)this.set(n,null,{path:"/",signed:!1});else return s&&this.set(n,this.keys.sign(i),{signed:!1}),a}}};c2.prototype.set=function(t,e,n){var l=this.response,I=this.request,a=l.getHeader("Set-Cookie")||[],c=new Cm(t,e,n),i=n&&n.signed!==void 0?n.signed:!!this.keys,s=this.secure===void 0?I.protocol==="https"||RHI(I):!!this.secure;if(typeof a=="string"&&(a=[a]),!s&&n&&n.secure)throw new Error("Cannot send secure cookie over unencrypted connection");if(c.secure=n&&n.secure!==void 0?n.secure:s,n&&"secureProxy"in n&&(hYe('"secureProxy" option; use "secure" option, provide "secure" to constructor if needed'),c.secure=n.secureProxy),MZn(a,c),n&&i){if(!this.keys)throw new Error(".keys required for signed cookies");c.value=this.keys.sign(c.toString()),c.name+=".sig",MZn(a,c)}var r=l.set?hHI.OutgoingMessage.prototype.setHeader:l.setHeader;return r.call(l,"Set-Cookie",a),this};function Cm(t,e,n){if(!pYe.test(t)||NHI.test(t))throw new TypeError("argument name is invalid");if(e&&(!pYe.test(e)||VHI.test(e)))throw new TypeError("argument value is invalid");this.name=t,this.value=e||"";for(var t in n)this[t]=n[t];if(this.value||(this.expires=new Date(0),this.maxAge=null),this.path&&!pYe.test(this.path))throw new TypeError("option path is invalid");if(this.domain&&!pYe.test(this.domain))throw new TypeError("option domain is invalid");if(typeof this.maxAge=="number"?isNaN(this.maxAge)||!isFinite(this.maxAge):this.maxAge)throw new TypeError("option maxAge is invalid");if(this.priority&&!ZHI.test(this.priority))throw new TypeError("option priority is invalid");if(this.sameSite&&this.sameSite!==!0&&!YHI.test(this.sameSite))throw new TypeError("option sameSite is invalid")}Cm.prototype.path="/";Cm.prototype.expires=void 0;Cm.prototype.domain=void 0;Cm.prototype.httpOnly=!0;Cm.prototype.partitioned=!1;Cm.prototype.priority=void 0;Cm.prototype.sameSite=!1;Cm.prototype.secure=!1;Cm.prototype.overwrite=!1;Cm.prototype.toString=function(){return this.name+"="+this.value};Cm.prototype.toHeader=function(){var t=this.toString();return this.maxAge&&(this.expires=new Date(Date.now()+this.maxAge)),this.path&&(t+="; path="+this.path),this.expires&&(t+="; expires="+this.expires.toUTCString()),this.domain&&(t+="; domain="+this.domain),this.priority&&(t+="; priority="+this.priority.toLowerCase()),this.sameSite&&(t+="; samesite="+(this.sameSite===!0?"strict":this.sameSite.toLowerCase())),this.secure&&(t+="; secure"),this.httpOnly&&(t+="; httponly"),this.partitioned&&(t+="; partitioned"),t};Object.defineProperty(Cm.prototype,"maxage",{configurable:!0,enumerable:!0,get:function(){return this.maxAge},set:function(t){return this.maxAge=t}});hYe.property(Cm.prototype,"maxage",'"maxage"; use "maxAge" instead');function gHI(t){return W6e[t]||(W6e[t]=new RegExp("(?:^|;) *"+t.replace(WHI,"\\$&")+"=([^;]*)")),W6e[t]}function RHI(t){return t.socket?t.socket.encrypted:t.connection.encrypted}function MZn(t,e){if(e.overwrite)for(var n=t.length-1;n>=0;n--)t[n].indexOf(e.name+"=")===0&&t.splice(n,1);t.push(e.toHeader())}c2.connect=c2.express=function(t){return function(e,n,l){e.cookies=n.cookies=new c2(e,n,{keys:t}),l()}};c2.Cookie=Cm;TZn.exports=c2});var PZn=f((Cyr,WYe)=>{"use strict";var N6e=require("util"),yHI=bYe(),AHI=LZn(),_Zn=xZn(),KZn=u9(),FHI=DZn(),ZYe=Symbol("context#cookies"),V6e=WYe.exports={inspect(){return this===V6e?this:this.toJSON()},toJSON(){return{request:this.request.toJSON(),response:this.response.toJSON(),app:this.app.toJSON(),originalUrl:this.originalUrl,req:"",res:"",socket:""}},assert:AHI,throw(...t){throw yHI(...t)},onerror(t){if(t==null)return;Object.prototype.toString.call(t)==="[object Error]"||t instanceof Error||(t=new Error(N6e.format("non-error thrown: %j",t)));let n=!1;if((this.headerSent||!this.writable)&&(n=t.headerSent=!0),this.app.emit("error",t,this),n)return;let{res:l}=this;typeof l.getHeaderNames=="function"?l.getHeaderNames().forEach(i=>l.removeHeader(i)):l._headers={},this.set(t.headers),this.type="text";let I=t.status||t.statusCode;t.code==="ENOENT"&&(I=404),(typeof I!="number"||!KZn[I])&&(I=500);let a=KZn[I],c=t.expose?t.message:a;this.status=t.status=I,this.length=Buffer.byteLength(c),l.end(c)},get cookies(){return this[ZYe]||(this[ZYe]=new FHI(this.req,this.res,{keys:this.app.keys,secure:this.request.secure})),this[ZYe]},set cookies(t){this[ZYe]=t}};N6e.inspect.custom&&(WYe.exports[N6e.inspect.custom]=WYe.exports.inspect);_Zn(V6e,"response").method("attachment").method("redirect").method("remove").method("vary").method("has").method("set").method("append").method("flushHeaders").access("status").access("message").access("body").access("length").access("type").access("lastModified").access("etag").getter("headerSent").getter("writable");_Zn(V6e,"request").method("acceptsLanguages").method("acceptsEncodings").method("acceptsCharsets").method("accepts").method("get").method("is").access("querystring").access("idempotent").access("socket").access("search").access("method").access("query").access("path").access("url").access("accept").getter("origin").getter("href").getter("subdomains").getter("protocol").getter("host").getter("hostname").getter("URL").getter("header").getter("headers").getter("secure").getter("stale").getter("fresh").getter("ips").getter("ip")});var tWn=f((Lyr,Y6e)=>{"use strict";Y6e.exports=eWn;Y6e.exports.preferredCharsets=eWn;var vHI=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function fHI(t){for(var e=t.split(","),n=0,l=0;n0}});var rWn=f((kyr,g6e)=>{"use strict";g6e.exports=aWn;g6e.exports.preferredEncodings=aWn;var EHI=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function JHI(t){for(var e=t.split(","),n=!1,l=1,I=0,a=0;I0}});var uWn=f((xyr,R6e)=>{"use strict";R6e.exports=sWn;R6e.exports.preferredLanguages=sWn;var xHI=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function jHI(t){for(var e=t.split(","),n=0,l=0;n0}});var hWn=f((jyr,y6e)=>{"use strict";y6e.exports=mWn;y6e.exports.preferredMediaTypes=mWn;var BHI=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function SHI(t){for(var e=_HI(t),n=0,l=0;n0)if(a.every(function(c){return e.params[c]=="*"||(e.params[c]||"").toLowerCase()==(l.params[c]||"").toLowerCase()}))I|=1;else return null;return{i:n,o:e.i,q:e.q,s:I}}function mWn(t,e){var n=SHI(t===void 0?"*/*":t||"");if(!e)return n.filter(GWn).sort(dWn).map(DHI);var l=e.map(function(a,c){return MHI(a,n,c)});return l.filter(GWn).sort(dWn).map(function(a){return e[l.indexOf(a)]})}function dWn(t,e){return e.q-t.q||e.s-t.s||t.o-e.o||t.i-e.i||0}function DHI(t){return t.type+"/"+t.subtype}function GWn(t){return t.q>0}function pWn(t){for(var e=0,n=0;(n=t.indexOf('"',n))!==-1;)e++,n++;return e}function KHI(t){var e=t.indexOf("="),n,l;return e===-1?n=t:(n=t.substr(0,e),l=t.substr(e+1)),[n,l]}function _HI(t){for(var e=t.split(","),n=1,l=0;n{"use strict";var qHI=tWn(),$HI=rWn(),eQI=uWn(),tQI=hWn();A6e.exports=_r;A6e.exports.Negotiator=_r;function _r(t){if(!(this instanceof _r))return new _r(t);this.request=t}_r.prototype.charset=function(e){var n=this.charsets(e);return n&&n[0]};_r.prototype.charsets=function(e){return qHI(this.request.headers["accept-charset"],e)};_r.prototype.encoding=function(e){var n=this.encodings(e);return n&&n[0]};_r.prototype.encodings=function(e){return $HI(this.request.headers["accept-encoding"],e)};_r.prototype.language=function(e){var n=this.languages(e);return n&&n[0]};_r.prototype.languages=function(e){return eQI(this.request.headers["accept-language"],e)};_r.prototype.mediaType=function(e){var n=this.mediaTypes(e);return n&&n[0]};_r.prototype.mediaTypes=function(e){return tQI(this.request.headers.accept,e)};_r.prototype.preferredCharset=_r.prototype.charset;_r.prototype.preferredCharsets=_r.prototype.charsets;_r.prototype.preferredEncoding=_r.prototype.encoding;_r.prototype.preferredEncodings=_r.prototype.encodings;_r.prototype.preferredLanguage=_r.prototype.language;_r.prototype.preferredLanguages=_r.prototype.languages;_r.prototype.preferredMediaType=_r.prototype.mediaType;_r.prototype.preferredMediaTypes=_r.prototype.mediaTypes});var NWn=f((Uyr,WWn)=>{"use strict";var nQI=ZWn(),lQI=pD();WWn.exports=mZ;function mZ(t){if(!(this instanceof mZ))return new mZ(t);this.headers=t.headers,this.negotiator=new nQI(t)}mZ.prototype.type=mZ.prototype.types=function(t){var e=t;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var n=0;n{"use strict";var VWn=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,rQI=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,YWn=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,cQI=/\\([\u000b\u0020-\u00ff])/g,oQI=/([\\"])/g,gWn=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;F6e.format=iQI;F6e.parse=sQI;function iQI(t){if(!t||typeof t!="object")throw new TypeError("argument obj is required");var e=t.parameters,n=t.type;if(!n||!gWn.test(n))throw new TypeError("invalid type");var l=n;if(e&&typeof e=="object")for(var I,a=Object.keys(e).sort(),c=0;c0&&!rQI.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(oQI,"\\$1")+'"'}function GQI(t){this.parameters=Object.create(null),this.type=t}});var XWn=f((Byr,v6e)=>{"use strict";var AWn=require("url"),yWn=AWn.parse,NYe=AWn.Url;v6e.exports=FWn;v6e.exports.original=bQI;function FWn(t){var e=t.url;if(e!==void 0){var n=t._parsedUrl;return fWn(e,n)?n:(n=vWn(e),n._raw=e,t._parsedUrl=n)}}function bQI(t){var e=t.originalUrl;if(typeof e!="string")return FWn(t);var n=t._parsedOriginalUrl;return fWn(e,n)?n:(n=vWn(e),n._raw=e,t._parsedOriginalUrl=n)}function vWn(t){if(typeof t!="string"||t.charCodeAt(0)!==47)return yWn(t);for(var e=t,n=null,l=null,I=1;I{"use strict";var mQI=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;HWn.exports=pQI;function pQI(t,e){var n=t["if-modified-since"],l=t["if-none-match"];if(!n&&!l)return!1;var I=t["cache-control"];if(I&&mQI.test(I))return!1;if(l&&l!=="*"){var a=e.etag;if(!a)return!1;for(var c=!0,i=hQI(l),s=0;s{"use strict";var ZQI=require("url").URL,WQI=require("net"),NQI=NWn(),VQI=RWn(),EWn=require("url").format,VYe=XWn(),JWn=require("querystring"),YQI=u6e(),gQI=QWn(),RQI=uYe(),CWn=require("util"),YYe=Symbol("context#ip");gYe.exports={get header(){return this.req.headers},set header(t){this.req.headers=t},get headers(){return this.req.headers},set headers(t){this.req.headers=t},get url(){return this.req.url},set url(t){this.req.url=t},get origin(){return`${this.protocol}://${this.host}`},get href(){return/^https?:\/\//i.test(this.originalUrl)?this.originalUrl:this.origin+this.originalUrl},get method(){return this.req.method},set method(t){this.req.method=t},get path(){return VYe(this.req).pathname},set path(t){let e=VYe(this.req);e.pathname!==t&&(e.pathname=t,e.path=null,this.url=EWn(e))},get query(){let t=this.querystring,e=this._querycache=this._querycache||{};return e[t]||(e[t]=JWn.parse(t))},set query(t){this.querystring=JWn.stringify(t)},get querystring(){return this.req&&VYe(this.req).query||""},set querystring(t){let e=VYe(this.req);e.search!==`?${t}`&&(e.search=t,e.path=null,this.url=EWn(e))},get search(){return this.querystring?`?${this.querystring}`:""},set search(t){this.querystring=t},get host(){let e=this.app.proxy&&this.get("X-Forwarded-Host");return e||(this.req.httpVersionMajor>=2&&(e=this.get(":authority")),e||(e=this.get("Host"))),e?f6e(e,1)[0]:""},get hostname(){let t=this.host;return t?t[0]==="["?this.URL.hostname||"":t.split(":",1)[0]:""},get URL(){if(!this.memoizedURL){let t=this.originalUrl||"";try{this.memoizedURL=new ZQI(`${this.origin}${t}`)}catch{this.memoizedURL=Object.create(null)}}return this.memoizedURL},get fresh(){let t=this.method,e=this.ctx.status;return t!=="GET"&&t!=="HEAD"?!1:e>=200&&e<300||e===304?gQI(this.header,this.response.header):!1},get stale(){return!this.fresh},get idempotent(){return!!~["GET","HEAD","PUT","DELETE","OPTIONS","TRACE"].indexOf(this.method)},get socket(){return this.req.socket},get charset(){try{let{parameters:t}=VQI.parse(this.req);return t.charset||""}catch{return""}},get length(){let t=this.get("Content-Length");if(t!=="")return~~t},get protocol(){if(this.socket.encrypted)return"https";if(!this.app.proxy)return"http";let t=this.get("X-Forwarded-Proto");return t?f6e(t,1)[0]:"http"},get secure(){return this.protocol==="https"},get ips(){let t=this.app.proxy,e=this.get(this.app.proxyIpHeader),n=t&&e?f6e(e):[];return this.app.maxIpsCount>0&&(n=n.slice(-this.app.maxIpsCount)),n},get ip(){return this[YYe]||(this[YYe]=this.ips[0]||this.socket.remoteAddress||""),this[YYe]},set ip(t){this[YYe]=t},get subdomains(){let t=this.app.subdomainOffset,e=this.hostname;return WQI.isIP(e)?[]:e.split(".").reverse().slice(t)},get accept(){return this._accept||(this._accept=NQI(this.req))},set accept(t){this._accept=t},accepts(...t){return this.accept.types(...t)},acceptsEncodings(...t){return this.accept.encodings(...t)},acceptsCharsets(...t){return this.accept.charsets(...t)},acceptsLanguages(...t){return this.accept.languages(...t)},is(t,...e){return YQI(this.req,t,...e)},get type(){let t=this.get("Content-Type");return t?t.split(";")[0]:""},get(t){let e=this.req;switch(t=t.toLowerCase()){case"referer":case"referrer":return e.headers.referrer||e.headers.referer||"";default:return e.headers[t]||""}},inspect(){if(this.req)return this.toJSON()},toJSON(){return RQI(this,["method","url","header"])}};CWn.inspect.custom&&(gYe.exports[CWn.inspect.custom]=gYe.exports.inspect);function f6e(t,e){return t.split(",",e).map(n=>n.trim())}});var OWn=f((Tyr,jWn)=>{var kWn=Array.prototype.slice;jWn.exports=b9.default=b9.co=b9;b9.wrap=function(t){return e.__generatorFunction__=t,e;function e(){return b9.call(this,t.apply(this,arguments))}};function b9(t){var e=this,n=kWn.call(arguments,1);return new Promise(function(l,I){if(typeof t=="function"&&(t=t.apply(e,n)),!t||typeof t.next!="function")return l(t);a();function a(s){var r;try{r=t.next(s)}catch(u){return I(u)}i(r)}function c(s){var r;try{r=t.throw(s)}catch(u){return I(u)}i(r)}function i(s){if(s.done)return l(s.value);var r=X6e.call(e,s.value);return r&&w6e(r)?r.then(a,c):c(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(s.value)+'"'))}})}function X6e(t){return!t||w6e(t)?t:vQI(t)||xWn(t)?b9.call(this,t):typeof t=="function"?yQI.call(this,t):Array.isArray(t)?AQI.call(this,t):fQI(t)?FQI.call(this,t):t}function yQI(t){var e=this;return new Promise(function(n,l){t.call(e,function(I,a){if(I)return l(I);arguments.length>2&&(a=kWn.call(arguments,1)),n(a)})})}function AQI(t){return Promise.all(t.map(X6e,this))}function FQI(t){for(var e=new t.constructor,n=Object.keys(t),l=[],I=0;I{"use strict";var UWn=OWn(),XQI=b6e();zWn.exports=RYe;function RYe(t){if(typeof t!="function")throw new TypeError("middleware must be a function");if(t.constructor.name!=="GeneratorFunction"&&t.constructor.name!=="AsyncGeneratorFunction")return t;let e=function(n,l){return UWn.call(n,t.call(n,function*(I){return yield I()}(l)))};return e._name=t._name||t.name,e}RYe.compose=function(t){return Array.isArray(t)||(t=Array.from(arguments)),XQI(t.map(RYe))};RYe.back=function(t){if(typeof t!="function")throw new TypeError("middleware must be a function");if(t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction")return t;let e=function*(n){let l=this,I=!1;yield t(l,function(){if(I)throw new Error("next() called multiple times");return I=!0,UWn.call(l,n)})};return e._name=t._name||t.name,e}});var TWn=f((Kyr,Q6e)=>{"use strict";var wQI=Nhn(),SWn=jWe()("koa:application"),HQI=c6e(),QQI=require("assert"),EQI=oZn(),JQI=b6e(),CQI=PZn(),LQI=LWn(),kQI=u9(),xQI=require("events"),H6e=require("util"),jQI=require("stream"),OQI=require("http"),UQI=uYe(),zQI=BWn(),BQI=Z6e()("koa"),{HttpError:SQI}=bYe();Q6e.exports=class MWn extends xQI{constructor(e){if(super(),e=e||{},this.proxy=e.proxy||!1,this.subdomainOffset=e.subdomainOffset||2,this.proxyIpHeader=e.proxyIpHeader||"X-Forwarded-For",this.maxIpsCount=e.maxIpsCount||0,this.env=e.env||"production",e.keys&&(this.keys=e.keys),this.middleware=[],this.context=Object.create(CQI),this.request=Object.create(LQI),this.response=Object.create(EQI),H6e.inspect.custom&&(this[H6e.inspect.custom]=this.inspect),e.asyncLocalStorage){let{AsyncLocalStorage:n}=require("async_hooks");QQI(n,"Requires node 12.17.0 or higher to enable asyncLocalStorage"),this.ctxStorage=new n}}listen(...e){return SWn("listen"),OQI.createServer(this.callback()).listen(...e)}toJSON(){return UQI(this,["subdomainOffset","proxy","env"])}inspect(){return this.toJSON()}use(e){if(typeof e!="function")throw new TypeError("middleware must be a function!");return wQI(e)&&(BQI("Support for generators will be removed in v3. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa/blob/master/docs/migration.md"),e=zQI(e)),SWn("use %s",e._name||e.name||"-"),this.middleware.push(e),this}callback(){let e=JQI(this.middleware);return this.listenerCount("error")||this.on("error",this.onerror),(l,I)=>{let a=this.createContext(l,I);return this.ctxStorage?this.ctxStorage.run(a,async()=>await this.handleRequest(a,e)):this.handleRequest(a,e)}}get currentContext(){if(this.ctxStorage)return this.ctxStorage.getStore()}handleRequest(e,n){let l=e.res;l.statusCode=404;let I=c=>e.onerror(c),a=()=>MQI(e);return HQI(l,I),n(e).then(a).catch(I)}createContext(e,n){let l=Object.create(this.context),I=l.request=Object.create(this.request),a=l.response=Object.create(this.response);return l.app=I.app=a.app=this,l.req=I.req=a.req=e,l.res=I.res=a.res=n,I.ctx=a.ctx=l,I.response=a,a.request=I,l.originalUrl=I.originalUrl=e.url,l.state={},l}onerror(e){if(!(Object.prototype.toString.call(e)==="[object Error]"||e instanceof Error))throw new TypeError(H6e.format("non-error thrown: %j",e));if(e.status===404||e.expose||this.silent)return;let l=e.stack||e.toString();console.error(` +${l.replace(/^/gm," ")} +`)}static get default(){return MWn}createAsyncCtxStorageMiddleware(){let e=this;return async function(l,I){await e.ctxStorage.run(l,async()=>await I())}}};function MQI(t){if(t.respond===!1||!t.writable)return;let e=t.res,n=t.body,l=t.status;if(kQI.empty[l])return t.body=null,e.end();if(t.method==="HEAD"){if(!e.headersSent&&!t.response.has("Content-Length")){let{length:I}=t.response;Number.isInteger(I)&&(t.length=I)}return e.end()}if(n==null)return t.response._explicitNullBody?(t.response.remove("Content-Type"),t.response.remove("Transfer-Encoding"),e.end()):(t.req.httpVersionMajor>=2?n=String(l):n=t.message||String(l),e.headersSent||(t.type="text",t.length=Buffer.byteLength(n)),e.end(n));if(Buffer.isBuffer(n)||typeof n=="string")return e.end(n);if(n instanceof jQI)return n.pipe(e);n=JSON.stringify(n),e.headersSent||(t.length=Buffer.byteLength(n)),e.end(n)}Q6e.exports.HttpError=SQI});var DWn={};Xe(DWn,{HttpError:()=>DQI,default:()=>TQI});var E6e,TQI,DQI,KWn=B(()=>{E6e=$(TWn(),1),TQI=E6e.default,DQI=E6e.default.HttpError});var PWn=f((_yr,_Wn)=>{var KQI=G6e();_Wn.exports=function(t){return t={...{allowMethods:"GET,HEAD,PUT,POST,DELETE,PATCH",secureContext:!1},...t},Array.isArray(t.exposeHeaders)&&(t.exposeHeaders=t.exposeHeaders.join(",")),Array.isArray(t.allowMethods)&&(t.allowMethods=t.allowMethods.join(",")),Array.isArray(t.allowHeaders)&&(t.allowHeaders=t.allowHeaders.join(",")),t.maxAge&&(t.maxAge=String(t.maxAge)),t.keepHeadersOnError=t.keepHeadersOnError===void 0||!!t.keepHeadersOnError,async function(l,I){let a=l.get("Origin");l.vary("Origin");let c;if(typeof t.origin=="function"){if(c=await t.origin(l),!c)return await I()}else c=t.origin||"*";let i;typeof t.credentials=="function"?i=await t.credentials(l):i=!!t.credentials,i&&c==="*"&&(c=a);let s={};function r(u,o){l.set(u,o),s[u]=o}if(l.method!=="OPTIONS"){if(r("Access-Control-Allow-Origin",c),i===!0&&r("Access-Control-Allow-Credentials","true"),t.exposeHeaders&&r("Access-Control-Expose-Headers",t.exposeHeaders),t.secureContext&&(r("Cross-Origin-Opener-Policy","same-origin"),r("Cross-Origin-Embedder-Policy","require-corp")),!t.keepHeadersOnError)return await I();try{return await I()}catch(u){let o=u.headers||{},d=KQI.append(o.vary||o.Vary||"","Origin");throw delete o.Vary,u.headers={...o,...s,vary:d},u}}else{if(!l.get("Access-Control-Request-Method"))return await I();l.set("Access-Control-Allow-Origin",c),i===!0&&l.set("Access-Control-Allow-Credentials","true"),t.maxAge&&l.set("Access-Control-Max-Age",t.maxAge),t.privateNetworkAccess&&l.get("Access-Control-Request-Private-Network")&&l.set("Access-Control-Allow-Private-Network","true"),t.allowMethods&&l.set("Access-Control-Allow-Methods",t.allowMethods),t.secureContext&&(r("Cross-Origin-Opener-Policy","same-origin"),r("Cross-Origin-Embedder-Policy","require-corp"));let u=t.allowHeaders;u||(u=l.get("Access-Control-Request-Headers")),u&&l.set("Access-Control-Allow-Headers",u),l.status=204}}}});var $Wn=f((Pyr,qWn)=>{"use strict";qWn.exports=function(e,n){if(n=n.split(":")[0],e=+e,!e)return!1;switch(n){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var Mq=f(tNn=>{var o2=tNn,_QI=require("url"),eNn=require("util")._extend,PQI=$Wn(),qQI=/(^|,)\s*upgrade\s*($|,)/i,J6e=/^https|wss/;o2.isSSL=J6e;o2.setupOutgoing=function(t,e,n,l){t.port=e[l||"target"].port||(J6e.test(e[l||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(i){t[i]=e[l||"target"][i]}),t.method=e.method||n.method,t.headers=eNn({},n.headers),e.headers&&eNn(t.headers,e.headers),e.auth&&(t.auth=e.auth),e.ca&&(t.ca=e.ca),J6e.test(e[l||"target"].protocol)&&(t.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),t.agent=e.agent||!1,t.localAddress=e.localAddress,t.agent||(t.headers=t.headers||{},(typeof t.headers.connection!="string"||!qQI.test(t.headers.connection))&&(t.headers.connection="close"));var I=e[l||"target"],a=I&&e.prependPath!==!1&&I.path||"",c=e.toProxy?n.url:_QI.parse(n.url).path||"";return c=e.ignorePath?"":c,t.path=o2.urlJoin(a,c),e.changeOrigin&&(t.headers.host=PQI(t.port,e[l||"target"].protocol)&&!$QI(t.host)?t.host+":"+t.port:t.host),t};o2.setupSocket=function(t){return t.setTimeout(0),t.setNoDelay(!0),t.setKeepAlive(!0,0),t};o2.getPort=function(t){var e=t.headers.host?t.headers.host.match(/:(\d+)/):"";return e?e[1]:o2.hasEncryptedConnection(t)?"443":"80"};o2.hasEncryptedConnection=function(t){return!!(t.connection.encrypted||t.connection.pair)};o2.urlJoin=function(){var t=Array.prototype.slice.call(arguments),e=t.length-1,n=t[e],l=n.split("?"),I;return t[e]=l.shift(),I=[t.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],I.push.apply(I,l),I.join("?")};o2.rewriteCookieProperty=function t(e,n,l){return Array.isArray(e)?e.map(function(I){return t(I,n,l)}):e.replace(new RegExp("(;\\s*"+l+"=)([^;]+)","i"),function(I,a,c){var i;if(c in n)i=n[c];else if("*"in n)i=n["*"];else return I;return i?a+i:""})};function $QI(t){return!!~t.indexOf(":")}});var aNn=f(($yr,INn)=>{var nNn=require("url"),lNn=Mq(),eEI=/^201|30(1|2|7|8)$/;INn.exports={removeChunked:function(e,n,l){e.httpVersion==="1.0"&&delete l.headers["transfer-encoding"]},setConnection:function(e,n,l){e.httpVersion==="1.0"?l.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!l.headers.connection&&(l.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,n,l,I){if((I.hostRewrite||I.autoRewrite||I.protocolRewrite)&&l.headers.location&&eEI.test(l.statusCode)){var a=nNn.parse(I.target),c=nNn.parse(l.headers.location);if(a.host!=c.host)return;I.hostRewrite?c.host=I.hostRewrite:I.autoRewrite&&(c.host=e.headers.host),I.protocolRewrite&&(c.protocol=I.protocolRewrite),l.headers.location=c.format()}},writeHeaders:function(e,n,l,I){var a=I.cookieDomainRewrite,c=I.cookiePathRewrite,i=I.preserveHeaderKeyCase,s,r=function(d,b){b!=null&&(a&&d.toLowerCase()==="set-cookie"&&(b=lNn.rewriteCookieProperty(b,a,"domain")),c&&d.toLowerCase()==="set-cookie"&&(b=lNn.rewriteCookieProperty(b,c,"path")),n.setHeader(String(d).trim(),b))};if(typeof a=="string"&&(a={"*":a}),typeof c=="string"&&(c={"*":c}),i&&l.rawHeaders!=null){s={};for(var u=0;u{var Tq;rNn.exports=function(){if(!Tq){try{Tq=gn()("follow-redirects")}catch{}typeof Tq!="function"&&(Tq=function(){})}Tq.apply(null,arguments)}});var dNn=f((tAr,T6e)=>{var Kq=require("url"),Dq=Kq.URL,tEI=require("http"),nEI=require("https"),j6e=require("stream").Writable,O6e=require("assert"),oNn=cNn();(function(){var e=typeof process<"u",n=typeof window<"u"&&typeof document<"u",l=NC(Error.captureStackTrace);!e&&(n||!l)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var U6e=!1;try{O6e(new Dq(""))}catch(t){U6e=t.code==="ERR_INVALID_URL"}var lEI=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],z6e=["abort","aborted","connect","error","socket","timeout"],B6e=Object.create(null);z6e.forEach(function(t){B6e[t]=function(e,n,l){this._redirectable.emit(t,e,n,l)}});var L6e=_q("ERR_INVALID_URL","Invalid URL",TypeError),k6e=_q("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),IEI=_q("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",k6e),aEI=_q("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),rEI=_q("ERR_STREAM_WRITE_AFTER_END","write after end"),cEI=j6e.prototype.destroy||sNn;function Pp(t,e){j6e.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var n=this;this._onNativeResponse=function(l){try{n._processResponse(l)}catch(I){n.emit("error",I instanceof k6e?I:new k6e({cause:I}))}},this._performRequest()}Pp.prototype=Object.create(j6e.prototype);Pp.prototype.abort=function(){M6e(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Pp.prototype.destroy=function(t){return M6e(this._currentRequest,t),cEI.call(this,t),this};Pp.prototype.write=function(t,e,n){if(this._ending)throw new rEI;if(!WC(t)&&!sEI(t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(NC(e)&&(n=e,e=null),t.length===0){n&&n();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,n)):(this.emit("error",new aEI),this.abort())};Pp.prototype.end=function(t,e,n){if(NC(t)?(n=t,t=e=null):NC(e)&&(n=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,n);else{var l=this,I=this._currentRequest;this.write(t,e,function(){l._ended=!0,I.end(null,null,n)}),this._ending=!0}};Pp.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};Pp.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};Pp.prototype.setTimeout=function(t,e){var n=this;function l(c){c.setTimeout(t),c.removeListener("timeout",c.destroy),c.addListener("timeout",c.destroy)}function I(c){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout(function(){n.emit("timeout"),a()},t),l(c)}function a(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",a),n.removeListener("error",a),n.removeListener("response",a),n.removeListener("close",a),e&&n.removeListener("timeout",e),n.socket||n._currentRequest.removeListener("socket",I)}return e&&this.on("timeout",e),this.socket?I(this.socket):this._currentRequest.once("socket",I),this.on("socket",l),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){Pp.prototype[t]=function(e,n){return this._currentRequest[t](e,n)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(Pp.prototype,t,{get:function(){return this._currentRequest[t]}})});Pp.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};Pp.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e)throw new TypeError("Unsupported protocol "+t);if(this._options.agents){var n=t.slice(0,-1);this._options.agent=this._options.agents[n]}var l=this._currentRequest=e.request(this._options,this._onNativeResponse);l._redirectable=this;for(var I of z6e)l.on(I,B6e[I]);if(this._currentUrl=/^\//.test(this._options.path)?Kq.format(this._options):this._options.path,this._isRedirect){var a=0,c=this,i=this._requestBodyBuffers;(function s(r){if(l===c._currentRequest)if(r)c.emit("error",r);else if(a=400){t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[];return}if(M6e(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects)throw new IEI;var l,I=this._options.beforeRedirect;I&&(l=Object.assign({Host:t.req.getHeader("host")},this._options.headers));var a=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],C6e(/^content-/i,this._options.headers));var c=C6e(/^host$/i,this._options.headers),i=S6e(this._currentUrl),s=c||i.host,r=/^\w+:/.test(n)?this._currentUrl:Kq.format(Object.assign(i,{host:s})),u=oEI(n,r);if(oNn("redirecting to",u.href),this._isRedirect=!0,x6e(u,this._options),(u.protocol!==i.protocol&&u.protocol!=="https:"||u.host!==s&&!iEI(u.host,s))&&C6e(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),NC(I)){var o={headers:t.headers,statusCode:e},d={url:r,method:a,headers:l};I(this._options,o,d),this._sanitizeOptions(this._options)}this._performRequest()};function iNn(t){var e={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(t).forEach(function(l){var I=l+":",a=n[I]=t[l],c=e[l]=Object.create(a);function i(r,u,o){return uEI(r)?r=x6e(r):WC(r)?r=x6e(S6e(r)):(o=u,u=uNn(r),r={protocol:I}),NC(u)&&(o=u,u=null),u=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},r,u),u.nativeProtocols=n,!WC(u.host)&&!WC(u.hostname)&&(u.hostname="::1"),O6e.equal(u.protocol,I,"protocol mismatch"),oNn("options",u),new Pp(u,o)}function s(r,u,o){var d=c.request(r,u,o);return d.end(),d}Object.defineProperties(c,{request:{value:i,configurable:!0,enumerable:!0,writable:!0},get:{value:s,configurable:!0,enumerable:!0,writable:!0}})}),e}function sNn(){}function S6e(t){var e;if(U6e)e=new Dq(t);else if(e=uNn(Kq.parse(t)),!WC(e.protocol))throw new L6e({input:t});return e}function oEI(t,e){return U6e?new Dq(t,e):S6e(Kq.resolve(e,t))}function uNn(t){if(/^\[/.test(t.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(t.hostname))throw new L6e({input:t.href||t});if(/^\[/.test(t.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(t.host))throw new L6e({input:t.href||t});return t}function x6e(t,e){var n=e||{};for(var l of lEI)n[l]=t[l];return n.hostname.startsWith("[")&&(n.hostname=n.hostname.slice(1,-1)),n.port!==""&&(n.port=Number(n.port)),n.path=n.search?n.pathname+n.search:n.pathname,n}function C6e(t,e){var n;for(var l in e)t.test(l)&&(n=e[l],delete e[l]);return n===null||typeof n>"u"?void 0:String(n).trim()}function _q(t,e,n){function l(I){NC(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,I||{}),this.code=t,this.message=this.cause?e+": "+this.cause.message:e}return l.prototype=new(n||Error),Object.defineProperties(l.prototype,{constructor:{value:l,enumerable:!1},name:{value:"Error ["+t+"]",enumerable:!1}}),l}function M6e(t,e){for(var n of z6e)t.removeListener(n,B6e[n]);t.on("error",sNn),t.destroy(e)}function iEI(t,e){O6e(WC(t)&&WC(e));var n=t.length-e.length-1;return n>0&&t[n]==="."&&t.endsWith(e)}function WC(t){return typeof t=="string"||t instanceof String}function NC(t){return typeof t=="function"}function sEI(t){return typeof t=="object"&&"length"in t}function uEI(t){return Dq&&t instanceof Dq}T6e.exports=iNn({http:tEI,https:nEI});T6e.exports.wrap=iNn});var bNn=f((nAr,GNn)=>{var dEI=require("http"),GEI=require("https"),Pq=aNn(),yYe=Mq(),bEI=dNn();Pq=Object.keys(Pq).map(function(t){return Pq[t]});var mEI={http:dEI,https:GEI};GNn.exports={deleteLength:function(e,n,l){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,n,l){l.timeout&&e.socket.setTimeout(l.timeout)},XHeaders:function(e,n,l){if(l.xfwd){var I=e.isSpdy||yYe.hasEncryptedConnection(e),a={for:e.connection.remoteAddress||e.socket.remoteAddress,port:yYe.getPort(e),proto:I?"https":"http"};["for","port","proto"].forEach(function(c){e.headers["x-forwarded-"+c]=(e.headers["x-forwarded-"+c]||"")+(e.headers["x-forwarded-"+c]?",":"")+a[c]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,n,l,I,a,c){a.emit("start",e,n,l.target||l.forward);var i=l.followRedirects?bEI:mEI,s=i.http,r=i.https;if(l.forward){var u=(l.forward.protocol==="https:"?r:s).request(yYe.setupOutgoing(l.ssl||{},l,e,"forward")),o=h(u,l.forward);if(e.on("error",o),u.on("error",o),(l.buffer||e).pipe(u),!l.target)return n.end()}var d=(l.target.protocol==="https:"?r:s).request(yYe.setupOutgoing(l.ssl||{},l,e));d.on("socket",function(Z){a&&!d.getHeader("expect")&&a.emit("proxyReq",d,e,n,l)}),l.proxyTimeout&&d.setTimeout(l.proxyTimeout,function(){d.abort()}),e.on("aborted",function(){d.abort()});var b=h(d,l.target);e.on("error",b),d.on("error",b);function h(Z,N){return function(y){if(e.socket.destroyed&&y.code==="ECONNRESET")return a.emit("econnreset",y,e,n,N),Z.abort();c?c(y,e,n,N):a.emit("error",y,e,n,N)}}(l.buffer||e).pipe(d),d.on("response",function(Z){if(a&&a.emit("proxyRes",Z,e,n),!n.headersSent&&!l.selfHandleResponse)for(var N=0;N{var pEI=require("http"),hEI=require("https"),m9=Mq();mNn.exports={checkMethodAndHeader:function(e,n){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return n.destroy(),!0},XHeaders:function(e,n,l){if(l.xfwd){var I={for:e.connection.remoteAddress||e.socket.remoteAddress,port:m9.getPort(e),proto:m9.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(a){e.headers["x-forwarded-"+a]=(e.headers["x-forwarded-"+a]||"")+(e.headers["x-forwarded-"+a]?",":"")+I[a]})}},stream:function(e,n,l,I,a,c){var i=function(u,o){return Object.keys(o).reduce(function(d,b){var h=o[b];if(!Array.isArray(h))return d.push(b+": "+h),d;for(var Z=0;Z{var NNn=YNn.exports,hNn=require("util")._extend,ZEI=require("url").parse,VNn=AAe(),WEI=require("http"),NEI=require("https"),ZNn=bNn(),WNn=pNn();NNn.Server=VC;function D6e(t){return function(e){return function(n,l){var I=t==="ws"?this.wsPasses:this.webPasses,a=[].slice.call(arguments),c=a.length-1,i,s;typeof a[c]=="function"&&(s=a[c],c--);var r=e;if(!(a[c]instanceof Buffer)&&a[c]!==l&&(r=hNn({},e),hNn(r,a[c]),c--),a[c]instanceof Buffer&&(i=a[c]),["target","forward"].forEach(function(o){typeof r[o]=="string"&&(r[o]=ZEI(r[o]))}),!r.target&&!r.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var u=0;u{var qq=gNn().Server;function K6e(t){return new qq(t)}qq.createProxyServer=K6e;qq.createServer=K6e;qq.createProxy=K6e;RNn.exports=qq});var FNn=f((rAr,ANn)=>{ANn.exports=yNn()});var fNn=f((cAr,vNn)=>{vNn.exports=Array.isArray||function(t){return Object.prototype.toString.call(t)=="[object Array]"}});var QNn=f((oAr,p9)=>{var AYe=fNn();p9.exports=HNn;p9.exports.parse=_6e;p9.exports.compile=gEI;p9.exports.tokensToFunction=XNn;p9.exports.tokensToRegExp=wNn;var VEI=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function _6e(t,e){for(var n=[],l=0,I=0,a="",c=e&&e.delimiter||"/",i;(i=VEI.exec(t))!=null;){var s=i[0],r=i[1],u=i.index;if(a+=t.slice(I,u),I=u+s.length,r){a+=r[1];continue}var o=t[I],d=i[2],b=i[3],h=i[4],Z=i[5],N=i[6],g=i[7];a&&(n.push(a),a="");var y=d!=null&&o!=null&&o!==d,X=N==="+"||N==="*",v=N==="?"||N==="*",H=d||c,Q=h||Z,L=d||(typeof n[n.length-1]=="string"?n[n.length-1]:"");n.push({name:b||l++,prefix:d||"",delimiter:H,optional:v,repeat:X,partial:y,asterisk:!!g,pattern:Q?AEI(Q):g?".*":YEI(H,L)})}return I-1?"[^"+YC(t)+"]+?":YC(e)+"|(?:(?!"+YC(e)+")[^"+YC(t)+"])+?"}function gEI(t,e){return XNn(_6e(t,e),e)}function REI(t){return encodeURI(t).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function yEI(t){return encodeURI(t).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function XNn(t,e){for(var n=new Array(t.length),l=0;l{typeof Object.create=="function"?$6e.exports=function(e,n){e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:$6e.exports=function(e,n){e.super_=n;var l=function(){};l.prototype=n.prototype,e.prototype=new l,e.prototype.constructor=e}});var CNn=f((ty,JNn)=>{var h9=u9(),eqe=ENn();function XEI(t){return t.split(" ").map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}ty=JNn.exports=function t(){for(var e,n,l=500,I={},a=0;a=400});wEI.forEach(function(t){var e=XEI(h9[t]),n=e.match(/Error$/)?e:e+"Error";if(t>=500){var l=function a(c){var i=new Error(c??h9[t]);return Error.captureStackTrace(i,a),i.__proto__=a.prototype,Object.defineProperty(i,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),i};eqe(l,tqe),l.prototype.status=l.prototype.statusCode=t,l.prototype.expose=!1,ty[t]=ty[e]=l;return}var I=function a(c){var i=new Error(c??h9[t]);return Error.captureStackTrace(i,a),i.__proto__=a.prototype,Object.defineProperty(i,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),i};eqe(I,tqe),I.prototype.status=I.prototype.statusCode=t,I.prototype.expose=!0,ty[t]=ty[e]=I});ty["I'mateapot"]=ty.ImATeapot});var kNn=f((sAr,LNn)=>{var HEI=QNn(),QEI=CNn();LNn.exports=function(t){return t=t||{},function(e){var n=[],l=HEI(e,n,t);return function(I,a){var c=l.exec(I);if(!c)return!1;a=a||{};for(var i,s,r=0;r{JEI=new Uint8Array(16)});var xNn,jNn=B(()=>{xNn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function CEI(t){return typeof t=="string"&&xNn.test(t)}var nH,e7=B(()=>{jNn();nH=CEI});function LEI(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(TG[t[e+0]]+TG[t[e+1]]+TG[t[e+2]]+TG[t[e+3]]+"-"+TG[t[e+4]]+TG[t[e+5]]+"-"+TG[t[e+6]]+TG[t[e+7]]+"-"+TG[t[e+8]]+TG[t[e+9]]+"-"+TG[t[e+10]]+TG[t[e+11]]+TG[t[e+12]]+TG[t[e+13]]+TG[t[e+14]]+TG[t[e+15]]).toLowerCase();if(!nH(n))throw TypeError("Stringified UUID is invalid");return n}var TG,vYe,lH,t7=B(()=>{e7();TG=[];for(vYe=0;vYe<256;++vYe)TG.push((vYe+256).toString(16).substr(1));lH=LEI});function kEI(t,e,n){var l=e&&n||0,I=e||new Array(16);t=t||{};var a=t.node||ONn,c=t.clockseq!==void 0?t.clockseq:lqe;if(a==null||c==null){var i=t.random||(t.rng||$q)();a==null&&(a=ONn=[i[0]|1,i[1],i[2],i[3],i[4],i[5]]),c==null&&(c=lqe=(i[6]<<8|i[7])&16383)}var s=t.msecs!==void 0?t.msecs:Date.now(),r=t.nsecs!==void 0?t.nsecs:aqe+1,u=s-Iqe+(r-aqe)/1e4;if(u<0&&t.clockseq===void 0&&(c=c+1&16383),(u<0||s>Iqe)&&t.nsecs===void 0&&(r=0),r>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Iqe=s,aqe=r,lqe=c,s+=122192928e5;var o=((s&268435455)*1e4+r)%4294967296;I[l++]=o>>>24&255,I[l++]=o>>>16&255,I[l++]=o>>>8&255,I[l++]=o&255;var d=s/4294967296*1e4&268435455;I[l++]=d>>>8&255,I[l++]=d&255,I[l++]=d>>>24&15|16,I[l++]=d>>>16&255,I[l++]=c>>>8|128,I[l++]=c&255;for(var b=0;b<6;++b)I[l+b]=a[b];return e||lH(I)}var ONn,lqe,Iqe,aqe,UNn,zNn=B(()=>{nqe();t7();Iqe=0,aqe=0;UNn=kEI});function xEI(t){if(!nH(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}var fYe,rqe=B(()=>{e7();fYe=xEI});function jEI(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n{t7();rqe();OEI="6ba7b810-9dad-11d1-80b4-00c04fd430c8",UEI="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function zEI(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n>5]>>>I%32&255,c=parseInt(l.charAt(a>>>4&15)+l.charAt(a&15),16);e.push(c)}return e}function BNn(t){return(t+64>>>9<<4)+14+1}function SEI(t,e){t[e>>5]|=128<>5]|=(t[l/8]&255)<>16)+(e>>16)+(n>>16);return l<<16|n&65535}function TEI(t,e){return t<>>32-e}function wYe(t,e,n,l,I,a){return IH(TEI(IH(IH(e,t),IH(l,a)),I),n)}function Kb(t,e,n,l,I,a,c){return wYe(e&n|~e&l,t,e,I,a,c)}function _b(t,e,n,l,I,a,c){return wYe(e&l|n&~l,t,e,I,a,c)}function Pb(t,e,n,l,I,a,c){return wYe(e^n^l,t,e,I,a,c)}function qb(t,e,n,l,I,a,c){return wYe(n^(e|~l),t,e,I,a,c)}var SNn,MNn=B(()=>{SNn=zEI});var DEI,TNn,DNn=B(()=>{cqe();MNn();DEI=XYe("v3",48,SNn),TNn=DEI});function KEI(t,e,n){t=t||{};var l=t.random||(t.rng||$q)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,e){n=n||0;for(var I=0;I<16;++I)e[n+I]=l[I];return e}return lH(l)}var KNn,_Nn=B(()=>{nqe();t7();KNn=KEI});function _EI(t,e,n,l){switch(t){case 0:return e&n^~e&l;case 1:return e^n^l;case 2:return e&n^e&l^n&l;case 3:return e^n^l}}function oqe(t,e){return t<>>32-e}function PEI(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var l=unescape(encodeURIComponent(t));t=[];for(var I=0;I>>0;X=y,y=g,g=oqe(N,30)>>>0,N=Z,Z=Q}n[0]=n[0]+Z>>>0,n[1]=n[1]+N>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+X>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var PNn,qNn=B(()=>{PNn=PEI});var qEI,$Nn,eVn=B(()=>{cqe();qNn();qEI=XYe("v5",80,PNn),$Nn=qEI});var tVn,nVn=B(()=>{tVn="00000000-0000-0000-0000-000000000000"});function $EI(t){if(!nH(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var lVn,IVn=B(()=>{e7();lVn=$EI});var aVn={};Xe(aVn,{NIL:()=>tVn,parse:()=>fYe,stringify:()=>lH,v1:()=>UNn,v3:()=>TNn,v4:()=>KNn,v5:()=>$Nn,validate:()=>nH,version:()=>lVn});var rVn=B(()=>{zNn();DNn();_Nn();eVn();nVn();IVn();e7();t7();rqe()});var cVn=f((DAr,uqe)=>{var{URL:e1I}=require("url"),t1I=FNn(),n1I=Mq(),l1I=kNn(),{v4:I1I}=(rVn(),f$e(aVn)),a1I=require("url"),sqe=t1I.createProxyServer(),r1I=l1I({sensitive:!1,strict:!1,end:!1}),iqe="__KOA_PROXIES_MIDDLEWARE_ID__",gC={};function c1I(t){if(!(["error","proxyReq","proxyRes"].indexOf(t)<0))return gC[t]=new Map,sqe.on(t,(...e)=>{let n=e[1],l=gC[t].get(n[iqe]);typeof l=="function"&&l(...e)}),gC[t]}uqe.exports=(t,e)=>{let n=I1I();return(l,I)=>{let c=r1I(t)(l.path);if(!c)return I();let i;if(typeof e=="function"){if(i=e.call(e,c,l),i===!1)return I()}else i=Object.assign({},e);let{logs:s,rewrite:r,events:u,...o}=i;return new Promise((d,b)=>{l.req.oldPath=l.req.url,typeof r=="function"&&(l.req.url=r(l.req.url,l)),s&&(typeof s=="function"?s(l,i.target):o1I(l,o)),u&&typeof u=="object"&&(l.req[iqe]=n,Object.entries(u).forEach(([h,Z])=>{let N=gC[h]==null?c1I(h):gC[h];typeof N=="object"&&!N.has(n)&&N.set(n,Z)})),l.res.on("close",()=>{b(new Error(`Http response closed while proxying ${l.req.oldPath}`))}),l.res.on("finish",()=>{d()}),sqe.web(l.req,l.res,o,(h,...Z)=>{let N=gC.error&&gC.error.get(l.req[iqe]);typeof N=="function"&&N(h,...Z);let g={ECONNREFUSED:503,ETIMEOUT:504}[h.code];l.status=g||500,d()})})}};uqe.exports.proxy=sqe;function o1I(t,e){let n={},l;try{let I={...e,target:a1I.parse(e.target||"")};n1I.setupOutgoing(n,I,t.req),l=new e1I("",`${I.target.protocol}//${n.host}${n.path}`)}catch{console.error("Error occurs when logging. Please check if target is a valid URL.")}console.log("%s - %s %s proxy to -> %s",new Date().toISOString(),t.req.method,t.req.oldPath,`${l||e.target}`)}});var WVn=f((B0r,ZVn)=>{ZVn.exports=function(){return{"pretty-error":{display:"block",marginLeft:"2"},"pretty-error > header":{display:"block"},"pretty-error > header > title > kind":{background:"red",color:"bright-white"},"pretty-error > header > title > wrapper":{marginRight:"1",color:"grey"},"pretty-error > header > colon":{color:"grey",marginRight:1},"pretty-error > header > message":{color:"bright-white"},"pretty-error > trace":{display:"block",marginTop:1},"pretty-error > trace > item":{display:"block",marginBottom:1,marginLeft:2,bullet:'"-"'},"pretty-error > trace > item > header":{display:"block"},"pretty-error > trace > item > header > pointer > file":{color:"bright-yellow"},"pretty-error > trace > item > header > pointer > colon":{color:"grey"},"pretty-error > trace > item > header > pointer > line":{color:"bright-yellow",marginRight:1},"pretty-error > trace > item > header > what":{color:"white"},"pretty-error > trace > item > footer":{display:"block"},"pretty-error > trace > item > footer > addr":{display:"block",color:"grey"},"pretty-error > trace > item > footer > extra":{display:"block",color:"grey"}}}});var RVn=f((S0r,gVn)=>{var VVn,r7,Wqe,YVn,QYe,NVn,Nqe;Wqe=Ca();gVn.exports=VVn=function(){function t(e){this.error=e,this._parse()}return t.prototype._parse=function(){var e;this._trace=[],this._kind="Error",this._wrapper="",this.error.wrapper!=null&&(this._wrapper=String(this.error.wrapper)),typeof this.error!="object"?this._message=String(this.error):(this._stack=this.error.stack,this.error.kind!=null?this._kind=String(this.error.kind):typeof this._stack=="string"&&(e=this._stack.match(/^([a-zA-Z0-9\_\$]+):\ /))&&(this._kind=e[1]),this._message=this.error.message!=null&&String(this.error.message)||"",typeof this._stack=="string"&&this._parseStack())},t.prototype._parseStack=function(){var e,n,l,I,a,c,i;for(l=[],I=!1,i=this._stack.split(` +`),a=0,c=i.length;a)"||e==="Error (:null:null)"))return o=e,X=null,n=null,h=null,a=null,c=null,r=null,l=null,s=null,i=null,y=null,g=null,d="[current]",(u=e.match(/\(([^\)]+)\)$/))&&(n=u[1].trim()),n!=null&&(X=e.substr(0,e.length-n.length-2),X=X.trim()),n==null&&(n=e.trim()),n=this._fixPath(n),N=n,(u=N.match(/\,\ :(\d+):(\d+)$/))&&(s=u[1],i=u[2],N=N.substr(0,N.length-u[0].length)),(u=N.match(/:(\d+):(\d+)$/))&&(r=u[1],l=u[2],N=N.substr(0,N.length-u[0].length),h=N),h!=null&&(c=Wqe.basename(h),a=Wqe.dirname(h),a==="."&&(a=""),h=this._fixPath(h),c=this._fixPath(c),a=this._fixPath(a)),a!=null&&(I=a.replace(/[\\]{1,2}/g,"/"),(u=I.match(/node_modules\/([^\/]+)(?!.*node_modules.*)/))&&(d=u[1])),s==null&&(s=r,i=l),h!=null&&(Z=this._rectifyPath(h),y=Z.path,g=y+n.substr(h.length,n.length),b=Z.packages),{original:o,what:X,addr:n,path:h,dir:a,file:c,line:parseInt(r),col:parseInt(l),jsLine:parseInt(s),jsCol:parseInt(i),packageName:d,shortenedPath:y,shortenedAddr:g,packages:b||[]}}},t.prototype._getMessage=function(){return this._message},t.prototype._getKind=function(){return this._kind},t.prototype._getWrapper=function(){return this._wrapper},t.prototype._getStack=function(){return this._stack},t.prototype._getArguments=function(){return this.error.arguments},t.prototype._getType=function(){return this.error.type},t.prototype._getTrace=function(){return this._trace},t.prototype._fixPath=function(e){return e.replace(/[\\]{1,2}/g,"/")},t.prototype._rectifyPath=function(e,n){var l,I,a,c,i;if(e=String(e),c=e,!(l=e.match(/^(.+?)\/node_modules\/(.+)$/)))return{path:e,packages:[]};for(a=[],I=[],typeof n=="string"?(a.push("["+n+"]"),I.push("["+n+"]")):(a.push("["+l[1].match(/([^\/]+)$/)[1]+"]"),I.push(l[1].match(/([^\/]+)$/)[1])),i=l[2];l=i.match(/([^\/]+)\/node_modules\/(.+)$/);)a.push("["+l[1]+"]"),I.push(l[1]),i=l[2];return(l=i.match(/([^\/]+)\/(.+)$/))&&(a.push("["+l[1]+"]"),I.push(l[1]),i=l[2]),a.push(i),{path:a.join("/"),packages:I}},t}();Nqe=["message","kind","arguments","type","stack","trace","wrapper"];YVn=function(){var t;return t="_get"+r7[0].toUpperCase()+r7.substr(1,r7.length),Object.defineProperty(VVn.prototype,r7,{get:function(){return this[t]()}})};for(QYe=0,NVn=Nqe.length;QYe{yVn.exports=["_debugger.js","_http_agent.js","_http_client.js","_http_common.js","_http_incoming.js","_http_outgoing.js","_http_server.js","_linklist.js","_stream_duplex.js","_stream_passthrough.js","_stream_readable.js","_stream_transform.js","_stream_writable.js","_tls_legacy.js","_tls_wrap.js","assert.js","buffer.js","child_process.js","cluster.js","console.js","constants.js","crypto.js","dgram.js","dns.js","domain.js","events.js","freelist.js","fs.js","http.js","https.js","module.js","net.js","os.js","path.js","punycode.js","querystring.js","readline.js","repl.js","smalloc.js","stream.js","string_decoder.js","sys.js","timers.js","tls.js","tty.js","url.js","util.js","vm.js","zlib.js","node.js"]});var Yqe=f(c7=>{"use strict";var EYe=c7&&c7.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(c7,"__esModule",{value:!0});var u1I=EYe(tJe()),d1I=EYe(MIe()),Vqe=EYe(eJe()),G1I=EYe(TIe());function ZZ(t){return t===" "||t===` +`||t===" "||t==="\f"||t==="\r"}function FVn(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}function qd(t,e,n){var l=t.toLowerCase();return t===l?function(I,a){a===l?I._state=e:(I._state=n,I._index--)}:function(I,a){a===l||a===t?I._state=e:(I._state=n,I._index--)}}function RY(t,e){var n=t.toLowerCase();return function(l,I){I===n||I===t?l._state=e:(l._state=3,l._index--)}}var b1I=qd("C",24,16),m1I=qd("D",25,16),p1I=qd("A",26,16),h1I=qd("T",27,16),Z1I=qd("A",28,16),W1I=RY("R",35),N1I=RY("I",36),V1I=RY("P",37),Y1I=RY("T",38),g1I=qd("R",40,1),R1I=qd("I",41,1),y1I=qd("P",42,1),A1I=qd("T",43,1),F1I=RY("Y",45),v1I=RY("L",46),f1I=RY("E",47),X1I=qd("Y",49,1),w1I=qd("L",50,1),H1I=qd("E",51,1),Q1I=RY("I",54),E1I=RY("T",55),J1I=RY("L",56),C1I=RY("E",57),L1I=qd("I",58,1),k1I=qd("T",59,1),x1I=qd("L",60,1),j1I=qd("E",61,1),O1I=qd("#",63,64),U1I=qd("X",66,65),z1I=function(){function t(e,n){var l;this._state=1,this.buffer="",this.sectionStart=0,this._index=0,this.bufferOffset=0,this.baseState=1,this.special=1,this.running=!0,this.ended=!1,this.cbs=n,this.xmlMode=!!e?.xmlMode,this.decodeEntities=(l=e?.decodeEntities)!==null&&l!==void 0?l:!0}return t.prototype.reset=function(){this._state=1,this.buffer="",this.sectionStart=0,this._index=0,this.bufferOffset=0,this.baseState=1,this.special=1,this.running=!0,this.ended=!1},t.prototype.write=function(e){this.ended&&this.cbs.onerror(Error(".write() after done!")),this.buffer+=e,this.parse()},t.prototype.end=function(e){this.ended&&this.cbs.onerror(Error(".end() after done!")),e&&this.write(e),this.ended=!0,this.running&&this.finish()},t.prototype.pause=function(){this.running=!1},t.prototype.resume=function(){this.running=!0,this._indexthis.sectionStart&&this.cbs.ontext(this.getSection()),this._state=2,this.sectionStart=this._index):this.decodeEntities&&e==="&"&&(this.special===1||this.special===4)&&(this._index>this.sectionStart&&this.cbs.ontext(this.getSection()),this.baseState=1,this._state=62,this.sectionStart=this._index)},t.prototype.isTagStartChar=function(e){return FVn(e)||this.xmlMode&&!ZZ(e)&&e!=="/"&&e!==">"},t.prototype.stateBeforeTagName=function(e){e==="/"?this._state=5:e==="<"?(this.cbs.ontext(this.getSection()),this.sectionStart=this._index):e===">"||this.special!==1||ZZ(e)?this._state=1:e==="!"?(this._state=15,this.sectionStart=this._index+1):e==="?"?(this._state=17,this.sectionStart=this._index+1):this.isTagStartChar(e)?(this._state=!this.xmlMode&&(e==="s"||e==="S")?32:!this.xmlMode&&(e==="t"||e==="T")?52:3,this.sectionStart=this._index):this._state=1},t.prototype.stateInTagName=function(e){(e==="/"||e===">"||ZZ(e))&&(this.emitToken("onopentagname"),this._state=8,this._index--)},t.prototype.stateBeforeClosingTagName=function(e){ZZ(e)||(e===">"?this._state=1:this.special!==1?this.special!==4&&(e==="s"||e==="S")?this._state=33:this.special===4&&(e==="t"||e==="T")?this._state=53:(this._state=1,this._index--):this.isTagStartChar(e)?(this._state=6,this.sectionStart=this._index):(this._state=20,this.sectionStart=this._index))},t.prototype.stateInClosingTagName=function(e){(e===">"||ZZ(e))&&(this.emitToken("onclosetag"),this._state=7,this._index--)},t.prototype.stateAfterClosingTagName=function(e){e===">"&&(this._state=1,this.sectionStart=this._index+1)},t.prototype.stateBeforeAttributeName=function(e){e===">"?(this.cbs.onopentagend(),this._state=1,this.sectionStart=this._index+1):e==="/"?this._state=4:ZZ(e)||(this._state=9,this.sectionStart=this._index)},t.prototype.stateInSelfClosingTag=function(e){e===">"?(this.cbs.onselfclosingtag(),this._state=1,this.sectionStart=this._index+1,this.special=1):ZZ(e)||(this._state=8,this._index--)},t.prototype.stateInAttributeName=function(e){(e==="="||e==="/"||e===">"||ZZ(e))&&(this.cbs.onattribname(this.getSection()),this.sectionStart=-1,this._state=10,this._index--)},t.prototype.stateAfterAttributeName=function(e){e==="="?this._state=11:e==="/"||e===">"?(this.cbs.onattribend(void 0),this._state=8,this._index--):ZZ(e)||(this.cbs.onattribend(void 0),this._state=9,this.sectionStart=this._index)},t.prototype.stateBeforeAttributeValue=function(e){e==='"'?(this._state=12,this.sectionStart=this._index+1):e==="'"?(this._state=13,this.sectionStart=this._index+1):ZZ(e)||(this._state=14,this.sectionStart=this._index,this._index--)},t.prototype.handleInAttributeValue=function(e,n){e===n?(this.emitToken("onattribdata"),this.cbs.onattribend(n),this._state=8):this.decodeEntities&&e==="&"&&(this.emitToken("onattribdata"),this.baseState=this._state,this._state=62,this.sectionStart=this._index)},t.prototype.stateInAttributeValueDoubleQuotes=function(e){this.handleInAttributeValue(e,'"')},t.prototype.stateInAttributeValueSingleQuotes=function(e){this.handleInAttributeValue(e,"'")},t.prototype.stateInAttributeValueNoQuotes=function(e){ZZ(e)||e===">"?(this.emitToken("onattribdata"),this.cbs.onattribend(null),this._state=8,this._index--):this.decodeEntities&&e==="&"&&(this.emitToken("onattribdata"),this.baseState=this._state,this._state=62,this.sectionStart=this._index)},t.prototype.stateBeforeDeclaration=function(e){this._state=e==="["?23:e==="-"?18:16},t.prototype.stateInDeclaration=function(e){e===">"&&(this.cbs.ondeclaration(this.getSection()),this._state=1,this.sectionStart=this._index+1)},t.prototype.stateInProcessingInstruction=function(e){e===">"&&(this.cbs.onprocessinginstruction(this.getSection()),this._state=1,this.sectionStart=this._index+1)},t.prototype.stateBeforeComment=function(e){e==="-"?(this._state=19,this.sectionStart=this._index+1):this._state=16},t.prototype.stateInComment=function(e){e==="-"&&(this._state=21)},t.prototype.stateInSpecialComment=function(e){e===">"&&(this.cbs.oncomment(this.buffer.substring(this.sectionStart,this._index)),this._state=1,this.sectionStart=this._index+1)},t.prototype.stateAfterComment1=function(e){e==="-"?this._state=22:this._state=19},t.prototype.stateAfterComment2=function(e){e===">"?(this.cbs.oncomment(this.buffer.substring(this.sectionStart,this._index-2)),this._state=1,this.sectionStart=this._index+1):e!=="-"&&(this._state=19)},t.prototype.stateBeforeCdata6=function(e){e==="["?(this._state=29,this.sectionStart=this._index+1):(this._state=16,this._index--)},t.prototype.stateInCdata=function(e){e==="]"&&(this._state=30)},t.prototype.stateAfterCdata1=function(e){e==="]"?this._state=31:this._state=29},t.prototype.stateAfterCdata2=function(e){e===">"?(this.cbs.oncdata(this.buffer.substring(this.sectionStart,this._index-2)),this._state=1,this.sectionStart=this._index+1):e!=="]"&&(this._state=29)},t.prototype.stateBeforeSpecialS=function(e){e==="c"||e==="C"?this._state=34:e==="t"||e==="T"?this._state=44:(this._state=3,this._index--)},t.prototype.stateBeforeSpecialSEnd=function(e){this.special===2&&(e==="c"||e==="C")?this._state=39:this.special===3&&(e==="t"||e==="T")?this._state=48:this._state=1},t.prototype.stateBeforeSpecialLast=function(e,n){(e==="/"||e===">"||ZZ(e))&&(this.special=n),this._state=3,this._index--},t.prototype.stateAfterSpecialLast=function(e,n){e===">"||ZZ(e)?(this.special=1,this._state=6,this.sectionStart=this._index-n,this._index--):this._state=1},t.prototype.parseFixedEntity=function(e){if(e===void 0&&(e=this.xmlMode?G1I.default:d1I.default),this.sectionStart+1=2;){var l=this.buffer.substr(e,n);if(Object.prototype.hasOwnProperty.call(Vqe.default,l)){this.emitPartial(Vqe.default[l]),this.sectionStart+=n+1;return}n--}},t.prototype.stateInNamedEntity=function(e){e===";"?(this.parseFixedEntity(),this.baseState===1&&this.sectionStart+1"9")&&!FVn(e)&&(this.xmlMode||this.sectionStart+1===this._index||(this.baseState!==1?e!=="="&&this.parseFixedEntity(Vqe.default):this.parseLegacyEntity()),this._state=this.baseState,this._index--)},t.prototype.decodeNumericEntity=function(e,n,l){var I=this.sectionStart+e;if(I!==this._index){var a=this.buffer.substring(I,this._index),c=parseInt(a,n);this.emitPartial(u1I.default(c)),this.sectionStart=l?this._index+1:this._index}this._state=this.baseState},t.prototype.stateInNumericEntity=function(e){e===";"?this.decodeNumericEntity(2,10,!0):(e<"0"||e>"9")&&(this.xmlMode?this._state=this.baseState:this.decodeNumericEntity(2,10,!1),this._index--)},t.prototype.stateInHexEntity=function(e){e===";"?this.decodeNumericEntity(3,16,!0):(e<"a"||e>"f")&&(e<"A"||e>"F")&&(e<"0"||e>"9")&&(this.xmlMode?this._state=this.baseState:this.decodeNumericEntity(3,16,!1),this._index--)},t.prototype.cleanup=function(){this.sectionStart<0?(this.buffer="",this.bufferOffset+=this._index,this._index=0):this.running&&(this._state===1?(this.sectionStart!==this._index&&this.cbs.ontext(this.buffer.substr(this.sectionStart)),this.buffer="",this.bufferOffset+=this._index,this._index=0):this.sectionStart===this._index?(this.buffer="",this.bufferOffset+=this._index,this._index=0):(this.buffer=this.buffer.substr(this.sectionStart),this._index-=this.sectionStart,this.bufferOffset+=this.sectionStart),this.sectionStart=0)},t.prototype.parse=function(){for(;this._index{"use strict";var B1I=g9&&g9.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(g9,"__esModule",{value:!0});g9.Parser=void 0;var S1I=B1I(Yqe()),Y9=new Set(["input","option","optgroup","select","button","datalist","textarea"]),Pr=new Set(["p"]),vVn={tr:new Set(["tr","th","td"]),th:new Set(["th"]),td:new Set(["thead","th","td"]),body:new Set(["head","link","script"]),li:new Set(["li"]),p:Pr,h1:Pr,h2:Pr,h3:Pr,h4:Pr,h5:Pr,h6:Pr,select:Y9,input:Y9,output:Y9,button:Y9,datalist:Y9,textarea:Y9,option:new Set(["option"]),optgroup:new Set(["optgroup","option"]),dd:new Set(["dt","dd"]),dt:new Set(["dt","dd"]),address:Pr,article:Pr,aside:Pr,blockquote:Pr,details:Pr,div:Pr,dl:Pr,fieldset:Pr,figcaption:Pr,figure:Pr,footer:Pr,form:Pr,header:Pr,hr:Pr,main:Pr,nav:Pr,ol:Pr,pre:Pr,section:Pr,table:Pr,ul:Pr,rt:new Set(["rt","rp"]),rp:new Set(["rt","rp"]),tbody:new Set(["thead","tbody"]),tfoot:new Set(["thead","tbody"])},gqe=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),fVn=new Set(["math","svg"]),XVn=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),M1I=/\s|\//,T1I=function(){function t(e,n){n===void 0&&(n={});var l,I,a,c,i;this.startIndex=0,this.endIndex=null,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.options=n,this.cbs=e??{},this.lowerCaseTagNames=(l=n.lowerCaseTags)!==null&&l!==void 0?l:!n.xmlMode,this.lowerCaseAttributeNames=(I=n.lowerCaseAttributeNames)!==null&&I!==void 0?I:!n.xmlMode,this.tokenizer=new((a=n.Tokenizer)!==null&&a!==void 0?a:S1I.default)(this.options,this),(i=(c=this.cbs).onparserinit)===null||i===void 0||i.call(c,this)}return t.prototype.updatePosition=function(e){this.endIndex===null?this.tokenizer.sectionStart<=e?this.startIndex=0:this.startIndex=this.tokenizer.sectionStart-e:this.startIndex=this.endIndex+1,this.endIndex=this.tokenizer.getAbsoluteIndex()},t.prototype.ontext=function(e){var n,l;this.updatePosition(1),this.endIndex--,(l=(n=this.cbs).ontext)===null||l===void 0||l.call(n,e)},t.prototype.onopentagname=function(e){var n,l;if(this.lowerCaseTagNames&&(e=e.toLowerCase()),this.tagname=e,!this.options.xmlMode&&Object.prototype.hasOwnProperty.call(vVn,e))for(var I=void 0;this.stack.length>0&&vVn[e].has(I=this.stack[this.stack.length-1]);)this.onclosetag(I);(this.options.xmlMode||!gqe.has(e))&&(this.stack.push(e),fVn.has(e)?this.foreignContext.push(!0):XVn.has(e)&&this.foreignContext.push(!1)),(l=(n=this.cbs).onopentagname)===null||l===void 0||l.call(n,e),this.cbs.onopentag&&(this.attribs={})},t.prototype.onopentagend=function(){var e,n;this.updatePosition(1),this.attribs&&((n=(e=this.cbs).onopentag)===null||n===void 0||n.call(e,this.tagname,this.attribs),this.attribs=null),!this.options.xmlMode&&this.cbs.onclosetag&&gqe.has(this.tagname)&&this.cbs.onclosetag(this.tagname),this.tagname=""},t.prototype.onclosetag=function(e){if(this.updatePosition(1),this.lowerCaseTagNames&&(e=e.toLowerCase()),(fVn.has(e)||XVn.has(e))&&this.foreignContext.pop(),this.stack.length&&(this.options.xmlMode||!gqe.has(e))){var n=this.stack.lastIndexOf(e);if(n!==-1)if(this.cbs.onclosetag)for(n=this.stack.length-n;n--;)this.cbs.onclosetag(this.stack.pop());else this.stack.length=n;else e==="p"&&!this.options.xmlMode&&(this.onopentagname(e),this.closeCurrentTag())}else!this.options.xmlMode&&(e==="br"||e==="p")&&(this.onopentagname(e),this.closeCurrentTag())},t.prototype.onselfclosingtag=function(){this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?this.closeCurrentTag():this.onopentagend()},t.prototype.closeCurrentTag=function(){var e,n,l=this.tagname;this.onopentagend(),this.stack[this.stack.length-1]===l&&((n=(e=this.cbs).onclosetag)===null||n===void 0||n.call(e,l),this.stack.pop())},t.prototype.onattribname=function(e){this.lowerCaseAttributeNames&&(e=e.toLowerCase()),this.attribname=e},t.prototype.onattribdata=function(e){this.attribvalue+=e},t.prototype.onattribend=function(e){var n,l;(l=(n=this.cbs).onattribute)===null||l===void 0||l.call(n,this.attribname,this.attribvalue,e),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribname="",this.attribvalue=""},t.prototype.getInstructionName=function(e){var n=e.search(M1I),l=n<0?e:e.substr(0,n);return this.lowerCaseTagNames&&(l=l.toLowerCase()),l},t.prototype.ondeclaration=function(e){if(this.cbs.onprocessinginstruction){var n=this.getInstructionName(e);this.cbs.onprocessinginstruction("!"+n,"!"+e)}},t.prototype.onprocessinginstruction=function(e){if(this.cbs.onprocessinginstruction){var n=this.getInstructionName(e);this.cbs.onprocessinginstruction("?"+n,"?"+e)}},t.prototype.oncomment=function(e){var n,l,I,a;this.updatePosition(4),(l=(n=this.cbs).oncomment)===null||l===void 0||l.call(n,e),(a=(I=this.cbs).oncommentend)===null||a===void 0||a.call(I)},t.prototype.oncdata=function(e){var n,l,I,a,c,i;this.updatePosition(1),this.options.xmlMode||this.options.recognizeCDATA?((l=(n=this.cbs).oncdatastart)===null||l===void 0||l.call(n),(a=(I=this.cbs).ontext)===null||a===void 0||a.call(I,e),(i=(c=this.cbs).oncdataend)===null||i===void 0||i.call(c)):this.oncomment("[CDATA["+e+"]]")},t.prototype.onerror=function(e){var n,l;(l=(n=this.cbs).onerror)===null||l===void 0||l.call(n,e)},t.prototype.onend=function(){var e,n;if(this.cbs.onclosetag)for(var l=this.stack.length;l>0;this.cbs.onclosetag(this.stack[--l]));(n=(e=this.cbs).onend)===null||n===void 0||n.call(e)},t.prototype.reset=function(){var e,n,l,I;(n=(e=this.cbs).onreset)===null||n===void 0||n.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack=[],(I=(l=this.cbs).onparserinit)===null||I===void 0||I.call(l,this)},t.prototype.parseComplete=function(e){this.reset(),this.end(e)},t.prototype.write=function(e){this.tokenizer.write(e)},t.prototype.end=function(e){this.tokenizer.end(e)},t.prototype.pause=function(){this.tokenizer.pause()},t.prototype.resume=function(){this.tokenizer.resume()},t.prototype.parseChunk=function(e){this.write(e)},t.prototype.done=function(e){this.end(e)},t}();g9.Parser=T1I});var R9=f(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.Doctype=Lc.CDATA=Lc.Tag=Lc.Style=Lc.Script=Lc.Comment=Lc.Directive=Lc.Text=Lc.Root=Lc.isTag=Lc.ElementType=void 0;var WZ;(function(t){t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"})(WZ=Lc.ElementType||(Lc.ElementType={}));function D1I(t){return t.type===WZ.Tag||t.type===WZ.Script||t.type===WZ.Style}Lc.isTag=D1I;Lc.Root=WZ.Root;Lc.Text=WZ.Text;Lc.Directive=WZ.Directive;Lc.Comment=WZ.Comment;Lc.Script=WZ.Script;Lc.Style=WZ.Style;Lc.Tag=WZ.Tag;Lc.CDATA=WZ.CDATA;Lc.Doctype=WZ.Doctype});var vqe=f(sI=>{"use strict";var RC=sI&&sI.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,I){l.__proto__=I}||function(l,I){for(var a in I)Object.prototype.hasOwnProperty.call(I,a)&&(l[a]=I[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function l(){this.constructor=e}e.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}}(),o7=sI&&sI.__assign||function(){return o7=Object.assign||function(t){for(var e,n=1,l=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(n){this.children=n},enumerable:!1,configurable:!0}),e}(Aqe);sI.NodeWithChildren=CYe;var EVn=function(t){RC(e,t);function e(n){return t.call(this,xo.ElementType.Root,n)||this}return e}(CYe);sI.Document=EVn;var JVn=function(t){RC(e,t);function e(n,l,I,a){I===void 0&&(I=[]),a===void 0&&(a=n==="script"?xo.ElementType.Script:n==="style"?xo.ElementType.Style:xo.ElementType.Tag);var c=t.call(this,a,I)||this;return c.name=n,c.attribs=l,c}return Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(n){this.name=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var n=this;return Object.keys(this.attribs).map(function(l){var I,a;return{name:l,value:n.attribs[l],namespace:(I=n["x-attribsNamespace"])===null||I===void 0?void 0:I[l],prefix:(a=n["x-attribsPrefix"])===null||a===void 0?void 0:a[l]}})},enumerable:!1,configurable:!0}),e}(CYe);sI.Element=JVn;function CVn(t){return(0,xo.isTag)(t)}sI.isTag=CVn;function LVn(t){return t.type===xo.ElementType.CDATA}sI.isCDATA=LVn;function kVn(t){return t.type===xo.ElementType.Text}sI.isText=kVn;function xVn(t){return t.type===xo.ElementType.Comment}sI.isComment=xVn;function jVn(t){return t.type===xo.ElementType.Directive}sI.isDirective=jVn;function OVn(t){return t.type===xo.ElementType.Root}sI.isDocument=OVn;function _1I(t){return Object.prototype.hasOwnProperty.call(t,"children")}sI.hasChildren=_1I;function Fqe(t,e){e===void 0&&(e=!1);var n;if(kVn(t))n=new wVn(t.data);else if(xVn(t))n=new HVn(t.data);else if(CVn(t)){var l=e?yqe(t.children):[],I=new JVn(t.name,o7({},t.attribs),l);l.forEach(function(s){return s.parent=I}),t.namespace!=null&&(I.namespace=t.namespace),t["x-attribsNamespace"]&&(I["x-attribsNamespace"]=o7({},t["x-attribsNamespace"])),t["x-attribsPrefix"]&&(I["x-attribsPrefix"]=o7({},t["x-attribsPrefix"])),n=I}else if(LVn(t)){var l=e?yqe(t.children):[],a=new CYe(xo.ElementType.CDATA,l);l.forEach(function(r){return r.parent=a}),n=a}else if(OVn(t)){var l=e?yqe(t.children):[],c=new EVn(l);l.forEach(function(r){return r.parent=c}),t["x-mode"]&&(c["x-mode"]=t["x-mode"]),n=c}else if(jVn(t)){var i=new QVn(t.name,t.data);t["x-name"]!=null&&(i["x-name"]=t["x-name"],i["x-publicId"]=t["x-publicId"],i["x-systemId"]=t["x-systemId"]),n=i}else throw new Error("Not implemented yet: ".concat(t.type));return n.startIndex=t.startIndex,n.endIndex=t.endIndex,t.sourceCodeLocation!=null&&(n.sourceCodeLocation=t.sourceCodeLocation),n}sI.cloneNode=Fqe;function yqe(t){for(var e=t.map(function(l){return Fqe(l,!0)}),n=1;n{"use strict";var P1I=ny&&ny.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),q1I=ny&&ny.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&P1I(e,t,n)};Object.defineProperty(ny,"__esModule",{value:!0});ny.DomHandler=void 0;var LYe=R9(),aH=vqe();q1I(vqe(),ny);var UVn=/\s+/g,zVn={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1,xmlMode:!1},BVn=function(){function t(e,n,l){this.dom=[],this.root=new aH.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof n=="function"&&(l=n,n=zVn),typeof e=="object"&&(n=e,e=void 0),this.callback=e??null,this.options=n??zVn,this.elementCB=l??null}return t.prototype.onparserinit=function(e){this.parser=e},t.prototype.onreset=function(){this.dom=[],this.root=new aH.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},t.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},t.prototype.onerror=function(e){this.handleCallback(e)},t.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},t.prototype.onopentag=function(e,n){var l=this.options.xmlMode?LYe.ElementType.Tag:void 0,I=new aH.Element(e,n,void 0,l);this.addNode(I),this.tagStack.push(I)},t.prototype.ontext=function(e){var n=this.options.normalizeWhitespace,l=this.lastNode;if(l&&l.type===LYe.ElementType.Text)n?l.data=(l.data+e).replace(UVn," "):l.data+=e,this.options.withEndIndices&&(l.endIndex=this.parser.endIndex);else{n&&(e=e.replace(UVn," "));var I=new aH.Text(e);this.addNode(I),this.lastNode=I}},t.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===LYe.ElementType.Comment){this.lastNode.data+=e;return}var n=new aH.Comment(e);this.addNode(n),this.lastNode=n},t.prototype.oncommentend=function(){this.lastNode=null},t.prototype.oncdatastart=function(){var e=new aH.Text(""),n=new aH.NodeWithChildren(LYe.ElementType.CDATA,[e]);this.addNode(n),e.parent=n,this.lastNode=e},t.prototype.oncdataend=function(){this.lastNode=null},t.prototype.onprocessinginstruction=function(e,n){var l=new aH.ProcessingInstruction(e,n);this.addNode(l)},t.prototype.handleCallback=function(e){if(typeof this.callback=="function")this.callback(e,this.dom);else if(e)throw e},t.prototype.addNode=function(e){var n=this.tagStack[this.tagStack.length-1],l=n.children[n.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),n.children.push(e),l&&(e.prev=l,l.next=e),e.parent=n,this.lastNode=null},t}();ny.DomHandler=BVn;ny.default=BVn});var SVn=f(y9=>{"use strict";Object.defineProperty(y9,"__esModule",{value:!0});y9.attributeNames=y9.elementNames=void 0;y9.elementNames=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]);y9.attributeNames=new Map([["definitionurl","definitionURL"],["attributename","attributeName"],["attributetype","attributeType"],["basefrequency","baseFrequency"],["baseprofile","baseProfile"],["calcmode","calcMode"],["clippathunits","clipPathUnits"],["diffuseconstant","diffuseConstant"],["edgemode","edgeMode"],["filterunits","filterUnits"],["glyphref","glyphRef"],["gradienttransform","gradientTransform"],["gradientunits","gradientUnits"],["kernelmatrix","kernelMatrix"],["kernelunitlength","kernelUnitLength"],["keypoints","keyPoints"],["keysplines","keySplines"],["keytimes","keyTimes"],["lengthadjust","lengthAdjust"],["limitingconeangle","limitingConeAngle"],["markerheight","markerHeight"],["markerunits","markerUnits"],["markerwidth","markerWidth"],["maskcontentunits","maskContentUnits"],["maskunits","maskUnits"],["numoctaves","numOctaves"],["pathlength","pathLength"],["patterncontentunits","patternContentUnits"],["patterntransform","patternTransform"],["patternunits","patternUnits"],["pointsatx","pointsAtX"],["pointsaty","pointsAtY"],["pointsatz","pointsAtZ"],["preservealpha","preserveAlpha"],["preserveaspectratio","preserveAspectRatio"],["primitiveunits","primitiveUnits"],["refx","refX"],["refy","refY"],["repeatcount","repeatCount"],["repeatdur","repeatDur"],["requiredextensions","requiredExtensions"],["requiredfeatures","requiredFeatures"],["specularconstant","specularConstant"],["specularexponent","specularExponent"],["spreadmethod","spreadMethod"],["startoffset","startOffset"],["stddeviation","stdDeviation"],["stitchtiles","stitchTiles"],["surfacescale","surfaceScale"],["systemlanguage","systemLanguage"],["tablevalues","tableValues"],["targetx","targetX"],["targety","targetY"],["textlength","textLength"],["viewbox","viewBox"],["viewtarget","viewTarget"],["xchannelselector","xChannelSelector"],["ychannelselector","yChannelSelector"],["zoomandpan","zoomAndPan"]])});var KVn=f(yY=>{"use strict";var A9=yY&&yY.__assign||function(){return A9=Object.assign||function(t){for(var e,n=1,l=arguments.length;n0&&(l+=fqe(t.children,e)),(e.xmlMode||!MVn.has(t.name))&&(l+="")),l}function oJI(t){return"<"+t.data+">"}function iJI(t,e){var n=t.data||"";return e.decodeEntities!==!1&&!(!e.xmlMode&&t.parent&&nJI.has(t.parent.name))&&(n=TVn.encodeXML(n)),n}function sJI(t){return""}function uJI(t){return""}});var Hqe=f(qp=>{"use strict";var dJI=qp&&qp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qp,"__esModule",{value:!0});qp.innerText=qp.textContent=qp.getText=qp.getInnerHTML=qp.getOuterHTML=void 0;var ly=s2(),GJI=dJI(KVn()),bJI=R9();function _Vn(t,e){return(0,GJI.default)(t,e)}qp.getOuterHTML=_Vn;function mJI(t,e){return(0,ly.hasChildren)(t)?t.children.map(function(n){return _Vn(n,e)}).join(""):""}qp.getInnerHTML=mJI;function kYe(t){return Array.isArray(t)?t.map(kYe).join(""):(0,ly.isTag)(t)?t.name==="br"?` +`:kYe(t.children):(0,ly.isCDATA)(t)?kYe(t.children):(0,ly.isText)(t)?t.data:""}qp.getText=kYe;function Xqe(t){return Array.isArray(t)?t.map(Xqe).join(""):(0,ly.hasChildren)(t)&&!(0,ly.isComment)(t)?Xqe(t.children):(0,ly.isText)(t)?t.data:""}qp.textContent=Xqe;function wqe(t){return Array.isArray(t)?t.map(wqe).join(""):(0,ly.hasChildren)(t)&&(t.type===bJI.ElementType.Tag||(0,ly.isCDATA)(t))?wqe(t.children):(0,ly.isText)(t)?t.data:""}qp.innerText=wqe});var eYn=f($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.prevElementSibling=$d.nextElementSibling=$d.getName=$d.hasAttrib=$d.getAttributeValue=$d.getSiblings=$d.getParent=$d.getChildren=void 0;var PVn=s2(),pJI=[];function qVn(t){var e;return(e=t.children)!==null&&e!==void 0?e:pJI}$d.getChildren=qVn;function $Vn(t){return t.parent||null}$d.getParent=$Vn;function hJI(t){var e,n,l=$Vn(t);if(l!=null)return qVn(l);for(var I=[t],a=t.prev,c=t.next;a!=null;)I.unshift(a),e=a,a=e.prev;for(;c!=null;)I.push(c),n=c,c=n.next;return I}$d.getSiblings=hJI;function ZJI(t,e){var n;return(n=t.attribs)===null||n===void 0?void 0:n[e]}$d.getAttributeValue=ZJI;function WJI(t,e){return t.attribs!=null&&Object.prototype.hasOwnProperty.call(t.attribs,e)&&t.attribs[e]!=null}$d.hasAttrib=WJI;function NJI(t){return t.name}$d.getName=NJI;function VJI(t){for(var e,n=t.next;n!==null&&!(0,PVn.isTag)(n);)e=n,n=e.next;return n}$d.nextElementSibling=VJI;function YJI(t){for(var e,n=t.prev;n!==null&&!(0,PVn.isTag)(n);)e=n,n=e.prev;return n}$d.prevElementSibling=YJI});var tYn=f($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.prepend=$p.prependChild=$p.append=$p.appendChild=$p.replaceElement=$p.removeElement=void 0;function i7(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var e=t.parent.children;e.splice(e.lastIndexOf(t),1)}}$p.removeElement=i7;function gJI(t,e){var n=e.prev=t.prev;n&&(n.next=e);var l=e.next=t.next;l&&(l.prev=e);var I=e.parent=t.parent;if(I){var a=I.children;a[a.lastIndexOf(t)]=e}}$p.replaceElement=gJI;function RJI(t,e){if(i7(e),e.next=null,e.parent=t,t.children.push(e)>1){var n=t.children[t.children.length-2];n.next=e,e.prev=n}else e.prev=null}$p.appendChild=RJI;function yJI(t,e){i7(e);var n=t.parent,l=t.next;if(e.next=l,e.prev=t,t.next=e,e.parent=n,l){if(l.prev=e,n){var I=n.children;I.splice(I.lastIndexOf(l),0,e)}}else n&&n.children.push(e)}$p.append=yJI;function AJI(t,e){if(i7(e),e.parent=t,e.prev=null,t.children.unshift(e)!==1){var n=t.children[1];n.prev=e,e.next=n}else e.next=null}$p.prependChild=AJI;function FJI(t,e){i7(e);var n=t.parent;if(n){var l=n.children;l.splice(l.indexOf(t),0,e)}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e}$p.prepend=FJI});var Eqe=f(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.findAll=eh.existsOne=eh.findOne=eh.findOneChild=eh.find=eh.filter=void 0;var s7=s2();function vJI(t,e,n,l){return n===void 0&&(n=!0),l===void 0&&(l=1/0),Array.isArray(e)||(e=[e]),Qqe(t,e,n,l)}eh.filter=vJI;function Qqe(t,e,n,l){for(var I=[],a=0,c=e;a0){var s=Qqe(t,i.children,n,l);if(I.push.apply(I,s),l-=s.length,l<=0)break}}return I}eh.find=Qqe;function fJI(t,e){return e.find(t)}eh.findOneChild=fJI;function nYn(t,e,n){n===void 0&&(n=!0);for(var l=null,I=0;I0&&(l=nYn(t,a.children));else continue}return l}eh.findOne=nYn;function lYn(t,e){return e.some(function(n){return(0,s7.isTag)(n)&&(t(n)||n.children.length>0&&lYn(t,n.children))})}eh.existsOne=lYn;function XJI(t,e){for(var n,l=[],I=e.filter(s7.isTag),a;a=I.shift();){var c=(n=a.children)===null||n===void 0?void 0:n.filter(s7.isTag);c&&c.length>0&&I.unshift.apply(I,c),t(a)&&l.push(a)}return l}eh.findAll=XJI});var Jqe=f(NN=>{"use strict";Object.defineProperty(NN,"__esModule",{value:!0});NN.getElementsByTagType=NN.getElementsByTagName=NN.getElementById=NN.getElements=NN.testElement=void 0;var yC=s2(),jYe=Eqe(),xYe={tag_name:function(t){return typeof t=="function"?function(e){return(0,yC.isTag)(e)&&t(e.name)}:t==="*"?yC.isTag:function(e){return(0,yC.isTag)(e)&&e.name===t}},tag_type:function(t){return typeof t=="function"?function(e){return t(e.type)}:function(e){return e.type===t}},tag_contains:function(t){return typeof t=="function"?function(e){return(0,yC.isText)(e)&&t(e.data)}:function(e){return(0,yC.isText)(e)&&e.data===t}}};function IYn(t,e){return typeof e=="function"?function(n){return(0,yC.isTag)(n)&&e(n.attribs[t])}:function(n){return(0,yC.isTag)(n)&&n.attribs[t]===e}}function wJI(t,e){return function(n){return t(n)||e(n)}}function aYn(t){var e=Object.keys(t).map(function(n){var l=t[n];return Object.prototype.hasOwnProperty.call(xYe,n)?xYe[n](l):IYn(n,l)});return e.length===0?null:e.reduce(wJI)}function HJI(t,e){var n=aYn(t);return n?n(e):!0}NN.testElement=HJI;function QJI(t,e,n,l){l===void 0&&(l=1/0);var I=aYn(t);return I?(0,jYe.filter)(I,e,n,l):[]}NN.getElements=QJI;function EJI(t,e,n){return n===void 0&&(n=!0),Array.isArray(e)||(e=[e]),(0,jYe.findOne)(IYn("id",t),e,n)}NN.getElementById=EJI;function JJI(t,e,n,l){return n===void 0&&(n=!0),l===void 0&&(l=1/0),(0,jYe.filter)(xYe.tag_name(t),e,n,l)}NN.getElementsByTagName=JJI;function CJI(t,e,n,l){return n===void 0&&(n=!0),l===void 0&&(l=1/0),(0,jYe.filter)(xYe.tag_type(t),e,n,l)}NN.getElementsByTagType=CJI});var oYn=f(rH=>{"use strict";Object.defineProperty(rH,"__esModule",{value:!0});rH.uniqueSort=rH.compareDocumentPosition=rH.removeSubsets=void 0;var rYn=s2();function LJI(t){for(var e=t.length;--e>=0;){var n=t[e];if(e>0&&t.lastIndexOf(n,e-1)>=0){t.splice(e,1);continue}for(var l=n.parent;l;l=l.parent)if(t.includes(l)){t.splice(e,1);break}}return t}rH.removeSubsets=LJI;function cYn(t,e){var n=[],l=[];if(t===e)return 0;for(var I=(0,rYn.hasChildren)(t)?t:t.parent;I;)n.unshift(I),I=I.parent;for(I=(0,rYn.hasChildren)(e)?e:e.parent;I;)l.unshift(I),I=I.parent;for(var a=Math.min(n.length,l.length),c=0;cs.indexOf(u)?i===e?20:4:i===t?10:2}rH.compareDocumentPosition=cYn;function kJI(t){return t=t.filter(function(e,n,l){return!l.includes(e,n+1)}),t.sort(function(e,n){var l=cYn(e,n);return l&2?-1:l&4?1:0}),t}rH.uniqueSort=kJI});var sYn=f(UYe=>{"use strict";Object.defineProperty(UYe,"__esModule",{value:!0});UYe.getFeed=void 0;var xJI=Hqe(),u7=Jqe();function jJI(t){var e=OYe(SJI,t);return e?e.name==="feed"?OJI(e):UJI(e):null}UYe.getFeed=jJI;function OJI(t){var e,n=t.children,l={type:"atom",items:(0,u7.getElementsByTagName)("entry",n).map(function(c){var i,s=c.children,r={media:iYn(s)};th(r,"id","id",s),th(r,"title","title",s);var u=(i=OYe("link",s))===null||i===void 0?void 0:i.attribs.href;u&&(r.link=u);var o=AC("summary",s)||AC("content",s);o&&(r.description=o);var d=AC("updated",s);return d&&(r.pubDate=new Date(d)),r})};th(l,"id","id",n),th(l,"title","title",n);var I=(e=OYe("link",n))===null||e===void 0?void 0:e.attribs.href;I&&(l.link=I),th(l,"description","subtitle",n);var a=AC("updated",n);return a&&(l.updated=new Date(a)),th(l,"author","email",n,!0),l}function UJI(t){var e,n,l=(n=(e=OYe("channel",t.children))===null||e===void 0?void 0:e.children)!==null&&n!==void 0?n:[],I={type:t.name.substr(0,3),id:"",items:(0,u7.getElementsByTagName)("item",t.children).map(function(c){var i=c.children,s={media:iYn(i)};th(s,"id","guid",i),th(s,"title","title",i),th(s,"link","link",i),th(s,"description","description",i);var r=AC("pubDate",i);return r&&(s.pubDate=new Date(r)),s})};th(I,"title","title",l),th(I,"link","link",l),th(I,"description","description",l);var a=AC("lastBuildDate",l);return a&&(I.updated=new Date(a)),th(I,"author","managingEditor",l,!0),I}var zJI=["url","type","lang"],BJI=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function iYn(t){return(0,u7.getElementsByTagName)("media:content",t).map(function(e){for(var n=e.attribs,l={medium:n.medium,isDefault:!!n.isDefault},I=0,a=zJI;I{"use strict";var MJI=kc&&kc.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n),Object.defineProperty(t,l,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),FC=kc&&kc.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&MJI(e,t,n)};Object.defineProperty(kc,"__esModule",{value:!0});kc.hasChildren=kc.isDocument=kc.isComment=kc.isText=kc.isCDATA=kc.isTag=void 0;FC(Hqe(),kc);FC(eYn(),kc);FC(tYn(),kc);FC(Eqe(),kc);FC(Jqe(),kc);FC(oYn(),kc);FC(sYn(),kc);var F9=s2();Object.defineProperty(kc,"isTag",{enumerable:!0,get:function(){return F9.isTag}});Object.defineProperty(kc,"isCDATA",{enumerable:!0,get:function(){return F9.isCDATA}});Object.defineProperty(kc,"isText",{enumerable:!0,get:function(){return F9.isText}});Object.defineProperty(kc,"isComment",{enumerable:!0,get:function(){return F9.isComment}});Object.defineProperty(kc,"isDocument",{enumerable:!0,get:function(){return F9.isDocument}});Object.defineProperty(kc,"hasChildren",{enumerable:!0,get:function(){return F9.hasChildren}})});var Lqe=f($b=>{"use strict";var TJI=$b&&$b.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,I){l.__proto__=I}||function(l,I){for(var a in I)Object.prototype.hasOwnProperty.call(I,a)&&(l[a]=I[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function l(){this.constructor=e}e.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}}(),DJI=$b&&$b.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n),Object.defineProperty(t,l,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),KJI=$b&&$b.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_JI=$b&&$b.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&DJI(e,t,n);return KJI(e,t),e},PJI=$b&&$b.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($b,"__esModule",{value:!0});$b.parseFeed=$b.FeedHandler=void 0;var qJI=PJI(s2()),SYe=_JI(zYe()),$JI=Rqe(),uYn;(function(t){t[t.image=0]="image",t[t.audio=1]="audio",t[t.video=2]="video",t[t.document=3]="document",t[t.executable=4]="executable"})(uYn||(uYn={}));var dYn;(function(t){t[t.sample=0]="sample",t[t.full=1]="full",t[t.nonstop=2]="nonstop"})(dYn||(dYn={}));var mYn=function(t){TJI(e,t);function e(n,l){var I=this;return typeof n=="object"&&(n=void 0,l=n),I=t.call(this,n,l)||this,I}return e.prototype.onend=function(){var n,l,I=BYe(eCI,this.dom);if(!I){this.handleCallback(new Error("couldn't find root of feed"));return}var a={};if(I.name==="feed"){var c=I.children;a.type="atom",nh(a,"id","id",c),nh(a,"title","title",c);var i=bYn("href",BYe("link",c));i&&(a.link=i),nh(a,"description","subtitle",c);var s=vC("updated",c);s&&(a.updated=new Date(s)),nh(a,"author","email",c,!0),a.items=Cqe("entry",c).map(function(r){var u={},o=r.children;nh(u,"id","id",o),nh(u,"title","title",o);var d=bYn("href",BYe("link",o));d&&(u.link=d);var b=vC("summary",o)||vC("content",o);b&&(u.description=b);var h=vC("updated",o);return h&&(u.pubDate=new Date(h)),u.media=GYn(o),u})}else{var c=(l=(n=BYe("channel",I.children))===null||n===void 0?void 0:n.children)!==null&&l!==void 0?l:[];a.type=I.name.substr(0,3),a.id="",nh(a,"title","title",c),nh(a,"link","link",c),nh(a,"description","description",c);var s=vC("lastBuildDate",c);s&&(a.updated=new Date(s)),nh(a,"author","managingEditor",c,!0),a.items=Cqe("item",I.children).map(function(o){var d={},b=o.children;nh(d,"id","guid",b),nh(d,"title","title",b),nh(d,"link","link",b),nh(d,"description","description",b);var h=vC("pubDate",b);return h&&(d.pubDate=new Date(h)),d.media=GYn(b),d})}this.feed=a,this.handleCallback(null)},e}(qJI.default);$b.FeedHandler=mYn;function GYn(t){return Cqe("media:content",t).map(function(e){var n={medium:e.attribs.medium,isDefault:!!e.attribs.isDefault};return e.attribs.url&&(n.url=e.attribs.url),e.attribs.fileSize&&(n.fileSize=parseInt(e.attribs.fileSize,10)),e.attribs.type&&(n.type=e.attribs.type),e.attribs.expression&&(n.expression=e.attribs.expression),e.attribs.bitrate&&(n.bitrate=parseInt(e.attribs.bitrate,10)),e.attribs.framerate&&(n.framerate=parseInt(e.attribs.framerate,10)),e.attribs.samplingrate&&(n.samplingrate=parseInt(e.attribs.samplingrate,10)),e.attribs.channels&&(n.channels=parseInt(e.attribs.channels,10)),e.attribs.duration&&(n.duration=parseInt(e.attribs.duration,10)),e.attribs.height&&(n.height=parseInt(e.attribs.height,10)),e.attribs.width&&(n.width=parseInt(e.attribs.width,10)),e.attribs.lang&&(n.lang=e.attribs.lang),n})}function Cqe(t,e){return SYe.getElementsByTagName(t,e,!0)}function BYe(t,e){return SYe.getElementsByTagName(t,e,!0,1)[0]}function vC(t,e,n){return n===void 0&&(n=!1),SYe.getText(SYe.getElementsByTagName(t,e,n,1)).trim()}function bYn(t,e){if(!e)return null;var n=e.attribs;return n[t]}function nh(t,e,n,l,I){I===void 0&&(I=!1);var a=vC(n,l,I);a&&(t[e]=a)}function eCI(t){return t==="rss"||t==="feed"||t==="rdf:RDF"}function tCI(t,e){e===void 0&&(e={xmlMode:!0});var n=new mYn(e);return new $JI.Parser(n,e).end(t),n.feed}$b.parseFeed=tCI});var WYn=f(Ha=>{"use strict";var pYn=Ha&&Ha.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n),Object.defineProperty(t,l,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),nCI=Ha&&Ha.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),hYn=Ha&&Ha.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&pYn(e,t,n);return nCI(e,t),e},lCI=Ha&&Ha.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&pYn(e,t,n)},ICI=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.RssHandler=Ha.DefaultHandler=Ha.DomUtils=Ha.ElementType=Ha.Tokenizer=Ha.createDomStream=Ha.parseDOM=Ha.parseDocument=Ha.DomHandler=Ha.Parser=void 0;var kqe=Rqe();Object.defineProperty(Ha,"Parser",{enumerable:!0,get:function(){return kqe.Parser}});var MYe=s2();Object.defineProperty(Ha,"DomHandler",{enumerable:!0,get:function(){return MYe.DomHandler}});Object.defineProperty(Ha,"DefaultHandler",{enumerable:!0,get:function(){return MYe.DomHandler}});function ZYn(t,e){var n=new MYe.DomHandler(void 0,e);return new kqe.Parser(n,e).end(t),n.root}Ha.parseDocument=ZYn;function aCI(t,e){return ZYn(t,e).children}Ha.parseDOM=aCI;function rCI(t,e,n){var l=new MYe.DomHandler(t,e,n);return new kqe.Parser(l,e)}Ha.createDomStream=rCI;var cCI=Yqe();Object.defineProperty(Ha,"Tokenizer",{enumerable:!0,get:function(){return ICI(cCI).default}});var oCI=hYn(R9());Ha.ElementType=oCI;lCI(Lqe(),Ha);Ha.DomUtils=hYn(zYe());var iCI=Lqe();Object.defineProperty(Ha,"RssHandler",{enumerable:!0,get:function(){return iCI.FeedHandler}})});var xqe=f((sFr,NYn)=>{var sCI;NYn.exports=sCI={from:function(t){return Array.prototype.slice.call(t)},simpleClone:function(t){return t.slice(0)},shallowEqual:function(t,e){var n,l,I,a;if(!(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length))return!1;for(n=I=0,a=t.length;Ie&&(t[n-1]=t[n]);return t.length=t.length-1,t},pluckItem:function(t,e){var n,l,I,a,c;if(t.length<1)return t;for(l=0,n=a=0,c=t.length;a0&&(t.length=t.length-l),t},pluckOneItem:function(t,e){var n,l,I,a,c;if(t.length<1)return t;for(l=!1,n=a=0,c=t.length;a0&&(t.length=t.length-l),t},pluckMultiple:function(t,e){var n,l,I,a;if(t.length<1)return t;for(l=0,e.sort(),I=0,a=e.length;I{var jqe,VYn=[].slice;YYn.exports=jqe={};jqe.implement=function(){var t,e,n,l,I,a,c,i,s;for(a=2<=arguments.length?VYn.call(arguments,0,c=arguments.length-1):(c=0,[]),e=arguments[c++],i=0,s=a.length;i{var cH;RYn.exports=cH={isBareObject:function(t){return t!=null&&t.constructor===Object},typeOf:function(t){var e;if(t===null)return"null";if(typeof t!="object")return typeof t;if(Array.isArray(t))return"array";if(t.nodeName){if(t.nodeType===1)return"element";if(t.nodeType===3)return(e=/\S/.test(t.nodeValue))!=null?e:{textnode:"whitespace"}}else if(typeof t.length=="number"&&t.callee)return"arguments";return typeof t},clone:function(t,e){switch(e==null&&(e=!1),cH.typeOf(t)){case"array":return cH._cloneArray(t,e);case"object":return cH._cloneObject(t,e);default:return t}},_cloneObject:function(t,e){var n,l;if(e==null&&(e=!1),cH.isBareObject(t)){n={};for(l in t)n[l]=cH.clone(t[l],e);return n}else{if(!e||t instanceof Function)return t;n=Object.create(t.constructor.prototype);for(l in t)t.hasOwnProperty(l)&&(n[l]=cH.clone(t[l],e));return n}},_cloneArray:function(t,e){var n,l;for(e==null&&(e=!1),l=t.length,n=new Array(l);l--;)n[l]=cH.clone(t[l],e);return n}}});var FYn=f((GFr,AYn)=>{var uCI,fC,dCI={}.hasOwnProperty;fC=yYn();AYn.exports=uCI={isBareObject:fC.isBareObject.bind(fC),isInstance:function(t){return!this.isBareObject(t)},typeOf:fC.typeOf.bind(fC),clone:fC.clone.bind(fC),empty:function(t){var e;for(e in t)t.hasOwnProperty(e)&&delete t[e];return t},fastEmpty:function(t){var e;for(e in t)delete t[e];return t},overrideOnto:function(t,e){var n,l,I;if(!this.isBareObject(e)||!this.isBareObject(t))return t;for(n in t)I=t[n],l=e[n],l!==void 0&&(typeof l!="object"||this.isInstance(l)?t[n]=this.clone(l):typeof I!="object"||this.isInstance(I)?t[n]=this.clone(l):this.overrideOnto(I,l));return t},override:function(t,e){return this.overrideOnto(this.clone(t),e)},append:function(t,e){return this.appendOnto(this.clone(t),e)},appendOnto:function(t,e){var n,l,I;if(!this.isBareObject(e)||!this.isBareObject(t))return t;for(n in e)dCI.call(e,n)&&(l=e[n],l!==void 0&&(typeof l!="object"||this.isInstance(l)?t[n]=l:(I=t[n],typeof I!="object"||this.isInstance(I)?t[n]=this.clone(l):this.appendOnto(I,l))));return t},groupProps:function(t,e){var n,l,I,a,c,i,s,r,u;I={};for(c in e)l=e[c],I[c]={};I.rest={};e:for(a in t){s=t[a],i=!1;for(c in e)for(l=e[c],Array.isArray(l)||(l=[l]),r=0,u=l.length;r{vYn.exports={pad:function(t,e,n){return n==null&&(n="0"),t=t+"",t.length>=e?t:new Array(e-t.length+1).join(n)+t}}});var HYn=f((mFr,wYn)=>{var GCI,XYn;XYn=xqe();wYn.exports=GCI=function(){function t(){this._listeners={},this._listenersForAnyEvent=[],this._disabledEmitters={}}return t.prototype.on=function(e,n){return this._listeners[e]==null&&(this._listeners[e]=[]),this._listeners[e].push(n),this},t.prototype.once=function(e,n){var l,I,a=this;return I=!1,l=function(){if(!I)return I=!0,n(),setTimeout(function(){return a.removeEvent(e,l)},0)},this.on(e,l),this},t.prototype.onAnyEvent=function(e){return this._listenersForAnyEvent.push(e),this},t.prototype.removeEvent=function(e,n){return this._listeners[e]==null?this:(XYn.pluckOneItem(this._listeners[e],n),this)},t.prototype.removeListeners=function(e){return this._listeners[e]==null?this:(this._listeners[e].length=0,this)},t.prototype.removeAllListeners=function(){var e,n,l;l=this._listeners;for(n in l)e=l[n],e.length=0;return this},t.prototype._emit=function(e,n){var l,I,a,c,i,s,r;for(s=this._listenersForAnyEvent,I=0,c=s.length;I{var bCI;QYn.exports=bCI={array:xqe(),classic:gYn(),object:FYn(),string:fYn(),Emitter:HYn()}});var JYn=f((hFr,EYn)=>{var Uqe,XC,mCI={}.hasOwnProperty;Uqe=Oqe().object;EYn.exports=XC={sanitize:function(t){return XC._toChildren(t)},_toChildren:function(t){var e;if(Uqe.isBareObject(t))return XC._objectToChildren(t);if(Array.isArray(t))return XC._arrayToChildren(t);if(t===null||typeof t>"u")return[];if((e=typeof t)=="string"||e==="number")return[String(t)];throw Error("not a valid child node: `"+t)},_objectToChildren:function(t){var e,n,l,I;e=[];for(l in t)mCI.call(t,l)&&(I=t[l],n={},n[l]=XC.sanitize(I),e.push(n));return e},_arrayToChildren:function(t){var e,n,l,I;for(l=[],e=0,n=t.length;e{var Iy,pCI={}.hasOwnProperty;CYn.exports=Iy={convert:function(t){return Iy._arrayToChildren(t)},_arrayToChildren:function(t,e){var n,l,I,a,c,i;for(e==null&&(e=null),n=[],c=null,l=0,I=t.length;l0)throw Error("_objectToNode() only accepts an object with one key/value");a=I,u=r,l++}if(i={},typeof a!="string")throw Error("_objectToNode()'s key must be a string of tag name and classes");if(typeof u=="string")n=[Iy._getTextNodeFor(u)];else if(Array.isArray(u))n=Iy._arrayToChildren(u,i);else throw inspect(t),Error("_objectToNode()'s key's value must only be a string or an array");return i.type="tag",s=Iy._parseTag(a),c=s.name,e=s.attribs,i.name=c,i.attribs=e,i.children=n,i},_getTextNodeFor:function(t){return{type:"text",data:t}},_nameRx:/^[a-zA-Z\-\_]{1}[a-zA-Z0-9\-\_]*$/,_parseTag:function(t){var e,n,l,I,a,c,i;if(!t.match(/^[a-zA-Z0-9\#\-\_\.\[\]\"\'\=\,\s]+$/)||t.match(/^[0-9]+/))throw Error("cannot parse tag `"+t+"`");if(e={},i={name:"",attribs:e},a=t.match(/^([^\.#]+)/)){if(c=a[1],!c.match(Iy._nameRx))throw Error("tag name `"+c+"` is not valid");i.name=c,t=t.substr(c.length,t.length)}if(a=t.match(/^#([a-zA-Z0-9\-]+)/)){if(I=a[1],!I.match(Iy._nameRx))throw Error("tag id `"+I+"` is not valid");e.id=I,t=t.substr(I.length+1,t.length)}for(n=[];a=t.match(/\.([a-zA-Z0-9\-\_]+)/);){if(l=a[1],!l.match(Iy._nameRx))throw Error("tag class `"+l+"` is not valid");n.push(l),t=t.replace("."+l,"")}return n.length&&(e.class=n.join(" ")),i}}});var kYn=f(()=>{});var zYn=f((VFr,UYn)=>{var Bqe,xYn,jYn,OYn,zqe;jYn=JYn();OYn=LYn();Bqe=kYn();xYn=Oqe().object;UYn.exports=zqe={objectToDom:function(t){return t=zqe._object2SaneObject(t),OYn.convert(t)},object2markup:function(t){var e;return e=zqe.objectToDom(t),Bqe.convert(e)},domToMarkup:function(t){return Bqe.convert(t)},_object2SaneObject:function(t){if(!Array.isArray(t)&&!xYn.isBareObject(t))throw Error("toDom() only accepts arrays and bare objects as input");return jYn.sanitize(t)}}});var TYe=f((YFr,BYn)=>{var hCI=Cie(),ZCI=R3e(),WCI=ZCI(function(t,e,n){hCI(t,e,n)});BYn.exports=WCI});var Lm=f((gFr,DYn)=>{"use strict";var SYn,Sqe,Mqe,MYn,TYn,wC;Sqe=WYn();var NCI=zYn();TYn=NCI.objectToDom;MYn=TYe();SYn=Kxe();Mqe=oX();DYn.exports=wC={repeatString:function(e,n){var l,I,a,c;for(a="",l=I=0,c=n;0<=c?Ic;l=0<=c?++I:--I)a+=e;return a},cloneAndMergeDeep:function(e,n){return MYn(SYn(e),n)},toDom:function(e){if(typeof e=="string")return wC.stringToDom(e);if(Mqe(e))return wC._objectToDom(e);throw Error("tools.toDom() only supports strings and objects")},stringToDom:function(e){var n,l;return n=new Sqe.DomHandler,l=new Sqe.Parser(n),l.write(e),l.end(),n.dom},_fixQuotesInDom:function(e){var n,l,I;if(Array.isArray(e)){for(n=0,l=e.length;n/g,">").replace(/\"/g,""").replace(/\ /g,"&sp;").replace(/\n/g,"
")},_quoteNodeText:function(e){return String(e).replace(/\&/g,"&").replace(//g,">").replace(/\"/g,""").replace(/\ /g,"&sp;").replace(/\n/g,"&nl;")},getCols:function(){var e,n;return n=require("tty"),e=function(){try{if(n.isatty(1)&&n.isatty(2)){if(process.stdout.getWindowSize)return process.stdout.getWindowSize(1)[0];if(n.getWindowSize)return n.getWindowSize()[1];if(process.stdout.columns)return process.stdout.columns}}catch{}}(),typeof e=="number"&&e>30?e:80}}});var PYn=f((RFr,_Yn)=>{"use strict";var HC,Tqe,DYe,KYn,KYe;_Yn.exports=KYe={none:{color:"none",bg:"none"},"bg-none":{color:"inherit",bg:"none"},"color-none":{color:"none",bg:"inherit"}};Tqe=["black","red","green","yellow","blue","magenta","cyan","white","grey","bright-red","bright-green","bright-yellow","bright-blue","bright-magenta","bright-cyan","bright-white"];for(DYe=0,KYn=Tqe.length;DYe{"use strict";var _Ye,d7;qYn.exports=d7={};d7.codes=_Ye={none:0,black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,grey:90,"bright-red":91,"bright-green":92,"bright-yellow":93,"bright-blue":94,"bright-magenta":95,"bright-cyan":96,"bright-white":97,"bg-black":40,"bg-red":41,"bg-green":42,"bg-yellow":43,"bg-blue":44,"bg-magenta":45,"bg-cyan":46,"bg-white":47,"bg-grey":100,"bg-bright-red":101,"bg-bright-green":102,"bg-bright-yellow":103,"bg-bright-blue":104,"bg-bright-magenta":105,"bg-bright-cyan":106,"bg-bright-white":107};d7.color=function(t){var e;if(t==="none")return"";if(e=_Ye[t],e==null)throw Error("Unknown color `".concat(t,"`"));return"\x1B["+e+"m"};d7.bg=function(t){var e;if(t==="none")return"";if(e=_Ye["bg-"+t],e==null)throw Error("Unknown bg color `".concat(t,"`"));return"\x1B["+e+"m"};d7.none=function(t){return"\x1B["+_Ye.none+"m"}});var Dqe=f((AFr,lgn)=>{"use strict";function VCI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function egn(t,e){for(var n=0;n").replace(/"/g,'"').replace(/&/g,"&")}},{key:"_parse",value:function(I){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return a&&(I=""+I+""),ngn.toDom(I)}},{key:"_renderDom",value:function(I){var a;return a={bg:"none",color:"none"},this._renderChildren(I,a)}},{key:"_renderChildren",value:function(I,a){var c,i,s;s="";for(i in I)tgn.call(I,i)&&(c=I[i],s+=this._renderNode(c,a));return s}},{key:"_renderNode",value:function(I,a){return I.type==="text"?this._renderTextNode(I,a):this._renderTag(I,a)}},{key:"_renderTextNode",value:function(I,a){return this._wrapInStyle(I.data,a)}},{key:"_wrapInStyle",value:function(I,a){return PYe.color(a.color)+PYe.bg(a.bg)+I+PYe.none()}},{key:"_renderTag",value:function(I,a){var c,i;return i=this._getStylesForTagName(I.name),c=this._mixStyles(a,i),this._renderChildren(I.children,c)}},{key:"_mixStyles",value:function(){var I,a,c,i,s,r;I={};for(var u=arguments.length,o=new Array(u),d=0;d{"use strict";var Kqe,RCI;Kqe=Dqe();Ign.exports=RCI={getStyleTagsFor:function(e){var n,l,I,a,c,i;if(i=[],e.color!=null){if(c="color-"+e.color,Kqe.tags[c]==null)throw Error("Unknown color `".concat(e.color,"`"));i.push(c)}if(e.background!=null){if(c="bg-"+e.background,Kqe.tags[c]==null)throw Error("Unknown background `".concat(e.background,"`"));i.push(c)}for(I={before:"",after:""},n=0,l=i.length;n")+I.before,I.after=I.after+"");return I}}});var cgn=f((vFr,rgn)=>{"use strict";var agn,yCI,ACI,G7;G7=Lm();agn=_qe();rgn.exports=yCI=ACI={applyTo:function(e,n){var l;return l=agn.getStyleTagsFor(n),n.marginLeft!=null&&(l.before=G7.repeatString("&sp;",parseInt(n.marginLeft))+l.before),n.marginRight!=null&&(l.after+=G7.repeatString("&sp;",parseInt(n.marginRight))),n.paddingLeft!=null&&(l.before+=G7.repeatString("&sp;",parseInt(n.paddingLeft))),n.paddingRight!=null&&(l.after=G7.repeatString("&sp;",parseInt(n.paddingRight))+l.after),l}}});var ign=f((fFr,ogn)=>{"use strict";var Pqe,FCI,v9,vCI;Pqe=_qe();v9=TYe();ogn.exports=FCI=vCI={applyTo:function(e,n){var l,I;return I=Pqe.getStyleTagsFor(n),I.blockConfig=l={},this._margins(n,l),this._bullet(n,l),this._dims(n,l),I},_margins:function(e,n){e.marginLeft!=null&&v9(n,{linePrependor:{options:{amount:parseInt(e.marginLeft)}}}),e.marginRight!=null&&v9(n,{lineAppendor:{options:{amount:parseInt(e.marginRight)}}}),e.marginTop!=null&&v9(n,{blockPrependor:{options:{amount:parseInt(e.marginTop)}}}),e.marginBottom!=null&&v9(n,{blockAppendor:{options:{amount:parseInt(e.marginBottom)}}})},_bullet:function(e,n){var l,I,a,c;if(e.bullet!=null&&e.bullet.enabled){a=e.bullet,c={},c.alignment=e.bullet.alignment;var i=Pqe.getStyleTagsFor({color:a.color,background:a.background});I=i.before,l=i.after,c.char=I+a.char+l,v9(n,{linePrependor:{options:{bullet:c}}})}},_dims:function(e,n){var l;e.width!=null&&(l=parseInt(e.width),n.width=l)}}});var oH=f((XFr,sgn)=>{sgn.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}});var $Ye=f(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.AttributeAction=ay.IgnoreCaseMode=ay.SelectorType=void 0;var fCI;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(fCI=ay.SelectorType||(ay.SelectorType={}));ay.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:!0,CaseSensitive:!1};var XCI;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(XCI=ay.AttributeAction||(ay.AttributeAction={}))});var mgn=f(f9=>{"use strict";Object.defineProperty(f9,"__esModule",{value:!0});f9.parse=f9.isTraversal=void 0;var Wr=$Ye(),ugn=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,wCI=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,HCI=new Map([[126,Wr.AttributeAction.Element],[94,Wr.AttributeAction.Start],[36,Wr.AttributeAction.End],[42,Wr.AttributeAction.Any],[33,Wr.AttributeAction.Not],[124,Wr.AttributeAction.Hyphen]]),QCI=new Set(["has","not","matches","is","where","host","host-context"]);function Ggn(t){switch(t.type){case Wr.SelectorType.Adjacent:case Wr.SelectorType.Child:case Wr.SelectorType.Descendant:case Wr.SelectorType.Parent:case Wr.SelectorType.Sibling:case Wr.SelectorType.ColumnCombinator:return!0;default:return!1}}f9.isTraversal=Ggn;var ECI=new Set(["contains","icontains"]);function JCI(t,e,n){var l=parseInt(e,16)-65536;return l!==l||n?e:l<0?String.fromCharCode(l+65536):String.fromCharCode(l>>10|55296,l&1023|56320)}function b7(t){return t.replace(wCI,JCI)}function qqe(t){return t===39||t===34}function dgn(t){return t===32||t===9||t===10||t===12||t===13}function CCI(t){var e=[],n=bgn(e,"".concat(t),0);if(n0&&n0&&Ggn(l[l.length-1]))throw new Error("Did not expect successive traversals.")}function r(_){if(l.length>0&&l[l.length-1].type===Wr.SelectorType.Descendant){l[l.length-1].type=_;return}s(),l.push({type:_})}function u(_,P){l.push({type:Wr.SelectorType.Attribute,name:_,action:P,value:I(1),namespace:null,ignoreCase:"quirks"})}function o(){if(l.length&&l[l.length-1].type===Wr.SelectorType.Descendant&&l.pop(),l.length===0)throw new Error("Empty sub-selector");t.push(l)}if(a(0),e.length===n)return n;e:for(;n{"use strict";var ege=w9&&w9.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var l=0,I=e.length,a;l ":" > ";case jo.SelectorType.Parent:return e===0?"< ":" < ";case jo.SelectorType.Sibling:return e===0?"~ ":" ~ ";case jo.SelectorType.Adjacent:return e===0?"+ ":" + ";case jo.SelectorType.Descendant:return" ";case jo.SelectorType.ColumnCombinator:return e===0?"|| ":" || ";case jo.SelectorType.Universal:return t.namespace==="*"&&e+10?l+t.slice(n):t}});var m7=f(NZ=>{"use strict";var jCI=NZ&&NZ.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),OCI=NZ&&NZ.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&jCI(e,t,n)};Object.defineProperty(NZ,"__esModule",{value:!0});NZ.stringify=NZ.parse=NZ.isTraversal=void 0;OCI($Ye(),NZ);var ggn=mgn();Object.defineProperty(NZ,"isTraversal",{enumerable:!0,get:function(){return ggn.isTraversal}});Object.defineProperty(NZ,"parse",{enumerable:!0,get:function(){return ggn.parse}});var UCI=Ygn();Object.defineProperty(NZ,"stringify",{enumerable:!0,get:function(){return UCI.stringify}})});var tge=f(QC=>{"use strict";Object.defineProperty(QC,"__esModule",{value:!0});QC.isTraversal=QC.procedure=void 0;QC.procedure={universal:50,tag:30,attribute:1,pseudo:0,"pseudo-element":0,"column-combinator":-1,descendant:-1,child:-1,parent:-1,sibling:-1,adjacent:-1,_flexibleDescendant:-1};function zCI(t){return QC.procedure[t.type]<0}QC.isTraversal=zCI});var Fgn=f($qe=>{"use strict";Object.defineProperty($qe,"__esModule",{value:!0});var Rgn=m7(),BCI=tge(),ygn={exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function SCI(t){for(var e=t.map(Agn),n=1;n=0&&l>=1);else if(t.type===Rgn.SelectorType.Pseudo)if(!t.data)e=3;else if(t.name==="has"||t.name==="contains")e=0;else if(Array.isArray(t.data)){e=0;for(var n=0;ne&&(e=l)}t.data.length>1&&e>0&&(e-=1)}else e=1;return e}});var fgn=f(lge=>{"use strict";Object.defineProperty(lge,"__esModule",{value:!0});lge.attributeRules=void 0;var nge=oH(),MCI=/[-[\]{}()*+?.,\\^$|#\s]/g;function vgn(t){return t.replace(MCI,"\\$&")}var TCI=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function EC(t,e){return typeof t.ignoreCase=="boolean"?t.ignoreCase:t.ignoreCase==="quirks"?!!e.quirksMode:!e.xmlMode&&TCI.has(t.name)}lge.attributeRules={equals:function(t,e,n){var l=n.adapter,I=e.name,a=e.value;return EC(e,n)?(a=a.toLowerCase(),function(c){var i=l.getAttributeValue(c,I);return i!=null&&i.length===a.length&&i.toLowerCase()===a&&t(c)}):function(c){return l.getAttributeValue(c,I)===a&&t(c)}},hyphen:function(t,e,n){var l=n.adapter,I=e.name,a=e.value,c=a.length;return EC(e,n)?(a=a.toLowerCase(),function(s){var r=l.getAttributeValue(s,I);return r!=null&&(r.length===c||r.charAt(c)==="-")&&r.substr(0,c).toLowerCase()===a&&t(s)}):function(s){var r=l.getAttributeValue(s,I);return r!=null&&(r.length===c||r.charAt(c)==="-")&&r.substr(0,c)===a&&t(s)}},element:function(t,e,n){var l=n.adapter,I=e.name,a=e.value;if(/\s/.test(a))return nge.falseFunc;var c=new RegExp("(?:^|\\s)".concat(vgn(a),"(?:$|\\s)"),EC(e,n)?"i":"");return function(s){var r=l.getAttributeValue(s,I);return r!=null&&r.length>=a.length&&c.test(r)&&t(s)}},exists:function(t,e,n){var l=e.name,I=n.adapter;return function(a){return I.hasAttrib(a,l)&&t(a)}},start:function(t,e,n){var l=n.adapter,I=e.name,a=e.value,c=a.length;return c===0?nge.falseFunc:EC(e,n)?(a=a.toLowerCase(),function(i){var s=l.getAttributeValue(i,I);return s!=null&&s.length>=c&&s.substr(0,c).toLowerCase()===a&&t(i)}):function(i){var s;return!!(!((s=l.getAttributeValue(i,I))===null||s===void 0)&&s.startsWith(a))&&t(i)}},end:function(t,e,n){var l=n.adapter,I=e.name,a=e.value,c=-a.length;return c===0?nge.falseFunc:EC(e,n)?(a=a.toLowerCase(),function(i){var s;return((s=l.getAttributeValue(i,I))===null||s===void 0?void 0:s.substr(c).toLowerCase())===a&&t(i)}):function(i){var s;return!!(!((s=l.getAttributeValue(i,I))===null||s===void 0)&&s.endsWith(a))&&t(i)}},any:function(t,e,n){var l=n.adapter,I=e.name,a=e.value;if(a==="")return nge.falseFunc;if(EC(e,n)){var c=new RegExp(vgn(a),"i");return function(s){var r=l.getAttributeValue(s,I);return r!=null&&r.length>=a.length&&c.test(r)&&t(s)}}return function(i){var s;return!!(!((s=l.getAttributeValue(i,I))===null||s===void 0)&&s.includes(a))&&t(i)}},not:function(t,e,n){var l=n.adapter,I=e.name,a=e.value;return a===""?function(c){return!!l.getAttributeValue(c,I)&&t(c)}:EC(e,n)?(a=a.toLowerCase(),function(c){var i=l.getAttributeValue(c,I);return(i==null||i.length!==a.length||i.toLowerCase()!==a)&&t(c)}):function(c){return l.getAttributeValue(c,I)!==a&&t(c)}}}});var wgn=f(Ige=>{"use strict";Object.defineProperty(Ige,"__esModule",{value:!0});Ige.parse=void 0;var DCI=new Set([9,10,12,13,32]),Xgn=48,KCI=57;function _CI(t){if(t=t.trim().toLowerCase(),t==="even")return[2,0];if(t==="odd")return[2,1];var e=0,n=0,l=a(),I=c();if(e=Xgn&&t.charCodeAt(e)<=KCI;)r=r*10+(t.charCodeAt(e)-Xgn),e++;return e===s?null:r}function i(){for(;e{"use strict";var PCI=iH&&iH.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iH,"__esModule",{value:!0});iH.generate=iH.compile=void 0;var Hgn=PCI(oH());function qCI(t){var e=t[0],n=t[1]-1;if(n<0&&e<=0)return Hgn.default.falseFunc;if(e===-1)return function(a){return a<=n};if(e===0)return function(a){return a===n};if(e===1)return n<0?Hgn.default.trueFunc:function(a){return a>=n};var l=Math.abs(e),I=(n%l+l)%l;return e>1?function(a){return a>=n&&a%l===I}:function(a){return a<=n&&a%l===I}}iH.compile=qCI;function $CI(t){var e=t[0],n=t[1]-1,l=0;if(e<0){var I=-e,a=(n%I+I)%I;return function(){var c=a+I*l++;return c>n?null:c}}return e===0?n<0?function(){return null}:function(){return l++===0?n:null}:(n<0&&(n+=e*Math.ceil(-n/e)),function(){return e*l+++n})}iH.generate=$CI});var Egn=f(AY=>{"use strict";Object.defineProperty(AY,"__esModule",{value:!0});AY.sequence=AY.generate=AY.compile=AY.parse=void 0;var e7e=wgn();Object.defineProperty(AY,"parse",{enumerable:!0,get:function(){return e7e.parse}});var age=Qgn();Object.defineProperty(AY,"compile",{enumerable:!0,get:function(){return age.compile}});Object.defineProperty(AY,"generate",{enumerable:!0,get:function(){return age.generate}});function e5I(t){return(0,age.compile)((0,e7e.parse)(t))}AY.default=e5I;function t5I(t){return(0,age.generate)((0,e7e.parse)(t))}AY.sequence=t5I});var Jgn=f(JC=>{"use strict";var n5I=JC&&JC.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(JC,"__esModule",{value:!0});JC.filters=void 0;var rge=n5I(Egn()),VZ=oH();function cge(t,e){return function(n){var l=e.getParent(n);return l!=null&&e.isTag(l)&&t(n)}}JC.filters={contains:function(t,e,n){var l=n.adapter;return function(a){return t(a)&&l.getText(a).includes(e)}},icontains:function(t,e,n){var l=n.adapter,I=e.toLowerCase();return function(c){return t(c)&&l.getText(c).toLowerCase().includes(I)}},"nth-child":function(t,e,n){var l=n.adapter,I=n.equals,a=(0,rge.default)(e);return a===VZ.falseFunc?VZ.falseFunc:a===VZ.trueFunc?cge(t,l):function(i){for(var s=l.getSiblings(i),r=0,u=0;u=0&&!I(i,s[u]);u--)l.isTag(s[u])&&r++;return a(r)&&t(i)}},"nth-of-type":function(t,e,n){var l=n.adapter,I=n.equals,a=(0,rge.default)(e);return a===VZ.falseFunc?VZ.falseFunc:a===VZ.trueFunc?cge(t,l):function(i){for(var s=l.getSiblings(i),r=0,u=0;u=0;u--){var o=s[u];if(I(i,o))break;l.isTag(o)&&l.getName(o)===l.getName(i)&&r++}return a(r)&&t(i)}},root:function(t,e,n){var l=n.adapter;return function(I){var a=l.getParent(I);return(a==null||!l.isTag(a))&&t(I)}},scope:function(t,e,n,l){var I=n.equals;return!l||l.length===0?JC.filters.root(t,e,n):l.length===1?function(a){return I(l[0],a)&&t(a)}:function(a){return l.includes(a)&&t(a)}},hover:t7e("isHovered"),visited:t7e("isVisited"),active:t7e("isActive")};function t7e(t){return function(n,l,I){var a=I.adapter,c=a[t];return typeof c!="function"?VZ.falseFunc:function(s){return c(s)&&n(s)}}}});var Cgn=f(H9=>{"use strict";Object.defineProperty(H9,"__esModule",{value:!0});H9.verifyPseudoArgs=H9.pseudos=void 0;H9.pseudos={empty:function(t,e){var n=e.adapter;return!n.getChildren(t).some(function(l){return n.isTag(l)||n.getText(l)!==""})},"first-child":function(t,e){var n=e.adapter,l=e.equals,I=n.getSiblings(t).find(function(a){return n.isTag(a)});return I!=null&&l(t,I)},"last-child":function(t,e){for(var n=e.adapter,l=e.equals,I=n.getSiblings(t),a=I.length-1;a>=0;a--){if(l(t,I[a]))return!0;if(n.isTag(I[a]))break}return!1},"first-of-type":function(t,e){for(var n=e.adapter,l=e.equals,I=n.getSiblings(t),a=n.getName(t),c=0;c=0;c--){var i=I[c];if(l(t,i))return!0;if(n.isTag(i)&&n.getName(i)===a)break}return!1},"only-of-type":function(t,e){var n=e.adapter,l=e.equals,I=n.getName(t);return n.getSiblings(t).every(function(a){return l(t,a)||!n.isTag(a)||n.getName(a)!==I})},"only-child":function(t,e){var n=e.adapter,l=e.equals;return n.getSiblings(t).every(function(I){return l(t,I)||!n.isTag(I)})}};function l5I(t,e,n){if(n===null){if(t.length>2)throw new Error("pseudo-selector :".concat(e," requires an argument"))}else if(t.length===2)throw new Error("pseudo-selector :".concat(e," doesn't have any arguments"))}H9.verifyPseudoArgs=l5I});var Lgn=f(oge=>{"use strict";Object.defineProperty(oge,"__esModule",{value:!0});oge.aliases=void 0;oge.aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is( + :is(button, input, select, textarea, optgroup, option)[disabled], + optgroup[disabled] > option, + fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *) + )`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}});var ige=f(YZ=>{"use strict";var kgn=YZ&&YZ.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var l=0,I=e.length,a;l{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.compilePseudoSelector=ry.aliases=ry.pseudos=ry.filters=void 0;var l7e=oH(),a5I=m7(),I7e=Jgn();Object.defineProperty(ry,"filters",{enumerable:!0,get:function(){return I7e.filters}});var sge=Cgn();Object.defineProperty(ry,"pseudos",{enumerable:!0,get:function(){return sge.pseudos}});var a7e=Lgn();Object.defineProperty(ry,"aliases",{enumerable:!0,get:function(){return a7e.aliases}});var Ogn=ige();function r5I(t,e,n,l,I){var a=e.name,c=e.data;if(Array.isArray(c))return Ogn.subselects[a](t,c,n,l,I);if(a in a7e.aliases){if(c!=null)throw new Error("Pseudo ".concat(a," doesn't have any arguments"));var i=(0,a5I.parse)(a7e.aliases[a]);return Ogn.subselects.is(t,i,n,l,I)}if(a in I7e.filters)return I7e.filters[a](t,c,n,l);if(a in sge.pseudos){var s=sge.pseudos[a];return(0,sge.verifyPseudoArgs)(s,a,c),s===l7e.falseFunc?l7e.falseFunc:t===l7e.trueFunc?function(r){return s(r,n,c)}:function(r){return s(r,n,c)&&t(r)}}throw new Error("unmatched pseudo-class :".concat(a))}ry.compilePseudoSelector=r5I});var Ugn=f(uge=>{"use strict";Object.defineProperty(uge,"__esModule",{value:!0});uge.compileGeneralSelector=void 0;var c5I=fgn(),o5I=r7e(),FY=m7();function i5I(t,e,n,l,I){var a=n.adapter,c=n.equals;switch(e.type){case FY.SelectorType.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case FY.SelectorType.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case FY.SelectorType.Attribute:{if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!n.xmlMode||n.lowerCaseAttributeNames)&&(e.name=e.name.toLowerCase()),c5I.attributeRules[e.action](t,e,n)}case FY.SelectorType.Pseudo:return(0,o5I.compilePseudoSelector)(t,e,n,l,I);case FY.SelectorType.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");var i=e.name;return(!n.xmlMode||n.lowerCaseTags)&&(i=i.toLowerCase()),function(u){return a.getName(u)===i&&t(u)}}case FY.SelectorType.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(u){for(var o=u;o=a.getParent(o);)if(a.isTag(o)&&t(o))return!0;return!1};var s=new WeakSet;return function(u){for(var o=u;o=a.getParent(o);)if(!s.has(o)){if(a.isTag(o)&&t(o))return!0;s.add(o)}return!1}}case"_flexibleDescendant":return function(u){var o=u;do if(a.isTag(o)&&t(o))return!0;while(o=a.getParent(o));return!1};case FY.SelectorType.Parent:return function(u){return a.getChildren(u).some(function(o){return a.isTag(o)&&t(o)})};case FY.SelectorType.Child:return function(u){var o=a.getParent(u);return o!=null&&a.isTag(o)&&t(o)};case FY.SelectorType.Sibling:return function(u){for(var o=a.getSiblings(u),d=0;d{"use strict";var s5I=cy&&cy.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cy,"__esModule",{value:!0});cy.compileToken=cy.compileUnsafe=cy.compile=void 0;var c7e=m7(),uH=oH(),u5I=s5I(Fgn()),d5I=tge(),G5I=Ugn(),zgn=ige();function b5I(t,e,n){var l=Bgn(t,e,n);return(0,zgn.ensureIsTag)(l,e.adapter)}cy.compile=b5I;function Bgn(t,e,n){var l=typeof t=="string"?(0,c7e.parse)(t):t;return o7e(l,e,n)}cy.compileUnsafe=Bgn;function Sgn(t){return t.type==="pseudo"&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some(function(e){return e.some(Sgn)}))}var m5I={type:c7e.SelectorType.Descendant},p5I={type:"_flexibleDescendant"},h5I={type:c7e.SelectorType.Pseudo,name:"scope",data:null};function Z5I(t,e,n){for(var l=e.adapter,I=!!n?.every(function(s){var r=l.isTag(s)&&l.getParent(s);return s===zgn.PLACEHOLDER_ELEMENT||r&&l.isTag(r)}),a=0,c=t;a0&&(0,d5I.isTraversal)(i[0])&&i[0].type!=="descendant"))if(I&&!i.some(Sgn))i.unshift(m5I);else continue;i.unshift(h5I)}}function o7e(t,e,n){var l;t=t.filter(function(s){return s.length>0}),t.forEach(u5I.default),n=(l=e.context)!==null&&l!==void 0?l:n;var I=Array.isArray(n),a=n&&(Array.isArray(n)?n:[n]);Z5I(t,e,a);var c=!1,i=t.map(function(s){if(s.length>=2){var r=s[0],u=s[1];r.type!=="pseudo"||r.name!=="scope"||(I&&u.type==="descendant"?s[1]=p5I:(u.type==="adjacent"||u.type==="sibling")&&(c=!0))}return W5I(s,e,a)}).reduce(N5I,uH.falseFunc);return i.shouldTestNextSiblings=c,i}cy.compileToken=o7e;function W5I(t,e,n){var l;return t.reduce(function(I,a){return I===uH.falseFunc?uH.falseFunc:(0,G5I.compileGeneralSelector)(I,a,e,n,o7e)},(l=e.rootFunc)!==null&&l!==void 0?l:uH.trueFunc)}function N5I(t,e){return e===uH.falseFunc||t===uH.trueFunc?t:t===uH.falseFunc||e===uH.trueFunc?e:function(l){return t(l)||e(l)}}});var qgn=f(Fr=>{"use strict";var V5I=Fr&&Fr.__createBinding||(Object.create?function(t,e,n,l){l===void 0&&(l=n);var I=Object.getOwnPropertyDescriptor(e,n);(!I||("get"in I?!e.__esModule:I.writable||I.configurable))&&(I={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,l,I)}:function(t,e,n,l){l===void 0&&(l=n),t[l]=e[n]}),Y5I=Fr&&Fr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g5I=Fr&&Fr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&V5I(e,t,n);return Y5I(e,t),e};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.aliases=Fr.pseudos=Fr.filters=Fr.is=Fr.selectOne=Fr.selectAll=Fr.prepareContext=Fr._compileToken=Fr._compileUnsafe=Fr.compile=void 0;var Tgn=g5I(zYe()),Dgn=oH(),p7=Mgn(),R5I=ige(),Kgn=function(t,e){return t===e},y5I={adapter:Tgn,equals:Kgn};function i7e(t){var e,n,l,I,a=t??y5I;return(e=a.adapter)!==null&&e!==void 0||(a.adapter=Tgn),(n=a.equals)!==null&&n!==void 0||(a.equals=(I=(l=a.adapter)===null||l===void 0?void 0:l.equals)!==null&&I!==void 0?I:Kgn),a}function s7e(t){return function(n,l,I){var a=i7e(l);return t(n,a,I)}}Fr.compile=s7e(p7.compile);Fr._compileUnsafe=s7e(p7.compileUnsafe);Fr._compileToken=s7e(p7.compileToken);function _gn(t){return function(n,l,I){var a=i7e(I);typeof n!="function"&&(n=(0,p7.compileUnsafe)(n,a,l));var c=Pgn(l,a.adapter,n.shouldTestNextSiblings);return t(n,c,a)}}function Pgn(t,e,n){return n===void 0&&(n=!1),n&&(t=A5I(t,e)),Array.isArray(t)?e.removeSubsets(t):e.getChildren(t)}Fr.prepareContext=Pgn;function A5I(t,e){for(var n=Array.isArray(t)?t.slice(0):[t],l=n.length,I=0;I{"use strict";function v5I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $gn(t,e){for(var n=0;n{"use strict";function w5I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nRn(t,e){for(var n=0;n{"use strict";function dge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dge=function(n){return typeof n}:dge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},dge(t)}function E5I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J5I(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&G7e(t,e)}function G7e(t,e){return G7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},G7e(t,e)}function C5I(t){var e=x5I();return function(){var l=Gge(t),I;if(e){var a=Gge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return L5I(this,I)}}function L5I(t,e){return e&&(dge(e)==="object"||typeof e=="function")?e:k5I(t)}function k5I(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x5I(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gge(t){return Gge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Gge(t)}var j5I,IRn;IRn=G2();aRn.exports=j5I=function(t){J5I(n,t);var e=C5I(n);function n(){return E5I(this,n),e.apply(this,arguments)}return n}(IRn)});var iRn=f((qFr,oRn)=>{"use strict";function bge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bge=function(n){return typeof n}:bge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},bge(t)}function O5I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U5I(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b7e(t,e)}function b7e(t,e){return b7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},b7e(t,e)}function z5I(t){var e=M5I();return function(){var l=mge(t),I;if(e){var a=mge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return B5I(this,I)}}function B5I(t,e){return e&&(bge(e)==="object"||typeof e=="function")?e:S5I(t)}function S5I(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function M5I(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function mge(t){return mge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},mge(t)}var T5I,cRn;cRn=G2();oRn.exports=T5I=function(t){U5I(n,t);var e=z5I(n);function n(){return O5I(this,n),e.apply(this,arguments)}return n}(cRn)});var dRn=f(($Fr,uRn)=>{"use strict";function pge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pge=function(n){return typeof n}:pge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},pge(t)}function D5I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function K5I(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m7e(t,e)}function m7e(t,e){return m7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},m7e(t,e)}function _5I(t){var e=$5I();return function(){var l=hge(t),I;if(e){var a=hge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return P5I(this,I)}}function P5I(t,e){return e&&(pge(e)==="object"||typeof e=="function")?e:q5I(t)}function q5I(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $5I(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hge(t){return hge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},hge(t)}var eLI,sRn;sRn=G2();uRn.exports=eLI=function(t){K5I(n,t);var e=_5I(n);function n(){return D5I(this,n),e.apply(this,arguments)}return n}(sRn)});var vY=f((e2r,mRn)=>{"use strict";function Zge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zge=function(n){return typeof n}:Zge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Zge(t)}function tLI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GRn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wge(t){return Wge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Wge(t)}var bRn,oLI;bRn=G2();mRn.exports=oLI=function(t){lLI(n,t);var e=ILI(n);function n(){return tLI(this,n),e.apply(this,arguments)}return nLI(n,[{key:"_set",value:function(I){if(!/^[0-9]+$/.test(String(I)))throw Error("`".concat(this.prop,"` only takes an integer for value"));return this.val=parseInt(I)}}]),n}(bRn)});var ZRn=f((t2r,hRn)=>{"use strict";function Nge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nge=function(n){return typeof n}:Nge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Nge(t)}function iLI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sLI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h7e(t,e)}function h7e(t,e){return h7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},h7e(t,e)}function uLI(t){var e=bLI();return function(){var l=Vge(t),I;if(e){var a=Vge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return dLI(this,I)}}function dLI(t,e){return e&&(Nge(e)==="object"||typeof e=="function")?e:GLI(t)}function GLI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bLI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vge(t){return Vge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Vge(t)}var mLI,pRn;pRn=vY();hRn.exports=mLI=function(t){sLI(n,t);var e=uLI(n);function n(){return iLI(this,n),e.apply(this,arguments)}return n}(pRn)});var VRn=f((n2r,NRn)=>{"use strict";function Yge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yge=function(n){return typeof n}:Yge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Yge(t)}function pLI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hLI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Z7e(t,e)}function Z7e(t,e){return Z7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},Z7e(t,e)}function ZLI(t){var e=VLI();return function(){var l=gge(t),I;if(e){var a=gge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return WLI(this,I)}}function WLI(t,e){return e&&(Yge(e)==="object"||typeof e=="function")?e:NLI(t)}function NLI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function VLI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gge(t){return gge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},gge(t)}var YLI,WRn;WRn=vY();NRn.exports=YLI=function(t){hLI(n,t);var e=ZLI(n);function n(){return pLI(this,n),e.apply(this,arguments)}return n}(WRn)});var yRn=f((l2r,RRn)=>{"use strict";function Rge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rge=function(n){return typeof n}:Rge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rge(t)}function gLI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function YRn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yge(t){return yge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},yge(t)}var XLI,gRn;gRn=G2();RRn.exports=XLI=function(){var t,e=function(n){yLI(I,n);var l=ALI(I);function I(){return gLI(this,I),l.apply(this,arguments)}return RLI(I,[{key:"_set",value:function(c){var i,s,r,u,o,d,b;if(c=String(c),b=c,r=null,o=!1,u="none",s="none",(d=c.match(/\"([^"]+)\"/)||(d=c.match(/\'([^']+)\'/)))&&(r=d[1],c=c.replace(d[0],""),o=!0),(d=c.match(/(none|left|right|center)/))?(i=d[1],c=c.replace(d[0],"")):i="left",i==="none"&&(o=!1),(d=c.match(/color\:([\w\-]+)/))&&(u=d[1],c=c.replace(d[0],"")),(d=c.match(/bg\:([\w\-]+)/))&&(s=d[1],c=c.replace(d[0],"")),c.trim()!=="")throw Error("Unrecognizable value `".concat(b,"` for `").concat(this.prop,"`"));return this.val={enabled:o,char:r,alignment:i,background:s,color:u}}}]),I}(gRn);return t=e,e}.call(void 0)});var fRn=f((I2r,vRn)=>{"use strict";function Age(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Age=function(n){return typeof n}:Age=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Age(t)}function wLI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ARn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fge(t){return Fge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Fge(t)}var kLI,FRn,xLI=[].indexOf;FRn=G2();vRn.exports=kLI=function(){var t,e=function(n){QLI(I,n);var l=ELI(I);function I(){return wLI(this,I),l.apply(this,arguments)}return HLI(I,[{key:"_set",value:function(c){if(c=String(c).toLowerCase(),xLI.call(t._allowed,c)<0)throw Error("Unrecognizable value `".concat(c,"` for `").concat(this.prop,"`"));return this.val=c}}]),I}(FRn);return t=e,e._allowed=["inline","block","none"],e}.call(void 0)});var Y7e=f((a2r,wRn)=>{"use strict";function vge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vge=function(n){return typeof n}:vge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},vge(t)}function jLI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OLI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&V7e(t,e)}function V7e(t,e){return V7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},V7e(t,e)}function ULI(t){var e=SLI();return function(){var l=fge(t),I;if(e){var a=fge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return zLI(this,I)}}function zLI(t,e){return e&&(vge(e)==="object"||typeof e=="function")?e:BLI(t)}function BLI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SLI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fge(t){return fge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},fge(t)}var MLI,XRn;XRn=vY();wRn.exports=MLI=function(t){OLI(n,t);var e=ULI(n);function n(){return jLI(this,n),e.apply(this,arguments)}return n}(XRn)});var R7e=f((r2r,QRn)=>{"use strict";function Xge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xge=function(n){return typeof n}:Xge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Xge(t)}function TLI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function DLI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g7e(t,e)}function g7e(t,e){return g7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},g7e(t,e)}function KLI(t){var e=qLI();return function(){var l=wge(t),I;if(e){var a=wge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return _LI(this,I)}}function _LI(t,e){return e&&(Xge(e)==="object"||typeof e=="function")?e:PLI(t)}function PLI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qLI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wge(t){return wge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},wge(t)}var $LI,HRn;HRn=vY();QRn.exports=$LI=function(t){DLI(n,t);var e=KLI(n);function n(){return TLI(this,n),e.apply(this,arguments)}return n}(HRn)});var A7e=f((c2r,JRn)=>{"use strict";function Hge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hge=function(n){return typeof n}:Hge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Hge(t)}function ekI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tkI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y7e(t,e)}function y7e(t,e){return y7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},y7e(t,e)}function nkI(t){var e=akI();return function(){var l=Qge(t),I;if(e){var a=Qge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return lkI(this,I)}}function lkI(t,e){return e&&(Hge(e)==="object"||typeof e=="function")?e:IkI(t)}function IkI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function akI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qge(t){return Qge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Qge(t)}var rkI,ERn;ERn=vY();JRn.exports=rkI=function(t){tkI(n,t);var e=nkI(n);function n(){return ekI(this,n),e.apply(this,arguments)}return n}(ERn)});var v7e=f((o2r,LRn)=>{"use strict";function Ege(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ege=function(n){return typeof n}:Ege=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ege(t)}function ckI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function okI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&F7e(t,e)}function F7e(t,e){return F7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},F7e(t,e)}function ikI(t){var e=dkI();return function(){var l=Jge(t),I;if(e){var a=Jge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return skI(this,I)}}function skI(t,e){return e&&(Ege(e)==="object"||typeof e=="function")?e:ukI(t)}function ukI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dkI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jge(t){return Jge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Jge(t)}var GkI,CRn;CRn=vY();LRn.exports=GkI=function(t){okI(n,t);var e=ikI(n);function n(){return ckI(this,n),e.apply(this,arguments)}return n}(CRn)});var jRn=f((i2r,xRn)=>{"use strict";function Cge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cge=function(n){return typeof n}:Cge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Cge(t)}function bkI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kRn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lge(t){return Lge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Lge(t)}var VkI,YkI,gkI,RkI,h7,Z7;Z7=G2();h7=Y7e();gkI=R7e();RkI=A7e();YkI=v7e();xRn.exports=VkI=function(){var t,e=function(n){pkI(I,n);var l=hkI(I);function I(){return bkI(this,I),l.apply(this,arguments)}return mkI(I,null,[{key:"setOnto",value:function(c,i,s){var r,u,o;if(r="",u=Z7.sanitizeValue(s),Z7.importantClauseRx.test(String(u))&&(r=" !important",u=u.replace(Z7.importantClauseRx,"")),u=u.trim(),u.length===0)return t._setAllDirections(c,r,r,r,r);if(o=u.split(" ").map(function(d){return d+r}),o.length===1)return t._setAllDirections(c,o[0],o[0],o[0],o[0]);if(o.length===2)return t._setAllDirections(c,o[0],o[1],o[0],o[1]);if(o.length===3)return t._setAllDirections(c,o[0],o[1],o[2],o[1]);if(o.length===4)return t._setAllDirections(c,o[0],o[1],o[2],o[3]);throw Error("Can't understand value for margin: `".concat(s,"`"))}},{key:"_setAllDirections",value:function(c,i,s,r,u){h7.setOnto(c,"marginTop",i),h7.setOnto(c,"marginRight",s),h7.setOnto(c,"marginBottom",r),h7.setOnto(c,"marginLeft",u)}}]),I}(Z7);return t=e,e}.call(void 0)});var w7e=f((s2r,URn)=>{"use strict";function kge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kge=function(n){return typeof n}:kge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},kge(t)}function ykI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AkI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&X7e(t,e)}function X7e(t,e){return X7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},X7e(t,e)}function FkI(t){var e=XkI();return function(){var l=xge(t),I;if(e){var a=xge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return vkI(this,I)}}function vkI(t,e){return e&&(kge(e)==="object"||typeof e=="function")?e:fkI(t)}function fkI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XkI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xge(t){return xge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},xge(t)}var wkI,ORn;ORn=vY();URn.exports=wkI=function(t){AkI(n,t);var e=FkI(n);function n(){return ykI(this,n),e.apply(this,arguments)}return n}(ORn)});var Q7e=f((u2r,BRn)=>{"use strict";function jge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jge=function(n){return typeof n}:jge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},jge(t)}function HkI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function QkI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&H7e(t,e)}function H7e(t,e){return H7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},H7e(t,e)}function EkI(t){var e=LkI();return function(){var l=Oge(t),I;if(e){var a=Oge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return JkI(this,I)}}function JkI(t,e){return e&&(jge(e)==="object"||typeof e=="function")?e:CkI(t)}function CkI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function LkI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oge(t){return Oge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Oge(t)}var kkI,zRn;zRn=vY();BRn.exports=kkI=function(t){QkI(n,t);var e=EkI(n);function n(){return HkI(this,n),e.apply(this,arguments)}return n}(zRn)});var J7e=f((d2r,MRn)=>{"use strict";function Uge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uge=function(n){return typeof n}:Uge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Uge(t)}function xkI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jkI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&E7e(t,e)}function E7e(t,e){return E7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},E7e(t,e)}function OkI(t){var e=BkI();return function(){var l=zge(t),I;if(e){var a=zge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return UkI(this,I)}}function UkI(t,e){return e&&(Uge(e)==="object"||typeof e=="function")?e:zkI(t)}function zkI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function BkI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zge(t){return zge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},zge(t)}var SkI,SRn;SRn=vY();MRn.exports=SkI=function(t){jkI(n,t);var e=OkI(n);function n(){return xkI(this,n),e.apply(this,arguments)}return n}(SRn)});var L7e=f((G2r,DRn)=>{"use strict";function Bge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bge=function(n){return typeof n}:Bge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Bge(t)}function MkI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function TkI(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C7e(t,e)}function C7e(t,e){return C7e=Object.setPrototypeOf||function(l,I){return l.__proto__=I,l},C7e(t,e)}function DkI(t){var e=PkI();return function(){var l=Sge(t),I;if(e){var a=Sge(this).constructor;I=Reflect.construct(l,arguments,a)}else I=l.apply(this,arguments);return KkI(this,I)}}function KkI(t,e){return e&&(Bge(e)==="object"||typeof e=="function")?e:_kI(t)}function _kI(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function PkI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sge(t){return Sge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Sge(t)}var qkI,TRn;TRn=vY();DRn.exports=qkI=function(t){TkI(n,t);var e=DkI(n);function n(){return MkI(this,n),e.apply(this,arguments)}return n}(TRn)});var PRn=f((b2r,_Rn)=>{"use strict";function Mge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mge=function(n){return typeof n}:Mge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Mge(t)}function $kI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function KRn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Tge(t){return Tge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Tge(t)}var rxI,cxI,oxI,ixI,W7,N7;N7=G2();W7=w7e();oxI=Q7e();ixI=J7e();cxI=L7e();_Rn.exports=rxI=function(){var t,e=function(n){txI(I,n);var l=nxI(I);function I(){return $kI(this,I),l.apply(this,arguments)}return exI(I,null,[{key:"setOnto",value:function(c,i,s){var r,u,o;if(r="",u=N7.sanitizeValue(s),N7.importantClauseRx.test(String(u))&&(r=" !important",u=u.replace(N7.importantClauseRx,"")),u=u.trim(),u.length===0)return t._setAllDirections(c,r,r,r,r);if(o=u.split(" ").map(function(d){return d+r}),o.length===1)return t._setAllDirections(c,o[0],o[0],o[0],o[0]);if(o.length===2)return t._setAllDirections(c,o[0],o[1],o[0],o[1]);if(o.length===3)return t._setAllDirections(c,o[0],o[1],o[2],o[1]);if(o.length===4)return t._setAllDirections(c,o[0],o[1],o[2],o[3]);throw Error("Can't understand value for padding: `".concat(s,"`"))}},{key:"_setAllDirections",value:function(c,i,s,r,u){W7.setOnto(c,"paddingTop",i),W7.setOnto(c,"paddingRight",s),W7.setOnto(c,"paddingBottom",r),W7.setOnto(c,"paddingLeft",u)}}]),I}(N7);return t=e,e}.call(void 0)});var nyn=f((m2r,tyn)=>{"use strict";function Dge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Dge=function(n){return typeof n}:Dge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Dge(t)}function sxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qRn(t,e){for(var n=0;n{"use strict";function GxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lyn(t,e){for(var n=0;n{"use strict";function Kge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kge=function(n){return typeof n}:Kge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Kge(t)}function pxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oyn(t,e){for(var n=0;n\,\+]{1})[\s]*/g,"$1").trim()}},{key:"splitSelectors",value:function(I){return I.trim().split(",")}}]),n}();return t=e,e}.call(void 0)});var byn=f((Z2r,Gyn)=>{"use strict";function WxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dyn(t,e){for(var n=0;nr.selector.priority}),a=0,c=I.length;a{"use strict";function YxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function myn(t,e){for(var n=0;n{"use strict";function yxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nyn(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:!1,c,i,s,r;return c="",i=0,r=[],s=!1,t._countChars(this._str,function(u,o){return(i>I||i+o>I)&&(r.push(c),c="",i=0),i===0&&u===" "&&!s&&a?s=!0:(c+=u,i+=o,s=!1)}),c.length>0&&r.push(c),r}},{key:"trim",value:function(){return new n(this.str.trim())}},{key:"_getLength",value:function(){var I;return I=0,t._countChars(this._str,function(a,c){I+=c}),I}},{key:"cut",value:function(I,a){var c=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s,r,u,o;if(a==null&&(a=this.length),I=parseInt(I),I>=a)throw Error("`from` shouldn't be larger than `to`");return r="",s="",o="",u=0,t._countChars(this._str,function(d,b){c.str==="ab"&&console.log(b,d),!(u===I&&d.match(/^\s+$/)&&i)&&(u]+>/,e._quotedHtmlRx=/^&(gt|lt|quot|amp|apos|sp);/,e}.call(void 0);j7e=["str","length"];for(_ge=0,Vyn=j7e.length;_ge{"use strict";function FxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ryn(t,e){for(var n=0;n{"use strict";function qge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qge=function(n){return typeof n}:qge=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},qge(t)}function XxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fyn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $ge(t){return $ge=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},$ge(t)}var LxI,vyn;vyn=Lm();fyn.exports=LxI=function(t){HxI(n,t);var e=QxI(n);function n(){return XxI(this,n),e.apply(this,arguments)}return wxI(n,[{key:"_render",value:function(I){return vyn.repeatString(` +`,this._config.amount)}}]),n}(Ayn())});var Qyn=f((g2r,Hyn)=>{"use strict";function kxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wyn(t,e){for(var n=0;n{"use strict";function eRe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eRe=function(n){return typeof n}:eRe=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eRe(t)}function OxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eyn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function tRe(t){return tRe=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},tRe(t)}var DxI,Jyn;Jyn=Lm();Cyn.exports=DxI=function(t){zxI(n,t);var e=BxI(n);function n(){return OxI(this,n),e.apply(this,arguments)}return UxI(n,[{key:"_render",value:function(I){return Jyn.repeatString(` +`,this._config.amount)}}]),n}(Qyn())});var jyn=f((y2r,xyn)=>{"use strict";function KxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kyn(t,e){for(var n=0;n"+this._render(n,l)+""}}]),t}()});var Syn=f((A2r,Byn)=>{"use strict";function nRe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nRe=function(n){return typeof n}:nRe=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},nRe(t)}function qxI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oyn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function lRe(t){return lRe=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},lRe(t)}var a3I,Uyn,zyn;zyn=Lm();Uyn=Pge();Byn.exports=a3I=function(){var t,e=function(n){e3I(I,n);var l=t3I(I);function I(){return qxI(this,I),l.apply(this,arguments)}return $xI(I,[{key:"_render",value:function(c,i){var s,r,u,o,d,b,h,Z,N,g,y;if(this._lineNo===0&&(o=this._config.bullet)){if(d=o.char,b=new Uyn(d).length,u=o.alignment,g=this._config.amount,y=d,s="",r="",g>b)if(h=g-b,u==="right")s=t.pad(h);else if(u==="left")r=t.pad(h);else if(u==="center")Z=Math.round(h/2),s=t.pad(Z),r=t.pad(h-Z);else throw Error("Unknown alignment `".concat(u,"`"));N=s+d+r}else N=t.pad(this._config.amount);return c+N}}],[{key:"pad",value:function(c){return zyn.repeatString(" ",c)}}]),I}(jyn());return t=e,e}.call(void 0)});var Dyn=f((F2r,Tyn)=>{"use strict";function r3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Myn(t,e){for(var n=0;n"+this._render(n,l)+""}}]),t}()});var qyn=f((v2r,Pyn)=>{"use strict";function IRe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?IRe=function(n){return typeof n}:IRe=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},IRe(t)}function i3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kyn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function aRe(t){return aRe=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},aRe(t)}var p3I,_yn;_yn=Lm();Pyn.exports=p3I=function(t){u3I(n,t);var e=d3I(n);function n(){return i3I(this,n),e.apply(this,arguments)}return s3I(n,[{key:"_render",value:function(I,a){return I+_yn.repeatString(" ",this._config.amount)}}]),n}(Dyn())});var tAn=f((f2r,eAn)=>{"use strict";function h3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $yn(t,e){for(var n=0;n{"use strict";function rRe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rRe=function(n){return typeof n}:rRe=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rRe(t)}function N3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nAn(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cRe(t){return cRe=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},cRe(t)}var F3I;lAn.exports=F3I=function(t){Y3I(n,t);var e=g3I(n);function n(){return N3I(this,n),e.apply(this,arguments)}return V3I(n,[{key:"_render",value:function(){}}]),n}(tAn())});var iAn=f((w2r,oAn)=>{"use strict";function v3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aAn(t,e){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";v3I(this,n),this._layout=l,this._parent=I,this._name=c,this._config=rAn(t.defaultConfig,a),this._closed=!1,this._wasOpenOnce=!1,this._active=!1,this._buffer="",this._didSeparateBlock=!1,this._linePrependor=new this._config.linePrependor.fn(this._config.linePrependor.options),this._lineAppendor=new this._config.lineAppendor.fn(this._config.lineAppendor.options),this._blockPrependor=new this._config.blockPrependor.fn(this._config.blockPrependor.options),this._blockAppendor=new this._config.blockAppendor.fn(this._config.blockAppendor.options)}return f3I(n,[{key:"_activate",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this._active)throw Error("This block is already active. This is probably a bug in RenderKid itself");if(this._closed)throw Error("This block is closed and cannot be activated. This is probably a bug in RenderKid itself");return this._active=!0,this._layout._activeBlock=this,I&&this._parent!=null&&this._parent._deactivate(!1),this}},{key:"_deactivate",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._ensureActive(),this._flushBuffer(),I&&this._parent!=null&&this._parent._activate(!1),this._active=!1,this}},{key:"_ensureActive",value:function(){if(!this._wasOpenOnce)throw Error("This block has never been open before. This is probably a bug in RenderKid itself.");if(!this._active)throw Error("This block is not active. This is probably a bug in RenderKid itself.");if(this._closed)throw Error("This block is already closed. This is probably a bug in RenderKid itself.")}},{key:"_open",value:function(){if(this._wasOpenOnce)throw Error("Block._open() has been called twice. This is probably a RenderKid bug.");return this._wasOpenOnce=!0,this._parent!=null&&this._parent.write(this._whatToPrependToBlock()),this._activate(),this}},{key:"close",value:function(){return this._deactivate(),this._closed=!0,this._parent!=null&&this._parent.write(this._whatToAppendToBlock()),this}},{key:"isOpen",value:function(){return this._wasOpenOnce&&!this._closed}},{key:"write",value:function(I){if(this._ensureActive(),I!=="")return I=String(I),this._buffer+=I,this}},{key:"openBlock",value:function(I,a){var c;return this._ensureActive(),c=new n(this._layout,this,I,a),c._open(),c}},{key:"_flushBuffer",value:function(){var I;this._buffer!==""&&(I=this._buffer,this._buffer="",this._writeInline(I))}},{key:"_toPrependToLine",value:function(){var I;return I="",this._parent!=null&&(I=this._parent._toPrependToLine()),this._linePrependor.render(I)}},{key:"_toAppendToLine",value:function(){var I;return I="",this._parent!=null&&(I=this._parent._toAppendToLine()),this._lineAppendor.render(I)}},{key:"_whatToPrependToBlock",value:function(){return this._blockPrependor.render()}},{key:"_whatToAppendToBlock",value:function(){return this._blockAppendor.render()}},{key:"_writeInline",value:function(I){var a,c,i,s,r,u,o,d,b,h;if(new Y7(I).isOnlySpecialChars()){this._layout._append(I);return}if(h=I,r=0,u=h.match(/^\n+/)){for(a=c=1,o=u[0].length;1<=o?c<=o:c>=o;a=1<=o?++c:--c)this._writeLine("");h=h.substr(u[0].length,h.length)}for((u=h.match(/\n+$/))&&(r=u[0].length,h=h.substr(0,h.length-u[0].length));h.length>0;)if(u=h.match(/^[^\n]+/))this._writeLine(u[0]),h=h.substr(u[0].length,h.length);else if(u=h.match(/^\n+/)){for(a=i=1,d=u[0].length;1<=d?id;a=1<=d?++i:--i)this._writeLine("");h=h.substr(u[0].length,h.length)}if(r>0)for(a=s=1,b=r;1<=b?s<=b:s>=b;a=1<=b?++s:--s)this._writeLine("")}},{key:"_writeLine",value:function(I){var a,c,i,s,r,u,o,d,b;for(s=new Y7(I);d=this._toPrependToLine(),b=new Y7(d).length,u=this._toAppendToLine(),o=new Y7(u).length,r=this._layout._config.terminalWidth-(b+o),i=Math.min(this._config.width,r),c=s.cut(0,i,!0),a=d+c.str+u,this._layout._appendLine(a),!s.isEmpty(););}}]),n}();return t=e,e.defaultConfig={blockPrependor:{fn:Xyn(),options:{amount:0}},blockAppendor:{fn:Lyn(),options:{amount:0}},linePrependor:{fn:Syn(),options:{amount:0}},lineAppendor:{fn:qyn(),options:{amount:0}},lineWrapper:{fn:IAn(),options:{lineWidth:null}},width:cAn,prefixRaw:"",suffixRaw:""},e}.call(void 0)});var ZAn=f((H2r,hAn)=>{"use strict";function H3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sAn(t,e){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:{},I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};H3I(this,n);var a;this._written=[],this._activeBlock=null,this._config=M7e(t._defaultConfig,l),a=M7e(t._rootBlockDefaultConfig,I),this._root=new GAn(this,null,a,"__root"),this._root._open()}return Q3I(n,[{key:"getRootBlock",value:function(){return this._root}},{key:"_append",value:function(I){return this._written.push(I)}},{key:"_appendLine",value:function(I){var a;return this._append(I),a=new mAn(I),a.length +`),this}},{key:"get",value:function(){return this._ensureClosed(),this._written[this._written.length-1]===` +`&&this._written.pop(),this._written.join("")}},{key:"_ensureClosed",value:function(){if(this._activeBlock!==this._root)throw Error("Not all the blocks have been closed. Please call block.close() on all open blocks.");this._root.isOpen()&&this._root.close()}}]),n}();return t=e,e._rootBlockDefaultConfig={linePrependor:{options:{amount:0}},lineAppendor:{options:{amount:0}},blockPrependor:{options:{amount:0}},blockAppendor:{options:{amount:0}}},e._defaultConfig={terminalWidth:pAn},e}.call(void 0);T7e=["openBlock","write"];for(oRe=0,uAn=T7e.length;oRe{"use strict";WAn.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var YAn=f((E2r,VAn)=>{"use strict";var J3I=NAn();VAn.exports=t=>typeof t=="string"?t.replace(J3I(),""):t});var HAn=f((J2r,wAn)=>{"use strict";function C3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gAn(t,e){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:{};C3I(this,n),this.tools=t.tools,this._config=AAn(t._defaultConfig,l),this._initStyles()}return L3I(n,[{key:"_initStyles",value:function(){return this._styles=new RAn}},{key:"style",value:function(){return this._styles.setRule.apply(this._styles,arguments)}},{key:"_getStyleFor",value:function(I){return this._styles.getStyleFor(I)}},{key:"render",value:function(I){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return this._paint(this._renderDom(this._toDom(I)),a)}},{key:"_toDom",value:function(I){if(typeof I=="string")return this._parse(I);if(vAn(I)||Array.isArray(I))return this._objToDom(I);throw Error("Invalid input type. Only strings, arrays and objects are accepted")}},{key:"_objToDom",value:function(I){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return a&&(I={body:I}),g7.objectToDom(I)}},{key:"_paint",value:function(I,a){var c;return c=D7e.paint(I),a?c:fAn(c)}},{key:"_parse",value:function(I){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return a&&(I=""+I+""),g7.stringToDom(I)}},{key:"_renderDom",value:function(I){var a,c,i;return a=I[0],c=new K7e(this._config.layout),i=c.getRootBlock(),this._renderBlockNode(a,null,i),c.get()}},{key:"_renderChildrenOf",value:function(I,a){var c,i,s,r;for(r=I.children,c=0,i=r.length;c{var P7e,EAn,JAn,CC,CAn,LC,LAn,kAn,q7e,R7,xAn,iRe,QAn,$7e,oy=[].slice,_7e=[].indexOf||function(t){for(var e=0,n=this.length;e0&&(t.length=t.length-l),t},pluckOneItem:function(t,e){var n,l,I,a,c;if(t.length<1)return t;for(l=!1,n=a=0,c=t.length;athis._maxItems)break;if(typeof c=="string"){s.push({item:{custom:c}});continue}s.push(function(){var d;return d={item:{header:{pointer:function(){return c.file==null?"":{file:c.file,colon:":",line:c.line}}()},footer:function(){var b;return b={addr:c.shortenedAddr},c.extra!=null&&(b.extra=c.extra),b}()}},typeof c.what=="string"&&c.what.trim().length>0&&(d.item.header.what=c.what),d}())}return i={"pretty-error":{header:I}},s.length>0&&(i["pretty-error"].trace=s),i},e.prototype._skipOrFilter=function(n,l){var I,a,c,i,s,r,u,o,d,b,h,Z,N,g,y,X,v;if(typeof n=="object"){if(Z=n.modName,_7e.call(this._packagesToSkip,Z)>=0||(N=n.path,_7e.call(this._pathsToSkip,N)>=0))return!0;for(g=n.packages,i=0,o=g.length;i=0)return!0;if(typeof n.shortenedAddr=="string")for(y=this._aliases,s=0,d=y.length;s{"use strict";function j3I(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UAn(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[l++]}},e:function(r){throw r},f:I}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,c=!1,i;return{s:function(){n=n.call(t)},n:function(){var r=n.next();return a=r.done,r},e:function(r){c=!0,i=r},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(c)throw i}}}}function U3I(t,e){if(t){if(typeof t=="string")return zAn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zAn(t,e)}}function zAn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,l=new Array(e);n0?t*40+55:0,c=e>0?e*40+55:0,i=n>0?n*40+55:0;l[I]=M3I([a,c,i])}function KAn(t){for(var e=t.toString(16);e.length<2;)e="0"+e;return e}function M3I(t){var e=[],n=DAn(t),l;try{for(n.s();!(l=n.n()).done;){var I=l.value;e.push(KAn(I))}}catch(a){n.e(a)}finally{n.f()}return"#"+e.join("")}function SAn(t,e,n,l){var I;return e==="text"?I=_3I(n,l):e==="display"?I=D3I(t,n,l):e==="xterm256Foreground"?I=dRe(t,l.colors[n]):e==="xterm256Background"?I=GRe(t,l.colors[n]):e==="rgb"&&(I=T3I(t,n)),I}function T3I(t,e){e=e.substring(2).slice(0,-1);var n=+e.substr(0,2),l=e.substring(5).split(";"),I=l.map(function(a){return("0"+Number(a).toString(16)).substr(-2)}).join("");return uRe(t,(n===38?"color:#":"background-color:#")+I)}function D3I(t,e,n){e=parseInt(e,10);var l={"-1":function(){return"
"},0:function(){return t.length&&_An(t)},1:function(){return dH(t,"b")},3:function(){return dH(t,"i")},4:function(){return dH(t,"u")},8:function(){return uRe(t,"display:none")},9:function(){return dH(t,"strike")},22:function(){return uRe(t,"font-weight:normal;text-decoration:none;font-style:normal")},23:function(){return TAn(t,"i")},24:function(){return TAn(t,"u")},39:function(){return dRe(t,n.fg)},49:function(){return GRe(t,n.bg)},53:function(){return uRe(t,"text-decoration:overline")}},I;return l[e]?I=l[e]():4"}).join("")}function sRe(t,e){for(var n=[],l=t;l<=e;l++)n.push(l);return n}function K3I(t){return function(e){return(t===null||e.category!==t)&&t!=="all"}}function MAn(t){t=parseInt(t,10);var e=null;return t===0?e="all":t===1?e="bold":2")}function uRe(t,e){return dH(t,"span",e)}function dRe(t,e){return dH(t,"span","color:"+e)}function GRe(t,e){return dH(t,"span","background-color:"+e)}function TAn(t,e){var n;if(t.slice(-1)[0]===e&&(n=t.pop()),n)return""}function P3I(t,e,n){var l=!1,I=3;function a(){return""}function c(H,Q){return n("xterm256Foreground",Q),""}function i(H,Q){return n("xterm256Background",Q),""}function s(H){return e.newline?n("display",-1):n("text",H),""}function r(H,Q){l=!0,Q.trim().length===0&&(Q="0"),Q=Q.trimRight(";").split(";");var L=DAn(Q),J;try{for(L.s();!(J=L.n()).done;){var O=J.value;n("display",O)}}catch(U){L.e(U)}finally{L.f()}return""}function u(H){return n("text",H),""}function o(H){return n("rgb",H),""}var d=[{pattern:/^\x08+/,sub:a},{pattern:/^\x1b\[[012]?K/,sub:a},{pattern:/^\x1b\[\(B/,sub:a},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:o},{pattern:/^\x1b\[38;5;(\d+)m/,sub:c},{pattern:/^\x1b\[48;5;(\d+)m/,sub:i},{pattern:/^\n/,sub:s},{pattern:/^\r+\n/,sub:s},{pattern:/^\r/,sub:s},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:r},{pattern:/^\x1b\[\d?J/,sub:a},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:a},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:a},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:u}];function b(H,Q){Q>I&&l||(l=!1,t=t.replace(H.pattern,H.sub))}var h=[],Z=t,N=Z.length;e:for(;N>0;){for(var g=0,y=0,X=d.length;y{"use strict";var i4I=km&&km.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,I){l.__proto__=I}||function(l,I){for(var a in I)Object.prototype.hasOwnProperty.call(I,a)&&(l[a]=I[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function l(){this.constructor=e}e.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}}(),eG=km&&km.__assign||function(){return eG=Object.assign||function(t){for(var e,n=1,l=arguments.length;n-1){n._history.stack=r.slice(0,u+1);var o=n._history.stack.length;if(o>N0n){var d=o-N0n;n._history.stack=r.slice(d,o),n._history.offset=Math.max(n._history.offset-d,0)}}var b=Date.now();if(I){var h=n._history.stack[n._history.offset];if(h&&b-h.timestamp=Z&&_<=N&&D.startsWith(b)?D.substring(b.length):D}).join(` +`);if(u!==g){var y=h[Z];n._applyEdits({value:g,selectionStart:y?.startsWith(b)?o-b.length:o,selectionEnd:d-(u.length-g.length)})}}else if(o!==d){var h=n._getLines(u,o),X=h.length-1,v=n._getLines(u,d).length-1,y=h[X];n._applyEdits({value:u.split(` +`).map(function(P,le){return le>=X&&le<=v?b+P:P}).join(` +`),selectionStart:y&&/\S/.test(y)?o+b.length:o,selectionEnd:d+b.length*(v-X+1)})}else{var H=o+b.length;n._applyEdits({value:u.substring(0,o)+b+u.substring(d),selectionStart:H,selectionEnd:H})}else if(l.keyCode===p4I){var Q=o!==d,L=u.substring(0,o);if(L.endsWith(b)&&!Q){l.preventDefault();var H=o-b.length;n._applyEdits({value:u.substring(0,o-b.length)+u.substring(d),selectionStart:H,selectionEnd:H})}}else if(l.keyCode===b4I){if(o===d){var J=n._getLines(u,o).pop(),O=J?.match(/^\s+/);if(O?.[0]){l.preventDefault();var U=` +`+O[0],H=o+U.length;n._applyEdits({value:u.substring(0,o)+U+u.substring(d),selectionStart:H,selectionEnd:H})}}}else if(l.keyCode===p0n||l.keyCode===h0n||l.keyCode===Z0n||l.keyCode===W0n){var K=void 0;l.keyCode===p0n&&l.shiftKey?K=["(",")"]:l.keyCode===h0n?l.shiftKey?K=["{","}"]:K=["[","]"]:l.keyCode===Z0n?l.shiftKey?K=['"','"']:K=["'","'"]:l.keyCode===W0n&&!l.shiftKey&&(K=["`","`"]),o!==d&&K&&(l.preventDefault(),n._applyEdits({value:u.substring(0,o)+K[0]+u.substring(o,d)+K[1]+u.substring(d),selectionStart:o,selectionEnd:d+2}))}else(r8e?l.metaKey&&l.keyCode===yRe:l.ctrlKey&&l.keyCode===yRe)&&!l.shiftKey&&!l.altKey?(l.preventDefault(),n._undoEdit()):(r8e?l.metaKey&&l.keyCode===yRe&&l.shiftKey:V4I?l.ctrlKey&&l.keyCode===h4I:l.ctrlKey&&l.keyCode===yRe&&l.shiftKey)&&!l.altKey?(l.preventDefault(),n._redoEdit()):l.keyCode===Z4I&&l.ctrlKey&&(!r8e||l.shiftKey)&&(l.preventDefault(),n.setState(function(D){return{capture:!D.capture}}))}},n._handleChange=function(l){var I=l.currentTarget,a=I.value,c=I.selectionStart,i=I.selectionEnd;n._recordChange({value:a,selectionStart:c,selectionEnd:i},!0),n.props.onValueChange(a)},n._history={stack:[],offset:-1},n._input=null,n}return e.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(e.prototype,"session",{get:function(){return{history:this._history}},set:function(n){this._history=n.history},enumerable:!1,configurable:!0}),e.prototype.render=function(){var n=this,l=this.props,I=l.value,a=l.style,c=l.padding,i=l.highlight,s=l.textareaId,r=l.textareaClassName,u=l.autoFocus,o=l.disabled,d=l.form,b=l.maxLength,h=l.minLength,Z=l.name,N=l.placeholder,g=l.readOnly,y=l.required,X=l.onClick,v=l.onFocus,H=l.onBlur,Q=l.onKeyUp,L=l.onKeyDown,J=l.onValueChange,O=l.tabSize,U=l.insertSpaces,K=l.ignoreTabKey,D=l.preClassName,_=G4I(l,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),P={paddingTop:typeof c=="object"?c.top:c,paddingRight:typeof c=="object"?c.right:c,paddingBottom:typeof c=="object"?c.bottom:c,paddingLeft:typeof c=="object"?c.left:c},le=i(I);return v7.createElement("div",eG({},_,{style:eG(eG({},f7.container),a)}),v7.createElement("pre",eG({className:D,"aria-hidden":"true",style:eG(eG(eG({},f7.editor),f7.highlight),P)},typeof le=="string"?{dangerouslySetInnerHTML:{__html:le+"
"}}:{children:le})),v7.createElement("textarea",{ref:function(q){return n._input=q},style:eG(eG(eG({},f7.editor),f7.textarea),P),className:ARe+(r?" ".concat(r):""),id:s,value:I,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:X,onKeyUp:Q,onFocus:v,onBlur:H,disabled:o,form:d,maxLength:b,minLength:h,name:Z,placeholder:N,readOnly:g,required:y,autoFocus:u,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),v7.createElement("style",{dangerouslySetInnerHTML:{__html:Y4I}}))},e.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},e}(v7.Component);km.default=g4I;var f7={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}});var g0n=f((qvr,FRe)=>{var R4I=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var Y0n=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,l={},I={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function Z(N){return N instanceof a?new a(N.type,Z(N.content),N.alias):Array.isArray(N)?N.map(Z):N.replace(/&/g,"&").replace(/"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(y){var Z=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(Z){var N=document.getElementsByTagName("script");for(var g in N)if(N[g].src==Z)return N[g]}return null}},isActive:function(Z,N,g){for(var y="no-"+N;Z;){var X=Z.classList;if(X.contains(N))return!0;if(X.contains(y))return!1;Z=Z.parentElement}return!!g}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(Z,N){var g=I.util.clone(I.languages[Z]);for(var y in N)g[y]=N[y];return g},insertBefore:function(Z,N,g,y){y=y||I.languages;var X=y[Z],v={};for(var H in X)if(X.hasOwnProperty(H)){if(H==N)for(var Q in g)g.hasOwnProperty(Q)&&(v[Q]=g[Q]);g.hasOwnProperty(H)||(v[H]=X[H])}var L=y[Z];return y[Z]=v,I.languages.DFS(I.languages,function(J,O){O===L&&J!=Z&&(this[J]=v)}),v},DFS:function Z(N,g,y,X){X=X||{};var v=I.util.objId;for(var H in N)if(N.hasOwnProperty(H)){g.call(N,H,N[H],y||H);var Q=N[H],L=I.util.type(Q);L==="Object"&&!X[v(Q)]?(X[v(Q)]=!0,Z(Q,g,null,X)):L==="Array"&&!X[v(Q)]&&(X[v(Q)]=!0,Z(Q,g,H,X))}}},plugins:{},highlightAll:function(Z,N){I.highlightAllUnder(document,Z,N)},highlightAllUnder:function(Z,N,g){var y={callback:g,container:Z,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};I.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),I.hooks.run("before-all-elements-highlight",y);for(var X=0,v;v=y.elements[X++];)I.highlightElement(v,N===!0,y.callback)},highlightElement:function(Z,N,g){var y=I.util.getLanguage(Z),X=I.languages[y];I.util.setLanguage(Z,y);var v=Z.parentElement;v&&v.nodeName.toLowerCase()==="pre"&&I.util.setLanguage(v,y);var H=Z.textContent,Q={element:Z,language:y,grammar:X,code:H};function L(O){Q.highlightedCode=O,I.hooks.run("before-insert",Q),Q.element.innerHTML=Q.highlightedCode,I.hooks.run("after-highlight",Q),I.hooks.run("complete",Q),g&&g.call(Q.element)}if(I.hooks.run("before-sanity-check",Q),v=Q.element.parentElement,v&&v.nodeName.toLowerCase()==="pre"&&!v.hasAttribute("tabindex")&&v.setAttribute("tabindex","0"),!Q.code){I.hooks.run("complete",Q),g&&g.call(Q.element);return}if(I.hooks.run("before-highlight",Q),!Q.grammar){L(I.util.encode(Q.code));return}if(N&&t.Worker){var J=new Worker(I.filename);J.onmessage=function(O){L(O.data)},J.postMessage(JSON.stringify({language:Q.language,code:Q.code,immediateClose:!0}))}else L(I.highlight(Q.code,Q.grammar,Q.language))},highlight:function(Z,N,g){var y={code:Z,grammar:N,language:g};if(I.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=I.tokenize(y.code,y.grammar),I.hooks.run("after-tokenize",y),a.stringify(I.util.encode(y.tokens),y.language)},tokenize:function(Z,N){var g=N.rest;if(g){for(var y in g)N[y]=g[y];delete N.rest}var X=new s;return r(X,X.head,Z),i(Z,X,N,X.head,0),o(X)},hooks:{all:{},add:function(Z,N){var g=I.hooks.all;g[Z]=g[Z]||[],g[Z].push(N)},run:function(Z,N){var g=I.hooks.all[Z];if(!(!g||!g.length))for(var y=0,X;X=g[y++];)X(N)}},Token:a};t.Prism=I;function a(Z,N,g,y){this.type=Z,this.content=N,this.alias=g,this.length=(y||"").length|0}a.stringify=function Z(N,g){if(typeof N=="string")return N;if(Array.isArray(N)){var y="";return N.forEach(function(L){y+=Z(L,g)}),y}var X={type:N.type,content:Z(N.content,g),tag:"span",classes:["token",N.type],attributes:{},language:g},v=N.alias;v&&(Array.isArray(v)?Array.prototype.push.apply(X.classes,v):X.classes.push(v)),I.hooks.run("wrap",X);var H="";for(var Q in X.attributes)H+=" "+Q+'="'+(X.attributes[Q]||"").replace(/"/g,""")+'"';return"<"+X.tag+' class="'+X.classes.join(" ")+'"'+H+">"+X.content+""};function c(Z,N,g,y){Z.lastIndex=N;var X=Z.exec(g);if(X&&y&&X[1]){var v=X[1].length;X.index+=v,X[0]=X[0].slice(v)}return X}function i(Z,N,g,y,X,v){for(var H in g)if(!(!g.hasOwnProperty(H)||!g[H])){var Q=g[H];Q=Array.isArray(Q)?Q:[Q];for(var L=0;L=v.reach);q+=le.value.length,le=le.next){var ee=le.value;if(N.length>Z.length)return;if(!(ee instanceof a)){var ne=1,ie;if(K){if(ie=c(P,q,Z,U),!ie||ie.index>=Z.length)break;var ce=ie.index,me=ie.index+ie[0].length,Ze=q;for(Ze+=le.value.length;ce>=Ze;)le=le.next,Ze+=le.value.length;if(Ze-=le.value.length,q=Ze,le.value instanceof a)continue;for(var Fe=le;Fe!==N.tail&&(Zev.reach&&(v.reach=E);var S=le.prev;ke&&(S=r(N,S,ke),q+=ke.length),u(N,S,ne);var m=new a(H,O?I.tokenize(fe,O):fe,D,fe);if(le=r(N,S,m),j&&r(N,le,j),ne>1){var Y={cause:H+","+L,reach:E};i(Z,N,g,le.prev,q,Y),v&&Y.reach>v.reach&&(v.reach=Y.reach)}}}}}}function s(){var Z={value:null,prev:null,next:null},N={value:null,prev:Z,next:null};Z.next=N,this.head=Z,this.tail=N,this.length=0}function r(Z,N,g){var y=N.next,X={value:g,prev:N,next:y};return N.next=X,y.prev=X,Z.length++,X}function u(Z,N,g){for(var y=N.next,X=0;Xrye});module.exports=f$e(xOI);var Rvn=$(d8()),tG=require("obsidian");var jgt=$(gn());Vr();yn();var Tgt=$(M5());var Jgt=require("obsidian"),e3=$(_2e());sh();var _ct=[];var Kve={};Xe(Kve,{agents:()=>Pct,caches:()=>q2e,callbacks__base:()=>s0e,callbacks__manager:()=>Y0e,callbacks__promises:()=>N0e,chat_history:()=>eve,documents:()=>tve,embeddings:()=>nve,example_selectors:()=>rve,language_models__base:()=>mve,language_models__chat_models:()=>Zve,language_models__llms:()=>Wve,load__serializable:()=>Eye,memory:()=>Nve,messages:()=>jFe,output_parsers:()=>wve,outputs:()=>f0e,prompt_values:()=>OFe,prompts:()=>PFe,retrievers:()=>Qve,runnables:()=>Vve,stores:()=>Eve,tools:()=>Jve,tracers__base:()=>G0e,tracers__console:()=>p0e,tracers__initialize:()=>Lve,tracers__log_stream:()=>v0e,tracers__run_collector:()=>kve,tracers__tracer_langchain:()=>W0e,tracers__tracer_langchain_v1:()=>Cve,utils__async_caller:()=>X0e,utils__chunk_array:()=>xve,utils__env:()=>c0e,utils__function_calling:()=>Ove,utils__hash:()=>P2e,utils__json_patch:()=>Ave,utils__json_schema:()=>QFe,utils__math:()=>zve,utils__stream:()=>A0e,utils__testing:()=>Mve,utils__tiktoken:()=>dve,utils__types:()=>Tve,vectorstores:()=>Sve});var Pct={};$2e();Y5();Qy();A$();var eve={};Xe(eve,{BaseChatMessageHistory:()=>pB,BaseListChatMessageHistory:()=>nL,InMemoryChatMessageHistory:()=>Ty});sh();KY();var pB=class extends XI{async addMessages(e){for(let n of e)await this.addMessage(n)}},nL=class extends XI{addUserMessage(e){return this.addMessage(new Qn(e))}addAIChatMessage(e){return this.addMessage(new _t(e))}addAIMessage(e){return this.addMessage(new _t(e))}async addMessages(e){for(let n of e)await this.addMessage(n)}clear(){throw new Error("Not implemented.")}},Ty=class extends nL{constructor(e){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","stores","message","in_memory"]}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.messages=e??[]}async getMessages(){return this.messages}async addMessage(e){this.messages.push(e)}async clear(){this.messages=[]}};var tve={};Xe(tve,{BaseDocumentTransformer:()=>lL,Document:()=>WI,MappingDocumentTransformer:()=>ZB});hB();Zd();var lL=class extends Zn{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","documents","transformers"]})}invoke(e,n){return this.transformDocuments(e)}},ZB=class extends lL{async transformDocuments(e){let n=[];for(let l of e){let I=await this._transformDocument(l);n.push(I)}return n}};Dee();cve();aL();ate();rte();sh();var Nve={};Xe(Nve,{BaseMemory:()=>BN,getInputValue:()=>_y,getOutputValue:()=>iQ,getPromptInputKey:()=>cte});var BN=class{},uot=(t,e)=>{if(e!==void 0)return t[e];let n=Object.keys(t);if(n.length===1)return t[n[0]]},_y=(t,e)=>{let n=uot(t,e);if(!n){let l=Object.keys(t);throw new Error(`input values have ${l.length} keys, you must specify an input key or pass only 1 key as input`)}return n},iQ=(t,e)=>{let n=uot(t,e);if(!n&&n!==""){let l=Object.keys(t);throw new Error(`output values have ${l.length} keys, you must specify an output key or pass only 1 key as output`)}return n};function cte(t,e){let n=Object.keys(t).filter(l=>!e.includes(l)&&l!=="stop");if(n.length!==1)throw new Error(`One input key expected, but got ${n.length}`);return n[0]}KY();Hve();Ey();qFe();B2();ote();var Qve={};Xe(Qve,{BaseRetriever:()=>bG});Qy();Zd();HN();var bG=class extends Zn{constructor(e){super(e),Object.defineProperty(this,"callbacks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{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,"verbose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.callbacks=e?.callbacks,this.tags=e?.tags??[],this.metadata=e?.metadata??{},this.verbose=e?.verbose??!1}_getRelevantDocuments(e,n){throw new Error("Not implemented!")}async invoke(e,n){return this.getRelevantDocuments(e,Xl(n))}async getRelevantDocuments(e,n){let l=Xl(Hy(n)),a=await(await Lr.configure(l.callbacks,this.callbacks,l.tags,this.tags,l.metadata,this.metadata,{verbose:this.verbose}))?.handleRetrieverStart(this.toJSON(),e,l.runId,void 0,void 0,void 0,l.runName);try{let c=await this._getRelevantDocuments(e,a);return await a?.handleRetrieverEnd(c),c}catch(c){throw await a?.handleRetrieverError(c),c}}};var Eve={};Xe(Eve,{BaseStore:()=>uL,InMemoryStore:()=>VB});sh();var uL=class extends XI{},VB=class extends uL{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","storage"]}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:{}})}async mget(e){return e.map(n=>this.store[n])}async mset(e){for(let[n,l]of e)this.store[n]=l}async mdelete(e){for(let n of e)delete this.store[n]}async*yieldKeys(e){let n=Object.keys(this.store);for(let l of n)(e===void 0||l.startsWith(e))&&(yield l)}};ute();QZ();Y$();var Lve={};Xe(Lve,{getTracingCallbackHandler:()=>vjn,getTracingV2CallbackHandler:()=>fjn});vz();var Cve={};Xe(Cve,{LangChainTracerV1:()=>RB});gy();zY();QZ();var RB=class extends Oc{constructor(){super(),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"langchain_tracer"}),Object.defineProperty(this,"endpoint",{enumerable:!0,configurable:!0,writable:!0,value:yt("LANGCHAIN_ENDPOINT")||"http://localhost:1984"}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:{"Content-Type":"application/json"}}),Object.defineProperty(this,"session",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let e=yt("LANGCHAIN_API_KEY");e&&(this.headers["x-api-key"]=e)}async newSession(e){let n={start_time:Date.now(),name:e},l=await this.persistSession(n);return this.session=l,l}async loadSession(e){let n=`${this.endpoint}/sessions?name=${e}`;return this._handleSessionResponse(n)}async loadDefaultSession(){let e=`${this.endpoint}/sessions?name=default`;return this._handleSessionResponse(e)}async convertV2RunToRun(e){let n=this.session??await this.loadDefaultSession(),l=e.serialized,I;if(e.run_type==="llm"){let a=e.inputs.prompts?e.inputs.prompts:e.inputs.messages.map(i=>mr(i));I={uuid:e.id,start_time:e.start_time,end_time:e.end_time,execution_order:e.execution_order,child_execution_order:e.child_execution_order,serialized:l,type:e.run_type,session_id:n.id,prompts:a,response:e.outputs}}else if(e.run_type==="chain"){let a=await Promise.all(e.child_runs.map(i=>this.convertV2RunToRun(i)));I={uuid:e.id,start_time:e.start_time,end_time:e.end_time,execution_order:e.execution_order,child_execution_order:e.child_execution_order,serialized:l,type:e.run_type,session_id:n.id,inputs:e.inputs,outputs:e.outputs,child_llm_runs:a.filter(i=>i.type==="llm"),child_chain_runs:a.filter(i=>i.type==="chain"),child_tool_runs:a.filter(i=>i.type==="tool")}}else if(e.run_type==="tool"){let a=await Promise.all(e.child_runs.map(i=>this.convertV2RunToRun(i)));I={uuid:e.id,start_time:e.start_time,end_time:e.end_time,execution_order:e.execution_order,child_execution_order:e.child_execution_order,serialized:l,type:e.run_type,session_id:n.id,tool_input:e.inputs.input,output:e.outputs?.output,action:JSON.stringify(l),child_llm_runs:a.filter(i=>i.type==="llm"),child_chain_runs:a.filter(i=>i.type==="chain"),child_tool_runs:a.filter(i=>i.type==="tool")}}else throw new Error(`Unknown run type: ${e.run_type}`);return I}async persistRun(e){let n,l;e.run_type!==void 0?l=await this.convertV2RunToRun(e):l=e,l.type==="llm"?n=`${this.endpoint}/llm-runs`:l.type==="chain"?n=`${this.endpoint}/chain-runs`:n=`${this.endpoint}/tool-runs`;let I=await fetch(n,{method:"POST",headers:this.headers,body:JSON.stringify(l)});I.ok||console.error(`Failed to persist run: ${I.status} ${I.statusText}`)}async persistSession(e){let n=`${this.endpoint}/sessions`,l=await fetch(n,{method:"POST",headers:this.headers,body:JSON.stringify(e)});return l.ok?{id:(await l.json()).id,...e}:(console.error(`Failed to persist session: ${l.status} ${l.statusText}, using default session.`),{id:1,...e})}async _handleSessionResponse(e){let n=await fetch(e,{method:"GET",headers:this.headers}),l;if(!n.ok)return console.error(`Failed to load session: ${n.status} ${n.statusText}`),l={id:1,start_time:Date.now()},this.session=l,l;let I=await n.json();return I.length===0?(l={id:1,start_time:Date.now()},this.session=l,l):([l]=I,this.session=l,l)}};async function vjn(t){let e=new RB;return t?await e.loadSession(t):await e.loadDefaultSession(),e}async function fjn(){return new lb}J$();var kve={};Xe(kve,{RunCollectorCallbackHandler:()=>yB});QZ();var yB=class extends Oc{constructor({exampleId:e}={}){super({_awaitHandler:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"run_collector"}),Object.defineProperty(this,"exampleId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracedRuns",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.exampleId=e,this.tracedRuns=[]}async persistRun(e){let n={...e};n.reference_example_id=this.exampleId,this.tracedRuns.push(n)}};vz();MH();jve();zY();Uve();bB();NB();ky();var zve={};Xe(zve,{cosineSimilarity:()=>ev,euclideanDistance:()=>bte,innerProduct:()=>Gte,matrixFunc:()=>AB,maximalMarginalRelevance:()=>mte,normalize:()=>yot});function dte(t,e){let n=0,l=0,I=0;for(let a=0;ae.map(I=>n(l,I)).map(I=>Number.isNaN(I)?0:I))}function yot(t,e=!1){let n=wjn(t);return t.map(l=>l.map(I=>e?1-I/n:I/n))}function ev(t,e){return AB(t,e,dte)}function Gte(t,e){return AB(t,e,got)}function bte(t,e){return AB(t,e,Rot)}function mte(t,e,n=.5,l=4){if(Math.min(l,e.length)<=0)return[];let I=Array.isArray(t[0])?t:[t],a=ev(I,e)[0],c=Aot(a).maxIndex,i=[e[c]],s=[c];for(;s.length{if(s.includes(b))return;let h=Math.max(...o[b]),Z=n*d-(1-n)*h;Z>r&&(r=Z,u=b)}),i.push(e[u]),s.push(u)}return s}function Aot(t){if(t.length===0)return{maxIndex:-1,maxValue:NaN};let e=t[0],n=0;for(let l=1;le&&(n=l,e=t[l]);return{maxIndex:n,maxValue:e}}function wjn(t){return t.reduce((e,n)=>Math.max(e,Aot(n).maxValue),0)}JZ();var Mve={};Xe(Mve,{FakeChatMessageHistory:()=>Rte,FakeChatModel:()=>Nte,FakeEmbeddings:()=>vte,FakeLLM:()=>Zte,FakeListChatMessageHistory:()=>yte,FakeListChatModel:()=>gte,FakeRetriever:()=>Yte,FakeRunnable:()=>hte,FakeSplitIntoListParser:()=>pte,FakeStreamingChatModel:()=>Vte,FakeStreamingLLM:()=>Wte,FakeTool:()=>Fte,FakeTracer:()=>Ate,FakeVectorStore:()=>wte,SingleRunExtractor:()=>Xte,SyntheticEmbeddings:()=>fte});hB();ate();rte();KY();sQ();Ey();Zd();ute();QZ();Dee();ky();var Sve={};Xe(Sve,{SaveableVectorStore:()=>Bve,VectorStore:()=>tv,VectorStoreRetriever:()=>MZ});sh();var MZ=class extends bG{static lc_name(){return"VectorStoreRetriever"}get lc_namespace(){return["langchain_core","vectorstores"]}_vectorstoreType(){return this.vectorStore._vectorstoreType()}constructor(e){super(e),Object.defineProperty(this,"vectorStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"k",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"searchType",{enumerable:!0,configurable:!0,writable:!0,value:"similarity"}),Object.defineProperty(this,"searchKwargs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.vectorStore=e.vectorStore,this.k=e.k??this.k,this.searchType=e.searchType??this.searchType,this.filter=e.filter,e.searchType==="mmr"&&(this.searchKwargs=e.searchKwargs)}async _getRelevantDocuments(e,n){if(this.searchType==="mmr"){if(typeof this.vectorStore.maxMarginalRelevanceSearch!="function")throw new Error(`The vector store backing this retriever, ${this._vectorstoreType()} does not support max marginal relevance search.`);return this.vectorStore.maxMarginalRelevanceSearch(e,{k:this.k,filter:this.filter,...this.searchKwargs},n?.getChild("vectorstore"))}return this.vectorStore.similaritySearch(e,this.k,this.filter,n?.getChild("vectorstore"))}async addDocuments(e,n){return this.vectorStore.addDocuments(e,n)}},tv=class extends XI{constructor(e,n){super(n),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","vectorstores",this._vectorstoreType()]}),Object.defineProperty(this,"embeddings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.embeddings=e}async delete(e){throw new Error("Not implemented.")}async similaritySearch(e,n=4,l=void 0,I=void 0){return(await this.similaritySearchVectorWithScore(await this.embeddings.embedQuery(e),n,l)).map(c=>c[0])}async similaritySearchWithScore(e,n=4,l=void 0,I=void 0){return this.similaritySearchVectorWithScore(await this.embeddings.embedQuery(e),n,l)}static fromTexts(e,n,l,I){throw new Error("the Langchain vectorstore implementation you are using forgot to override this, please report a bug")}static fromDocuments(e,n,l){throw new Error("the Langchain vectorstore implementation you are using forgot to override this, please report a bug")}asRetriever(e,n,l,I,a,c){if(typeof e=="number")return new MZ({vectorStore:this,k:e,filter:n,tags:[...I??[],this._vectorstoreType()],metadata:a,verbose:c,callbacks:l});{let i={vectorStore:this,k:e?.k,filter:e?.filter,tags:[...e?.tags??[],this._vectorstoreType()],metadata:e?.metadata,verbose:e?.verbose,callbacks:e?.callbacks,searchType:e?.searchType};return e?.searchType==="mmr"?new MZ({...i,searchKwargs:e.searchKwargs}):new MZ({...i})}}},Bve=class extends tv{static load(e,n){throw new Error("Not implemented")}};var pte=class extends QI{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["tests","fake"]})}getFormatInstructions(){return""}async parse(e){return e.split(",").map(n=>n.trim())}},hte=class extends Zn{constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["tests","fake"]}),Object.defineProperty(this,"returnOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.returnOptions=e.returnOptions}async invoke(e,n){return this.returnOptions?n??{}:{input:e}}},Zte=class extends eg{constructor(e){super(e),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thrownErrorString",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.response=e.response,this.thrownErrorString=e.thrownErrorString}_llmType(){return"fake"}async _call(e,n,l){if(this.thrownErrorString)throw new Error(this.thrownErrorString);let I=this.response??e;return await l?.handleLLMNewToken(I),I}},Wte=class extends eg{constructor(e){super(e),Object.defineProperty(this,"sleep",{enumerable:!0,configurable:!0,writable:!0,value:50}),Object.defineProperty(this,"responses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thrownErrorString",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.sleep=e.sleep??this.sleep,this.responses=e.responses,this.thrownErrorString=e.thrownErrorString}_llmType(){return"fake"}async _call(e){if(this.thrownErrorString)throw new Error(this.thrownErrorString);let n=this.responses?.[0];return this.responses=this.responses?.slice(1),n??e}async*_streamResponseChunks(e,n,l){if(this.thrownErrorString)throw new Error(this.thrownErrorString);let I=this.responses?.[0];this.responses=this.responses?.slice(1);for(let a of I??e)await new Promise(c=>setTimeout(c,this.sleep)),yield{text:a,generationInfo:{}},await l?.handleLLMNewToken(a)}},Nte=class extends Vd{_combineLLMOutput(){return[]}_llmType(){return"fake"}async _generate(e,n,l){if(n?.stop?.length)return{generations:[{message:new _t(n.stop[0]),text:n.stop[0]}]};let I=e.map(a=>typeof a.content=="string"?a.content:JSON.stringify(a.content,null,2)).join(` +`);return await l?.handleLLMNewToken(I),{generations:[{message:new _t(I),text:I}],llmOutput:{}}}},Vte=class t extends Vd{constructor({sleep:e=50,responses:n=[],chunks:l=[],toolStyle:I="openai",thrownErrorString:a,...c}){super(c),Object.defineProperty(this,"sleep",{enumerable:!0,configurable:!0,writable:!0,value:50}),Object.defineProperty(this,"responses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"chunks",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"toolStyle",{enumerable:!0,configurable:!0,writable:!0,value:"openai"}),Object.defineProperty(this,"thrownErrorString",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.sleep=e,this.responses=n,this.chunks=l,this.toolStyle=I,this.thrownErrorString=a}_llmType(){return"fake"}bindTools(e){let n=[...this.tools,...e],l=n.map(c=>{switch(this.toolStyle){case"openai":return{type:"function",function:{name:c.name,description:c.description,parameters:Wl(c.schema)}};case"anthropic":return{name:c.name,description:c.description,input_schema:Wl(c.schema)};case"bedrock":return{toolSpec:{name:c.name,description:c.description,inputSchema:Wl(c.schema)}};case"google":return{name:c.name,description:c.description,parameters:Wl(c.schema)};default:throw new Error(`Unsupported tool style: ${this.toolStyle}`)}}),I=this.toolStyle==="google"?[{functionDeclarations:l}]:l,a=new t({sleep:this.sleep,responses:this.responses,chunks:this.chunks,toolStyle:this.toolStyle,thrownErrorString:this.thrownErrorString});return a.tools=n,a.withConfig({tools:I})}async _generate(e,n,l){if(this.thrownErrorString)throw new Error(this.thrownErrorString);let I=this.responses?.[0]?.content??e[0].content??"";return{generations:[{text:"",message:new _t({content:I,tool_calls:this.chunks?.[0]?.tool_calls})}]}}async*_streamResponseChunks(e,n,l){if(this.thrownErrorString)throw new Error(this.thrownErrorString);if(this.chunks?.length){for(let c of this.chunks){let i=new Io({message:new Jl({content:c.content,tool_calls:c.tool_calls,additional_kwargs:c.additional_kwargs??{}}),text:c.content?.toString()??""});yield i,await l?.handleLLMNewToken(c.content,void 0,void 0,void 0,void 0,{chunk:i})}return}let I=this.responses?.[0]??new _t(typeof e[0].content=="string"?e[0].content:""),a=typeof I.content=="string"?I.content:"";for(let c of a){await new Promise(s=>setTimeout(s,this.sleep));let i=new Io({message:new Jl({content:c}),text:c});yield i,await l?.handleLLMNewToken(c,void 0,void 0,void 0,void 0,{chunk:i})}}},Yte=class extends bG{constructor(e){super(),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["test","fake"]}),Object.defineProperty(this,"output",{enumerable:!0,configurable:!0,writable:!0,value:[new WI({pageContent:"foo"}),new WI({pageContent:"bar"})]}),this.output=e?.output??this.output}async _getRelevantDocuments(e){return this.output}},gte=class extends Vd{static lc_name(){return"FakeListChatModel"}constructor(e){super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"responses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"i",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"sleep",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emitCustomEvent",{enumerable:!0,configurable:!0,writable:!0,value:!1});let{responses:n,sleep:l,emitCustomEvent:I}=e;this.responses=n,this.sleep=l,this.emitCustomEvent=I??this.emitCustomEvent}_combineLLMOutput(){return[]}_llmType(){return"fake-list"}async _generate(e,n,l){if(await this._sleepIfRequested(),n?.thrownErrorString)throw new Error(n.thrownErrorString);if(this.emitCustomEvent&&await l?.handleCustomEvent("some_test_event",{someval:!0}),n?.stop?.length)return{generations:[this._formatGeneration(n.stop[0])]};{let I=this._currentResponse();return this._incrementResponse(),{generations:[this._formatGeneration(I)],llmOutput:{}}}}_formatGeneration(e){return{message:new _t(e),text:e}}async*_streamResponseChunks(e,n,l){let I=this._currentResponse();this._incrementResponse(),this.emitCustomEvent&&await l?.handleCustomEvent("some_test_event",{someval:!0});for await(let a of I){if(await this._sleepIfRequested(),n?.thrownErrorString)throw new Error(n.thrownErrorString);yield this._createResponseChunk(a),l?.handleLLMNewToken(a)}}async _sleepIfRequested(){this.sleep!==void 0&&await this._sleep()}async _sleep(){return new Promise(e=>{setTimeout(()=>e(),this.sleep)})}_createResponseChunk(e){return new Io({message:new Jl({content:e}),text:e})}_currentResponse(){return this.responses[this.i]}_incrementResponse(){this.i{let I=await this.invoke(l);if(I.tool_calls?.[0]?.args)return I.tool_calls[0].args;if(typeof I.content=="string")return JSON.parse(I.content);throw new Error("No structured output found")})}},Rte=class extends pB{constructor(){super(),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","message","fake"]}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:[]})}async getMessages(){return this.messages}async addMessage(e){this.messages.push(e)}async addUserMessage(e){this.messages.push(new Qn(e))}async addAIChatMessage(e){this.messages.push(new _t(e))}async clear(){this.messages=[]}},yte=class extends nL{constructor(){super(),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","message","fake"]}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:[]})}async addMessage(e){this.messages.push(e)}async getMessages(){return this.messages}},Ate=class extends Oc{constructor(){super(),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"fake_tracer"}),Object.defineProperty(this,"runs",{enumerable:!0,configurable:!0,writable:!0,value:[]})}persistRun(e){return this.runs.push(e),Promise.resolve()}},Fte=class extends Gm{constructor(e){super(e),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}async _call(e,n){return JSON.stringify(e)}},vte=class extends Pm{constructor(e){super(e??{})}embedDocuments(e){return Promise.resolve(e.map(()=>[.1,.2,.3,.4]))}embedQuery(e){return Promise.resolve([.1,.2,.3,.4])}},fte=class extends Pm{constructor(e){super(e??{}),Object.defineProperty(this,"vectorSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.vectorSize=e?.vectorSize??4}async embedDocuments(e){return Promise.all(e.map(n=>this.embedQuery(n)))}async embedQuery(e){let n=e;n=n.toLowerCase().replaceAll(/[^a-z ]/g,"");let l=n.length%this.vectorSize,I=l===0?0:this.vectorSize-l,a=n.length+I;n=n.padEnd(a," ");let c=n.length/this.vectorSize,i=[];for(let r=0;r{let u=0;for(let d=0;d{this.runPromiseResolver=e})}async persistRun(e){this.runPromiseResolver(e)}async extract(){return this.runPromise}},wte=class t extends tv{_vectorstoreType(){return"memory"}constructor(e,{similarity:n,...l}={}){super(e,l),Object.defineProperty(this,"memoryVectors",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"similarity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.similarity=n??dte}async addDocuments(e){let n=e.map(({pageContent:l})=>l);return this.addVectors(await this.embeddings.embedDocuments(n),e)}async addVectors(e,n){let l=e.map((I,a)=>({content:n[a].pageContent,embedding:I,metadata:n[a].metadata}));this.memoryVectors=this.memoryVectors.concat(l)}async similaritySearchVectorWithScore(e,n,l){let I=s=>{if(!l)return!0;let r=new WI({metadata:s.metadata,pageContent:s.content});return l(r)},a=this.memoryVectors.filter(I);return a.map((s,r)=>({similarity:this.similarity(e,s.embedding),index:r})).sort((s,r)=>s.similarity>r.similarity?-1:0).slice(0,n).map(s=>[new WI({metadata:a[s.index].metadata,pageContent:a[s.index].content}),s.similarity])}static async fromTexts(e,n,l,I){let a=[];for(let c=0;c(n[I]=l,n),{})}async function Hte(t){let{optionalImportsMap:e={},optionalImportEntrypoints:n=[],importMap:l={},secretsMap:I={},path:a=["$"]}=this,c=a.join(".");if(typeof t=="object"&&t!==null&&!Array.isArray(t)&&"lc"in t&&"type"in t&&"id"in t&&t.lc===1&&t.type==="secret"){let i=t,[s]=i.id;if(s in I)return I[s];{let r=yt(s);if(r)return r;throw new Error(`Missing key "${s}" for ${c} in load(secretsMap={})`)}}else if(typeof t=="object"&&t!==null&&!Array.isArray(t)&&"lc"in t&&"type"in t&&"id"in t&&t.lc===1&&t.type==="not_implemented"){let s=JSON.stringify(t);throw new Error(`Trying to load an object that doesn't implement serialization: ${c} -> ${s}`)}else if(typeof t=="object"&&t!==null&&!Array.isArray(t)&&"lc"in t&&"type"in t&&"id"in t&&"kwargs"in t&&t.lc===1){let i=t,s=JSON.stringify(i),[r,...u]=i.id.slice().reverse(),o=u.reverse(),d={langchain_core:Kve,langchain:l},b=null,h=[o.join("/")];o[0]==="langchain_community"&&h.push(["langchain",...o.slice(1)].join("/"));let Z=h.find(y=>y in e);if(_ct.concat(n).includes(o.join("/"))||Z)if(Z!==void 0)b=await e[Z];else throw new Error(`Missing key "${o.join("/")}" for ${c} in load(optionalImportsMap={})`);else{let y;if(o[0]==="langchain"||o[0]==="langchain_core")y=d[o[0]],o.shift();else throw new Error(`Invalid namespace: ${c} -> ${s}`);if(o.length===0)throw new Error(`Invalid namespace: ${c} -> ${s}`);let X;do{if(X=o.join("__"),X in y)break;o.pop()}while(o.length>0);X in y&&(b=y[X])}if(typeof b!="object"||b===null)throw new Error(`Invalid namespace: ${c} -> ${s}`);let N=b[r]??Object.values(b).find(y=>typeof y=="function"&&a5(y)===r);if(typeof N!="function")throw new Error(`Invalid identifer: ${c} -> ${s}`);let g=await Hte.call({...this,path:[...a,"kwargs"]},i.kwargs);if(i.type==="constructor"){let y=new N(m8(g,D$e,Hjn(N)));return Object.defineProperty(y.constructor,"name",{value:r}),y}else throw new Error(`Invalid type: ${c} -> ${s}`)}else if(typeof t=="object"&&t!==null)return Array.isArray(t)?Promise.all(t.map((i,s)=>Hte.call({...this,path:[...a,`${s}`]},i))):Object.fromEntries(await Promise.all(Object.entries(t).map(async([i,s])=>[i,await Hte.call({...this,path:[...a,i]},s)])));return t}async function Fot(t,e){let n=JSON.parse(t);return Hte.call({...e},n)}var vot=["langchain/agents/load","langchain/agents/toolkits/sql","langchain/tools/sql","langchain/tools/webbrowser","langchain/chains/load","langchain/chains/query_constructor","langchain/chains/query_constructor/ir","langchain/chains/sql_db","langchain/chains/graph_qa/cypher","langchain/chat_models/universal","langchain/document_loaders/fs/buffer","langchain/document_loaders/fs/directory","langchain/document_loaders/fs/json","langchain/document_loaders/fs/multi_file","langchain/document_loaders/fs/text","langchain/sql_db","langchain/output_parsers/expression","langchain/retrievers/self_query","langchain/retrievers/self_query/functional","langchain/cache/file_system","langchain/stores/file/node","langchain/storage/file_system","langchain/hub","langchain/hub/node","langchain/experimental/prompts/handlebars"];var rEe={};Xe(rEe,{agents:()=>gfe,agents__format_scratchpad:()=>mfe,agents__format_scratchpad__log:()=>dfe,agents__format_scratchpad__log_to_message:()=>Rfe,agents__format_scratchpad__openai_tools:()=>Vfe,agents__format_scratchpad__xml:()=>Wfe,agents__openai__output_parser:()=>Gfe,agents__react__output_parser:()=>Yfe,agents__toolkits:()=>Nfe,agents__xml__output_parser:()=>hfe,callbacks:()=>EHe,chains:()=>GHe,chains__combine_documents:()=>bHe,chains__combine_documents__reduce:()=>mHe,chains__history_aware_retriever:()=>pHe,chains__openai_functions:()=>NHe,chains__retrieval:()=>VHe,chat_models__azure_openai:()=>XSn,chat_models__openai:()=>fSn,document_loaders__base:()=>HHe,document_transformers__openai_functions:()=>QHe,embeddings__azure_openai:()=>ESn,embeddings__cache_backed:()=>yHe,embeddings__fake:()=>AHe,embeddings__openai:()=>QSn,evaluation:()=>kQe,experimental__autogpt:()=>ZQe,experimental__babyagi:()=>gQe,experimental__chains__violation_of_expectations:()=>XQe,experimental__generative_agents:()=>yQe,experimental__masking:()=>wQe,experimental__openai_assistant:()=>NQe,experimental__openai_files:()=>YQe,experimental__plan_and_execute:()=>FQe,experimental__prompts__custom_format:()=>QQe,indexes:()=>nEe,llms__azure_openai:()=>HSn,llms__openai:()=>wSn,memory:()=>XHe,memory__chat_memory:()=>ofe,output_parsers:()=>JHe,prompts__base:()=>OSn,prompts__chat:()=>kSn,prompts__image:()=>xSn,prompts__pipeline:()=>jSn,prompts__prompt:()=>JSn,retrievers__contextual_compression:()=>LHe,retrievers__document_compressors:()=>xHe,retrievers__document_compressors__chain_extract:()=>qHe,retrievers__document_compressors__embeddings_filter:()=>eQe,retrievers__ensemble:()=>OHe,retrievers__hyde:()=>nQe,retrievers__matryoshka_retriever:()=>rQe,retrievers__multi_query:()=>BHe,retrievers__multi_vector:()=>SHe,retrievers__parent_document:()=>THe,retrievers__score_threshold:()=>IQe,retrievers__time_weighted:()=>KHe,runnables__remote:()=>_Qe,schema:()=>LSn,schema__messages:()=>CSn,schema__output:()=>BSn,schema__output_parser:()=>zSn,schema__prompt_template:()=>aEe,schema__query_constructor:()=>IEe,schema__runnable:()=>USn,smith:()=>MQe,storage__encoder_backed:()=>gHe,storage__in_memory:()=>GQe,stores__doc__base:()=>cQe,stores__doc__in_memory:()=>sQe,stores__file__in_memory:()=>dQe,stores__message__in_memory:()=>cfe,text_splitter:()=>ffe,tools:()=>Afe,tools__chain:()=>yfe,tools__render:()=>ufe,tools__retriever:()=>Ffe,util__document:()=>rfe,util__math:()=>FHe,util__time:()=>mQe,vectorstores__memory:()=>fHe});var gfe={};Xe(gfe,{Agent:()=>$m,AgentActionOutputParser:()=>li,AgentExecutor:()=>Sc,BaseMultiActionAgent:()=>HB,BaseSingleActionAgent:()=>qy,ChatAgent:()=>tA,ChatAgentOutputParser:()=>FL,ChatConversationalAgent:()=>WQ,ChatConversationalAgentOutputParser:()=>vL,ChatConversationalAgentOutputParserWithRetries:()=>ZQ,JsonToolkit:()=>Iv,LLMSingleActionAgent:()=>Ste,OpenAIAgent:()=>wL,OpenApiToolkit:()=>gL,RequestsToolkit:()=>mQ,RunnableAgent:()=>Bte,StructuredChatAgent:()=>cv,StructuredChatOutputParser:()=>fL,StructuredChatOutputParserWithRetries:()=>rv,Toolkit:()=>Yh,VectorStoreRouterToolkit:()=>yL,VectorStoreToolkit:()=>RL,XMLAgent:()=>QL,ZeroShotAgent:()=>ed,ZeroShotAgentOutputParser:()=>pL,createJsonAgent:()=>NL,createOpenAIFunctionsAgent:()=>Rit,createOpenAIToolsAgent:()=>fit,createOpenApiAgent:()=>Dte,createReactAgent:()=>Qit,createStructuredChatAgent:()=>Yit,createToolCallingAgent:()=>Xit,createVectorStoreAgent:()=>Kte,createVectorStoreRouterAgent:()=>_te,createXmlAgent:()=>Ait,initializeAgentExecutor:()=>Fit,initializeAgentExecutorWithOptions:()=>nne});TZ();var Nfe={};Xe(Nfe,{JsonToolkit:()=>Iv,OpenAIAgentTokenBufferMemory:()=>EL,OpenApiToolkit:()=>gL,RequestsToolkit:()=>mQ,VectorStoreRouterToolkit:()=>yL,VectorStoreToolkit:()=>RL,createConversationalRetrievalAgent:()=>vit,createJsonAgent:()=>NL,createOpenApiAgent:()=>Dte,createRetrieverTool:()=>oit,createVectorStoreAgent:()=>Kte,createVectorStoreRouterAgent:()=>_te});mG();var Ife=$(lfe(),1);dQ();mG();var Tte=class extends XI{constructor(e,n=4e3){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","tools","json"]}),Object.defineProperty(this,"obj",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxValueLength",{enumerable:!0,configurable:!0,writable:!0,value:4e3}),this.obj=e,this.maxValueLength=n}getKeys(e){let l=Ife.default.compile(e).get(this.obj);if(typeof l=="object"&&!Array.isArray(l)&&l!==null)return Object.keys(l).map(I=>I.replaceAll("~","~0").replaceAll("/","~1")).join(", ");throw new Error(`Value at ${e} is not a dictionary, get the value directly instead.`)}getValue(e){let l=Ife.default.compile(e).get(this.obj);if(l==null)throw new Error(`Value at ${e} is null or undefined.`);let I=typeof l=="object"?JSON.stringify(l):l.toString();return typeof l=="object"&&!Array.isArray(l)&&I.length>this.maxValueLength?"Value is a large dictionary, should explore its keys directly.":I.length>this.maxValueLength?`${I.slice(0,this.maxValueLength)}...`:I}},ZL=class extends $u{static lc_name(){return"JsonListKeysTool"}constructor(e){"jsonSpec"in e||(e={jsonSpec:e}),super(e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"json_list_keys"}),Object.defineProperty(this,"jsonSpec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:`Can be used to list all keys at a given path. + Before calling this you should be SURE that the path to this exists. + The input is a text representation of the path to the json as json pointer syntax (e.g. /key1/0/key2).`}),this.jsonSpec=e.jsonSpec}async _call(e){try{return this.jsonSpec.getKeys(e)}catch(n){return`${n}`}}},WL=class extends $u{static lc_name(){return"JsonGetValueTool"}constructor(e){super(),Object.defineProperty(this,"jsonSpec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"json_get_value"}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:`Can be used to see value in string format at a given path. + Before calling this you should be SURE that the path to this exists. + The input is a text representation of the path to the json as json pointer syntax (e.g. /key1/0/key2).`})}async _call(e){try{return this.jsonSpec.getValue(e)}catch(n){return`${n}`}}};var tit=`You are an agent designed to interact with JSON. +Your goal is to return a final answer by interacting with the JSON. +You have access to the following tools which help you learn more about the JSON you are interacting with. +Only use the below tools. Only use the information returned by the below tools to construct your final answer. +Do not make up any information that is not contained in the JSON. +Your input to the tools should be in the form of in json pointer syntax (e.g. /key1/0/key2). +You must escape a slash in a key with a ~1, and escape a tilde with a ~0. +For example, to access the key /foo, you would use /~1foo +You should only use keys that you know for a fact exist. You must validate that a key exists by seeing it previously when calling 'json_list_keys'. +If you have not seen a key in one of those responses, you cannot use it. +You should only add one key at a time to the path. You cannot add multiple keys at once. +If you encounter a null or undefined value, go back to the previous key, look at the available keys, and try again. + +If the question does not seem to be related to the JSON, just return "I don't know" as the answer. +Always begin your interaction with the 'json_list_keys' with an empty string as the input to see what keys exist in the JSON. + +Note that sometimes the value at a given path is large. In this case, you will get an error "Value is a large dictionary, should explore its keys directly". +In this case, you should ALWAYS follow up by using the 'json_list_keys' tool to see what keys exist at that path. +Do not simply refer the user to the JSON or a section of the JSON, as this is not a valid answer. Keep digging until you find the answer and explicitly return it.`,nit=`Begin!" + +Question: {input} +Thought: I should look at the keys that exist to see what I can query. I should use the 'json_list_keys' tool with an empty string as the input. +{agent_scratchpad}`;Dl();bQ();mG();Bo();_ve();Ul();dQ();TZ();fo();var afe=class extends XI{get finalOutputs(){return this._finalOutputs}async setFinalOutputs(e){if(this._finalOutputs=void 0,e){let n=await this.agentExecutor.prepOutputs(this.inputs,e,!0);this._finalOutputs=n}}get nameToToolMap(){let e=this.agentExecutor.tools.map(n=>({[n.name]:n}));return Object.assign({},...e)}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","executor_iterator"]}),Object.defineProperty(this,"agentExecutor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputs",{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,"callbacks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{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,"runName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_finalOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"intermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"iterations",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.agentExecutor=e.agentExecutor,this.inputs=e.inputs,this.callbacks=e.callbacks,this.tags=e.tags,this.metadata=e.metadata,this.runName=e.runName,this.runManager=e.runManager,this.config=e.config}reset(){this.intermediateSteps=[],this.iterations=0,this._finalOutputs=void 0}updateIterations(){this.iterations+=1}async*streamIterator(){for(this.reset();;)try{this.iterations===0&&await this.onFirstStep(),yield await this._callNext()}catch(e){if("message"in e&&e.message.startsWith("Final outputs already reached: ")){if(!this.finalOutputs)throw e;return this.finalOutputs}throw this.runManager&&await this.runManager.handleChainError(e),e}}async onFirstStep(){if(this.iterations===0){let e=await Lr.configure(this.callbacks??this.config?.callbacks,this.agentExecutor.callbacks,this.tags??this.config?.tags,this.agentExecutor.tags,this.metadata??this.config?.metadata,this.agentExecutor.metadata,{verbose:this.agentExecutor.verbose});this.runManager=await e?.handleChainStart(this.agentExecutor.toJSON(),this.inputs,this.config?.runId,void 0,this.tags??this.config?.tags,this.metadata??this.config?.metadata,this.runName??this.config?.runName),this.config!==void 0&&delete this.config.runId}}async _executeNextStep(e){return this.agentExecutor._takeNextStep(this.nameToToolMap,this.inputs,this.intermediateSteps,e,this.config)}async _processNextStepOutput(e,n){if("returnValues"in e){let I=await this.agentExecutor._return(e,this.intermediateSteps,n);return this.runManager&&await this.runManager.handleChainEnd(I),await this.setFinalOutputs(I),I}this.intermediateSteps=this.intermediateSteps.concat(e);let l={};if(Array.isArray(e)&&e.length===1){let I=e[0],a=await this.agentExecutor._getToolReturn(I);a&&(l=await this.agentExecutor._return(a,this.intermediateSteps,n),await this.runManager?.handleChainEnd(l),await this.setFinalOutputs(l))}return l={intermediateSteps:e},l}async _stop(){let e=await this.agentExecutor.agent.returnStoppedResponse(this.agentExecutor.earlyStoppingMethod,this.intermediateSteps,this.inputs),n=await this.agentExecutor._return(e,this.intermediateSteps,this.runManager);return await this.setFinalOutputs(n),await this.runManager?.handleChainEnd(n),n}async _callNext(){if(this.finalOutputs)throw new Error(`Final outputs already reached: ${JSON.stringify(this.finalOutputs,null,2)}`);if(!this.agentExecutor.shouldContinueGetter(this.iterations))return this._stop();let e=await this._executeNextStep(this.runManager),n=await this._processNextStepOutput(e,this.runManager);return this.updateIterations(),n}},QB=class extends $u{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"_Exception"}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:"Exception tool"})}async _call(e){return e}},Sc=class t extends cn{static lc_name(){return"AgentExecutor"}get lc_namespace(){return["langchain","agents","executor"]}get inputKeys(){return this.agent.inputKeys}get outputKeys(){return this.agent.returnValues}constructor(e){let n,l=!0;if(Zn.isRunnable(e.agent)?(ob.isAgentRunnableSequence(e.agent)?e.agent.singleAction?n=new zte({runnable:e.agent,streamRunnable:e.agent.streamRunnable}):n=new hL({runnable:e.agent,streamRunnable:e.agent.streamRunnable}):n=new hL({runnable:e.agent}),l=!1):(Pot(e.agent)&&(l=!1),n=e.agent),super(e),Object.defineProperty(this,"agent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnIntermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxIterations",{enumerable:!0,configurable:!0,writable:!0,value:15}),Object.defineProperty(this,"earlyStoppingMethod",{enumerable:!0,configurable:!0,writable:!0,value:"force"}),Object.defineProperty(this,"returnOnlyOutputs",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"handleParsingErrors",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handleToolRuntimeErrors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.agent=n,this.tools=e.tools,this.handleParsingErrors=e.handleParsingErrors??this.handleParsingErrors,this.handleToolRuntimeErrors=e.handleToolRuntimeErrors,this.returnOnlyOutputs=l,this.agent._agentActionType()==="multi"){for(let I of this.tools)if(I.returnDirect)throw new Error(`Tool with return direct ${I.name} not supported for multi-action agent.`)}this.returnIntermediateSteps=e.returnIntermediateSteps??this.returnIntermediateSteps,this.maxIterations=e.maxIterations??this.maxIterations,this.earlyStoppingMethod=e.earlyStoppingMethod??this.earlyStoppingMethod}static fromAgentAndTools(e){return new t(e)}get shouldContinueGetter(){return this.shouldContinue.bind(this)}shouldContinue(e){return this.maxIterations===void 0||e[r.name.toLowerCase(),r])),a=[],c=0,i=async r=>{let{returnValues:u}=r,o=await this.agent.prepareForOutput(u,a);await n?.handleAgentEnd(r);let d;return this.returnIntermediateSteps?d={...u,intermediateSteps:a,...o}:d={...u,...o},this.returnOnlyOutputs||(d={...e,...d}),d};for(;this.shouldContinue(c);){let r;try{r=await this.agent.plan(a,e,n?.getChild(),l)}catch(h){if(h instanceof $t){let Z,N=h.message;if(this.handleParsingErrors===!0)h.sendToLLM?(Z=h.observation,N=h.llmOutput??""):Z="Invalid or incomplete response";else if(typeof this.handleParsingErrors=="string")Z=this.handleParsingErrors;else if(typeof this.handleParsingErrors=="function")Z=this.handleParsingErrors(h);else throw h;r={tool:"_Exception",toolInput:Z,log:N}}else throw h}if("returnValues"in r)return i(r);let u;Array.isArray(r)?u=r:u=[r];let o=await Promise.all(u.map(async h=>{await n?.handleAgentAction(h);let Z=h.tool==="_Exception"?new QB:I[h.tool?.toLowerCase()],N;try{if(N=Z?await Z.invoke(h.toolInput,wI(l,{callbacks:n?.getChild()})):`${h.tool} is not a valid tool, try another one.`,typeof N!="string")throw new Error("Received unsupported non-string response from tool call.")}catch(g){if(g instanceof yZ){if(this.handleParsingErrors===!0)N="Invalid or incomplete tool input. Please try again.";else if(typeof this.handleParsingErrors=="string")N=this.handleParsingErrors;else if(typeof this.handleParsingErrors=="function")N=this.handleParsingErrors(g);else throw g;return N=await new QB().call(N,n?.getChild()),{action:h,observation:N??""}}else this.handleToolRuntimeErrors!==void 0&&(N=this.handleToolRuntimeErrors(g))}return{action:h,observation:N??""}}));a.push(...o);let d=a[a.length-1];if(I[d.action.tool?.toLowerCase()]?.returnDirect)return i({returnValues:{[this.agent.returnValues[0]]:d.observation},log:""});c+=1}let s=await this.agent.returnStoppedResponse(this.earlyStoppingMethod,a,e);return i(s)}async _takeNextStep(e,n,l,I,a){let c;try{c=await this.agent.plan(l,n,I?.getChild(),a)}catch(r){if(r instanceof $t){let u,o=r.message;if(this.handleParsingErrors===!0)r.sendToLLM?(u=r.observation,o=r.llmOutput??""):u="Invalid or incomplete response";else if(typeof this.handleParsingErrors=="string")u=this.handleParsingErrors;else if(typeof this.handleParsingErrors=="function")u=this.handleParsingErrors(r);else throw r;c={tool:"_Exception",toolInput:u,log:o}}else throw r}if("returnValues"in c)return c;let i;Array.isArray(c)?i=c:i=[c];let s=[];for(let r of i){let u="";if(I&&await I?.handleAgentAction(r),r.tool in e){let o=e[r.tool];try{if(u=await o.call(r.toolInput,I?.getChild()),typeof u!="string")throw new Error("Received unsupported non-string response from tool call.")}catch(d){if(d instanceof yZ){if(this.handleParsingErrors===!0)u="Invalid or incomplete tool input. Please try again.";else if(typeof this.handleParsingErrors=="string")u=this.handleParsingErrors;else if(typeof this.handleParsingErrors=="function")u=this.handleParsingErrors(d);else throw d;u=await new QB().call(u,I?.getChild())}}}else u=`${r.tool} is not a valid tool, try another available tool: ${Object.keys(e).join(", ")}`;s.push({action:r,observation:u})}return s}async _return(e,n,l){l&&await l.handleAgentEnd(e);let I=e.returnValues;return this.returnIntermediateSteps&&(I.intermediateSteps=n),I}async _getToolReturn(e){let{action:n,observation:l}=e,I=Object.fromEntries(this.tools.map(c=>[c.name.toLowerCase(),c])),[a="output"]=this.agent.returnValues;return n.tool in I&&I[n.tool].returnDirect?{returnValues:{[a]:l},log:""}:null}_returnStoppedResponse(e){if(e==="force")return{returnValues:{output:"Agent stopped due to iteration limit or time limit."},log:""};throw new Error(`Got unsupported early_stopping_method: ${e}`)}async*_streamIterator(e,n){let I=new afe({inputs:e,agentExecutor:this,config:n,metadata:n?.metadata,tags:n?.tags,callbacks:n?.callbacks}).streamIterator();for await(let a of I)a&&(yield a)}_chainType(){return"agent_executor"}serialize(){throw new Error("Cannot serialize an AgentExecutor")}};var Iv=class extends Yh{constructor(e){super(),Object.defineProperty(this,"jsonSpec",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tools=[new ZL(e),new WL(e)]}};function NL(t,e,n){let{prefix:l=tit,suffix:I=nit,inputVariables:a=["input","agent_scratchpad"]}=n??{},{tools:c}=e,i=ed.createPrompt(c,{prefix:l,suffix:I,inputVariables:a}),s=new ze({prompt:i,llm:t}),r=new ed({llmChain:s,allowedTools:c.map(u=>u.name)});return Sc.fromAgentAndTools({agent:r,tools:c,returnIntermediateSteps:!0})}mG();var lit=`You are an agent designed to answer questions by making web requests to an API given the OpenAPI spec. + +If the question does not seem related to the API, return I don't know. Do not make up an answer. +Only use information provided by the tools to construct your response. + +To find information in the OpenAPI spec, use the 'json_explorer' tool. The input to this tool is a question about the API. + +Take the following steps: +First, find the base URL needed to make the request. + +Second, find the relevant paths needed to answer the question. Take note that, sometimes, you might need to make more than one request to more than one path to answer the question. + +Third, find the required parameters needed to make the request. For GET requests, these are usually URL parameters and for POST requests, these are request body parameters. + +Fourth, make the requests needed to answer the question. Ensure that you are sending the correct parameters to the request by checking which parameters are required. For parameters with a fixed set of values, please use the spec to look at which values are allowed. + +Use the exact parameter names as listed in the spec, do not make up any names or abbreviate the names of parameters. +If you get a not found error, ensure that you are using a path that actually exists in the spec.`,Iit=`Begin!" + +Question: {input} +Thought: I should explore the spec to find the base url for the API. +{agent_scratchpad}`,ait=` +Can be used to answer questions about the openapi spec for the API. Always use this tool before trying to make a request. +Example inputs to this tool: + 'What are the required query parameters for a GET request to the /bar endpoint?' + 'What are the required parameters in the request body for a POST request to the /foo endpoint?' +Always give this tool a specific question.`;Dl();bQ();mG();var VL=class extends $u{static lc_name(){return"RequestsGetTool"}constructor(e={},{maxOutputLength:n}={}){super(...arguments),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"requests_get"}),Object.defineProperty(this,"maxOutputLength",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:`A portal to the internet. Use this when you need to get specific content from a website. + Input should be a url string (i.e. "https://www.google.com"). The output will be the text response of the GET request.`}),this.maxOutputLength=n??this.maxOutputLength}async _call(e){return(await(await fetch(e,{headers:this.headers})).text()).slice(0,this.maxOutputLength)}},YL=class extends $u{static lc_name(){return"RequestsPostTool"}constructor(e={},{maxOutputLength:n}={}){super(...arguments),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"requests_post"}),Object.defineProperty(this,"maxOutputLength",{enumerable:!0,configurable:!0,writable:!0,value:1/0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:`Use this when you want to POST to a website. + Input should be a json string with two keys: "url" and "data". + The value of "url" should be a string, and the value of "data" should be a dictionary of + key-value pairs you want to POST to the url as a JSON body. + Be careful to always use double quotes for strings in the json string + The output will be the text response of the POST request.`}),this.maxOutputLength=n??this.maxOutputLength}async _call(e){try{let{url:n,data:l}=JSON.parse(e);return(await(await fetch(n,{method:"POST",headers:this.headers,body:JSON.stringify(l)})).text()).slice(0,this.maxOutputLength)}catch(n){return`${n}`}}};var mQ=class extends Yh{constructor(e){super(),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tools=[new VL(e),new YL(e)]}},gL=class extends mQ{constructor(e,n,l){super(l);let I=NL(n,new Iv(e));this.tools=[...this.tools,new MN({name:"json_explorer",func:async a=>(await I.call({input:a})).output,description:ait})]}};function Dte(t,e,n){let{prefix:l=lit,suffix:I=Iit,inputVariables:a=["input","agent_scratchpad"]}=n??{},{tools:c}=e,i=ed.createPrompt(c,{prefix:l,suffix:I,inputVariables:a}),s=new ze({prompt:i,llm:t}),r=c.map(o=>o.name),u=new ed({llmChain:s,allowedTools:r});return Sc.fromAgentAndTools({agent:u,tools:c,returnIntermediateSteps:!0})}mG();mG();Lte();var $y=class extends $u{static lc_name(){return"VectorStoreQATool"}constructor(e,n,l){super(...arguments),Object.defineProperty(this,"vectorStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"llm",{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,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e,this.description=n,this.vectorStore=l.vectorStore,this.llm=l.llm,this.chain=lv.fromLLM(this.llm,this.vectorStore)}static getDescription(e,n){return`Useful for when you need to answer questions about ${e}. Whenever you need information about ${n} you should ALWAYS use this. Input should be a fully formed question.`}async _call(e){return this.chain.run(e)}};bQ();var rit=`You are an agent designed to answer questions about sets of documents. +You have access to tools for interacting with the documents, and the inputs to the tools are questions. +Sometimes, you will be asked to provide sources for your questions, in which case you should use the appropriate tool to do so. +If the question does not seem relevant to any of the tools provided, just return "I don't know" as the answer.`,cit=`You are an agent designed to answer questions. +You have access to tools for interacting with different sources, and the inputs to the tools are questions. +Your main task is to decide which of the tools is relevant for answering question at hand. +For complex questions, you can break the question down into sub questions and use tools to answers the sub questions.`;Ote();Dl();var RL=class extends Yh{constructor(e,n){super(),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"llm",{enumerable:!0,configurable:!0,writable:!0,value:void 0});let l=$y.getDescription(e.name,e.description);this.llm=n,this.tools=[new $y(e.name,l,{vectorStore:e.vectorStore,llm:this.llm})]}},yL=class extends Yh{constructor(e,n){super(),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"vectorStoreInfos",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"llm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llm=n,this.vectorStoreInfos=e,this.tools=e.map(l=>{let I=$y.getDescription(l.name,l.description);return new $y(l.name,I,{vectorStore:l.vectorStore,llm:this.llm})})}};function Kte(t,e,n){let{prefix:l=rit,suffix:I=wB,inputVariables:a=["input","agent_scratchpad"]}=n??{},{tools:c}=e,i=ed.createPrompt(c,{prefix:l,suffix:I,inputVariables:a}),s=new ze({prompt:i,llm:t}),r=new ed({llmChain:s,allowedTools:c.map(u=>u.name)});return Sc.fromAgentAndTools({agent:r,tools:c,returnIntermediateSteps:!0})}function _te(t,e,n){let{prefix:l=cit,suffix:I=wB,inputVariables:a=["input","agent_scratchpad"]}=n??{},{tools:c}=e,i=ed.createPrompt(c,{prefix:l,suffix:I,inputVariables:a}),s=new ze({prompt:i,llm:t}),r=new ed({llmChain:s,allowedTools:c.map(u=>u.name)});return Sc.fromAgentAndTools({agent:r,tools:c,returnIntermediateSteps:!0})}ab();mG();var rfe={};Xe(rfe,{formatDocumentsAsString:()=>pQ});var pQ=t=>t.map(e=>e.pageContent).join(` + +`);function oit(t,e){let n=async({input:I},a)=>{let c=await t.getRelevantDocuments(I,a?.getChild("retriever"));return pQ(c)},l=St.object({input:St.string().describe("Natural language query used as input to the retriever")});return new TN({...e,func:n,schema:l})}Vr();Vr();Dl();yn();var dOn=`Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary. + +EXAMPLE +Current summary: +The human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good. + +New lines of conversation: +Human: Why do you think artificial intelligence is a force for good? +AI: Because artificial intelligence will help humans reach their full potential. + +New summary: +The human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good because it will help humans reach their full potential. +END OF EXAMPLE + +Current summary: +{summary} + +New lines of conversation: +{new_lines} + +New summary:`,iit=new xe({inputVariables:["summary","new_lines"],template:dOn}),GOn=`You are an assistant to a human, powered by a large language model trained by OpenAI. + +You are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. + +You are constantly learning and improving, and your capabilities are constantly evolving. You are able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. You have access to some personalized information provided by the human in the Context section below. Additionally, you are able to generate your own text based on the input you receive, allowing you to engage in discussions and provide explanations and descriptions on a wide range of topics. + +Overall, you are a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether the human needs help with a specific question or just wants to have a conversation about a particular topic, you are here to assist. + +Context: +{entities} + +Current conversation: +{history} +Last line: +Human: {input} +You:`,sit=new xe({inputVariables:["entities","history","input"],template:GOn}),bOn=`You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places. + +The conversation history is provided just in case of a coreference (e.g. "What do you know about him" where "him" is defined in a previous line) -- ignore items mentioned there that are not in the last line. + +Return the output as a single comma-separated list, or NONE if there is nothing of note to return (e.g. the user is just issuing a greeting or having a simple conversation). + +EXAMPLE +Conversation history: +Person #1: my name is Jacob. how's it going today? +AI: "It's going great! How about you?" +Person #1: good! busy working on Langchain. lots to do. +AI: "That sounds like a lot of work! What kind of things are you doing to make Langchain better?" +Last line: +Person #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff. +Output: Jacob,Langchain +END OF EXAMPLE + +EXAMPLE +Conversation history: +Person #1: how's it going today? +AI: "It's going great! How about you?" +Person #1: good! busy working on Langchain. lots to do. +AI: "That sounds like a lot of work! What kind of things are you doing to make Langchain better?" +Last line: +Person #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff. I'm working with Person #2. +Output: Langchain, Person #2 +END OF EXAMPLE + +Conversation history (for reference only): +{history} +Last line of conversation (for extraction): +Human: {input} + +Output:`,uit=new xe({inputVariables:["history","input"],template:bOn}),mOn=`You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the "Entity" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence. +The update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity. + +If there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), output the exact string "UNCHANGED" below. + +Full conversation history (for context): +{history} + +Entity to summarize: +{entity} + +Existing summary of {entity}: +{summary} + +Last line of conversation: +Human: {input} +Updated summary (or the exact string "UNCHANGED" if there is no new information about {entity} above):`,dit=new xe({inputVariables:["entity","summary","history","input"],template:mOn});var ofe={};Xe(ofe,{BaseChatMemory:()=>td});var cfe={};Xe(cfe,{ChatMessageHistory:()=>Ty});var td=class extends BN{constructor(e){super(),Object.defineProperty(this,"chatHistory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnMessages",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.chatHistory=e?.chatHistory??new Ty,this.returnMessages=e?.returnMessages??this.returnMessages,this.inputKey=e?.inputKey??this.inputKey,this.outputKey=e?.outputKey??this.outputKey}async saveContext(e,n){await this.chatHistory.addUserMessage(_y(e,this.inputKey)),await this.chatHistory.addAIChatMessage(iQ(n,this.outputKey))}async clear(){await this.chatHistory.clear()}};var hQ=class extends td{constructor(e){let{returnMessages:n,inputKey:l,outputKey:I,chatHistory:a,humanPrefix:c,aiPrefix:i,llm:s,prompt:r,summaryChatMessageClass:u}=e;super({returnMessages:n,inputKey:l,outputKey:I,chatHistory:a}),Object.defineProperty(this,"memoryKey",{enumerable:!0,configurable:!0,writable:!0,value:"history"}),Object.defineProperty(this,"humanPrefix",{enumerable:!0,configurable:!0,writable:!0,value:"Human"}),Object.defineProperty(this,"aiPrefix",{enumerable:!0,configurable:!0,writable:!0,value:"AI"}),Object.defineProperty(this,"llm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prompt",{enumerable:!0,configurable:!0,writable:!0,value:iit}),Object.defineProperty(this,"summaryChatMessageClass",{enumerable:!0,configurable:!0,writable:!0,value:Xr}),this.memoryKey=e?.memoryKey??this.memoryKey,this.humanPrefix=c??this.humanPrefix,this.aiPrefix=i??this.aiPrefix,this.llm=s,this.prompt=r??this.prompt,this.summaryChatMessageClass=u??this.summaryChatMessageClass}async predictNewSummary(e,n){let l=mr(e,this.humanPrefix,this.aiPrefix);return await new ze({llm:this.llm,prompt:this.prompt}).predict({summary:n,new_lines:l})}},Pte=class extends hQ{constructor(e){super(e),Object.defineProperty(this,"buffer",{enumerable:!0,configurable:!0,writable:!0,value:""})}get memoryKeys(){return[this.memoryKey]}async loadMemoryVariables(e){return this.returnMessages?{[this.memoryKey]:[new this.summaryChatMessageClass(this.buffer)]}:{[this.memoryKey]:this.buffer}}async saveContext(e,n){await super.saveContext(e,n);let l=await this.chatHistory.getMessages();this.buffer=await this.predictNewSummary(l.slice(-2),this.buffer)}async clear(){await super.clear(),this.buffer=""}};var AL=class extends hQ{constructor(e){super(e),Object.defineProperty(this,"movingSummaryBuffer",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"maxTokenLimit",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),this.maxTokenLimit=e?.maxTokenLimit??this.maxTokenLimit}get memoryKeys(){return[this.memoryKey]}async loadMemoryVariables(e){let n=await this.chatHistory.getMessages();this.movingSummaryBuffer&&(n=[new this.summaryChatMessageClass(this.movingSummaryBuffer),...n]);let l;return this.returnMessages?l=n:l=mr(n,this.humanPrefix,this.aiPrefix),{[this.memoryKey]:l}}async saveContext(e,n){await super.saveContext(e,n),await this.prune()}async prune(){let e=await this.chatHistory.getMessages();this.movingSummaryBuffer&&(e=[new this.summaryChatMessageClass(this.movingSummaryBuffer),...e]);let n=await this.llm.getNumTokens(mr(e,this.humanPrefix,this.aiPrefix));if(n>this.maxTokenLimit){let l=[];for(;n>this.maxTokenLimit;){let I=e.shift();I&&(l.push(I),n=await this.llm.getNumTokens(mr(e,this.humanPrefix,this.aiPrefix)))}this.movingSummaryBuffer=await this.predictNewSummary(l,this.movingSummaryBuffer)}}async clear(){await super.clear(),this.movingSummaryBuffer=""}};Vr();var eA=class extends td{constructor(e){super({chatHistory:e?.chatHistory,returnMessages:e?.returnMessages??!1,inputKey:e?.inputKey,outputKey:e?.outputKey}),Object.defineProperty(this,"humanPrefix",{enumerable:!0,configurable:!0,writable:!0,value:"Human"}),Object.defineProperty(this,"aiPrefix",{enumerable:!0,configurable:!0,writable:!0,value:"AI"}),Object.defineProperty(this,"memoryKey",{enumerable:!0,configurable:!0,writable:!0,value:"history"}),this.humanPrefix=e?.humanPrefix??this.humanPrefix,this.aiPrefix=e?.aiPrefix??this.aiPrefix,this.memoryKey=e?.memoryKey??this.memoryKey}get memoryKeys(){return[this.memoryKey]}async loadMemoryVariables(e){let n=await this.chatHistory.getMessages();return this.returnMessages?{[this.memoryKey]:n}:{[this.memoryKey]:mr(n,this.humanPrefix,this.aiPrefix)}}};yn();Dl();TZ();Ul();KN();var Git="Answer the following questions as best you can. You have access to the following tools:",qte=`The way you use the tools is by specifying a json blob, denoted below by $JSON_BLOB +Specifically, this $JSON_BLOB should have a "action" key (with the name of the tool to use) and a "action_input" key (with the input to the tool going here). +The $JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. Here is an example of a valid $JSON_BLOB: + +\`\`\` +{{ + "action": "calculator", + "action_input": "1 + 2" +}} +\`\`\` + +ALWAYS use the following format: + +Question: the input question you must answer +Thought: you should always think about what to do +Action: +\`\`\` +$JSON_BLOB +\`\`\` +Observation: the result of the action +... (this Thought/Action/Observation can repeat N times) +Thought: I now know the final answer +Final Answer: the final answer to the original input question`,bit="Begin! Reminder to always use the exact characters `Final Answer` when responding.";var mit="Final Answer:",FL=class extends li{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","chat"]})}async parse(e){if(e.includes(mit)||!e.includes('"action":')){let l=e.split(mit);return{returnValues:{output:l[l.length-1].trim()},log:e}}let n=e.includes("```")?e.trim().split(/```(?:json)?/)[1]:e.trim();try{let l=JSON.parse(n.trim());return{tool:l.action,toolInput:l.action_input,log:e}}catch{throw new $t(`Unable to parse JSON response from chat agent. + +${e}`)}}getFormatInstructions(){return qte}};var pOn=`{input} + +{agent_scratchpad}`,tA=class t extends $m{static lc_name(){return"ChatAgent"}constructor(e){let n=e?.outputParser??t.getDefaultOutputParser();super({...e,outputParser:n}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","chat"]})}_agentType(){return"chat-zero-shot-react-description"}observationPrefix(){return"Observation: "}llmPrefix(){return"Thought:"}_stop(){return["Observation:"]}static validateTools(e){let n=e.find(l=>!l.description);if(n){let l=`Got a tool ${n.name} without a description. This agent requires descriptions for all tools.`;throw new Error(l)}}static getDefaultOutputParser(e){return new FL}async constructScratchPad(e){let n=await super.constructScratchPad(e);return n&&`This was your previous work (but I haven't seen any of it! I only see what you return as final answer): +${n}`}static createPrompt(e,n){let{prefix:l=Git,suffix:I=bit,humanMessageTemplate:a=pOn,formatInstructions:c=qte}=n??{},i=e.map(u=>`${u.name}: ${u.description}`).join(` +`),s=[l,i,c,I].join(` + +`),r=[kr.fromTemplate(s),RI.fromTemplate(a)];return HI.fromMessages(r)}static fromLLMAndTools(e,n,l){t.validateTools(n);let I=t.createPrompt(n,l),a=new ze({prompt:I,llm:e,callbacks:l?.callbacks??l?.callbackManager}),c=l?.outputParser??t.getDefaultOutputParser();return new t({llmChain:a,outputParser:c,allowedTools:n.map(i=>i.name)})}};yn();Vr();Dl();TZ();Ul();yn();KN();var pit=`Assistant is a large language model trained by OpenAI. + +Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. + +Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. + +Overall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.`,hit=" However, above all else, all responses must adhere to the format of RESPONSE FORMAT INSTRUCTIONS.",$te=`RESPONSE FORMAT INSTRUCTIONS +---------------------------- + +Output a JSON markdown code snippet containing a valid JSON object in one of two formats: + +**Option 1:** +Use this if you want the human to use a tool. +Markdown code snippet formatted in the following schema: + +\`\`\`json +{{{{ + "action": string, // The action to take. Must be one of [{tool_names}] + "action_input": string // The input to the action. May be a stringified object. +}}}} +\`\`\` + +**Option #2:** +Use this if you want to respond directly and conversationally to the human. Markdown code snippet formatted in the following schema: + +\`\`\`json +{{{{ + "action": "Final Answer", + "action_input": string // You should put what you want to return to user here and make sure to use valid json newline characters. +}}}} +\`\`\` + +For both options, remember to always include the surrounding markdown code snippet delimiters (begin with "\`\`\`json" and end with "\`\`\`")! +`,Zit=`TOOLS +------ +Assistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are: + +{tools} + +{format_instructions} + +USER'S INPUT +-------------------- +Here is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else): + +{{input}}`,ene=`TOOL RESPONSE: +--------------------- +{observation} + +USER'S INPUT +-------------------- + +Okay, so what is the response to my last comment? If using information obtained from the tools you must mention it explicitly without mentioning the tool names - I have forgotten all TOOL RESPONSES! Remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else.`;Ul();Dl();yn();var hOn=`Instructions: +-------------- +{instructions} +-------------- +Completion: +-------------- +{completion} +-------------- + +Above, the Completion did not satisfy the constraints given in the Instructions. +Error: +-------------- +{error} +-------------- + +Please try again. Please only respond with an answer that satisfies the constraints laid out in the Instructions:`,Wit=xe.fromTemplate(hOn);function ZOn(t){return t.prompt!==void 0&&t.llm!==void 0}var av=class t extends QI{static lc_name(){return"OutputFixingParser"}static fromLLM(e,n,l){let I=l?.prompt??Wit,a=new ze({llm:e,prompt:I});return new t({parser:n,retryChain:a})}constructor({parser:e,retryChain:n}){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","output_parsers","fix"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.parser=e,this.retryChain=n}async parse(e,n){try{return await this.parser.parse(e,n)}catch(l){if(l instanceof $t){let I={instructions:this.parser.getFormatInstructions(),completion:e,error:l};if(ZOn(this.retryChain)){let c=(await this.retryChain.call(I,n))[this.retryChain.outputKey];return this.parser.parse(c,n)}else return await this.retryChain.invoke(I,{callbacks:n})}throw l}}getFormatInstructions(){return this.parser.getFormatInstructions()}};var vL=class extends li{constructor(e){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","chat_convo"]}),Object.defineProperty(this,"toolNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.toolNames=e.toolNames}async parse(e){let n=e.trim();if(n.includes("```json")||n.includes("```")){let l=n.includes("```json")?"```json":"```",I=n.indexOf(l);if(n.indexOf("action_input")>I){n=n.slice(I+l.length).trimStart();let c=n.lastIndexOf("```");c!==-1&&(n=n.slice(0,c).trimEnd())}}try{let l=JSON.parse(n),{action:I,action_input:a}=l;return I==="Final Answer"?{returnValues:{output:a},log:e}:{tool:I,toolInput:a,log:e}}catch(l){throw new $t(`Failed to parse. Text: "${e}". Error: ${l}`)}}getFormatInstructions(){return Ja($te,"f-string",{tool_names:this.toolNames.join(", ")})}},ZQ=class t extends li{constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","chat_convo"]}),Object.defineProperty(this,"baseParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputFixingParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toolNames",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.toolNames=e.toolNames??this.toolNames,this.baseParser=e?.baseParser??new vL({toolNames:this.toolNames}),this.outputFixingParser=e?.outputFixingParser}getFormatInstructions(e){return e.raw?$te:Ja($te,"f-string",{tool_names:e.toolNames.join(", ")})}async parse(e){return this.outputFixingParser!==void 0?this.outputFixingParser.parse(e):this.baseParser.parse(e)}static fromLLM(e,n){let l=n.baseParser??new vL({toolNames:n.toolNames??[]}),I=av.fromLLM(e,l);return new t({baseParser:l,outputFixingParser:I,toolNames:n.toolNames})}};var WQ=class t extends $m{static lc_name(){return"ChatConversationalAgent"}constructor(e){let n=e.outputParser??t.getDefaultOutputParser();super({...e,outputParser:n}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","chat_convo"]})}_agentType(){return"chat-conversational-react-description"}observationPrefix(){return"Observation: "}llmPrefix(){return"Thought:"}_stop(){return["Observation:"]}static validateTools(e){let n=e.find(l=>!l.description);if(n){let l=`Got a tool ${n.name} without a description. This agent requires descriptions for all tools.`;throw new Error(l)}}async constructScratchPad(e){let n=[];for(let l of e)n.push(new _t(l.action.log)),n.push(new Qn(Ja(ene,"f-string",{observation:l.observation})));return n}static getDefaultOutputParser(e){return e?.llm?ZQ.fromLLM(e.llm,{toolNames:e.toolNames}):new ZQ({toolNames:e?.toolNames})}static createPrompt(e,n){let l=(n?.systemMessage??pit)+hit,I=n?.humanMessage??Zit,a=e.map(o=>`${o.name}: ${o.description}`).join(` +`),c=e.map(o=>o.name),s=(n?.outputParser??t.getDefaultOutputParser({toolNames:c})).getFormatInstructions({toolNames:c}),r=Ja(I,"f-string",{format_instructions:s,tools:a}),u=[kr.fromTemplate(l),new hh("chat_history"),RI.fromTemplate(r),new hh("agent_scratchpad")];return HI.fromMessages(u)}static fromLLMAndTools(e,n,l){t.validateTools(n);let I=l?.outputParser??t.getDefaultOutputParser({llm:e,toolNames:n.map(i=>i.name)}),a=t.createPrompt(n,{...l,outputParser:I}),c=new ze({prompt:a,llm:e,callbacks:l?.callbacks??l?.callbackManager});return new t({llmChain:c,outputParser:I,allowedTools:n.map(i=>i.name)})}};DN();Bo();yn();_N();ep();tp();Dl();TZ();Ul();yn();KN();var Nit="Answer the following questions truthfully and as best you can.",ife=`Output a JSON markdown code snippet containing a valid JSON blob (denoted below by $JSON_BLOB). +This $JSON_BLOB must have a "action" key (with the name of the tool to use) and an "action_input" key (tool input). + +Valid "action" values: "Final Answer" (which you must use when giving your final response to the user), or one of [{tool_names}]. + +The $JSON_BLOB must be valid, parseable JSON and only contain a SINGLE action. Here is an example of an acceptable output: + +\`\`\`json +{{ + "action": $TOOL_NAME, + "action_input": $INPUT +}} +\`\`\` + +Remember to include the surrounding markdown code snippet delimiters (begin with "\`\`\`" json and close with "\`\`\`")! +`,tne=`You have access to the following tools. +You must format your inputs to these tools to match their "JSON schema" definitions below. + +"JSON Schema" is a declarative language that allows you to annotate and validate JSON documents. + +For example, the example "JSON Schema" instance {{"properties": {{"foo": {{"description": "a list of test words", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}}}} +would match an object with one required property, "foo". The "type" property specifies "foo" must be an "array", and the "description" property semantically describes it as "a list of test words". The items within "foo" must be strings. +Thus, the object {{"foo": ["bar", "baz"]}} is a well-formatted instance of this example "JSON Schema". The object {{"properties": {{"foo": ["bar", "baz"]}}}} is not well-formatted. + +Here are the JSON Schema instances for the tools you have access to: + +{tool_schemas} + +The way you use the tools is as follows: + +------------------------ + +${ife} + +If you are using a tool, "action_input" must adhere to the tool's input schema, given above. + +------------------------ + +ALWAYS use the following format: + +Question: the input question you must answer +Thought: you should always think about what to do +Action: +\`\`\`json +$JSON_BLOB +\`\`\` +Observation: the result of the action +... (this Thought/Action/Observation can repeat N times) +Thought: I now know the final answer +Action: +\`\`\`json +{{ + "action": "Final Answer", + "action_input": "Final response to human" +}} +\`\`\``,Vit="Begin! Reminder to ALWAYS use the above format, and to use tools if appropriate.";var fL=class extends li{constructor(e){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","structured_chat"]}),Object.defineProperty(this,"toolNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.toolNames=e.toolNames}async parse(e){try{let l=/```(?:json)?(.*)(```)/gs.exec(e);if(l===null)throw new $t('Could not parse an action. The agent action must be within a markdown code block, and "action" must be a provided tool or "Final Answer"');let I=JSON.parse(l[1].trim()),{action:a,action_input:c}=I;return a==="Final Answer"?{returnValues:{output:c},log:e}:{tool:a,toolInput:c||{},log:e}}catch(n){throw new $t(`Failed to parse. Text: "${e}". Error: ${n}`)}}getFormatInstructions(){return Ja(ife,"f-string",{tool_names:this.toolNames.join(", ")})}},rv=class t extends li{constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","structured_chat"]}),Object.defineProperty(this,"baseParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputFixingParser",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toolNames",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.toolNames=e.toolNames??this.toolNames,this.baseParser=e?.baseParser??new fL({toolNames:this.toolNames}),this.outputFixingParser=e?.outputFixingParser}async parse(e,n){return this.outputFixingParser!==void 0?this.outputFixingParser.parse(e,n):this.baseParser.parse(e)}getFormatInstructions(){return Ja(tne,"f-string",{tool_names:this.toolNames.join(", ")})}static fromLLM(e,n){let l=n.baseParser??new fL({toolNames:n.toolNames??[]}),I=av.fromLLM(e,l);return new t({baseParser:l,outputFixingParser:I,toolNames:n.toolNames})}};var ufe={};Xe(ufe,{renderTextDescription:()=>EB,renderTextDescriptionAndArgs:()=>sfe});DN();tp();ep();function EB(t){return t.every(qm)?t.map(e=>`${e.function.name}${e.function.description?`: ${e.function.description}`:""}`).join(` +`):t.map(e=>`${e.name}: ${e.description}`).join(` +`)}function sfe(t){return t.every(qm)?t.map(e=>`${e.function.name}${e.function.description?`: ${e.function.description}`:""}, args: ${JSON.stringify(e.function.parameters)}`).join(` +`):t.map(e=>{let n=wr(e.schema)?Wl(e.schema):e.schema;return`${e.name}: ${e.description}, args: ${JSON.stringify(n?.properties)}`}).join(` +`)}var dfe={};Xe(dfe,{formatLogToString:()=>JB});function JB(t,e="Observation: ",n="Thought: "){return t.reduce((I,{action:a,observation:c})=>I+[a.log,` +${e}${c}`,n].join(` +`),"")}var cv=class t extends $m{static lc_name(){return"StructuredChatAgent"}constructor(e){let n=e?.outputParser??t.getDefaultOutputParser();super({...e,outputParser:n}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","structured_chat"]})}_agentType(){return"structured-chat-zero-shot-react-description"}observationPrefix(){return"Observation: "}llmPrefix(){return"Thought:"}_stop(){return["Observation:"]}static validateTools(e){let n=e.find(l=>!l.description);if(n){let l=`Got a tool ${n.name} without a description. This agent requires descriptions for all tools.`;throw new Error(l)}}static getDefaultOutputParser(e){return e?.llm?rv.fromLLM(e.llm,{toolNames:e.toolNames}):new rv({toolNames:e?.toolNames})}async constructScratchPad(e){let n=await super.constructScratchPad(e);return n&&`This was your previous work (but I haven't seen any of it! I only see what you return as final answer): +${n}`}static createToolSchemasString(e){return e.map(n=>{let l=wr(n.schema)?Wl(n.schema):n.schema;return`${n.name}: ${n.description}, args: ${JSON.stringify(l?.properties)}`}).join(` +`)}static createPrompt(e,n){let{prefix:l=Nit,suffix:I=Vit,inputVariables:a=["input","agent_scratchpad"],humanMessageTemplate:c=`{input} + +{agent_scratchpad}`,memoryPrompts:i=[]}=n??{},s=[l,tne,I].join(` + +`),r=[new kr(new xe({template:s,inputVariables:a,partialVariables:{tool_schemas:t.createToolSchemasString(e),tool_names:e.map(u=>u.name).join(", ")}})),...i,new RI(new xe({template:c,inputVariables:a}))];return HI.fromMessages(r)}static fromLLMAndTools(e,n,l){t.validateTools(n);let I=t.createPrompt(n,l),a=l?.outputParser??t.getDefaultOutputParser({llm:e,toolNames:n.map(i=>i.name)}),c=new ze({prompt:I,llm:e,callbacks:l?.callbacks});return new t({llmChain:c,outputParser:a,allowedTools:n.map(i=>i.name)})}};async function Yit({llm:t,tools:e,prompt:n,streamRunnable:l}){let I=["tools","tool_names","agent_scratchpad"].filter(r=>!n.inputVariables.includes(r));if(I.length>0)throw new Error(`Provided prompt is missing required input variables: ${JSON.stringify(I)}`);let a=[];if(e.every(qm))a=e.map(r=>r.function.name);else if(e.every(uQ))a=e.map(r=>r.name);else throw new Error("All tools must be either OpenAI or Structured tools, not a mix.");let c=await n.partial({tools:sfe(e),tool_names:a.join(", ")}),i=t.withConfig({stop:["Observation"]});return ob.fromRunnables([Tl.assign({agent_scratchpad:r=>JB(r.steps)}),c,i,rv.fromLLM(t,{toolNames:a})],{name:"StructuredChatAgent",streamRunnable:l,singleAction:!0})}bQ();Bo();_N();Vr();yn();TZ();var git="You are a helpful AI assistant.";Dl();var Gfe={};Xe(Gfe,{OpenAIFunctionsAgentOutputParser:()=>XL,OpenAIToolsAgentOutputParser:()=>CB});Vr();Ul();KN();var XL=class extends li{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","openai"]})}static lc_name(){return"OpenAIFunctionsAgentOutputParser"}async parse(e){throw new Error(`OpenAIFunctionsAgentOutputParser can only parse messages. +Passed input: ${e}`)}async parseResult(e){if("message"in e[0]&&$r(e[0].message))return this.parseAIMessage(e[0].message);throw new Error("parseResult on OpenAIFunctionsAgentOutputParser only works on ChatGeneration output")}parseAIMessage(e){if(e.content&&typeof e.content!="string")throw new Error("This agent cannot parse non-string model responses.");if(e.additional_kwargs.function_call){let n=e.additional_kwargs.function_call;try{let l=n.arguments?JSON.parse(n.arguments):{};return{tool:n.name,toolInput:l,log:`Invoking "${n.name}" with ${n.arguments??"{}"} +${e.content}`,messageLog:[e]}}catch(l){throw new $t(`Failed to parse function arguments from chat model response. Text: "${n.arguments}". ${l}`)}}else return{returnValues:{output:e.content},log:e.content}}getFormatInstructions(){throw new Error("getFormatInstructions not implemented inside OpenAIFunctionsAgentOutputParser.")}};Vr();Ul();KN();var CB=class extends mL{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","openai"]})}static lc_name(){return"OpenAIToolsAgentOutputParser"}async parse(e){throw new Error(`OpenAIFunctionsAgentOutputParser can only parse messages. +Passed input: ${e}`)}async parseResult(e){if("message"in e[0]&&$r(e[0].message))return this.parseAIMessage(e[0].message);throw new Error("parseResult on OpenAIFunctionsAgentOutputParser only works on ChatGeneration output")}parseAIMessage(e){if(e.content&&typeof e.content!="string")throw new Error("This agent cannot parse non-string model responses.");if(e.additional_kwargs.tool_calls){let n=e.additional_kwargs.tool_calls;try{return n.map((l,I)=>{let a=l.function.arguments?JSON.parse(l.function.arguments):{},c=I===0?[e]:[];return{tool:l.function.name,toolInput:a,toolCallId:l.id,log:`Invoking "${l.function.name}" with ${l.function.arguments??"{}"} +${e.content}`,messageLog:c}})}catch(l){throw new $t(`Failed to parse tool arguments from chat model response. Text: "${JSON.stringify(n)}". ${l}`)}}else return{returnValues:{output:e.content},log:e.content}}getFormatInstructions(){throw new Error("getFormatInstructions not implemented inside OpenAIToolsAgentOutputParser.")}};var mfe={};Xe(mfe,{formatForOpenAIFunctions:()=>WOn,formatToOpenAIFunctionMessages:()=>bfe});Vr();yn();function WOn(t){let e=[];for(let n of t)e.push(new _t(n.action.log)),e.push(new Qn(Ja(ene,"f-string",{observation:n.observation})));return e}function bfe(t){return t.flatMap(({action:e,observation:n})=>"messageLog"in e&&e.messageLog!==void 0?e.messageLog.concat(new rG(n,e.tool)):[new _t(e.log)])}function NOn(t){return t.messageLog!==void 0}function VOn(t,e){return NOn(t)&&t.messageLog!==void 0?t.messageLog?.concat(new rG(e,t.tool)):[new _t(t.log)]}function pfe(t){return t.flatMap(({action:e,observation:n})=>VOn(e,n))}var wL=class t extends $m{static lc_name(){return"OpenAIAgent"}_agentType(){return"openai-functions"}observationPrefix(){return"Observation: "}llmPrefix(){return"Thought:"}_stop(){return["Observation:"]}constructor(e){super({...e,outputParser:void 0}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","openai"]}),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputParser",{enumerable:!0,configurable:!0,writable:!0,value:new XL}),this.tools=e.tools}static createPrompt(e,n){let{prefix:l=git}=n||{};return HI.fromMessages([kr.fromTemplate(l),new hh("chat_history"),RI.fromTemplate("{input}"),new hh("agent_scratchpad")])}static fromLLMAndTools(e,n,l){if(t.validateTools(n),e._modelType()!=="base_chat_model"||e._llmType()!=="openai")throw new Error("OpenAIAgent requires an OpenAI chat model");let I=t.createPrompt(n,l),a=new ze({prompt:I,llm:e,callbacks:l?.callbacks});return new t({llmChain:a,allowedTools:n.map(c=>c.name),tools:n})}async constructScratchPad(e){return pfe(e)}async plan(e,n,l){let I=await this.constructScratchPad(e),a={...n,agent_scratchpad:I};this._stop().length!==0&&(a.stop=this._stop());let c=this.llmChain.llm,i={...a},s={functions:this.tools.map(d=>SZ(d))},r="callKeys"in this.llmChain.llm?this.llmChain.llm.callKeys:[];for(let d of r)d in n&&(s[d]=n[d],delete i[d]);let u=await this.llmChain.prompt.formatPromptValue(i),o=await c.invoke(u.toChatMessages(),{...s,callbacks:l});return this.outputParser.parseAIMessage(o)}};async function Rit({llm:t,tools:e,prompt:n,streamRunnable:l}){if(!n.inputVariables.includes("agent_scratchpad"))throw new Error(['Prompt must have an input variable named "agent_scratchpad".',`Found ${JSON.stringify(n.inputVariables)} instead.`].join(` +`));let I=t.bindTools?t.bindTools(e):t.withConfig({functions:e.map(c=>SZ(c))});return ob.fromRunnables([Tl.assign({agent_scratchpad:c=>bfe(c.steps)}),n,I,new XL],{name:"OpenAIFunctionsAgent",streamRunnable:l,singleAction:!0})}Bo();yn();Dl();TZ();var yit=`You are a helpful assistant. Help the user answer any questions. + +You have access to the following tools: + +{tools} + +In order to use a tool, you can use and tags. +You will then get back a response in the form +For example, if you have a tool called 'search' that could run a google search, in order to search for the weather in SF you would respond: + +searchweather in SF +64 degrees + +When you are done, respond with a final answer between . For example: + +The weather in SF is 64 degrees + +Begin! + +Question: {question}`;var hfe={};Xe(hfe,{XMLAgentOutputParser:()=>HL});Ul();KN();var HL=class extends li{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","xml"]})}static lc_name(){return"XMLAgentOutputParser"}async parse(e){if(e.includes("")){let n=e.match(/([^<]*)<\/tool>/),l=n?n[1]:"",I=e.match(/([^<]*?)(?:<\/tool_input>|$)/),a=I?I[1]:"";return{tool:l,toolInput:a,log:e}}else if(e.includes("")){let n=e.match(/([^<]*?)(?:<\/final_answer>|$)/);return{returnValues:{output:n?n[1]:""},log:e}}else throw new $t(`Could not parse LLM output: ${e}`)}getFormatInstructions(){throw new Error("getFormatInstructions not implemented inside OpenAIFunctionsAgentOutputParser.")}};var Wfe={};Xe(Wfe,{formatXml:()=>Zfe});function Zfe(t){let e="";for(let n of t){let{action:l,observation:I}=n;e+=`${l.tool}${l.toolInput} +${I}`}return e}var QL=class t extends qy{static lc_name(){return"XMLAgent"}_agentType(){return"xml"}constructor(e){super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","xml"]}),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputParser",{enumerable:!0,configurable:!0,writable:!0,value:new HL}),this.tools=e.tools,this.llmChain=e.llmChain}get inputKeys(){return["input"]}static createPrompt(){return HI.fromMessages([RI.fromTemplate(yit),Zh.fromTemplate("{intermediate_steps}")])}async plan(e,n,l){let I="";for(let{action:s,observation:r}of e)I+=`${s.tool}${s.toolInput}${r}`;let a="";for(let s of this.tools)a+=`${s.name}: ${s.description} +`;let c={intermediate_steps:I,tools:a,question:n.input,stop:["",""]},i=await this.llmChain.call(c,l);return this.outputParser.parse(i[this.llmChain.outputKey])}static fromLLMAndTools(e,n,l){let I=t.createPrompt(),a=new ze({prompt:I,llm:e,callbacks:l?.callbacks});return new t({llmChain:a,tools:n})}};async function Ait({llm:t,tools:e,prompt:n,streamRunnable:l}){let I=["tools","agent_scratchpad"].filter(s=>!n.inputVariables.includes(s));if(I.length>0)throw new Error(`Provided prompt is missing required input variables: ${JSON.stringify(I)}`);let a=await n.partial({tools:EB(e)}),c=t.withConfig({stop:["",""]});return ob.fromRunnables([Tl.assign({agent_scratchpad:s=>Zfe(s.steps)}),a,c,new HL],{name:"XMLAgent",streamRunnable:l,singleAction:!0})}var Fit=async(t,e,n,l,I)=>{let a=n??"zero-shot-react-description",c=l,i=I;switch(a){case"zero-shot-react-description":return Sc.fromAgentAndTools({agent:ed.fromLLMAndTools(e,t),tools:t,returnIntermediateSteps:!0,verbose:c,callbackManager:i});case"chat-zero-shot-react-description":return Sc.fromAgentAndTools({agent:tA.fromLLMAndTools(e,t),tools:t,returnIntermediateSteps:!0,verbose:c,callbackManager:i});case"chat-conversational-react-description":return Sc.fromAgentAndTools({agent:WQ.fromLLMAndTools(e,t),tools:t,verbose:c,callbackManager:i});default:throw new Error("Unknown agent type")}};async function nne(t,e,n={agentType:e._modelType()==="base_chat_model"?"chat-zero-shot-react-description":"zero-shot-react-description"}){switch(n.agentType){case"zero-shot-react-description":{let{agentArgs:l,tags:I,...a}=n;return Sc.fromAgentAndTools({tags:[...I??[],"zero-shot-react-description"],agent:ed.fromLLMAndTools(e,t,l),tools:t,...a})}case"chat-zero-shot-react-description":{let{agentArgs:l,tags:I,...a}=n;return Sc.fromAgentAndTools({tags:[...I??[],"chat-zero-shot-react-description"],agent:tA.fromLLMAndTools(e,t,l),tools:t,...a})}case"chat-conversational-react-description":{let{agentArgs:l,memory:I,tags:a,...c}=n;return Sc.fromAgentAndTools({tags:[...a??[],"chat-conversational-react-description"],agent:WQ.fromLLMAndTools(e,t,l),tools:t,memory:I??new eA({returnMessages:!0,memoryKey:"chat_history",inputKey:"input",outputKey:"output"}),...c})}case"xml":{let{agentArgs:l,tags:I,...a}=n;return Sc.fromAgentAndTools({tags:[...I??[],"xml"],agent:QL.fromLLMAndTools(e,t,l),tools:t,...a})}case"structured-chat-zero-shot-react-description":{let{agentArgs:l,memory:I,tags:a,...c}=n;return Sc.fromAgentAndTools({tags:[...a??[],"structured-chat-zero-shot-react-description"],agent:cv.fromLLMAndTools(e,t,l),tools:t,memory:I,...c})}case"openai-functions":{let{agentArgs:l,memory:I,tags:a,...c}=n;return Sc.fromAgentAndTools({tags:[...a??[],"openai-functions"],agent:wL.fromLLMAndTools(e,t,l),tools:t,memory:I??new eA({returnMessages:!0,memoryKey:"chat_history",inputKey:"input",outputKey:"output"}),...c})}default:throw new Error("Unknown agent type")}}Vr();var EL=class extends td{constructor(e){super(e),Object.defineProperty(this,"humanPrefix",{enumerable:!0,configurable:!0,writable:!0,value:"Human"}),Object.defineProperty(this,"aiPrefix",{enumerable:!0,configurable:!0,writable:!0,value:"AI"}),Object.defineProperty(this,"llm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"memoryKey",{enumerable:!0,configurable:!0,writable:!0,value:"history"}),Object.defineProperty(this,"maxTokenLimit",{enumerable:!0,configurable:!0,writable:!0,value:12e3}),Object.defineProperty(this,"returnMessages",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output"}),Object.defineProperty(this,"intermediateStepsKey",{enumerable:!0,configurable:!0,writable:!0,value:"intermediateSteps"}),this.humanPrefix=e.humanPrefix??this.humanPrefix,this.aiPrefix=e.aiPrefix??this.aiPrefix,this.llm=e.llm,this.memoryKey=e.memoryKey??this.memoryKey,this.maxTokenLimit=e.maxTokenLimit??this.maxTokenLimit,this.returnMessages=e.returnMessages??this.returnMessages,this.outputKey=e.outputKey??this.outputKey,this.intermediateStepsKey=e.intermediateStepsKey??this.intermediateStepsKey}get memoryKeys(){return[this.memoryKey]}async getMessages(){return this.chatHistory.getMessages()}async loadMemoryVariables(e){let n=await this.getMessages();if(this.returnMessages)return{[this.memoryKey]:n};{let l=mr(n,this.humanPrefix,this.aiPrefix);return{[this.memoryKey]:l}}}async saveContext(e,n){let l=_y(e,this.inputKey),I=iQ(n,this.outputKey);await this.chatHistory.addUserMessage(l);let a=pfe(n[this.intermediateStepsKey]);for(let s of a)await this.chatHistory.addMessage(s);await this.chatHistory.addAIChatMessage(I);let c=await this.chatHistory.getMessages(),i=await this.llm.getNumTokensFromMessages(c);if(i.totalCount>this.maxTokenLimit){let s=[];for(;i.totalCount>this.maxTokenLimit;){let r=c.pop();if(!r){console.warn(`Could not prune enough messages from chat history to stay under ${this.maxTokenLimit} tokens.`);break}s.push(r),i=await this.llm.getNumTokensFromMessages(c)}await this.chatHistory.clear();for(let r of s)await this.chatHistory.addMessage(r)}}};async function vit(t,e,n){let{rememberIntermediateSteps:l=!0,memoryKey:I="chat_history",outputKey:a="output",inputKey:c="input",prefix:i,verbose:s}=n??{},r;return l?r=new EL({memoryKey:I,llm:t,outputKey:a,inputKey:c}):r=new AL({memoryKey:I,llm:t,maxTokenLimit:12e3,returnMessages:!0,outputKey:a,inputKey:c}),await nne(e,t,{agentType:"openai-functions",memory:r,verbose:s,returnIntermediateSteps:l,agentArgs:{prefix:i??"Do your best to answer the questions. Feel free to use any tools available to look up relevant information, only if necessary."}})}mG();bQ();efe();KN();Bo();_N();var Vfe={};Xe(Vfe,{formatToOpenAIToolMessages:()=>JL});Vr();function YOn(t){return new Oo({tool_call_id:t.action.toolCallId,content:t.observation,additional_kwargs:{name:t.action.tool}})}function JL(t){return t.flatMap(({action:e,observation:n})=>"messageLog"in e&&e.messageLog!==void 0?e.messageLog.concat(YOn({action:e,observation:n})):[new _t(e.log)])}TZ();async function fit({llm:t,tools:e,prompt:n,streamRunnable:l}){if(!n.inputVariables.includes("agent_scratchpad"))throw new Error(['Prompt must have an input variable named "agent_scratchpad".',`Found ${JSON.stringify(n.inputVariables)} instead.`].join(` +`));let I=t.bindTools?t.bindTools(e):t.withConfig({tools:e.map(c=>$2(c))});return ob.fromRunnables([Tl.assign({agent_scratchpad:c=>JL(c.steps)}),n,I,new CB],{name:"OpenAIToolsAgent",streamRunnable:l,singleAction:!1})}Bo();TZ();Vr();Ul();KN();function gOn(t){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content),n=[];if(t.tool_calls!==void 0&&t.tool_calls.length>0)n=t.tool_calls;else{if(t.additional_kwargs.tool_calls===void 0||t.additional_kwargs.tool_calls.length===0)return{returnValues:{output:t.content},log:e};for(let l of t.additional_kwargs.tool_calls??[]){let I=l.function?.name;try{let a=JSON.parse(l.function.arguments);n.push({name:I,args:a,id:l.id})}catch(a){throw new $t(`Failed to parse tool arguments from chat model response. Text: "${JSON.stringify(n)}". ${a}`)}}}return n.map((l,I)=>{let a=I===0?[t]:[],c=`Invoking "${l.name}" with ${JSON.stringify(l.args??{})} +${e}`;return{tool:l.name,toolInput:l.args,toolCallId:l.id??"",log:c,messageLog:a}})}var lne=class extends mL{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","tool_calling"]})}static lc_name(){return"ToolCallingAgentOutputParser"}async parse(e){throw new Error(`ToolCallingAgentOutputParser can only parse messages. +Passed input: ${e}`)}async parseResult(e){if("message"in e[0]&&$r(e[0].message))return gOn(e[0].message);throw new Error("parseResult on ToolCallingAgentOutputParser only works on ChatGeneration output")}getFormatInstructions(){throw new Error("getFormatInstructions not implemented inside ToolCallingAgentOutputParser.")}};function ROn(t){let e=t;return typeof e._modelType=="function"&&e._modelType()==="base_chat_model"}function Xit({llm:t,tools:e,prompt:n,streamRunnable:l}){if(!n.inputVariables.includes("agent_scratchpad"))throw new Error(['Prompt must have an input variable named "agent_scratchpad".',`Found ${JSON.stringify(n.inputVariables)} instead.`].join(` +`));let I;if(ROn(t)){if(t.bindTools===void 0)throw new Error('This agent requires that the "bind_tools()" method be implemented on the input model.');I=t.bindTools(e)}else I=t;return ob.fromRunnables([Tl.assign({agent_scratchpad:c=>JL(c.steps)}),n,I,new lne],{name:"ToolCallingAgent",streamRunnable:l,singleAction:!1})}Bo();var Yfe={};Xe(Yfe,{ReActSingleInputOutputParser:()=>LB});yn();Ul();KN();var wit=`Use the following format: + +Question: the input question you must answer +Thought: you should always think about what to do +Action: the action to take, should be one of [{tool_names}] +Action Input: the input to the action +Observation: the result of the action +... (this Thought/Action/Action Input/Observation can repeat N times) +Thought: I now know the final answer +Final Answer: the final answer to the original input question`;var Hit="Final Answer:",yOn="Parsing LLM output produced both a final answer and a parse-able action:",LB=class extends li{constructor(e){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","agents","react"]}),Object.defineProperty(this,"toolNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.toolNames=e.toolNames}async parse(e){let n=e.includes(Hit),l=/Action\s*\d*\s*:[\s]*(.*?)[\s]*Action\s*\d*\s*Input\s*\d*\s*:[\s]*(.*)/,I=e.match(l);if(I){if(n)throw new $t(`${yOn}: ${e}`);let a=I[1],i=I[2].trim().replace(/^"|"$/g,"");return{tool:a,toolInput:i,log:e}}if(n)return{returnValues:{output:e.split(Hit)[1].trim()},log:e};throw new $t(`Could not parse LLM output: ${e}`)}getFormatInstructions(){return Ja(wit,"f-string",{tool_names:this.toolNames.join(", ")})}};TZ();async function Qit({llm:t,tools:e,prompt:n,streamRunnable:l}){let I=["tools","tool_names","agent_scratchpad"].filter(r=>!n.inputVariables.includes(r));if(I.length>0)throw new Error(`Provided prompt is missing required input variables: ${JSON.stringify(I)}`);let a=e.map(r=>r.name),c=await n.partial({tools:EB(e),tool_names:a.join(", ")}),i=t.withConfig({stop:[` +Observation:`]});return ob.fromRunnables([Tl.assign({agent_scratchpad:r=>JB(r.steps)}),c,i,new LB({toolNames:a})],{name:"ReactAgent",streamRunnable:l,singleAction:!0})}var Rfe={};Xe(Rfe,{formatLogToMessage:()=>AOn});Vr();yn();function AOn(t,e="{observation}"){let l=[...e.matchAll(/{([^}]*)}/g)].map(a=>a[1]);if(l.length>1)throw new Error(`templateToolResponse must contain one input variable: ${e}`);let I=[];for(let a of t)I.push(new _t(a.action.log)),I.push(new Qn(Ja(e,"f-string",{[l[0]]:a.observation})));return I}var Afe={};Xe(Afe,{ChainTool:()=>kB,DynamicStructuredTool:()=>TN,DynamicTool:()=>MN,JsonGetValueTool:()=>WL,JsonListKeysTool:()=>ZL,JsonSpec:()=>Tte,ReadFileTool:()=>Ine,RequestsGetTool:()=>VL,RequestsPostTool:()=>YL,StructuredTool:()=>Gm,Tool:()=>$u,VectorStoreQATool:()=>$y,WriteFileTool:()=>ane,formatToOpenAIFunction:()=>SZ,formatToOpenAITool:()=>$2});mG();mG();var yfe={};Xe(yfe,{ChainTool:()=>kB});mG();var kB=class extends MN{static lc_name(){return"ChainTool"}constructor({chain:e,...n}){super({...n,func:async(l,I)=>e.run(l,I?.getChild())}),Object.defineProperty(this,"chain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.chain=e}};ab();mG();var Ine=class extends Gm{static lc_name(){return"ReadFileTool"}constructor({store:e}){super(...arguments),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:St.object({file_path:St.string().describe("name of file")})}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"read_file"}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:"Read file from disk"}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.store=e}async _call({file_path:e}){return await this.store.readFile(e)}},ane=class extends Gm{static lc_name(){return"WriteFileTool"}constructor({store:e,...n}){super(n),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:St.object({file_path:St.string().describe("name of file"),text:St.string().describe("text to write to file")})}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"write_file"}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:"Write file from disk"}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.store=e}async _call({file_path:e,text:n}){return await this.store.writeFile(e,n),"File written to successfully."}};_N();ep();tp();var Ffe={};Xe(Ffe,{createRetrieverTool:()=>FOn});ab();mG();function FOn(t,e){let n=async({query:I},a)=>{let c=await t.getRelevantDocuments(I,a?.getChild("retriever"));return pQ(c)},l=St.object({query:St.string().describe("query to look up in retriever")});return new TN({...e,func:n,schema:l})}var GHe={};Xe(GHe,{APIChain:()=>bL,AnalyzeDocumentChain:()=>zB,BaseChain:()=>cn,ChatVectorDBQAChain:()=>xB,ConstitutionalChain:()=>MB,ConstitutionalPrinciple:()=>Bt,ConversationChain:()=>nA,ConversationalRetrievalQAChain:()=>SB,LLMChain:()=>ze,LLMRouterChain:()=>bA,MapReduceDocumentsChain:()=>lg,MultiPromptChain:()=>RS,MultiRetrievalQAChain:()=>yS,MultiRouteChain:()=>GA,OpenAIModerationChain:()=>YS,PRINCIPLES:()=>CL,RefineDocumentsChain:()=>Ig,RetrievalQAChain:()=>iv,RouterChain:()=>KQ,SequentialChain:()=>nv,SimpleSequentialChain:()=>dL,StuffDocumentsChain:()=>Rh,TransformChain:()=>AS,VectorDBQAChain:()=>lv,convertOpenAPISpecToOpenAIFunctions:()=>Ile,createExtractionChain:()=>Jk,createExtractionChainFromZod:()=>FS,createOpenAPIChain:()=>JS,createTaggingChain:()=>Qv,createTaggingChainFromZod:()=>vS,loadQAChain:()=>XB,loadQAMapReduceChain:()=>Jte,loadQARefineChain:()=>Cte,loadQAStuffChain:()=>ag,loadSummarizationChain:()=>Xfe});fo();Dl();$ve();yn();Dl();var vfe=`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. + +Current conversation: +{history} +Human: {input} +AI:`,nA=class extends ze{static lc_name(){return"ConversationChain"}constructor({prompt:e,outputKey:n,memory:l,...I}){super({prompt:e??new xe({template:vfe,inputVariables:["history","input"]}),outputKey:n??"response",memory:l??new eA,...I})}};fB();GQ();yn();fo();Dl();GL();var vOn=`Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question. + +Chat History: +{chat_history} +Follow Up Input: {question} +Standalone question:`,fOn=`Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. + +{context} + +Question: {question} +Helpful Answer:`,xB=class t extends cn{get inputKeys(){return[this.inputKey,this.chatHistoryKey]}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"k",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"question"}),Object.defineProperty(this,"chatHistoryKey",{enumerable:!0,configurable:!0,writable:!0,value:"chat_history"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"result"}),Object.defineProperty(this,"vectorstore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"combineDocumentsChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"questionGeneratorChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"returnSourceDocuments",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.vectorstore=e.vectorstore,this.combineDocumentsChain=e.combineDocumentsChain,this.questionGeneratorChain=e.questionGeneratorChain,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.k=e.k??this.k,this.returnSourceDocuments=e.returnSourceDocuments??this.returnSourceDocuments}async _call(e,n){if(!(this.inputKey in e))throw new Error(`Question key ${this.inputKey} not found.`);if(!(this.chatHistoryKey in e))throw new Error(`chat history key ${this.inputKey} not found.`);let l=e[this.inputKey],I=e[this.chatHistoryKey],a=l;if(I.length>0){let r=await this.questionGeneratorChain.call({question:l,chat_history:I},n?.getChild("question_generator")),u=Object.keys(r);if(console.log("_call",e,u),u.length===1)a=r[u[0]];else throw new Error("Return from llm chain has multiple values, only single values supported.")}let c=await this.vectorstore.similaritySearch(a,this.k,void 0,n?.getChild("vectorstore")),i={question:a,input_documents:c,chat_history:I},s=await this.combineDocumentsChain.call(i,n?.getChild("combine_documents"));return this.returnSourceDocuments?{...s,sourceDocuments:c}:s}_chainType(){return"chat-vector-db"}static async deserialize(e,n){if(!("vectorstore"in n))throw new Error("Need to pass in a vectorstore to deserialize VectorDBQAChain");let{vectorstore:l}=n;return new t({combineDocumentsChain:await cn.deserialize(e.combine_documents_chain),questionGeneratorChain:await ze.deserialize(e.question_generator),k:e.k,vectorstore:l})}serialize(){return{_type:this._chainType(),combine_documents_chain:this.combineDocumentsChain.serialize(),question_generator:this.questionGeneratorChain.serialize(),k:this.k}}static fromLLM(e,n,l={}){let{questionGeneratorTemplate:I,qaTemplate:a,verbose:c,...i}=l,s=xe.fromTemplate(I||vOn),r=xe.fromTemplate(a||fOn),u=ag(e,{prompt:r,verbose:c}),o=new ze({prompt:s,llm:e,verbose:c});return new this({vectorstore:n,combineDocumentsChain:u,questionGeneratorChain:o,...i})}};fo();var ffe={};Xe(ffe,{CharacterTextSplitter:()=>jB,LatexTextSplitter:()=>UB,MarkdownTextSplitter:()=>OB,RecursiveCharacterTextSplitter:()=>PN,SupportedTextSplitterLanguages:()=>XOn,TextSplitter:()=>ov,TokenTextSplitter:()=>NQ});tte();var ov=class extends lL{constructor(e){if(super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain","document_transformers","text_splitters"]}),Object.defineProperty(this,"chunkSize",{enumerable:!0,configurable:!0,writable:!0,value:1e3}),Object.defineProperty(this,"chunkOverlap",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(this,"keepSeparator",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"lengthFunction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.chunkSize=e?.chunkSize??this.chunkSize,this.chunkOverlap=e?.chunkOverlap??this.chunkOverlap,this.keepSeparator=e?.keepSeparator??this.keepSeparator,this.lengthFunction=e?.lengthFunction??(n=>n.length),this.chunkOverlap>=this.chunkSize)throw new Error("Cannot have chunkOverlap >= chunkSize")}async transformDocuments(e,n={}){return this.splitDocuments(e,n)}splitOnSeparator(e,n){let l;if(n)if(this.keepSeparator){let I=n.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&");l=e.split(new RegExp(`(?=${I})`))}else l=e.split(n);else l=e.split("");return l.filter(I=>I!=="")}async createDocuments(e,n=[],l={}){let I=n.length>0?n:[...Array(e.length)].map(()=>({})),{chunkHeader:a="",chunkOverlapHeader:c="(cont'd) ",appendChunkOverlapHeader:i=!1}=l,s=new Array;for(let r=0;rN){let H=this.numberOfNewLines(u,N,v);o-=H}i&&(Z+=c)}let g=this.numberOfNewLines(h),y=I[r].loc&&typeof I[r].loc=="object"?{...I[r].loc}:{};y.lines={from:o,to:o+g};let X={...I[r],loc:y};Z+=h,s.push(new WI({pageContent:Z,metadata:X})),o+=g,d=h,b=N}}return s}numberOfNewLines(e,n,l){return(e.slice(n,l).match(/\n/g)||[]).length}async splitDocuments(e,n={}){let l=e.filter(c=>c.pageContent!==void 0),I=l.map(c=>c.pageContent),a=l.map(c=>c.metadata);return this.createDocuments(I,a,n)}joinDocs(e,n){let l=e.join(n).trim();return l===""?null:l}async mergeSplits(e,n){let l=[],I=[],a=0;for(let i of e){let s=await this.lengthFunction(i);if(a+s+I.length*n.length>this.chunkSize&&(a>this.chunkSize&&console.warn(`Created a chunk of size ${a}, + +which is longer than the specified ${this.chunkSize}`),I.length>0)){let r=this.joinDocs(I,n);for(r!==null&&l.push(r);a>this.chunkOverlap||a+s+I.length*n.length>this.chunkSize&&a>0;)a-=await this.lengthFunction(I[0]),I.shift()}I.push(i),a+=s}let c=this.joinDocs(I,n);return c!==null&&l.push(c),l}},jB=class extends ov{static lc_name(){return"CharacterTextSplitter"}constructor(e){super(e),Object.defineProperty(this,"separator",{enumerable:!0,configurable:!0,writable:!0,value:` + +`}),this.separator=e?.separator??this.separator}async splitText(e){let n=this.splitOnSeparator(e,this.separator);return this.mergeSplits(n,this.keepSeparator?"":this.separator)}},XOn=["cpp","go","java","js","php","proto","python","rst","ruby","rust","scala","swift","markdown","latex","html","sol"],PN=class t extends ov{static lc_name(){return"RecursiveCharacterTextSplitter"}constructor(e){super(e),Object.defineProperty(this,"separators",{enumerable:!0,configurable:!0,writable:!0,value:[` + +`,` +`," ",""]}),this.separators=e?.separators??this.separators,this.keepSeparator=e?.keepSeparator??!0}async _splitText(e,n){let l=[],I=n[n.length-1],a;for(let r=0;r","
","

","
","

  • ","

    ","

    ","

    ","

    ","

    ","
    ","","","","
    ","","
      ","
        ","
        ","